Cleaned 66 files across all eqpalg subdirectories: - Removed commented-out dead code - Removed redundant Chinese inline comments that restate variable/function names - Removed trailing ///< annotations on self-explanatory fields - Removed namespace closing comments - Preserved all file headers, Doxygen documentation, and logic explanations - No code changes — only comment removal
67 lines
1.4 KiB
C++
67 lines
1.4 KiB
C++
#pragma once
|
|
/**
|
|
* @file fault_code.h
|
|
* @brief 故障代码解析
|
|
*
|
|
* @author your name (you@domain.com)
|
|
* @version 0.1
|
|
* @date 2024-03-04
|
|
*
|
|
* Copyright: Baosight Co. Ltd.
|
|
* DO NOT COPY/USE WITHOUT PERMISSION
|
|
*
|
|
*/
|
|
#include <eqpalg/alg_base.h>
|
|
|
|
class FaultCode : public AlgBase {
|
|
public:
|
|
FaultCode(const string name, const mix_cc::json& rule_json,
|
|
const string ruleId,size_t code_type);
|
|
|
|
~FaultCode() override;
|
|
|
|
public:
|
|
int init() override;
|
|
/**
|
|
* @brief 执行函数
|
|
* @return AlarmInfo
|
|
*/
|
|
AlarmInfo exec_mon() override;
|
|
/**
|
|
* @brief 单次执行
|
|
* @param time_range My Param doc
|
|
* @return std::vector<AlarmInfo>
|
|
*/
|
|
std::vector<AlarmInfo> exec_task(mix_cc::time_range_t time_range) override;
|
|
|
|
protected:
|
|
/**
|
|
* @brief 取位函数
|
|
* 获取 value的第sub位
|
|
* @tparam T
|
|
* @param value 数据
|
|
* @param sub 第sub位
|
|
* @return T 0或1
|
|
*/
|
|
template <typename T>
|
|
T static gitbit(T value, T sub) {
|
|
return int(value) >> int(sub) & 1;
|
|
};
|
|
/**
|
|
* @brief
|
|
* @return true
|
|
* @return false
|
|
*/
|
|
int select_t_lov_fcode();
|
|
|
|
protected:
|
|
const size_t code_type_;
|
|
struct FaultCodeInfo {
|
|
bool is_usable = false;
|
|
std::string name;
|
|
std::string content;
|
|
};
|
|
std::map<int, FaultCodeInfo> map2fcode_;
|
|
std::string alarm_content_;
|
|
bool is_valid_ = false;
|
|
}; |