AbstractSeqEx.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  2. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 WHEELDPC_EXPORTS
  3. // 符号编译的。在使用此 DLL 的
  4. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  5. // SYNCFPDDPC_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  6. // 符号视为是被导出的。
  7. #ifndef ABSTRACTSEQEX_EXPORTS
  8. #ifdef _WIN64
  9. #ifdef _DEBUG
  10. #pragma comment(lib, "AbstractSeqExX64D.lib")
  11. #else
  12. #pragma comment(lib, "AbstractSeqExX64.lib")
  13. #endif
  14. #else
  15. #ifdef _DEBUG
  16. #pragma comment(lib, "AbstractSeqExD.lib")
  17. #else
  18. #pragma comment(lib, "AbstractSeqEx.lib")
  19. #endif
  20. #endif
  21. #endif
  22. #ifdef ABSTRACTSEQEX_EXPORTS
  23. #define ABSTRACTSEQEX_API __declspec(dllexport)
  24. #else
  25. #define ABSTRACTSEQEX_API __declspec(dllimport)
  26. #endif
  27. #include "LogicDevice.h"
  28. #include "CommonLogicClient.h"
  29. #include "diosthread.h"
  30. #include "DIOSLogicDeviceStructure.h"
  31. #include <map>
  32. class ABSTRACTSEQEX_API AbstractSeqEx : public LogicDevice
  33. {
  34. public:
  35. AbstractSeqEx(void);
  36. virtual ~AbstractSeqEx(void);
  37. void *m_pData;
  38. void *m_pNotify;
  39. BaseJsonDataObject<int>* m_nXWindowTime;
  40. //get device type
  41. virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType);
  42. //get device resource
  43. virtual RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource);
  44. //ResourceCommand Request In and Response Out
  45. virtual RET_STATUS SYSTEM_CALL Request(ResDataObject PARAM_IN *pRequest, ResDataObject PARAM_OUT *pResponse);
  46. //notify to lower layer
  47. virtual RET_STATUS SYSTEM_CALL CmdToLogicDev(ResDataObject PARAM_IN *pCmd);
  48. //errors,warnings
  49. void SetErrorInfo(int errCode, char *pErrInfo);
  50. void SetWarningInfo(int warningCode, char *pWarningInfo);
  51. protected:
  52. SM_STATUS m_SMState;
  53. bool m_bExposureSuccess;
  54. bool m_bSwitchStatus;
  55. //map<CommonLogicClient*, bool > m_mapError;
  56. public:
  57. int WaitforNotify(DWORD Index);
  58. void InitState( map<CommonLogicClient*, int> &objSM);
  59. bool StateAction(char*,map<CommonLogicClient*, int>& objSM);
  60. bool StateGuard(char*,map<CommonLogicClient*, int> &objSM);
  61. bool StateNotify(char* strState, bool bResult);
  62. bool work(DWORD Index);
  63. bool StartThread();
  64. bool StopThread();
  65. HANDLE *GetHandlelist(int &size);
  66. bool IsThreadRun();
  67. private:
  68. bool ProcessHandSwitch(CommonLogicClient* pULDObj, bool bHSWStatus);
  69. public:
  70. //fpd actions
  71. virtual RET_STATUS OpenLogicDevice();
  72. virtual RET_STATUS CloseLogicDevice();
  73. virtual RET_STATUS ResetSMState();
  74. virtual RET_STATUS AddLogicDevice(string path);
  75. virtual RET_STATUS DelLogicDevice(string path);
  76. virtual RET_STATUS SetApplicationMode(ResDataObject nApplicationMode); //RAD FLU
  77. virtual RET_STATUS SetExamInfo(ResDataObject nExamMode);
  78. virtual RET_STATUS SetFrameRate(const char *fps);
  79. virtual RET_STATUS GetSEQResource(ResDataObject PARAM_OUT *pDeviceResource);
  80. virtual RET_STATUS SeqPrep();
  81. virtual RET_STATUS SeqReady();
  82. virtual RET_STATUS FramePrep();
  83. virtual RET_STATUS ExpEnableAction();
  84. virtual RET_STATUS ExpEnableResult(CommonLogicClient* objSM, RES_SM SMResult);
  85. virtual RET_STATUS FrameReady();
  86. virtual RET_STATUS FrameReadyResult(CommonLogicClient* objSM, RES_SM bResult);
  87. virtual RET_STATUS FrameStart();
  88. virtual RET_STATUS FrameStartResult(CommonLogicClient* objSM, RES_SM SMResult);
  89. virtual RET_STATUS FrameIn();
  90. virtual RET_STATUS FrameInComplete(CommonLogicClient* objSM, RES_SM SMResult);
  91. virtual RET_STATUS FramePost();
  92. //virtual RET_STATUS FramePostResult();
  93. virtual RET_STATUS FrameEnd();
  94. virtual RET_STATUS FrameEndResult();
  95. virtual RET_STATUS FrameError();
  96. virtual RET_STATUS SeqPost();
  97. virtual RET_STATUS SeqPostResult();
  98. virtual RET_STATUS SeqSWSwitchOn(int state);
  99. virtual RET_STATUS RESET();
  100. //we need check each action resource is Support or not
  101. //return yes or no inside of OEM module
  102. virtual RET_STATUS Support_SetSyncMode();
  103. virtual RET_STATUS Support_SetXWindowTime();
  104. virtual RET_STATUS Support_SetApplicationMode();
  105. virtual RET_STATUS Support_SetExamInfo();
  106. virtual RET_STATUS Support_GetSEQResource();
  107. virtual RET_STATUS Support_SeqPrep();
  108. virtual RET_STATUS Support_SeqReady();
  109. virtual RET_STATUS Support_FramePrep();
  110. virtual RET_STATUS Support_ExpEnable();
  111. virtual RET_STATUS Support_FrameReady();
  112. virtual RET_STATUS Support_FrameStart();
  113. virtual RET_STATUS Support_XWindowOn();
  114. virtual RET_STATUS Support_FrameIn();
  115. virtual RET_STATUS Support_FrameInComplete();
  116. virtual RET_STATUS Support_FramePost();
  117. virtual RET_STATUS Support_FrameEnd();
  118. virtual RET_STATUS Support_FrameError();
  119. virtual RET_STATUS Support_SeqPost();
  120. };