Definition of the Raw data sensor services. This header will let the programmer to handle all the requests that have to be sent to the hardware through the appropriate channel. More...
#include <RawDataSensor.h>
Public Member Functions | |
RawDataSensor () | |
Base constructor. | |
~RawDataSensor () | |
Destructor (disconects the data sensor) | |
RawDataSensor (BaseCommunication *comm) | |
Copy constructor: sets the basic communication object. | |
RawData | ExtractData (vector< string >pDataToExtract) |
Extracts the data from the datastream (Internal method, do not use as is) | |
bool | IsCommandAcknowledgment (string pDataToVerify) |
Check if data is a command acknowledgment. | |
bool | IsHeader (string pDataToVerify) |
Check if data is a BEA HEADER. | |
bool | IsEndOfPacket (string pDataToVerify) |
Check if the data is an end of packet group. | |
bool | IsFirstPacket (string pDataToVerify) |
Check if the data is the first packet group. | |
int | GetPacketHeaderSizeToRead () |
Returns a pointer on an array with a determined size. | |
int | CountToReadForLength (char *pHeaderBuffer) |
Indicates how much byte must be read in order to obtain packet len. | |
int | GetPacketLengthToRead (char *pLenHeaderBuffer, int pPacketType) |
Retrieve, in the pHeaderBuffer, the amount of data to read. | |
void | Initialize () |
Initializes the object to connect the sensor. | |
RawData | RetrieveRawData () |
Wait for Raw Data availability. | |
void | ResetDevice () |
Resets the device. | |
void | RebootDevice () |
Reboots the device. | |
NetworkInformation | GetNetworkInformation () |
Gets whole data information. | |
PROTOCOL | GetRawDataExchangeMode () |
Get the raw data exchange mode. | |
SCAN_PACKET_TYPE | GetDataPacketType () |
Gets the data packed type. | |
ANGULAR_RESOLUTION | GetAngularResolution () |
Gets the angular resolution. | |
SCANNING_DIRECTION | GetScanningDirection () |
Gets the scanning direction. | |
AngleRange | GetAngleRange () |
Gets the angle range. | |
unsigned int | GetSkipScan () |
Gets the skip scan. | |
unsigned int | GetImmunityLevel () |
Gets the immunity level. | |
ContaminationThreshold | GetContaminationThreshold () |
Gets the contamination threshold. | |
ContaminationStatus | GetContaminationStatus () |
Gets the contamination status. | |
SoftwareVersion | GetVersion () |
Gets the sensor version data. | |
int | GetTemperature () |
Gets the temperature. | |
vector< RawDataError > | GetErrorLog () |
Gets the error log. | |
SensorLeds | GetSensorLeds () |
Gets the sensor's leds status. | |
SensorLamps | GetSensorLamps () |
Gets the sensor lamps status. | |
long | GetRuntimeHours () |
Gets the sensor runtime hours. | |
string | GetDeviceName () |
Gets the sensor's name. | |
FILTER_STATUS | GetFilterStatus () |
Gets the sensor's filter status. | |
WINDOW_CALIBRATION | GetWindowCalibrationStatus () |
Gets the window calibration status. | |
ConfigurationResult | SetIpAddress (string pIpAddress) |
Sets the IP v4 address of the sensor. | |
ConfigurationResult | SetIpPort (int pPort) |
Sets the IP port of the sensor. | |
ConfigurationResult | SetNetworkInformation (NetworkInformation pNetwork) |
Set the overall network information except IP v4 and Port. | |
ConfigurationResult | SetRawDataExchangeMode (PROTOCOL pProtocol) |
Sets the RAW data exchange mode. Can be either TCP or UDP. | |
ConfigurationResult | SetDataPacketType (SCAN_PACKET_TYPE pPacketType) |
Sets the packet type returned in raw data. Can be either DISTANCE or DISTANCE_INTENSITY. | |
ConfigurationResult | SetAngularResolution (ANGULAR_RESOLUTION pResolution) |
Sets the angle resolution. Can be either ZERO_TO_ZERO_POINT_TWO_AT_EIGHTY_HZ or ZERO_TO_ZERO_POINT_ONE_AT_FOURTY_HZ. | |
ConfigurationResult | SetScanningDirection (SCANNING_DIRECTION pScanDirection) |
Sets the scanning direction. Can be either CLOCKWISE or COUNTER_CLOCKWISE. | |
ConfigurationResult | SetAngleRange (AngleRange pAngleRange) |
Sets the Angle range (start and stop) | |
ConfigurationResult | SetSkipScan (int pSkipScan) |
Sets the skip scan. | |
ConfigurationResult | SetImmunityLevel (int pImmunityLevel) |
Sets the sensor's immunity level. | |
ConfigurationResult | SetContaminationThreshold (ContaminationThreshold pContaminationThreshold) |
Sets the contamination level threshold for warning and error. | |
ConfigurationResult | SetSensorLeds (SensorLeds pLeds) |
Sets the sensors external leds status (ON or OFF) | |
ConfigurationResult | SetDeviceName (string pName) |
Sets the sensor's name. | |
ConfigurationResult | SetFilterStatus (FILTER_STATUS pFilterStatus) |
Sets the sensor's filter status. | |
ConfigurationResult | StartWindowCalibration () |
Starts the window calibration. | |
void | SendMdi () |
Request the sensor to start sending MDI data to host. | |
void | StopMdi () |
Request the sensor to stop sending MDI data to host. | |
Protected Member Functions | |
string | ExtractCommandResult (int MODE, string commandCode, string result) |
This method analyses and decompose the reply to a command comming from the sensor media. It also checks if the reply matches the command that was sent in order to ensure coherence of the data It decompose the reply into a data vector representing the requested data. | |
Protected Attributes | |
string | GetImmu = { 0x47 ,0x65 ,0x74 ,0x49, 0x6D, 0x6D, 0x75 } |
string | SetImmu = { 0x53, 0x65, 0x74, 0x49, 0x6D, 0x6D, 0x75 } |
Definition of the Raw data sensor services. This header will let the programmer to handle all the requests that have to be sent to the hardware through the appropriate channel.
RawDataSensor::RawDataSensor | ( | ) |
Base constructor.
RawDataSensor::~RawDataSensor | ( | ) |
Destructor (disconects the data sensor)
RawDataSensor::RawDataSensor | ( | BaseCommunication * | comm | ) |
Copy constructor: sets the basic communication object.
comm | The basic communication object |
int RawDataSensor::CountToReadForLength | ( | char * | pHeaderBuffer | ) |
Indicates how much byte must be read in order to obtain packet len.
|
protected |
This method analyses and decompose the reply to a command comming from the sensor media. It also checks if the reply matches the command that was sent in order to ensure coherence of the data It decompose the reply into a data vector representing the requested data.
MODE | READ or WRITE mode |
commandCode | The sensor GCID command to be analysed |
result | A string representing the media stream returned from the sensor after command execution |
RawData RawDataSensor::ExtractData | ( | vector< string > | pDataToExtract | ) |
Extracts the data from the datastream (Internal method, do not use as is)
pDataToExtract | Datastream vector |
AngleRange RawDataSensor::GetAngleRange | ( | ) |
Gets the angle range.
ANGULAR_RESOLUTION RawDataSensor::GetAngularResolution | ( | ) |
Gets the angular resolution.
ContaminationStatus RawDataSensor::GetContaminationStatus | ( | ) |
Gets the contamination status.
ContaminationThreshold RawDataSensor::GetContaminationThreshold | ( | ) |
Gets the contamination threshold.
SCAN_PACKET_TYPE RawDataSensor::GetDataPacketType | ( | ) |
Gets the data packed type.
string RawDataSensor::GetDeviceName | ( | ) |
Gets the sensor's name.
vector< RawDataError > RawDataSensor::GetErrorLog | ( | ) |
Gets the error log.
FILTER_STATUS RawDataSensor::GetFilterStatus | ( | ) |
Gets the sensor's filter status.
unsigned int RawDataSensor::GetImmunityLevel | ( | ) |
Gets the immunity level.
NetworkInformation RawDataSensor::GetNetworkInformation | ( | ) |
Gets whole data information.
int RawDataSensor::GetPacketHeaderSizeToRead | ( | ) |
Returns a pointer on an array with a determined size.
int RawDataSensor::GetPacketLengthToRead | ( | char * | pLenHeaderBuffer, |
int | pPacketType | ||
) |
Retrieve, in the pHeaderBuffer, the amount of data to read.
pHeaderBuffer | |
pPacketType | RAW data (2) or Command data (4) ? |
PROTOCOL RawDataSensor::GetRawDataExchangeMode | ( | ) |
Get the raw data exchange mode.
long RawDataSensor::GetRuntimeHours | ( | ) |
Gets the sensor runtime hours.
SCANNING_DIRECTION RawDataSensor::GetScanningDirection | ( | ) |
Gets the scanning direction.
SensorLamps RawDataSensor::GetSensorLamps | ( | ) |
Gets the sensor lamps status.
SensorLeds RawDataSensor::GetSensorLeds | ( | ) |
Gets the sensor's leds status.
unsigned int RawDataSensor::GetSkipScan | ( | ) |
Gets the skip scan.
int RawDataSensor::GetTemperature | ( | ) |
Gets the temperature.
SoftwareVersion RawDataSensor::GetVersion | ( | ) |
Gets the sensor version data.
WINDOW_CALIBRATION RawDataSensor::GetWindowCalibrationStatus | ( | ) |
Gets the window calibration status.
void RawDataSensor::Initialize | ( | ) |
Initializes the object to connect the sensor.
bool RawDataSensor::IsCommandAcknowledgment | ( | string | pDataToVerify | ) |
Check if data is a command acknowledgment.
pDataToVerify | The string to be checked |
bool RawDataSensor::IsEndOfPacket | ( | string | pDataToVerify | ) |
Check if the data is an end of packet group.
pDataToVerify | The string to be checked |
bool RawDataSensor::IsFirstPacket | ( | string | pDataToVerify | ) |
Check if the data is the first packet group.
pDataToVerify | The string to be checked |
bool RawDataSensor::IsHeader | ( | string | pDataToVerify | ) |
Check if data is a BEA HEADER.
pDataToVerify | The string to be checked |
void RawDataSensor::RebootDevice | ( | ) |
Reboots the device.
void RawDataSensor::ResetDevice | ( | ) |
Resets the device.
RawData RawDataSensor::RetrieveRawData | ( | ) |
Wait for Raw Data availability.
void RawDataSensor::SendMdi | ( | ) |
Request the sensor to start sending MDI data to host.
ConfigurationResult RawDataSensor::SetAngleRange | ( | AngleRange | pAngleRange | ) |
Sets the Angle range (start and stop)
pAngleRange | The encapsulation of the angle range to be set |
ConfigurationResult RawDataSensor::SetAngularResolution | ( | ANGULAR_RESOLUTION | pResolution | ) |
Sets the angle resolution. Can be either ZERO_TO_ZERO_POINT_TWO_AT_EIGHTY_HZ or ZERO_TO_ZERO_POINT_ONE_AT_FOURTY_HZ.
pResolution |
ConfigurationResult RawDataSensor::SetContaminationThreshold | ( | ContaminationThreshold | pContaminationThreshold | ) |
Sets the contamination level threshold for warning and error.
pContaminationThreshold | The encapsulation of contamination leve threshold |
ConfigurationResult RawDataSensor::SetDataPacketType | ( | SCAN_PACKET_TYPE | pPacketType | ) |
Sets the packet type returned in raw data. Can be either DISTANCE or DISTANCE_INTENSITY.
pPacketType | The packet type to be set |
ConfigurationResult RawDataSensor::SetDeviceName | ( | string | pName | ) |
Sets the sensor's name.
ConfigurationResult RawDataSensor::SetFilterStatus | ( | FILTER_STATUS | pFilterStatus | ) |
Sets the sensor's filter status.
pFilterStatus | FILTER_ON or FILTER_OFF will enable / disable the filter |
ConfigurationResult RawDataSensor::SetImmunityLevel | ( | int | pImmunityLevel | ) |
Sets the sensor's immunity level.
pImmunityLevel | The immunity level to be set |
ConfigurationResult RawDataSensor::SetIpAddress | ( | string | pIpAddress | ) |
Sets the IP v4 address of the sensor.
pIpAddress | The IP v4 address to be set |
ConfigurationResult RawDataSensor::SetIpPort | ( | int | pPort | ) |
Sets the IP port of the sensor.
pPort | The IP port to be set |
ConfigurationResult RawDataSensor::SetNetworkInformation | ( | NetworkInformation | pNetwork | ) |
Set the overall network information except IP v4 and Port.
pNetwork | An encapsulation of the network data |
ConfigurationResult RawDataSensor::SetRawDataExchangeMode | ( | PROTOCOL | pProtocol | ) |
Sets the RAW data exchange mode. Can be either TCP or UDP.
pProtocol | The exchange mode (TCP or UDP) |
ConfigurationResult RawDataSensor::SetScanningDirection | ( | SCANNING_DIRECTION | pScanDirection | ) |
Sets the scanning direction. Can be either CLOCKWISE or COUNTER_CLOCKWISE.
pScanDirection |
ConfigurationResult RawDataSensor::SetSensorLeds | ( | SensorLeds | pLeds | ) |
Sets the sensors external leds status (ON or OFF)
pLeds | The encapsulation of the leds to be set |
ConfigurationResult RawDataSensor::SetSkipScan | ( | int | pSkipScan | ) |
Sets the skip scan.
pSkipScan | The skip scan value to be set |
ConfigurationResult RawDataSensor::StartWindowCalibration | ( | ) |
Starts the window calibration.
void RawDataSensor::StopMdi | ( | ) |
Request the sensor to stop sending MDI data to host.
|
protected |
|
protected |