-
Notifications
You must be signed in to change notification settings - Fork 388
/
OpcuaNodeIdServicesVariableH.go
255 lines (233 loc) · 12.1 KB
/
OpcuaNodeIdServicesVariableH.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package model
import (
"context"
"fmt"
"github.com/apache/plc4x/plc4go/spi/utils"
"github.com/pkg/errors"
"github.com/rs/zerolog"
)
// Code generated by code-generation. DO NOT EDIT.
// OpcuaNodeIdServicesVariableH is an enum
type OpcuaNodeIdServicesVariableH int32
type IOpcuaNodeIdServicesVariableH interface {
fmt.Stringer
utils.LengthAware
utils.Serializable
}
const (
OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_TreatUncertainAsBad OpcuaNodeIdServicesVariableH = 11204
OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_PercentDataBad OpcuaNodeIdServicesVariableH = 11205
OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_PercentDataGood OpcuaNodeIdServicesVariableH = 11206
OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_UseSlopedExtrapolation OpcuaNodeIdServicesVariableH = 11207
OpcuaNodeIdServicesVariableH_HAConfiguration_Stepped OpcuaNodeIdServicesVariableH = 11208
OpcuaNodeIdServicesVariableH_HAConfiguration_Definition OpcuaNodeIdServicesVariableH = 11209
OpcuaNodeIdServicesVariableH_HAConfiguration_MaxTimeInterval OpcuaNodeIdServicesVariableH = 11210
OpcuaNodeIdServicesVariableH_HAConfiguration_MinTimeInterval OpcuaNodeIdServicesVariableH = 11211
OpcuaNodeIdServicesVariableH_HAConfiguration_ExceptionDeviation OpcuaNodeIdServicesVariableH = 11212
OpcuaNodeIdServicesVariableH_HAConfiguration_ExceptionDeviationFormat OpcuaNodeIdServicesVariableH = 11213
OpcuaNodeIdServicesVariableH_HAConfiguration_StartOfArchive OpcuaNodeIdServicesVariableH = 11503
OpcuaNodeIdServicesVariableH_HAConfiguration_StartOfOnlineArchive OpcuaNodeIdServicesVariableH = 11504
OpcuaNodeIdServicesVariableH_HAConfiguration_ServerTimestampSupported OpcuaNodeIdServicesVariableH = 19093
OpcuaNodeIdServicesVariableH_HAConfiguration_MaxTimeStoredValues OpcuaNodeIdServicesVariableH = 32635
OpcuaNodeIdServicesVariableH_HAConfiguration_MaxCountStoredValues OpcuaNodeIdServicesVariableH = 32636
)
var OpcuaNodeIdServicesVariableHValues []OpcuaNodeIdServicesVariableH
func init() {
_ = errors.New
OpcuaNodeIdServicesVariableHValues = []OpcuaNodeIdServicesVariableH{
OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_TreatUncertainAsBad,
OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_PercentDataBad,
OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_PercentDataGood,
OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_UseSlopedExtrapolation,
OpcuaNodeIdServicesVariableH_HAConfiguration_Stepped,
OpcuaNodeIdServicesVariableH_HAConfiguration_Definition,
OpcuaNodeIdServicesVariableH_HAConfiguration_MaxTimeInterval,
OpcuaNodeIdServicesVariableH_HAConfiguration_MinTimeInterval,
OpcuaNodeIdServicesVariableH_HAConfiguration_ExceptionDeviation,
OpcuaNodeIdServicesVariableH_HAConfiguration_ExceptionDeviationFormat,
OpcuaNodeIdServicesVariableH_HAConfiguration_StartOfArchive,
OpcuaNodeIdServicesVariableH_HAConfiguration_StartOfOnlineArchive,
OpcuaNodeIdServicesVariableH_HAConfiguration_ServerTimestampSupported,
OpcuaNodeIdServicesVariableH_HAConfiguration_MaxTimeStoredValues,
OpcuaNodeIdServicesVariableH_HAConfiguration_MaxCountStoredValues,
}
}
func OpcuaNodeIdServicesVariableHByValue(value int32) (enum OpcuaNodeIdServicesVariableH, ok bool) {
switch value {
case 11204:
return OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_TreatUncertainAsBad, true
case 11205:
return OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_PercentDataBad, true
case 11206:
return OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_PercentDataGood, true
case 11207:
return OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_UseSlopedExtrapolation, true
case 11208:
return OpcuaNodeIdServicesVariableH_HAConfiguration_Stepped, true
case 11209:
return OpcuaNodeIdServicesVariableH_HAConfiguration_Definition, true
case 11210:
return OpcuaNodeIdServicesVariableH_HAConfiguration_MaxTimeInterval, true
case 11211:
return OpcuaNodeIdServicesVariableH_HAConfiguration_MinTimeInterval, true
case 11212:
return OpcuaNodeIdServicesVariableH_HAConfiguration_ExceptionDeviation, true
case 11213:
return OpcuaNodeIdServicesVariableH_HAConfiguration_ExceptionDeviationFormat, true
case 11503:
return OpcuaNodeIdServicesVariableH_HAConfiguration_StartOfArchive, true
case 11504:
return OpcuaNodeIdServicesVariableH_HAConfiguration_StartOfOnlineArchive, true
case 19093:
return OpcuaNodeIdServicesVariableH_HAConfiguration_ServerTimestampSupported, true
case 32635:
return OpcuaNodeIdServicesVariableH_HAConfiguration_MaxTimeStoredValues, true
case 32636:
return OpcuaNodeIdServicesVariableH_HAConfiguration_MaxCountStoredValues, true
}
return 0, false
}
func OpcuaNodeIdServicesVariableHByName(value string) (enum OpcuaNodeIdServicesVariableH, ok bool) {
switch value {
case "HAConfiguration_AggregateConfiguration_TreatUncertainAsBad":
return OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_TreatUncertainAsBad, true
case "HAConfiguration_AggregateConfiguration_PercentDataBad":
return OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_PercentDataBad, true
case "HAConfiguration_AggregateConfiguration_PercentDataGood":
return OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_PercentDataGood, true
case "HAConfiguration_AggregateConfiguration_UseSlopedExtrapolation":
return OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_UseSlopedExtrapolation, true
case "HAConfiguration_Stepped":
return OpcuaNodeIdServicesVariableH_HAConfiguration_Stepped, true
case "HAConfiguration_Definition":
return OpcuaNodeIdServicesVariableH_HAConfiguration_Definition, true
case "HAConfiguration_MaxTimeInterval":
return OpcuaNodeIdServicesVariableH_HAConfiguration_MaxTimeInterval, true
case "HAConfiguration_MinTimeInterval":
return OpcuaNodeIdServicesVariableH_HAConfiguration_MinTimeInterval, true
case "HAConfiguration_ExceptionDeviation":
return OpcuaNodeIdServicesVariableH_HAConfiguration_ExceptionDeviation, true
case "HAConfiguration_ExceptionDeviationFormat":
return OpcuaNodeIdServicesVariableH_HAConfiguration_ExceptionDeviationFormat, true
case "HAConfiguration_StartOfArchive":
return OpcuaNodeIdServicesVariableH_HAConfiguration_StartOfArchive, true
case "HAConfiguration_StartOfOnlineArchive":
return OpcuaNodeIdServicesVariableH_HAConfiguration_StartOfOnlineArchive, true
case "HAConfiguration_ServerTimestampSupported":
return OpcuaNodeIdServicesVariableH_HAConfiguration_ServerTimestampSupported, true
case "HAConfiguration_MaxTimeStoredValues":
return OpcuaNodeIdServicesVariableH_HAConfiguration_MaxTimeStoredValues, true
case "HAConfiguration_MaxCountStoredValues":
return OpcuaNodeIdServicesVariableH_HAConfiguration_MaxCountStoredValues, true
}
return 0, false
}
func OpcuaNodeIdServicesVariableHKnows(value int32) bool {
for _, typeValue := range OpcuaNodeIdServicesVariableHValues {
if int32(typeValue) == value {
return true
}
}
return false
}
func CastOpcuaNodeIdServicesVariableH(structType any) OpcuaNodeIdServicesVariableH {
castFunc := func(typ any) OpcuaNodeIdServicesVariableH {
if sOpcuaNodeIdServicesVariableH, ok := typ.(OpcuaNodeIdServicesVariableH); ok {
return sOpcuaNodeIdServicesVariableH
}
return 0
}
return castFunc(structType)
}
func (m OpcuaNodeIdServicesVariableH) GetLengthInBits(ctx context.Context) uint16 {
return 32
}
func (m OpcuaNodeIdServicesVariableH) GetLengthInBytes(ctx context.Context) uint16 {
return m.GetLengthInBits(ctx) / 8
}
func OpcuaNodeIdServicesVariableHParse(ctx context.Context, theBytes []byte) (OpcuaNodeIdServicesVariableH, error) {
return OpcuaNodeIdServicesVariableHParseWithBuffer(ctx, utils.NewReadBufferByteBased(theBytes))
}
func OpcuaNodeIdServicesVariableHParseWithBuffer(ctx context.Context, readBuffer utils.ReadBuffer) (OpcuaNodeIdServicesVariableH, error) {
log := zerolog.Ctx(ctx)
_ = log
val, err := readBuffer.ReadInt32("OpcuaNodeIdServicesVariableH", 32)
if err != nil {
return 0, errors.Wrap(err, "error reading OpcuaNodeIdServicesVariableH")
}
if enum, ok := OpcuaNodeIdServicesVariableHByValue(val); !ok {
log.Debug().Interface("val", val).Msg("no value val found for OpcuaNodeIdServicesVariableH")
return OpcuaNodeIdServicesVariableH(val), nil
} else {
return enum, nil
}
}
func (e OpcuaNodeIdServicesVariableH) Serialize() ([]byte, error) {
wb := utils.NewWriteBufferByteBased()
if err := e.SerializeWithWriteBuffer(context.Background(), wb); err != nil {
return nil, err
}
return wb.GetBytes(), nil
}
func (e OpcuaNodeIdServicesVariableH) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error {
log := zerolog.Ctx(ctx)
_ = log
return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableH", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName()))
}
// PLC4XEnumName returns the name that is used in code to identify this enum
func (e OpcuaNodeIdServicesVariableH) PLC4XEnumName() string {
switch e {
case OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_TreatUncertainAsBad:
return "HAConfiguration_AggregateConfiguration_TreatUncertainAsBad"
case OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_PercentDataBad:
return "HAConfiguration_AggregateConfiguration_PercentDataBad"
case OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_PercentDataGood:
return "HAConfiguration_AggregateConfiguration_PercentDataGood"
case OpcuaNodeIdServicesVariableH_HAConfiguration_AggregateConfiguration_UseSlopedExtrapolation:
return "HAConfiguration_AggregateConfiguration_UseSlopedExtrapolation"
case OpcuaNodeIdServicesVariableH_HAConfiguration_Stepped:
return "HAConfiguration_Stepped"
case OpcuaNodeIdServicesVariableH_HAConfiguration_Definition:
return "HAConfiguration_Definition"
case OpcuaNodeIdServicesVariableH_HAConfiguration_MaxTimeInterval:
return "HAConfiguration_MaxTimeInterval"
case OpcuaNodeIdServicesVariableH_HAConfiguration_MinTimeInterval:
return "HAConfiguration_MinTimeInterval"
case OpcuaNodeIdServicesVariableH_HAConfiguration_ExceptionDeviation:
return "HAConfiguration_ExceptionDeviation"
case OpcuaNodeIdServicesVariableH_HAConfiguration_ExceptionDeviationFormat:
return "HAConfiguration_ExceptionDeviationFormat"
case OpcuaNodeIdServicesVariableH_HAConfiguration_StartOfArchive:
return "HAConfiguration_StartOfArchive"
case OpcuaNodeIdServicesVariableH_HAConfiguration_StartOfOnlineArchive:
return "HAConfiguration_StartOfOnlineArchive"
case OpcuaNodeIdServicesVariableH_HAConfiguration_ServerTimestampSupported:
return "HAConfiguration_ServerTimestampSupported"
case OpcuaNodeIdServicesVariableH_HAConfiguration_MaxTimeStoredValues:
return "HAConfiguration_MaxTimeStoredValues"
case OpcuaNodeIdServicesVariableH_HAConfiguration_MaxCountStoredValues:
return "HAConfiguration_MaxCountStoredValues"
}
return fmt.Sprintf("Unknown(%v)", int32(e))
}
func (e OpcuaNodeIdServicesVariableH) String() string {
return e.PLC4XEnumName()
}