/****************************************************************************************************************** * Action instruction algorithm * * arg[0] action expression * arg[1] feedback expression * arg[2] expression of judgment result * * 1.0 2020-12-17 zoufuzhou ******************************************************************************************************************/ #ifndef _H_ALGORITHM_EXPRESSION_DELAY_H #define _H_ALGORITHM_EXPRESSION_DELAY_H #include #include #include #include #include class AlgExpDelay : virtual public AlgExp { public: AlgExpDelay(const string &name, const Json::Value &rulejson, const string &ruleid, IHDBTools *ihdb); virtual ~AlgExpDelay(); public: virtual int Reload(); virtual int calculate(string &outjson); private: int calculate_once(string &outjson); private: MathExpression *exp_act_; MathExpression *exp_feedback_; bool result_exp_act_ = false; bool result_exp_feedback_ = false; bool prev_calc_result_; bool keep_act_; unsigned long act_feedback_time_; unsigned long long begin_time_; unsigned long long end_time_; }; #endif