ThreeAxisGyrDPC.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  2. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 WHEELDPC_EXPORTS
  3. // 符号编译的。在使用此 DLL 的
  4. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  5. // SYNCFPDDPC_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  6. // 符号视为是被导出的。
  7. #pragma once
  8. #ifndef THREEAXGYRDPC_EXPORTS
  9. #ifdef _WIN64
  10. #ifdef _DEBUG
  11. #pragma comment(lib, "ThreeAxisGyrDPCX64D.lib")
  12. #else
  13. #pragma comment(lib, "ThreeAxisGyrDPCX64.lib")
  14. #endif
  15. #else
  16. #ifdef _DEBUG
  17. #pragma comment(lib, "ThreeAxisGyrDPCD.lib")
  18. #else
  19. #pragma comment(lib, "ThreeAxisGyrDPC.lib")
  20. #endif
  21. #endif
  22. #endif
  23. #ifdef THREEAXGYRDPC_EXPORTS
  24. #define THREEAXGYRDPC_API __declspec(dllexport)
  25. #else
  26. #define THREEAXGYRDPC_API __declspec(dllimport)
  27. #endif
  28. #include "DPC.h"
  29. #include "DiosThread.h"
  30. #include "ThreeAxisGyrOem.h"
  31. #include "SerialSCF.h"
  32. extern "C" THREEAXGYRDPC_API DPC* GetDPC();
  33. extern "C" THREEAXGYRDPC_API void ReleaseDPC(DPC *p);
  34. class THREEAXGYRDPC_API ThreeAxisGyrDPC : public DPC
  35. {
  36. std::string *m_pWorkpath;
  37. public:
  38. void LogInfo(string string);
  39. void LogWarn(string string);
  40. void LogError(string string);
  41. public:
  42. ThreeAxisGyrDPC(void);
  43. virtual ~ThreeAxisGyrDPC(void);
  44. virtual bool DpcEntry(ResDataObject &Configuration);
  45. virtual ResDataObject GetConnectionType();
  46. virtual bool Connect(ResDataObject &Connection);
  47. virtual bool Probe(ResDataObject &HardwareInfo);
  48. virtual bool OnNotify(HANDLE ExitNotify);
  49. virtual bool SetWorkPath(const char *pWorkPath);
  50. virtual PVOID LoadLogicDevices();
  51. virtual void UnloadLogicDevices(PVOID p);
  52. virtual bool DisConnect();
  53. bool SendBySCF(char chChannelID, bool bStatus);
  54. //friend class SyncGen_OemDevice;
  55. //friend class ThreeAxisGyr_Oem;
  56. //friend class SyncSwitch_OemDevice;
  57. private:
  58. bool CharArrToDec(char*p,int nLength,DWORD dwRetValue);
  59. int ChartoInt(char uc);
  60. int CalChecksum(const char * cCmd, int nCmdSize);
  61. bool FormatCmd(char *cCmd, int &nSize);
  62. bool CmdtoString(const char * cCmd, int nCmdSize, string &strCmd);
  63. static PACKET_RET EventCallback(const char * pRecData, DWORD nLength, DWORD & PacketLength);
  64. typedef SCF* (*GetSCF)();
  65. GetSCF getSCF;
  66. typedef void(*ReleaseSCF)(SCF *p);
  67. ReleaseSCF releaseSCF;
  68. SCFPacket *m_pSendPacket;
  69. SCFPacket *m_pReceivePacket;
  70. SCF *m_pSCFInstance;
  71. private:
  72. ThreeAxisGyr_Oem *m_pThreeAxGyrFPD;
  73. HMODULE m_DllFileHandle;
  74. //ResDataObject m_ConfigObj;
  75. };