71 lines
1.7 KiB
C
71 lines
1.7 KiB
C
|
|
/*********************************************************************
|
|||
|
|
*
|
|||
|
|
* <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>: StorageDump.h
|
|||
|
|
*
|
|||
|
|
* <EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Shanghai Baosight Software Co., Ltd.
|
|||
|
|
* %USER%
|
|||
|
|
*********************************************************************/
|
|||
|
|
#ifndef _COIL_STORAGE_DUMP_H
|
|||
|
|
#define _COIL_STORAGE_DUMP_H
|
|||
|
|
#include <Ice/BuiltinSequences.h>
|
|||
|
|
#include <zlib/coilDef.h>
|
|||
|
|
#include <zlib/MemTrk.h>
|
|||
|
|
#include <glob/AutoTele.h>
|
|||
|
|
#include <proxy/MessageICE.h>
|
|||
|
|
#include <zlib/MemTable.hpp>
|
|||
|
|
|
|||
|
|
|
|||
|
|
using namespace baosight;
|
|||
|
|
|
|||
|
|
/*********************************************************************
|
|||
|
|
* <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>: StorageDump
|
|||
|
|
* <EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Shanghai Baosight Software Co., Ltd.
|
|||
|
|
*
|
|||
|
|
*********************************************************************/
|
|||
|
|
class StorageDump
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
StorageDump(const string& db,const string& user, const string& password);
|
|||
|
|
virtual ~StorageDump();
|
|||
|
|
/**********************************************************************
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD>ܷ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
*
|
|||
|
|
**********************************************************************/
|
|||
|
|
int dispatch(int eventNo,const ::Ice::ByteSeq& seq);
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
int SetPDIMem(const string& entId,const string& sql);
|
|||
|
|
|
|||
|
|
//get color from L2
|
|||
|
|
int GetColor(void);
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
|
|||
|
|
bool getNextPDO(PDO* pdo);
|
|||
|
|
|
|||
|
|
int getL2PDO(const string& entId,PDO* pdo);
|
|||
|
|
|
|||
|
|
//dump by table
|
|||
|
|
int dumpTable(int eventNo,const string& where);
|
|||
|
|
int dumpTable(const string& srcsql,const string& disttable);
|
|||
|
|
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
//dump database data
|
|||
|
|
int dumpData(const string& srcsql,const string& distsql);
|
|||
|
|
|
|||
|
|
short Proxy(int eventNo,const string& proxyName, const char* str,int length);
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
|
|||
|
|
CMemTable<PDO>* pt_pdo;
|
|||
|
|
CMemTable<PDI>* pt_pdi;
|
|||
|
|
CMemTrk* mp_trk;
|
|||
|
|
AutoTele* mp_atele;
|
|||
|
|
iDA::Connection m_con;
|
|||
|
|
iDA::Command m_cmd;
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
#endif
|