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.

75 lines
3.7 KiB

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