70 lines
1.4 KiB
C++
70 lines
1.4 KiB
C++
#pragma once
|
|
#include <vector>
|
|
#include <string>
|
|
#include <map>
|
|
#include "HbdLanguage.h"
|
|
|
|
using namespace std;
|
|
|
|
class CommunicationCfg {
|
|
public:
|
|
|
|
enum ComType {
|
|
COM = 0,
|
|
TCP,
|
|
S7
|
|
};
|
|
|
|
CommunicationCfg();
|
|
CommunicationCfg(int mid, string cc, string name, int type);
|
|
~CommunicationCfg() {}
|
|
|
|
void GetUpdateSql(vector<string>& ups);
|
|
void GetInitInsertSql(vector<string>& ins);
|
|
|
|
public:
|
|
int m_MachineId;
|
|
string m_ClientCode;
|
|
string m_Name;
|
|
int m_Type;
|
|
string m_IP;
|
|
int m_Port;
|
|
unsigned char m_Addr;
|
|
string m_COM;
|
|
int m_BaudRate;
|
|
int m_Parity;
|
|
int m_DataBits;
|
|
int m_StopBits;
|
|
unsigned int m_Interval;
|
|
unsigned int m_AlarmTimeoutTimes;
|
|
bool m_Enable;
|
|
|
|
char m_szIp[16];
|
|
char m_szCom[10];
|
|
|
|
string m_ShowContent;
|
|
//static map<string, TrText*> s_CommunicationTr;
|
|
public:
|
|
static const string TABLE_NAME;
|
|
static const string FIELD_MACHINE_ID;
|
|
static const string FIELD_CLIENT_CODE;
|
|
static const string FIELD_PARAM_CODE;
|
|
static const string FIELD_PARAM_VALUE;
|
|
|
|
static const string PARAM_NAME;
|
|
static const string PARAM_TYPE;
|
|
static const string PARAM_IP;
|
|
static const string PARAM_PORT;
|
|
static const string PARAM_ADDR;
|
|
static const string PARAM_COM;
|
|
static const string PARAM_BAUD_RATE;
|
|
static const string PARAM_PARITY;
|
|
static const string PARAM_DATABITS;
|
|
static const string PARAM_STOPBITS;
|
|
static const string PARAM_INTERVAL;
|
|
static const string PARAM_ALARM_TIMEOUT_TIMES;
|
|
static const string PARAM_ENABLE;
|
|
|
|
|
|
};
|