#pragma once
|
#include <vector>
|
#include <string>
|
#include <algorithm>
|
|
// PLCÐÅÏ¢
|
struct PlcInfo {
|
CString strName; // PLC Ãû³Æ
|
CString strIp; // IP µØÖ·
|
UINT nPort; // ¶Ë¿ÚºÅ
|
};
|
|
class CConfiguration
|
{
|
public:
|
CConfiguration();
|
CConfiguration(const char* pszFilepath);
|
~CConfiguration();
|
|
public:
|
void setFilepath(const char* pszFilepath);
|
void getUnitId(CString& strUnitId);
|
void getBond1(CString& strIp, UINT& port, UINT& doorCount);
|
int getLogcatLevel();
|
void setLogcatLevel(int level);
|
int setLogcatIncludeText(CString& strInclude);
|
int getLogcatIncludeText(CString& strInclude);
|
void setLogcatIncludeRegex(BOOL bRegex);
|
BOOL isLogcatIncludeRegex();
|
int getCustomLogcatIncludeTexts(std::vector<std::string>& texts);
|
|
public:
|
void setP2RemoteEqReconnectInterval(int second);
|
int getP2RemoteEqReconnectInterval();
|
|
public:
|
// PLCÅäÖòÙ×÷
|
bool addPLC(const CString& strName, const CString& strIp, UINT nPort);
|
bool removePLC(const CString& strName);
|
bool updatePLC(const CString& strOldName, const CString& strNewName, const CString& strNewIp, UINT nNewPort);
|
bool getPLCByName(const CString& strName, CString& strIp, UINT& nPort);
|
void getAllPLCInfo(std::vector<PlcInfo>& plcList);
|
int getPLCListCount();
|
|
private:
|
void loadPLCListFromFile();
|
void savePLCListToFile();
|
|
private:
|
CString m_strFilepath;
|
std::vector<PlcInfo> m_plcList;
|
};
|