/****************************************************************************************************************** * Action instruction algorithm * * arg[0] data determination expression * * * * 1.0 2020-12-17 zoufuzhou ******************************************************************************************************************/ #ifndef _H_ALGORITHM_EXPRESSION_H #define _H_ALGORITHM_EXPRESSION_H #include #include #include #include #include #include #include class AlgExp:virtual public AlgorithmBase { public: AlgExp(const string& name,const Json::Value& rulejson, const string& ruleid,IHDBTools* ihdbtool); virtual ~AlgExp(); public: virtual int Reload(); virtual int calculate(string& outjson); protected: virtual void PrintExpVar(const string& expstr = ""); protected: MathExpression* mp_expret; std::map mm_vars; int m_datasource; // 0:iHyerDB,1:memory int m_modest; // 0:history,1:cycle int m_modejudge; // 0: absolute difference, 1: error percentage (%), 2: normal value signal (%) string m_expstr; bool m_keep; bool m_timemode; double m_samplediff; int m_archive; protected: bool expact; bool expfbk; bool expret; protected: SampleTrendAnalysis* mp_sample; }; #endif