You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __PROTOCOL_LGS_2D_HEADERS__
  2. #define __PROTOCOL_LGS_2D_HEADERS__
  3. #include "../../alg/lgs/detectorStructures.h"
  4. #include "../../alg/lgs/mask.h"
  5. #include "protocol.h"
  6. #include "protocolLGS_data.h"
  7. // #include "../../rgoose/rgooseTypes.h"
  8. #define LEGACY_2ZEROS_BEFORE_PACKAGE
  9. #ifdef LEGACY_2ZEROS_BEFORE_PACKAGE
  10. // #define LEGACY_2ZEROS_FROM_BOTH_SIDES
  11. #endif
  12. // #include "../../App/common/dataBinder_structures.h"
  13. class protocolLGS_2D : public protocolParser
  14. {
  15. private:
  16. basicLogCollection * m_pLog;
  17. basicMutex m_mInquiryMutex;
  18. uint8_t m_bDeviceID;
  19. int FinishUpPackage(uint8_t * Buffer, size_t Size, uint8_t DeviceID);
  20. protected:
  21. virtual int packetChecker(uint8_t * Buffer, size_t BufferSize);
  22. virtual protocolPackage * packetExtractor(uint8_t * Buffer, size_t BufferSize);
  23. public:
  24. explicit protocolLGS_2D(basicTransport * Transport = NULL, uint8_t DeviceID = 0);
  25. virtual ~protocolLGS_2D();
  26. virtual bool create(void)
  27. {
  28. return protocolParser::create();
  29. }
  30. bool doFullReset(void);
  31. bool doReset(void);
  32. bool getDetectionProfile(void);
  33. uint8_t getDeviceID(void)
  34. {
  35. return m_bDeviceID;
  36. }
  37. bool getMode(void);
  38. bool getFullDraw(uint16_t Angle);
  39. bool getFastDraw(uint16_t Angle);
  40. bool getParameters(bool MASTER = true);
  41. bool getRelayParameters(void);
  42. bool getSerialNumber(void);
  43. bool getShadowInfo(uint8_t seq);
  44. bool getShadowPoly(uint8_t seq, uint16_t PolyID);
  45. bool getShadowPolyPoint(uint8_t seq, uint16_t PolyID, uint16_t PointID);
  46. bool getShadowStatus(uint8_t MaskID = 0);
  47. bool getState(void);
  48. bool getState2(void);
  49. bool getWidthTable();
  50. bool getVersionString(void);
  51. bool getVoltage(void);
  52. bool setComSpeed(uint32_t spd);
  53. bool setDetectionProfile(uint8_t profile);
  54. bool setDeviceID(uint8_t DeviceID)
  55. {
  56. m_bDeviceID = DeviceID;
  57. return true;
  58. }
  59. bool setDeviceAddress(uint8_t DeviceID, CSTR Serial = NULL);
  60. bool setMode(U8 Mode);
  61. bool setParameters(PLGS_2D_PARAMETERS ptr, bool MASTER = true, uint8_t profile = 0);
  62. bool setRelayParameters(PRELAY_PARAMETERS ptr);
  63. bool setShadowInfo(uint8_t seq, SHADOW & SH);
  64. bool setShadowPoly(uint8_t seq, SHADOW & SH, uint16_t PolyID);
  65. bool setShadowPolyPoint(uint8_t seq, SHADOW & SH, uint16_t PolyID, uint16_t PointID);
  66. bool setShadowRay(uint8_t seq, SHADOW & SH, uint16_t RLID);
  67. bool setShadowRayLine(uint8_t seq, SHADOW & SH, uint16_t RLID, uint16_t RayID);
  68. bool setShadowDone(uint8_t seq);
  69. bool setShadowStatus(uint8_t ShadowMask);
  70. bool setWidthTable(PWIDTH_TABLE);
  71. bool sendGF_package(uint8_t CMD, uint8_t cnt, uint8_t * Data);
  72. bool sendFS_package(PFS_DATA pFSData);
  73. };
  74. #endif