| | |
| | | #pragma once |
| | | #include <vector> |
| | | #include <string> |
| | | #include <algorithm> |
| | | |
| | | // PLC信息 |
| | | struct PlcInfo { |
| | | CString strName; // PLC 名称 |
| | | CString strIp; // IP 地址 |
| | | UINT nPort; // 端口号 |
| | | }; |
| | | |
| | | class CConfiguration |
| | | { |
| | |
| | | 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; |
| | | }; |
| | | |