AbstractMotion.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  2. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 WHEELDPC_EXPORTS
  3. // 符号编译的。在使用此 DLL 的
  4. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  5. // SYNCFPDDPC_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  6. // 符号视为是被导出的。
  7. #ifndef ABSTRACTMOTION_EXPORTS
  8. #ifdef _WIN64
  9. #ifdef _DEBUG
  10. #pragma comment(lib, "AbstractMotionX64D.lib")
  11. #else
  12. #pragma comment(lib, "AbstractMotionX64.lib")
  13. #endif
  14. #else
  15. #ifdef _DEBUG
  16. #pragma comment(lib, "AbstractMotionD.lib")
  17. #else
  18. #pragma comment(lib, "AbstractMotion.lib")
  19. #endif
  20. #endif
  21. #endif
  22. #ifdef ABSTRACTMOTION_EXPORTS
  23. #define ABSTRACTMOTION_API __declspec(dllexport)
  24. #else
  25. #define ABSTRACTMOTION_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 ABSTRACTMOTION_API AbstractMotion : public LogicDevice
  33. {
  34. ResDataObject* m_pSyncData;
  35. public:
  36. AbstractMotion(void);
  37. virtual ~AbstractMotion(void);
  38. void *m_pData;
  39. void *m_pNotify;
  40. BaseJsonDataObject<int>* m_nXWindowTime;
  41. //get device type
  42. virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType);
  43. //get device resource
  44. virtual RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource);
  45. //ResourceCommand Request In and Response Out
  46. virtual RET_STATUS SYSTEM_CALL Request(ResDataObject PARAM_IN *pRequest, ResDataObject PARAM_OUT *pResponse);
  47. //notify to lower layer
  48. virtual RET_STATUS SYSTEM_CALL CmdToLogicDev(ResDataObject PARAM_IN *pCmd);
  49. //errors,warnings
  50. void SetErrorInfo(int errCode, char *pErrInfo);
  51. void SetWarningInfo(int warningCode, char *pWarningInfo);
  52. bool work(DWORD Index);
  53. bool StartThread();
  54. bool StopThread();
  55. HANDLE *GetHandlelist(int &size);
  56. bool IsThreadRun();
  57. protected:
  58. SM_STATUS m_SMState;
  59. bool m_bExposureSuccess;
  60. bool m_bSwitchStatus;
  61. //map<CommonLogicClient*, bool > m_mapError;
  62. public:
  63. int WaitforNotify(DWORD Index);
  64. bool StateNotify(char* strState, bool bResult);
  65. public:
  66. //fpd actions
  67. virtual RET_STATUS OpenLogicDevice();
  68. virtual RET_STATUS CloseLogicDevice();
  69. virtual RET_STATUS ResetSMState();
  70. virtual RET_STATUS AddLogicDevice(string path);
  71. virtual RET_STATUS DelLogicDevice(string path);
  72. virtual RET_STATUS SetApplicationMode(ResDataObject nApplicationMode); //RAD FLU
  73. virtual RET_STATUS SetExamInfo(ResDataObject PARAM_IN& pParam);
  74. virtual RET_STATUS SelectExamMode(const char *pExamKey);
  75. virtual RET_STATUS GetSEQResource(ResDataObject PARAM_OUT *pDeviceResource);
  76. virtual RET_STATUS SeqPrep();
  77. virtual RET_STATUS SeqReady();
  78. virtual RET_STATUS FramePrep();
  79. virtual RET_STATUS ExpEnableAction();
  80. virtual RET_STATUS ExpEnableResult(CommonLogicClient* objSM, RES_SM SMResult);
  81. virtual RET_STATUS FrameReady();
  82. virtual RET_STATUS FrameReadyResult(CommonLogicClient* objSM, RES_SM bResult);
  83. virtual RET_STATUS FrameStart();
  84. virtual RET_STATUS FrameStartResult(CommonLogicClient* objSM, RES_SM SMResult);
  85. virtual RET_STATUS FrameIn();
  86. virtual RET_STATUS FrameInComplete(CommonLogicClient* objSM, RES_SM SMResult);
  87. virtual RET_STATUS FramePost();
  88. //virtual RET_STATUS FramePostResult();
  89. virtual RET_STATUS FrameEnd();
  90. virtual RET_STATUS FrameEndResult();
  91. virtual RET_STATUS FrameError();
  92. virtual RET_STATUS SeqPost();
  93. virtual RET_STATUS SeqPostResult();
  94. //we need check each action resource is Support or not
  95. //return yes or no inside of OEM module
  96. virtual RET_STATUS Support_SetSyncMode();
  97. virtual RET_STATUS Support_SetXWindowTime();
  98. virtual RET_STATUS Support_SetApplicationMode();
  99. virtual RET_STATUS Support_SetExamInfo();
  100. virtual RET_STATUS Support_GetSEQResource();
  101. virtual RET_STATUS Support_SeqPrep();
  102. virtual RET_STATUS Support_SeqReady();
  103. virtual RET_STATUS Support_FramePrep();
  104. virtual RET_STATUS Support_ExpEnable();
  105. virtual RET_STATUS Support_FrameReady();
  106. virtual RET_STATUS Support_FrameStart();
  107. virtual RET_STATUS Support_XWindowOn();
  108. virtual RET_STATUS Support_FrameIn();
  109. virtual RET_STATUS Support_FrameInComplete();
  110. virtual RET_STATUS Support_FramePost();
  111. virtual RET_STATUS Support_FrameEnd();
  112. virtual RET_STATUS Support_FrameError();
  113. virtual RET_STATUS Support_SeqPost();
  114. ///////////////////////////////////机架抽象需要的接口函//////////////////////
  115. virtual RET_STATUS INIT();
  116. virtual RET_STATUS RESET();
  117. virtual RET_STATUS SetFilter(int index,bool State); //index filter 类型,State是In/out状态
  118. virtual RET_STATUS SetSID(int value);
  119. virtual RET_STATUS SetPhantom(int index, bool State);//index Phantom 类型,State是Load/Unload状态
  120. virtual RET_STATUS SetDoseMeterPositon(int xvalue, int yvaule);
  121. virtual RET_STATUS SetDoorState(int type, int state);//type:0 leftdoor,1 rightdoor;state:0 lock,1 unlock
  122. virtual RET_STATUS SetFPDDoorState(int value);
  123. virtual RET_STATUS SetFPDPower(bool State);
  124. virtual RET_STATUS SetFPDRepair(bool State);
  125. virtual RET_STATUS XRAYState(bool state);
  126. virtual RET_STATUS ReplaceFilter(int index, bool State);//index filter 类型,State是Replace/Recover状态
  127. };