fix: 清理 ExpBase 子类中残留的旧方法调用(first_fill_mm_vars/print_exp_vars/refresh_exp_vars_ihd/act_triggered_)

This commit is contained in:
Huamonarch 2026-05-15 16:07:13 +08:00
parent 43c545eea3
commit ba0bf8ce21
6 changed files with 9 additions and 8 deletions

View File

@ -70,7 +70,7 @@ AlarmInfo ExpBound::mon_proc() {
std::string msg = "";
msg = error_str_ + ",当前值:" + DAA::double2str(now_value) + unit_ + ",超";
auto alarm_time = get_alarm_time();
print_exp_vars();
expr_engine_->printVars();
if (now_value > limit_error_) {
msg += "报警值:" + DAA::double2str(limit_error_) + unit_;

View File

@ -32,7 +32,7 @@ int ExpSample2D::init() {
// 重新载入数据源配置信息
ret += this->reload_config_data_source();
// 在载入数据源信息完成后载入表达式配置之前必须刷新变量把变量信息初始化到mm_vars内
ret += this->first_fill_mm_vars();
ret += expr_engine_->firstFill(data_source_, now_time_, query_time_range_);
// 必须在刷新变量后,才可以初始化表达式
ret += this->reload_config_exp_act();
ret += this->reload_samples();
@ -421,7 +421,7 @@ void ExpSample2D::task_mon_pro() {
logger_->Debug() << rule_name_ << ",data_len_:" << data_len_
<< ",ihd size:" << queried_data_.size() << endl;
for (auto i = 0; i < queried_data_.rows(); i++) {
refresh_exp_vars_ihd(i);
expr_engine_->refreshFromIhdRow(i, queried_data_, queried_time_, now_time_, query_time_range_);
if (data_len_ < MAX_STORAGE_SIZE) {
if (expr_engine_->evaluateBool("act")) {
SampleX_.push_back(expr_engine_->evaluate("sample_X"));

View File

@ -76,7 +76,7 @@ int ExpTimes::init() {
ret += AlgBase::init(); /*1.tag点2执行时间间隔和上次执行时间点*/
ret += reload_config_data_source(); /*载入数据源0——ihd1——内存*/
if (glob_process_type == ProcessType::kMon) {
ret += this->first_fill_mm_vars(); /*4.数据项*/
ret += expr_engine_->firstFill(data_source_, now_time_, query_time_range_); /*4.数据项*/
}
// 必须在刷新变量后,才可以初始化表达式
ret += this->reload_config_exp_act(); /*表达式*/

View File

@ -33,6 +33,7 @@ class ExpTimes : public ExpBase {
int64_t max_times_ = 0;
int rw_time_ = 10;
int wait_flag_ = 0;
bool act_triggered_ = false; // ExpTimes 独立使用,非反馈状态机
protected:
/**

View File

@ -25,7 +25,7 @@ int Roller2::init() {
return -1;
}
}
res += this->first_fill_mm_vars();
res += expr_engine_->firstFill(data_source_, now_time_, query_time_range_);
res += this->reload_config_data_source(); /*3.数据源*/
res += init_X_exp();

View File

@ -36,7 +36,7 @@ int Roller3::init() {
res += this->reload_config_data_source(); /*3.数据源*/
res += this->first_fill_mm_vars(); /*4.数据项*/
res += expr_engine_->firstFill(data_source_, now_time_, query_time_range_); /*4.数据项*/
res += init_X_exp();
rule_stat_.unit = unit_;
@ -134,7 +134,7 @@ AlarmInfo Roller3::mon_proc() {
DAA::double2strLimit(rule_stat_.limit_down, 3) + "," +
DAA::double2strLimit(rule_stat_.limit_up, 3) + "]" + unit_;
auto alarm_time = get_alarm_time();
print_exp_vars();
expr_engine_->printVars();
logger_->Debug() << " median_:" << median_ << ",maxIndexValue:["
<< maxIndexValue.first << "," << maxIndexValue.second
<< "]," << msg << endl;
@ -184,7 +184,7 @@ AlarmInfo Roller3::mon_proc() {
}
if (!msg.empty()) {
auto alarm_time = get_alarm_time();
print_exp_vars();
expr_engine_->printVars();
logger_->Debug() << " median_:" << median_ << ",maxIndexValue:["
<< maxIndexValue.first << "," << maxIndexValue.second
<< "]," << msg << endl;