DeviceConf_API.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. #ifndef _DEVICECONF_API_H_
  2. #define _DEVICECONF_API_H_
  3. #ifdef CONFXMLPARSE_EXPORTS
  4. #define CONFXML_API extern "C" __declspec(dllexport)
  5. #else
  6. #define CONFXML_API extern "C" __declspec(dllimport)
  7. #endif
  8. #ifndef CONFXMLPARSE_EXPORTS
  9. #ifdef WIN64
  10. #ifdef _DEBUG
  11. #pragma comment(lib,"ConfXMLParseX64D.lib")
  12. #else
  13. #pragma comment(lib,"ConfXMLParseX64.lib")
  14. #endif
  15. #else
  16. #pragma comment(lib,"ConfXMLParse.lib")
  17. #endif // DEBUG
  18. #endif
  19. #include <vector>
  20. #include <map>
  21. #include <list>
  22. using namespace std;
  23. typedef basic_string<TCHAR, char_traits<TCHAR>, allocator<TCHAR> >
  24. tstring;
  25. //---------------------------------------------------------------------------------------
  26. enum
  27. {
  28. FW_NEED_UPDATE = 1,
  29. FW_MANDATORY_UPDATE,
  30. FW_NOT_SUPPORT,
  31. FW_NEW,
  32. FW_GET_ERROR
  33. };
  34. typedef struct
  35. {
  36. int nFullWidth;
  37. int nFullHeight;
  38. int nWidthOffset;
  39. int nHeightOffset;
  40. int nPreviewEnable;
  41. int nPreviewWidth;
  42. int nPreviewHeight;
  43. }Image;
  44. typedef struct
  45. {
  46. int nReferDose;
  47. int nAvgNum;
  48. }RefrenceCal;
  49. struct PanelBasicItem
  50. {
  51. int nSyncMode;
  52. int nCalibrationMode;
  53. int nPanelExpWindowMode;
  54. int nSaveRawDataMode;
  55. int nSaturationValue;
  56. int nGridSuppressed;
  57. int nPanelID;
  58. int nCOMPort;
  59. int nPanelChannel;
  60. wchar_t* strPanelType;
  61. wchar_t* strPanelFileName;
  62. wchar_t* strIPAddress;
  63. wchar_t* strPanelSerial;
  64. };
  65. struct PanelAdvanceItem
  66. {
  67. int nAutoBadPixel;
  68. int nTempUpperLimit;
  69. int nTempMaxLimit;
  70. int nTempLowerLimit;
  71. int nBatteryUpperLimit;
  72. int nBatteryLowerLimit;
  73. int nWifiUpperLimit;
  74. int nWifiLowerLimit;
  75. int nStandardEXI;
  76. int nDoseOfEXI;
  77. int nOffsetType; //
  78. wchar_t* strLastCalibrationDate;
  79. Image ImageStruct;
  80. vector<RefrenceCal> vecRefrenceCal;
  81. };
  82. struct PanelInternalItem
  83. {
  84. int nVersion;
  85. int nEnable;
  86. };
  87. struct PanelInfo
  88. {
  89. PanelBasicItem panelBasicItem;
  90. PanelAdvanceItem panelAdvanceItem;
  91. PanelInternalItem panelInternalItem;
  92. };
  93. //---------------------------------------------------------------------------------------
  94. struct GenBasicItem
  95. {
  96. int nGenPort;
  97. int nGenCtrlMode;
  98. int nGenWSLying;
  99. int nGenWSStand;
  100. int nGenWSConventional;
  101. int nGenWSFree;
  102. int nGenWSConventionalLying;
  103. int nGenWSConventionalStand;
  104. int nOrthoGenWSLying;
  105. int nOrthoGenWSStand;
  106. int nOrthoGenWSConventional;
  107. int nOrthoGenWSFree;
  108. int nOrthoGenWSConventionalLying;
  109. int nOrthoGenWSConventionalStand;
  110. //int nGenWSConventionalFree;
  111. wchar_t* strCalledIP;
  112. int nCalledPort;
  113. wchar_t* strCallingAETitle;
  114. wchar_t* strCalledAETitle;
  115. float fLargeFocalSpot;
  116. float fSmallFocalSpot;
  117. wchar_t* strXRayTubeVendor;
  118. int nReserved1;
  119. int nReserved2;
  120. };
  121. struct GenAdvanceItem
  122. {
  123. };
  124. struct GenInternalItem
  125. {
  126. wchar_t* strGenType;
  127. int nGenState;
  128. };
  129. struct GenInfo
  130. {
  131. GenBasicItem genBasicItem;
  132. GenAdvanceItem genAdvanceItem;
  133. GenInternalItem genInternalItem;
  134. };
  135. struct SNList
  136. {
  137. int nID;
  138. string strPanelType;
  139. string strPanelSN;
  140. string strActive;
  141. string strIPAddress;
  142. string strCalibDate;
  143. SNList()
  144. {
  145. nID = 0;
  146. strActive = "";
  147. strPanelType = "";
  148. strPanelSN = "";
  149. strIPAddress = "";
  150. strCalibDate = "";
  151. }
  152. };
  153. CONFXML_API bool LoadGenConXML( const wchar_t* strGenXMLName,GenInfo *genInfo);
  154. CONFXML_API bool LoadPanelConfXML(const wchar_t* strPanelXMLPath,PanelInfo *panelInfo);
  155. CONFXML_API bool LoadSynBoxConXML( const wchar_t* strSynXMLName,map<wstring,wstring> &);
  156. CONFXML_API bool LoadGenConf(const wchar_t* strGenXMLPath,map<wstring,wstring> &);
  157. CONFXML_API bool LoadPanelConf(const wchar_t* strPanelXMLPath,map<wstring,wstring> &);
  158. CONFXML_API bool GetPanelCalibItem(const wchar_t* strPanelXMLPath, list<RefrenceCal> & );
  159. CONFXML_API bool GetCalibReport(char* strConfXML, char* strKey, string& strValue);
  160. CONFXML_API bool CreatCalibReport(char* strConfXML, char* strKey, char* strValue);
  161. CONFXML_API bool SetDefectClass(char* strPanelXMLPath, char* strKey, int nValue, int nValueMax, bool bNewNode = true);
  162. CONFXML_API bool AddNewPanelSerial(char* strPanelXMLPath, SNList);
  163. CONFXML_API bool GetPanelSerialList(char* strPanelXMLPath,list<SNList> &listPanelSerial);
  164. CONFXML_API bool ClearSNList(char* pszPanelXMLPath);
  165. CONFXML_API bool LoadWlanAPConf(const char *strWlanConf, const char* strKey, string &strValue);
  166. CONFXML_API bool SetWlanAPConf(const char *strWlanConf, const char* strKey, string &strValue);
  167. CONFXML_API bool GetWlanAPLogin(const char *strWlanConf, string &strLogin, string &strPassword);
  168. CONFXML_API bool GetWlanAPIP(const char *strWlanConf, string &strIP,int &nPort);
  169. //CONFXML_API const wchar_t* GetKeyValueW(const wchar_t* strConfXML, const wchar_t* strKey);
  170. //CONFXML_API const char* GetKeyValueA(const char* strConfXML, const char* strKey);
  171. CONFXML_API bool GetValueByKeyA(const char* strConfXML, const char* strKey, string &strValue);
  172. CONFXML_API int LoadFirmwareList(const char *strFirmwareListConf, const char* strPN, const char* strFW);
  173. CONFXML_API bool LoadShockInfo(const char* strDeviceConfXML, map<string, string> &vecShockInfo);
  174. #endif