CCOS.Dev.FPDDeviceMould.hpp 32 KB

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