CCOS.Dev.FPDDeviceMould.hpp 31 KB

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