Visioscan Set SDK Libraries 1.0.28
Visioscan Set SDK Help documentation file for C++ and C++/CLI
 
Loading...
Searching...
No Matches
WRawDataSensor.h
1#pragma once
2#include <RawDataSensor.h>
3#include "WNetworkInformation.h"
4#include "WAngleRange.h"
5#include "WContaminationThreshold.h"
6#include "WRawDataError.h"
7#include <List>
8#include "WSensorLeds.h"
9#include "WSensorLamps.h"
10#include <array>
11#include <BadAcknowledgmentException.h>
12#include <CommunicationException.h>
13#include <SensorErrorException.h>
14#include <ThreadCreationException.h>
15
16#include "../StarfleetToolboxWrapper/WCommunicationStatus.h"
17#include "../StarfleetToolboxWrapper/WContaminationStatus.h"
18
19#pragma make_public(ConfigurationResult)
20
21using namespace System::Collections;
22using namespace System::Collections::Generic;
23using namespace WBase;
24using namespace WUtils;
25using namespace WCommunication;
26using namespace WToolboxException;
27using namespace WSensorData;
28using namespace System::Runtime::InteropServices;
29using namespace WEnumerations;
30
36public ref class WRawDataSensor : public WBaseSensor
37{
38public:
40 this->_sensor = (BaseSensor*)new RawDataSensor();
41 }
42
43 WRawDataSensor(WBaseCommunication^ pcomm) {
44 _sensor = (BaseSensor*)new RawDataSensor(pcomm->__nativeCommunication);
45 Communication = pcomm;
46 }
47
49 delete(_sensor);
50 }
51
56 CommunicationStatus status = _sensor->Initialize();
57
59 for (int i = 0; i < status.Channels.size(); i++) {
60 WChannel^ toAdd = gcnew WChannel();
61 toAdd->RawDataAvailability = static_cast<DataAvailabilityEnum>(status.Channels[i].RawDataAvailability);
62 toAdd->Type = static_cast<ChannelTypeEnum>(status.Channels[i].Type);
63
64 toReturn->Channels->Add(toAdd);
65 }
66
67 toReturn->ErrorCode = gcnew WCommunicationErrorCode();
68 toReturn->ErrorCode->ErrorCode = status.ErrorCode.ErrorCode;
69 toReturn->ErrorCode->ErrorMeaning = gcnew String(status.ErrorCode.ErrorMeaning.c_str());
70
71 toReturn->Status = static_cast<ConnectionStatusEnum>(status.Status);
72
73 return toReturn;
74 }
75
76
80 void ResetDevice() {
81 try {
82 ((RawDataSensor*)_sensor)->ResetDevice();
83 }
85 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
86 throw toThrow;
87 }
88 catch (CommunicationException e) {
89 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
90 toThrow->ErrorCode = e.GetErrorCode();
91 throw toThrow;
92 }
93 catch (SensorErrorException e) {
94 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
95 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
96 throw toThrow;
97
98 }
99 catch (ThreadCreationException e) {
100 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
101 throw toThrow;
102 }
103 }
104
109 try {
110 ((RawDataSensor*)_sensor)->RebootDevice();
111 }
113 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
114 throw toThrow;
115 }
116 catch (CommunicationException e) {
117 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
118 toThrow->ErrorCode = e.GetErrorCode();
119 throw toThrow;
120 }
121 catch (SensorErrorException e) {
122 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
123 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
124 throw toThrow;
125
126 }
127 catch (ThreadCreationException e) {
128 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
129 throw toThrow;
130 }
131 }
132
133 // Command settings management
134 // Data retrieve
140 try {
141 NetworkInformation toFetch = ((RawDataSensor*)_sensor)->GetNetworkInformation();
142
143 WNetworkInformation^ toReturn = gcnew WNetworkInformation();
144 toReturn->DhcpMode = toFetch.GetDhcpMode();
145 toReturn->Gateway = gcnew String(toFetch.GetGateway().c_str());
146 toReturn->IpAddress = gcnew String(toFetch.GetIpAddress().c_str());
147 toReturn->IpPort = toFetch.GetIpPort();
148 toReturn->SubnetMask = gcnew String(toFetch.GetSubnetMask().c_str());
149 toReturn->MacAddress = gcnew String(toFetch.GetMacAddress().c_str());
150
151 return toReturn;
152 }
154 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
155 throw toThrow;
156 }
157 catch (CommunicationException e) {
158 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
159 toThrow->ErrorCode = e.GetErrorCode();
160 throw toThrow;
161 }
162 catch (SensorErrorException e) {
163 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
164 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
165 throw toThrow;
166
167 }
168 catch (ThreadCreationException e) {
169 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
170 throw toThrow;
171 }
172 }
173
179 try {
180 PROTOCOL actual = ((RawDataSensor*)_sensor)->GetRawDataExchangeMode();
181 if (actual == UDP) {
182 return Protocol::Udp;
183 }
184 else {
185 return Protocol::Tcp;
186 }
187 }
189 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
190 throw toThrow;
191 }
192 catch (CommunicationException e) {
193 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
194 toThrow->ErrorCode = e.GetErrorCode();
195 throw toThrow;
196 }
197 catch (SensorErrorException e) {
198 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
199 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
200 throw toThrow;
201
202 }
203 catch (ThreadCreationException e) {
204 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
205 throw toThrow;
206 }
207 }
208
214 try {
215 SCAN_PACKET_TYPE actual = ((RawDataSensor*)_sensor)->GetDataPacketType();
216 if (actual == DISTANCE) {
217 return ScanPacketType::Distance;
218 }
219 else {
220 return ScanPacketType::DistanceAndIntensity;
221 }
222 }
224 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
225 throw toThrow;
226 }
227 catch (CommunicationException e) {
228 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
229 toThrow->ErrorCode = e.GetErrorCode();
230 throw toThrow;
231 }
232 catch (SensorErrorException e) {
233 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
234 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
235 throw toThrow;
236
237 }
238 catch (ThreadCreationException e) {
239 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
240 throw toThrow;
241 }
242 }
243
249 try {
250 SensorResolutionFrequencyEnum actual = ((RawDataSensor*)_sensor)->GetAngularResolution();
251
252 return static_cast<AngularResolution>(actual);
253 }
255 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
256 throw toThrow;
257 }
258 catch (CommunicationException e) {
259 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
260 toThrow->ErrorCode = e.GetErrorCode();
261 throw toThrow;
262 }
263 catch (SensorErrorException e) {
264 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
265 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
266 throw toThrow;
267
268 }
269 catch (ThreadCreationException e) {
270 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
271 throw toThrow;
272 }
273 }
274
280 try {
281 SCANNING_DIRECTION actual = ((RawDataSensor*)_sensor)->GetScanningDirection();
282 if (actual == CLOCKWISE) {
283 return ScanningDirection::Clockwise;
284 }
285 else {
286 return ScanningDirection::CounterClockwise;
287 }
288 }
290 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
291 throw toThrow;
292 }
293 catch (CommunicationException e) {
294 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
295 toThrow->ErrorCode = e.GetErrorCode();
296 throw toThrow;
297 }
298 catch (SensorErrorException e) {
299 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
300 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
301 throw toThrow;
302
303 }
304 catch (ThreadCreationException e) {
305 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
306 throw toThrow;
307 }
308 }
309
315 try {
316 WAngleRange^ toReturn = gcnew WAngleRange();
317 AngleRange actual = ((RawDataSensor*)_sensor)->GetAngleRange();
318
319 toReturn->Start = actual.GetStart();
320 toReturn->Stop = actual.GetStop();
321
322 return toReturn;
323 }
325 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
326 throw toThrow;
327 }
328 catch (CommunicationException e) {
329 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
330 toThrow->ErrorCode = e.GetErrorCode();
331 throw toThrow;
332 }
333 catch (SensorErrorException e) {
334 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
335 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
336 throw toThrow;
337
338 }
339 catch (ThreadCreationException e) {
340 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
341 throw toThrow;
342 }
343 }
344
349 unsigned int GetSkipScan() {
350 try {
351 return ((RawDataSensor*)_sensor)->GetSkipScan();
352 }
354 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
355 throw toThrow;
356 }
357 catch (CommunicationException e) {
358 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
359 toThrow->ErrorCode = e.GetErrorCode();
360 throw toThrow;
361 }
362 catch (SensorErrorException e) {
363 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
364 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
365 throw toThrow;
366
367 }
368 catch (ThreadCreationException e) {
369 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
370 throw toThrow;
371 }
372 }
373
378 unsigned int GetImmunityLevel() {
379 try {
380 return ((RawDataSensor*)_sensor)->GetImmunityLevel();
381 }
383 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
384 throw toThrow;
385 }
386 catch (CommunicationException e) {
387 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
388 toThrow->ErrorCode = e.GetErrorCode();
389 throw toThrow;
390 }
391 catch (SensorErrorException e) {
392 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
393 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
394 throw toThrow;
395
396 }
397 catch (ThreadCreationException e) {
398 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
399 throw toThrow;
400 }
401 }
402
408 try {
410 ContaminationThreshold actual = ((RawDataSensor*)_sensor)->GetContaminationThreshold();
411
412 toReturn->Error = actual.GetError();
413 toReturn->Warning = actual.GetWarning();
414
415 return toReturn;
416 }
418 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
419 throw toThrow;
420 }
421 catch (CommunicationException e) {
422 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
423 toThrow->ErrorCode = e.GetErrorCode();
424 throw toThrow;
425 }
426 catch (SensorErrorException e) {
427 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
428 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
429 throw toThrow;
430
431 }
432 catch (ThreadCreationException e) {
433 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
434 throw toThrow;
435 }
436 }
437
443 try {
444 WSoftwareVersion^ toReturn = gcnew WSoftwareVersion();
445 SoftwareVersion actual = ((RawDataSensor*)_sensor)->GetVersion();
446
447 toReturn->PartNumber = actual.GetPartNumber();
448 toReturn->Prototype = actual.GetPrototype();
449 toReturn->Revision = actual.GetRevision();
450 toReturn->HardwareVersion = actual.GetHardwareVersion();
451 toReturn->CanNumber = actual.GetCanNumber();
452 toReturn->Version = actual.GetVersion();
453 switch (actual.GetProductIdentification()) {
454 case RAW_DATA:
455 toReturn->ProductTypeIdentification = ProductIdentification::RawData;
456 break;
457 case NAVIGATION:
458 toReturn->ProductTypeIdentification = ProductIdentification::Navigation;
459 break;
460 case ANTI_COLLISION:
461 toReturn->ProductTypeIdentification = ProductIdentification::AntiCollision;
462 break;
463 case ROD_300:
464 toReturn->ProductTypeIdentification = ProductIdentification::Rod300;
465 break;
466 case ROD_500:
467 toReturn->ProductTypeIdentification = ProductIdentification::Rod500;
468 break;
469 case ROD_120:
470 toReturn->ProductTypeIdentification = ProductIdentification::Rod120;
471 break;
472 case ROD_130:
473 toReturn->ProductTypeIdentification = ProductIdentification::Rod130;
474 break;
475 default:
476 toReturn->ProductTypeIdentification = ProductIdentification::Unknown;
477 break;
478 }
479
480
481 return toReturn;
482 }
484 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
485 throw toThrow;
486 }
487 catch (CommunicationException e) {
488 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
489 toThrow->ErrorCode = e.GetErrorCode();
490 throw toThrow;
491 }
492 catch (SensorErrorException e) {
493 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
494 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
495 throw toThrow;
496
497 }
498 catch (ThreadCreationException e) {
499 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
500 throw toThrow;
501 }
502 }
503
508 unsigned int GetPlatformVersion() override {
509 try {
510 unsigned int platformVersion = ((RawDataSensor*)_sensor)->GetPlatformVersion();
511
512 return platformVersion;
513 }
515 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
516 throw toThrow;
517 }
518 catch (CommunicationException e) {
519 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
520 toThrow->ErrorCode = e.GetErrorCode();
521 throw toThrow;
522 }
523 catch (SensorErrorException e) {
524 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
525 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
526 throw toThrow;
527
528 }
529 catch (ThreadCreationException e) {
530 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
531 throw toThrow;
532 }
533 }
534
539 int GetTemperature() override {
540 try {
541 return ((RawDataSensor*)_sensor)->GetTemperature();
542 }
544 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
545 throw toThrow;
546 }
547 catch (CommunicationException e) {
548 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
549 toThrow->ErrorCode = e.GetErrorCode();
550 throw toThrow;
551 }
552 catch (SensorErrorException e) {
553 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
554 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
555 throw toThrow;
556
557 }
558 catch (ThreadCreationException e) {
559 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
560 throw toThrow;
561 }
562 }
563
568 List<WRawDataError^>^ GetErrorLog() {
569 try {
570 vector<RawDataError> actual = ((RawDataSensor*)_sensor)->GetErrorLog();
571 List<WRawDataError^>^ toReturn = gcnew List<WRawDataError^>();
572 WRawDataError^ toAdd;
573 for (int i = 0; i < actual.size(); i++) {
574 toAdd = gcnew WRawDataError();
575 toAdd->ErrorCode = actual[i].GetErrorCode();
576 toAdd->ErrorDate = actual[i].GetErrorDate();
577
578 toReturn->Add(toAdd);
579 }
580
581 return toReturn;
582 }
584 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
585 throw toThrow;
586 }
587 catch (CommunicationException e) {
588 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
589 toThrow->ErrorCode = e.GetErrorCode();
590 throw toThrow;
591 }
592 catch (SensorErrorException e) {
593 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
594 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
595 throw toThrow;
596
597 }
598 catch (ThreadCreationException e) {
599 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
600 throw toThrow;
601 }
602 }
603
609 try {
610 SensorLeds actual = ((RawDataSensor*)_sensor)->GetSensorLeds();
611 WSensorLeds^ toReturn = gcnew WSensorLeds();
612
613 toReturn->LogoLed = actual.GetLogoLed();
614 toReturn->StatusLed = actual.GetStatusLed();
615
616 return toReturn;
617 }
619 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
620 throw toThrow;
621 }
622 catch (CommunicationException e) {
623 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
624 toThrow->ErrorCode = e.GetErrorCode();
625 throw toThrow;
626 }
627 catch (SensorErrorException e) {
628 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
629 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
630 throw toThrow;
631
632 }
633 catch (ThreadCreationException e) {
634 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
635 throw toThrow;
636 }
637 }
638
644 try {
645 WSensorLamps^ toReturn = gcnew WSensorLamps();
646 SensorLamps actual = ((RawDataSensor*)_sensor)->GetSensorLamps();
647
648 toReturn->Led1 = (LedColor)actual.GetLed1();
649 toReturn->Led2 = (LedColor)actual.GetLed2();
650 toReturn->Led3 = (LedColor)actual.GetLed3();
651 toReturn->Led4 = (LedColor)actual.GetLed4();
652
653 return toReturn;
654 }
656 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
657 throw toThrow;
658 }
659 catch (CommunicationException e) {
660 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
661 toThrow->ErrorCode = e.GetErrorCode();
662 throw toThrow;
663 }
664 catch (SensorErrorException e) {
665 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
666 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
667 throw toThrow;
668
669 }
670 catch (ThreadCreationException e) {
671 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
672 throw toThrow;
673 }
674 }
675
680 long GetRuntimeHours() override {
681 try {
682 long actual = ((RawDataSensor*)_sensor)->GetRuntimeHours();
683 return actual;
684 }
686 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
687 throw toThrow;
688 }
689 catch (CommunicationException e) {
690 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
691 toThrow->ErrorCode = e.GetErrorCode();
692 throw toThrow;
693 }
694 catch (SensorErrorException e) {
695 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
696 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
697 throw toThrow;
698
699 }
700 catch (ThreadCreationException e) {
701 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
702 throw toThrow;
703 }
704 }
705
710 String^ GetDeviceName() override {
711 try {
712 string actual = ((RawDataSensor*)_sensor)->GetDeviceName();
713
714 return gcnew String(actual.c_str());
715 }
717 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
718 throw toThrow;
719 }
720 catch (CommunicationException e) {
721 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
722 toThrow->ErrorCode = e.GetErrorCode();
723 throw toThrow;
724 }
725 catch (SensorErrorException e) {
726 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
727 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
728 throw toThrow;
729
730 }
731 catch (ThreadCreationException e) {
732 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
733 throw toThrow;
734 }
735 }
736
742 try {
743 FILTER_STATUS actual = ((RawDataSensor*)_sensor)->GetFilterStatus();
744 if (actual == FILTER_OFF) {
745 return FilterStatus::Off;
746 }
747 else {
748 return FilterStatus::On;
749 }
750 }
752 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
753 throw toThrow;
754 }
755 catch (CommunicationException e) {
756 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
757 toThrow->ErrorCode = e.GetErrorCode();
758 throw toThrow;
759 }
760 catch (SensorErrorException e) {
761 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
762 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
763 throw toThrow;
764
765 }
766 catch (ThreadCreationException e) {
767 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
768 throw toThrow;
769 }
770 }
776 try {
777 WINDOW_CALIBRATION actual = ((RawDataSensor*)_sensor)->GetWindowCalibrationStatus();
778 if (actual == PROCESSING) {
779 return WindowCalibrationStatus::Processing;
780 }
781 else if (actual == DONE) {
782 return WindowCalibrationStatus::Done;
783 }
784 else {
785 return WindowCalibrationStatus::Failed;
786 }
787 }
789 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
790 throw toThrow;
791 }
792 catch (CommunicationException e) {
793 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
794 toThrow->ErrorCode = e.GetErrorCode();
795 throw toThrow;
796 }
797 catch (SensorErrorException e) {
798 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
799 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
800 throw toThrow;
801
802 }
803 catch (ThreadCreationException e) {
804 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
805 throw toThrow;
806 }
807 }
808
815 try {
816 return toManagedInstance(((RawDataSensor*)_sensor)->SetNetworkInformation(*pNetwork->__native));
817 }
819 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
820 throw toThrow;
821 }
822 catch (CommunicationException e) {
823 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
824 toThrow->ErrorCode = e.GetErrorCode();
825 throw toThrow;
826 }
827 catch (SensorErrorException e) {
828 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
829 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
830 throw toThrow;
831
832 }
833 catch (ThreadCreationException e) {
834 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
835 throw toThrow;
836 }
837 }
838
845 try {
846 PROTOCOL toSet = -1;
847 if (pProtocol == Protocol::Tcp) {
848 toSet = TCP;
849 }
850 else {
851 toSet = UDP;
852 }
853 return toManagedInstance(((RawDataSensor*)_sensor)->SetRawDataExchangeMode(toSet));
854 }
856 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
857 throw toThrow;
858 }
859 catch (CommunicationException e) {
860 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
861 toThrow->ErrorCode = e.GetErrorCode();
862 throw toThrow;
863 }
864 catch (SensorErrorException e) {
865 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
866 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
867 throw toThrow;
868
869 }
870 catch (ThreadCreationException e) {
871 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
872 throw toThrow;
873 }
874 }
875
882 try {
883 SCAN_PACKET_TYPE toSet = -1;
884 if (pPacketType == ScanPacketType::Distance) {
885 toSet = DISTANCE;
886 }
887 else {
888 toSet = DISTANCE_INTENSITY;
889 }
890 return toManagedInstance(((RawDataSensor*)_sensor)->SetDataPacketType(toSet));
891 }
893 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
894 throw toThrow;
895 }
896 catch (CommunicationException e) {
897 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
898 toThrow->ErrorCode = e.GetErrorCode();
899 throw toThrow;
900 }
901 catch (SensorErrorException e) {
902 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
903 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
904 throw toThrow;
905
906 }
907 catch (ThreadCreationException e) {
908 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
909 throw toThrow;
910 }
911 }
912
919 try {
920 SensorResolutionFrequencyEnum toSet = static_cast<SensorResolutionFrequencyEnum>(pResolution);
921
922 return toManagedInstance(((RawDataSensor*)_sensor)->SetAngularResolution(toSet));
923 }
925 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
926 throw toThrow;
927 }
928 catch (CommunicationException e) {
929 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
930 toThrow->ErrorCode = e.GetErrorCode();
931 throw toThrow;
932 }
933 catch (SensorErrorException e) {
934 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
935 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
936 throw toThrow;
937
938 }
939 catch (ThreadCreationException e) {
940 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
941 throw toThrow;
942 }
943 }
944
951 try {
952 SCANNING_DIRECTION toSet = -1;
953 if (pScanDirection == ScanningDirection::Clockwise) {
954 toSet = CLOCKWISE;
955 }
956 else {
957 toSet = COUNTER_CLOCKWISE;
958 }
959 return toManagedInstance(((RawDataSensor*)_sensor)->SetScanningDirection(toSet));
960 }
962 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
963 throw toThrow;
964 }
965 catch (CommunicationException e) {
966 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
967 toThrow->ErrorCode = e.GetErrorCode();
968 throw toThrow;
969 }
970 catch (SensorErrorException e) {
971 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
972 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
973 throw toThrow;
974
975 }
976 catch (ThreadCreationException e) {
977 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
978 throw toThrow;
979 }
980 }
981
988 try {
989 return toManagedInstance(((RawDataSensor*)_sensor)->SetAngleRange(*pAngleRange->__native));
990 }
992 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
993 throw toThrow;
994 }
995 catch (CommunicationException e) {
996 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
997 toThrow->ErrorCode = e.GetErrorCode();
998 throw toThrow;
999 }
1000 catch (SensorErrorException e) {
1001 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1002 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1003 throw toThrow;
1004
1005 }
1006 catch (ThreadCreationException e) {
1007 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1008 throw toThrow;
1009 }
1010 }
1011
1018 try {
1019 return toManagedInstance(((RawDataSensor*)_sensor)->SetSkipScan(pSkipScan));
1020 }
1021 catch (BadAcknowledgmentException e) {
1022 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1023 throw toThrow;
1024 }
1025 catch (CommunicationException e) {
1026 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1027 toThrow->ErrorCode = e.GetErrorCode();
1028 throw toThrow;
1029 }
1030 catch (SensorErrorException e) {
1031 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1032 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1033 throw toThrow;
1034
1035 }
1036 catch (ThreadCreationException e) {
1037 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1038 throw toThrow;
1039 }
1040 }
1041
1042
1049 try {
1050 return toManagedInstance(((RawDataSensor*)_sensor)->SetImmunityLevel(pImmunityLevel));
1051 }
1052 catch (BadAcknowledgmentException e) {
1053 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1054 throw toThrow;
1055 }
1056 catch (CommunicationException e) {
1057 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1058 toThrow->ErrorCode = e.GetErrorCode();
1059 throw toThrow;
1060 }
1061 catch (SensorErrorException e) {
1062 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1063 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1064 throw toThrow;
1065
1066 }
1067 catch (ThreadCreationException e) {
1068 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1069 throw toThrow;
1070 }
1071 }
1072
1079 try {
1080 return toManagedInstance(((RawDataSensor*)_sensor)->SetContaminationThreshold(*pContaminationThreshold->__native));
1081 }
1082 catch (BadAcknowledgmentException e) {
1083 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1084 throw toThrow;
1085 }
1086 catch (CommunicationException e) {
1087 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1088 toThrow->ErrorCode = e.GetErrorCode();
1089 throw toThrow;
1090 }
1091 catch (SensorErrorException e) {
1092 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1093 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1094 throw toThrow;
1095
1096 }
1097 catch (ThreadCreationException e) {
1098 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1099 throw toThrow;
1100 }
1101 }
1102
1109 try {
1110 return toManagedInstance(((RawDataSensor*)_sensor)->SetSensorLeds(*pLeds->__native));
1111 }
1112 catch (BadAcknowledgmentException e) {
1113 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1114 throw toThrow;
1115 }
1116 catch (CommunicationException e) {
1117 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1118 toThrow->ErrorCode = e.GetErrorCode();
1119 throw toThrow;
1120 }
1121 catch (SensorErrorException e) {
1122 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1123 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1124 throw toThrow;
1125
1126 }
1127 catch (ThreadCreationException e) {
1128 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1129 throw toThrow;
1130 }
1131 }
1132
1133
1138 WConfigurationResult^ SetDeviceName(String^ pName) override {
1139 try {
1141 }
1142 catch (BadAcknowledgmentException e) {
1143 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1144 throw toThrow;
1145 }
1146 catch (CommunicationException e) {
1147 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1148 toThrow->ErrorCode = e.GetErrorCode();
1149 throw toThrow;
1150 }
1151 catch (SensorErrorException e) {
1152 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1153 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1154 throw toThrow;
1155
1156 }
1157 catch (ThreadCreationException e) {
1158 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1159 throw toThrow;
1160 }
1161 }
1162
1169 try {
1170 FILTER_STATUS toSet = -1;
1171 if (pFilterStatus == FilterStatus::Off) {
1172 toSet = FILTER_OFF;
1173 }
1174 else {
1175 toSet = FILTER_ON;
1176 }
1177 return toManagedInstance(((RawDataSensor*)_sensor)->SetFilterStatus(toSet));
1178 }
1179 catch (BadAcknowledgmentException e) {
1180 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1181 throw toThrow;
1182 }
1183 catch (CommunicationException e) {
1184 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1185 toThrow->ErrorCode = e.GetErrorCode();
1186 throw toThrow;
1187 }
1188 catch (SensorErrorException e) {
1189 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1190 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1191 throw toThrow;
1192
1193 }
1194 catch (ThreadCreationException e) {
1195 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1196 throw toThrow;
1197 }
1198 }
1199
1204 try {
1205 ((RawDataSensor*)_sensor)->StartWindowCalibration();
1206 }
1207 catch (BadAcknowledgmentException e) {
1208 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1209 throw toThrow;
1210 }
1211 catch (CommunicationException e) {
1212 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1213 toThrow->ErrorCode = e.GetErrorCode();
1214 throw toThrow;
1215 }
1216 catch (SensorErrorException e) {
1217 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1218 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1219 throw toThrow;
1220
1221 }
1222 catch (ThreadCreationException e) {
1223 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1224 throw toThrow;
1225 }
1226 }
1227
1228
1230 try {
1231 RawData data = ((RawDataSensor*)_sensor)->RetrieveRawData();
1232
1233 WRawData^ toReturn = gcnew WRawData();
1234 //if (this->Communication->IsConnected()) {
1235 if (data._scanCount > 0) {
1236
1237 toReturn->Angles = gcnew cli::array<double>(data._scanCount);
1238 toReturn->Distances = gcnew cli::array<double>(data._scanCount);
1239 toReturn->Intensities = gcnew cli::array<double>(data._scanCount);
1240 toReturn->Indexes = gcnew cli::array<int>(data._scanCount);
1241 toReturn->Timestamps = gcnew cli::array<double>(data._scanCount);
1242
1243 //pin_ptr<long> indexesStart = &toReturn->Indexes[0];
1244 //memcpy(indexesStart, data._indexes, data._scanCount * sizeof(int));
1245 Marshal::Copy(IntPtr((void*)data._indexes), toReturn->Indexes, 0, data._scanCount);
1246
1247 //pin_ptr<double> timestampsStart = &toReturn->Timestamps[0];
1248 //memcpy(timestampsStart, data._timestamps, data._scanCount * sizeof(double));
1249 Marshal::Copy(IntPtr((void*)data._timestamps), toReturn->Timestamps, 0, data._scanCount);
1250
1251 //pin_ptr<double> anglesStart = &toReturn->Angles[0];
1252 //memcpy(anglesStart, data._angles, data._scanCount * sizeof(double));
1253 Marshal::Copy(IntPtr((void*)data._angles), toReturn->Angles, 0, data._scanCount);
1254
1255
1256 //pin_ptr<double> distanceStart = &toReturn->Distances[0];
1257 //memcpy(distanceStart, data._distance, data._scanCount * sizeof(double));
1258 Marshal::Copy(IntPtr((void*)data._distances), toReturn->Distances, 0, data._scanCount);
1259
1260 if (data._intensities != NULL) {
1261 /*pin_ptr<double> intensitiesStart = &toReturn->Intensities[0];
1262 memcpy(intensitiesStart, data._intensities, data._scanCount * sizeof(double));*/
1263 Marshal::Copy(IntPtr((void*)data._intensities), toReturn->Intensities, 0, data._scanCount);
1264 }
1265 else {
1266 double* dummy = (double*)malloc(data._scanCount * sizeof(double));
1267 fill_n(dummy, data._scanCount, -1);
1268 Marshal::Copy(IntPtr((void*)dummy), toReturn->Intensities, 0, data._scanCount);
1269 free(dummy);
1270 }
1271
1272 free(data._indexes);
1273 free(data._timestamps);
1274 free(data._angles);
1275 free(data._distances);
1276 free(data._intensities);
1277 }
1278 //}
1279 return toReturn;
1280 }
1281 catch (BadAcknowledgmentException e) {
1282 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1283 throw toThrow;
1284 }
1285 catch (CommunicationException e) {
1286 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1287 toThrow->ErrorCode = e.GetErrorCode();
1288 throw toThrow;
1289 }
1290 catch (SensorErrorException e) {
1291 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1292 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1293 throw toThrow;
1294
1295 }
1296 catch (ThreadCreationException e) {
1297 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1298 throw toThrow;
1299 }
1300 }
1301
1305 void SendMdi()
1306 {
1307 try {
1308 ((RawDataSensor*)_sensor)->SendMdi();
1309 }
1310 catch (BadAcknowledgmentException e) {
1311 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1312 throw toThrow;
1313 }
1314 catch (CommunicationException e) {
1315 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1316 toThrow->ErrorCode = e.GetErrorCode();
1317 throw toThrow;
1318 }
1319 catch (SensorErrorException e) {
1320 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1321 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1322 throw toThrow;
1323
1324 }
1325 catch (ThreadCreationException e) {
1326 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1327 throw toThrow;
1328 }
1329 }
1330
1334 void StopMdi()
1335 {
1336 try {
1337 ((RawDataSensor*)_sensor)->StopMdi();
1338 }
1339 catch (BadAcknowledgmentException e) {
1340 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1341 throw toThrow;
1342 }
1343 catch (CommunicationException e) {
1344 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1345 toThrow->ErrorCode = e.GetErrorCode();
1346 throw toThrow;
1347 }
1348 catch (SensorErrorException e) {
1349 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1350 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1351 throw toThrow;
1352
1353 }
1354 catch (ThreadCreationException e) {
1355 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1356 throw toThrow;
1357 }
1358 }
1359
1365 try {
1366 ContaminationStatus toFetch = ((RawDataSensor*)_sensor)->GetContaminationStatus();
1367
1368 WContaminationStatus^ toReturn = gcnew WContaminationStatus();
1369 toReturn->DataLeft = toFetch.GetDataLeft();
1370 toReturn->DataMiddle = toFetch.GetDataMiddle();
1371 toReturn->DataRight = toFetch.GetDataRight();
1372 toReturn->Z1 = toFetch.GetZ1();
1373 toReturn->Z2 = toFetch.GetZ2();
1374 toReturn->Z3 = toFetch.GetZ3();
1375 toReturn->Z4 = toFetch.GetZ4();
1376 toReturn->Z5 = toFetch.GetZ5();
1377 toReturn->Z6 = toFetch.GetZ6();
1378 toReturn->Z7 = toFetch.GetZ7();
1379 toReturn->Z8 = toFetch.GetZ8();
1380 toReturn->Z9 = toFetch.GetZ9();
1381
1382 return toReturn;
1383 }
1384 catch (BadAcknowledgmentException e) {
1385 WBadAcknowledgmentException^ toThrow = gcnew WBadAcknowledgmentException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1386 throw toThrow;
1387 }
1388 catch (CommunicationException e) {
1389 WCommunicationException^ toThrow = gcnew WCommunicationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1390 toThrow->ErrorCode = e.GetErrorCode();
1391 throw toThrow;
1392 }
1393 catch (SensorErrorException e) {
1394 WSensorException^ toThrow = gcnew WSensorException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1395 toThrow->ErrorCode = gcnew String(e.GetErrorCode().c_str());
1396 throw toThrow;
1397
1398 }
1399 catch (ThreadCreationException e) {
1400 WThreadCreationException^ toThrow = gcnew WThreadCreationException(gcnew String(e.what()), gcnew String(e.GetTranslateCode().c_str()));
1401 throw toThrow;
1402 }
1403 }
1404
1405
1406protected:
1408 WConfigurationResult^ toReturn = gcnew WConfigurationResult();
1409 toReturn->Result = pResult.GetResult();
1410 for (int i = 0; i < pResult.GetReasons().size(); i++) {
1411 toReturn->PushReason(gcnew String(pResult.GetReasons()[i].c_str()));
1412 }
1413 return toReturn;
1414 }
1415
1416
1417};
1418
Definition WAvailableResolution.h:7
Definition WBadAcknowledgmentException.h:3
Definition WBaseCommunication.h:16
Definition WEnums.h:4
ScanningDirection
Definition WEnums.h:9
FilterStatus
Definition WEnums.h:10
ScanPacketType
Definition WEnums.h:7
DataAvailabilityEnum
Definition WEnums.h:28
WindowCalibrationStatus
Definition WEnums.h:11
AngularResolution
Definition WEnums.h:8
Protocol
Definition WEnums.h:6
ChannelTypeEnum
Definition WEnums.h:27
ConnectionStatusEnum
Definition WEnums.h:26
Definition WEthernetCommunication.h:5
A wrapper on the RawData data encapsulation.
Definition WRawData.h:5
Helper to encapsulate the Angle range data.
Definition AngleRange.h:13
int GetStart()
Gets the start angle.
Definition AngleRange.cpp:7
int GetStop()
Gets the stop angle.
Definition AngleRange.cpp:25
Helper to encapsulate the contamination threshold.
Definition ContaminationThreshold.h:12
unsigned int GetWarning()
Gets the warning status.
Definition ContaminationThreshold.cpp:8
unsigned int GetError()
Gets the error status.
Definition ContaminationThreshold.cpp:26
Helper to encapsulate the network information.
Definition 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
Definition of the Raw data sensor services. This header will let the programmer to handle all the req...
Definition RawDataSensor.h:65
Helper to encapsulate the sensor lamps state.
Definition SensorLamps.h:20
LEDCOLOR GetLed4()
Gets the LED4 status.
Definition SensorLamps.cpp:84
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 SensorLeds.h:11
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
property int Start
Definition WAngleRange.h:21
A wrapper on the ContaminationThreshold data encapsulation.
Definition WContaminationThreshold.h:7
property int Warning
Definition WContaminationThreshold.h:23
A wrapper on the NetworkInformation data encapsulation.
Definition WNetworkInformation.h:14
property String IpAddress
Definition WNetworkInformation.h:34
A wrapper on the RawDataError data encapsulation.
Definition WRawDataError.h:7
property int ErrorCode
Definition WRawDataError.h:23
This class is a wrapper around the unmanaged code RawDataSensor. The goal of this classe is make acce...
Definition WRawDataSensor.h:37
int GetTemperature() override
Gets the temperature.
Definition WRawDataSensor.h:539
WConfigurationResult SetFilterStatus(FilterStatus pFilterStatus)
Sets the device's filter status.
Definition WRawDataSensor.h:1168
WConfigurationResult SetNetworkInformation(WNetworkInformation^ pNetwork)
Set the overall network information except IP v4 and Port.
Definition WRawDataSensor.h:814
unsigned int GetPlatformVersion() override
Gets the platform version.
Definition WRawDataSensor.h:508
WContaminationStatus GetContaminationStatus() override
Gets the contamination status.
Definition WRawDataSensor.h:1364
Protocol GetRawDataExchangeMode()
Get the raw data exchange mode.
Definition WRawDataSensor.h:178
void StopMdi()
Request the sensor to stop sending MDI data to host.
Definition WRawDataSensor.h:1334
String GetDeviceName() override
Gets the sensor's name.
Definition WRawDataSensor.h:710
WConfigurationResult SetContaminationThreshold(WContaminationThreshold^ pContaminationThreshold)
Sets the contamination level threshold for warning and error.
Definition WRawDataSensor.h:1078
unsigned int GetImmunityLevel()
Gets the immunity level.
Definition WRawDataSensor.h:378
WRawDataSensor(WBaseCommunication^ pcomm)
Definition WRawDataSensor.h:43
ScanningDirection GetScanningDirection()
Gets the scanning direction.
Definition WRawDataSensor.h:279
WAngleRange GetAngleRange()
Gets the angle range.
Definition WRawDataSensor.h:314
WConfigurationResult SetSensorLeds(WSensorLeds^ pLeds)
Sets the sensors external leds status (ON or OFF)
Definition WRawDataSensor.h:1108
void StartWindowCalibrationStatus()
Starts the window calibration status.
Definition WRawDataSensor.h:1203
WRawData RetrieveRawData()
Definition WRawDataSensor.h:1229
WConfigurationResult SetImmunityLevel(int pImmunityLevel)
Sets the sensor's immunity level.
Definition WRawDataSensor.h:1048
WConfigurationResult SetAngularResolution(AngularResolution pResolution)
Sets the angle resolution. Can be either AngularResolution::ZeroToZeroPointOneAtFourtyHz or AngularRe...
Definition WRawDataSensor.h:918
WSensorLeds GetSensorLeds()
Gets the sensor's leds status.
Definition WRawDataSensor.h:608
WCommunicationStatus Initialize() override
Initializes the object to connect the sensor.
Definition WRawDataSensor.h:55
long GetRuntimeHours() override
Gets the sensor runtime hours.
Definition WRawDataSensor.h:680
WNetworkInformation GetNetworkInformation()
Gets whole data information.
Definition WRawDataSensor.h:139
WConfigurationResult toManagedInstance(ConfigurationResult pResult)
Definition WRawDataSensor.h:1407
WConfigurationResult SetScanningDirection(ScanningDirection pScanDirection)
Sets the scanning direction. Can be either ScanningDirection::Clockwise or ScanningDirection::Counter...
Definition WRawDataSensor.h:950
WConfigurationResult SetDeviceName(String^ pName) override
Sets the sensor's name.
Definition WRawDataSensor.h:1138
ScanPacketType GetDataPacketType()
Gets the data packed type.
Definition WRawDataSensor.h:213
void ResetDevice()
Resets the device.
Definition WRawDataSensor.h:80
WConfigurationResult SetDataPacketType(ScanPacketType pPacketType)
Sets the packet type returned in raw data. Can be either ScanPacketType::Distance or ScanPacketType::...
Definition WRawDataSensor.h:881
~WRawDataSensor()
Definition WRawDataSensor.h:48
WindowCalibrationStatus GetWindowCalibrationStatus()
Gets the window calibration status.
Definition WRawDataSensor.h:775
WContaminationThreshold GetContaminationThreshold()
Gets the contamination threshold.
Definition WRawDataSensor.h:407
WConfigurationResult SetRawDataExchangeMode(Protocol pProtocol)
Sets the RAW data exchange mode. Can be either TCP or UDP.
Definition WRawDataSensor.h:844
void SendMdi()
Request the sensor to start sending MDI data to host.
Definition WRawDataSensor.h:1305
List< WRawDataError^> GetErrorLog()
Gets the error log.
Definition WRawDataSensor.h:568
FilterStatus GetFilterStatus()
Gets the filter status.
Definition WRawDataSensor.h:741
void RebootDevice()
Reboots the device.
Definition WRawDataSensor.h:108
WSoftwareVersion GetVersion() override
Gets the sensor version data.
Definition WRawDataSensor.h:442
WRawDataSensor()
Definition WRawDataSensor.h:39
AngularResolution GetAngularResolution()
Gets the angular resolution.
Definition WRawDataSensor.h:248
WConfigurationResult SetSkipScan(int pSkipScan)
Sets the skip scan.
Definition WRawDataSensor.h:1017
unsigned int GetSkipScan()
Gets the skip scan.
Definition WRawDataSensor.h:349
WConfigurationResult SetAngleRange(WAngleRange^ pAngleRange)
Sets the Angle range (start and stop)
Definition WRawDataSensor.h:987
WSensorLamps GetSensorLamps()
Gets the sensor lamps status.
Definition WRawDataSensor.h:643
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 BadAcknowledgmentException.h:15
virtual const char * what() const noexcept
Overload of message retrie.
Definition BadAcknowledgmentException.h:44
An Exception used when a communication error is detected.
Definition CommunicationException.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
Helper to encapsulate the configuration result.
Definition ConfigurationResult.h:15
bool GetResult()
Gets the result.
Definition ConfigurationResult.cpp:33
vector< string > GetReasons()
Gets the reason of failure.
Definition ConfigurationResult.cpp:42
Helper to encapsulate the contamination threshold.
Definition ContaminationStatus.h:12
unsigned int GetDataRight()
Gets the contamination status on sensor's right side.
Definition ContaminationStatus.cpp:40
unsigned int GetZ3()
Gets the Navigation sensor's Z3 contamination state.
Definition ContaminationStatus.cpp:89
unsigned int GetDataMiddle()
Gets the contamination status on sensor's middle side.
Definition ContaminationStatus.cpp:24
unsigned int GetZ9()
Gets the Navigation sensor's Z9 contamination state.
Definition ContaminationStatus.cpp:188
unsigned int GetDataLeft()
Gets the contamination status on sensor's left side.
Definition ContaminationStatus.cpp:8
unsigned int GetZ8()
Gets the Navigation sensor's Z8 contamination state.
Definition ContaminationStatus.cpp:173
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 GetZ7()
Gets the Navigation sensor's Z7 contamination state.
Definition ContaminationStatus.cpp:158
unsigned int GetZ4()
Gets the Navigation sensor's Z4 contamination state.
Definition ContaminationStatus.cpp:105
The base class encapsulating sensor's RAW data.
Definition RawData.h:14
int * _indexes
The index of the record starting from 1 (FREE the pointer after usage !!!)
Definition RawData.h:19
double * _angles
Angles array (FREE the pointer after usage !!!)
Definition RawData.h:35
double * _distances
Distances array (FREE the pointer after usage !!!)
Definition RawData.h:27
double * _timestamps
The reading timestamps elapsed from the StartMdi command expressed in nanoseconds (FREE the pointer a...
Definition RawData.h:23
int _scanCount
Scan counts.
Definition RawData.h:39
double * _intensities
Intensities array (FREE the pointer after usage !!!)
Definition RawData.h:31
An exception used when the sensor returns an error related to a command excecution.
Definition SensorErrorException.h:14
Helper to encapsulate the software version.
Definition SoftwareVersion.h:21
unsigned int GetRevision()
Gets the internal software revision.
Definition SoftwareVersion.cpp:26
unsigned int GetPrototype()
Gets the internal prototype code.
Definition SoftwareVersion.cpp:44
unsigned int GetVersion()
Gets the internal software version.
Definition SoftwareVersion.cpp:8
PRODUCT_IDENTIFICATION GetProductIdentification()
Gets the product identification.
Definition SoftwareVersion.cpp:113
unsigned long GetPartNumber()
Gets the internal part number.
Definition SoftwareVersion.cpp:95
unsigned long GetCanNumber()
Gets the internal CAN number.
Definition SoftwareVersion.cpp:63
unsigned int GetHardwareVersion()
Gets the Hardware version.
Definition SoftwareVersion.cpp:80
An Exception used when a thread creation error is detected.
Definition ThreadCreationException.h:16
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
property bool Result
Definition WConfigurationResult.h:30
Definition WContaminationStatus.h:6
property int DataLeft
Definition WContaminationStatus.h:23
Definition WRawData.h:7
property cli::array< int > Indexes
Definition WRawData.h:21
Definition WSensorException.h:6
property String ErrorCode
Definition WSensorException.h:12
A wrapper on the SoftwareVersion data encapsulation.
Definition WSoftwareVersion.h:12
property int Version
Definition WSoftwareVersion.h:32
Definition WThreadCreationException.h:6
static char * ConvertToNativeString(String^ toConvert)
Definition WUtilities.h:16