101 lines
2.3 KiB
C++
101 lines
2.3 KiB
C++
/*********************************************************************
|
||
*
|
||
* 文 件: Snapshot.h 启动文件
|
||
*
|
||
* 版权所有: Shanghai Baosight Software Co., Ltd.
|
||
*
|
||
* 概述://TODO请添加本文件包含功能详细描述
|
||
* ://TODO
|
||
* ://TODO
|
||
*
|
||
* 版本历史
|
||
* %USER%
|
||
*********************************************************************/
|
||
#ifndef __SNAPSHOT_h__
|
||
#define __SNAPSHOT_h__
|
||
|
||
#include <proxy/MessageICE.h>
|
||
#include <tag/Tag.h>
|
||
#include <zhd/data_types.h>
|
||
#include <zhd/error_code.h>
|
||
#include <zhd/hd3Enum.h>
|
||
#include <zhd/hd3MaskDefine.h>
|
||
#include <zhd/hd3Struct.h>
|
||
#include <zhd/hdKingAPI.h>
|
||
#include <zhd/IhyperDBcommon.h>
|
||
#include <glob/BinaryTele.h>
|
||
|
||
|
||
namespace baosight
|
||
{
|
||
const int IHD_SIZE_MAX = 10000;
|
||
struct IHD_TAGID{
|
||
int size;
|
||
unsigned int tagID[IHD_SIZE_MAX];
|
||
};
|
||
class Snapshot
|
||
{
|
||
public:
|
||
Snapshot();
|
||
virtual ~Snapshot();
|
||
public:
|
||
|
||
virtual int Dispatch(int eventNo,const ::Ice::ByteSeq& seq) = 0;
|
||
|
||
protected:
|
||
|
||
virtual int CacheCase(int eventNo, const char* seq) = 0;
|
||
|
||
virtual int StatCase(int eventNo, const char* seq) = 0;
|
||
|
||
virtual int TeleCase(int eventNo, const char* seq) = 0;
|
||
|
||
virtual int iMultiLinkCase(int eventNo, const char* seq) = 0;
|
||
|
||
protected:
|
||
|
||
int ConnectDB();
|
||
|
||
void DisConnectDB(int retcode);
|
||
|
||
int SnapShotLocal(int eventNo, int tagitemcount, bool isArchiving);
|
||
|
||
int GetTagIDs(int eventNo,bool isArchiving = true);
|
||
|
||
int IDBStorage(TeleItem &item, int tagItemCount, bool Statcase = 0, float value=0);
|
||
|
||
int IDBStorage(char type, int tagItemCount, const string& value);
|
||
|
||
|
||
protected:
|
||
|
||
int CheckTagName(HD3HANDLE hServer,string szTagName,HD3_TAG_TYPE tagType,uint32 &tagID,bool isArchiving = true);
|
||
|
||
int CheckTagNames(HD3HANDLE hServer,int32 nTagNum,char szTagNames[][TAGNAME_MAXLEN],HD3_TAG_TYPE tagTypes[],uint32 tagID[],bool isArchiving = true);
|
||
|
||
|
||
protected:
|
||
HD3Connection conn;
|
||
bool m_isconn;
|
||
|
||
protected:
|
||
|
||
BinaryTele* mp_btele;
|
||
|
||
HD3HANDLE hServer;
|
||
string nodeName;
|
||
|
||
HD3Record snapshotsSaved[IHD_SIZE_MAX];
|
||
int32 nErrorCodes[IHD_SIZE_MAX];
|
||
char tagNames[IHD_SIZE_MAX][TAGNAME_MAXLEN];
|
||
char tagChinese[IHD_SIZE_MAX][TAGNAME_MAXLEN];
|
||
HD3_TAG_TYPE tagTypes[IHD_SIZE_MAX];
|
||
int tagItemCount;
|
||
IHD_TAGID m_tagids;
|
||
map<int,IHD_TAGID> mv_tagids;
|
||
};
|
||
}
|
||
|
||
#endif
|
||
|