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.
 
 
 
 
 
 

108 lines
4.4 KiB

#ifndef __OBJECT_NET_NODE_2D_HEADERS__
#define __OBJECT_NET_NODE_2D_HEADERS__
#include "rgooseNodeSensor.h"
#include "../components/base/basicObject.h"
#include "../components/base/basicMutex.h"
#include "../components/base/basicThread.h"
#include "../components/base/basicLogCollection.h"
#include "../components/base/basicEventHeap.h"
#include "../components/base/basicPosition.h"
#include "../components/object/objectSystemAnchor.h"
#include "../components/base/basicSettingsProvider.h"
#include "../alg/lgs/mask.h"
#include "../data/protocol/protocolLGS2D.h"
#define LGS_DEFAULT_SLEEP_TIME 333
#define LGS_ALERT_SLEEP_TIME 10
#define LGS_DEFAULT_TO_COUNTER 10
#define LGS_INITIAL_FLIPS 4
#define ANODE_WM_2D_BEFORE_START 0
#define ANODE_WM_2D_CREATE_PORT 1
#define ANODE_WM_2D_CONNECT 2
#define ANODE_WM_2D_WAIT_CONNECT 3
#define ANODE_WM_2D_SET_INIT_MODE 4
#define ANODE_WM_2D_WAIT_INIT_MODE 5
#define ANODE_WM_2D_GET_SERIAL_NUM 6
#define ANODE_WM_2D_WAIT_SERIAL_NUM 7
#define ANODE_WM_2D_GET_VERSION 8
#define ANODE_WM_2D_WAIT_VERSION 9
#define ANODE_WM_2D_GET_DETECTION_PROFILE 10
#define ANODE_WM_2D_WAIT_DETECTION_PROFILE 11
#define ANODE_WM_2D_GET_MASTER_PARAM 12
#define ANODE_WM_2D_WAIT_MASTER_PARAM 13
#define ANODE_WM_2D_GET_SLAVE_PARAM 14
#define ANODE_WM_2D_WAIT_SLAVE_PARAM 15
#define ANODE_WM_2D_SET_BORDER_MODE 16
#define ANODE_WM_2D_WAIT_BORDER_MODE 17
#define ANODE_WM_2D_GET_FAST_DRAW 18
#define ANODE_WM_2D_WAIT_FAST_DRAW 19
#define ANODE_WM_2D_SET_DETECTION_MODE 20
#define ANODE_WM_2D_WAIT_DETECTION_MODE 21
#define ANODE_WM_2D_SET_FILESYSTEM_MODE 22
#define ANODE_WM_2D_WAIT_FILESYSTEM_MODE 23
#define ANODE_WM_2D_FS_TRANSFER_MODE 24
#define ANODE_WM_2D_ISSUE_FULL_RESET 64
#define ANODE_WM_2D_WAIT_FULL_RESET 65
#define ANODE_WM_2D_ISSUE_RESET 66
#define ANODE_WM_2D_WAIT_RESET 67
#define ANODE_WM_2D_PING 128
#define ANODE_WM_2D_PONG 129
#define ANODE_WM_2D_SLEEP_AND_RECONNECT 130
#define ANODE_2D_MAX_DRAW_ANGLES 6000
class ARGUS_2DSensor: public argusNodeSensor, public basicThread, public protocolLGS_2D{
private:
basicLogCollection * m_pLog;
basicEventHeap * m_pEventHeap;
basicEventClassID m_eSensorClass;
DBC_LRF_DATA m_sLRF_DATA;
uint8_t m_bPortType;
basicTransport * m_pPort;
uint8_t m_bWM;
basicMutex m_mWMProtector;
uint8_t m_bDeviceWM;
uint32_t m_nSleepTime;
uint16_t m_bTimeOutCounter;
uint8_t m_bInitialFlips;
uint16_t m_nCurrentAngle;
uint8_t m_bDrawType;
uint32_t m_vDrawRanges[ANODE_2D_MAX_DRAW_ANGLES];
bool m_bSerialStringValid;
bool m_bVersionStringValid;
char m_tSN[65];
char m_tSV[129];
char m_sCurrentFile[MAX_PATH];
uint32_t m_nUploadID;
uint8_t m_nActiveDetectionProfile;
TARGET_DATA * prepareTargetData( uint16_t AZ, uint16_t RANGE, uint32_t WIDTH );
void saveRawDrawData( uint16_t alngles );
uint8_t getWM( void );
void setWM( uint8_t MD );
void cleanupDeviceStructures();
CSTR generateSettingFile();
protected:
virtual bool packetHandler( protocolPackage *Package );
virtual void m_fThreadProc( void );
public:
explicit ARGUS_2DSensor( uint32_t id );
~ARGUS_2DSensor();
virtual bool startService();
virtual bool stopService();
virtual bool validate();
virtual void simulateTarget( void );
};
#endif