eis/eqpalg/algs/exp_times.h
Huamonarch 224c2c45c4 Remove irrelevant comments from eqpalg source files
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
2026-05-09 13:30:09 +08:00

70 lines
1.5 KiB
C++

#pragma once
/**
* @file exp_times.h
* @brief 持续时间统计,出现次数统计
* exp_type_ 6/7
* 6——累计时间
* 7——出现次数
* @author your name (you@domain.com)
* @version 0.1
* @date 2023-12-15
*
* Copyright: Baosight Co. Ltd.
* DO NOT COPY/USE WITHOUT PERMISSION
*
*/
#include <eqpalg/algs/exp_base.h>
class ExpTimes : public ExpBase {
public:
ExpTimes(const string& name, const mix_cc::json& rule_json,
const string& ruleId, size_t exp_type);
~ExpTimes() override;
virtual AlarmInfo mon_proc() override;
virtual int init() override;
/**
* @brief 重写 清除历史记录
*/
virtual void reset_dev_data() override;
protected:
double max_time_ = 0;
int64_t max_times_ = 0;
int rw_time_ = 10;
int wait_flag_ = 0;
protected:
/**
* @brief 保持时间/出现次数 更新
* @return int
*/
int update_times();
/**
* @brief 检查是否报警
* @return true
* @return false
*/
bool check_alarm();
/**
* @brief 载入报警阈值
* @return int
*/
int reload_params();
/**
* @brief 查数据库 t_rule_sample_1d_approximate 表
* @return int
*/
int get_history_times();
/**
* @brief 更新数据库 t_rule_sample_1d_approximate 表
* @return int
*/
int update_history_times();
/**
* @brief 插入数据库t_rule_sample_1d_approximate 表
* @param now_times My Param doc
* @param now_used_time My Param doc
* @return int
*/
int insert_history_times(int64_t now_times, double now_used_time);
};