DIOS.Dev.FPDDeviceMould.hpp 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  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. constexpr auto ImagerPixelSpacing = "ImagerPixelSpacing";
  164. constexpr auto DistanceSourcetoDetector = "DistanceSourcetoDetector";
  165. constexpr auto DistanceSourcetoPatient = "DistanceSourcetoPatient";
  166. constexpr auto EstimatedRadiographicMagnificationFactor = "EstimatedRadiographicMagnificationFactor";
  167. constexpr auto DetectorElementSpacing = "DetectorElementSpacing";
  168. }
  169. namespace nsDev = CCOS::Dev;
  170. //-----------------------------------------------------------------------------
  171. // AcqUnit
  172. //-----------------------------------------------------------------------------
  173. class _CCOSDEVFPDDEVICEMOULD_API AcqUnit : public IOLogicUnit, public IODeviceDetail
  174. {
  175. string m_strZskkFPDState;
  176. string m_strNoNeedWaitImage;
  177. string m_strLastImage;
  178. string m_strAutonumousMapFinish;
  179. string m_strFluPPS;
  180. string m_strMaxFrameRate;
  181. string m_strAcqMode;
  182. DWORD m_nFullWidth;
  183. DWORD m_nFullHeight;
  184. DWORD m_nPrevWidth;
  185. DWORD m_nPrevHeight;
  186. DWORD m_nBits;
  187. PVOID m_pFullImageQueue;
  188. PVOID m_pPrevImageData;
  189. protected:
  190. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  191. public:
  192. AcqUnit();
  193. ~AcqUnit();
  194. std::string GetGUID() const override { return DetectorAcqType; }
  195. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  196. RET_STATUS JSGetAcqMode(std::string& out);
  197. RET_STATUS JSSetAcqMode(std::string in, std::string& out);
  198. RET_STATUS JSSetGainMode(std::string in, std::string& out);
  199. RET_STATUS JSSetBinningMode(std::string in, std::string& out);
  200. RET_STATUS JSSetZoomMode(std::string in, std::string& out);
  201. RET_STATUS JSSetDemoImage(std::string in, std::string& out);
  202. RET_STATUS JSGetZskkFPDState(std::string& out);
  203. RET_STATUS SetZskkFPDState(string in);
  204. RET_STATUS JSGetNoNeedWaitImage(std::string& out);
  205. RET_STATUS JSSetNoNeedWaitImage(std::string in);
  206. RET_STATUS JSGetLastImage(std::string& out);
  207. RET_STATUS JSSetFluPPS(std::string in, std::string& out);
  208. RET_STATUS JSGetFluPPS(std::string& out);
  209. RET_STATUS JSGetMaxFrameRate(std::string& out);
  210. RET_STATUS JSAutonumousMapFinish(std::string& out);
  211. DWORD AddFrame(IMAGE_VIEW_TYPE Type, string ImageHead, WORD* pFrameBuff, DWORD FrameSize);
  212. RET_STATUS OEM_IF AddFrameWithRawHead(IMAGE_VIEW_TYPE Type, string ImageHead, WORD* pFrameBuff, DWORD FrameSize);
  213. bool OEM_IF SetMaxBlockSize(const char* pQueName, DWORD BlockSize, DWORD FulBlockCount, DWORD PrevBlockCount);
  214. bool OEM_IF SetFulImageInfo(DWORD Height, DWORD Width, DWORD Bits, bool FetchFlag);
  215. bool OEM_IF SetPrevImageInfo(bool Support, DWORD Height, DWORD Width, bool FetchFlag);
  216. bool OEM_IF FlipX(WORD* pData, UINT nWidth, UINT nHeight);
  217. bool OEM_IF FlipY(WORD* pData, UINT nWidth, UINT nHeight);
  218. bool OEM_IF RotateImage(WORD* imageBuffer, int nImageHeight, int nImageWidth, int nAngle);
  219. void OEM_IF SetMaxFrameRate(float fMaxFrameRate);
  220. void OEM_NOTIFY SendNoNeedWaitImage(bool bflag);
  221. void OEM_NOTIFY SendAutonumousMapFinish(int bFlag);
  222. void OEM_NOTIFY FluPPSNotify(float nCurrentFps);
  223. void OEM_NOTIFY AcqModeNotify(string strAcqMode);
  224. void OEM_NOTIFY ImagerPixelSpacingNotify(int nPixelSpacing);
  225. void OEM_NOTIFY SidNotify(float fSid);
  226. void OEM_NOTIFY SodNotify(float fSod);
  227. void OEM_NOTIFY ErmfNotify(float fErmf);
  228. protected:
  229. virtual RET_STATUS SetAcqMode(int mode) = 0;
  230. virtual RET_STATUS SetGainMode(float nGain);
  231. virtual RET_STATUS SetBinningMode(int nBinningX, int nBinningY);
  232. virtual RET_STATUS SetZoomMode(int nZOOMX1, int nZOOMY1, int nZOOMX2, int nZOOMY2);
  233. virtual RET_STATUS SetDemoImage(string strFile);
  234. virtual RET_STATUS SetFluPPS(float fFluPPS);
  235. virtual RET_STATUS GetFluPPS(float& fFluPPS);
  236. };
  237. //-----------------------------------------------------------------------------
  238. // SyncUnit
  239. //-----------------------------------------------------------------------------
  240. class _CCOSDEVFPDDEVICEMOULD_API SyncUnit : public IOLogicUnit, public IODeviceDetail
  241. {
  242. string m_strReady4EXP;
  243. string m_strXwindowStatus;
  244. string m_strFPDExpReady;
  245. string m_strXrayON;
  246. string m_strConnectStatus;
  247. string m_strImageReadingStatus;
  248. string m_strSupportSyncMode;
  249. protected:
  250. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  251. public:
  252. SyncUnit();
  253. ~SyncUnit();
  254. std::string GetGUID() const override { return DetectorSyncType; }
  255. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  256. RET_STATUS JSSetSyncMode(std::string in, std::string& out);
  257. RET_STATUS JSGetSyncMode(std::string& out);
  258. RET_STATUS JSSetXwindowSize(std::string in, std::string& out);
  259. RET_STATUS JSSetFrameRate(std::string in, std::string& out);
  260. RET_STATUS JSPrepareAcquisition(std::string in, std::string& out);
  261. RET_STATUS JSStartAcquisition(std::string in, std::string& out);
  262. RET_STATUS JSStopAcquisition(std::string in, std::string& out);
  263. RET_STATUS JSActiveSyncMode(std::string in, std::string& out);
  264. RET_STATUS JSGetFPDReady(std::string& out);
  265. RET_STATUS JSSetFPDReady(std::string in);
  266. RET_STATUS JSGetConnectStatus(std::string& out);
  267. RET_STATUS JSGetXrayON(std::string& out);
  268. RET_STATUS JSGetImageReadingStatus(std::string& out);
  269. RET_STATUS JSSetImageReadingStatus(std::string in);
  270. RET_STATUS JSGetExpReadyStatus(std::string& out);
  271. RET_STATUS JSGetXWindowStatus(std::string& out);
  272. RET_STATUS JSSetXWindowStatus(std::string in);
  273. RET_STATUS JSGetSupportSyncMode(std::string& out);
  274. RET_STATUS JSSetSupportSyncMode(std::string in);
  275. void OEM_NOTIFY FPDReadyNotify(bool bReady);
  276. void OEM_NOTIFY FPDConnectStatusNotify(bool bConnect);
  277. void OEM_NOTIFY XWindowOnNotify();
  278. void OEM_NOTIFY XWindowOffNotify();
  279. void OEM_NOTIFY FakeEIPONNotify();
  280. void OEM_NOTIFY XrayONNotify();
  281. void OEM_NOTIFY XrayOffNNotify();
  282. void OEM_NOTIFY ImageReadingNotify();
  283. void OEM_NOTIFY ExpReadyNotify(int nMillisecond);
  284. protected:
  285. virtual RET_STATUS SetSyncMode(SYNC_MODE nSyncMode, HARDWARE_TRIGGER_MODE TriggerMode) = 0;
  286. virtual RET_STATUS GetSyncMode(SYNC_MODE& nSyncMode);
  287. virtual RET_STATUS SetXwindow(float XwindowSize) = 0;
  288. virtual RET_STATUS SetFrameRate(float fFrameRate);
  289. virtual RET_STATUS PrepareAcquisition() = 0;
  290. virtual RET_STATUS StartAcquisition(string in = "") = 0;
  291. virtual RET_STATUS StopAcquisition() = 0;
  292. virtual RET_STATUS ActiveSyncMode(int nSyncMode) = 0;
  293. };
  294. //-----------------------------------------------------------------------------
  295. // CalibUnit
  296. //-----------------------------------------------------------------------------
  297. class _CCOSDEVFPDDEVICEMOULD_API CalibUnit : public IOLogicUnit, public IODeviceDetail
  298. {
  299. CCOS_CALIBRATION_TYPE m_CurrentCalibType;
  300. CCOS_CALIBRATION_STATUS m_CalibStatus;
  301. string m_strCalibProgress;
  302. string m_strUploadCalibrationFilesResult;
  303. string m_strSaveCalibrationFileFinish;
  304. protected:
  305. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  306. public:
  307. CalibUnit();
  308. ~CalibUnit();
  309. std::string GetGUID() const override { return DetectorCalibType; }
  310. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  311. RET_STATUS JSActiveCalibration(std::string in, std::string& out);
  312. RET_STATUS JSGetRequestedDose(std::string in, std::string& out);
  313. RET_STATUS JSSetRequestedDose(std::string in, std::string& out);
  314. RET_STATUS JSPrepareCalibration(std::string in, std::string& out);
  315. RET_STATUS JSStartCalibration(std::string in, std::string& out);
  316. RET_STATUS JSStopCalibration(std::string in, std::string& out);
  317. RET_STATUS JSSetSID(std::string in, std::string& out);
  318. RET_STATUS JSSetCorrectionType(std::string in, std::string& out);
  319. RET_STATUS JSUploadCalibrationFiles(std::string in, std::string& out);
  320. RET_STATUS JSGetCalibrationStep(std::string in, std::string& out);
  321. RET_STATUS JSAcceptCalibration(std::string in, std::string& out);
  322. RET_STATUS JSRejectCalibration(std::string in, std::string& out);
  323. RET_STATUS JSSaveCalibrationFile(std::string in, std::string& out);
  324. RET_STATUS JSGetCalibStatus(std::string& out);
  325. RET_STATUS JSGetCalibProgress(std::string& out);
  326. RET_STATUS JSGetUploadCalibrationFilesResult(std::string& out);
  327. RET_STATUS JSGetSupportCalibrationType(std::string& out);
  328. RET_STATUS JSGetHaveImgCalibration(std::string& out);
  329. RET_STATUS JSGetSaveCalibrationFileFinish(std::string& out);
  330. RET_STATUS OEM_IF PauseCalibration();
  331. RET_STATUS SetCalibrationStatus(string in);
  332. RET_STATUS SetCalibrationProgress(string in);
  333. RET_STATUS SetUploadCalibrationFilesResult(string in);
  334. void OEM_IF SetSaveCalibrationFileFinish(bool bResult);
  335. CCOS_CALIBRATION_TYPE OEM_IF GetCalibrationType();
  336. CCOS_CALIBRATION_STATUS OEM_IF GetCalibrationStatus();
  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. };
  355. //-----------------------------------------------------------------------------
  356. // DetectorCtrlUnit
  357. //-----------------------------------------------------------------------------
  358. class _CCOSDEVFPDDEVICEMOULD_API DetectorCtrlUnit : public IOLogicUnit, public IODeviceDetail
  359. {
  360. DETECTOR_STATUS m_DetectorStatus;
  361. DETECTOR_SHARE_STATUS m_DetectorConnectStatus;
  362. string m_strUpdateFWStatus;
  363. string m_strInitialStatus;
  364. string m_strAttachStatus;
  365. string m_strAttachResult;
  366. string m_strShockSensor;
  367. string m_strRecoverImageState;
  368. string m_strRecoverImageEvent;
  369. string m_strFieldofViewShape;
  370. string m_strFieldofViewDimension;
  371. string m_strDetectorType;
  372. string m_strDescription;
  373. string m_strDetectorID;
  374. string m_strDateofLastDetectorCalibration;
  375. string m_strTimeofLastDetectorCalibration;
  376. string m_strDetectorConditionsNominalFlag;
  377. string m_strFPDSensitivity;
  378. string m_strFPDSensitivityResult;
  379. string m_strPixelData;
  380. string m_strTargetEXI;
  381. string m_strFirmwareStatus;
  382. string m_strSupportDDR;
  383. protected:
  384. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  385. public:
  386. DetectorCtrlUnit();
  387. ~DetectorCtrlUnit();
  388. std::string GetGUID() const override { return DetectorCtrlType; }
  389. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  390. //Action
  391. RET_STATUS JSRESET(std::string in, std::string& out);
  392. RET_STATUS JSActiveDetector(std::string in, std::string& out);
  393. RET_STATUS JSWakeupDetector(std::string in, std::string& out);
  394. RET_STATUS JSEnterExam(std::string in, std::string& out);
  395. RET_STATUS JSExitExam(std::string in, std::string& out);
  396. RET_STATUS JSAttachConnect(std::string in, std::string& out);
  397. RET_STATUS JSCancelAttach(std::string in, std::string& out);
  398. RET_STATUS JSGetDetectorInfo(std::string in, std::string& out);
  399. RET_STATUS JSResetConnect(std::string in, std::string& out);
  400. RET_STATUS JSDisConnectFPD(std::string in, std::string& out);
  401. RET_STATUS JSDisConnectFPDForce(std::string in, std::string& out);
  402. RET_STATUS JSUpdateFirmware(std::string in, std::string& out);
  403. RET_STATUS JSRecoverImage(std::string in, std::string& out);
  404. RET_STATUS JSSaveSensitivity(std::string in, std::string& out);
  405. RET_STATUS JSSetXrayOnNum(std::string in, std::string& out);
  406. RET_STATUS JSSetExposureTimes(std::string in, std::string& out);
  407. RET_STATUS JSGetRecoverImageState(std::string in, std::string& out);
  408. //Get Set
  409. RET_STATUS OEM_IF SetDetectorStatus(string in);
  410. RET_STATUS JSGetFPDStatus(std::string& out);
  411. RET_STATUS OEM_IF SetConnectStatus(string in);
  412. RET_STATUS JSGetConnectStatus(std::string& out);
  413. RET_STATUS OEM_IF SetAttachResult(string in);
  414. RET_STATUS JSGetAttachResult(std::string& out);
  415. RET_STATUS OEM_IF SetAttachStatus(string in);
  416. RET_STATUS JSGetAttachStatus(std::string& out);
  417. RET_STATUS OEM_IF SetInitialStatus(string in);
  418. RET_STATUS JSGetInitialStatus(std::string& out);
  419. RET_STATUS OEM_IF SetUpdateFWStatus(string in);
  420. RET_STATUS JSGetUpdateFWStatus(std::string& out);
  421. RET_STATUS OEM_IF SetShockSensorInfo(string in);
  422. RET_STATUS JSGetShockSensorInfo(std::string& out);
  423. RET_STATUS OEM_IF SetRecoverImageState(string in);
  424. RET_STATUS JSGetRecoverImageState(std::string& out);
  425. RET_STATUS OEM_IF SetRecoverImageEvent(string in);
  426. RET_STATUS JSGetRecoverImageEvent(std::string& out);
  427. RET_STATUS OEM_IF SetFieldofViewShape(string in);
  428. RET_STATUS JSGetFieldofViewShape(std::string& out);
  429. RET_STATUS OEM_IF SetFieldofViewDimension(string in);
  430. RET_STATUS JSGetFieldofViewDimension(std::string& out);
  431. RET_STATUS OEM_IF SetDetectorType(string in);
  432. RET_STATUS JSGetDetectorType(std::string& out);
  433. RET_STATUS OEM_IF SetDescription(string in);
  434. RET_STATUS JSGetDescription(std::string& out);
  435. RET_STATUS OEM_IF SetDetectorID(string in);
  436. RET_STATUS JSGetDetectorID(std::string& out);
  437. RET_STATUS OEM_IF SetDateofLastDetectorCalibration(string in);
  438. RET_STATUS JSGetDateofLastDetectorCalibration(std::string& out);
  439. RET_STATUS OEM_IF SetTimeofLastDetectorCalibration(string in);
  440. RET_STATUS JSGetTimeofLastDetectorCalibration(std::string& out);
  441. RET_STATUS OEM_IF SetDetectorConditionsNominalFlag(string in);
  442. RET_STATUS JSGetDetectorConditionsNominalFlag(std::string& out);
  443. RET_STATUS OEM_IF SetFPDSensitivity(string in);
  444. RET_STATUS JSGetFPDSensitivity(std::string& out);
  445. RET_STATUS OEM_IF SetFPDSensitivityResult(string in);
  446. RET_STATUS JSGetFPDSensitivityResult(std::string& out);
  447. RET_STATUS OEM_IF SetPixelData(string in);
  448. RET_STATUS JSGetPixelData(std::string& out);
  449. RET_STATUS OEM_IF SetTargetEXI(string in);
  450. RET_STATUS JSGetTargetEXI(std::string& out);
  451. //DDR
  452. RET_STATUS OEM_IF SetSupportDDR(string in);
  453. RET_STATUS JSGetSupportDDR(std::string& out);
  454. //DDR
  455. RET_STATUS OEM_IF SetLastError(string in);
  456. RET_STATUS JSGetLastError(std::string& out);
  457. RET_STATUS JSSetFilterType(std::string in, std::string& out);
  458. RET_STATUS OEM_IF SetFirmwareStatus(string in);
  459. RET_STATUS JSGetFirmwareStatus(std::string& out);
  460. RET_STATUS JSSaveRawDataMode(std::string in, std::string& out);
  461. RET_STATUS JSOfflineFPD(std::string in, std::string& out);
  462. RET_STATUS JSOnlineFPD(std::string in, std::string& out);
  463. RET_STATUS JSGetAutonumousImageList(std::string in, std::string& out);
  464. RET_STATUS JSRemoveAutonumousImageList(std::string in, std::string& out);
  465. RET_STATUS JSRemoveAutonumousAll(std::string in, std::string& out);
  466. RET_STATUS JSGetImageMetaData(std::string in, std::string& out);
  467. RET_STATUS JSExportAutonumousAll(std::string in, std::string& out);
  468. DETECTOR_STATUS GetDetectorStatus();
  469. protected:
  470. virtual RET_STATUS ActiveDetector(bool bActive) = 0;
  471. virtual RET_STATUS EnterExam(int nExamStatus) = 0;
  472. virtual RET_STATUS GetDetectorInfo(string& strFDI) = 0;
  473. virtual RET_STATUS RESET();
  474. virtual RET_STATUS WakeupDetector();
  475. virtual RET_STATUS ExitExam();
  476. virtual RET_STATUS AttachConnect();
  477. virtual RET_STATUS CancelAttach();
  478. virtual RET_STATUS ResetConnect();
  479. virtual RET_STATUS DisConnectFPD();
  480. virtual RET_STATUS DisConnectFPDForce();
  481. virtual RET_STATUS UpdateFirmware();
  482. virtual RET_STATUS RecoverImage(bool bRecoverIt);
  483. virtual RET_STATUS SaveSensitivity();
  484. virtual RET_STATUS SetXrayOnNum();
  485. virtual RET_STATUS SetExposureTimes(int nTimes);
  486. virtual RET_STATUS GetRecoverImageState(string& strREI);
  487. virtual RET_STATUS SetFilterType(int nFilter);
  488. virtual RET_STATUS SaveRawDataMode(int nSaveRawDataMode);
  489. virtual RET_STATUS OfflineFPD(int nOfflineFPDMode);
  490. virtual RET_STATUS OnlineFPD(int nOnlineFPDMode);
  491. virtual RET_STATUS GetAutonumousImageList(int nDetectorID, vector<string>& AutonumousList);
  492. virtual RET_STATUS RemoveAutonumousImageList(string strMeta);
  493. virtual RET_STATUS RemoveAutonumousAll();
  494. virtual RET_STATUS GetImageMetaData(string strMetaData);
  495. virtual RET_STATUS ExportAutonumousAll();
  496. };
  497. //-----------------------------------------------------------------------------
  498. // ConfigInfo
  499. //-----------------------------------------------------------------------------
  500. class _CCOSDEVFPDDEVICEMOULD_API ConfigInfo
  501. {
  502. public:
  503. ConfigInfo(const char* Key, const char* strType, const char* strAccess, const char* strRequired, const char* strDefaultValue);
  504. virtual ~ConfigInfo();
  505. void SetList(const char* str);
  506. void SetRange(const char* strmin, const char* strmax);
  507. const char* GetCurrentValue();
  508. void SetCurrentValue(const char* res);
  509. const char* GetDescription();
  510. const char* GetKey();
  511. private:
  512. std::string strConfKey;
  513. std::string resValue;
  514. std::string resDescription;
  515. };
  516. //-----------------------------------------------------------------------------
  517. // FPDDeviceMould
  518. //-----------------------------------------------------------------------------
  519. class _CCOSDEVFPDDEVICEMOULD_API FPDDeviceMould : public IODeviceDetail
  520. {
  521. public:
  522. FPDDeviceMould();
  523. ~FPDDeviceMould();
  524. //protected:
  525. // virtual void RegisterCtrl();
  526. // virtual void RegisterAcq();
  527. // virtual void RegisterSync();
  528. // virtual void RegisterCalib();
  529. // virtual void RegisterOthers();
  530. };
  531. }
  532. namespace CCOS::Dev::Detail::Detector
  533. {
  534. class _CCOSDEVFPDDEVICEMOULD_API FPDDriverMould : public CCOS::Dev::IODriver
  535. {
  536. public:
  537. FPDDriverMould();
  538. ~FPDDriverMould();
  539. public:
  540. virtual std::string GetGUID() const;
  541. //virtual void Prepare() override;
  542. //virtual int Connect() override;
  543. //virtual void Disconnect() override;
  544. //virtual bool isConnected() const override;
  545. //virtual void FireNotify(int code, std::string key, std::string content) override;
  546. //virtual auto CreateDevice(int index)->std::unique_ptr <IODevice> override;
  547. //virtual std::string DriverProbe() override;
  548. //virtual std::string GetResource() override;
  549. //virtual std::string DeviceProbe() override;
  550. void AddConfig(ConfigInfo config);
  551. protected:
  552. std::list <ConfigInfo> m_ConfigInfo;
  553. };
  554. }