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

Loading...
Searching...
No Matches
WFieldData.h
1#pragma once
2#include "../AgvSensor/FieldData.h"
3#include "../AgvSensor/Enumerations.h"
4
5 using namespace WEnumerations;
6 using namespace System;
7 using namespace std;
8 using namespace WUtils;
9 using namespace System::Collections::Generic;
10
11 namespace Com {
12 namespace AgvSensorWrapper {
13 namespace Structs {
14 public ref class WFieldData
15 {
16 public:
17 WFieldData() {
18 _fieldData = new FieldData();
19 }
20 WFieldData(WFieldData^ toCopy) {
21 _fieldData = new FieldData();
22 FieldNumber = toCopy->FieldNumber;
23 ZoneType = toCopy->ZoneType;
24 Parameter1 = toCopy->Parameter1;
25 Parameter2 = toCopy->Parameter2;
26 Crc = toCopy->Crc;
27 GUID = toCopy->GUID;
28 Data = toCopy->Data;
29 DataCrc = toCopy->DataCrc;
30 }
31 ~WFieldData() {
32 delete(_fieldData);
33 }
34
35 property int FieldNumber {
36 int get() {
37 return _fieldData->GetFieldNumber();
38 }
39 void set(int x) {
40 _fieldData->SetFieldNumber(x);
41 }
42 }
43
44 property ZoneTypeEnum ZoneType {
45 ZoneTypeEnum get() {
46 return static_cast<ZoneTypeEnum>(_fieldData->GetZoneType());
47 }
48 void set(ZoneTypeEnum x) {
49 _fieldData->SetZoneType((NativeZoneTypeEnum)x);
50 }
51 }
52
53 property int Parameter1 {
54 int get() {
55 return _fieldData->GetParameter1();
56 }
57 void set(int x) {
58 _fieldData->SetParameter1(x);
59 }
60 }
61
62 property int Parameter2 {
63 int get() {
64 return _fieldData->GetParameter2();
65 }
66 void set(int x) {
67 _fieldData->SetParameter2(x);
68 }
69 }
70
71 property int Crc {
72 int get() {
73 return _fieldData->GetCrc();
74 }
75 void set(int x) {
76 _fieldData->SetCrc(x);
77 }
78 }
79
80 property String^ GUID {
81 String^ get() {
82 return gcnew String(_fieldData->GetGUID().c_str());
83 }
84 void set(String^ x) {
85 _fieldData->SetGUID(WConverter::ConvertToNativeString(x));
86 }
87 }
88
89 property List<int>^ Data {
90 List<int>^ get() {
91 return _internalPoints;
92 }
93 void set(List<int>^ x) {
94 _internalPoints = x;
95 _internalDataCrc = 0;
96 vector<uint16_t> toFetch;
97
98 for (int i = 0; i < x->Count; i++) {
99 _internalDataCrc = _internalDataCrc ^ x[i];
100 toFetch.push_back(x[i]);
101 }
102 _fieldData->SetData(toFetch);
103 }
104 }
105 property int DataCrc {
106 int get() {
107 return _internalDataCrc;
108 }
109 void set(int x) {
110 _internalDataCrc = x;
111 }
112 }
113
114
115 property FieldData* __native {
116 FieldData* get() {
117 return _fieldData;
118 }
119 }
120
121 void __fetchNativeData(vector<uint16_t> toFetch) {
122 for (int i = 0; i < toFetch.size(); i++) {
123 _internalDataCrc = _internalDataCrc ^ toFetch[i];
124 _internalPoints->Add(toFetch[i]);
125 }
126 }
127
128 static bool operator== (WFieldData^ pComp1, WFieldData^ pComp2) {
129 if (System::Object::ReferenceEquals(pComp1, pComp2))
130 return true;
131
132 if (System::Object::ReferenceEquals(pComp1, nullptr) ||
133 System::Object::ReferenceEquals(pComp2, nullptr)) {
134 return false;
135 }
136 return pComp1->FieldNumber == pComp2->FieldNumber
137 && pComp1->Parameter1 == pComp2->Parameter1
138 && pComp1->Parameter2 == pComp2->Parameter2
139 && pComp1->Crc == pComp2->Crc
140 && pComp1->GUID == pComp2->GUID
141 && pComp1->DataCrc == pComp2->DataCrc;
142 }
143
144 static bool operator!= (WFieldData^ pComp1, WFieldData^ pComp2) {
145 return !(pComp1 == pComp2);
146 }
147
148 private:
149 List<int> ^_internalPoints = gcnew List<int>();
150 FieldData* _fieldData;
151 int _internalDataCrc = 0;
152 };
153 }
154 }
155}
Com
Definition WActiveLevel.h:7
WUtils
Definition WAvailableResolution.h:7
WEnumerations
Definition WEnums.h:4
WEnumerations::ZoneTypeEnum
ZoneTypeEnum
Definition WEnums.h:21
FieldData
Definition FieldData.h:14
FieldData::SetParameter2
void SetParameter2(int16_t parameter2)
Definition FieldData.cpp:48
FieldData::GetZoneType
NativeZoneTypeEnum GetZoneType()
Definition FieldData.cpp:23
FieldData::SetData
void SetData(vector< uint16_t > data)
Definition FieldData.cpp:78
FieldData::SetFieldNumber
void SetFieldNumber(uint8_t fieldNumber)
Definition FieldData.cpp:18
FieldData::GetCrc
uint16_t GetCrc()
Definition FieldData.cpp:53
FieldData::SetParameter1
void SetParameter1(int16_t parameter1)
Definition FieldData.cpp:38
FieldData::GetGUID
string GetGUID()
Definition FieldData.cpp:63
FieldData::SetGUID
void SetGUID(string GUID)
Definition FieldData.cpp:68
FieldData::GetParameter2
int16_t GetParameter2()
Definition FieldData.cpp:43
FieldData::SetCrc
void SetCrc(uint16_t crc)
Definition FieldData.cpp:58
FieldData::GetFieldNumber
uint8_t GetFieldNumber()
Definition FieldData.cpp:13
FieldData::SetZoneType
void SetZoneType(NativeZoneTypeEnum zoneType)
Definition FieldData.cpp:28
FieldData::GetParameter1
int16_t GetParameter1()
Definition FieldData.cpp:33
Com::AgvSensorWrapper::Structs::WFieldData
Definition WFieldData.h:15
Com::AgvSensorWrapper::Structs::WFieldData::WFieldData
WFieldData(WFieldData^ toCopy)
Definition WFieldData.h:20
Com::AgvSensorWrapper::Structs::WFieldData::_internalDataCrc
int _internalDataCrc
Definition WFieldData.h:151
Com::AgvSensorWrapper::Structs::WFieldData::~WFieldData
~WFieldData()
Definition WFieldData.h:31
Com::AgvSensorWrapper::Structs::WFieldData::_fieldData
FieldData * _fieldData
Definition WFieldData.h:150
Com::AgvSensorWrapper::Structs::WFieldData::FieldNumber
property int FieldNumber
Definition WFieldData.h:35
Com::AgvSensorWrapper::Structs::WFieldData::WFieldData
WFieldData()
Definition WFieldData.h:17
WUtils::WConverter::ConvertToNativeString
static char * ConvertToNativeString(String^ toConvert)
Definition WUtilities.h:16