DIOS.Dev.FPDDeviceMould.hpp 32 KB

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