TrixellCtrl.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. #pragma once
  2. #include <map>
  3. //转存文件内容使用
  4. #include <shellapi.h>
  5. #include "CcosLock.h"
  6. #include "ResDataObject.h"
  7. #include "CCOS.Dev.FPD.TrixellDR.h"
  8. #include "PanelSerialXMLControl.h" //加载、处理PanelSerial.xml
  9. //SDK头文件
  10. #include "include/pixradlib.h"
  11. #include "ZSKKCalibration.h"
  12. #ifndef EDETSTATUS
  13. #define EDETSTATUS
  14. enum eDetStatus
  15. {
  16. DetStatus_NotIni,
  17. DetStatus_NotConn,
  18. DetStatus_Sleep,
  19. DetStatus_Standby,
  20. DetStatus_Work,
  21. DetStatus_Acquire,
  22. DetStatus_Offset,
  23. DetStatus_XrayCalibration,
  24. };
  25. #endif // !EDETSTATUS
  26. //探测器状态
  27. enum ENUM_EXPOSURE_STATUS
  28. {
  29. EXP_NULL = 0,
  30. EXP_START_ACQ = 1,
  31. EXP_XWINDOW_ON = 2,
  32. EXP_XWINDOW_OFF = 3,
  33. EXP_READING = 4,
  34. EXP_IMAGE = 5,
  35. EXP_END_ACQ = 6
  36. };
  37. //探测器同步模式
  38. enum ENUM_PANEL_SYNC_MODE
  39. {
  40. PANEL_SYNC_HW = 10,
  41. PANEL_SYNC_SW = 11,
  42. PANEL_SYNC_AUTO = 12
  43. };
  44. ////探测器异步事件状态
  45. //enum ENUM_PANEL_EVENT_STATE
  46. //{
  47. // PANEL_EVENT_END_OK = 0,
  48. // PANEL_EVENT_END_ERROR = 1,
  49. // PANEL_EVENT_START = 2,
  50. // PANEL_EVENT_SUCCESS = 3,
  51. // PANEL_EVENT_END = 4,
  52. // PANEL_EVENT_BEGIN = 5,
  53. // PANEL_EVENT_TIMEOUT = 6
  54. //};
  55. //探测器异步事件状态
  56. //enum ENUM_SHARE_EVENT_STATE
  57. //{
  58. // PANEL_CONNECT_ERROR = 0,
  59. // PANEL_ATTACH_START = 1,
  60. // PANEL_CONNECT_OK = 2,
  61. // PANEL_DISCONNECT_SUCCESS = 3,
  62. // PANEL_DISCONNECT_ERROR = 4,
  63. // PANEL_ATTACH_OVER = 5,
  64. // PANEL_ATTACH_FAILED = 6,
  65. // PANEL_ATTACH_NULL = 7,
  66. //};
  67. //enum ENUM_EXPOSE_STATUS
  68. //{
  69. // DOSE_ACCEPT = 0,
  70. // DOSE_TOO_HIGH = 1,
  71. // DOSE_TOO_LOW = 2,
  72. // DOSE_OBJECT = 3
  73. //
  74. //};
  75. enum
  76. {
  77. REQUIRE_HW_MIX,
  78. REQUIRE_HW_AUTO,
  79. REQUIRE_HW_DEL,
  80. };
  81. #ifndef EDETOPERATIONMODE
  82. #define EDETOPERATIONMODE
  83. enum eDetOperationMode
  84. {
  85. PIX_OM_RAD = 1,
  86. PIX_OM_TOMO,
  87. PIX_OM_AED = 3
  88. };
  89. #endif // !EDETOPERATIONMODE
  90. #ifndef EDETPIXIMGTYPE
  91. #define EDETPIXIMGTYPE
  92. enum eDetPixImgType
  93. {
  94. PIX_IMG_NONE,
  95. PIX_IMG_PRE,
  96. PIX_IMG_RAW,
  97. PIX_IMG_FULL = 4
  98. };
  99. #endif // !EDETPIXIMGTYPE
  100. #ifndef EDETINITRESULT
  101. #define EDETINITRESULT
  102. enum INIT_RESULT
  103. {
  104. INIT_FAILED,
  105. INIT_CONNECT_ERR,
  106. INIT_SUCCESS,
  107. INIT_FIRMWARE
  108. };
  109. #endif // !EDETINITRESULT
  110. class TrixellCtrl : public CcosLock
  111. {
  112. //探测器信息
  113. struct CPanelStatus
  114. {
  115. string strPanelType; //探测器类型,AddDPC时赋值
  116. string strPanelSN; //探测器序列号,连接成功后获取信息时被赋值
  117. bool bIsPortable;
  118. bool bCharging;
  119. bool bStatusPolling;
  120. bool bDC_AED;
  121. bool bDarkCalibDone; //offset刷新结束
  122. bool bAEDDarkCalibDone;
  123. bool bLTEDarkCalibDone; //长曝光offset刷新结束
  124. string strModuleIP; //探测器IP地址,attach或收到init回调时赋值
  125. bool bBatteryTooLow;
  126. bool bConnectStatus; //是否连接
  127. bool bImagePending;
  128. bool bIsLoadRef; //是否加载了校正文件,加载过了不用再次加载
  129. int nBattery; //电池电量
  130. bool bInitOK; //初始化过程探测器连接完毕,用于重连判断
  131. bool bNeedUpdateFW; //是否需要固件升级的标记位
  132. bool bSelftested; //Selftest执行完毕
  133. int nTotalShockNumber; //探测器的shocksenseor总数
  134. int nFWStatus; //探测器固件状态
  135. string strPartNumber; //产品编号,连接成功后获取信息时被赋值
  136. correction_type eCorrectType[3]; //校正类型 All或者offset
  137. ResDataObject objPanelConfig;
  138. bool bHaveAutonumousMode; //是否支持离线采集
  139. bool bAutonumousMode; //true: 离线模式;false:在线模式
  140. CPanelStatus()
  141. {
  142. strPanelType = "";
  143. strPanelSN = "";
  144. bIsPortable = false;
  145. bCharging = false;
  146. bStatusPolling = false;
  147. bDC_AED = false;
  148. bDarkCalibDone = false;
  149. bAEDDarkCalibDone = false;
  150. bLTEDarkCalibDone = false;
  151. strModuleIP = "";
  152. bBatteryTooLow = false;
  153. bConnectStatus = false;
  154. bImagePending = false;
  155. bIsLoadRef = false;
  156. nBattery = 0;
  157. bInitOK = false;
  158. bNeedUpdateFW = false;
  159. bSelftested = false;
  160. nTotalShockNumber = -1;
  161. nFWStatus = -1;
  162. strPartNumber = "";
  163. bHaveAutonumousMode = false;
  164. bAutonumousMode = false;
  165. }
  166. };
  167. public:
  168. TrixellCtrl(/*Logger *pLog*/);
  169. ~TrixellCtrl();
  170. bool AddDPCs(FPDDeviceTrixell* pDrvDPC, ResDataObject& Configuration, DeviceIndexStruct& DeviceStruct);
  171. bool DelDPCs(FPDDeviceTrixell* pDrvDPC);
  172. int GetDPCsCount();
  173. bool ActivePanel(FPDDeviceTrixell* pDrvDPC);
  174. bool SwitchPanel(int nPanelId);
  175. bool EnterExam(APP_STATUS eStatus);
  176. bool Connect(string strWorkPath, FPDDeviceTrixell* pDrvDPC);
  177. void DisConnect(FPDDeviceTrixell* pDrvDPC);
  178. void SetAttachFPDInfo(string strFPDType, int nDetectorID);
  179. bool AttachDetector(FPDDeviceTrixell* pDrvDPC);
  180. void CancelAttach();
  181. RET_STATUS SetSyncMode(SYNC_MODE nSyncMode, HARDWARE_TRIGGER_MODE TriggerMode);
  182. bool SelectExamMode(int nLogicMode, FPDDeviceTrixell* pDrvDPC);
  183. RET_STATUS SetFrameRate(FLOAT frameRate, FPDDeviceTrixell* pDrvDPC);
  184. RET_STATUS StartAcquisition(FPDDeviceTrixell* pDrvDPC);
  185. RET_STATUS StopAcquisition(FPDDeviceTrixell* pDrvDPC);
  186. RET_STATUS PrepareAcquisition(FPDDeviceTrixell* pDrvDPC);
  187. RET_STATUS ActiveCalibration(CCOS_CALIBRATION_TYPE Type);
  188. RET_STATUS StartCalibration(FPDDeviceTrixell* pDrvDPC);
  189. RET_STATUS GetDoseRequest(float& DoseReq, FPDDeviceTrixell* pDrvDPC);
  190. RET_STATUS AbortCalibration(FPDDeviceTrixell* pDrvDPC);
  191. RET_STATUS PrepareCalibration(FPDDeviceTrixell* pDrvDPC);
  192. RET_STATUS PostCalibration(FPDDeviceTrixell* pDrvDPC);
  193. RET_STATUS CompleteCalibration(FPDDeviceTrixell* pDrvDPC);
  194. bool SetLTEMode(bool bEnable);
  195. bool RecoverLastImage();
  196. bool WakeupDetector(int nDetectorID);
  197. bool LoadDLL(string strWorkPath = "");
  198. static void EventCallback(const event_id eventID, const Event* eventData, void* customData);
  199. //static void OutputCallback(const char* string, void* customData);
  200. static void RsprogressCallback(const unsigned int transferred_bytes, const unsigned int total_bytes, void* customData);
  201. void ProcessEvent(const event_id eventID, const Event* eventData);
  202. bool ProcessEventError(string strEventName, error_status err, int nDetectorID = -1);
  203. bool TestError(error_status err, int nFpdID = -1, string strFuncName = "");
  204. bool TestRSError(rs_error_status err, int nFpdID = -1, string strFuncName = "");
  205. int InitDetector(bool bAttachProcess = false, int nDetectorID = -1);
  206. bool CloseDetector();
  207. bool ConnectDetector(bool bAttachProcess, int nDetectorID);
  208. bool ConnectDetectorInFWUpdating(int nDetectorID);
  209. bool DisconnectDetector(int nDetectorID);
  210. bool LockPixrad(string strPosition = "", int nTimeout = 65000); //等待耗时操作执行完毕,耗时1分钟
  211. void UnlockPixrad(string strPosition = "");
  212. bool GetConfigParameters(int nDetectorID);
  213. bool SetFpdExamMode(string strPanelType, int nOmMode, int nAppMode, bool bEnable); //激活探测器特殊模式 aed/tomo
  214. bool RefreshOffset(bool bEnablePreview, int nOmMode, int nAppMode, bool bWaitOver = true); //刷新单一模式offset
  215. //bool RefreshAllOffset(); //刷新全部模式offset
  216. bool LoadReference(int nAppMode, int nDetectorID, bool bLTEenable = false);
  217. bool LoadReferenceEx(application_mode aMode, operating_mode oMode, unsigned short usDetectorMode, unsigned short usGainID, unsigned short usDMID);
  218. bool ConfigPixradSDK(ResDataObject ResConfig);
  219. bool GetSystemState(system_state& stState);
  220. bool SetSystemState(system_state stState);
  221. bool SetApplicationParam(int nAppMode); //设置应用参数
  222. bool ActiveGainCalibration();
  223. void OnProcessImg();
  224. void SaveRawFunc(eDetPixImgType eImgType, WORD* pInImg);
  225. bool ResumeSequence(bool bLock); //校正时触发SDK进行下一步操作
  226. bool GetEffectiveImage(WORD* pOutImg, WORD* pInImg, int nInWidth);
  227. //static DWORD __stdcall RefreshOffsetThread(PVOID pvoid);
  228. //void OnRefreshOffset(); //offset 刷新
  229. void OnProcessDarkEnd();
  230. void StartModuleThread();
  231. static DWORD __stdcall onModuleThread(PVOID pvoid);
  232. bool OnModuleConnect();
  233. bool ModifyModuleFPDConf(string strDetectorIP, string strHostIP);
  234. bool ModifyFPDsIPConf();
  235. bool ModifyFPDIPConf(string strConfPath, string strDetectorIP, string strHostIP = "");
  236. //bool ModifyDRFPDIPConf(string strDetectorIP, string strConfPath);
  237. bool ModifyOLDFPDIPConf(string strDetectorIP, string strConfPath, string strHostIP);
  238. bool ModifyOLDFPDIPConfEx(string strDetectorIP, string strConfPath);
  239. bool SetIRPort(string strDetectorType, int nPort);
  240. bool CopyFile2Folder(string strSrcPath, string strDstPath);
  241. bool SetStatusPolling(int nDetectorID, bool bEnable);
  242. bool SetDetectorStatusPolling(int nDetectorID, bool bEnable);
  243. bool GetHardwareStatus(int nDetectorID);
  244. bool GetDetectorHardwareStatus(int nDetectorID);
  245. bool GetDetectorWifiStatus(int nDetectorID);
  246. bool GetDetectorInformation(int nDetectorID, bool bRequireVoltage = false);
  247. void SimulateShockSensor(int nDetectorID, bool bSend = true);
  248. bool UploadSensitivity(int nDetectorID = -1);
  249. bool DownloadSensitivity(int nDetectorID = -1);
  250. bool UploadReferences(int nDetectorID = -1);
  251. bool DownloadReferences(bool bLTEenable = false, int nDetectorID = -1);
  252. bool UploadDefectCalibrationFiles(int nDetectorID = -1);
  253. bool UploadDefectMap(int nDetectorID = -1);
  254. bool DownloadDefectMap(int nDetectorID = -1);
  255. bool RestoreCalibrationData(bool bLTEenable = false, int nDetectorID = -1);
  256. bool UploadtoDetector(string strFilePath, string strFileName, int nDetectorID = -1);
  257. bool DownloadfromDetector(string strFilePath, string strFileName, int nDetectorID = -1);
  258. bool IsPortablePanel(string strPanelType);
  259. bool FactoryCorrectionActive(bool bAttachProcess, int nDetectorID = -1);
  260. bool SelfTestFPD(int nDetectorID = -1);
  261. bool GetCalibrationTime(int nDetectorID = -1);
  262. bool GetModeMatchInfo();
  263. bool SetActiveDetector(unsigned short usDetectorID);
  264. bool GetActiveDetector(unsigned short& usDetectorID);
  265. void ConfFeedback(int nEventID, int nDetectorID = -1, const char* pszMsg = "", int nParam1 = 0, float fParam2 = 0, int nPtrParamLen = 0, void* pParam = NULL);
  266. void InfoFeedback(int nEventID, int nDetectorID = -1, int nParam1 = 0, float fParam2 = 0, const char* pszMsg = "", int nPtrParamLen = 0, void* pParam = NULL);
  267. void StatusFeedback(int nEventID, int nParam1 = 0, const char* pszMsg = "", int nDetectorID = -1, float fParam2 = 0, int nPtrParamLen = 0, void* pParam = NULL);
  268. void DataFeedback(int nEventID, void* pParam = NULL, int nParam1 = 0, float fParam2 = 0, const char* pszMsg = "", int nPtrParamLen = 0, int nDetectorID = -1);
  269. void WarnFeedback(int nEventID, const char* pszMsg = "", int nParam1 = 0, float fParam2 = 0, int nPtrParamLen = 0, void* pParam = NULL, int nDetectorID = -1);
  270. void ErrorFeedback(int nEventID, const char* pszMsg = "", int nDetectorID = -1, int nParam1 = 0, float fParam2 = 0, int nPtrParamLen = 0, void* pParam = NULL);
  271. bool IRFuncSetting(bool bModifyConfig, bool bInvokeAPI);
  272. static DWORD __stdcall onFPDScanThread(PVOID pvoid);
  273. bool SetConnectConf(bool bConnect, int nDetectorID);
  274. bool GetConnectConf(int nDetectorID);
  275. bool IsConnected(string strIP);
  276. //void SetAttachFPDInfo(string strFPDType, int nDetectorID);
  277. bool CheckFileExits(string strPath, string strFile);
  278. void OnEndCalibraion();
  279. static DWORD __stdcall onCheckShockThread(PVOID pvoid);
  280. void StopThread();
  281. void UpdateFirmware(int nDetectorID);
  282. static DWORD __stdcall onUpdateFWThread(PVOID pvoid);
  283. bool onUpdateFirmware();
  284. bool GetFWVersion(string strPNCode, string& strFirmwareVersion, int nDetectorID);
  285. bool ModifyFirmwareLogPath(int nDetectorID);
  286. int CallAdapter(string strFirmwareVersion, string strIPAddress, int nDetectorID);
  287. UINT ExecuteEXE(string strExeName, string strParameters, DWORD& hProcID);
  288. DWORD GetProcessidFromName(string strProcName);
  289. static DWORD __stdcall onFPDStatusThread(PVOID pvoid);
  290. bool onCheckFPDStatus();
  291. bool InDetectorShare();
  292. string GetPanelResource(string strKey);
  293. bool UpdatePanelSerialFile(string strPanelType, string strSN, string strSetIP, string strDate, bool bActive);
  294. bool GetPanelSNList(string strPanelSerial, PanelSerialList& stpanelInfo);
  295. void RefreshHWStatus();
  296. bool OfflineFPD(int nDetectorID);
  297. bool StartOfflineAutonumousThread();
  298. static unsigned __stdcall onOfflineAutonumousMode(void* pParam);
  299. bool OfflineAutonumousMode();
  300. bool SetSyncMode(int nDetectorID, SYNC_MODE nSyncMode);
  301. bool SetSyncMode(int nDetectorID, int nSyncMode);
  302. bool OnlineFPD(int nDetectorID);
  303. bool StartOnlineAutonumousThread();
  304. static unsigned __stdcall onOnlineAutonumousMode(void* pParam);
  305. bool OnlineAutonumousMode();
  306. bool GetAutonumousImageList(int nDetectorID, vector<string>& AutonumousList);
  307. string RecognizeBarcode(string strData, int nLen);
  308. bool RemoveAutonumousImageList(string strMeta);
  309. bool RemoveAutonumousAll();
  310. bool GetImageMetaData(string strMetaData);
  311. static DWORD __stdcall onGetStoredImageThread(PVOID pvoid);
  312. bool GetStoredImage(string strMetaData);
  313. bool ExportAutonumousAll();
  314. static DWORD __stdcall onExportAutonumousToLocal(PVOID pvoid);
  315. bool ExportAutonumousToLocal();
  316. bool SetSaveRawDataMode(int nSaveRawDataMode);
  317. bool SaveRawImage(const char* pImgName, const WORD* pRawImg, int nWidth, int nHeight);
  318. bool ApplicationAcquireSequence(); //触发采集序列
  319. bool AcceptCalibration();
  320. bool RejectCalibration();
  321. bool GetCalibrationStep(int nCalibCurrentCalibrationRound, int nCalibrationRounds, int nCalibCurrentExposureIndex, int nExposureNumCurrentRound);
  322. bool SaveCalibrationFile();
  323. bool SetReferenceNum(int nReferenceNum);
  324. public:
  325. int m_nPanelCount;
  326. int m_nCurrentPanelID; //0, 1, 2
  327. void* m_pCurrentDPC;
  328. map<FPDDeviceTrixell*, int>* m_pDPC2PanelID;
  329. map<int, FPDDeviceTrixell*>* m_pPanelID2DPC;
  330. ResDataObject m_PanelConfigPath; //加载PanelConfigPath,通过探测器类型获取配置文件名称
  331. ResDataObject m_ModeMatch; //存储配置文件中FPDModeMatch项
  332. ResDataObject m_SelfTest; //存储自检信息
  333. private:
  334. bool WaitRespond(int nTimeOut, string strAction = "");
  335. bool SendRespond(string strAction = "");
  336. private:
  337. HMODULE m_hTrixellModule;
  338. string m_strPanelType; //探测器类型
  339. string m_strWorkPath; //工作路径
  340. string m_strPanelIP; //配置文件中的IP地址
  341. string m_strCfgPath; //SDK配置文件路径
  342. bool m_bOpened; //true: SDK Open成功,避免重复执行
  343. bool m_bConnected; //true: SDK Connect成功,避免重复执行
  344. bool m_bLoaded; //true: 已经加载过SDK
  345. APP_STATUS m_eAppStatus; //记录当前软件的工作状态(界面)
  346. ConfigParameters m_configParams;
  347. string m_strDetectorSSID_Old;
  348. system_state m_currentState; //记录当前状态 QUIET REFERENCE PATIENT等
  349. int m_nCurrentMode; //记录探测器当前application mode
  350. int m_nCurrentOmMode; //记录探测器当前操作模式,取自自定义枚举类型eDetOperationMode的值
  351. int m_nCurrentAppMode; //记录当前的应用模式
  352. bool m_bWorkMode; //true: 已经进入workmode
  353. int m_nImageWidth;
  354. int m_nImageHeight;
  355. int m_nWidthOffset;
  356. int m_nHeightOffset;
  357. int m_nRawImgWidth; //图像原始宽
  358. int m_nRawImgHeight; //图像原始高
  359. WORD* m_pPreImgBuffer;
  360. WORD* m_pImgBuffer;
  361. WORD* m_pRawImgBuffer;
  362. int m_nImgBits;
  363. int m_nPixelPitch;
  364. bool m_bPreviewEnable;
  365. int m_nPreviewWidth;
  366. int m_nPreviewHeight;
  367. CCOS_CALIBRATION_TYPE m_eCaliType; // 记录当前校正模式
  368. float m_fDose;
  369. float m_fCurrentDose; // 记录当前的Dose要求
  370. eDetStatus m_eStatus; // 探测器状态
  371. int m_nXwinOnIndex; // tomo开窗次数
  372. int m_nTomoImgIndex; //tomo曝光图像的index,存图时使用
  373. int m_nTomoImgCount; //tomo曝光图像的张数(1~30)
  374. int m_nCaliFailedCount; //记录增益校正失败次数,超过一定次数自动停止校正
  375. bool m_bGainPreparing; //true: 正在进入增益校正状态
  376. bool m_bGainProcess; //true: 处于增益曝光的一次小循环当中(WindowOn ~ SDK返回当前曝光结果)
  377. bool m_bConfirmCaliRst; //true: 接受当前增益校正曝光结果
  378. bool m_bAutoContinueCal; //true: SDK自动进行下一次增益开窗流程(一般是在当前增益合格);false: 手动触发SDK进行下一次增益
  379. int m_nSaveRaw; //0:不存; 1:预览图; 2:raw图; 4:实际尺寸图像;
  380. bool m_bPreviewImg; //true: 当前获取的是预览图
  381. bool m_bExpEnable; //true: 曝光使能。false的情况下不允许进行曝光操作
  382. eDetPixImgType m_eImgType; //图像类型
  383. bool m_bWaitAcqEnd; //true:调用停止采集,等待EVT_END_ACQUISITION
  384. bool m_bPrepShot; //true:收到了EVT_PREP_XRAY_SHOT,不用在FramePrep里面进行耗时操作
  385. //int m_nGainNodeCount; //校正曝光的总节点个数
  386. //int m_nGainNodeIndex; //校正曝光的节点Index
  387. //int m_nGainExpCount; //校正曝光节点需要曝光的次数
  388. //int m_nGainExpIndex; //校正曝光节点已曝光的次数
  389. correction_type m_eCorrectionType; //记录可以设置给探测器的校正模式
  390. correction_type m_eCurrentCT; //记录当前的设置给探测器的校正模式
  391. bool m_bAbortRefreshOft; //true 终止offset
  392. int m_nOftRefreshTimer; //offset刷新计时器 单位:分钟
  393. int m_nAngle; //顺时针旋转角度,支持90 180 270
  394. CRITICAL_SECTION m_cs;
  395. int m_nIgnoreImgCount; //tomo模式需要忽略掉的图像张数
  396. int m_nIgnoreImgNum; //tomo模式已经忽略掉的图像张数
  397. int m_nCfgCalibPrepare;
  398. CPanelStatus* m_pStPanelStatus[3];
  399. DeviceIndexStruct m_stDeviceIndex[3]; //配置的探测器列表//不超过三块板
  400. int m_nDetectorID;
  401. bool m_bAttaching; //true: 探测器正在attach过程中
  402. bool m_bModuleConnecting; //true: 探测器正在连接过程中。固件升级、attach时使用
  403. bool m_bModulePresent; //记录红外探头是否和探测器接触
  404. string m_strModuleType; //红外获取的探测器类型;
  405. string m_strModuleIP;//红外获取的探测器IP;
  406. string m_strModuleSN; //红外获取的探测器SN
  407. string m_strModuleSSID; //红外获取的SSID
  408. bool m_bModuleEnable; //true: 使用红外扫描功能
  409. int m_nIRPort; //从配置文件中读取到的红外探头串口号
  410. bool m_bUpdateFirmwareDirect; //true: 直接升级固件
  411. //bool m_bNeedUpdateFW; //true: 需要升级固件 需要通过配置获知是否需要升级
  412. bool m_bNeedFeedback; //true: 获取wifi信息中,需要unlockpixrad
  413. unsigned int m_nSessionID; //下载文件时 和探测器的会话ID
  414. bool m_bLTEenable; //true: 长曝光模式
  415. SYNC_MODE m_eSyncMode; //同步模式
  416. int m_nXWinMode;
  417. int m_nLteXWinMode;
  418. bool m_bTransImageSuccess; //true:图像传输成功
  419. //int m_nTotalShockNumber;
  420. string m_strAttachFPD; //记录要attach的探测器类型
  421. int m_nAttachFPDID; //记录要attach的探测器ID
  422. int m_nUpdateFPDID; //记录要固件升级的探测器ID
  423. int m_nShockFPDID; //记录要查询shock sensor信息的探测器ID
  424. bool m_bExitShockCheck; //true:退出获取shock sensor信息的线程
  425. int m_nRefreshOftMode; //当前刷新offset的appmode
  426. bool m_bIsImageRecovering; //是否处于图像恢复流程
  427. PanelSerialXMLControl m_objSNlist;
  428. int m_nRequireHWType; //查询多板状态的机制
  429. int m_nStatusTimeout; //通过SDK polling状态的时间
  430. int m_nPollingTimes; //通过SDK polling状态的次数
  431. int m_nStopPollingIndex; //停止polling功能的探测器index
  432. bool m_bIsExpInAuto; //true: aed模式曝光了
  433. bool m_bRefreshing; //true:正在刷新offset
  434. bool m_bReInitialize; //true:正在重新初始化
  435. int m_nAutonumousID; //离线采集的探测器ID
  436. vector<string> m_vecStorageList;
  437. vector<string> m_StoredImageMetaDataList;
  438. string m_strGetMetaData;
  439. bool m_bAutonumousMode;
  440. string m_strAutonumousMetaData;
  441. int m_nAutonumousImageIndex;
  442. CCOS_CALIBRATION_MODE m_nCalibrationMode;
  443. CZSKKCalibrationCtrl* m_pZSKKCalib;
  444. int m_nCalibCurrentCalibrationRound;
  445. int m_nCalibrationRounds;
  446. int m_nCalibCurrentExposureIndex;
  447. int m_nExposureNumCurrentRound;
  448. bool m_bSaveCalibrationRaw;
  449. HANDLE m_hShareEvent; //等待事件锁
  450. //HANDLE m_hRefreshOftEvent;
  451. //HANDLE m_hRefreshOftThread; //自动刷新offset线程
  452. HANDLE m_hFPDScanThread; //辅助线程,执行开窗、关窗等通知
  453. HANDLE m_hFPDStatusThread; //检查探测器状态线程句柄
  454. //HANDLE m_hOftEndEvent; //自动刷新offset结束
  455. HANDLE m_hStopScanEvent;
  456. HANDLE m_hProcessImgEvent;
  457. HANDLE m_hXWinOnEvent;
  458. HANDLE m_hXWinOffEvent;
  459. HANDLE m_hEndCalibEvent;
  460. HANDLE m_hDarkEndEvent; //dark校正结束
  461. HANDLE m_hClosePollingEvent;
  462. HANDLE m_hArrayEvent[7];
  463. HANDLE m_hModuleThread; //红外连接线程的句柄
  464. HANDLE m_hCheckShockThread; //获取shock信息的线程的句柄
  465. HANDLE m_hCheckShockEvent;
  466. HANDLE m_hToggleEvent; //线程执行结束的通知事件
  467. HANDLE m_hQuitAdaptEvent; //退出固件升级线程
  468. HANDLE m_hQuitStatusEvent; //退出检查探测器状态线程事件
  469. HANDLE m_hRespondEvent; //耗时流程执行等待事件
  470. CB_TED_PixRad_RegisterEventCallback TED_PixRad_RegisterEventCallback;
  471. CB_TED_PixRad_RegisterOutputMsgCallback TED_PixRad_RegisterOutputMsgCallback;
  472. CB_TED_PixRad_Open TED_PixRad_Open; //同步函数
  473. CB_TED_PixRad_Close TED_PixRad_Close;
  474. CB_TED_PixRad_ResetDetector TED_PixRad_ResetDetector;
  475. CB_TED_PixRad_StartAcquisition TED_PixRad_StartAcquisition;
  476. CB_TED_PixRad_StopAcquisition TED_PixRad_StopAcquisition;
  477. CB_TED_PixRad_GetConfigParameters TED_PixRad_GetConfigParameters; //同步函数
  478. CB_TED_PixRad_GetHardwareStatus TED_PixRad_GetHardwareStatus;
  479. CB_TED_PixRad_GetDetectorHardwareStatus TED_PixRad_GetDetectorHardwareStatus;
  480. CB_TED_PixRad_GetWifiStatus TED_PixRad_GetWifiStatus;
  481. CB_TED_PixRad_GetDetectorWifiStatus TED_PixRad_GetDetectorWifiStatus;
  482. CB_TED_PixRad_GetSystemStatus TED_PixRad_GetSystemStatus;
  483. CB_TED_PixRad_GetSystemState TED_PixRad_GetSystemState;
  484. CB_TED_PixRad_LoadReferences TED_PixRad_LoadReferences;
  485. CB_TED_PixRad_DarkCalibration TED_PixRad_DarkCalibration;
  486. //DarkCalibration --- 先从quiet切换到reference,然后EVT_START_DARK_CALIBRATION,最后EVT_END_DARK_CALIBRATION,再切换到standby状态
  487. CB_TED_PixRad_XRayCalibration TED_PixRad_XRayCalibration;
  488. CB_TED_PixRad_CancelSequence TED_PixRad_CancelSequence;
  489. CB_TED_PixRad_SetActiveDetector TED_PixRad_SetActiveDetector;
  490. CB_TED_PixRad_GetActiveDetector TED_PixRad_GetActiveDetector;
  491. CB_TED_PixRad_PerformDetectorSelfTest TED_PixRad_PerformDetectorSelfTest;
  492. CB_TED_PixRad_SwitchSSID TED_PixRad_SwitchSSID;
  493. CB_TED_PixRad_ResumeSequence TED_PixRad_ResumeSequence;
  494. CB_TED_PixRad_SetSystemState TED_PixRad_SetSystemState;
  495. CB_TED_PixRad_UnregisterEventCallback TED_PixRad_UnregisterEventCallback;
  496. CB_TED_PixRad_UnregisterOutputMsgCallback TED_PixRad_UnregisterOutputMsgCallback;
  497. CB_TED_PixRad_ModulePolling TED_PixRad_ModulePolling;
  498. CB_TED_PixRad_ModuleSwitchSSID TED_PixRad_ModuleSwitchSSID;
  499. CB_TED_PixRad_ModuleSetNetworkConfig TED_PixRad_ModuleSetNetworkConfig;
  500. CB_TED_PixRad_ModuleSetIpConfig TED_PixRad_ModuleSetIpConfig;
  501. CB_TED_PixRad_Connect TED_PixRad_Connect;
  502. CB_TED_PixRad_Disconnect TED_PixRad_Disconnect;
  503. CB_TED_PixRad_DetectorControl TED_PixRad_DetectorControl;
  504. CB_TED_PixRad_RecoverLastImage TED_PixRad_RecoverLastImage;
  505. CB_TED_PixRad_GetLastAcquisitionData TED_PixRad_GetLastAcquisitionData;
  506. CB_TED_PixRad_DetectorStatusPolling TED_PixRad_DetectorStatusPolling;
  507. CB_TED_PixRad_GetVoltage TED_PixRad_GetVoltage;
  508. CB_TED_PixRad_SetImageMetadata TED_PixRad_SetImageMetadata;
  509. CB_TED_PixRad_GetStoredImageList TED_PixRad_GetStoredImageList;
  510. CB_TED_PixRad_GetStoredImage TED_PixRad_GetStoredImage;
  511. CB_TED_PixRad_RemoveStoredImage TED_PixRad_RemoveStoredImage;
  512. CB_TED_PixRad_ModuleGetInfo TED_PixRad_ModuleGetInfo;
  513. CB_TED_PixRad_SetApplicationParameters TED_PixRad_SetApplicationParameters;
  514. CB_TED_PixRad_ApplicationAcquisition TED_PixRad_ApplicationAcquisition;
  515. CB_TED_PixRad_GetDetectorInformation TED_PixRad_GetDetectorInformation;
  516. CB_TED_PixRad_ApplicationControl TED_PixRad_ApplicationControl;
  517. CB_TED_PixRad_RemoveAllStoredImages TED_PixRad_RemoveAllStoredImages;
  518. CB_TED_PixRad_GetSystemCalibrationTimeStatus TED_PixRad_GetSystemCalibrationTimeStatus;
  519. CB_TED_PixRad_OpenRemoteStorageSession TED_PixRad_OpenRemoteStorageSession;
  520. CB_TED_PixRad_CloseRemoteStorageSession TED_PixRad_CloseRemoteStorageSession;
  521. CB_TED_PixRad_RemoteStorageUploadFile TED_PixRad_RemoteStorageUploadFile;
  522. CB_TED_PixRad_RemoteStorageDownloadFile TED_PixRad_RemoteStorageDownloadFile;
  523. CB_TED_PixRad_RemoteStorageCreateDirectory TED_PixRad_RemoteStorageCreateDirectory;
  524. CB_TED_PixRad_SaveImage TED_PixRad_SaveImage;
  525. CB_TED_PixRad_LoadImage TED_PixRad_LoadImage;
  526. CB_TED_PixRad_TransferStoredImages TED_PixRad_TransferStoredImages;
  527. ResDataObject m_ModeConfig;
  528. ResDataObject m_ObjFPDsInfo; //存储探测器数量和类型
  529. };