DIOS.Dev.FPDDeviceMould.hpp 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. #pragma once
  2. #include <string>
  3. #include "ResDataObject.h"
  4. #include "Detector_Model_Def.h"
  5. #include "CCOSConfigurations.h"
  6. #include "CCOS.Dev.IODevice.hpp"
  7. #include "CCOS.Dev.IODevice.Detail.hpp"
  8. #include "BatteryMould.hpp"
  9. #include "TemperatureMould.hpp"
  10. #include "WifiMould.hpp"
  11. #ifndef CCOSDEVFPDDEVICEMOULD_EXPORTS
  12. #ifdef _WIN64
  13. #pragma message("import WIN64 CCOSDEVFPDDEVICEMOULD")
  14. #ifdef _DEBUG
  15. #pragma message("import WIN64 Debug CCOSDEVFPDDEVICEMOULD")
  16. #pragma comment(lib, "CCOS.Dev.FPDDeviceMould64D.lib")
  17. #else
  18. #pragma message("import WIN64 Release CCOSDEVFPDDEVICEMOULD")
  19. #pragma comment(lib, "CCOS.Dev.FPDDeviceMould64.lib")
  20. #endif
  21. #else
  22. #ifdef _DEBUG
  23. #pragma comment(lib, "CCOS.Dev.FPDDeviceMouldD.lib")
  24. #else
  25. #pragma comment(lib, "CCOS.Dev.FPDDeviceMould.lib")
  26. #endif
  27. #endif
  28. #endif
  29. #ifdef CCOSDEVFPDDEVICEMOULD_EXPORTS
  30. #define _CCOSDEVFPDDEVICEMOULD_API __declspec(dllexport)
  31. #else
  32. #define _CCOSDEVFPDDEVICEMOULD_API __declspec(dllimport)
  33. #endif
  34. namespace CCOS::Dev::Detail::Detector
  35. {
  36. static const char* DetectorDriverType = "{18CAB88A-C61C-4BB2-AC28-184FDD4FD160}";
  37. static const char* DetectorUnitType = "{A209866C-A049-4A17-B5C9-421974E59D68}";
  38. static const char* DetectorAcqType = "{A209866C-A049-4A17-B5C9-421974000000}";
  39. static const char* DetectorSyncType = "{A209866C-A049-4A17-B5C9-421974000001}";
  40. static const char* DetectorCalibType = "{A209866C-A049-4A17-B5C9-421974000002}";
  41. static const char* DetectorCtrlType = "{A209866C-A049-4A17-B5C9-421974000003}";
  42. namespace ConfKey
  43. {
  44. constexpr auto CcosDetectorType = "DetectorVender";
  45. constexpr auto CcosDetectorModel = "DetectorModel";
  46. constexpr auto CcosDetectorConfig = "DeviceConfig";
  47. constexpr auto CcosDetectorAttribute = "Attribute";
  48. constexpr auto CcosDetectorDescription = "Description";
  49. constexpr auto CcosDetectorSerialNumber = "SerialNumber";
  50. constexpr auto CcosWiredIP = "WiredIP";
  51. constexpr auto CcosWirelessIP = "WirelessIP";
  52. constexpr auto CcosLocalIP = "LocalIP";
  53. constexpr auto CcosSyncType = "SyncType";
  54. constexpr auto CcosWorkStation = "WorkStation";
  55. constexpr auto CcosTempMaxLimit = "TempMaxLimit";
  56. constexpr auto CcosTempUpperLimit = "TempUpperLimit";
  57. constexpr auto CcosTempLowerLimit = "TempLowerLimit";
  58. constexpr auto CcosTempMinLimit = "TempMinLimit";
  59. constexpr auto CcosBatLowerLimit = "BatLowerLimit";
  60. constexpr auto CcosBatMiniLimit = "BatMiniLimit";
  61. constexpr auto CcosWifiLowerLimit = "WifiLowerLimit";
  62. constexpr auto CcosWifiMiniLimit = "WifiMiniLimit";
  63. constexpr auto CcosImageFullWidth = "ImageFullWidth";
  64. constexpr auto CcosImageFullHeight = "ImageFullHeight";
  65. constexpr auto CcosShowTemperature = "ShowTemperature";
  66. constexpr auto CcosShowWifi = "ShowWifi";
  67. constexpr auto CcosShowBattery = "ShowBattery";
  68. constexpr auto CcosShowBluetooth = "ShowBluetooth";
  69. constexpr auto CcosIsConnect = "IsConnect";
  70. }
  71. namespace ActionKey
  72. {
  73. //DetecorCtrl
  74. constexpr auto GetDetectorInfo = "GetFPDinformation";
  75. constexpr auto CcosActiveDetector = "ActiveDetector";
  76. constexpr auto RESET = "RESET";
  77. constexpr auto EnterExam = "EnterExam";
  78. constexpr auto ExitExam = "ExitExam";
  79. constexpr auto AttachConnect = "AttachConnect";
  80. constexpr auto CancelAttach = "CancelAttach";
  81. constexpr auto RecoverImage = "RecoverImage";
  82. constexpr auto ResetConnect = "ResetConnect";
  83. constexpr auto DisConnectFPD = "DisConnectFPD";
  84. constexpr auto UpdateFirmware = "UpdateFirmware";
  85. constexpr auto SaveSensitivity = "SaveSensitivity";
  86. constexpr auto SetXrayOnNum = "SetXrayOnNum";
  87. constexpr auto SetExposureTimes = "SetExposureTimes";
  88. constexpr auto SetValue_PPS = "SetValue_PPS";
  89. //Synchronization
  90. constexpr auto SetAcqMode = "SetAcqMode";
  91. constexpr auto SetSyncMode = "SetSyncMode";
  92. constexpr auto SetXwindowSize = "SetXwindowSize";
  93. constexpr auto PrepareAcquisition = "PrepareAcquisition";
  94. constexpr auto StartAcquisition = "StartAcquisition";
  95. constexpr auto StopAcquisition = "StopAcquisition";
  96. //Calibration
  97. constexpr auto SetSID = "SetSID";
  98. constexpr auto ActiveCalibration = "ActiveCalibration";
  99. constexpr auto PrepareCalibration = "PrepareCalibration";
  100. constexpr auto StartCalibration = "StartCalibration";
  101. constexpr auto StopCalibration = "StopCalibration";
  102. constexpr auto SetCorrectionType = "SetCorrectionType";
  103. constexpr auto UploadCalibrationFiles = "UploadCalibrationFiles";
  104. constexpr auto GetRequestedDose = "GetRequestedDose";
  105. constexpr auto SetRequestedDose = "SetRequestedDose";
  106. constexpr auto AcceptCalibration = "AcceptCalibration";
  107. constexpr auto RejectCalibration = "RejectCalibration";
  108. constexpr auto SaveCalibrationFile = "SaveCalibrationFile";
  109. constexpr auto GetCalibrationStep = "GetCalibrationStep";
  110. }
  111. namespace AttrKey
  112. {
  113. //sensor status
  114. constexpr auto GetTemperatureValue = "GetTemperatureValue";
  115. constexpr auto GetRemainPowerValue = "GetRemainPowerValue";
  116. constexpr auto GetWifiStrengthValue = "GetWifiStrengthValue";
  117. constexpr auto Temperature_Value = "Temperature_Value";
  118. constexpr auto Remain_Power_Value = "Remain_Power_Value";
  119. constexpr auto Wifi_Strength_Value = "Wifi_Strength_Value";
  120. //DetecorCtrl
  121. constexpr auto DetectorStatus = "DetectorStatus";
  122. constexpr auto DetectorConnectStatus = "DetectorConnectStatus";
  123. constexpr auto DetectorAttach = "DetectorAttach";
  124. constexpr auto DetectorAttachedFlag = "FPDAttached";
  125. constexpr auto DetectorInitialStatus = "DetectorInitialStatus";
  126. constexpr auto DetectorUpdateFWStatus = "DetectorUpdateFWStatus";
  127. constexpr auto FPDShockSensorInfo = "FPDShockSensorInfo";
  128. constexpr auto SaveRawDataMode = "SaveRawDataMode";
  129. //Calibration
  130. constexpr auto CalibrationStatus = "CalibrationStatus";
  131. constexpr auto CalibrationProgress = "CalibrationProgress";
  132. constexpr auto UploadCalibrationFilesResult = "UploadCalibrationFilesResult";
  133. constexpr auto SupportCalibrationType = "SupportCalibrationType";
  134. constexpr auto SaveCalibrationFileFinish = "SaveCalibrationFileFinish";
  135. constexpr auto HaveImgCalibration = "HaveImgCalibration";
  136. //Synchronization
  137. constexpr auto FPDReadyStatus = "FPDReadyStatus";
  138. constexpr auto XwindowStatus = "XwindowStatus";
  139. constexpr auto ImageReadingStatus = "ImageReadingStatus";
  140. constexpr auto ZskkFPDState = "ZskkFPDState";
  141. constexpr auto FPDExpReady = "FPDExpReady";
  142. constexpr auto XrayON = "XrayON";
  143. constexpr auto SyncMode = "SyncMode";
  144. //Acquisition
  145. constexpr auto NoNeedWaitImage = "NoNeedWaitImage";
  146. constexpr auto ImgDataInfo = "ImgDataInfo";
  147. constexpr auto AutonumousMapFinish = "AutonumousMapFinish";
  148. constexpr auto FluPPS = "FluPPS";
  149. constexpr auto AcqMode = "AcqMode";
  150. constexpr auto MaxFrameRate = "MaxFrameRate";
  151. //DICOM
  152. constexpr auto DetectorType = "DetectorType";
  153. constexpr auto Description = "Description";
  154. constexpr auto DetectorID = "DetectorID";
  155. constexpr auto FieldofViewShape = "FieldofViewShape";
  156. constexpr auto FieldofViewDimension = "FieldofViewDimension";
  157. constexpr auto DateofLastDetectorCalibration = "DateofLastDetectorCalibration";
  158. constexpr auto TimeofLastDetectorCalibration = "TimeofLastDetectorCalibration";
  159. constexpr auto DetectorConditionsNominalFlag = "DetectorConditionsNominalFlag";
  160. constexpr auto FPDSensitivity = "FPDSensitivity";
  161. constexpr auto PixelData = "PixelData";
  162. constexpr auto TargetEXI = "TargetEXI";
  163. }
  164. namespace nsDev = CCOS::Dev;
  165. //-----------------------------------------------------------------------------
  166. // AcqUnit
  167. //-----------------------------------------------------------------------------
  168. class _CCOSDEVFPDDEVICEMOULD_API AcqUnit : public IOLogicUnit, public IODeviceDetail
  169. {
  170. string m_strZskkFPDState;
  171. string m_strNoNeedWaitImage;
  172. string m_strLastImage;
  173. string m_strAutonumousMapFinish;
  174. string m_strFluPPS;
  175. string m_strMaxFrameRate;
  176. string m_strAcqMode;
  177. DWORD m_nFullWidth;
  178. DWORD m_nFullHeight;
  179. DWORD m_nPrevWidth;
  180. DWORD m_nPrevHeight;
  181. DWORD m_nBits;
  182. PVOID m_pFullImageQueue;
  183. PVOID m_pPrevImageData;
  184. protected:
  185. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  186. public:
  187. AcqUnit();
  188. ~AcqUnit();
  189. std::string GetGUID() const override { return DetectorAcqType; }
  190. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  191. RET_STATUS JSGetAcqMode(std::string& out);
  192. RET_STATUS JSSetAcqMode(std::string in, std::string& out);
  193. RET_STATUS JSSetGainMode(std::string in, std::string& out);
  194. RET_STATUS JSSetBinningMode(std::string in, std::string& out);
  195. RET_STATUS JSSetZoomMode(std::string in, std::string& out);
  196. RET_STATUS JSSetDemoImage(std::string in, std::string& out);
  197. RET_STATUS JSGetZskkFPDState(std::string& out);
  198. RET_STATUS SetZskkFPDState(string in);
  199. RET_STATUS JSGetNoNeedWaitImage(std::string& out);
  200. RET_STATUS JSSetNoNeedWaitImage(std::string in);
  201. RET_STATUS JSGetLastImage(std::string& out);
  202. RET_STATUS JSSetFluPPS(std::string in, std::string& out);
  203. RET_STATUS JSGetFluPPS(std::string& out);
  204. RET_STATUS JSGetMaxFrameRate(std::string& out);
  205. RET_STATUS JSAutonumousMapFinish(std::string& out);
  206. DWORD AddFrame(IMAGE_VIEW_TYPE Type, string ImageHead, WORD* pFrameBuff, DWORD FrameSize);
  207. RET_STATUS OEM_IF AddFrameWithRawHead(IMAGE_VIEW_TYPE Type, string ImageHead, WORD* pFrameBuff, DWORD FrameSize);
  208. bool OEM_IF SetMaxBlockSize(const char* pQueName, DWORD BlockSize, DWORD FulBlockCount, DWORD PrevBlockCount);
  209. bool OEM_IF SetFulImageInfo(DWORD Height, DWORD Width, DWORD Bits, bool FetchFlag);
  210. bool OEM_IF SetPrevImageInfo(bool Support, DWORD Height, DWORD Width, bool FetchFlag);
  211. bool OEM_IF FlipX(WORD* pData, UINT nWidth, UINT nHeight);
  212. bool OEM_IF FlipY(WORD* pData, UINT nWidth, UINT nHeight);
  213. bool OEM_IF RotateImage(WORD* imageBuffer, int nImageHeight, int nImageWidth, int nAngle);
  214. void OEM_IF SetMaxFrameRate(float fMaxFrameRate);
  215. void OEM_NOTIFY SendNoNeedWaitImage(bool bflag);
  216. void OEM_NOTIFY SendAutonumousMapFinish(int bFlag);
  217. void OEM_NOTIFY FluPPSNotify(float nCurrentFps);
  218. protected:
  219. virtual RET_STATUS SetAcqMode(int mode) = 0;
  220. virtual RET_STATUS SetGainMode(float nGain);
  221. virtual RET_STATUS SetBinningMode(int nBinningX, int nBinningY);
  222. virtual RET_STATUS SetZoomMode(int nZOOMX1, int nZOOMY1, int nZOOMX2, int nZOOMY2);
  223. virtual RET_STATUS SetDemoImage(string strFile);
  224. virtual RET_STATUS SetFluPPS(float fFluPPS);
  225. virtual RET_STATUS GetFluPPS(float& fFluPPS);
  226. };
  227. //-----------------------------------------------------------------------------
  228. // SyncUnit
  229. //-----------------------------------------------------------------------------
  230. class _CCOSDEVFPDDEVICEMOULD_API SyncUnit : public IOLogicUnit, public IODeviceDetail
  231. {
  232. string m_strReady4EXP;
  233. string m_strXwindowStatus;
  234. string m_strFPDExpReady;
  235. string m_strXrayON;
  236. string m_strConnectStatus;
  237. string m_strImageReadingStatus;
  238. protected:
  239. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  240. public:
  241. SyncUnit();
  242. ~SyncUnit();
  243. std::string GetGUID() const override { return DetectorSyncType; }
  244. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  245. RET_STATUS JSSetSyncMode(std::string in, std::string& out);
  246. RET_STATUS JSGetSyncMode(std::string& out);
  247. RET_STATUS JSSetXwindowSize(std::string in, std::string& out);
  248. RET_STATUS JSSetFrameRate(std::string in, std::string& out);
  249. RET_STATUS JSPrepareAcquisition(std::string in, std::string& out);
  250. RET_STATUS JSStartAcquisition(std::string in, std::string& out);
  251. RET_STATUS JSStopAcquisition(std::string in, std::string& out);
  252. RET_STATUS JSGetFPDReady(std::string& out);
  253. RET_STATUS JSSetFPDReady(std::string in);
  254. RET_STATUS JSGetConnectStatus(std::string& out);
  255. RET_STATUS JSGetXrayON(std::string& out);
  256. RET_STATUS JSGetImageReadingStatus(std::string& out);
  257. RET_STATUS JSSetImageReadingStatus(std::string in);
  258. RET_STATUS JSGetExpReadyStatus(std::string& out);
  259. RET_STATUS JSGetXWindowStatus(std::string& out);
  260. RET_STATUS JSSetXWindowStatus(std::string in);
  261. void OEM_NOTIFY FPDReadyNotify(bool bReady);
  262. void OEM_NOTIFY FPDConnectStatusNotify(bool bConnect);
  263. void OEM_NOTIFY XWindowOnNotify();
  264. void OEM_NOTIFY XWindowOffNotify();
  265. void OEM_NOTIFY FakeEIPONNotify();
  266. void OEM_NOTIFY XrayONNotify();
  267. void OEM_NOTIFY XrayOffNNotify();
  268. void OEM_NOTIFY ImageReadingNotify();
  269. void OEM_NOTIFY ExpReadyNotify(int nMillisecond);
  270. protected:
  271. virtual RET_STATUS SetSyncMode(SYNC_MODE nSyncMode, HARDWARE_TRIGGER_MODE TriggerMode) = 0;
  272. virtual RET_STATUS GetSyncMode(SYNC_MODE& nSyncMode);
  273. virtual RET_STATUS SetXwindow(float XwindowSize) = 0;
  274. virtual RET_STATUS SetFrameRate(float fFrameRate);
  275. virtual RET_STATUS PrepareAcquisition() = 0;
  276. virtual RET_STATUS StartAcquisition(string in = "") = 0;
  277. virtual RET_STATUS StopAcquisition() = 0;
  278. };
  279. //-----------------------------------------------------------------------------
  280. // CalibUnit
  281. //-----------------------------------------------------------------------------
  282. class _CCOSDEVFPDDEVICEMOULD_API CalibUnit : public IOLogicUnit, public IODeviceDetail
  283. {
  284. CCOS_CALIBRATION_TYPE m_CurrentCalibType;
  285. CCOS_CALIBRATION_STATUS m_CalibStatus;
  286. string m_strCalibProgress;
  287. string m_strUploadCalibrationFilesResult;
  288. string m_strSaveCalibrationFileFinish;
  289. string m_strOffsetStatus;
  290. string m_strOffsetCounts;
  291. string m_strOffsetProgress;
  292. string m_strOffsetInterval;
  293. protected:
  294. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  295. public:
  296. CalibUnit();
  297. ~CalibUnit();
  298. std::string GetGUID() const override { return DetectorCalibType; }
  299. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  300. RET_STATUS JSActiveCalibration(std::string in, std::string& out);
  301. RET_STATUS JSGetRequestedDose(std::string in, std::string& out);
  302. RET_STATUS JSSetRequestedDose(std::string in, std::string& out);
  303. RET_STATUS JSPrepareCalibration(std::string in, std::string& out);
  304. RET_STATUS JSStartCalibration(std::string in, std::string& out);
  305. RET_STATUS JSStopCalibration(std::string in, std::string& out);
  306. RET_STATUS JSSetSID(std::string in, std::string& out);
  307. RET_STATUS JSSetCorrectionType(std::string in, std::string& out);
  308. RET_STATUS JSUploadCalibrationFiles(std::string in, std::string& out);
  309. RET_STATUS JSGetCalibrationStep(std::string in, std::string& out);
  310. RET_STATUS JSAcceptCalibration(std::string in, std::string& out);
  311. RET_STATUS JSRejectCalibration(std::string in, std::string& out);
  312. RET_STATUS JSSaveCalibrationFile(std::string in, std::string& out);
  313. RET_STATUS JSGetCalibStatus(std::string& out);
  314. RET_STATUS JSGetCalibProgress(std::string& out);
  315. RET_STATUS JSGetUploadCalibrationFilesResult(std::string& out);
  316. RET_STATUS JSGetSupportCalibrationType(std::string& out);
  317. RET_STATUS JSGetHaveImgCalibration(std::string& out);
  318. RET_STATUS JSGetSaveCalibrationFileFinish(std::string& out);
  319. RET_STATUS JSStartOffset(std::string in, std::string& out);
  320. RET_STATUS JSAbortOffset(std::string in, std::string& out);
  321. RET_STATUS OEM_IF PauseCalibration();
  322. RET_STATUS SetCalibrationStatus(string in);
  323. RET_STATUS SetCalibrationProgress(string in);
  324. RET_STATUS SetUploadCalibrationFilesResult(string in);
  325. void OEM_IF SetSaveCalibrationFileFinish(bool bResult);
  326. CCOS_CALIBRATION_TYPE OEM_IF GetCalibrationType();
  327. CCOS_CALIBRATION_STATUS OEM_IF GetCalibrationStatus();
  328. RET_STATUS JSGetOffsetStatus(std::string& out);
  329. RET_STATUS SetOffsetStatus(std::string in);
  330. RET_STATUS JSGetOffsetCounts(std::string& out);
  331. RET_STATUS SetOffsetCounts(std::string in);
  332. RET_STATUS JSGetOffsetProgress(std::string& out);
  333. RET_STATUS SetOffsetProgress(std::string in);
  334. RET_STATUS JSGetOffsetInterval(std::string& out);
  335. RET_STATUS SetOffsetInterval(std::string in);
  336. RET_STATUS JSUpdateOffsetInterval(std::string in, std::string& out);
  337. protected:
  338. virtual RET_STATUS SetSID(int nSID) = 0;
  339. virtual RET_STATUS ActiveCalibration(CCOS_CALIBRATION_TYPE in) = 0;
  340. virtual RET_STATUS PrepareCalibration() = 0;
  341. virtual RET_STATUS GetRequestedDose(std::string& out) = 0;
  342. virtual RET_STATUS SetRequestedDose(std::string in);
  343. virtual RET_STATUS StartCalibration() = 0;
  344. virtual RET_STATUS StopCalibration() = 0;
  345. virtual RET_STATUS SetCorrectionType(CCOS_CORRECTION_TYPE in) = 0;
  346. virtual RET_STATUS UploadCalibrationFiles(string strFileName) = 0;
  347. virtual RET_STATUS GetCalibrationStep(int nDetectorID, string& strCalibrationStepInfo);
  348. virtual RET_STATUS AcceptCalibration();
  349. virtual RET_STATUS RejectCalibration();
  350. virtual RET_STATUS SaveCalibrationFile(bool bSaveFlag);
  351. virtual bool Support_DarkCalib();
  352. virtual bool Support_XrayCalib();
  353. virtual bool Support_HaveImageCalib();
  354. virtual RET_STATUS StartOffset(bool isAll);
  355. virtual RET_STATUS AbortOffset();
  356. };
  357. //-----------------------------------------------------------------------------
  358. // DetectorCtrlUnit
  359. //-----------------------------------------------------------------------------
  360. class _CCOSDEVFPDDEVICEMOULD_API DetectorCtrlUnit : public IOLogicUnit, public IODeviceDetail
  361. {
  362. DETECTOR_STATUS m_DetectorStatus;
  363. DETECTOR_SHARE_STATUS m_DetectorConnectStatus;
  364. string m_strUpdateFWStatus;
  365. string m_strInitialStatus;
  366. string m_strAttachStatus;
  367. string m_strAttachResult;
  368. string m_strShockSensor;
  369. string m_strRecoverImageState;
  370. string m_strRecoverImageEvent;
  371. string m_strFieldofViewShape;
  372. string m_strFieldofViewDimension;
  373. string m_strDetectorType;
  374. string m_strDescription;
  375. string m_strDetectorID;
  376. string m_strDateofLastDetectorCalibration;
  377. string m_strTimeofLastDetectorCalibration;
  378. string m_strDetectorConditionsNominalFlag;
  379. string m_strFPDSensitivity;
  380. string m_strFPDSensitivityResult;
  381. string m_strPixelData;
  382. string m_strTargetEXI;
  383. string m_strFirmwareStatus;
  384. string m_strSupportDDR;
  385. string m_strDetectorWidth;
  386. string m_strDetectorHeight;
  387. protected:
  388. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  389. public:
  390. DetectorCtrlUnit();
  391. ~DetectorCtrlUnit();
  392. std::string GetGUID() const override { return DetectorCtrlType; }
  393. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  394. //Action
  395. RET_STATUS JSRESET(std::string in, std::string& out);
  396. RET_STATUS JSActiveDetector(std::string in, std::string& out);
  397. RET_STATUS JSWakeupDetector(std::string in, std::string& out);
  398. RET_STATUS JSEnterExam(std::string in, std::string& out);
  399. RET_STATUS JSExitExam(std::string in, std::string& out);
  400. RET_STATUS JSAttachConnect(std::string in, std::string& out);
  401. RET_STATUS JSCancelAttach(std::string in, std::string& out);
  402. RET_STATUS JSGetDetectorInfo(std::string in, std::string& out);
  403. RET_STATUS JSResetConnect(std::string in, std::string& out);
  404. RET_STATUS JSDisConnectFPD(std::string in, std::string& out);
  405. RET_STATUS JSDisConnectFPDForce(std::string in, std::string& out);
  406. RET_STATUS JSUpdateFirmware(std::string in, std::string& out);
  407. RET_STATUS JSRecoverImage(std::string in, std::string& out);
  408. RET_STATUS JSSaveSensitivity(std::string in, std::string& out);
  409. RET_STATUS JSSetXrayOnNum(std::string in, std::string& out);
  410. RET_STATUS JSSetExposureTimes(std::string in, std::string& out);
  411. RET_STATUS JSGetRecoverImageState(std::string in, std::string& out);
  412. //Get Set
  413. RET_STATUS OEM_IF SetDetectorStatus(string in);
  414. RET_STATUS JSGetFPDStatus(std::string& out);
  415. RET_STATUS OEM_IF SetConnectStatus(string in);
  416. RET_STATUS JSGetConnectStatus(std::string& out);
  417. RET_STATUS OEM_IF SetAttachResult(string in);
  418. RET_STATUS JSGetAttachResult(std::string& out);
  419. RET_STATUS OEM_IF SetAttachStatus(string in);
  420. RET_STATUS JSGetAttachStatus(std::string& out);
  421. RET_STATUS OEM_IF SetInitialStatus(string in);
  422. RET_STATUS JSGetInitialStatus(std::string& out);
  423. RET_STATUS OEM_IF SetUpdateFWStatus(string in);
  424. RET_STATUS JSGetUpdateFWStatus(std::string& out);
  425. RET_STATUS OEM_IF SetShockSensorInfo(string in);
  426. RET_STATUS JSGetShockSensorInfo(std::string& out);
  427. RET_STATUS OEM_IF SetRecoverImageState(string in);
  428. RET_STATUS JSGetRecoverImageState(std::string& out);
  429. RET_STATUS OEM_IF SetRecoverImageEvent(string in);
  430. RET_STATUS JSGetRecoverImageEvent(std::string& out);
  431. RET_STATUS OEM_IF SetFieldofViewShape(string in);
  432. RET_STATUS JSGetFieldofViewShape(std::string& out);
  433. RET_STATUS OEM_IF SetFieldofViewDimension(string in);
  434. RET_STATUS JSGetFieldofViewDimension(std::string& out);
  435. RET_STATUS OEM_IF SetDetectorType(string in);
  436. RET_STATUS JSGetDetectorType(std::string& out);
  437. RET_STATUS OEM_IF SetDescription(string in);
  438. RET_STATUS JSGetDescription(std::string& out);
  439. RET_STATUS OEM_IF SetDetectorID(string in);
  440. RET_STATUS JSGetDetectorID(std::string& out);
  441. RET_STATUS OEM_IF SetDateofLastDetectorCalibration(string in);
  442. RET_STATUS JSGetDateofLastDetectorCalibration(std::string& out);
  443. RET_STATUS OEM_IF SetTimeofLastDetectorCalibration(string in);
  444. RET_STATUS JSGetTimeofLastDetectorCalibration(std::string& out);
  445. RET_STATUS OEM_IF SetDetectorConditionsNominalFlag(string in);
  446. RET_STATUS JSGetDetectorConditionsNominalFlag(std::string& out);
  447. RET_STATUS OEM_IF SetFPDSensitivity(string in);
  448. RET_STATUS JSGetFPDSensitivity(std::string& out);
  449. RET_STATUS OEM_IF SetFPDSensitivityResult(string in);
  450. RET_STATUS JSGetFPDSensitivityResult(std::string& out);
  451. RET_STATUS OEM_IF SetPixelData(string in);
  452. RET_STATUS JSGetPixelData(std::string& out);
  453. RET_STATUS OEM_IF SetTargetEXI(string in);
  454. RET_STATUS JSGetTargetEXI(std::string& out);
  455. //DDR
  456. RET_STATUS OEM_IF SetSupportDDR(string in);
  457. RET_STATUS JSGetSupportDDR(std::string& out);
  458. //DDR
  459. RET_STATUS OEM_IF SetLastError(string in);
  460. RET_STATUS JSGetLastError(std::string& out);
  461. RET_STATUS JSSetFilterType(std::string in, std::string& out);
  462. RET_STATUS OEM_IF SetFirmwareStatus(string in);
  463. RET_STATUS JSGetFirmwareStatus(std::string& out);
  464. RET_STATUS JSSaveRawDataMode(std::string in, std::string& out);
  465. RET_STATUS JSOfflineFPD(std::string in, std::string& out);
  466. RET_STATUS JSOnlineFPD(std::string in, std::string& out);
  467. RET_STATUS JSGetAutonumousImageList(std::string in, std::string& out);
  468. RET_STATUS JSRemoveAutonumousImageList(std::string in, std::string& out);
  469. RET_STATUS JSRemoveAutonumousAll(std::string in, std::string& out);
  470. RET_STATUS JSGetImageMetaData(std::string in, std::string& out);
  471. RET_STATUS JSExportAutonumousAll(std::string in, std::string& out);
  472. RET_STATUS JSGetDetectorWidth(std::string& out);
  473. RET_STATUS OEM_IF SetDetectorWidth(string in);
  474. RET_STATUS JSGetDetectorHeight(std::string& out);
  475. RET_STATUS OEM_IF SetDetectorHeight(string in);
  476. DETECTOR_STATUS GetDetectorStatus();
  477. protected:
  478. virtual RET_STATUS ActiveDetector(bool bActive) = 0;
  479. virtual RET_STATUS EnterExam(int nExamStatus) = 0;
  480. virtual RET_STATUS GetDetectorInfo(string& strFDI) = 0;
  481. virtual RET_STATUS RESET();
  482. virtual RET_STATUS WakeupDetector();
  483. virtual RET_STATUS ExitExam();
  484. virtual RET_STATUS AttachConnect();
  485. virtual RET_STATUS CancelAttach();
  486. virtual RET_STATUS ResetConnect();
  487. virtual RET_STATUS DisConnectFPD();
  488. virtual RET_STATUS DisConnectFPDForce();
  489. virtual RET_STATUS UpdateFirmware();
  490. virtual RET_STATUS RecoverImage(bool bRecoverIt);
  491. virtual RET_STATUS SaveSensitivity();
  492. virtual RET_STATUS SetXrayOnNum();
  493. virtual RET_STATUS SetExposureTimes(int nTimes);
  494. virtual RET_STATUS GetRecoverImageState(string& strREI);
  495. virtual RET_STATUS SetFilterType(int nFilter);
  496. virtual RET_STATUS SaveRawDataMode(int nSaveRawDataMode);
  497. virtual RET_STATUS OfflineFPD(int nOfflineFPDMode);
  498. virtual RET_STATUS OnlineFPD(int nOnlineFPDMode);
  499. virtual RET_STATUS GetAutonumousImageList(int nDetectorID, vector<string>& AutonumousList);
  500. virtual RET_STATUS RemoveAutonumousImageList(string strMeta);
  501. virtual RET_STATUS RemoveAutonumousAll();
  502. virtual RET_STATUS GetImageMetaData(string strMetaData);
  503. virtual RET_STATUS ExportAutonumousAll();
  504. };
  505. //-----------------------------------------------------------------------------
  506. // ConfigInfo
  507. //-----------------------------------------------------------------------------
  508. class _CCOSDEVFPDDEVICEMOULD_API ConfigInfo
  509. {
  510. public:
  511. ConfigInfo(const char* Key, const char* strType, const char* strAccess, const char* strRequired, const char* strDefaultValue);
  512. virtual ~ConfigInfo();
  513. void SetList(const char* str);
  514. void SetRange(const char* strmin, const char* strmax);
  515. const char* GetCurrentValue();
  516. void SetCurrentValue(const char* res);
  517. const char* GetDescription();
  518. const char* GetKey();
  519. private:
  520. std::string strConfKey;
  521. std::string resValue;
  522. std::string resDescription;
  523. };
  524. //-----------------------------------------------------------------------------
  525. // FPDDeviceMould
  526. //-----------------------------------------------------------------------------
  527. class _CCOSDEVFPDDEVICEMOULD_API FPDDeviceMould : public IODeviceDetail
  528. {
  529. public:
  530. FPDDeviceMould();
  531. ~FPDDeviceMould();
  532. //protected:
  533. // virtual void RegisterCtrl();
  534. // virtual void RegisterAcq();
  535. // virtual void RegisterSync();
  536. // virtual void RegisterCalib();
  537. // virtual void RegisterOthers();
  538. };
  539. }
  540. namespace CCOS::Dev::Detail::Detector
  541. {
  542. class _CCOSDEVFPDDEVICEMOULD_API FPDDriverMould : public CCOS::Dev::IODriver
  543. {
  544. public:
  545. FPDDriverMould();
  546. ~FPDDriverMould();
  547. public:
  548. virtual std::string GetGUID() const;
  549. //virtual void Prepare() override;
  550. //virtual int Connect() override;
  551. //virtual void Disconnect() override;
  552. //virtual bool isConnected() const override;
  553. //virtual void FireNotify(int code, std::string key, std::string content) override;
  554. //virtual auto CreateDevice(int index)->std::unique_ptr <IODevice> override;
  555. //virtual std::string DriverProbe() override;
  556. //virtual std::string GetResource() override;
  557. //virtual std::string DeviceProbe() override;
  558. void AddConfig(ConfigInfo config);
  559. protected:
  560. std::list <ConfigInfo> m_ConfigInfo;
  561. };
  562. }