71 lines
1.6 KiB
C++
71 lines
1.6 KiB
C++
/******************************************************************************************************************
|
|
* 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_STAT_H
|
|
#define _H_ALGORITHM_EXPRESSION_STAT_H
|
|
|
|
#include <eqpalg/AlgCommonDefine.h>
|
|
#include <eqpalg/AlgorithmBase.h>
|
|
#include <glob/MathExpression.h>
|
|
#include <zcus/IHDBTools.h>
|
|
#include <string>
|
|
#include <iostream>
|
|
#include <iomanip>
|
|
|
|
|
|
|
|
class AlgExpStat:virtual public AlgorithmBase
|
|
{
|
|
public:
|
|
AlgExpStat(const string name,const Json::Value rulejson, const string ruleid);
|
|
|
|
virtual ~AlgExpStat();
|
|
|
|
public:
|
|
|
|
virtual int Reload();
|
|
virtual int calculate(string& outjson);
|
|
|
|
private:
|
|
|
|
int calculate_once(string& outjson);
|
|
|
|
void freeDB3Record();
|
|
|
|
int queryDB3Record();
|
|
|
|
private:
|
|
MathExpression* mp_expact;
|
|
MathExpression* mp_expfbk;
|
|
MathExpression* mp_expret;
|
|
std::map<std::string, double> mm_vars;
|
|
|
|
private:
|
|
IHDBTools* mp_ihdb;
|
|
int m_datasource; // 0:iHyerDB,1:memory
|
|
int m_modest; // 0:history,1:cycle
|
|
HD3Record* mp_hdRec;
|
|
string m_expstr;
|
|
bool m_keep;
|
|
bool m_timemode;
|
|
long long m_btime;
|
|
|
|
private:
|
|
bool expact;
|
|
bool expfbk;
|
|
bool expret;
|
|
|
|
private:
|
|
HD3TimeRegion m_timeRegion;
|
|
HD3Record **mp_recordsQueried;
|
|
long long m_start, m_end;
|
|
};
|
|
|
|
#endif
|