Visioscan Set SDK Libraries 1.0.14
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 "ContaminationStatus.h"
10#include "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
17using namespace std;
18
19#ifdef RAWDATASENSOR_EXPORTS
20#define RAWDATASENSOR __declspec(dllexport)
21#else
22#define RAWDATASENSOR __declspec(dllimport)
23#endif
24
25
26typedef int PROTOCOL;
27#define TCP 1
28#define UDP 0
29
30// Command mode
31#define READ 0
32#define WRITE 1
33
34typedef int SCAN_PACKET_TYPE;
35#define DISTANCE 0
36#define DISTANCE_INTENSITY 1
37
38typedef int ANGULAR_RESOLUTION;
39#define ZERO_TO_ZERO_POINT_TWO_AT_EIGHTY_HZ 0
40#define ZERO_TO_ZERO_POINT_ONE_AT_FOURTY_HZ 1
41
42typedef int SCANNING_DIRECTION;
43#define CLOCKWISE 0
44#define COUNTER_CLOCKWISE 1
45
46typedef int FILTER_STATUS;
47#define FILTER_OFF 0
48#define FILTER_ON 1
49
50typedef int WINDOW_CALIBRATION;
51#define PROCESSING 0
52#define DONE 1
53#define FAILED 3
54
60class RAWDATASENSOR RawDataSensor : public BaseSensor, public BaseDataExtractor
61{
62public:
67
72
77 RawDataSensor(BaseCommunication* comm);
78
84 RawData ExtractData(vector<string>pDataToExtract);
85
91 bool IsCommandAcknowledgment(string pDataToVerify);
92
98 bool IsHeader(string pDataToVerify);
99
105 bool IsEndOfPacket(string pDataToVerify);
106
112 bool IsFirstPacket(string pDataToVerify);
113
118 int GetPacketHeaderSizeToRead();
119
124 int CountToReadForLength(char* pHeaderBuffer);
125
132 int GetPacketLengthToRead(char* pLenHeaderBuffer, int pPacketType);
133
137 void Initialize();
138
139 // Public exposed feature methods
140
145 RawData RetrieveRawData();
146
147
148 // Device utilities
149
153 void ResetDevice();
154
158 void RebootDevice();
159
160 // Command settings management
161 // Data retrieve
166 NetworkInformation GetNetworkInformation();
167
172 PROTOCOL GetRawDataExchangeMode();
173
178 SCAN_PACKET_TYPE GetDataPacketType();
179
184 ANGULAR_RESOLUTION GetAngularResolution();
185
190 SCANNING_DIRECTION GetScanningDirection();
191
196 AngleRange GetAngleRange();
197
202 unsigned int GetSkipScan();
203
208 unsigned int GetImmunityLevel();
209
214 ContaminationThreshold GetContaminationThreshold();
215
220 ContaminationStatus GetContaminationStatus();
221
226 SoftwareVersion GetVersion();
227
232 int GetTemperature();
233
238 vector<RawDataError> GetErrorLog();
239
244 SensorLeds GetSensorLeds();
245
250 SensorLamps GetSensorLamps();
251
256 long GetRuntimeHours();
257
262 string GetDeviceName();
263
268 FILTER_STATUS GetFilterStatus();
269
274 WINDOW_CALIBRATION GetWindowCalibrationStatus();
275
281 ConfigurationResult SetIpAddress(string pIpAddress);
282
288 ConfigurationResult SetIpPort(int pPort);
289
295 ConfigurationResult SetNetworkInformation(NetworkInformation pNetwork);
296
302 ConfigurationResult SetRawDataExchangeMode(PROTOCOL pProtocol);
303
309 ConfigurationResult SetDataPacketType(SCAN_PACKET_TYPE pPacketType);
310
316 ConfigurationResult SetAngularResolution(ANGULAR_RESOLUTION pResolution);
317
323 ConfigurationResult SetScanningDirection(SCANNING_DIRECTION pScanDirection);
324
330 ConfigurationResult SetAngleRange(AngleRange pAngleRange);
331
337 ConfigurationResult SetSkipScan(int pSkipScan);
338
344 ConfigurationResult SetImmunityLevel(int pImmunityLevel);
345
351 ConfigurationResult SetContaminationThreshold(ContaminationThreshold pContaminationThreshold);
352
358 ConfigurationResult SetSensorLeds(SensorLeds pLeds);
359
364 ConfigurationResult SetDeviceName(string pName);
365
371 ConfigurationResult SetFilterStatus(FILTER_STATUS pFilterStatus);
372
373
378 ConfigurationResult StartWindowCalibration();
379
383 void SendMdi();
384
388 void StopMdi();
389private:
390 // Variable used to set up the RetrieveRawData wait system.
391 // in case of StopMdi, the thread will remain blocked
392 // This can cause unwanted behaviour when a BaseDataRecorder
393 // has join the RawDataSensor class and attempts to replay recorded frames
394 // So, this variable will be setup differently depending on the presence
395 // or not of a BaseDataRecorder
396 int _globalWaitTimeout = 0xFFFFFFFF;
397
405 string ExtractRawResult(string readWriteResponseCommand, string command, string result);
406
412 bool CheckForDistIntensity(string toVerify);
413
414 int _lastPacket = -1;
415protected:
425 string ExtractCommandResult(int MODE, string commandCode, string result);
426
427
428
429 string GetImmu = { 0x47 ,0x65 ,0x74 ,0x49, 0x6D, 0x6D, 0x75 };
430 string SetImmu = { 0x53, 0x65, 0x74, 0x49, 0x6D, 0x6D, 0x75 };
431};
432
Helper to encapsulate the Angle range data.
Definition AngleRange.h:13
Helper to encapsulate the contamination threshold.
Definition ContaminationStatus.h:12
Helper to encapsulate the contamination threshold.
Definition ContaminationThreshold.h:12
Helper to encapsulate the network information.
Definition NetworkInformation.h:15
Definition of the Raw data sensor services. This header will let the programmer to handle all the req...
Definition RawDataSensor.h:61
Helper to encapsulate the sensor lamps state.
Definition SensorLamps.h:20
Helper to encapsulate the sensor leds state.
Definition SensorLeds.h:11
Helper to encapsulate the software version.
Definition SoftwareVersion.h:19
Helper to encapsulate the configuration result.
Definition ConfigurationResult.h:15
The base class encapsulating sensor's RAW data.
Definition RawData.h:14