MACHINE_DPC.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #pragma once
  2. //#include "GeneratorDriver.h"
  3. #include "LogicDriver.h"
  4. #include "Generator_Model_Def.h"
  5. #include "SCF.hpp"
  6. namespace nsSCF = DIOS::Dev::Communication;
  7. class CMACHINE_DPC : public LogicDriver
  8. {
  9. std::string *m_pWorkpath;
  10. public:
  11. CMACHINE_DPC();
  12. virtual ~CMACHINE_DPC();
  13. ///////////////////////////////////////////////////////
  14. virtual bool DriverEntry(ResDataObject &Configuration);
  15. virtual bool Driver_Probe(ResDataObject &HardwareInfo);
  16. virtual bool SYSTEM_CALL SetDriverWorkPath(const char * PARAM_IN pWorkPath);
  17. virtual PVOID SYSTEM_CALL LoadDriver();//无根节点
  18. virtual void SYSTEM_CALL UnloadDriver();
  19. RET_STATUS SYSTEM_CALL GetDriverDictionary(ResDataObject& PARAM_OUT DriverInfo);
  20. RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource);
  21. RET_STATUS DATA_ACTION GetDeviceConfig(ResDataObject PARAM_OUT *pDeviceConfig);
  22. RET_STATUS DATA_ACTION SetDeviceConfig(ResDataObject PARAM_IN *DeviceConfig);
  23. virtual bool Connect();
  24. virtual void DisConnect();
  25. //给硬件驱动设置Unique工作路径
  26. //如果是同一设备同一连接情况下,硬件多次接入,系统会保证工作路径是一样的.
  27. //连接后,单一硬件相关的数据要保存在此.
  28. virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath);
  29. //逻辑设备树的加载和卸载
  30. virtual PVOID SYSTEM_CALL LoadLogicDevices();
  31. virtual void SYSTEM_CALL UnloadLogicDevices();
  32. virtual bool SYSTEM_CALL OnHeartBeat();
  33. virtual bool Device_Probe(ResDataObject &HardwareInfo);
  34. /////////////////////////////////
  35. void OEM_IF NotifyTomoParams(FLOAT fSID, FLOAT fTID, FLOAT fMaxAngle, int nDirection, int nProjectionNumber);
  36. public:
  37. int CMDSet(const char *pKey,int len);
  38. int SendCmd(char * pCmd);
  39. int ActionCall(char * pName);
  40. int m_nStatus;
  41. ResDataObject CurrentExamMode;
  42. bool SendTomoExam(void);
  43. bool StartMove(bool state);
  44. bool ClearMoveState();
  45. bool SendIXRAY(void);
  46. bool MechMoveReady();
  47. bool SetPositionNum(const char* code);
  48. bool MechGetPosReady();
  49. bool GetPosition(ResDataObject &resangle, ResDataObject &resheight);
  50. private:
  51. string m_strWorkPath;
  52. ResDataObject m_DeviceConfig; //设备属性
  53. HMODULE m_hDPCDll;
  54. nsSCF::SCF* m_pSCFServer;
  55. typedef nsSCF::SCF* (*GetSCF)();
  56. GetSCF m_fpGetSCF;
  57. typedef void(*ReleaseSCF)(nsSCF::SCF* p);
  58. ReleaseSCF m_fpReleaseSCF;
  59. CRITICAL_SECTION m_stCSProcessMsg;
  60. class CMACHINE_Logical * m_pGenLogical;
  61. HANDLE m_hConnectFinish;
  62. HANDLE m_hBeginConnect;
  63. HANDLE m_hConnection;
  64. HANDLE m_hMechReady;
  65. HANDLE m_hMechGetPostionFinished;
  66. ResDataObject m_DetectorToTableDistance;
  67. ResDataObject m_DistanceSourcetoDetector;
  68. ResDataObject m_DistanceSourcetoEntrance;
  69. ResDataObject m_GEOMETRY;
  70. ResDataObject m_ProjectionNum;
  71. ResDataObject m_ProjectionMaxAngle;
  72. ResDataObject m_ProjectionDirection;
  73. ResDataObject m_MechAngle;
  74. ResDataObject m_MechHeight;
  75. int m_nLostConnectNumber;
  76. int m_nTimeoutCount;
  77. int m_nCurrentViewNumber;
  78. int m_nTargetViewNumber;
  79. int m_nLastErrorCount;
  80. string Inifilename;
  81. bool m_bIdentStatus;
  82. void *m_pNotify;
  83. bool m_bMechMoveState;
  84. bool SendDate(void);
  85. ConfigInfo *m_pGenVender;
  86. ConfigInfo *m_pGenModel;
  87. ConfigInfo *m_pGenSyncType;
  88. ConfigInfo *m_pGenSCFType;
  89. ConfigInfo *m_pGenSCFPort;
  90. ConfigInfo *m_pTID;
  91. ConfigInfo *m_pSID;
  92. ConfigInfo *m_pENTRANCE;
  93. ConfigInfo *m_pGEOMETRY;
  94. #ifdef CMD_ANSYNC
  95. class CRingBuffer * m_pRBMsg;
  96. HANDLE m_hSemaphore;
  97. #endif
  98. };
  99. int FormatCMD(char * pCmd, int nSize);
  100. int GetSingleMsg(char * pCmd, int nCmdLen, char * pMsg);