| Visioscan Set SDK Libraries 1.0.28 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 return pComp1->FieldNumber == pComp2->FieldNumber
130 && pComp1->Parameter1 == pComp2->Parameter1
131 && pComp1->Parameter2 == pComp2->Parameter2
132 && pComp1->Crc == pComp2->Crc
133 && pComp1->GUID == pComp2->GUID
134 && pComp1->DataCrc == pComp2->DataCrc;
135 }
136
137 static bool operator!= (WFieldData^ pComp1, WFieldData^ pComp2) {
138 return pComp1->FieldNumber != pComp2->FieldNumber
139 || pComp1->Parameter1 != pComp2->Parameter1
140 || pComp1->Parameter2 != pComp2->Parameter2
141 || pComp1->Crc != pComp2->Crc
142 || pComp1->GUID != pComp2->GUID
143 || pComp1->DataCrc != pComp2->DataCrc;
144 }
145
146 private:
147 List<int> ^_internalPoints = gcnew List<int>();
148 FieldData* _fieldData;
149 int _internalDataCrc = 0;
150 };
151 }
152 }
153}
Com
Definition WAgvSensor.h:26
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:39
FieldData::GetZoneType
NativeZoneTypeEnum GetZoneType()
Definition FieldData.cpp:14
FieldData::SetData
void SetData(vector< uint16_t > data)
Definition FieldData.cpp:69
FieldData::SetFieldNumber
void SetFieldNumber(uint8_t fieldNumber)
Definition FieldData.cpp:9
FieldData::GetCrc
uint16_t GetCrc()
Definition FieldData.cpp:44
FieldData::SetParameter1
void SetParameter1(int16_t parameter1)
Definition FieldData.cpp:29
FieldData::GetGUID
string GetGUID()
Definition FieldData.cpp:54
FieldData::SetGUID
void SetGUID(string GUID)
Definition FieldData.cpp:59
FieldData::GetParameter2
int16_t GetParameter2()
Definition FieldData.cpp:34
FieldData::SetCrc
void SetCrc(uint16_t crc)
Definition FieldData.cpp:49
FieldData::GetFieldNumber
uint8_t GetFieldNumber()
Definition FieldData.cpp:4
FieldData::SetZoneType
void SetZoneType(NativeZoneTypeEnum zoneType)
Definition FieldData.cpp:19
FieldData::GetParameter1
int16_t GetParameter1()
Definition FieldData.cpp:24
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:149
Com::AgvSensorWrapper::Structs::WFieldData::~WFieldData
~WFieldData()
Definition WFieldData.h:31
Com::AgvSensorWrapper::Structs::WFieldData::_fieldData
FieldData * _fieldData
Definition WFieldData.h:148
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