| Visioscan Set SDK Libraries 1.3.5 Visioscan Set SDK Help documentation file for C++ and C++/CLI |

Loading...
Searching...
No Matches
WSensorLamps.h
1#pragma once
2#include <RawDataSensor.h>
3
4
5 public enum class LedColor { Black = 0, Red = 1, Green = 2, Orange = 3, Blue = 4 };
6
10 public ref class WSensorLamps
11{
12 public:
13 WSensorLamps() {
14 _lamps = new SensorLamps();
15 }
16 WSensorLamps(WSensorLamps^ toCopy) {
17 _lamps = new SensorLamps();
18 Led1 = toCopy->Led1;
19 Led2 = toCopy->Led2;
20 Led3 = toCopy->Led3;
21 Led4 = toCopy->Led4;
22 }
23 WSensorLamps(LedColor pLed1, LedColor pLed2, LedColor pLed3, LedColor pLed4) {
24 _lamps = new SensorLamps();
25 }
26 ~WSensorLamps() {
27 delete(_lamps);
28 }
29 property LedColor Led1 {
30 LedColor get() {
31 return GetColor(_lamps->GetLed1());
32 }
33 void set(LedColor x) {
34 _lamps->SetLed1((int)x);
35 }
36 }
37 property LedColor Led2 {
38 LedColor get() {
39 return GetColor(_lamps->GetLed2());
40 }
41 void set(LedColor x) {
42 _lamps->SetLed2((int)x);
43 }
44 }
45 property LedColor Led3 {
46 LedColor get() {
47 return GetColor(_lamps->GetLed3());
48 }
49 void set(LedColor x) {
50 _lamps->SetLed3((int)x);
51 }
52 }
53 property LedColor Led4 {
54 LedColor get() {
55 return GetColor(_lamps->GetLed4());
56 }
57 void set(LedColor x) {
58 _lamps->SetLed4((int)x);
59 }
60 }
61 static bool operator== (WSensorLamps^ pComp1, WSensorLamps^ pComp2) {
62
63 if (System::Object::ReferenceEquals(pComp1, pComp2))
64 return true;
65
66 if (System::Object::ReferenceEquals(pComp1, nullptr) ||
67 System::Object::ReferenceEquals(pComp2, nullptr)) {
68 return false;
69 }
70
71 return pComp1->Led1 == pComp2->Led1 &&
72 pComp1->Led2 == pComp2->Led2 &&
73 pComp1->Led3 == pComp2->Led3 &&
74 pComp1->Led4 == pComp2->Led4;
75
76 }
77
78 static bool operator!= (WSensorLamps^ pComp1, WSensorLamps^ pComp2) {
79 return !(pComp1 == pComp2);
80 }
81
82 private:
83 SensorLamps* _lamps;
84
85 LedColor GetColor(int color) {
86 switch (color) {
87 case 0:
88 return LedColor::Black;
89 break;
90 case 1:
91 return LedColor::Red;
92 break;
93 case 2:
94 return LedColor::Green;
95 break;
96 case 3:
97 return LedColor::Orange;
98 break;
99 case 4:
100 return LedColor::Blue;
101 break;
102 }
103 }
104};
105
SensorLamps
Helper to encapsulate the sensor lamps state.
Definition SensorLamps.h:20
WSensorLamps
A wrapper on the SensorLamps data encapsulation.
Definition WSensorLamps.h:11
WSensorLamps::WSensorLamps
WSensorLamps()
Definition WSensorLamps.h:13
WSensorLamps::GetColor
LedColor GetColor(int color)
Definition WSensorLamps.h:85
WSensorLamps::Led1
property LedColor Led1
Definition WSensorLamps.h:29
WSensorLamps::WSensorLamps
WSensorLamps(LedColor pLed1, LedColor pLed2, LedColor pLed3, LedColor pLed4)
Definition WSensorLamps.h:23
WSensorLamps::WSensorLamps
WSensorLamps(WSensorLamps^ toCopy)
Definition WSensorLamps.h:16
WSensorLamps::~WSensorLamps
~WSensorLamps()
Definition WSensorLamps.h:26