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.

72 lines
3.5 KiB

​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 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 getSerialNumber( void );
  35. bool getShadowInfo( uint8_t seq );
  36. bool getShadowPoly( uint8_t seq, uint16_t PolyID );
  37. bool getShadowPolyPoint( uint8_t seq, uint16_t PolyID, uint16_t PointID );
  38. bool getShadowStatus( uint8_t MaskID = 0 );
  39. bool getState( void );
  40. bool getState2( void );
  41. bool getVersionString( void );
  42. bool getVoltage(void);
  43. bool setComSpeed( uint32_t spd );
  44. bool setDetectionProfile( uint8_t profile );
  45. bool setDeviceID( uint8_t DeviceID ){ m_bDeviceID = DeviceID; return true; };
  46. bool setDeviceAddress( uint8_t DeviceID, CSTR Serial = NULL );
  47. bool setMode( U8 Mode );
  48. bool setParameters( PLGS_2D_PARAMETERS ptr, bool MASTER = true, uint8_t profile = 0 );
  49. bool setShadowInfo( uint8_t seq, SHADOW & SH );
  50. bool setShadowPoly( uint8_t seq, SHADOW & SH, uint16_t PolyID );
  51. bool setShadowPolyPoint( uint8_t seq, SHADOW & SH, uint16_t PolyID, uint16_t PointID );
  52. bool setShadowRayLine( uint8_t seq, SHADOW & SH, uint16_t RLID );
  53. bool setShadowRay( uint8_t seq, SHADOW & SH, uint16_t RLID, uint16_t RayID );
  54. bool setShadowDone( uint8_t seq );
  55. bool setShadowStatus( uint8_t ShadowMask );
  56. bool sendGF_package( uint8_t CMD, uint8_t cnt, uint8_t *Data );
  57. bool sendFS_package( PFS_DATA pFSData );
  58. };
  59. #endif