123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #pragma once
- #ifndef LIB_DEVICEERRORINFOR_EXPORTS
- #ifdef _WIN64
- #ifdef _DEBUG
- #pragma comment(lib, "libDeviceErrorInforX64D.lib")
- #else
- #pragma comment(lib, "libDeviceErrorInforX64.lib")
- #endif
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "libDeviceErrorInforD.lib")
- #else
- #pragma comment(lib, "libDeviceErrorInfor.lib")
- #endif
- #endif
- #endif
- #include <vector>
- #include<string>
- #include "DeviceErrorCode.h"
- enum DEVICE_ERROR_INFO_TYPE
- {
- INFO_TYPE_ERROR,
- INFO_TYPE_WARN
- };
- class DeviceError
- {
- public:
- DeviceError(void);
- ~DeviceError(void);
- std::string getCode();
- std::string getName();
- std::string getDescription();
- std::string getSolution();
- std::string getNotifyType();
- std::string getInterlock();
- std::string getBackCommand();
- void setCode(std::string code);
- void setName(std::string name);
- void setDescription(std::string desc);
- void setSolution(std::string solu);
- void setNotifyType(std::string notifytype);
- void setInterlock(std::string interlock);
- void setBackCommand(std::string backCommand);
- private:
- std::string m_strCode;
- std::string m_strName;
- std::string m_strDescription;
- std::string m_strSolution;
- std::string m_strNotifyType;
- std::string m_strInterlock;
- std::string m_strBackCommand;
- //std::string m_str;
- };
- class DeviceErrorInfor
- {
- public:
- DeviceErrorInfor(void);
- ~DeviceErrorInfor(void);
- bool getDeviceError(const std::string strFileName , const std::string strCode, DeviceError &error);
- bool getDeviceWarn(const std::string strFileName, const std::string strCode, DeviceError &warn);
- bool getDeviceError(const std::string strCode, DeviceError &error);
- bool getDeviceWarn(const std::string strCode, DeviceError &warn);
- void setFileName(const std::string strPath);
- void setFileName(DEVICE_ERROR_INFO_TYPE type, const std::string strLang ,const std::string strInfoFileName ,std::string strAppPath);
- private:
- std::string m_strFileName;
- bool getInfor(const std::string strFileName ,const std::string strType , const std::string strCode, DeviceError &error);
- };
- class DeviceErrorList
- {
- public:
- DeviceErrorList(void);
- ~DeviceErrorList(void);
- bool isError();
- bool isExist(const std::string strCode);
- bool add(DeviceError &error);
- bool remove(const std::string strCode);
- void clear();
- int size();
- DeviceError &item(int index);
- private:
- std::vector<DeviceError> m_list;
- };
|