DIOS.Dev.FPD.PZMedicalDF.cpp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. // CCOS.Dev.FPD.PZMedicalDF.cpp: 定义 DLL 的初始化例程。
  2. //
  3. #include "pch.h"
  4. #include "framework.h"
  5. #include "CCOS.Dev.FPD.PZMedicalDF.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #endif
  9. //
  10. //TODO: 如果此 DLL 相对于 MFC DLL 是动态链接的,
  11. // 则从此 DLL 导出的任何调入
  12. // MFC 的函数必须将 AFX_MANAGE_STATE 宏添加到
  13. // 该函数的最前面。
  14. //
  15. // 例如:
  16. //
  17. // extern "C" BOOL PASCAL EXPORT ExportedFunction()
  18. // {
  19. // AFX_MANAGE_STATE(AfxGetStaticModuleState());
  20. // // 此处为普通函数体
  21. // }
  22. //
  23. // 此宏先于任何 MFC 调用
  24. // 出现在每个函数中十分重要。 这意味着
  25. // 它必须作为以下项中的第一个语句:
  26. // 出现,甚至先于所有对象变量声明,
  27. // 这是因为它们的构造函数可能生成 MFC
  28. // DLL 调用。
  29. //
  30. // 有关其他详细信息,
  31. // 请参阅 MFC 技术说明 33 和 58。
  32. //
  33. // CCCOSDevFPDPZMedicalDFApp
  34. BEGIN_MESSAGE_MAP(CCCOSDevFPDPZMedicalDFApp, CWinApp)
  35. END_MESSAGE_MAP()
  36. // CCCOSDevFPDPZMedicalDFApp 构造
  37. CCCOSDevFPDPZMedicalDFApp::CCCOSDevFPDPZMedicalDFApp()
  38. {
  39. // TODO: 在此处添加构造代码,
  40. // 将所有重要的初始化放置在 InitInstance 中
  41. }
  42. // 唯一的 CCCOSDevFPDPZMedicalDFApp 对象
  43. CCCOSDevFPDPZMedicalDFApp theApp;
  44. class CAppSettings;
  45. CString strAppPath;
  46. CAppSettings* g_pAcqParam;
  47. extern CString g_strConfFilePath;
  48. extern CString g_strHWConfFilePath;
  49. // CCCOSDevFPDPZMedicalDFApp 初始化
  50. CString strAppDYNHandleName;
  51. CString strAppMechCompHandleName;
  52. CString strAppRFDTHandleName;
  53. CString strAppDRDTHandleName;
  54. CString strAppHardwareHandleName;
  55. CString strAppRFOCHandleName;
  56. CString g_strLogFilePath;
  57. CString g_strHWConfFilePath;
  58. CString g_strConfFilePath;
  59. BOOL CCCOSDevFPDPZMedicalDFApp::InitInstance()
  60. {
  61. CWinApp::InitInstance();
  62. if (!AfxSocketInit())
  63. {
  64. AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
  65. return FALSE;
  66. }
  67. return TRUE;
  68. }
  69. //////////////////////////////////////////////////////////////////
  70. ///
  71. /// 驱动接口,必须实现
  72. ///
  73. //////////////////////////////////////////////////////////////////
  74. void DRV_Prepare()
  75. {
  76. }
  77. bool DRV_DriverEntry(std::string CfgFileName)
  78. {
  79. return true;
  80. }
  81. //返回驱动静态资源,如厂商/序列号/等不会变化的常量信息,包括不限于字典等
  82. std::string DRV_DriverProbe()
  83. {
  84. return "";
  85. }
  86. //为了保持的一定的兼容性,GUID保留,每个公开的值 参考相关文档
  87. std::string DRV_GetGUID()
  88. {
  89. return "";
  90. }
  91. //返回驱动资源,包括各种可能变更的属性、方法等等
  92. std::string DRV_GetResource()
  93. {
  94. return "";
  95. }
  96. //返回该驱动下所有设备的静态资源,如序列号、字典等信息
  97. std::string DRV_DeviceProbe()
  98. {
  99. return "";
  100. }
  101. bool DRV_OnHeartBeat()
  102. {
  103. return true;
  104. }
  105. bool DRV_ReLoadConfig()
  106. {
  107. return true;
  108. }
  109. DEVICE_HANDLE DRV_CreateDevice(int index)
  110. {
  111. return nullptr;
  112. }
  113. void DRV_FreeDevice(DEVICE_HANDLE)
  114. {
  115. }
  116. bool DRV_GetDeviceConfig(std::string& Cfg)
  117. {
  118. return true;
  119. }
  120. bool DRV_SetDeviceConfig(std::string Cfg)
  121. {
  122. return true;
  123. }
  124. int DRV_Get(const std::string attrName, std::string& Out)
  125. {
  126. return 2;
  127. }
  128. int DRV_Set(const std::string attrName, std::string& Out)
  129. {
  130. return 2;
  131. }
  132. /// XXX 为属性名,可以定义任意多个,每次取一个属性值,等同 DRV_GET(XXX,Out)
  133. int DRV_Get_XXX(std::string& Out)
  134. {
  135. return 2;
  136. }
  137. /// XXX 为属性名,可以定义任意多个,每次取一个属性值,等同 DRV_GET(XXX,Out)
  138. int DRV_Set_XXX(std::string& InOut)
  139. {
  140. return 2;
  141. }
  142. //////////////////////////////////////////////////////////////////
  143. ///
  144. /// 通用设备接口 Part1,必须实现
  145. ///
  146. //////////////////////////////////////////////////////////////////
  147. std::string DEV_GetGUID(DEVICE_HANDLE hDev)
  148. {
  149. return "";
  150. }
  151. std::string DEV_GetPath(DEVICE_HANDLE hDev)
  152. {
  153. return "";
  154. }
  155. //这里定义了该设备的模型资源,含属性、方法
  156. std::string DEV_GetResource(DEVICE_HANDLE hDev)
  157. {
  158. return "";
  159. }
  160. void DEV_CompleteInit(DEVICE_HANDLE hDev)
  161. {
  162. }
  163. bool DEV_Prepare(DEVICE_HANDLE hDev)
  164. {
  165. return true;
  166. }
  167. void DEV_CompleteUnInit(DEVICE_HANDLE hDev)
  168. {
  169. }
  170. void DEV_GetSubscribeTopicList(DEVICE_HANDLE hDev, std::vector<string>& TopicList)
  171. {
  172. }
  173. //////////////////////////////////////////////////////////////////
  174. ///
  175. /// 通用设备接口 Part2,通用模型化原始接口实现,ADD/DELETE/UPDATE/ACTION/GET/SET
  176. /// 参考 HTTP RESTFULL,
  177. /// 驱动可以直接实现此接口,无需额外创建接口,适用任意设备
  178. /// DEVPath 为设备路径访问接口,直接访问对应设备路径的方法
  179. /// 各驱动可以根据自己特点,实现一套或者2套,不实现的方法需要返回-2
  180. //////////////////////////////////////////////////////////////////
  181. //int DEV_Add(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out);
  182. //int DEV_Delete(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out);
  183. //int DEV_Update(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out);
  184. //int DEV_Action(DEVICE_HANDLE hDev, const std::string funcName, std::string In, std::string& Out);
  185. //int DEV_Get(DEVICE_HANDLE hDev, const std::string funcName, std::string& Out);
  186. //int DEV_Set(DEVICE_HANDLE hDev, const std::string funcName, std::string In);
  187. //
  188. //int DEVPath_Add(const std::string devPath, const std::string funcName, std::string In, std::string& Out);
  189. //int DEVPath_Delete(const std::string devPath, const std::string funcName, std::string In, std::string& Out);
  190. //int DEVPath_Update(const std::string devPath, const std::string funcName, std::string In, std::string& Out);
  191. //int DEVPath_Action(const std::string devPath, const std::string funcName, std::string In, std::string& Out);
  192. //int DEVPath_Get(const std::string devPath, const std::string funcName, std::string& Out);
  193. //int DEVPath_Set(const std::string devPath, const std::string funcName, std::string In);
  194. //////////////////////////////////////////////////////////////////
  195. ///
  196. /// 设备模型接口 Part3,各中设备的标准方法
  197. /// XXX为属性名或者方法名,用于区分行为的Key
  198. /// 各驱动可以根据自己特点,定义标准方法集合
  199. //////////////////////////////////////////////////////////////////
  200. //实现者需要为每一个创建的设备对象定义模型实现,入口参数为设备时创建的对象句柄,需要自行区分对象与方法的对应
  201. //int DEV_Add_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out);
  202. //int DEV_Delete_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out);
  203. //int DEV_Update_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out);
  204. //int DEV_Action_XXX(DEVICE_HANDLE hDev, std::string In, std::string& Out);
  205. //int DEV_Get_XXX(DEVICE_HANDLE hDev, std::string& Out);
  206. //int DEV_Set_XXX(DEVICE_HANDLE hDev, std::string In);
  207. //实现者需要为每一个逻辑对象的设备路径 定义模型实现,需要自行根据设备路径和 方法进行区分
  208. //int DEVPath_Add_XXX(const std::string devPath, std::string In, std::string& Out);
  209. //int DEVPath_Delete_XXX(const std::string devPath, std::string In, std::string& Out);
  210. //int DEVPath_Update_XXX(const std::string devPath, std::string In, std::string& Out);
  211. //int DEVPath_Action_XXX(const std::string devPath, std::string In, std::string& Out);
  212. //int DEVPath_Get_XXX(const std::string devPath, std::string& Out);
  213. //int DEVPath_Set_XXX(const std::string devPath, std::string In);
  214. //设备树的模型实现
  215. //根设备的模型方法一套
  216. //只有一套接口,就是根设备路径的方法
  217. int DEVPath_Add_XXX_(std::string In, std::string& Out)
  218. {
  219. return 2;
  220. }
  221. int DEVPath_Delete_XXX_(std::string In, std::string& Out)
  222. {
  223. return 2;
  224. }
  225. int DEVPath_Update_XXX_(std::string In, std::string& Out)
  226. {
  227. return 2;
  228. }
  229. int DEVPath_Action_XXX_(std::string In, std::string& Out)
  230. {
  231. return 2;
  232. }
  233. int DEVPath_Get_XXX_(std::string& Out)
  234. {
  235. return 2;
  236. }
  237. int DEVPath_Set_XXX_(std::string& InOut)
  238. {
  239. return 2;
  240. }
  241. int DEVPath_Get_CalibrateAllModes_(std::string& Out)
  242. {
  243. return 2;
  244. } //
  245. //(int& nLogicMode, int& nOffsetIndex);
  246. int DEVPath_Get_ActiveMode_(std::string& Out)
  247. {
  248. return 2;
  249. }
  250. //(vector <ZSKK_DETECTOR_MODE_INFO>& vecDetectorMode);
  251. int DEVPath_Get_LogicModeList_(std::string& Out)
  252. {
  253. return 2;
  254. }
  255. //Set sequence shot fps
  256. int DEVPath_Set_SpotFrameRate_(std::string& InOut)
  257. {
  258. return 2;
  259. }
  260. //Set FLU fps (float fps);
  261. int DEVPath_Set_FLUFrameRate_(std::string& InOut)
  262. {
  263. return 2;
  264. }
  265. //Set CINE fps (float fps);
  266. int DEVPath_Set_CINEFrameRate_(std::string& InOut)
  267. {
  268. return 2;
  269. }
  270. //(int nmode); (float fps);
  271. int DEVPath_Set_SetGrabMode_(std::string& InOut)
  272. {
  273. return 2;
  274. }
  275. //(int nLogicMode, vector <ZSKK_PROTOCOL_OFFSET_INFO>& vecOffsetInfo);
  276. int DEVPath_Action_GetOffsetInfo_(std::string& Out)
  277. {
  278. return 2;
  279. }
  280. //(int nLogicMode, int nOffsetIndex, ZSKK_CAL_STATUS& modeStatus);
  281. int DEVPath_Action_GetCalibrationStatus_(std::string& Out)
  282. {
  283. return 2;
  284. }
  285. //(int nLogicMode, int nOffsetIndex, int nSpeed);
  286. int DEVPath_Action_SetRadOffsetMode_(std::string In, std::string& InOut)
  287. {
  288. return 2;
  289. }
  290. //(int nLogicMode, int nOffsetIndex, float fSpeed);
  291. int DEVPath_Action_SetFluOffsetMode_(std::string In, std::string& InOut)
  292. {
  293. return 2;
  294. }
  295. //(int nLogicMode, int nOffsetIndex, float fSpeed);
  296. int DEVPath_Action_SetCinOffsetMode_(std::string In, std::string& InOut)
  297. {
  298. return 2;
  299. }
  300. int DEVPath_Action_BeginWorkMode_(std::string In, std::string& Out)
  301. {
  302. return 2;
  303. }
  304. int DEVPath_Action_EndWorkMode_(std::string In, std::string& Out)
  305. {
  306. return 2;
  307. }
  308. int DEVPath_Action_StartGrab_(std::string In, std::string& Out)
  309. {
  310. return 2;
  311. }
  312. //(int nXRayOnNum = 0);
  313. int DEVPath_Action_StopGrab_(std::string In, std::string& Out)
  314. {
  315. return 2;
  316. }
  317. int DEVPath_Action_ExpEnable_(std::string In, std::string& Out)
  318. {
  319. return 2;
  320. }
  321. int DEVPath_Action_ExpDisable_(std::string In, std::string& Out)
  322. {
  323. return 2;
  324. }
  325. int DEVPath_Action_FluEnable_(std::string In, std::string& Out)
  326. {
  327. return 2;
  328. }
  329. int DEVPath_Action_FluDisable_(std::string In, std::string& Out)
  330. {
  331. return 2;
  332. }
  333. //(int nLogicMode, int nOffsetIndex, int nCalMode);
  334. int DEVPath_Action_BeginCalibration_(std::string In, std::string& Out)
  335. {
  336. return 2;
  337. }
  338. int DEVPath_Action_EnterCalibration_(std::string In, std::string& Out)
  339. {
  340. return 2;
  341. }
  342. int DEVPath_Action_ExitCalibration_(std::string In, std::string& Out)
  343. {
  344. return 2;
  345. }
  346. int DEVPath_Action_AbortCalibration_(std::string In, std::string& Out)
  347. {
  348. return 2;
  349. }
  350. //(bool bEn);
  351. int DEVPath_Action_EnableAutoOffset_(std::string In, std::string& Out)
  352. {
  353. return 2;
  354. }
  355. int DEVPath_Action_StartOffsetRefresh_(std::string In, std::string& Out)
  356. {
  357. return 2;
  358. }
  359. int DEVPath_Action_StartOffsetCalibration_(std::string In, std::string& Out)
  360. {
  361. return 2;
  362. }
  363. int DEVPath_Action_OffsetByUser_(std::string In, std::string& Out)
  364. {
  365. return 2;
  366. }
  367. //(int nLogicMode, int nOffsetIndex);
  368. int DEVPath_Action_SelectRADMode_(std::string In, std::string& Out)
  369. {
  370. return 2;
  371. }
  372. //(int nLogicMode, int nOffsetIndex);
  373. int DEVPath_Action_SelectFLUMode_(std::string In, std::string& Out)
  374. {
  375. return 2;
  376. }
  377. //(int nLogicMode, int nOffsetIndex);
  378. int DEVPath_Action_SelectCINEMode_(std::string In, std::string& Out)
  379. {
  380. return 2;
  381. }
  382. int DEVPath_Action_DownloadCorrectionFile2Device_(std::string In, std::string& Out)
  383. {
  384. return 2;
  385. } //
  386. int DEVPath_Action_ActiveRADMode_(std::string In, std::string& Out)
  387. {
  388. return 2;
  389. } //
  390. int DEVPath_Action_ActiveFLUMode_(std::string In, std::string& Out)
  391. {
  392. return 2;
  393. } //
  394. int DEVPath_Action_ActiveCINEMode_(std::string In, std::string& Out)
  395. {
  396. return 2;
  397. } //
  398. int DEVPath_Action_SetNextStepEvent_(std::string In, std::string& Out)
  399. {
  400. return 2;
  401. } //