2#include "../AgvSensor/AgvSensor.h"
4#include "WObjectSize.h"
6#include "WMultipleSampling.h"
8#include "WOutputActiveLevel.h"
9#include "WOutputFunction.h"
10#include "WAgvSensorLeds.h"
11#include <ThreadCreationException.h>
12#include <SensorErrorException.h>
13#include <BadAcknowledgmentException.h>
14#include <CommunicationException.h>
21using namespace System::Collections;
22using namespace System::Collections::Generic;
27 namespace AgvSensorWrapper {
34 this->_sensor = (BaseSensor*)
new AgvSensor();
40 _sensor = (BaseSensor*)
new AgvSensor(pcomm->__nativeCommunication);
42 Communication = pcomm;
53 _wRawData->Communication = this->Communication;
54 _sensor->SetCommunication(this->Communication->__nativeCommunication);
240 vector<unsigned int> actual = ((
AgvSensor*)_sensor)->GetWms();
241 List<unsigned int>^ toReturn = gcnew List<unsigned int>();
243 for (
int i = 0; i < actual.size(); i++) {
245 toReturn->Add(actual[i]);
261 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
334 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
370 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
389 FieldData actual = ((
AgvSensor*)_sensor)->GetField(fieldNumber,
static_cast<NativeZoneTypeEnum
>(zone));
394 toReturn->Crc = actual.
GetCrc();
395 toReturn->GUID = gcnew String(actual.
GetGUID().c_str());
396 toReturn->__fetchNativeData(actual.
GetData());
411 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
447 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
483 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
520 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
557 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
591 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
621 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
651 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
681 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
711 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
741 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
771 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
801 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
831 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
860 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
873 for (
int i = 0; i < pResult.
GetReasons().size(); i++) {
874 toReturn->PushReason(gcnew String(pResult.
GetReasons()[i].c_str()));
Definition WAgvSensor.h:26
Definition WAgvSensorLeds.h:6
Definition WAvailableResolution.h:7
Definition WBadAcknowledgmentException.h:3
Definition WBaseCommunication.h:16
ZoneTypeEnum
Definition WEnums.h:21
ScanPacketType
Definition WEnums.h:7
FunctionEnum
Definition WEnums.h:23
Protocol
Definition WEnums.h:6
ObjSizeEnum
Definition WEnums.h:20
ActiveLevelEnum
Definition WEnums.h:22
Definition WEthernetCommunication.h:5
A wrapper on the RawData data encapsulation.
Definition WRawData.h:5
Definition AgvSensor.h:37
Definition AgvSensorLeds.h:11
bool GetContaminationLed()
Gets the contamination led.
Definition AgvSensorLeds.cpp:4
Definition FieldData.h:14
vector< uint16_t > GetData()
Definition FieldData.cpp:64
NativeZoneTypeEnum GetZoneType()
Definition FieldData.cpp:14
uint16_t GetCrc()
Definition FieldData.cpp:44
string GetGUID()
Definition FieldData.cpp:54
int16_t GetParameter2()
Definition FieldData.cpp:34
uint8_t GetFieldNumber()
Definition FieldData.cpp:4
int16_t GetParameter1()
Definition FieldData.cpp:24
Definition FieldName.h:10
int GetFieldNumber()
Get the field number.
Definition FieldName.cpp:4
string GetProtectionZoneName()
Gets the protection zone name.
Definition FieldName.cpp:24
string GetWarning1ZoneName()
Gets the warning 1 zone name.
Definition FieldName.cpp:34
string GetWarning2ZoneName()
Gets the warning 2 zone name.
Definition FieldName.cpp:44
uint16_t GetWarning2()
Definition HoldTime.cpp:23
uint16_t GetWarning1()
Definition HoldTime.cpp:13
uint16_t GetProtection()
Definition HoldTime.cpp:3
Definition MultipleSampling.h:10
uint8_t GetWarning1()
Definition MultipleSampling.cpp:14
uint8_t GetProtection()
Definition MultipleSampling.cpp:4
uint8_t GetWarning2()
Definition MultipleSampling.cpp:24
Definition ObjectSize.h:13
NativeObjSizeEnum GetWarning2()
Gets the warning2 size.
Definition ObjectSize.cpp:24
NativeObjSizeEnum GetProtection()
Gets the protection size.
Definition ObjectSize.cpp:4
NativeObjSizeEnum GetWarning1()
Gets the warning1 size.
Definition ObjectSize.cpp:14
Definition OutputActiveLevel.h:12
NativeActiveLevelEnum GetOutput1()
Definition OutputActiveLevel.cpp:4
NativeActiveLevelEnum GetOutput3()
Definition OutputActiveLevel.cpp:24
NativeActiveLevelEnum GetOutput4()
Definition OutputActiveLevel.cpp:34
NativeActiveLevelEnum GetOutput2()
Definition OutputActiveLevel.cpp:14
Definition OutputFunction.h:12
NativeFunctionEnum GetOutput4()
Definition OutputFunction.cpp:34
NativeFunctionEnum GetOutput1()
Definition OutputFunction.cpp:4
NativeFunctionEnum GetOutput3()
Definition OutputFunction.cpp:24
NativeFunctionEnum GetOutput2()
Definition OutputFunction.cpp:14
Definition WAgvSensor.h:31
WRawData RetrieveRawData()
Definition WAgvSensor.h:58
WConfigurationResult toManagedInstance(ConfigurationResult pResult)
Definition WAgvSensor.h:870
void ResetDevice()
Resets the device.
Definition WAgvSensor.h:223
WNetworkInformation GetNetworkInformation()
Gets whole data information.
Definition WAgvSensor.h:145
WAngleRange GetAngleRange()
Gets the angle range.
Definition WAgvSensor.h:87
void StopMdi()
Request the sensor to stop sending MDI data to host.
Definition WAgvSensor.h:71
WAgvSensor()
Definition WAgvSensor.h:33
WConfigurationResult SetDataPacketType(ScanPacketType pPacketType)
Sets the packet type returned in raw data. Can be either ScanPacketType::Distance or ScanPacketType::...
Definition WAgvSensor.h:171
WConfigurationResult SetField(WFieldData^ data)
Set the requested field data.
Definition WAgvSensor.h:666
int GetTemperature()
Gets the temperature.
Definition WAgvSensor.h:127
WSoftwareVersion GetVersion() override
Gets the sensor version data.
Definition WAgvSensor.h:119
void RebootDevice()
Reboots the device.
Definition WAgvSensor.h:230
WConfigurationResult SetObjectSize(WObjectSize^ sizeToSet)
Sets the object size.
Definition WAgvSensor.h:636
WConfigurationResult SetImmunityLevel(int pImmunityLevel)
Sets the sensor's immunity level.
Definition WAgvSensor.h:189
Protocol GetRawDataExchangeMode()
Get the raw data exchange mode.
Definition WAgvSensor.h:79
WMultipleSampling GetMultipleSampling()
Gets the multiple sampling data.
Definition WAgvSensor.h:425
WConfigurationResult SetRawDataExchangeMode(Protocol pProtocol)
Sets the RAW data exchange mode. Can be either TCP or UDP.
Definition WAgvSensor.h:162
WOutputFunction GetOutputFunction()
Gest the output function for 4 outputs.
Definition WAgvSensor.h:534
WConfigurationResult StoreInFlash()
Store fields in the flash.
Definition WAgvSensor.h:845
WConfigurationResult SetContaminationThreshold(WContaminationThreshold^ pContaminationThreshold)
Sets the contamination level threshold for warning and error.
Definition WAgvSensor.h:198
List< WRawDataError^> GetErrorLog()
Gets the error log.
Definition WAgvSensor.h:135
~WAgvSensor()
Definition WAgvSensor.h:45
WConfigurationResult SetHoldTime(WHoldTime^ holdTime)
Sets the Hold time.
Definition WAgvSensor.h:726
WConfigurationResult SetMultipleSampling(WMultipleSampling^ sampling)
Sets the multiple sampling.
Definition WAgvSensor.h:696
WObjectSize GetObjectSize()
Gets the object size.
Definition WAgvSensor.h:347
WConfigurationResult SetDeviceName(String^ pName)
Sets the sensor's name.
Definition WAgvSensor.h:216
unsigned int GetImmunityLevel()
Gets the immunity level.
Definition WAgvSensor.h:103
WHoldTime GetHoldTime()
Gets Hold Time (ms)
Definition WAgvSensor.h:461
WFieldData GetField(int fieldNumber, ZoneTypeEnum zone)
Returns the requested field data.
Definition WAgvSensor.h:385
void SendMdi()
Request the sensor to start sending MDI data to host.
Definition WAgvSensor.h:64
String GetDeviceName()
Gets the sensor's name.
Definition WAgvSensor.h:153
WConfigurationResult SetSensorLeds(WAgvSensorLeds^ leds)
Sets the sensor's leds.
Definition WAgvSensor.h:816
WOutputActiveLevel GetOutputActiveLevel()
Gets the output active level for 4 outputs.
Definition WAgvSensor.h:497
WConfigurationResult SetAngleRange(WAngleRange^ pAngleRange)
Sets the Angle range (start and stop)
Definition WAgvSensor.h:180
WCommunicationStatus Initialize() override
Initializes the object to connect the sensor.
Definition WAgvSensor.h:52
WAgvSensorLeds GetSensorLeds()
Gets the navigation sensor leds status.
Definition WAgvSensor.h:569
WAgvSensor(WBaseCommunication^ pcomm)
Definition WAgvSensor.h:38
WContaminationThreshold GetContaminationThreshold()
Gets the contamination threshold.
Definition WAgvSensor.h:111
WConfigurationResult SetOutputFunction(WOutputFunction^ function)
Sets the output function.
Definition WAgvSensor.h:786
List< unsigned int > GetWms()
Returns the window monitoring system of each sector (SECTORS_COUNT sectors - 132 -)
Definition WAgvSensor.h:238
WConfigurationResult SetOutputActiveLevel(WOutputActiveLevel^ activeLevel)
Sets the output active level.
Definition WAgvSensor.h:756
ScanPacketType GetDataPacketType()
Gets the data packed type.
Definition WAgvSensor.h:95
WFieldName GetFieldName(int fieldSetNumber)
Gets the sensor lamps status.
Definition WAgvSensor.h:310
WConfigurationResult SetNetworkInformation(WNetworkInformation^ pNetwork)
Set the overall network information except IP v4 and Port.
Definition WAgvSensor.h:208
WConfigurationResult SetFieldName(WFieldName^ fieldName)
Sets the field name data.
Definition WAgvSensor.h:606
Definition WAgvSensorLeds.h:8
property bool ContaminationLed
Definition WAgvSensorLeds.h:24
Definition WFieldData.h:15
property int FieldNumber
Definition WFieldData.h:35
Definition WFieldName.h:15
property int FieldNumber
Definition WFieldName.h:33
property unsigned int Protection
Definition WHoldTime.h:24
Definition WMultipleSampling.h:8
property unsigned int Protection
Definition WMultipleSampling.h:24
Definition WObjectSize.h:11
property ObjSizeEnum Protection
Definition WObjectSize.h:27
Definition WOutputActiveLevel.h:11
property ActiveLevelEnum Output1
Definition WOutputActiveLevel.h:28
Definition WOutputFunction.h:11
property FunctionEnum Output1
Definition WOutputFunction.h:28
bool GetLogoLed()
Gets the logo led.
Definition SensorLeds.cpp:44
bool GetStatusLed()
Gets the status led.
Definition SensorLeds.cpp:26
A wrapper on the AngleRange data encapsulation.
Definition WAngleRange.h:7
A wrapper on the ContaminationThreshold data encapsulation.
Definition WContaminationThreshold.h:7
A wrapper on the NetworkInformation data encapsulation.
Definition WNetworkInformation.h:14
This class is a wrapper around the unmanaged code RawDataSensor. The goal of this classe is make acce...
Definition WRawDataSensor.h:36
WConfigurationResult SetNetworkInformation(WNetworkInformation^ pNetwork)
Set the overall network information except IP v4 and Port.
Definition WRawDataSensor.h:818
WConfigurationResult SetDeviceName(String^ pName)
Sets the sensor's name.
Definition WRawDataSensor.h:1142
String GetDeviceName()
Gets the sensor's name.
Definition WRawDataSensor.h:714
Protocol GetRawDataExchangeMode()
Get the raw data exchange mode.
Definition WRawDataSensor.h:177
void StopMdi()
Request the sensor to stop sending MDI data to host.
Definition WRawDataSensor.h:1338
WConfigurationResult SetContaminationThreshold(WContaminationThreshold^ pContaminationThreshold)
Sets the contamination level threshold for warning and error.
Definition WRawDataSensor.h:1082
int GetTemperature()
Gets the temperature.
Definition WRawDataSensor.h:543
unsigned int GetImmunityLevel()
Gets the immunity level.
Definition WRawDataSensor.h:377
WAngleRange GetAngleRange()
Gets the angle range.
Definition WRawDataSensor.h:313
WRawData RetrieveRawData()
Definition WRawDataSensor.h:1233
WConfigurationResult SetImmunityLevel(int pImmunityLevel)
Sets the sensor's immunity level.
Definition WRawDataSensor.h:1052
WCommunicationStatus Initialize() override
Initializes the object to connect the sensor.
Definition WRawDataSensor.h:54
WNetworkInformation GetNetworkInformation()
Gets whole data information.
Definition WRawDataSensor.h:138
ScanPacketType GetDataPacketType()
Gets the data packed type.
Definition WRawDataSensor.h:212
void ResetDevice()
Resets the device.
Definition WRawDataSensor.h:79
WConfigurationResult SetDataPacketType(ScanPacketType pPacketType)
Sets the packet type returned in raw data. Can be either ScanPacketType::Distance or ScanPacketType::...
Definition WRawDataSensor.h:885
WContaminationThreshold GetContaminationThreshold()
Gets the contamination threshold.
Definition WRawDataSensor.h:406
WConfigurationResult SetRawDataExchangeMode(Protocol pProtocol)
Sets the RAW data exchange mode. Can be either TCP or UDP.
Definition WRawDataSensor.h:848
void SendMdi()
Request the sensor to start sending MDI data to host.
Definition WRawDataSensor.h:1309
List< WRawDataError^> GetErrorLog()
Gets the error log.
Definition WRawDataSensor.h:572
void RebootDevice()
Reboots the device.
Definition WRawDataSensor.h:107
WSoftwareVersion GetVersion() override
Gets the sensor version data.
Definition WRawDataSensor.h:477
WConfigurationResult SetAngleRange(WAngleRange^ pAngleRange)
Sets the Angle range (start and stop)
Definition WRawDataSensor.h:991
An Exception used when a bad acknowledgment error is detected.
Definition RodConfigSoftware_Samples/RODConfigSoftwareSamples/includes/Toolbox/BadAcknowledgmentException.h:14
virtual const char * what() const noexcept
Overload of message retrie.
Definition RodConfigSoftware_Samples/RODConfigSoftwareSamples/includes/Toolbox/BadAcknowledgmentException.h:39
An Exception used when a communication error is detected.
Definition RodConfigSoftware_Samples/RODConfigSoftwareSamples/includes/Toolbox/CommunicationException.h:14
Helper to encapsulate the configuration result.
Definition RodConfigSoftware_Samples/RODConfigSoftwareSamples/includes/Toolbox/ConfigurationResult.h:15
bool GetResult()
Gets the result.
Definition ConfigurationResult.cpp:33
vector< string > GetReasons()
Gets the reason of failure.
Definition ConfigurationResult.cpp:42
An exception used when the sensor returns an error related to a command excecution.
Definition RodConfigSoftware_Samples/RODConfigSoftwareSamples/includes/Toolbox/SensorErrorException.h:13
An Exception used when a thread creation error is detected.
Definition RodConfigSoftware_Samples/RODConfigSoftwareSamples/includes/Toolbox/ThreadCreationException.h:15
Definition WBadAcknowledgmentException.h:6
Definition WCommunicationException.h:6
property int ErrorCode
Definition WCommunicationException.h:12
Definition WCommunicationStatus.h:16
A wrapper on the ConfigurationResult data encapsulation.
Definition WConfigurationResult.h:16
property bool Result
Definition WConfigurationResult.h:30
Definition WSensorException.h:6
property String ErrorCode
Definition WSensorException.h:12
A wrapper on the SoftwareVersion data encapsulation.
Definition WSoftwareVersion.h:12
Definition WThreadCreationException.h:6