diff --git a/eqpalg/algs/bound_alg.cpp b/eqpalg/algs/bound_alg.cpp index 8f78086..7321e0a 100644 --- a/eqpalg/algs/bound_alg.cpp +++ b/eqpalg/algs/bound_alg.cpp @@ -28,7 +28,7 @@ void BoundAlg::doInitExtend() { } bool BoundAlg::checkFilter() { - if (!expr_engine_->exps_.count("feedback")) { + if (!expr_engine_->hasExpression("feedback")) { return true; // 无筛选表达式,所有数据参与 } try { diff --git a/eqpalg/algs/exp_bound.cpp b/eqpalg/algs/exp_bound.cpp index 66e8355..a1a18a2 100644 --- a/eqpalg/algs/exp_bound.cpp +++ b/eqpalg/algs/exp_bound.cpp @@ -1,8 +1,8 @@ -#include "mix_cc/ihyper_db.h" +#include #include #include -#include > +#include #include #include #include @@ -23,7 +23,7 @@ int ExpBound::init() { res += this->reload_config_data_source(); /*3.数据源*/ logger_->Debug() << "数据来源,0:iHyperDB,1:memory:" << this->data_source_ << ",单位unit_:" << unit_ << std::endl; - 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_; rule_stat_.limit_down = -32768; diff --git a/eqpalg/utility/expression_engine.h b/eqpalg/utility/expression_engine.h index 293aa56..26b0957 100644 --- a/eqpalg/utility/expression_engine.h +++ b/eqpalg/utility/expression_engine.h @@ -56,6 +56,9 @@ public: */ int registerRawExpression(const std::string& name, const std::string& raw_exp_str); + /** 查询表达式是否已注册 */ + bool hasExpression(const std::string& name) const { return exps_.count(name) > 0; } + // ========== 表达式求值 ========== double evaluate(const std::string& name);