Visioscan Set SDK Libraries 1.0.14
Visioscan Set SDK Help documentation file for C++ and C++/CLI
 
Loading...
Searching...
No Matches
WNavigationSensor.h
1#pragma once
2
3#include <NavigationSensor.h>
4#include "WFilterType.h"
5#include <List>
6
7#include <CommunicationException.h>
8#include <SensorErrorException.h>
9#include <ThreadCreationException.h>
10#include <BadAcknowledgmentException.h>
11#include <CommunicationException.h>
12#include <ParameterNotSupportedException.h>
13
14using namespace WBase;
15using namespace WUtils;
16using namespace WCommunication;
17using namespace WToolboxException;
18using namespace WEnumerations;
19using namespace System::Collections;
20using namespace System::Collections::Generic;
21
22public ref class WNavigationSensor :
23 public WRawDataSensor
24{
25public:
27 this->_sensor = (BaseSensor*)new NavigationSensor();
28 }
29
30 WNavigationSensor(WBaseCommunication^ pcomm) : WRawDataSensor(pcomm) {
31 _sensor = (BaseSensor*)new NavigationSensor(pcomm->__nativeCommunication);
32 Communication = pcomm;
33 }
34
36 delete(_sensor);
37 }
38
43 CommunicationStatus status = _sensor->Initialize();
44
46 for (int i = 0; i < status.Channels.size(); i++) {
47 WChannel^ toAdd = gcnew WChannel();
48 toAdd->RawDataAvailability = static_cast<DataAvailabilityEnum>(status.Channels[i].RawDataAvailability);
49 toAdd->Type = static_cast<ChannelTypeEnum>(status.Channels[i].Type);
50
51 toReturn->Channels->Add(toAdd);
52 }
53
54 toReturn->ErrorCode = gcnew WCommunicationErrorCode();
55 toReturn->ErrorCode->ErrorCode = status.ErrorCode.ErrorCode;
56 toReturn->ErrorCode->ErrorMeaning = gcnew String(status.ErrorCode.ErrorMeaning.c_str());
57
58 toReturn->Status = static_cast<ConnectionStatusEnum>(status.Status);
59
60 return toReturn;
61 }
62
64 try {
65 WFilterType^ toReturn = gcnew WFilterType();
66 FilterType toFetch = ((NavigationSensor*)_sensor)->GetFilterType();
67 switch (toFetch.GetFilterMode()) {
68 case MEDIAN_FILTER:
69 toReturn->FilterTypeValue = FilterMode::Median;
70 break;
71 case AVERAGE_FILTER:
72 toReturn->FilterTypeValue = FilterMode::Average;
73 break;
74 case MAX_FILTER:
75 toReturn->FilterTypeValue = FilterMode::Max;
76 break;
77 case COMBO_FILTER:
78 toReturn->FilterTypeValue = FilterMode::Combo;
79 break;
80 }
81
82 toReturn->NumH = toFetch.GetNumH();
83 toReturn->NumS = toFetch.GetNumS();
84
85 return toReturn;
86 }
88 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
89 throw toThrow;
90 }
91 catch (CommunicationException e) {
92 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
93 toThrow->ErrorCode = e.GetErrorCode();
94 throw toThrow;
95 }
96 catch (SensorErrorException e) {
97 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
98 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
99 throw toThrow;
100
101 }
102 catch (ThreadCreationException e) {
103 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
104 throw toThrow;
105 }
106 }
107
109 try {
110 FilterType toSet;
111
112 switch (pFilterType->FilterTypeValue) {
113 case FilterMode::Median:
114 toSet.SetFilterMode(MEDIAN_FILTER);
115 break;
116 case FilterMode::Average:
117 toSet.SetFilterMode(AVERAGE_FILTER);
118 break;
119 case FilterMode::Max:
120 toSet.SetFilterMode(MAX_FILTER);
121 break;
122 case FilterMode::Combo:
123 toSet.SetFilterMode(COMBO_FILTER);
124 break;
125 }
126
127 toSet.SetNumH(pFilterType->NumH);
128 toSet.SetNumS(pFilterType->NumS);
129 return toManagedInstance(&((NavigationSensor*)_sensor)->SetFilterType(toSet));
130 }
132 WParameterNotSupportedException^ toThrow = gcnew WParameterNotSupportedException(gcnew String(e.what()));
133 throw toThrow;
134 }
136 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
137 throw toThrow;
138 }
139 catch (CommunicationException e) {
140 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
141 toThrow->ErrorCode = e.GetErrorCode();
142 throw toThrow;
143 }
144 catch (SensorErrorException e) {
145 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
146 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
147 throw toThrow;
148
149 }
150 catch (ThreadCreationException e) {
151 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
152 throw toThrow;
153 }
154 }
155
161 try {
162 ANGULAR_RESOLUTION actual = ((NavigationSensor*)_sensor)->GetAngularResolution();
163 if (actual == ZERO_TO_ZERO_POINT_ONE_AT_FOURTY_HZ) {
164 return AngularResolution::ZeroToZeroPointOneAtFourtyHz;
165 }
166 else if (actual == ZERO_TO_ZERO_POINT_TWO_AT_EIGHTY_HZ) {
167 return AngularResolution::ZeroToZeroPointTwoAtEightyHz;
168 }
169 else if (actual == ZERO_TO_ZERO_POINT_ZERO_FIVE_AT_TWENTY_HZ) {
170 return AngularResolution::ZeroToZeroPointZeroFiveAtTwentyHz;
171 }
172 else if (actual == ZERO_TO_ZERO_POINT_ZERO_TWENTYFIVE_AT_TEN_HZ) {
173 return AngularResolution::ZeroToZeroPointZeroTwoFiveAtTenHz;
174 }
175 else if (actual == ZERO_TO_ZERO_POINT_ZERO_SOMETHING_AT_FIFTY_HZ) {
176 return AngularResolution::ZeroToZeroSomethingAtFiftyHz;
177 }
178 }
180 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
181 throw toThrow;
182 }
183 catch (CommunicationException e) {
184 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
185 toThrow->ErrorCode = e.GetErrorCode();
186 throw toThrow;
187 }
188 catch (SensorErrorException e) {
189 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
190 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
191 throw toThrow;
192
193 }
194 catch (ThreadCreationException e) {
195 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
196 throw toThrow;
197 }
198 }
199
200
207 try {
208 ANGULAR_RESOLUTION toSet = -1;
209 if (pResolution == AngularResolution::ZeroToZeroPointOneAtFourtyHz) {
210 toSet = ZERO_TO_ZERO_POINT_ONE_AT_FOURTY_HZ;
211 }
212 else if(pResolution == AngularResolution::ZeroToZeroPointTwoAtEightyHz) {
213 toSet = ZERO_TO_ZERO_POINT_TWO_AT_EIGHTY_HZ;
214 }
215 else if (pResolution == AngularResolution::ZeroToZeroPointZeroFiveAtTwentyHz) {
216 toSet = ZERO_TO_ZERO_POINT_ZERO_FIVE_AT_TWENTY_HZ;
217 }
218 else if (pResolution == AngularResolution::ZeroToZeroPointZeroTwoFiveAtTenHz) {
219 toSet = ZERO_TO_ZERO_POINT_ZERO_TWENTYFIVE_AT_TEN_HZ;
220 }
221 else if (pResolution == AngularResolution::ZeroToZeroSomethingAtFiftyHz) {
222 toSet = ZERO_TO_ZERO_POINT_ZERO_SOMETHING_AT_FIFTY_HZ;
223 }
224
225 return toManagedInstance(&((NavigationSensor*)_sensor)->SetAngularResolution(toSet));
226 }
228 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
229 throw toThrow;
230 }
231 catch (CommunicationException e) {
232 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
233 toThrow->ErrorCode = e.GetErrorCode();
234 throw toThrow;
235 }
236 catch (SensorErrorException e) {
237 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
238 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
239 throw toThrow;
240
241 }
242 catch (ThreadCreationException e) {
243 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
244 throw toThrow;
245 }
246 }
247#ifndef LEUZE
253 try {
254 PAGE_INDEX actual = ((NavigationSensor*)_sensor)->GetDisplayPageIndex();
255 if (actual == CUSTOMIZE_LOGO_PAGE) {
256 return DisplayPageIndex::CustomLogoPage;
257 }
258 else if (actual == OPERATING_STATUS_PAGE) {
259 return DisplayPageIndex::OperatingStatus;
260 }
261 else if (actual == WMS_STATUS_PAGE) {
262 return DisplayPageIndex::WmsStatus;
263 }
264 else if (actual == ETH_USB_CONNECT_STATUS_PAGE) {
265 return DisplayPageIndex::EthUsbConnectStatus;
266 }
267 else if (actual == NETWORK_INFORMATION_PAGE) {
268 return DisplayPageIndex::NetworkInfo;
269 }
270 else if (actual == BLUETHOOT_CONNECTION_PAGE) {
271 return DisplayPageIndex::BluethootConnection;
272 }
273 }
275 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
276 throw toThrow;
277 }
278 catch (CommunicationException e) {
279 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
280 toThrow->ErrorCode = e.GetErrorCode();
281 throw toThrow;
282 }
283 catch (SensorErrorException e) {
284 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
285 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
286 throw toThrow;
287
288 }
289 catch (ThreadCreationException e) {
290 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
291 throw toThrow;
292 }
293 }
294#endif
295#ifndef LEUZE
302 try {
303 PAGE_INDEX toSet = -1;
304 if (pPageIndex == DisplayPageIndex::CustomLogoPage) {
305 toSet = CUSTOMIZE_LOGO_PAGE;
306 }
307 else if (pPageIndex == DisplayPageIndex::OperatingStatus) {
308 toSet = OPERATING_STATUS_PAGE;
309 }
310 else if (pPageIndex == DisplayPageIndex::WmsStatus) {
311 toSet = WMS_STATUS_PAGE;
312 }
313 else if (pPageIndex == DisplayPageIndex::EthUsbConnectStatus) {
314 toSet = ETH_USB_CONNECT_STATUS_PAGE;
315 }
316 else if (pPageIndex == DisplayPageIndex::NetworkInfo) {
317 toSet = NETWORK_INFORMATION_PAGE;
318 }
319 else if (pPageIndex == DisplayPageIndex::BluethootConnection) {
320 toSet = BLUETHOOT_CONNECTION_PAGE;
321 }
322
323 return toManagedInstance(&((NavigationSensor*)_sensor)->SetDisplayPageIndex(toSet));
324 }
326 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
327 throw toThrow;
328 }
329 catch (CommunicationException e) {
330 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
331 toThrow->ErrorCode = e.GetErrorCode();
332 throw toThrow;
333 }
334 catch (SensorErrorException e) {
335 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
336 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
337 throw toThrow;
338
339 }
340 catch (ThreadCreationException e) {
341 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
342 throw toThrow;
343 }
344 }
345#endif
346#ifndef LEUZE
352 try {
353 PAGE_DIRECTION actual = ((NavigationSensor*)_sensor)->GetDisplayPageDirection();
354 if (actual == NORMAL) {
355 return PageDirection::Normal;
356 }
357 else if (actual == UPSIDE_DOWN) {
358 return PageDirection::UpsideDown;
359 }
360 }
362 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
363 throw toThrow;
364 }
365 catch (CommunicationException e) {
366 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
367 toThrow->ErrorCode = e.GetErrorCode();
368 throw toThrow;
369 }
370 catch (SensorErrorException e) {
371 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
372 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
373 throw toThrow;
374
375 }
376 catch (ThreadCreationException e) {
377 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
378 throw toThrow;
379 }
380 }
381#endif
382#ifndef LEUZE
389 try {
390 PAGE_DIRECTION toSet = -1;
391 if (pPageDirection == PageDirection::Normal) {
392 toSet = NORMAL;
393 }
394 else if (pPageDirection == PageDirection::UpsideDown) {
395 toSet = UPSIDE_DOWN;
396 }
397
399 }
401 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
402 throw toThrow;
403 }
404 catch (CommunicationException e) {
405 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
406 toThrow->ErrorCode = e.GetErrorCode();
407 throw toThrow;
408 }
409 catch (SensorErrorException e) {
410 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
411 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
412 throw toThrow;
413
414 }
415 catch (ThreadCreationException e) {
416 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
417 throw toThrow;
418 }
419 }
420#endif
421#ifndef LEUZE
427 try {
428 DISPLAY_MODE actual = ((NavigationSensor*)_sensor)->GetDisplayMode();
429 if (actual == NORMAL_MODE) {
430 return DisplayMode::Normal;
431 }
432 else if (actual == ON_MODE) {
433 return DisplayMode::On;
434 }
435 else if (actual == OFF_MODE) {
436 return DisplayMode::Off;
437 }
438 }
440 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
441 throw toThrow;
442 }
443 catch (CommunicationException e) {
444 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
445 toThrow->ErrorCode = e.GetErrorCode();
446 throw toThrow;
447 }
448 catch (SensorErrorException e) {
449 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
450 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
451 throw toThrow;
452
453 }
454 catch (ThreadCreationException e) {
455 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
456 throw toThrow;
457 }
458 }
459#endif
460#ifndef LEUZE
467 try {
468 DISPLAY_MODE toSet = -1;
469 if (pdisplayMode == DisplayMode::Normal) {
470 toSet = NORMAL;
471 }
472 else if (pdisplayMode == DisplayMode::On) {
473 toSet = ON_MODE;
474 }
475 else if (pdisplayMode == DisplayMode::Off) {
476 toSet = OFF_MODE;
477 }
478
479 return toManagedInstance(&((NavigationSensor*)_sensor)->SetDisplayMode(toSet));
480 }
482 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
483 throw toThrow;
484 }
485 catch (CommunicationException e) {
486 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
487 toThrow->ErrorCode = e.GetErrorCode();
488 throw toThrow;
489 }
490 catch (SensorErrorException e) {
491 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
492 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
493 throw toThrow;
494
495 }
496 catch (ThreadCreationException e) {
497 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
498 throw toThrow;
499 }
500 }
501#endif
502#ifndef LEUZE
507 List<List<UInt16>^>^ GetLogoImage() {
508 try {
509 List<List<UInt16>^>^ toReturn = gcnew List<List<UInt16>^>();
510
511 vector<LOGO_IMAGE_SEGMENT> sensorImage = ((NavigationSensor*)_sensor)->GetLogoImage();
512
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]);
517 }
518 toReturn->Add(segmentOfPixelToAdd);
519 }
520
521 return toReturn;
522 }
524 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
525 throw toThrow;
526 }
527 catch (CommunicationException e) {
528 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
529 toThrow->ErrorCode = e.GetErrorCode();
530 throw toThrow;
531 }
532 catch (SensorErrorException e) {
533 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
534 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
535 throw toThrow;
536
537 }
538 catch (ThreadCreationException e) {
539 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
540 throw toThrow;
541 }
542 }
543#endif
544#ifndef LEUZE
545
551 WConfigurationResult^ SetLogoImage(List<List<UInt16>^>^ logoToFetch) {
552 WConfigurationResult^ toReturn;
553 vector<LOGO_IMAGE_SEGMENT> toFetch;
554
555 try {
556 for each (List<UInt16>^ segment in logoToFetch) {
557 vector<IMAGE_PIXEL> segmentToFetch;
558
559 for each (UInt16 pixel in segment) {
560 segmentToFetch.push_back(pixel);
561 }
562
563 toFetch.push_back(segmentToFetch);
564 }
565 return toManagedInstance(&((NavigationSensor*)_sensor)->SetLogoImage(toFetch));
566 }
568 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
569 throw toThrow;
570 }
571 catch (CommunicationException e) {
572 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
573 toThrow->ErrorCode = e.GetErrorCode();
574 throw toThrow;
575 }
576 catch (SensorErrorException e) {
577 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
578 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
579 throw toThrow;
580
581 }
582 catch (ThreadCreationException e) {
583 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
584 throw toThrow;
585 }
586
587
588 return toReturn;
589 }
590#endif
591
592#ifndef LEUZE
598
599 try {
600 return toManagedInstance(&((NavigationSensor*)_sensor)->ResetLogoImage());
601 }
603 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
604 throw toThrow;
605 }
606 catch (CommunicationException e) {
607 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
608 toThrow->ErrorCode = e.GetErrorCode();
609 throw toThrow;
610 }
611 catch (SensorErrorException e) {
612 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
613 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
614 throw toThrow;
615
616 }
617 catch (ThreadCreationException e) {
618 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
619 throw toThrow;
620 }
621 }
622#endif
627 List<unsigned int>^ GetWms() {
628 try {
629 vector<unsigned int> actual = ((NavigationSensor*)_sensor)->GetWms();
630 List<unsigned int>^ toReturn = gcnew List<unsigned int>();
631
632 for (int i = 0; i < actual.size(); i++) {
633
634 toReturn->Add(actual[i]);
635 }
636
637 return toReturn;
638 }
640 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
641 throw toThrow;
642 }
643 catch (CommunicationException e) {
644 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
645 toThrow->ErrorCode = e.GetErrorCode();
646 throw toThrow;
647 }
648 catch (SensorErrorException e) {
649 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
650 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
651 throw toThrow;
652
653 }
654 catch (ThreadCreationException e) {
655 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
656 throw toThrow;
657 }
658 }
659
665 try {
666 SensorLeds actual = ((NavigationSensor*)_sensor)->GetSensorLeds();
667 WSensorLeds^ toReturn = gcnew WSensorLeds();
668
669 toReturn->StatusLed = actual.GetStatusLed();
670
671 return toReturn;
672 }
674 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
675 throw toThrow;
676 }
677 catch (CommunicationException e) {
678 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
679 toThrow->ErrorCode = e.GetErrorCode();
680 throw toThrow;
681 }
682 catch (SensorErrorException e) {
683 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
684 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
685 throw toThrow;
686
687 }
688 catch (ThreadCreationException e) {
689 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
690 throw toThrow;
691 }
692 }
693
694
701 try {
702 SensorLeds toSet;
703
704 toSet.SetStatusLed(pLeds->StatusLed);
705
706 return toManagedInstance(&((NavigationSensor*)_sensor)->SetSensorLeds(toSet));
707 }
709 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
710 throw toThrow;
711 }
712 catch (CommunicationException e) {
713 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
714 toThrow->ErrorCode = e.GetErrorCode();
715 throw toThrow;
716 }
717 catch (SensorErrorException e) {
718 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
719 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
720 throw toThrow;
721
722 }
723 catch (ThreadCreationException e) {
724 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
725 throw toThrow;
726 }
727 }
728
729
735 try {
736 WSensorLamps^ toReturn = gcnew WSensorLamps();
737 SensorLamps actual = ((NavigationSensor*)_sensor)->GetSensorLamps();
738
739 toReturn->Led1 = (LedColor)actual.GetLed1();
740 toReturn->Led2 = (LedColor)actual.GetLed2();
741 toReturn->Led3 = (LedColor)actual.GetLed3();
742 toReturn->Led4 = LedColor::Black;
743
744 return toReturn;
745 }
747 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
748 throw toThrow;
749 }
750 catch (CommunicationException e) {
751 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
752 toThrow->ErrorCode = e.GetErrorCode();
753 throw toThrow;
754 }
755 catch (SensorErrorException e) {
756 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
757 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
758 throw toThrow;
759
760 }
761 catch (ThreadCreationException e) {
762 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
763 throw toThrow;
764 }
765 }
766
772 try {
773 ContaminationStatus toFetch = ((NavigationSensor*)_sensor)->GetContaminationStatus();
774
775 WContaminationStatus^ toReturn = gcnew WContaminationStatus();
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();
782
783 return toReturn;
784 }
786 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
787 throw toThrow;
788 }
789 catch (CommunicationException e) {
790 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
791 toThrow->ErrorCode = e.GetErrorCode();
792 throw toThrow;
793 }
794 catch (SensorErrorException e) {
795 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
796 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
797 throw toThrow;
798
799 }
800 catch (ThreadCreationException e) {
801 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
802 throw toThrow;
803 }
804 }
805
806 // Command settings management
807 // Data retrieve
813 try {
814 NetworkInformation toFetch = ((NavigationSensor*)_sensor)->GetNetworkInformation();
815
816 WNetworkInformation^ toReturn = gcnew WNetworkInformation();
817 toReturn->DhcpMode = toFetch.GetDhcpMode();
818 toReturn->Gateway = gcnew String(toFetch.GetGateway().c_str());
819 toReturn->IpAddress = gcnew String(toFetch.GetIpAddress().c_str());
820 toReturn->IpPort = toFetch.GetIpPort();
821 toReturn->SubnetMask = gcnew String(toFetch.GetSubnetMask().c_str());
822 toReturn->MacAddress = gcnew String(toFetch.GetMacAddress().c_str());
823
824 return toReturn;
825 }
827 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
828 throw toThrow;
829 }
830 catch (CommunicationException e) {
831 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
832 toThrow->ErrorCode = e.GetErrorCode();
833 throw toThrow;
834 }
835 catch (SensorErrorException e) {
836 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
837 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
838 throw toThrow;
839
840 }
841 catch (ThreadCreationException e) {
842 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
843 throw toThrow;
844 }
845 }
846#ifndef LEUZE
852 try {
853 OLED_WAKEUP_RANGE actual = ((NavigationSensor*)_sensor)->GetDisplayWakeUpRange();
854 switch (actual) {
855 case 0:
856 return DisplayWakeUpRange::ThreeHundred;
857 case 1:
858 return DisplayWakeUpRange::FiveHundred;
859 case 2:
860 return DisplayWakeUpRange::TenHundred;
861 case 3:
862 return DisplayWakeUpRange::FifteenHundred;
863 case 4:
864 return DisplayWakeUpRange::TwentyHundred;
865 }
866 }
868 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
869 throw toThrow;
870 }
871 catch (CommunicationException e) {
872 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
873 toThrow->ErrorCode = e.GetErrorCode();
874 throw toThrow;
875 }
876 catch (SensorErrorException e) {
877 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
878 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
879 throw toThrow;
880
881 }
882 catch (ThreadCreationException e) {
883 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
884 throw toThrow;
885 }
886 }
887#endif
888#ifndef LEUZE
895 try {
896 OLED_WAKEUP_RANGE toSet = -1;
897 if (pWakeupTime == DisplayWakeUpRange::ThreeHundred) {
898 toSet = THREE_HUNDRED_MM;
899 }
900 else if (pWakeupTime == DisplayWakeUpRange::FiveHundred) {
901 toSet = FIVE_HUNDRED_MM;
902 }
903 else if (pWakeupTime == DisplayWakeUpRange::TenHundred) {
904 toSet = TEN_HUNDRED_MM;
905 }
906 else if (pWakeupTime == DisplayWakeUpRange::FifteenHundred) {
907 toSet = FIFTEEN_HUNDRED_MM;
908 }
909 else if (pWakeupTime == DisplayWakeUpRange::TwentyHundred) {
910 toSet = TWENTY_HUNDRED_MM;
911 }
912 return toManagedInstance(&((NavigationSensor*)_sensor)->SetDisplayWakeUpRange(toSet));
913 }
915 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
916 throw toThrow;
917 }
918 catch (CommunicationException e) {
919 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
920 toThrow->ErrorCode = e.GetErrorCode();
921 throw toThrow;
922 }
923 catch (SensorErrorException e) {
924 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
925 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
926 throw toThrow;
927
928 }
929 catch (ThreadCreationException e) {
930 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
931 throw toThrow;
932 }
933 }
934#endif
935#ifndef LEUZE
936
942 try {
943 OLED_WAKEUP_TIME actual = ((NavigationSensor*)_sensor)->GetDisplayWakeUpTime();
944 switch (actual) {
945 case 0:
946 return DisplayWakeUpTime::TwoSec;
947 case 1:
948 return DisplayWakeUpTime::ThreeSec;
949 case 2:
950 return DisplayWakeUpTime::FiveSec;
951 case 3:
952 return DisplayWakeUpTime::TenSec;
953 }
954 }
956 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
957 throw toThrow;
958 }
959 catch (CommunicationException e) {
960 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
961 toThrow->ErrorCode = e.GetErrorCode();
962 throw toThrow;
963 }
964 catch (SensorErrorException e) {
965 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
966 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
967 throw toThrow;
968
969 }
970 catch (ThreadCreationException e) {
971 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
972 throw toThrow;
973 }
974 }
975#endif
976#ifndef LEUZE
983 try {
984 OLED_WAKEUP_TIME toSet = -1;
985 if (pWakeupTime == DisplayWakeUpTime::TwoSec) {
986 toSet = TWO_SEC;
987 }
988 else if (pWakeupTime == DisplayWakeUpTime::ThreeSec) {
989 toSet = THREE_SEC;
990 }
991 else if (pWakeupTime == DisplayWakeUpTime::FiveSec) {
992 toSet = FIVE_SEC;
993 }
994 else if (pWakeupTime == DisplayWakeUpTime::TenSec) {
995 toSet = TEN_SEC;
996 }
997 return toManagedInstance(&((NavigationSensor*)_sensor)->SetDisplayWakeUpTime(toSet));
998 }
1000 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
1001 throw toThrow;
1002 }
1003 catch (CommunicationException e) {
1004 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
1005 toThrow->ErrorCode = e.GetErrorCode();
1006 throw toThrow;
1007 }
1008 catch (SensorErrorException e) {
1009 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
1010 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1011 throw toThrow;
1012
1013 }
1014 catch (ThreadCreationException e) {
1015 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
1016 throw toThrow;
1017 }
1018 }
1019#endif
1025 try {
1026 MDI_TRANSMISSION_STATUS actual = ((NavigationSensor*)_sensor)->GetMdiTransmissionStatus();
1027 switch (actual) {
1028 case 0:
1029 return TransmissionStatus::Off;
1030 case 1:
1031 return TransmissionStatus::On;
1032 }
1033 }
1034 catch (BadAcknowledgmentException e) {
1035 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
1036 throw toThrow;
1037 }
1038 catch (CommunicationException e) {
1039 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
1040 toThrow->ErrorCode = e.GetErrorCode();
1041 throw toThrow;
1042 }
1043 catch (SensorErrorException e) {
1044 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
1045 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1046 throw toThrow;
1047
1048 }
1049 catch (ThreadCreationException e) {
1050 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
1051 throw toThrow;
1052 }
1053 }
1054#ifndef LEUZE
1059 try {
1060 ((NavigationSensor*)_sensor)->ShowDeviceIdentification();
1061 }
1062 catch (BadAcknowledgmentException e) {
1063 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
1064 throw toThrow;
1065 }
1066 catch (CommunicationException e) {
1067 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
1068 toThrow->ErrorCode = e.GetErrorCode();
1069 throw toThrow;
1070 }
1071 catch (SensorErrorException e) {
1072 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
1073 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1074 throw toThrow;
1075
1076 }
1077 catch (ThreadCreationException e) {
1078 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
1079 throw toThrow;
1080 }
1081 }
1082#endif
1083};
1084
Definition WAvailableResolution.h:7
Definition WBadAcknowledgmentException.h:3
Definition WBaseCommunication.h:16
Definition WEnums.h:4
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
Definition WChannel.h:12
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