DIOS.Dev.FPDDeviceMould.hpp 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. #pragma once
  2. #include <string>
  3. #include "ResDataObject.h"
  4. #include "Detector_Model_Def.h"
  5. #include "CCOSConfigurations.h"
  6. #include "CCOS.Dev.IODevice.hpp"
  7. #include "CCOS.Dev.IODevice.Detail.hpp"
  8. #include "BatteryMould.hpp"
  9. #include "TemperatureMould.hpp"
  10. #include "WifiMould.hpp"
  11. #ifndef CCOSDEVFPDDEVICEMOULD_EXPORTS
  12. #ifdef _WIN64
  13. #pragma message("import WIN64 CCOSDEVFPDDEVICEMOULD")
  14. #ifdef _DEBUG
  15. #pragma message("import WIN64 Debug CCOSDEVFPDDEVICEMOULD")
  16. #pragma comment(lib, "CCOS.Dev.FPDDeviceMould64D.lib")
  17. #else
  18. #pragma message("import WIN64 Release CCOSDEVFPDDEVICEMOULD")
  19. #pragma comment(lib, "CCOS.Dev.FPDDeviceMould64.lib")
  20. #endif
  21. #else
  22. #ifdef _DEBUG
  23. #pragma comment(lib, "CCOS.Dev.FPDDeviceMouldD.lib")
  24. #else
  25. #pragma comment(lib, "CCOS.Dev.FPDDeviceMould.lib")
  26. #endif
  27. #endif
  28. #endif
  29. #ifdef CCOSDEVFPDDEVICEMOULD_EXPORTS
  30. #define _CCOSDEVFPDDEVICEMOULD_API __declspec(dllexport)
  31. #else
  32. #define _CCOSDEVFPDDEVICEMOULD_API __declspec(dllimport)
  33. #endif
  34. namespace ConfKey
  35. {
  36. static const char* CcosDetectorType = "DetectorVender";
  37. static const char* CcosDetectorModel = "DetectorModel";
  38. static const char* CcosDetectorConfig = "DeviceConfig";
  39. static const char* CcosDetectorAttribute = "Attribute";
  40. static const char* CcosDetectorDescription = "Description";
  41. static const char* CcosDetectorSerialNumber = "SerialNumber";
  42. static const char* CcosWiredIP = "WiredIP";
  43. static const char* CcosWirelessIP = "WirelessIP";
  44. static const char* CcosLocalIP = "LocalIP";
  45. static const char* CcosSyncType = "SyncType";
  46. static const char* CcosWorkStation = "WorkStation";
  47. static const char* CcosTempMaxLimit = "TempMaxLimit";
  48. static const char* CcosTempUpperLimit = "TempUpperLimit";
  49. static const char* CcosTempLowerLimit = "TempLowerLimit";
  50. static const char* CcosTempMinLimit = "TempMinLimit";
  51. static const char* CcosBatLowerLimit = "BatLowerLimit";
  52. static const char* CcosBatMiniLimit = "BatMiniLimit";
  53. static const char* CcosWifiLowerLimit = "WifiLowerLimit";
  54. static const char* CcosWifiMiniLimit = "WifiMiniLimit";
  55. static const char* CcosImageFullWidth = "ImageFullWidth";
  56. static const char* CcosImageFullHeight = "ImageFullHeight";
  57. static const char* CcosShowTemperature = "ShowTemperature";
  58. static const char* CcosShowWifi = "ShowWifi";
  59. static const char* CcosShowBattery = "ShowBattery";
  60. static const char* CcosShowBluetooth = "ShowBluetooth";
  61. static const char* CcosIsConnect = "IsConnect";
  62. }
  63. namespace ActionKey
  64. {
  65. //DetecorCtrl
  66. static const char* GetDetectorInfo = "GetFPDinformation";
  67. static const char* CcosActiveDetector = "ActiveDetector";
  68. static const char* RESET = "RESET";
  69. static const char* EnterExam = "EnterExam";
  70. static const char* ExitExam = "ExitExam";
  71. static const char* AttachConnect = "AttachConnect";
  72. static const char* CancelAttach = "CancelAttach";
  73. static const char* RecoverImage = "RecoverImage";
  74. static const char* ResetConnect = "ResetConnect";
  75. static const char* DisConnectFPD = "DisConnectFPD";
  76. static const char* UpdateFirmware = "UpdateFirmware";
  77. static const char* SaveSensitivity = "SaveSensitivity";
  78. constexpr auto SetXrayOnNum = "SetXrayOnNum";
  79. constexpr auto SetExposureTimes = "SetExposureTimes";
  80. //Synchronization
  81. static const char* SetAcqMode = "SetAcqMode";
  82. static const char* SetSyncMode = "SetSyncMode";
  83. static const char* SetXwindowSize = "SetXwindowSize";
  84. static const char* PrepareAcquisition = "PrepareAcquisition";
  85. static const char* StartAcquisition = "StartAcquisition";
  86. static const char* StopAcquisition = "StopAcquisition";
  87. //Calibration
  88. static const char* SetSID = "SetSID";
  89. static const char* ActiveCalibration = "ActiveCalibration";
  90. static const char* PrepareCalibration = "PrepareCalibration";
  91. static const char* StartCalibration = "StartCalibration";
  92. static const char* StopCalibration = "StopCalibration";
  93. static const char* SetCorrectionType = "SetCorrectionType";
  94. static const char* UploadCalibrationFiles = "UploadCalibrationFiles";
  95. constexpr auto GetRequestedDose = "GetRequestedDose";
  96. }
  97. namespace AttrKey
  98. {
  99. //sensor status
  100. static const char* GetTemperatureValue = "GetTemperatureValue";
  101. static const char* GetRemainPowerValue = "GetRemainPowerValue";
  102. static const char* 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. //DetecorCtrl
  107. static const char* DetectorStatus = "DetectorStatus";
  108. static const char* DetectorConnectStatus = "DetectorConnectStatus";
  109. static const char* DetectorAttach = "DetectorAttach";
  110. static const char* DetectorAttachedFlag = "FPDAttached";
  111. static const char* DetectorInitialStatus = "DetectorInitialStatus";
  112. static const char* DetectorUpdateFWStatus = "DetectorUpdateFWStatus";
  113. static const char* FPDShockSensorInfo = "FPDShockSensorInfo";
  114. static const char* SaveRawDataMode = "SaveRawDataMode";
  115. //Calibration
  116. static const char* CalibrationStatus = "CalibrationStatus";
  117. static const char* CalibrationProgress = "CalibrationProgress";
  118. static const char* UploadCalibrationFilesResult = "UploadCalibrationFilesResult";
  119. constexpr auto SupportCalibrationType = "SupportCalibrationType";
  120. //Synchronization
  121. static const char* FPDReadyStatus = "FPDReadyStatus";
  122. static const char* XwindowStatus = "XwindowStatus";
  123. static const char* ImageReadingStatus = "ImageReadingStatus";
  124. static const char* ZskkFPDState = "ZskkFPDState";
  125. constexpr auto FPDExpReady = "FPDExpReady";
  126. //Acquisition
  127. static const char* NoNeedWaitImage = "NoNeedWaitImage";
  128. static const char* ImgDataInfo = "ImgDataInfo";
  129. static const char* AutonumousMapFinish = "AutonumousMapFinish";
  130. //DICOM
  131. static const char* DetectorType = "DetectorType";
  132. static const char* Description = "Description";
  133. static const char* DetectorID = "DetectorID";
  134. static const char* FieldofViewShape = "FieldofViewShape";
  135. static const char* FieldofViewDimension = "FieldofViewDimension";
  136. static const char* DateofLastDetectorCalibration = "DateofLastDetectorCalibration";
  137. static const char* TimeofLastDetectorCalibration = "TimeofLastDetectorCalibration";
  138. static const char* DetectorConditionsNominalFlag = "DetectorConditionsNominalFlag";
  139. static const char* FPDSensitivity = "FPDSensitivity";
  140. static const char* PixelData = "PixelData";
  141. static const char* TargetEXI = "TargetEXI";
  142. //超声相关
  143. static const char* ProbeType = "ProbeType";//探头类型 线阵 凸阵
  144. static const char* ProbeMode = "ProbeMode";//帧类型 B模式图 C模式图
  145. static const char* BGain = "BGain";//B模式增益
  146. static const char* BDepth = "BDepth";//B模式深度档位
  147. static const char* BDepthCm = "BDepthCm";//B模式深度值
  148. static const char* BFrequency = "BFrequency";//B模式帧率
  149. static const char* BFocus = "BFocus";//B模式焦点档位
  150. static const char* BFocusCm = "BFocusCm";//B模式焦点值
  151. static const char* BDynamicRange = "BDynamicRange";//B模式动态范围
  152. static const char* BHarmonic = "BHarmonic";//B模式谐波开关
  153. static const char* BPower = "BPower";//B模式能量值
  154. static const char* CxLeft = "CxLeft";//C模式ROI范围(X轴左侧值)
  155. static const char* CxRight = "CxRight";//C模式ROI范围(X轴右侧值)
  156. static const char* CyTop = "CyTop";//C模式ROI范围(Y轴上方值)
  157. static const char* CyBottom = "CyBottom";//C模式ROI范围(Y轴下方值)
  158. static const char* CGain = "CGain";//C模式增益
  159. static const char* CFrequency = "CFrequency";//C模式帧率
  160. static const char* CSpeedWallFilter = "CSpeedWallFilter";//C模式速度璧滤波
  161. static const char* CRangeWallFilter = "CRangeWallFilter";//C模式幅度璧滤波
  162. static const char* CPersistence = "CPersistence";//C模式余辉
  163. static const char* CLinearAngle = "CLinearAngle";//C模式线阵偏转角
  164. static const char* CPrf = "CPrf";//C模式Prf??不知道什么意思
  165. static const char* PostLevel = "PostLevel";//后处理级别
  166. static const char* Mirror = "Mirror";//是否镜像模式
  167. }
  168. namespace CCOS::Dev::Detail::Detector
  169. {
  170. static const char* DetectorDriverType = "{18CAB88A-C61C-4BB2-AC28-184FDD4FD160}";
  171. static const char* UltrasonicDriverType = "{636A944E-AD06-4099-910F-B519253C2715}";
  172. static const char* DetectorUnitType = "{A209866C-A049-4A17-B5C9-421974E59D68}";
  173. static const char* UltrasonicUnitType = "{B74BFF35-BFFB-412F-BC5D-5657E7535E87}";
  174. static const char* DetectorAcqType = "{A209866C-A049-4A17-B5C9-421974000000}";
  175. static const char* DetectorSyncType = "{A209866C-A049-4A17-B5C9-421974000001}";
  176. static const char* DetectorCalibType = "{A209866C-A049-4A17-B5C9-421974000002}";
  177. static const char* DetectorCtrlType = "{A209866C-A049-4A17-B5C9-421974000003}";
  178. //-----------------------------------------------------------------------------
  179. // AcqUnit
  180. //-----------------------------------------------------------------------------
  181. namespace nsDev = CCOS::Dev;
  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. DWORD m_nFullWidth;
  189. DWORD m_nFullHeight;
  190. DWORD m_nPrevWidth;
  191. DWORD m_nPrevHeight;
  192. DWORD m_nBits;
  193. PVOID m_pFullImageQueue;
  194. PVOID m_pPrevImageData;
  195. protected:
  196. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  197. public:
  198. AcqUnit();
  199. ~AcqUnit();
  200. std::string GetGUID() const override { return DetectorAcqType; }
  201. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  202. RET_STATUS JSSetAcqMode(std::string in, std::string & out);
  203. RET_STATUS JSSetGainMode(std::string in, std::string & out);
  204. RET_STATUS JSSetBinningMode(std::string in, std::string & out);
  205. RET_STATUS JSSetZoomMode(std::string in, std::string & out);
  206. RET_STATUS JSSetDemoImage(std::string in, std::string & out);
  207. RET_STATUS JSGetZskkFPDState(std::string & out);
  208. bool OEM_IF SetZskkFPDState(ZSKK_FPD_STATE state);
  209. RET_STATUS JSGetNoNeedWaitImage(std::string & out);
  210. void OEM_NOTIFY SendNoNeedWaitImage(bool bflag);
  211. RET_STATUS JSGetLastImage(std::string & out);
  212. RET_STATUS OEM_IF AddFrameWithRawHead(IMAGE_VIEW_TYPE Type, string ImageHead, unsigned char* pFrameBuff, DWORD FrameSize);
  213. bool OEM_IF SetMaxBlockSize(const char *pQueName, DWORD BlockSize, DWORD FulBlockCount, DWORD PrevBlockCount);
  214. bool OEM_IF SetFulImageInfo(DWORD Height, DWORD Width, DWORD Bits, bool FetchFlag);
  215. bool OEM_IF SetPrevImageInfo(bool Support, DWORD Height, DWORD Width, bool FetchFlag);
  216. DWORD AddFrame(IMAGE_VIEW_TYPE Type, string ImageHead, WORD* pFrameBuff, DWORD FrameSize);
  217. bool OEM_IF FlipX(WORD* pData, UINT nWidth, UINT nHeight);
  218. bool OEM_IF FlipY(WORD* pData, UINT nWidth, UINT nHeight);
  219. bool OEM_IF RotateImage(WORD* imageBuffer, int nImageHeight, int nImageWidth, int nAngle);
  220. RET_STATUS JSAutonumousMapFinish(std::string& out);
  221. void OEM_NOTIFY SendAutonumousMapFinish(int bFlag);
  222. //超声相关
  223. RET_STATUS JSSetFreeze(std::string in, std::string& out);
  224. RET_STATUS JSSwitchProbe(std::string in, std::string& out);
  225. RET_STATUS JSSwitchProbeMode(std::string in, std::string& out);
  226. RET_STATUS JSSetBGain(std::string in, std::string& out);
  227. RET_STATUS JSSetBDepth(std::string in, std::string& out);
  228. RET_STATUS JSSetBFrequency(std::string in, std::string& out);
  229. RET_STATUS JSSetBFocus(std::string in, std::string& out);
  230. RET_STATUS JSSetBHarmonic(std::string in, std::string& out);
  231. RET_STATUS JSSetBPower(std::string in, std::string& out);
  232. RET_STATUS JSSetBDynamicRange(std::string in, std::string& out);
  233. RET_STATUS JSGetBDepth(std::string in, std::string& out);
  234. RET_STATUS JSGetBFrequency(std::string in, std::string& out);
  235. RET_STATUS JSGetBGain(std::string in, std::string& out);
  236. RET_STATUS JSGetBFocus(std::string in, std::string& out);
  237. RET_STATUS JSGetBDynamicRange(std::string in, std::string& out);
  238. RET_STATUS JSSetCRoi(std::string in, std::string& out);
  239. RET_STATUS JSSetCGain(std::string in, std::string& out);
  240. RET_STATUS JSSetPostLevel(std::string in, std::string& out);
  241. RET_STATUS JSSetMirror(std::string in, std::string& out);
  242. RET_STATUS JSSetCFrequency(std::string in, std::string& out);
  243. RET_STATUS JSSetCSpeedWallFilter(std::string in, std::string& out);
  244. RET_STATUS JSSetCRangeWallFilter(std::string in, std::string& out);
  245. RET_STATUS JSSetCPersistence(std::string in, std::string& out);
  246. RET_STATUS JSSetCLinearAngle(std::string in, std::string& out);
  247. RET_STATUS JSSetCPrf(std::string in, std::string& out);
  248. RET_STATUS JSGetCFrequency(std::string in, std::string& out);
  249. RET_STATUS JSGetCGain(std::string in, std::string& out);
  250. RET_STATUS JSGetCPrf(std::string in, std::string& out);
  251. RET_STATUS JSGetCLinearAngle(std::string in, std::string& out);
  252. //调节图像亮暗的
  253. RET_STATUS JSSetTgc1(std::string in, std::string& out);
  254. RET_STATUS JSSetTgc2(std::string in, std::string& out);
  255. RET_STATUS JSSetTgc3(std::string in, std::string& out);
  256. RET_STATUS JSSetTgc4(std::string in, std::string& out);
  257. RET_STATUS JSSetTgc5(std::string in, std::string& out);
  258. RET_STATUS JSSetTgc6(std::string in, std::string& out);
  259. RET_STATUS JSSetTgc7(std::string in, std::string& out);
  260. RET_STATUS JSSetTgc8(std::string in, std::string& out);
  261. void OEM_NOTIFY NotifyProbeType(int nProbeType);
  262. protected:
  263. virtual RET_STATUS SetAcqMode(int mode) = 0;
  264. virtual RET_STATUS SetGainMode(float nGain);
  265. virtual RET_STATUS SetBinningMode(int nBinningX, int nBinningY);
  266. virtual RET_STATUS SetZoomMode(int nZOOMX1, int nZOOMY1, int nZOOMX2, int nZOOMY2);
  267. virtual RET_STATUS SetDemoImage(string strFile);
  268. //超声相关
  269. virtual RET_STATUS SetFreeze(int nFreeze);
  270. virtual RET_STATUS SwitchProbe(int nProbeType);//切换探头
  271. virtual RET_STATUS SwitchProbeMode(int nProbeMode);//切换模式
  272. virtual RET_STATUS SetBGain(int nGain);
  273. virtual RET_STATUS SetBDepth(int nDepth);
  274. virtual RET_STATUS SetBFrequency(float fFrequency);
  275. virtual RET_STATUS SetBFocus(int nFocus);
  276. virtual RET_STATUS SetBHarmonic(int nHarmonic);
  277. virtual RET_STATUS SetBPower(int nPower);
  278. virtual RET_STATUS SetBDynamicRange(int nRange);
  279. virtual RET_STATUS GetBDepth(int& nDepth,float& fDepthCm);
  280. virtual RET_STATUS GetBFrequency(float& fFrequency);
  281. virtual RET_STATUS GetBGain(int& nGain);
  282. virtual RET_STATUS GetBFocus(int& nFocus,float& fFocusCm);
  283. virtual RET_STATUS GetBDynamicRange(int& nRange);
  284. virtual RET_STATUS SetCRoi(int x1,int x2,int y1,int y2);
  285. virtual RET_STATUS SetCGain(int nGain);
  286. virtual RET_STATUS SetPostLevel(int nLevel);
  287. virtual RET_STATUS SetMirror(int nMirror);
  288. virtual RET_STATUS SetCFrequency(float fFrequency);
  289. virtual RET_STATUS SetCSpeedWallFilter(int nSpeedWallFilter);
  290. virtual RET_STATUS SetCRangeWallFilter(int nRangeWallFilter);
  291. virtual RET_STATUS SetCPersistence(int nPersistence);
  292. virtual RET_STATUS SetCLinearAngle(int nAngle);
  293. virtual RET_STATUS SetCPrf(int nPrf);
  294. virtual RET_STATUS GetCFrequency(float& fFrequency);
  295. virtual RET_STATUS GetCGain(int& nGain);
  296. virtual RET_STATUS GetCPrf(int& nPrf);
  297. virtual RET_STATUS GetCLinearAngle(int& nAngle);
  298. //调节图像亮暗的
  299. virtual RET_STATUS SetTgc1(int nTgc);
  300. virtual RET_STATUS SetTgc2(int nTgc);
  301. virtual RET_STATUS SetTgc3(int nTgc);
  302. virtual RET_STATUS SetTgc4(int nTgc);
  303. virtual RET_STATUS SetTgc5(int nTgc);
  304. virtual RET_STATUS SetTgc6(int nTgc);
  305. virtual RET_STATUS SetTgc7(int nTgc);
  306. virtual RET_STATUS SetTgc8(int nTgc);
  307. };
  308. //-----------------------------------------------------------------------------
  309. // SyncUnit
  310. //-----------------------------------------------------------------------------
  311. class _CCOSDEVFPDDEVICEMOULD_API SyncUnit : public IOLogicUnit, public IODeviceDetail
  312. {
  313. string m_strReady4EXP;
  314. string m_strXwindowStatus;
  315. string m_strFPDExpReady;
  316. string m_strXrayON;
  317. string m_strConnectStatus;
  318. protected:
  319. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  320. public:
  321. SyncUnit();
  322. ~SyncUnit();
  323. std::string GetGUID() const override { return DetectorSyncType; }
  324. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  325. RET_STATUS JSSetSyncMode(std::string in, std::string & out);
  326. RET_STATUS JSGetSyncMode(std::string& out);
  327. RET_STATUS JSSetXwindowSize(std::string in, std::string & out);
  328. RET_STATUS JSSetFrameRate(std::string in, std::string& out);
  329. RET_STATUS JSSetFluPPS(std::string in, std::string & out);
  330. RET_STATUS JSPrepareAcquisition(std::string in, std::string& out);
  331. RET_STATUS JSStartAcquisition(std::string in, std::string& out);
  332. RET_STATUS JSStopAcquisition(std::string in, std::string& out);
  333. RET_STATUS JSGetFPDReady(std::string& out);
  334. RET_STATUS JSGetConnectStatus(std::string & out);
  335. RET_STATUS JSGetXrayON(std::string& out)
  336. {
  337. out = m_strXrayON;
  338. return RET_STATUS::RET_SUCCEED;
  339. }
  340. void OEM_NOTIFY FPDReadyNotify(bool bReady);
  341. void OEM_NOTIFY FPDConnectStatusNotify(bool bConnect);
  342. RET_STATUS JSGetXWindowStatus(std::string & out);
  343. void OEM_NOTIFY XWindowOnNotify();
  344. void OEM_NOTIFY XWindowOffNotify();
  345. void OEM_NOTIFY FakeEIPONNotify();
  346. void OEM_NOTIFY XrayONNotify();
  347. void OEM_NOTIFY XrayOffNNotify();
  348. RET_STATUS JSGetImageReadingStatus(std::string & out);
  349. void OEM_NOTIFY ImageReadingNotify();
  350. RET_STATUS JSGetExpReadyStatus(std::string& out);
  351. void OEM_NOTIFY ExpReadyNotify(int nMillisecond);
  352. protected:
  353. virtual RET_STATUS SetSyncMode(SYNC_MODE nSyncMode, HARDWARE_TRIGGER_MODE TriggerMode) = 0;
  354. virtual RET_STATUS GetSyncMode(SYNC_MODE &nSyncMode);
  355. virtual RET_STATUS SetXwindow(float XwindowSize) = 0;
  356. virtual RET_STATUS SetFrameRate(float fFrameRate);
  357. virtual RET_STATUS SetFluPPS(float fFluPPS);
  358. virtual RET_STATUS PrepareAcquisition() = 0;
  359. virtual RET_STATUS StartAcquisition(string in = "") = 0;
  360. virtual RET_STATUS StopAcquisition() = 0;
  361. };
  362. //-----------------------------------------------------------------------------
  363. // CalibUnit
  364. //-----------------------------------------------------------------------------
  365. class _CCOSDEVFPDDEVICEMOULD_API CalibUnit : public IOLogicUnit, public IODeviceDetail
  366. {
  367. CCOS_CALIBRATION_TYPE m_CurrentCalibType;
  368. CCOS_CALIBRATION_STATUS m_CalibStatus;
  369. string m_strCalibProgress;
  370. string m_strUploadCalibrationFilesResult;
  371. string m_strSaveCalibrationFileFinish;
  372. protected:
  373. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  374. public:
  375. CalibUnit();
  376. ~CalibUnit();
  377. std::string GetGUID() const override { return DetectorCalibType; }
  378. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  379. RET_STATUS JSActiveCalibration(std::string in, std::string & out);
  380. RET_STATUS JSGetRequestedDose(std::string in, std::string & out);
  381. RET_STATUS JSSetRequestedDose(std::string in, std::string& out);
  382. RET_STATUS JSPrepareCalibration(std::string in, std::string& out);
  383. RET_STATUS JSStartCalibration(std::string in, std::string& out);
  384. RET_STATUS JSStopCalibration(std::string in, std::string& out);
  385. RET_STATUS OEM_IF PauseCalibration();
  386. RET_STATUS JSSetSID(std::string in, std::string& out);
  387. RET_STATUS JSSetCorrectionType(std::string in, std::string & out);
  388. RET_STATUS JSUploadCalibrationFiles(std::string in, std::string & out);
  389. RET_STATUS JSGetCalibrationStep(std::string in, std::string& out);
  390. RET_STATUS JSAcceptCalibration(std::string in, std::string& out);
  391. RET_STATUS JSRejectCalibration(std::string in, std::string& out);
  392. RET_STATUS JSSaveCalibrationFile(std::string in, std::string& out);
  393. CCOS_CALIBRATION_STATUS OEM_IF GetCalibrationStatus();
  394. void OEM_IF SetCalibrationStatus(CCOS_CALIBRATION_STATUS Status);
  395. RET_STATUS JSGetCalibStatus(std::string & out);
  396. void OEM_IF SetCalibrationProgress(DWORD progress);
  397. RET_STATUS JSGetCalibProgress(std::string & out);
  398. CCOS_CALIBRATION_TYPE OEM_IF GetCalibrationType();
  399. RET_STATUS JSGetUploadCalibrationFilesResult(std::string & out);
  400. void OEM_IF SetUploadCalibrationFilesResult(bool bResult);
  401. RET_STATUS JSGetSupportCalibrationType(std::string & out);
  402. RET_STATUS JSGetHaveImgCalibration(std::string& out);
  403. RET_STATUS JSGetSaveCalibrationFileFinish(std::string& out);
  404. void OEM_IF SetSaveCalibrationFileFinish(bool bResult);
  405. protected:
  406. virtual RET_STATUS SetSID(int nSID) = 0;
  407. virtual RET_STATUS ActiveCalibration(CCOS_CALIBRATION_TYPE in) = 0;
  408. virtual RET_STATUS PrepareCalibration() = 0;
  409. virtual RET_STATUS GetRequestedDose(std::string& out) = 0;
  410. virtual RET_STATUS SetRequestedDose(std::string in);
  411. virtual RET_STATUS StartCalibration() = 0;
  412. virtual RET_STATUS StopCalibration() = 0;
  413. virtual RET_STATUS SetCorrectionType(CCOS_CORRECTION_TYPE in) = 0;
  414. virtual RET_STATUS UploadCalibrationFiles(string strFileName) = 0;
  415. virtual bool Support_DarkCalib();
  416. virtual bool Support_XrayCalib();
  417. virtual bool Support_HaveImageCalib();
  418. virtual RET_STATUS GetCalibrationStep(int nDetectorID, string & strCalibrationStepInfo);
  419. virtual RET_STATUS AcceptCalibration();
  420. virtual RET_STATUS RejectCalibration();
  421. virtual RET_STATUS SaveCalibrationFile(bool bSaveFlag);
  422. };
  423. //-----------------------------------------------------------------------------
  424. // CalibUnit
  425. //-----------------------------------------------------------------------------
  426. class _CCOSDEVFPDDEVICEMOULD_API DetectorCtrlUnit : public IOLogicUnit, public IODeviceDetail
  427. {
  428. DETECTOR_STATUS m_DetectorStatus;
  429. DETECTOR_SHARE_STATUS m_DetectorConnectStatus;
  430. string m_strUpdateFWStatus;
  431. string m_strInitialStatus;
  432. string m_strAttachStatus;
  433. string m_strAttachResult;
  434. string m_strShockSensor;
  435. string m_strRecoverImageState;
  436. string m_strRecoverImageEvent;
  437. string m_strFieldofViewShape;
  438. string m_strFieldofViewDimension;
  439. string m_strDetectorType;
  440. string m_strDescription;
  441. string m_strDetectorID;
  442. string m_strDateofLastDetectorCalibration;
  443. string m_strTimeofLastDetectorCalibration;
  444. string m_strDetectorConditionsNominalFlag;
  445. string m_strFPDSensitivity;
  446. string m_strFPDSensitivityResult;
  447. string m_strPixelData;
  448. string m_strTargetEXI;
  449. string m_strFirmwareStatus;
  450. string m_strSupportDDR;
  451. string m_strAcqMode;
  452. protected:
  453. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  454. public:
  455. DetectorCtrlUnit();
  456. ~DetectorCtrlUnit();
  457. std::string GetGUID() const override { return DetectorCtrlType; }
  458. void OEM_IF SetEventCenter(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter);
  459. RET_STATUS JSRESET(std::string in, std::string& out);
  460. RET_STATUS JSActiveDetector(std::string in, std::string & out);
  461. RET_STATUS JSWakeupDetector(std::string in, std::string & out);
  462. RET_STATUS JSEnterExam(std::string in, std::string & out);
  463. RET_STATUS JSExitExam(std::string in, std::string& out);
  464. RET_STATUS JSAttachConnect(std::string in, std::string& out);
  465. RET_STATUS JSCancelAttach(std::string in, std::string& out);
  466. RET_STATUS JSGetDetectorInfo(std::string in, std::string & out);
  467. RET_STATUS JSResetConnect(std::string in, std::string& out);
  468. RET_STATUS JSDisConnectFPD(std::string in, std::string& out);
  469. RET_STATUS JSDisConnectFPDForce(std::string in, std::string& out);
  470. RET_STATUS JSUpdateFirmware(std::string in, std::string& out);
  471. RET_STATUS JSRecoverImage(std::string in, std::string & out);
  472. RET_STATUS JSSaveSensitivity(std::string in, std::string& out);
  473. RET_STATUS JSSetXrayOnNum(std::string in, std::string& out);
  474. RET_STATUS JSSetExposureTimes(std::string in, std::string& out);
  475. RET_STATUS JSGetRecoverImageState(std::string in, std::string& out);
  476. DETECTOR_STATUS OEM_IF GetDetectorStatus();
  477. RET_STATUS OEM_IF SetDetectorStatus(DETECTOR_STATUS status);
  478. RET_STATUS JSGetFPDStatus(std::string & out);
  479. RET_STATUS OEM_IF SetConnectStatus(DETECTOR_SHARE_STATUS nStatus);
  480. RET_STATUS JSGetConnectStatus(std::string & out);
  481. RET_STATUS OEM_IF SetAttachResult(bool result, const char* DetectorType, const char* DetectorSN);
  482. RET_STATUS JSGetAttachResult(std::string & out);
  483. RET_STATUS OEM_IF SetAttachStatus(int nStatus);
  484. RET_STATUS JSGetAttachStatus(std::string & out);
  485. RET_STATUS OEM_IF SetInitialStatus(int nStatus);
  486. RET_STATUS JSGetInitialStatus(std::string & out);
  487. RET_STATUS OEM_IF SetUpdateFWStatus(int nStatus);
  488. RET_STATUS JSGetUpdateFWStatus(std::string & out);
  489. RET_STATUS OEM_IF SetShockSensorInfo(string nStatus);
  490. RET_STATUS JSGetShockSensorInfo(std::string & out);
  491. RET_STATUS OEM_IF SetRecoverImageState(string nStatus);
  492. RET_STATUS JSGetRecoverImageState(std::string & out);
  493. RET_STATUS OEM_IF SetRecoverImageEvent(int nStatus);
  494. RET_STATUS JSGetRecoverImageEvent(std::string & out);
  495. RET_STATUS OEM_IF SetFieldofViewShape(string nStatus);
  496. RET_STATUS JSGetFieldofViewShape(std::string & out);
  497. RET_STATUS OEM_IF SetFieldofViewDimension(string nStatus);
  498. RET_STATUS JSGetFieldofViewDimension(std::string & out);
  499. RET_STATUS OEM_IF SetDetectorType(string nStatus);
  500. RET_STATUS JSGetDetectorType(std::string & out);
  501. RET_STATUS OEM_IF SetDescription(string nStatus);
  502. RET_STATUS JSGetDescription(std::string & out);
  503. RET_STATUS OEM_IF SetDetectorID(string nStatus);
  504. RET_STATUS JSGetDetectorID(std::string & out);
  505. RET_STATUS OEM_IF SetDateofLastDetectorCalibration(string nStatus);
  506. RET_STATUS JSGetDateofLastDetectorCalibration(std::string & out);
  507. RET_STATUS OEM_IF SetTimeofLastDetectorCalibration(string nStatus);
  508. RET_STATUS JSGetTimeofLastDetectorCalibration(std::string & out);
  509. RET_STATUS OEM_IF SetDetectorConditionsNominalFlag(string nStatus);
  510. RET_STATUS JSGetDetectorConditionsNominalFlag(std::string & out);
  511. RET_STATUS OEM_IF SetFPDSensitivity(string nStatus);
  512. RET_STATUS JSGetFPDSensitivity(std::string & out);
  513. RET_STATUS OEM_IF SetFPDSensitivityResult(string nStatus);
  514. RET_STATUS JSGetFPDSensitivityResult(std::string& out);
  515. RET_STATUS OEM_IF SetPixelData(string nStatus);
  516. RET_STATUS JSGetPixelData(std::string & out);
  517. RET_STATUS OEM_IF SetTargetEXI(string nStatus);
  518. RET_STATUS JSGetTargetEXI(std::string & out);
  519. //DDR
  520. RET_STATUS OEM_IF SetSupportDDR(bool bFlag);
  521. RET_STATUS JSGetSupportDDR(std::string& out);
  522. RET_STATUS OEM_IF SetAcqMode(int nMode);
  523. RET_STATUS JSGetAcqMode(std::string& out);
  524. //DDR
  525. RET_STATUS OEM_IF SetLastError(string nStatus);
  526. RET_STATUS JSGetLastError(std::string& out);
  527. RET_STATUS JSSetFilterType(std::string in, std::string& out);
  528. RET_STATUS OEM_IF SetFirmwareStatus(int nStatus);
  529. RET_STATUS JSGetFirmwareStatus(std::string& out);
  530. RET_STATUS JSSaveRawDataMode(std::string in, std::string& out);
  531. RET_STATUS JSOfflineFPD(std::string in, std::string& out);
  532. RET_STATUS JSOnlineFPD(std::string in, std::string& out);
  533. RET_STATUS JSGetAutonumousImageList(std::string in, std::string& out);
  534. RET_STATUS JSRemoveAutonumousImageList(std::string in, std::string& out);
  535. RET_STATUS JSRemoveAutonumousAll(std::string in, std::string& out);
  536. RET_STATUS JSGetImageMetaData(std::string in, std::string& out);
  537. RET_STATUS JSExportAutonumousAll(std::string in, std::string& out);
  538. protected:
  539. virtual RET_STATUS ActiveDetector(bool bActive) = 0;
  540. virtual RET_STATUS EnterExam(int nExamStatus) = 0;
  541. virtual RET_STATUS GetDetectorInfo(string& strFDI) = 0;
  542. virtual RET_STATUS RESET();
  543. virtual RET_STATUS WakeupDetector();
  544. virtual RET_STATUS ExitExam();
  545. virtual RET_STATUS AttachConnect();
  546. virtual RET_STATUS CancelAttach();
  547. virtual RET_STATUS ResetConnect();
  548. virtual RET_STATUS DisConnectFPD();
  549. virtual RET_STATUS DisConnectFPDForce();
  550. virtual RET_STATUS UpdateFirmware();
  551. virtual RET_STATUS RecoverImage(bool bRecoverIt);
  552. virtual RET_STATUS SaveSensitivity();
  553. virtual RET_STATUS SetXrayOnNum();
  554. virtual RET_STATUS SetExposureTimes(int nTimes);
  555. virtual RET_STATUS GetRecoverImageState(string & strREI);
  556. virtual RET_STATUS SetFilterType(int nFilter);
  557. virtual RET_STATUS SaveRawDataMode(int nSaveRawDataMode);
  558. virtual RET_STATUS OfflineFPD(int nOfflineFPDMode);
  559. virtual RET_STATUS OnlineFPD(int nOnlineFPDMode);
  560. virtual RET_STATUS GetAutonumousImageList(int nDetectorID, vector<string>& AutonumousList);
  561. virtual RET_STATUS RemoveAutonumousImageList(string strMeta);
  562. virtual RET_STATUS RemoveAutonumousAll();
  563. virtual RET_STATUS GetImageMetaData(string strMetaData);
  564. virtual RET_STATUS ExportAutonumousAll();
  565. };
  566. class _CCOSDEVFPDDEVICEMOULD_API ConfigInfo
  567. {
  568. public:
  569. ConfigInfo(const char* Key, const char* strType, const char* strAccess, const char* strRequired, const char* strDefaultValue);
  570. virtual ~ConfigInfo();
  571. void SetList(const char* str);
  572. void SetRange(const char* strmin, const char* strmax);
  573. const char* GetCurrentValue();
  574. void SetCurrentValue(const char* res);
  575. const char* GetDescription();
  576. const char* GetKey();
  577. private:
  578. std::string strConfKey;
  579. std::string resValue;
  580. std::string resDescription;
  581. };
  582. //-----------------------------------------------------------------------------
  583. // FPDDeviceMould
  584. //-----------------------------------------------------------------------------
  585. class _CCOSDEVFPDDEVICEMOULD_API FPDDeviceMould : public IODeviceDetail
  586. {
  587. public:
  588. FPDDeviceMould(/*std::shared_ptr <IOEventCenter> center*/);
  589. ~FPDDeviceMould();
  590. };
  591. }
  592. namespace CCOS::Dev::Detail::Detector
  593. {
  594. class _CCOSDEVFPDDEVICEMOULD_API FPDDriverMould : public CCOS::Dev::IODriver
  595. {
  596. public:
  597. FPDDriverMould();
  598. ~FPDDriverMould();
  599. public:
  600. virtual std::string GetGUID() const;
  601. //virtual void Prepare() override;
  602. //virtual int Connect() override;
  603. //virtual void Disconnect() override;
  604. //virtual bool isConnected() const override;
  605. //virtual void FireNotify(int code, std::string key, std::string content) override;
  606. //virtual auto CreateDevice(int index)->std::unique_ptr <IODevice> override;
  607. //virtual std::string DriverProbe() override;
  608. //virtual std::string GetResource() override;
  609. //virtual std::string DeviceProbe() override;
  610. void AddConfig(ConfigInfo config);
  611. protected:
  612. std::list <ConfigInfo> m_ConfigInfo;
  613. };
  614. }