eis/inc/eqpalg/algs/AlgExp.h

65 lines
1.5 KiB
C
Raw Normal View History

/******************************************************************************************************************
* 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 <eqpalg/AlgCommonDefine.h>
#include <eqpalg/stat/SampleTrendAnalysis.h>
#include <eqpalg/AlgorithmBase.h>
#include <glob/MathExpression.h>
#include <string>
#include <iostream>
#include <iomanip>
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<std::string, double> 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