| Visioscan Set SDK Libraries 1.0.28 Visioscan Set SDK Help documentation file for C++ and C++/CLI |

Loading...
Searching...
No Matches
RawDataSensor.h
1#pragma once
2#include<iostream>
3#include<sstream>
4#include "../StarfleetToolbox/BaseCommunication.h"
5#include "../StarfleetToolbox/BaseSensor.h"
6#include "NetworkInformation.h"
7#include "AngleRange.h"
8#include "ContaminationThreshold.h"
9#include "../StarfleetToolbox/ContaminationStatus.h"
10#include "../StarfleetToolbox/SoftwareVersion.h"
11#include "../StarfleetToolbox/BaseDataExtractor.h"
12#include "RawDataError.h"
13#include "SensorLeds.h"
14#include "SensorLamps.h"
15#include "../StarfleetToolbox/ConfigurationResult.h"
16#include "../StarfleetToolbox/AvailableResolution.h"
17
18 using namespace std;
19
20#ifdef RAWDATASENSOR_EXPORTS
21#define RAWDATASENSOR __declspec(dllexport)
22#else
23#define RAWDATASENSOR __declspec(dllimport)
24#endif
25
26
27 typedef int PROTOCOL;
28#define TCP 1
29#define UDP 0
30
31// Command mode
32#define READ 0
33#define WRITE 1
34
35 typedef int SCAN_PACKET_TYPE;
36#define DISTANCE 0
37#define DISTANCE_INTENSITY 1
38
39 typedef int ANGULAR_RESOLUTION;
40#define ZERO_TO_ZERO_POINT_TWO_AT_EIGHTY_HZ 0
41#define ZERO_TO_ZERO_POINT_ONE_AT_FOURTY_HZ 1
42#ifdef LEUZE
43#define ZERO_TO_ZERO_POINT_ONE_AT_FIFTY_HZ 4
44#endif
45
46 typedef int SCANNING_DIRECTION;
47#define CLOCKWISE 0
48#define COUNTER_CLOCKWISE 1
49
50 typedef int FILTER_STATUS;
51#define FILTER_OFF 0
52#define FILTER_ON 1
53
54 typedef int WINDOW_CALIBRATION;
55#define PROCESSING 0
56#define DONE 1
57#define FAILED 3
58
64 class RAWDATASENSOR RawDataSensor : public BaseSensor, public BaseDataExtractor
65{
66 public:
70 RawDataSensor();
71
75 ~RawDataSensor();
76
81 RawDataSensor(BaseCommunication* comm);
82
88 RawData ExtractData(vector<string>pDataToExtract);
89
95 bool IsCommandAcknowledgment(string pDataToVerify);
96
102 bool IsHeader(string pDataToVerify);
103
109 bool IsEndOfPacket(string pDataToVerify);
110
116 bool IsFirstPacket(string pDataToVerify);
117
122 int GetPacketHeaderSizeToRead();
123
128 int CountToReadForLength(char* pHeaderBuffer);
129
136 int GetPacketLengthToRead(char* pLenHeaderBuffer, int pPacketType);
137
141 CommunicationStatus Initialize();
142
148 void Close();
149
150 // Public exposed feature methods
151
156 RawData RetrieveRawData();
157
158
159 // Device utilities
160
164 void ResetDevice();
165
169 void RebootDevice();
170
171 // Command settings management
172 // Data retrieve
177 NetworkInformation GetNetworkInformation();
178
183 PROTOCOL GetRawDataExchangeMode();
184
189 SCAN_PACKET_TYPE GetDataPacketType();
190
195 SensorResolutionFrequencyEnum GetAngularResolution();
196
201 SCANNING_DIRECTION GetScanningDirection();
202
207 AngleRange GetAngleRange();
208
213 unsigned int GetSkipScan();
214
219 unsigned int GetImmunityLevel();
220
225 ContaminationThreshold GetContaminationThreshold();
226
231 ContaminationStatus GetContaminationStatus();
232
237 SoftwareVersion GetVersion();
238
243 uint16_t GetPlatformVersion();
244
249 int GetTemperature();
250
255 vector<RawDataError> GetErrorLog();
256
261 SensorLeds GetSensorLeds();
262
267 SensorLamps GetSensorLamps();
268
273 long GetRuntimeHours();
274
279 string GetDeviceName();
280
285 FILTER_STATUS GetFilterStatus();
286
291 WINDOW_CALIBRATION GetWindowCalibrationStatus();
292
298 ConfigurationResult SetNetworkInformation(NetworkInformation pNetwork);
299
305 ConfigurationResult SetRawDataExchangeMode(PROTOCOL pProtocol);
306
312 ConfigurationResult SetDataPacketType(SCAN_PACKET_TYPE pPacketType);
313
319 ConfigurationResult SetAngularResolution(SensorResolutionFrequencyEnum pResolution);
320
326 ConfigurationResult SetScanningDirection(SCANNING_DIRECTION pScanDirection);
327
333 ConfigurationResult SetAngleRange(AngleRange pAngleRange);
334
340 ConfigurationResult SetSkipScan(int pSkipScan);
341
347 ConfigurationResult SetImmunityLevel(int pImmunityLevel);
348
354 ConfigurationResult SetContaminationThreshold(ContaminationThreshold pContaminationThreshold);
355
361 ConfigurationResult SetSensorLeds(SensorLeds pLeds);
362
367 ConfigurationResult SetDeviceName(string pName);
368
374 ConfigurationResult SetFilterStatus(FILTER_STATUS pFilterStatus);
375
376
381 ConfigurationResult StartWindowCalibration();
382
386 void SendMdi();
387
391 void StopMdi();
392 friend class AgvSensor;
393 private:
394 // Variable used to set up the RetrieveRawData wait system.
395 // in case of StopMdi, the thread will remain blocked
396 // This can cause unwanted behaviour when a BaseDataRecorder
397 // has join the RawDataSensor class and attempts to replay recorded frames
398 // So, this variable will be setup differently depending on the presence
399 // or not of a BaseDataRecorder
400 int _globalWaitTimeout = 0xFFFFFFFF;
401
409 string ExtractRawResult(string readWriteResponseCommand, string command, string result);
410
416 bool CheckForDistIntensity(string toVerify);
417
418 int _lastPacket = -1;
419 protected:
429 string ExtractCommandResult(int MODE, string commandCode, string result);
430
431
432
433 string GetImmu = { 0x47 ,0x65 ,0x74 ,0x49, 0x6D, 0x6D, 0x75 };
434 string SetImmu = { 0x53, 0x65, 0x74, 0x49, 0x6D, 0x6D, 0x75 };
435};
436
AgvSensor
Definition AgvSensor.h:42
AngleRange
Helper to encapsulate the Angle range data.
Definition AngleRange.h:13
ContaminationThreshold
Helper to encapsulate the contamination threshold.
Definition ContaminationThreshold.h:12
NetworkInformation
Helper to encapsulate the network information.
Definition NetworkInformation.h:15
RawDataSensor
Definition of the Raw data sensor services. This header will let the programmer to handle all the req...
Definition RawDataSensor.h:65
SensorLamps
Helper to encapsulate the sensor lamps state.
Definition SensorLamps.h:20
SensorLeds
Helper to encapsulate the sensor leds state.
Definition SensorLeds.h:11
CommunicationStatus
Definition CommunicationStructures.h:24
ConfigurationResult
Helper to encapsulate the configuration result.
Definition ConfigurationResult.h:15
ContaminationStatus
Helper to encapsulate the contamination threshold.
Definition ContaminationStatus.h:12
RawData
The base class encapsulating sensor's RAW data.
Definition RawData.h:14
SoftwareVersion
Helper to encapsulate the software version.
Definition SoftwareVersion.h:21