Visioscan Set SDK Libraries 1.0.14
Visioscan Set SDK Help documentation file for C++ and C++/CLI
 
Loading...
Searching...
No Matches
WAgvSensor.h
1#pragma once
2#include "../AgvSensor/AgvSensor.h"
3#include "WFieldName.h"
4#include "WObjectSize.h"
5#include "WFieldData.h"
6#include "WMultipleSampling.h"
7#include "WHoldTime.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>
15
16using namespace WUtils;
17using namespace WBase;
18using namespace WCommunication;
19using namespace WToolboxException;
20using namespace WEnumerations;
21using namespace System::Collections;
22using namespace System::Collections::Generic;
23using namespace Bea::AgvSensorWrapper::Structs;
24using namespace WSensorData;
25
26namespace Bea {
27 namespace AgvSensorWrapper {
28 namespace Sensor {
29 public ref class WAgvSensor :
30 public WBaseSensor
31 {
32 public:
34 this->_sensor = (BaseSensor*)new AgvSensor();
35 _wRawData = gcnew WRawDataSensor();
36 }
37
38 WAgvSensor(WBaseCommunication^ pcomm) {
39 _wRawData = gcnew WRawDataSensor(pcomm);
40 _sensor = (BaseSensor*)new AgvSensor(pcomm->__nativeCommunication);
41
42 Communication = pcomm;
43 }
44
46 delete(_sensor);
47 }
48
53 _wRawData->Communication = this->Communication;
54 _sensor->SetCommunication(this->Communication->__nativeCommunication);
55 return _wRawData->Initialize();
56 }
57
59 return _wRawData->RetrieveRawData();
60 }
64 void SendMdi() {
65 _wRawData->SendMdi();
66 }
67
71 void StopMdi() {
72 _wRawData->StopMdi();
73 }
74
80 return _wRawData->GetRawDataExchangeMode();
81 }
82
88 return _wRawData->GetAngleRange();
89 }
90
96 return _wRawData->GetDataPacketType();
97 }
98
103 unsigned int GetImmunityLevel() {
104 return _wRawData->GetImmunityLevel();
105 }
106
114
120 return _wRawData->GetVersion();
121 }
122
128 return _wRawData->GetTemperature();
129 }
130
135 List<WRawDataError^>^ GetErrorLog() {
136 return _wRawData->GetErrorLog();
137 }
138
139 // Command settings management
140 // Data retrieve
148
153 String^ GetDeviceName() {
154 return _wRawData->GetDeviceName();
155 }
156
163 return _wRawData->SetRawDataExchangeMode(pProtocol);
164 }
165
172 return _wRawData->SetDataPacketType(pPacketType);
173 }
174
181 return _wRawData->SetAngleRange(pAngleRange);
182 }
183
190 return _wRawData->SetImmunityLevel(pImmunityLevel);
191 }
192
199 return _wRawData->SetContaminationThreshold(pContaminationThreshold);
200 }
201
202
209 return _wRawData->SetNetworkInformation(pNetwork);
210 }
211
217 return _wRawData->SetDeviceName(pName);
218 }
219
223 void ResetDevice() {
224 _wRawData->ResetDevice();
225 }
226
231 _wRawData->RebootDevice();
232 }
233
238 List<unsigned int>^ GetWms() {
239 try {
240 vector<unsigned int> actual = ((AgvSensor*)_sensor)->GetWms();
241 List<unsigned int>^ toReturn = gcnew List<unsigned int>();
242
243 for (int i = 0; i < actual.size(); i++) {
244
245 toReturn->Add(actual[i]);
246 }
247
248 return toReturn;
249 }
251 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
252 throw toThrow;
253 }
254 catch (CommunicationException e) {
255 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
256 toThrow->ErrorCode = e.GetErrorCode();
257 throw toThrow;
258 }
259 catch (SensorErrorException e) {
260 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
261 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
262 throw toThrow;
263
264 }
265 catch (ThreadCreationException e) {
266 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
267 throw toThrow;
268 }
269 }
270
275 /*WSensorLamps^ GetSensorLamps() {
276 try {
277 WSensorLamps^ toReturn = gcnew WSensorLamps();
278 SensorLamps actual = ((AgvSensor*)_sensor)->GetSensorLamps();
279 toReturn->Led1 = (LedColor)actual.GetLed1();
280 toReturn->Led2 = (LedColor)actual.GetLed2();
281 toReturn->Led3 = (LedColor)actual.GetLed3();
282 toReturn->Led4 = (LedColor)actual.GetLed4();
283 return toReturn;
284 }
285 catch (BadAcknowledgmentException e) {
286 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
287 throw toThrow;
288 }
289 catch (CommunicationException e) {
290 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
291 toThrow->ErrorCode = e.GetErrorCode();
292 throw toThrow;
293 }
294 catch (SensorErrorException e) {
295 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
296 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
297 throw toThrow;
298 }
299 catch (ThreadCreationException e) {
300 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
301 throw toThrow;
302 }
303 }*/
304
310 WFieldName^ GetFieldName(int fieldSetNumber) {
311 try {
312 WFieldName^ toReturn = gcnew WFieldName();
313
314 FieldName actual = ((AgvSensor*)_sensor)->GetFieldName(fieldSetNumber);
315
316 toReturn->FieldNumber = actual.GetFieldNumber();
317 toReturn->ProtectionZoneName = gcnew String(actual.GetProtectionZoneName().c_str());
318 toReturn->Warning1ZoneName = gcnew String(actual.GetWarning1ZoneName().c_str());
319 toReturn->Warning2ZoneName = gcnew String(actual.GetWarning2ZoneName().c_str());
320
321 return toReturn;
322 }
324 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
325 throw toThrow;
326 }
327 catch (CommunicationException e) {
328 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
329 toThrow->ErrorCode = e.GetErrorCode();
330 throw toThrow;
331 }
332 catch (SensorErrorException e) {
333 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
334 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
335 throw toThrow;
336
337 }
338 catch (ThreadCreationException e) {
339 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
340 throw toThrow;
341 }
342 }
348 try {
349 WObjectSize^ toReturn = gcnew WObjectSize();
350
351 ObjectSize actual = ((AgvSensor*)_sensor)->GetObjectSize();
352
353 toReturn->Protection = static_cast<ObjSizeEnum>(actual.GetProtection());
354 toReturn->Warning1 = static_cast<ObjSizeEnum>(actual.GetWarning1());
355 toReturn->Warning2 = static_cast<ObjSizeEnum>(actual.GetWarning2());
356
357 return toReturn;
358 }
360 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
361 throw toThrow;
362 }
363 catch (CommunicationException e) {
364 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
365 toThrow->ErrorCode = e.GetErrorCode();
366 throw toThrow;
367 }
368 catch (SensorErrorException e) {
369 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
370 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
371 throw toThrow;
372
373 }
374 catch (ThreadCreationException e) {
375 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
376 throw toThrow;
377 }
378 }
385 WFieldData^ GetField(int fieldNumber, ZoneTypeEnum zone) {
386 try {
387 WFieldData^ toReturn = gcnew WFieldData();
388
389 FieldData actual = ((AgvSensor*)_sensor)->GetField(fieldNumber, static_cast<NativeZoneTypeEnum>(zone));
390 toReturn->FieldNumber = actual.GetFieldNumber();
391 toReturn->ZoneType = static_cast<ZoneTypeEnum>(actual.GetZoneType());
392 toReturn->Parameter1 = actual.GetParameter1();
393 toReturn->Parameter2 = actual.GetParameter2();
394 toReturn->Crc = actual.GetCrc();
395 toReturn->GUID = gcnew String(actual.GetGUID().c_str());
396 toReturn->__fetchNativeData(actual.GetData());
397
398 return toReturn;
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
426 try {
427 WMultipleSampling^ toReturn = gcnew WMultipleSampling();
428
429 MultipleSampling actual = ((AgvSensor*)_sensor)->GetMultipleSampling();
430 toReturn->Protection = actual.GetProtection();
431 toReturn->Warning1 = actual.GetWarning1();
432 toReturn->Warning2 = actual.GetWarning2();
433
434 return toReturn;
435 }
437 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
438 throw toThrow;
439 }
440 catch (CommunicationException e) {
441 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
442 toThrow->ErrorCode = e.GetErrorCode();
443 throw toThrow;
444 }
445 catch (SensorErrorException e) {
446 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
447 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
448 throw toThrow;
449
450 }
451 catch (ThreadCreationException e) {
452 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
453 throw toThrow;
454 }
455 }
456
462 try {
463 WHoldTime^ toReturn = gcnew WHoldTime();
464
465 HoldTime actual = ((AgvSensor*)_sensor)->GetHoldTime();
466 toReturn->Protection = actual.GetProtection();
467 toReturn->Warning1 = actual.GetWarning1();
468 toReturn->Warning2 = actual.GetWarning2();
469
470 return toReturn;
471 }
473 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
474 throw toThrow;
475 }
476 catch (CommunicationException e) {
477 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
478 toThrow->ErrorCode = e.GetErrorCode();
479 throw toThrow;
480 }
481 catch (SensorErrorException e) {
482 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
483 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
484 throw toThrow;
485
486 }
487 catch (ThreadCreationException e) {
488 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
489 throw toThrow;
490 }
491 }
492
498 try {
499 WOutputActiveLevel^ toReturn = gcnew WOutputActiveLevel();
500
501 OutputActiveLevel actual = ((AgvSensor*)_sensor)->GetOutputActiveLevel();
502 toReturn->Output1 = static_cast<ActiveLevelEnum>(actual.GetOutput1());
503 toReturn->Output2 = static_cast<ActiveLevelEnum>(actual.GetOutput2());
504 toReturn->Output3 = static_cast<ActiveLevelEnum>(actual.GetOutput3());
505 toReturn->Output4 = static_cast<ActiveLevelEnum>(actual.GetOutput4());
506
507 return toReturn;
508 }
510 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
511 throw toThrow;
512 }
513 catch (CommunicationException e) {
514 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
515 toThrow->ErrorCode = e.GetErrorCode();
516 throw toThrow;
517 }
518 catch (SensorErrorException e) {
519 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
520 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
521 throw toThrow;
522
523 }
524 catch (ThreadCreationException e) {
525 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
526 throw toThrow;
527 }
528 }
529
535 try {
536 WOutputFunction^ toReturn = gcnew WOutputFunction();
537
538 OutputFunction actual = ((AgvSensor*)_sensor)->GetOutputFunction();
539 toReturn->Output1 = static_cast<FunctionEnum>(actual.GetOutput1());
540 toReturn->Output2 = static_cast<FunctionEnum>(actual.GetOutput2());
541 toReturn->Output3 = static_cast<FunctionEnum>(actual.GetOutput3());
542 toReturn->Output4 = static_cast<FunctionEnum>(actual.GetOutput4());
543
544 return toReturn;
545 }
547 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
548 throw toThrow;
549 }
550 catch (CommunicationException e) {
551 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
552 toThrow->ErrorCode = e.GetErrorCode();
553 throw toThrow;
554 }
555 catch (SensorErrorException e) {
556 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
557 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
558 throw toThrow;
559
560 }
561 catch (ThreadCreationException e) {
562 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
563 throw toThrow;
564 }
565 }
570 try {
571 WAgvSensorLeds^ toReturn = gcnew WAgvSensorLeds();
572
573 AgvSensorLeds actual = ((AgvSensor*)_sensor)->GetSensorLeds();
574 toReturn->ContaminationLed = actual.GetContaminationLed();
575 toReturn->StatusLed = actual.GetStatusLed();
576 toReturn->LogoLed = actual.GetLogoLed();
577
578 return toReturn;
579 }
581 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
582 throw toThrow;
583 }
584 catch (CommunicationException e) {
585 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
586 toThrow->ErrorCode = e.GetErrorCode();
587 throw toThrow;
588 }
589 catch (SensorErrorException e) {
590 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
591 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
592 throw toThrow;
593
594 }
595 catch (ThreadCreationException e) {
596 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
597 throw toThrow;
598 }
599 }
600
607 try {
608 return toManagedInstance(((AgvSensor*)_sensor)->SetFieldName(*fieldName->__native));
609 }
611 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
612 throw toThrow;
613 }
614 catch (CommunicationException e) {
615 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
616 toThrow->ErrorCode = e.GetErrorCode();
617 throw toThrow;
618 }
619 catch (SensorErrorException e) {
620 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
621 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
622 throw toThrow;
623
624 }
625 catch (ThreadCreationException e) {
626 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
627 throw toThrow;
628 }
629 }
630
637 try {
638 return toManagedInstance(((AgvSensor*)_sensor)->SetObjectSize(*sizeToSet->__native));
639 }
641 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
642 throw toThrow;
643 }
644 catch (CommunicationException e) {
645 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
646 toThrow->ErrorCode = e.GetErrorCode();
647 throw toThrow;
648 }
649 catch (SensorErrorException e) {
650 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
651 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
652 throw toThrow;
653
654 }
655 catch (ThreadCreationException e) {
656 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
657 throw toThrow;
658 }
659 }
660
667 try {
668 return toManagedInstance(((AgvSensor*)_sensor)->SetField(*data->__native));
669 }
671 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
672 throw toThrow;
673 }
674 catch (CommunicationException e) {
675 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
676 toThrow->ErrorCode = e.GetErrorCode();
677 throw toThrow;
678 }
679 catch (SensorErrorException e) {
680 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
681 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
682 throw toThrow;
683
684 }
685 catch (ThreadCreationException e) {
686 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
687 throw toThrow;
688 }
689 }
690
697 try {
698 return toManagedInstance(((AgvSensor*)_sensor)->SetMultipleSampling(*sampling->__native));
699 }
701 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
702 throw toThrow;
703 }
704 catch (CommunicationException e) {
705 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
706 toThrow->ErrorCode = e.GetErrorCode();
707 throw toThrow;
708 }
709 catch (SensorErrorException e) {
710 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
711 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
712 throw toThrow;
713
714 }
715 catch (ThreadCreationException e) {
716 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
717 throw toThrow;
718 }
719 }
720
727 try {
728 return toManagedInstance(((AgvSensor*)_sensor)->SetHoldTime(*holdTime->__native));
729 }
731 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
732 throw toThrow;
733 }
734 catch (CommunicationException e) {
735 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
736 toThrow->ErrorCode = e.GetErrorCode();
737 throw toThrow;
738 }
739 catch (SensorErrorException e) {
740 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
741 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
742 throw toThrow;
743
744 }
745 catch (ThreadCreationException e) {
746 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
747 throw toThrow;
748 }
749 }
750
757 try {
758 return toManagedInstance(((AgvSensor*)_sensor)->SetOutputActiveLevel(*activeLevel->__native));
759 }
761 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
762 throw toThrow;
763 }
764 catch (CommunicationException e) {
765 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
766 toThrow->ErrorCode = e.GetErrorCode();
767 throw toThrow;
768 }
769 catch (SensorErrorException e) {
770 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
771 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
772 throw toThrow;
773
774 }
775 catch (ThreadCreationException e) {
776 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
777 throw toThrow;
778 }
779 }
780
787 try {
788 return toManagedInstance(((AgvSensor*)_sensor)->SetOutputFunction(*function->__native));
789 }
791 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
792 throw toThrow;
793 }
794 catch (CommunicationException e) {
795 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
796 toThrow->ErrorCode = e.GetErrorCode();
797 throw toThrow;
798 }
799 catch (SensorErrorException e) {
800 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
801 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
802 throw toThrow;
803
804 }
805 catch (ThreadCreationException e) {
806 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
807 throw toThrow;
808 }
809 }
810
817 try {
818 return toManagedInstance(((AgvSensor*)_sensor)->SetSensorLeds(*leds->__native));
819 }
821 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
822 throw toThrow;
823 }
824 catch (CommunicationException e) {
825 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
826 toThrow->ErrorCode = e.GetErrorCode();
827 throw toThrow;
828 }
829 catch (SensorErrorException e) {
830 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
831 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
832 throw toThrow;
833
834 }
835 catch (ThreadCreationException e) {
836 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
837 throw toThrow;
838 }
839 }
840
846 try {
847 return toManagedInstance(((AgvSensor*)_sensor)->StoreInFlash());
848 }
850 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()));
851 throw toThrow;
852 }
853 catch (CommunicationException e) {
854 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()));
855 toThrow->ErrorCode = e.GetErrorCode();
856 throw toThrow;
857 }
858 catch (SensorErrorException e) {
859 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()));
860 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
861 throw toThrow;
862
863 }
864 catch (ThreadCreationException e) {
865 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()));
866 throw toThrow;
867 }
868 }
869 protected:
871 WConfigurationResult^ toReturn = gcnew WConfigurationResult();
872 toReturn->Result = pResult.GetResult();
873 for (int i = 0; i < pResult.GetReasons().size(); i++) {
874 toReturn->PushReason(gcnew String(pResult.GetReasons()[i].c_str()));
875 }
876 return toReturn;
877 }
878 private:
879 WRawDataSensor^ _wRawData;
880 };
881 }
882 }
883}
Definition WAgvSensor.h:26
Definition WAgvSensorLeds.h:6
Definition WAvailableResolution.h:7
Definition WBadAcknowledgmentException.h:3
Definition WBaseCommunication.h:16
Definition WEnums.h:4
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
Definition HoldTime.h:10
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
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
property bool ContaminationLed
Definition WAgvSensorLeds.h:24
property int FieldNumber
Definition WFieldData.h:35
property int FieldNumber
Definition WFieldName.h:33
property unsigned int Protection
Definition WHoldTime.h:24
property unsigned int Protection
Definition WMultipleSampling.h:24
property ObjSizeEnum Protection
Definition WObjectSize.h:27
Definition WOutputActiveLevel.h:11
property ActiveLevelEnum Output1
Definition WOutputActiveLevel.h:28
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 WRawData.h:7
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