HM-SPMS/product/src/service/calc_server/CalcServerCommon.h

52 lines
2.1 KiB
C
Raw Normal View History

/**
*@file CalcServerCommon.h
*@brief
*@author
*@date 2018-11-12
*/
#pragma once
#include "CalcOutParaTable.h"
#include "map"
#include "pub_lua_engine_api/LuaEngineInterface.h"
#include "CalcDefTable.h"
#include "CalcInParaTable.h"
//#include "../data_process/DataProcessDefine.h"
#include "service/common/RdbTableDefine.h"
namespace kbd_service {
const std::string CN_ProcName_CalcServer="calc_server";//当前进程名
typedef kbd_public::LuaVariantType ValueType;
#define VALUE ".value"
#define STATUS ".status"
typedef struct _SOutPointInfo
{
std::string stTag; //标签
std::string value; //值
int nvalid; //是否有效
uint64 nTime; //上次发送时间
_SOutPointInfo() {
value = "";
nvalid = 0;
nTime = 0;
}
}SOutPointInfo,*PSOutPointInfo;
typedef struct _SInPointInfo
{
ValueType value; //值
uint64 nStatus; //状态
uint64 nTime; //上次发送时间
_SInPointInfo() {}
}SInPointInfo,*PSInPointInfo;
typedef std::map<std::string,std::map<int ,std::string> > CalcInParaMAP; //保存输入输出的配置 ,以及每个输出对应的所有输入<输出标签,<序号,输入标签>>
typedef std::map<std::string,SInPointInfo> SInPointInfoMap; //用来保存接收到的点的值和状态
typedef std::map<std::string,STableCalcOutPara> CalcOutParaMAP; //保存输出的配置
typedef std::map<std::string,STableCalcDef> CalDefMAP; //保存函数配置 map<key,value> key为函数名 value为函数结构体
typedef std::map<std::string,SOutPointInfo> SOutPointInfoMap; //用来保存输出点上次的值和状态 <标签,点信息>
typedef std::map<std::string,std::vector<std::string> > SInOutVecMap; //保存输入和输出的映射 一对多
} //namespace kbd_service