\doxysection{Raw\+Data\+Sensor.\+h}
\hypertarget{a00239_source}{}\label{a00239_source}\index{RawDataSensor.h@{RawDataSensor.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#include<iostream>}}
\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#include<sstream>}}
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ "{}../StarfleetToolbox/BaseCommunication.h"{}}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ "{}../StarfleetToolbox/BaseSensor.h"{}}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ "{}NetworkInformation.h"{}}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ "{}AngleRange.h"{}}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ "{}ContaminationThreshold.h"{}}}
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ "{}../StarfleetToolbox/ContaminationStatus.h"{}}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ "{}../StarfleetToolbox/SoftwareVersion.h"{}}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ "{}../StarfleetToolbox/BaseDataExtractor.h"{}}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ "{}RawDataError.h"{}}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ "{}SensorLeds.h"{}}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ "{}SensorLamps.h"{}}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ "{}../StarfleetToolbox/ConfigurationResult.h"{}}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ "{}../StarfleetToolbox/AvailableResolution.h"{}}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \textcolor{keyword}{using\ namespace\ }std;}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#ifdef\ RAWDATASENSOR\_EXPORTS}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#define\ RAWDATASENSOR\ \_\_declspec(dllexport)}}
\DoxyCodeLine{00022\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#define\ RAWDATASENSOR\ \_\_declspec(dllimport)}}
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ \textcolor{keyword}{typedef}\ \textcolor{keywordtype}{int}\ PROTOCOL;}
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#define\ TCP\ 1}}
\DoxyCodeLine{00029\ \textcolor{preprocessor}{\#define\ UDP\ 0}}
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00031\ \textcolor{comment}{//\ Command\ mode}}
\DoxyCodeLine{00032\ \textcolor{preprocessor}{\#define\ READ\ 0}}
\DoxyCodeLine{00033\ \textcolor{preprocessor}{\#define\ WRITE\ 1}}
\DoxyCodeLine{00034\ }
\DoxyCodeLine{00035\ \textcolor{keyword}{typedef}\ \textcolor{keywordtype}{int}\ SCAN\_PACKET\_TYPE;}
\DoxyCodeLine{00036\ \textcolor{preprocessor}{\#define\ DISTANCE\ 0}}
\DoxyCodeLine{00037\ \textcolor{preprocessor}{\#define\ DISTANCE\_INTENSITY\ 1}}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00039\ \textcolor{keyword}{typedef}\ \textcolor{keywordtype}{int}\ ANGULAR\_RESOLUTION;}
\DoxyCodeLine{00040\ \textcolor{preprocessor}{\#define\ ZERO\_TO\_ZERO\_POINT\_TWO\_AT\_EIGHTY\_HZ\ 0}}
\DoxyCodeLine{00041\ \textcolor{preprocessor}{\#define\ ZERO\_TO\_ZERO\_POINT\_ONE\_AT\_FOURTY\_HZ\ 1}}
\DoxyCodeLine{00042\ \textcolor{preprocessor}{\#ifdef\ LEUZE}}
\DoxyCodeLine{00043\ \textcolor{preprocessor}{\#define\ ZERO\_TO\_ZERO\_POINT\_ONE\_AT\_FIFTY\_HZ\ 4}}
\DoxyCodeLine{00044\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ \textcolor{keyword}{typedef}\ \textcolor{keywordtype}{int}\ SCANNING\_DIRECTION;}
\DoxyCodeLine{00047\ \textcolor{preprocessor}{\#define\ CLOCKWISE\ 0}}
\DoxyCodeLine{00048\ \textcolor{preprocessor}{\#define\ COUNTER\_CLOCKWISE\ 1}}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00050\ \textcolor{keyword}{typedef}\ \textcolor{keywordtype}{int}\ FILTER\_STATUS;}
\DoxyCodeLine{00051\ \textcolor{preprocessor}{\#define\ FILTER\_OFF\ 0}}
\DoxyCodeLine{00052\ \textcolor{preprocessor}{\#define\ FILTER\_ON\ 1}}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00054\ \textcolor{keyword}{typedef}\ \textcolor{keywordtype}{int}\ WINDOW\_CALIBRATION;}
\DoxyCodeLine{00055\ \textcolor{preprocessor}{\#define\ PROCESSING\ 0}}
\DoxyCodeLine{00056\ \textcolor{preprocessor}{\#define\ DONE\ 1}}
\DoxyCodeLine{00057\ \textcolor{preprocessor}{\#define\ FAILED\ 3}}
\DoxyCodeLine{00058\ }
\DoxyCodeLine{00064\ \textcolor{keyword}{class\ }RAWDATASENSOR\ \mbox{\hyperlink{a00788}{RawDataSensor}}\ :\ \textcolor{keyword}{public}\ BaseSensor,\ \textcolor{keyword}{public}\ BaseDataExtractor}
\DoxyCodeLine{00065\ \{}
\DoxyCodeLine{00066\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00070\ \ \ \ \ \mbox{\hyperlink{a00788}{RawDataSensor}}();}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00075\ \ \ \ \ \mbox{\hyperlink{a00788}{\string~RawDataSensor}}();}
\DoxyCodeLine{00076\ }
\DoxyCodeLine{00081\ \ \ \ \ \mbox{\hyperlink{a00788}{RawDataSensor}}(BaseCommunication*\ comm);}
\DoxyCodeLine{00082\ \ \ \ \ }
\DoxyCodeLine{00088\ \ \ \ \ \mbox{\hyperlink{a00928}{RawData}}\ ExtractData(vector<string>pDataToExtract);}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00095\ \ \ \ \ \textcolor{keywordtype}{bool}\ IsCommandAcknowledgment(\textcolor{keywordtype}{string}\ pDataToVerify);}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00102\ \ \ \ \ \textcolor{keywordtype}{bool}\ IsHeader(\textcolor{keywordtype}{string}\ pDataToVerify);}
\DoxyCodeLine{00103\ }
\DoxyCodeLine{00109\ \ \ \ \ \textcolor{keywordtype}{bool}\ IsEndOfPacket(\textcolor{keywordtype}{string}\ pDataToVerify);}
\DoxyCodeLine{00110\ }
\DoxyCodeLine{00116\ \ \ \ \ \textcolor{keywordtype}{bool}\ IsFirstPacket(\textcolor{keywordtype}{string}\ pDataToVerify);}
\DoxyCodeLine{00117\ }
\DoxyCodeLine{00122\ \ \ \ \ \textcolor{keywordtype}{int}\ GetPacketHeaderSizeToRead();}
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00128\ \ \ \ \ \textcolor{keywordtype}{int}\ CountToReadForLength(\textcolor{keywordtype}{char}*\ pHeaderBuffer);}
\DoxyCodeLine{00129\ }
\DoxyCodeLine{00136\ \ \ \ \ \textcolor{keywordtype}{int}\ GetPacketLengthToRead(\textcolor{keywordtype}{char}*\ pLenHeaderBuffer,\ \textcolor{keywordtype}{int}\ pPacketType);}
\DoxyCodeLine{00137\ }
\DoxyCodeLine{00141\ \ \ \ \ \mbox{\hyperlink{a00856}{CommunicationStatus}}\ Initialize();}
\DoxyCodeLine{00142\ }
\DoxyCodeLine{00148\ \ \ \ \ \textcolor{keywordtype}{void}\ Close();}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00150\ \ \ \ \ \textcolor{comment}{//\ Public\ exposed\ feature\ methods}}
\DoxyCodeLine{00151\ \ \ \ \ }
\DoxyCodeLine{00156\ \ \ \ \ \mbox{\hyperlink{a00928}{RawData}}\ RetrieveRawData();}
\DoxyCodeLine{00157\ }
\DoxyCodeLine{00158\ \ \ \ \ }
\DoxyCodeLine{00159\ \ \ \ \ \textcolor{comment}{//\ Device\ utilities}}
\DoxyCodeLine{00160\ }
\DoxyCodeLine{00164\ \ \ \ \ \textcolor{keywordtype}{void}\ ResetDevice();}
\DoxyCodeLine{00165\ }
\DoxyCodeLine{00169\ \ \ \ \ \textcolor{keywordtype}{void}\ RebootDevice();}
\DoxyCodeLine{00170\ }
\DoxyCodeLine{00171\ \ \ \ \ \textcolor{comment}{//\ Command\ settings\ management}}
\DoxyCodeLine{00172\ \ \ \ \ \textcolor{comment}{//\ Data\ retrieve}}
\DoxyCodeLine{00177\ \ \ \ \ \mbox{\hyperlink{a00780}{NetworkInformation}}\ \ GetNetworkInformation();}
\DoxyCodeLine{00178\ }
\DoxyCodeLine{00183\ \ \ \ \ PROTOCOL\ GetRawDataExchangeMode();}
\DoxyCodeLine{00184\ }
\DoxyCodeLine{00189\ \ \ \ \ SCAN\_PACKET\_TYPE\ GetDataPacketType();}
\DoxyCodeLine{00190\ }
\DoxyCodeLine{00195\ \ \ \ \ SensorResolutionFrequencyEnum\ GetAngularResolution();}
\DoxyCodeLine{00196\ }
\DoxyCodeLine{00201\ \ \ \ \ SCANNING\_DIRECTION\ GetScanningDirection();}
\DoxyCodeLine{00202\ }
\DoxyCodeLine{00207\ \ \ \ \ \mbox{\hyperlink{a00772}{AngleRange}}\ GetAngleRange();}
\DoxyCodeLine{00208\ }
\DoxyCodeLine{00213\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ GetSkipScan();}
\DoxyCodeLine{00214\ }
\DoxyCodeLine{00219\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ GetImmunityLevel();}
\DoxyCodeLine{00220\ }
\DoxyCodeLine{00225\ \ \ \ \ \mbox{\hyperlink{a00776}{ContaminationThreshold}}\ GetContaminationThreshold();}
\DoxyCodeLine{00226\ }
\DoxyCodeLine{00231\ \ \ \ \ \mbox{\hyperlink{a00864}{ContaminationStatus}}\ GetContaminationStatus();}
\DoxyCodeLine{00232\ }
\DoxyCodeLine{00237\ \ \ \ \ \mbox{\hyperlink{a00936}{SoftwareVersion}}\ GetVersion();}
\DoxyCodeLine{00238\ }
\DoxyCodeLine{00243\ \ \ \ \ uint16\_t\ GetPlatformVersion();}
\DoxyCodeLine{00244\ }
\DoxyCodeLine{00249\ \ \ \ \ \textcolor{keywordtype}{int}\ GetTemperature();}
\DoxyCodeLine{00250\ }
\DoxyCodeLine{00255\ \ \ \ \ vector<RawDataError>\ GetErrorLog();}
\DoxyCodeLine{00256\ }
\DoxyCodeLine{00261\ \ \ \ \ \mbox{\hyperlink{a00796}{SensorLeds}}\ GetSensorLeds();}
\DoxyCodeLine{00262\ }
\DoxyCodeLine{00267\ \ \ \ \ \mbox{\hyperlink{a00792}{SensorLamps}}\ GetSensorLamps();\ \ \ \ }
\DoxyCodeLine{00268\ }
\DoxyCodeLine{00273\ \ \ \ \ \textcolor{keywordtype}{long}\ GetRuntimeHours();}
\DoxyCodeLine{00274\ }
\DoxyCodeLine{00279\ \ \ \ \ \textcolor{keywordtype}{string}\ GetDeviceName();}
\DoxyCodeLine{00280\ }
\DoxyCodeLine{00285\ \ \ \ \ FILTER\_STATUS\ GetFilterStatus();}
\DoxyCodeLine{00286\ }
\DoxyCodeLine{00291\ \ \ \ \ WINDOW\_CALIBRATION\ GetWindowCalibrationStatus();}
\DoxyCodeLine{00292\ }
\DoxyCodeLine{00298\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetNetworkInformation(\mbox{\hyperlink{a00780}{NetworkInformation}}\ pNetwork);}
\DoxyCodeLine{00299\ }
\DoxyCodeLine{00305\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetRawDataExchangeMode(PROTOCOL\ pProtocol);}
\DoxyCodeLine{00306\ }
\DoxyCodeLine{00312\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetDataPacketType(SCAN\_PACKET\_TYPE\ pPacketType);}
\DoxyCodeLine{00313\ }
\DoxyCodeLine{00319\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetAngularResolution(SensorResolutionFrequencyEnum\ pResolution);}
\DoxyCodeLine{00320\ }
\DoxyCodeLine{00326\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetScanningDirection(SCANNING\_DIRECTION\ pScanDirection);}
\DoxyCodeLine{00327\ }
\DoxyCodeLine{00333\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetAngleRange(\mbox{\hyperlink{a00772}{AngleRange}}\ pAngleRange);}
\DoxyCodeLine{00334\ }
\DoxyCodeLine{00340\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetSkipScan(\textcolor{keywordtype}{int}\ pSkipScan);}
\DoxyCodeLine{00341\ }
\DoxyCodeLine{00347\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetImmunityLevel(\textcolor{keywordtype}{int}\ pImmunityLevel);}
\DoxyCodeLine{00348\ }
\DoxyCodeLine{00354\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetContaminationThreshold(\mbox{\hyperlink{a00776}{ContaminationThreshold}}\ pContaminationThreshold);}
\DoxyCodeLine{00355\ }
\DoxyCodeLine{00361\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetSensorLeds(\mbox{\hyperlink{a00796}{SensorLeds}}\ pLeds);}
\DoxyCodeLine{00362\ }
\DoxyCodeLine{00367\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetDeviceName(\textcolor{keywordtype}{string}\ pName);}
\DoxyCodeLine{00368\ }
\DoxyCodeLine{00374\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ SetFilterStatus(FILTER\_STATUS\ pFilterStatus);}
\DoxyCodeLine{00375\ }
\DoxyCodeLine{00376\ }
\DoxyCodeLine{00381\ \ \ \ \ \mbox{\hyperlink{a00860}{ConfigurationResult}}\ StartWindowCalibration();}
\DoxyCodeLine{00382\ }
\DoxyCodeLine{00386\ \ \ \ \ \textcolor{keywordtype}{void}\ SendMdi();}
\DoxyCodeLine{00387\ }
\DoxyCodeLine{00391\ \ \ \ \ \textcolor{keywordtype}{void}\ StopMdi();}
\DoxyCodeLine{00392\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\mbox{\hyperlink{a00656}{AgvSensor}};}
\DoxyCodeLine{00393\ \textcolor{keyword}{private}:\ \ \ \ }
\DoxyCodeLine{00394\ \ \ \ \ \textcolor{comment}{//\ Variable\ used\ to\ set\ up\ the\ RetrieveRawData\ wait\ system.\ }}
\DoxyCodeLine{00395\ \ \ \ \ \textcolor{comment}{//\ in\ case\ of\ StopMdi,\ the\ thread\ will\ remain\ blocked}}
\DoxyCodeLine{00396\ \ \ \ \ \textcolor{comment}{//\ This\ can\ cause\ unwanted\ behaviour\ when\ a\ BaseDataRecorder}}
\DoxyCodeLine{00397\ \ \ \ \ \textcolor{comment}{//\ has\ join\ the\ RawDataSensor\ class\ and\ attempts\ to\ replay\ recorded\ frames}}
\DoxyCodeLine{00398\ \ \ \ \ \textcolor{comment}{//\ So,\ this\ variable\ will\ be\ setup\ differently\ depending\ on\ the\ presence}}
\DoxyCodeLine{00399\ \ \ \ \ \textcolor{comment}{//\ or\ not\ of\ a\ BaseDataRecorder}}
\DoxyCodeLine{00400\ \ \ \ \ \textcolor{keywordtype}{int}\ \_globalWaitTimeout\ =\ 0xFFFFFFFF;\ }
\DoxyCodeLine{00401\ }
\DoxyCodeLine{00409\ \ \ \ \ \textcolor{keywordtype}{string}\ ExtractRawResult(\textcolor{keywordtype}{string}\ readWriteResponseCommand,\ \textcolor{keywordtype}{string}\ command,\ \textcolor{keywordtype}{string}\ result);}
\DoxyCodeLine{00410\ }
\DoxyCodeLine{00416\ \ \ \ \ \textcolor{keywordtype}{bool}\ CheckForDistIntensity(\textcolor{keywordtype}{string}\ toVerify);}
\DoxyCodeLine{00417\ }
\DoxyCodeLine{00418\ \ \ \ \ \textcolor{keywordtype}{int}\ \_lastPacket\ =\ -\/1;}
\DoxyCodeLine{00419\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00429\ \ \ \ \ \textcolor{keywordtype}{string}\ ExtractCommandResult(\textcolor{keywordtype}{int}\ MODE,\ \textcolor{keywordtype}{string}\ commandCode,\ \textcolor{keywordtype}{string}\ result);}
\DoxyCodeLine{00430\ }
\DoxyCodeLine{00431\ \ \ \ \ }
\DoxyCodeLine{00432\ \ \ \ \ }
\DoxyCodeLine{00433\ \ \ \ \ \textcolor{keywordtype}{string}\ GetImmu\ =\ \{\ 0x47\ ,0x65\ ,0x74\ ,0x49,\ 0x6D,\ 0x6D,\ 0x75\ \};}
\DoxyCodeLine{00434\ \ \ \ \ \textcolor{keywordtype}{string}\ SetImmu\ =\ \{\ 0x53,\ 0x65,\ 0x74,\ 0x49,\ 0x6D,\ 0x6D,\ 0x75\ \};}
\DoxyCodeLine{00435\ \};}
\DoxyCodeLine{00436\ }

\end{DoxyCode}
