105 lines
3.4 KiB
C
105 lines
3.4 KiB
C
|
|
/**
|
|||
|
|
@file AiProcess.h
|
|||
|
|
@brief 模拟量数据处理实现类头文件
|
|||
|
|
@author 周正龙
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#pragma once
|
|||
|
|
|
|||
|
|
|
|||
|
|
#include "MixStructDefine.h"
|
|||
|
|
#include "CommStructDefine.h"
|
|||
|
|
|
|||
|
|
#include "service/common/RdbTableDefine.h"
|
|||
|
|
#include "service/common/CommonDefine.h"
|
|||
|
|
#include "rdb_api/RdbTableMng.h"
|
|||
|
|
|
|||
|
|
#include "data_process_api/DataProcessApi.h"
|
|||
|
|
|
|||
|
|
#include "PointBase.h"
|
|||
|
|
|
|||
|
|
namespace kbd_service
|
|||
|
|
{
|
|||
|
|
class CMixProcess :public CPointBase
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
CMixProcess(kbd_public::SRunAppInfo stRunAppInfo,\
|
|||
|
|
CDataProcessApiPtr ptrDataProcApi,\
|
|||
|
|
CSrvDataPublishPtr ptrDataPublish);
|
|||
|
|
~CMixProcess();
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
SSysInfo m_stSysInfo;
|
|||
|
|
int64 m_lCurTime;
|
|||
|
|
|
|||
|
|
std::string m_strSourceTagLocal;
|
|||
|
|
std::string m_strSrcTagRecv;
|
|||
|
|
std::string m_strSourceTag;
|
|||
|
|
|
|||
|
|
SChangeMixInfo m_stChangeMixInfo;
|
|||
|
|
bool m_bIsMiGkOff ;
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
/**
|
|||
|
|
@brief ANN 处理类初始化
|
|||
|
|
@param 无
|
|||
|
|
@return 成功 true 失败 false
|
|||
|
|
@retval
|
|||
|
|
*/
|
|||
|
|
bool initialize();
|
|||
|
|
/**
|
|||
|
|
@brief 执行业务进程前执行内容
|
|||
|
|
@param 无
|
|||
|
|
@return 成功 true 失败 false
|
|||
|
|
@retval
|
|||
|
|
*/
|
|||
|
|
int initPara();
|
|||
|
|
/**
|
|||
|
|
@brief 变化模拟量处理函数
|
|||
|
|
@param chgAiPkg 变化数据包结构体
|
|||
|
|
@return 成功 true 失败 false
|
|||
|
|
@retval
|
|||
|
|
*/
|
|||
|
|
int procMixChange(const kbd_idlfile::SFesChangeMiPkg &stFesChgMixPkg);
|
|||
|
|
/**
|
|||
|
|
@brief 模拟量全数据处理函数
|
|||
|
|
@param chgAiPkg 变化数据包结构体
|
|||
|
|
@return 成功 true 失败 false
|
|||
|
|
@retval
|
|||
|
|
*/
|
|||
|
|
int procMixUpdate(const kbd_idlfile::SFesUpdateMiPkg &stFesUpMixPkg);
|
|||
|
|
/**
|
|||
|
|
@brief 置数、取消置数、取消禁止刷新处理
|
|||
|
|
@param stOptSetDataPkg OPT设置结构体
|
|||
|
|
@return 成功 true 失败 false
|
|||
|
|
*/
|
|||
|
|
int processOperate(const kbd_idlfile::SOptSetDataPkg &stOptSetDataPkg,const int nOperateType);
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
//AI/AO
|
|||
|
|
//==========================================================================================
|
|||
|
|
void initChangeMixInfo();
|
|||
|
|
bool checkNewValue(const int &newValue);
|
|||
|
|
//bool findAoCtrl(const char *strPointName, const float &fCurValue, const int &nReportType);
|
|||
|
|
|
|||
|
|
//Mix
|
|||
|
|
//==========================================================================================
|
|||
|
|
int getMixAlarmDesc(std::string &strAlarm,const std::string &strTagName,const std::string& strDevTagName,\
|
|||
|
|
const std::string& strStatusText,const int nDescFlag= ALARM_DESC_POINT_FLAG);
|
|||
|
|
int procOneMixChange( SChangeMixData &stChangeMixData, const int nUpdataType, const int nOptType,
|
|||
|
|
SMiOldValueStatus &stMiOldValueStatus, SMiNewValueStatus &stMiNewValueStatus,const bool bInit = false);
|
|||
|
|
int writeMixRtdb(const SChangeMixData &stChangeMixData,\
|
|||
|
|
SMiOldValueStatus &stMiOldValueStatus, SMiNewValueStatus &stMiNewValueStatus,\
|
|||
|
|
int nRawValue, time_t occurTime, char updateType, SDigAlarmPara &stDigAlmPara, int nDomain);
|
|||
|
|
int doMixMethod(const std::string &method, const int &nRawValue, int &fTransValue);
|
|||
|
|
|
|||
|
|
|
|||
|
|
//Other;
|
|||
|
|
//==========================================================================================
|
|||
|
|
int writeRdbAndSendMsg(const SChangeMixData &stChangeMixData , int nStyle);
|
|||
|
|
void initMixValueStatus(SMiOldValueStatus &stMiOldValueStatus, SMiNewValueStatus &stMiNewValueStatus);
|
|||
|
|
};
|
|||
|
|
typedef boost::shared_ptr<CMixProcess> CMixProcessPtr;
|
|||
|
|
}
|