3#include <NavigationSensor.h>
4#include "WFilterType.h"
7#include <CommunicationException.h>
8#include <SensorErrorException.h>
9#include <ThreadCreationException.h>
10#include <BadAcknowledgmentException.h>
11#include <CommunicationException.h>
12#include <ParameterNotSupportedException.h>
19using namespace System::Collections;
20using namespace System::Collections::Generic;
32 Communication = pcomm;
46 for (
int i = 0; i < status.
Channels.size(); i++) {
69 toReturn->FilterTypeValue = FilterMode::Median;
72 toReturn->FilterTypeValue = FilterMode::Average;
75 toReturn->FilterTypeValue = FilterMode::Max;
78 toReturn->FilterTypeValue = FilterMode::Combo;
83 toReturn->NumS = toFetch.
GetNumS();
98 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
112 switch (pFilterType->FilterTypeValue) {
113 case FilterMode::Median:
116 case FilterMode::Average:
119 case FilterMode::Max:
122 case FilterMode::Combo:
128 toSet.
SetNumS(pFilterType->NumS);
146 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
162 ANGULAR_RESOLUTION actual = ((
NavigationSensor*)_sensor)->GetAngularResolution();
163 if (actual == ZERO_TO_ZERO_POINT_ONE_AT_FOURTY_HZ) {
164 return AngularResolution::ZeroToZeroPointOneAtFourtyHz;
166 else if (actual == ZERO_TO_ZERO_POINT_TWO_AT_EIGHTY_HZ) {
167 return AngularResolution::ZeroToZeroPointTwoAtEightyHz;
169 else if (actual == ZERO_TO_ZERO_POINT_ZERO_FIVE_AT_TWENTY_HZ) {
170 return AngularResolution::ZeroToZeroPointZeroFiveAtTwentyHz;
172 else if (actual == ZERO_TO_ZERO_POINT_ZERO_TWENTYFIVE_AT_TEN_HZ) {
173 return AngularResolution::ZeroToZeroPointZeroTwoFiveAtTenHz;
175 else if (actual == ZERO_TO_ZERO_POINT_ZERO_SOMETHING_AT_FIFTY_HZ) {
176 return AngularResolution::ZeroToZeroSomethingAtFiftyHz;
190 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
208 ANGULAR_RESOLUTION toSet = -1;
209 if (pResolution == AngularResolution::ZeroToZeroPointOneAtFourtyHz) {
210 toSet = ZERO_TO_ZERO_POINT_ONE_AT_FOURTY_HZ;
212 else if(pResolution == AngularResolution::ZeroToZeroPointTwoAtEightyHz) {
213 toSet = ZERO_TO_ZERO_POINT_TWO_AT_EIGHTY_HZ;
215 else if (pResolution == AngularResolution::ZeroToZeroPointZeroFiveAtTwentyHz) {
216 toSet = ZERO_TO_ZERO_POINT_ZERO_FIVE_AT_TWENTY_HZ;
218 else if (pResolution == AngularResolution::ZeroToZeroPointZeroTwoFiveAtTenHz) {
219 toSet = ZERO_TO_ZERO_POINT_ZERO_TWENTYFIVE_AT_TEN_HZ;
221 else if (pResolution == AngularResolution::ZeroToZeroSomethingAtFiftyHz) {
222 toSet = ZERO_TO_ZERO_POINT_ZERO_SOMETHING_AT_FIFTY_HZ;
238 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
255 if (actual == CUSTOMIZE_LOGO_PAGE) {
256 return DisplayPageIndex::CustomLogoPage;
258 else if (actual == OPERATING_STATUS_PAGE) {
259 return DisplayPageIndex::OperatingStatus;
261 else if (actual == WMS_STATUS_PAGE) {
262 return DisplayPageIndex::WmsStatus;
264 else if (actual == ETH_USB_CONNECT_STATUS_PAGE) {
265 return DisplayPageIndex::EthUsbConnectStatus;
267 else if (actual == NETWORK_INFORMATION_PAGE) {
268 return DisplayPageIndex::NetworkInfo;
270 else if (actual == BLUETHOOT_CONNECTION_PAGE) {
271 return DisplayPageIndex::BluethootConnection;
285 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
303 PAGE_INDEX toSet = -1;
304 if (pPageIndex == DisplayPageIndex::CustomLogoPage) {
305 toSet = CUSTOMIZE_LOGO_PAGE;
307 else if (pPageIndex == DisplayPageIndex::OperatingStatus) {
308 toSet = OPERATING_STATUS_PAGE;
310 else if (pPageIndex == DisplayPageIndex::WmsStatus) {
311 toSet = WMS_STATUS_PAGE;
313 else if (pPageIndex == DisplayPageIndex::EthUsbConnectStatus) {
314 toSet = ETH_USB_CONNECT_STATUS_PAGE;
316 else if (pPageIndex == DisplayPageIndex::NetworkInfo) {
317 toSet = NETWORK_INFORMATION_PAGE;
319 else if (pPageIndex == DisplayPageIndex::BluethootConnection) {
320 toSet = BLUETHOOT_CONNECTION_PAGE;
336 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
353 PAGE_DIRECTION actual = ((
NavigationSensor*)_sensor)->GetDisplayPageDirection();
354 if (actual == NORMAL) {
355 return PageDirection::Normal;
357 else if (actual == UPSIDE_DOWN) {
358 return PageDirection::UpsideDown;
372 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
390 PAGE_DIRECTION toSet = -1;
391 if (pPageDirection == PageDirection::Normal) {
394 else if (pPageDirection == PageDirection::UpsideDown) {
411 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
429 if (actual == NORMAL_MODE) {
430 return DisplayMode::Normal;
432 else if (actual == ON_MODE) {
433 return DisplayMode::On;
435 else if (actual == OFF_MODE) {
436 return DisplayMode::Off;
450 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
468 DISPLAY_MODE toSet = -1;
469 if (pdisplayMode == DisplayMode::Normal) {
472 else if (pdisplayMode == DisplayMode::On) {
475 else if (pdisplayMode == DisplayMode::Off) {
492 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
509 List<List<UInt16>^>^ toReturn = gcnew List<List<UInt16>^>();
511 vector<LOGO_IMAGE_SEGMENT> sensorImage = ((
NavigationSensor*)_sensor)->GetLogoImage();
513 for (
int segment = 0; segment < IMAGE_SEGMENT_SIZE; segment++) {
514 List<UInt16>^ segmentOfPixelToAdd = gcnew List<UInt16>();
515 for (
int pixel = 0; pixel < PIXELS_PER_SEGMENT; pixel++) {
516 segmentOfPixelToAdd->Add( sensorImage[segment][pixel]);
518 toReturn->Add(segmentOfPixelToAdd);
534 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
553 vector<LOGO_IMAGE_SEGMENT> toFetch;
556 for each (List<UInt16>^ segment
in logoToFetch) {
557 vector<IMAGE_PIXEL> segmentToFetch;
559 for each (UInt16 pixel
in segment) {
560 segmentToFetch.push_back(pixel);
563 toFetch.push_back(segmentToFetch);
578 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
613 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
630 List<unsigned int>^ toReturn = gcnew List<unsigned int>();
632 for (
int i = 0; i < actual.size(); i++) {
634 toReturn->Add(actual[i]);
650 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
684 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
719 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
740 toReturn->Led2 = (LedColor)actual.
GetLed2();
741 toReturn->Led3 = (LedColor)actual.
GetLed3();
742 toReturn->Led4 = LedColor::Black;
757 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
776 toReturn->Z1 = toFetch.
GetZ1();
777 toReturn->Z2 = toFetch.
GetZ2();
778 toReturn->Z3 = toFetch.
GetZ3();
779 toReturn->Z4 = toFetch.
GetZ4();
780 toReturn->Z5 = toFetch.
GetZ5();
781 toReturn->Z6 = toFetch.
GetZ6();
796 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
818 toReturn->Gateway = gcnew String(toFetch.
GetGateway().c_str());
821 toReturn->SubnetMask = gcnew String(toFetch.
GetSubnetMask().c_str());
822 toReturn->MacAddress = gcnew String(toFetch.
GetMacAddress().c_str());
837 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
853 OLED_WAKEUP_RANGE actual = ((
NavigationSensor*)_sensor)->GetDisplayWakeUpRange();
856 return DisplayWakeUpRange::ThreeHundred;
858 return DisplayWakeUpRange::FiveHundred;
860 return DisplayWakeUpRange::TenHundred;
862 return DisplayWakeUpRange::FifteenHundred;
864 return DisplayWakeUpRange::TwentyHundred;
878 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
896 OLED_WAKEUP_RANGE toSet = -1;
897 if (pWakeupTime == DisplayWakeUpRange::ThreeHundred) {
898 toSet = THREE_HUNDRED_MM;
900 else if (pWakeupTime == DisplayWakeUpRange::FiveHundred) {
901 toSet = FIVE_HUNDRED_MM;
903 else if (pWakeupTime == DisplayWakeUpRange::TenHundred) {
904 toSet = TEN_HUNDRED_MM;
906 else if (pWakeupTime == DisplayWakeUpRange::FifteenHundred) {
907 toSet = FIFTEEN_HUNDRED_MM;
909 else if (pWakeupTime == DisplayWakeUpRange::TwentyHundred) {
910 toSet = TWENTY_HUNDRED_MM;
925 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
943 OLED_WAKEUP_TIME actual = ((
NavigationSensor*)_sensor)->GetDisplayWakeUpTime();
946 return DisplayWakeUpTime::TwoSec;
948 return DisplayWakeUpTime::ThreeSec;
950 return DisplayWakeUpTime::FiveSec;
952 return DisplayWakeUpTime::TenSec;
966 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
984 OLED_WAKEUP_TIME toSet = -1;
985 if (pWakeupTime == DisplayWakeUpTime::TwoSec) {
988 else if (pWakeupTime == DisplayWakeUpTime::ThreeSec) {
991 else if (pWakeupTime == DisplayWakeUpTime::FiveSec) {
994 else if (pWakeupTime == DisplayWakeUpTime::TenSec) {
1010 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
1026 MDI_TRANSMISSION_STATUS actual = ((
NavigationSensor*)_sensor)->GetMdiTransmissionStatus();
1029 return TransmissionStatus::Off;
1031 return TransmissionStatus::On;
1045 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
1073 toThrow->
ErrorCode = gcnew String(e.GetErrorCode().c_str());
Definition WAvailableResolution.h:7
Definition WBadAcknowledgmentException.h:3
Definition WBaseCommunication.h:16
TransmissionStatus
Definition WEnums.h:15
PageDirection
Definition WEnums.h:13
DisplayWakeUpTime
Definition WEnums.h:18
DisplayWakeUpRange
Definition WEnums.h:17
DisplayPageIndex
Definition WEnums.h:12
DataAvailabilityEnum
Definition WEnums.h:27
DisplayMode
Definition WEnums.h:14
AngularResolution
Definition WEnums.h:8
ChannelTypeEnum
Definition WEnums.h:26
ConnectionStatusEnum
Definition WEnums.h:25
Definition WEthernetCommunication.h:5
Helper to encapsulate the the raw data error.
Definition FilterType.h:20
unsigned int GetNumH()
Gets historical spots number at current position.
Definition FilterType.cpp:42
void SetNumS(unsigned int numS)
Sets historical spots number on both sides.
Definition FilterType.cpp:66
void SetNumH(unsigned int numH)
Sets historical spots number at current position.
Definition FilterType.cpp:50
FILTER_MODE GetFilterMode()
Gets the filter mode.
Definition FilterType.cpp:26
unsigned int GetNumS()
Gets historical spots number on both sides.
Definition FilterType.cpp:58
void SetFilterMode(FILTER_MODE filterMode)
Sets the filter mode.
Definition FilterType.cpp:34
Definition NavigationSensor.h:61
Definition WFilterType.h:9
property unsigned int NumH
Definition WFilterType.h:26
Definition WNavigationSensor.h:24
void ShowDeviceIdentification()
Shows the device identification.
Definition WNavigationSensor.h:1058
WFilterType GetFilterType()
Definition WNavigationSensor.h:63
WNetworkInformation GetNetworkInformation()
Gets whole data information.
Definition WNavigationSensor.h:812
~WNavigationSensor()
Definition WNavigationSensor.h:35
WConfigurationResult SetDisplayWakeUpTime(DisplayWakeUpTime pWakeupTime)
Sets the OLED wake up time.
Definition WNavigationSensor.h:982
WSensorLeds GetSensorLeds() new
Gets the sensor's status led.
Definition WNavigationSensor.h:664
WContaminationStatus GetContaminationStatus() new
Gets the contamination status.
Definition WNavigationSensor.h:771
WSensorLamps GetSensorLamps()
Gets the sensor lamps status.
Definition WNavigationSensor.h:734
WConfigurationResult SetDisplayMode(DisplayMode pdisplayMode)
sets the display mode (Accepted values: Normal, On, Off)
Definition WNavigationSensor.h:466
WNavigationSensor(WBaseCommunication^ pcomm)
Definition WNavigationSensor.h:30
WCommunicationStatus Initialize() new
Initializes the object to connect the sensor.
Definition WNavigationSensor.h:42
PageDirection GetDisplayPageDirection()
Returns the display page direction.
Definition WNavigationSensor.h:351
WNavigationSensor()
Definition WNavigationSensor.h:26
AngularResolution GetAngularResolution() new
Gets the angular resolution.
Definition WNavigationSensor.h:160
DisplayWakeUpTime GetDisplayWakeUpTime()
Returns the OLED wake up time.
Definition WNavigationSensor.h:941
List< List< UInt16 >^> GetLogoImage()
Returns the sensor's logo image.
Definition WNavigationSensor.h:507
DisplayPageIndex GetDisplayPageIndex()
Returns the display page index.
Definition WNavigationSensor.h:252
List< unsigned int > GetWms()
Returns the window monitoring system of each sector (SECTORS_COUNT sectors - 132 -)
Definition WNavigationSensor.h:627
WConfigurationResult SetAngularResolution(AngularResolution pResolution) new
Sets the angle resolution. Can be either AngularResolution::ZeroToZeroPointOneAtFourtyHz,...
Definition WNavigationSensor.h:206
WConfigurationResult SetDisplayPageIndex(DisplayPageIndex pPageIndex)
Sets the display page on the given direction.
Definition WNavigationSensor.h:301
WConfigurationResult ResetLogoImage()
Resets the logo image to its default.
Definition WNavigationSensor.h:597
DisplayMode GetDisplayMode()
Returns the display mode (values are NORMAL_MODE, ON_MODE or OFF_MODE)
Definition WNavigationSensor.h:426
DisplayWakeUpRange GetDisplayWakeUpRange()
Returns the OLED wake up range.
Definition WNavigationSensor.h:851
WConfigurationResult SetDisplayPageDirection(PageDirection pPageDirection)
Sets the display page on the given direction (Accepted values: NORMAL or UPDIDE_DOWN)
Definition WNavigationSensor.h:388
WConfigurationResult SetDisplayWakeUpRange(DisplayWakeUpRange pWakeupTime)
Sets the OLED wake up range.
Definition WNavigationSensor.h:894
TransmissionStatus GetMdiTransmissionStatus()
Returns the MDI transmission status.
Definition WNavigationSensor.h:1024
WConfigurationResult SetFilterType(WFilterType^ pFilterType)
Definition WNavigationSensor.h:108
WConfigurationResult SetLogoImage(List< List< UInt16 >^>^ logoToFetch)
Sets the sensor's logo image.
Definition WNavigationSensor.h:551
WConfigurationResult SetSensorLeds(WSensorLeds^ pLeds) new
Sets the sensors leds status led (ON or OFF)
Definition WNavigationSensor.h:700
Helper to encapsulate the contamination threshold.
Definition RawDataSensor/ContaminationStatus.h:12
unsigned int GetZ3()
Gets the Navigation sensor's Z3 contamination state.
Definition ContaminationStatus.cpp:89
unsigned int GetZ5()
Gets the Navigation sensor's Z5 contamination state.
Definition ContaminationStatus.cpp:121
unsigned int GetZ2()
Gets the Navigation sensor's Z2 contamination state.
Definition ContaminationStatus.cpp:74
unsigned int GetZ1()
Gets the Navigation sensor's Z1 contamination state.
Definition ContaminationStatus.cpp:58
unsigned int GetZ6()
Gets the Navigation sensor's Z6 contamination state.
Definition ContaminationStatus.cpp:143
unsigned int GetZ4()
Gets the Navigation sensor's Z4 contamination state.
Definition ContaminationStatus.cpp:105
Helper to encapsulate the network information.
Definition RawDataSensor/NetworkInformation.h:15
string GetSubnetMask()
Gets the subnet mask.
Definition NetworkInformation.cpp:62
string GetGateway()
Gets the gateway Address.
Definition NetworkInformation.cpp:44
bool GetDhcpMode()
Gets the dhcp mode.
Definition NetworkInformation.cpp:80
string GetIpAddress()
Gets the IP v4 Address.
Definition NetworkInformation.cpp:8
string GetMacAddress()
Get the sensor's mac adress.
Definition NetworkInformation.cpp:98
int GetIpPort()
Gets the tcp/ip comm port.
Definition NetworkInformation.cpp:26
Helper to encapsulate the sensor lamps state.
Definition RawDataSensor/SensorLamps.h:20
LEDCOLOR GetLed3()
Gets the LED3 status.
Definition SensorLamps.cpp:66
LEDCOLOR GetLed2()
Gets the LED2 status.
Definition SensorLamps.cpp:48
LEDCOLOR GetLed1()
Gets the LED1 status.
Definition SensorLamps.cpp:30
Helper to encapsulate the sensor leds state.
Definition RawDataSensor/SensorLeds.h:11
void SetStatusLed(bool pStatusLed)
Sets the status led.
Definition SensorLeds.cpp:35
bool GetStatusLed()
Gets the status led.
Definition SensorLeds.cpp:26
Definition WContaminationStatus.h:4
A wrapper on the NetworkInformation data encapsulation.
Definition WNetworkInformation.h:14
property String IpAddress
Definition WNetworkInformation.h:34
This class is a wrapper around the unmanaged code RawDataSensor. The goal of this classe is make acce...
Definition WRawDataSensor.h:36
WConfigurationResult toManagedInstance(ConfigurationResult pResult)
Definition WRawDataSensor.h:1365
A wrapper on the SensorLamps data encapsulation.
Definition WSensorLamps.h:11
property LedColor Led1
Definition WSensorLamps.h:29
A wrapper on the SensorLeds data encapsulation.
Definition WSensorLeds.h:8
property bool StatusLed
Definition WSensorLeds.h:24
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
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
std::string ErrorMeaning
Definition CommunicationStructures.h:16
int ErrorCode
Definition CommunicationStructures.h:15
Definition CommunicationStructures.h:24
ConnectionState Status
Definition CommunicationStructures.h:26
vector< Channel > Channels
Definition CommunicationStructures.h:25
CommErrorCode ErrorCode
Definition CommunicationStructures.h:27
An exception used when not supported values are fetched to the sensor.
Definition ParameterNotSupportedException.h:13
virtual const char * what() const noexcept
Overload of message retrie.
Definition ParameterNotSupportedException.h:39
Definition WBadAcknowledgmentException.h:6
property ChannelTypeEnum Type
Definition WChannel.h:22
Definition WCommunicationErrorCode.h:6
Definition WCommunicationException.h:6
property int ErrorCode
Definition WCommunicationException.h:12
Definition WCommunicationStatus.h:16
property List< WChannel^> Channels
Definition WCommunicationStatus.h:24
A wrapper on the ConfigurationResult data encapsulation.
Definition WConfigurationResult.h:16
Definition WParameterNotSupportedException.h:6
Definition WSensorException.h:6
property String ErrorCode
Definition WSensorException.h:12
Definition WThreadCreationException.h:6