node-red-contrib-uos-nats 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +92 -0
  2. package/icons/white/datahub-input.svg +4 -0
  3. package/icons/white/datahub-output.svg +4 -0
  4. package/lib/auth.js +27 -0
  5. package/lib/config.js +23 -0
  6. package/lib/consumer.js +41 -0
  7. package/lib/fbs/weidmueller/ucontrol/hub/duration.js +67 -0
  8. package/lib/fbs/weidmueller/ucontrol/hub/provider-definition-changed-event.js +69 -0
  9. package/lib/fbs/weidmueller/ucontrol/hub/provider-definition-state.js +20 -0
  10. package/lib/fbs/weidmueller/ucontrol/hub/provider-definition.js +118 -0
  11. package/lib/fbs/weidmueller/ucontrol/hub/provider-list.js +76 -0
  12. package/lib/fbs/weidmueller/ucontrol/hub/provider.js +59 -0
  13. package/lib/fbs/weidmueller/ucontrol/hub/providers-changed-event.js +69 -0
  14. package/lib/fbs/weidmueller/ucontrol/hub/read-provider-definition-query-request.js +51 -0
  15. package/lib/fbs/weidmueller/ucontrol/hub/read-provider-definition-query-response.js +68 -0
  16. package/lib/fbs/weidmueller/ucontrol/hub/read-providers-query-request.js +51 -0
  17. package/lib/fbs/weidmueller/ucontrol/hub/read-providers-query-response.js +69 -0
  18. package/lib/fbs/weidmueller/ucontrol/hub/read-variables-query-request.js +88 -0
  19. package/lib/fbs/weidmueller/ucontrol/hub/read-variables-query-response.js +69 -0
  20. package/lib/fbs/weidmueller/ucontrol/hub/state-changed-event.js +67 -0
  21. package/lib/fbs/weidmueller/ucontrol/hub/state.js +14 -0
  22. package/lib/fbs/weidmueller/ucontrol/hub/timestamp.js +62 -0
  23. package/lib/fbs/weidmueller/ucontrol/hub/uuid.js +43 -0
  24. package/lib/fbs/weidmueller/ucontrol/hub/variable-access-type.js +17 -0
  25. package/lib/fbs/weidmueller/ucontrol/hub/variable-data-type.js +15 -0
  26. package/lib/fbs/weidmueller/ucontrol/hub/variable-definition.js +115 -0
  27. package/lib/fbs/weidmueller/ucontrol/hub/variable-list.js +106 -0
  28. package/lib/fbs/weidmueller/ucontrol/hub/variable-quality.js +31 -0
  29. package/lib/fbs/weidmueller/ucontrol/hub/variable-value-boolean.js +57 -0
  30. package/lib/fbs/weidmueller/ucontrol/hub/variable-value-duration.js +58 -0
  31. package/lib/fbs/weidmueller/ucontrol/hub/variable-value-float64.js +57 -0
  32. package/lib/fbs/weidmueller/ucontrol/hub/variable-value-int64.js +57 -0
  33. package/lib/fbs/weidmueller/ucontrol/hub/variable-value-string.js +58 -0
  34. package/lib/fbs/weidmueller/ucontrol/hub/variable-value-timestamp.js +58 -0
  35. package/lib/fbs/weidmueller/ucontrol/hub/variable-value.js +45 -0
  36. package/lib/fbs/weidmueller/ucontrol/hub/variable.js +131 -0
  37. package/lib/fbs/weidmueller/ucontrol/hub/variables-changed-event.js +71 -0
  38. package/lib/fbs/weidmueller/ucontrol/hub/write-variables-command.js +69 -0
  39. package/lib/fbs/weidmueller/ucontrol/hub.js +17 -0
  40. package/lib/models.js +1 -0
  41. package/lib/payloads.js +182 -0
  42. package/lib/provider.js +51 -0
  43. package/lib/simulation.js +54 -0
  44. package/lib/subjects.js +11 -0
  45. package/nodes/datahub-input.html +157 -0
  46. package/nodes/datahub-input.js +129 -0
  47. package/nodes/datahub-output.html +36 -0
  48. package/nodes/datahub-output.js +189 -0
  49. package/nodes/uos-config.html +48 -0
  50. package/nodes/uos-config.js +173 -0
  51. package/package.json +25 -0
@@ -0,0 +1,15 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ /**
4
+ * The data type of a variable.
5
+ */
6
+ export var VariableDataType;
7
+ (function (VariableDataType) {
8
+ VariableDataType[VariableDataType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
9
+ VariableDataType[VariableDataType["BOOLEAN"] = 1] = "BOOLEAN";
10
+ VariableDataType[VariableDataType["DURATION"] = 2] = "DURATION";
11
+ VariableDataType[VariableDataType["FLOAT64"] = 3] = "FLOAT64";
12
+ VariableDataType[VariableDataType["INT64"] = 4] = "INT64";
13
+ VariableDataType[VariableDataType["STRING"] = 5] = "STRING";
14
+ VariableDataType[VariableDataType["TIMESTAMP"] = 6] = "TIMESTAMP";
15
+ })(VariableDataType || (VariableDataType = {}));
@@ -0,0 +1,115 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ import * as flatbuffers from 'flatbuffers';
4
+ import { VariableAccessType } from '../../../weidmueller/ucontrol/hub/variable-access-type.js';
5
+ import { VariableDataType } from '../../../weidmueller/ucontrol/hub/variable-data-type.js';
6
+ /**
7
+ * The definition of a variable.
8
+ */
9
+ export class VariableDefinition {
10
+ constructor() {
11
+ this.bb = null;
12
+ this.bb_pos = 0;
13
+ }
14
+ __init(i, bb) {
15
+ this.bb_pos = i;
16
+ this.bb = bb;
17
+ return this;
18
+ }
19
+ static getRootAsVariableDefinition(bb, obj) {
20
+ return (obj || new VariableDefinition()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21
+ }
22
+ static getSizePrefixedRootAsVariableDefinition(bb, obj) {
23
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
24
+ return (obj || new VariableDefinition()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
25
+ }
26
+ key(optionalEncoding) {
27
+ const offset = this.bb.__offset(this.bb_pos, 4);
28
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
29
+ }
30
+ /**
31
+ * The unique ID of the variable. It is only unique via one provider.
32
+ */
33
+ id() {
34
+ const offset = this.bb.__offset(this.bb_pos, 6);
35
+ return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
36
+ }
37
+ /**
38
+ * The data type of the variable.
39
+ */
40
+ dataType() {
41
+ const offset = this.bb.__offset(this.bb_pos, 8);
42
+ return offset ? this.bb.readInt8(this.bb_pos + offset) : VariableDataType.UNSPECIFIED;
43
+ }
44
+ /**
45
+ * The access type of the variable.
46
+ */
47
+ accessType() {
48
+ const offset = this.bb.__offset(this.bb_pos, 10);
49
+ return offset ? this.bb.readInt8(this.bb_pos + offset) : VariableAccessType.UNSPECIFIED;
50
+ }
51
+ /**
52
+ * Marker to indicate whether the variable is experimental.
53
+ *
54
+ * Experimental means that the variable is not stable/reliable and it is hidden in the user interface.
55
+ */
56
+ experimental() {
57
+ const offset = this.bb.__offset(this.bb_pos, 12);
58
+ return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
59
+ }
60
+ static startVariableDefinition(builder) {
61
+ builder.startObject(5);
62
+ }
63
+ static addKey(builder, keyOffset) {
64
+ builder.addFieldOffset(0, keyOffset, 0);
65
+ }
66
+ static addId(builder, id) {
67
+ builder.addFieldInt32(1, id, 0);
68
+ }
69
+ static addDataType(builder, dataType) {
70
+ builder.addFieldInt8(2, dataType, VariableDataType.UNSPECIFIED);
71
+ }
72
+ static addAccessType(builder, accessType) {
73
+ builder.addFieldInt8(3, accessType, VariableAccessType.UNSPECIFIED);
74
+ }
75
+ static addExperimental(builder, experimental) {
76
+ builder.addFieldInt8(4, +experimental, +false);
77
+ }
78
+ static endVariableDefinition(builder) {
79
+ const offset = builder.endObject();
80
+ builder.requiredField(offset, 4); // key
81
+ return offset;
82
+ }
83
+ static createVariableDefinition(builder, keyOffset, id, dataType, accessType, experimental) {
84
+ VariableDefinition.startVariableDefinition(builder);
85
+ VariableDefinition.addKey(builder, keyOffset);
86
+ VariableDefinition.addId(builder, id);
87
+ VariableDefinition.addDataType(builder, dataType);
88
+ VariableDefinition.addAccessType(builder, accessType);
89
+ VariableDefinition.addExperimental(builder, experimental);
90
+ return VariableDefinition.endVariableDefinition(builder);
91
+ }
92
+ unpack() {
93
+ return new VariableDefinitionT(this.key(), this.id(), this.dataType(), this.accessType(), this.experimental());
94
+ }
95
+ unpackTo(_o) {
96
+ _o.key = this.key();
97
+ _o.id = this.id();
98
+ _o.dataType = this.dataType();
99
+ _o.accessType = this.accessType();
100
+ _o.experimental = this.experimental();
101
+ }
102
+ }
103
+ export class VariableDefinitionT {
104
+ constructor(key = null, id = 0, dataType = VariableDataType.UNSPECIFIED, accessType = VariableAccessType.UNSPECIFIED, experimental = false) {
105
+ this.key = key;
106
+ this.id = id;
107
+ this.dataType = dataType;
108
+ this.accessType = accessType;
109
+ this.experimental = experimental;
110
+ }
111
+ pack(builder) {
112
+ const key = (this.key !== null ? builder.createString(this.key) : 0);
113
+ return VariableDefinition.createVariableDefinition(builder, key, this.id, this.dataType, this.accessType, this.experimental);
114
+ }
115
+ }
@@ -0,0 +1,106 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ import * as flatbuffers from 'flatbuffers';
4
+ import { Timestamp } from '../../../weidmueller/ucontrol/hub/timestamp.js';
5
+ import { Variable } from '../../../weidmueller/ucontrol/hub/variable.js';
6
+ /**
7
+ * A list of a provider's variables that match the provider's definition.
8
+ */
9
+ export class VariableList {
10
+ constructor() {
11
+ this.bb = null;
12
+ this.bb_pos = 0;
13
+ }
14
+ __init(i, bb) {
15
+ this.bb_pos = i;
16
+ this.bb = bb;
17
+ return this;
18
+ }
19
+ static getRootAsVariableList(bb, obj) {
20
+ return (obj || new VariableList()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21
+ }
22
+ static getSizePrefixedRootAsVariableList(bb, obj) {
23
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
24
+ return (obj || new VariableList()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
25
+ }
26
+ /**
27
+ * The fingerprint of the associated provider's definition.
28
+ */
29
+ providerDefinitionFingerprint() {
30
+ const offset = this.bb.__offset(this.bb_pos, 4);
31
+ return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
32
+ }
33
+ /**
34
+ * The timestamp for all changed variables. The base timestamp is the
35
+ * fallback if no explicit was specified for the variable.
36
+ *
37
+ * Only set by the provider!
38
+ * Consumers can set it to 0s and 0ns. This value is ignored by the
39
+ * provider in a write command.
40
+ */
41
+ baseTimestamp(obj) {
42
+ const offset = this.bb.__offset(this.bb_pos, 6);
43
+ return offset ? (obj || new Timestamp()).__init(this.bb_pos + offset, this.bb) : null;
44
+ }
45
+ /**
46
+ * The items of the provider's variable list.
47
+ */
48
+ items(index, obj) {
49
+ const offset = this.bb.__offset(this.bb_pos, 8);
50
+ return offset ? (obj || new Variable()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
51
+ }
52
+ itemsLength() {
53
+ const offset = this.bb.__offset(this.bb_pos, 8);
54
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
55
+ }
56
+ static startVariableList(builder) {
57
+ builder.startObject(3);
58
+ }
59
+ static addProviderDefinitionFingerprint(builder, providerDefinitionFingerprint) {
60
+ builder.addFieldInt64(0, providerDefinitionFingerprint, BigInt('0'));
61
+ }
62
+ static addBaseTimestamp(builder, baseTimestampOffset) {
63
+ builder.addFieldStruct(1, baseTimestampOffset, 0);
64
+ }
65
+ static addItems(builder, itemsOffset) {
66
+ builder.addFieldOffset(2, itemsOffset, 0);
67
+ }
68
+ static createItemsVector(builder, data) {
69
+ builder.startVector(4, data.length, 4);
70
+ for (let i = data.length - 1; i >= 0; i--) {
71
+ builder.addOffset(data[i]);
72
+ }
73
+ return builder.endVector();
74
+ }
75
+ static startItemsVector(builder, numElems) {
76
+ builder.startVector(4, numElems, 4);
77
+ }
78
+ static endVariableList(builder) {
79
+ const offset = builder.endObject();
80
+ builder.requiredField(offset, 6); // base_timestamp
81
+ return offset;
82
+ }
83
+ unpack() {
84
+ return new VariableListT(this.providerDefinitionFingerprint(), (this.baseTimestamp() !== null ? this.baseTimestamp().unpack() : null), this.bb.createObjList(this.items.bind(this), this.itemsLength()));
85
+ }
86
+ unpackTo(_o) {
87
+ _o.providerDefinitionFingerprint = this.providerDefinitionFingerprint();
88
+ _o.baseTimestamp = (this.baseTimestamp() !== null ? this.baseTimestamp().unpack() : null);
89
+ _o.items = this.bb.createObjList(this.items.bind(this), this.itemsLength());
90
+ }
91
+ }
92
+ export class VariableListT {
93
+ constructor(providerDefinitionFingerprint = BigInt('0'), baseTimestamp = null, items = []) {
94
+ this.providerDefinitionFingerprint = providerDefinitionFingerprint;
95
+ this.baseTimestamp = baseTimestamp;
96
+ this.items = items;
97
+ }
98
+ pack(builder) {
99
+ const items = VariableList.createItemsVector(builder, builder.createObjectOffsetList(this.items));
100
+ VariableList.startVariableList(builder);
101
+ VariableList.addProviderDefinitionFingerprint(builder, this.providerDefinitionFingerprint);
102
+ VariableList.addBaseTimestamp(builder, (this.baseTimestamp !== null ? this.baseTimestamp.pack(builder) : 0));
103
+ VariableList.addItems(builder, items);
104
+ return VariableList.endVariableList(builder);
105
+ }
106
+ }
@@ -0,0 +1,31 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ /**
4
+ * The quality of a variable.
5
+ *
6
+ * This is set by the provider and indicates the quality of a variable value.
7
+ * Check the documentation of the individual values for more information.
8
+ */
9
+ export var VariableQuality;
10
+ (function (VariableQuality) {
11
+ /**
12
+ * Indicates that the value is not usable
13
+ */
14
+ VariableQuality[VariableQuality["BAD"] = 0] = "BAD";
15
+ /**
16
+ * Variable quality is uncertain without any specific reason, but may still be usable e.g. for display or other non critical purposes
17
+ */
18
+ VariableQuality[VariableQuality["UNCERTAIN"] = 64] = "UNCERTAIN";
19
+ /**
20
+ * The variable has stopped updating and contains its last usable value
21
+ */
22
+ VariableQuality[VariableQuality["UNCERTAIN_LAST_USABLE_VALUE"] = 67] = "UNCERTAIN_LAST_USABLE_VALUE";
23
+ /**
24
+ * Variable has not been written yet and still contains a default initial value
25
+ */
26
+ VariableQuality[VariableQuality["UNCERTAIN_INITIAL_VALUE"] = 68] = "UNCERTAIN_INITIAL_VALUE";
27
+ /**
28
+ * Indicates that the value is good and can be used without restrictions
29
+ */
30
+ VariableQuality[VariableQuality["GOOD"] = 192] = "GOOD";
31
+ })(VariableQuality || (VariableQuality = {}));
@@ -0,0 +1,57 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ import * as flatbuffers from 'flatbuffers';
4
+ /**
5
+ * A boolean value of a variable.
6
+ */
7
+ export class VariableValueBoolean {
8
+ constructor() {
9
+ this.bb = null;
10
+ this.bb_pos = 0;
11
+ }
12
+ __init(i, bb) {
13
+ this.bb_pos = i;
14
+ this.bb = bb;
15
+ return this;
16
+ }
17
+ static getRootAsVariableValueBoolean(bb, obj) {
18
+ return (obj || new VariableValueBoolean()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
19
+ }
20
+ static getSizePrefixedRootAsVariableValueBoolean(bb, obj) {
21
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
22
+ return (obj || new VariableValueBoolean()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
23
+ }
24
+ value() {
25
+ const offset = this.bb.__offset(this.bb_pos, 4);
26
+ return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
27
+ }
28
+ static startVariableValueBoolean(builder) {
29
+ builder.startObject(1);
30
+ }
31
+ static addValue(builder, value) {
32
+ builder.addFieldInt8(0, +value, +false);
33
+ }
34
+ static endVariableValueBoolean(builder) {
35
+ const offset = builder.endObject();
36
+ return offset;
37
+ }
38
+ static createVariableValueBoolean(builder, value) {
39
+ VariableValueBoolean.startVariableValueBoolean(builder);
40
+ VariableValueBoolean.addValue(builder, value);
41
+ return VariableValueBoolean.endVariableValueBoolean(builder);
42
+ }
43
+ unpack() {
44
+ return new VariableValueBooleanT(this.value());
45
+ }
46
+ unpackTo(_o) {
47
+ _o.value = this.value();
48
+ }
49
+ }
50
+ export class VariableValueBooleanT {
51
+ constructor(value = false) {
52
+ this.value = value;
53
+ }
54
+ pack(builder) {
55
+ return VariableValueBoolean.createVariableValueBoolean(builder, this.value);
56
+ }
57
+ }
@@ -0,0 +1,58 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ import * as flatbuffers from 'flatbuffers';
4
+ import { Duration } from '../../../weidmueller/ucontrol/hub/duration.js';
5
+ /**
6
+ * A duration value of a variable.
7
+ */
8
+ export class VariableValueDuration {
9
+ constructor() {
10
+ this.bb = null;
11
+ this.bb_pos = 0;
12
+ }
13
+ __init(i, bb) {
14
+ this.bb_pos = i;
15
+ this.bb = bb;
16
+ return this;
17
+ }
18
+ static getRootAsVariableValueDuration(bb, obj) {
19
+ return (obj || new VariableValueDuration()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
20
+ }
21
+ static getSizePrefixedRootAsVariableValueDuration(bb, obj) {
22
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
23
+ return (obj || new VariableValueDuration()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
24
+ }
25
+ value(obj) {
26
+ const offset = this.bb.__offset(this.bb_pos, 4);
27
+ return offset ? (obj || new Duration()).__init(this.bb_pos + offset, this.bb) : null;
28
+ }
29
+ static startVariableValueDuration(builder) {
30
+ builder.startObject(1);
31
+ }
32
+ static addValue(builder, valueOffset) {
33
+ builder.addFieldStruct(0, valueOffset, 0);
34
+ }
35
+ static endVariableValueDuration(builder) {
36
+ const offset = builder.endObject();
37
+ return offset;
38
+ }
39
+ static createVariableValueDuration(builder, valueOffset) {
40
+ VariableValueDuration.startVariableValueDuration(builder);
41
+ VariableValueDuration.addValue(builder, valueOffset);
42
+ return VariableValueDuration.endVariableValueDuration(builder);
43
+ }
44
+ unpack() {
45
+ return new VariableValueDurationT((this.value() !== null ? this.value().unpack() : null));
46
+ }
47
+ unpackTo(_o) {
48
+ _o.value = (this.value() !== null ? this.value().unpack() : null);
49
+ }
50
+ }
51
+ export class VariableValueDurationT {
52
+ constructor(value = null) {
53
+ this.value = value;
54
+ }
55
+ pack(builder) {
56
+ return VariableValueDuration.createVariableValueDuration(builder, (this.value !== null ? this.value.pack(builder) : 0));
57
+ }
58
+ }
@@ -0,0 +1,57 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ import * as flatbuffers from 'flatbuffers';
4
+ /**
5
+ * A precision floating-point value of a variable.
6
+ */
7
+ export class VariableValueFloat64 {
8
+ constructor() {
9
+ this.bb = null;
10
+ this.bb_pos = 0;
11
+ }
12
+ __init(i, bb) {
13
+ this.bb_pos = i;
14
+ this.bb = bb;
15
+ return this;
16
+ }
17
+ static getRootAsVariableValueFloat64(bb, obj) {
18
+ return (obj || new VariableValueFloat64()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
19
+ }
20
+ static getSizePrefixedRootAsVariableValueFloat64(bb, obj) {
21
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
22
+ return (obj || new VariableValueFloat64()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
23
+ }
24
+ value() {
25
+ const offset = this.bb.__offset(this.bb_pos, 4);
26
+ return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
27
+ }
28
+ static startVariableValueFloat64(builder) {
29
+ builder.startObject(1);
30
+ }
31
+ static addValue(builder, value) {
32
+ builder.addFieldFloat64(0, value, 0.0);
33
+ }
34
+ static endVariableValueFloat64(builder) {
35
+ const offset = builder.endObject();
36
+ return offset;
37
+ }
38
+ static createVariableValueFloat64(builder, value) {
39
+ VariableValueFloat64.startVariableValueFloat64(builder);
40
+ VariableValueFloat64.addValue(builder, value);
41
+ return VariableValueFloat64.endVariableValueFloat64(builder);
42
+ }
43
+ unpack() {
44
+ return new VariableValueFloat64T(this.value());
45
+ }
46
+ unpackTo(_o) {
47
+ _o.value = this.value();
48
+ }
49
+ }
50
+ export class VariableValueFloat64T {
51
+ constructor(value = 0.0) {
52
+ this.value = value;
53
+ }
54
+ pack(builder) {
55
+ return VariableValueFloat64.createVariableValueFloat64(builder, this.value);
56
+ }
57
+ }
@@ -0,0 +1,57 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ import * as flatbuffers from 'flatbuffers';
4
+ /**
5
+ * A 64-bit, signed integer value of a variable.
6
+ */
7
+ export class VariableValueInt64 {
8
+ constructor() {
9
+ this.bb = null;
10
+ this.bb_pos = 0;
11
+ }
12
+ __init(i, bb) {
13
+ this.bb_pos = i;
14
+ this.bb = bb;
15
+ return this;
16
+ }
17
+ static getRootAsVariableValueInt64(bb, obj) {
18
+ return (obj || new VariableValueInt64()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
19
+ }
20
+ static getSizePrefixedRootAsVariableValueInt64(bb, obj) {
21
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
22
+ return (obj || new VariableValueInt64()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
23
+ }
24
+ value() {
25
+ const offset = this.bb.__offset(this.bb_pos, 4);
26
+ return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
27
+ }
28
+ static startVariableValueInt64(builder) {
29
+ builder.startObject(1);
30
+ }
31
+ static addValue(builder, value) {
32
+ builder.addFieldInt64(0, value, BigInt('0'));
33
+ }
34
+ static endVariableValueInt64(builder) {
35
+ const offset = builder.endObject();
36
+ return offset;
37
+ }
38
+ static createVariableValueInt64(builder, value) {
39
+ VariableValueInt64.startVariableValueInt64(builder);
40
+ VariableValueInt64.addValue(builder, value);
41
+ return VariableValueInt64.endVariableValueInt64(builder);
42
+ }
43
+ unpack() {
44
+ return new VariableValueInt64T(this.value());
45
+ }
46
+ unpackTo(_o) {
47
+ _o.value = this.value();
48
+ }
49
+ }
50
+ export class VariableValueInt64T {
51
+ constructor(value = BigInt('0')) {
52
+ this.value = value;
53
+ }
54
+ pack(builder) {
55
+ return VariableValueInt64.createVariableValueInt64(builder, this.value);
56
+ }
57
+ }
@@ -0,0 +1,58 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ import * as flatbuffers from 'flatbuffers';
4
+ /**
5
+ * A string value of a variable.
6
+ */
7
+ export class VariableValueString {
8
+ constructor() {
9
+ this.bb = null;
10
+ this.bb_pos = 0;
11
+ }
12
+ __init(i, bb) {
13
+ this.bb_pos = i;
14
+ this.bb = bb;
15
+ return this;
16
+ }
17
+ static getRootAsVariableValueString(bb, obj) {
18
+ return (obj || new VariableValueString()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
19
+ }
20
+ static getSizePrefixedRootAsVariableValueString(bb, obj) {
21
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
22
+ return (obj || new VariableValueString()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
23
+ }
24
+ value(optionalEncoding) {
25
+ const offset = this.bb.__offset(this.bb_pos, 4);
26
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
27
+ }
28
+ static startVariableValueString(builder) {
29
+ builder.startObject(1);
30
+ }
31
+ static addValue(builder, valueOffset) {
32
+ builder.addFieldOffset(0, valueOffset, 0);
33
+ }
34
+ static endVariableValueString(builder) {
35
+ const offset = builder.endObject();
36
+ return offset;
37
+ }
38
+ static createVariableValueString(builder, valueOffset) {
39
+ VariableValueString.startVariableValueString(builder);
40
+ VariableValueString.addValue(builder, valueOffset);
41
+ return VariableValueString.endVariableValueString(builder);
42
+ }
43
+ unpack() {
44
+ return new VariableValueStringT(this.value());
45
+ }
46
+ unpackTo(_o) {
47
+ _o.value = this.value();
48
+ }
49
+ }
50
+ export class VariableValueStringT {
51
+ constructor(value = null) {
52
+ this.value = value;
53
+ }
54
+ pack(builder) {
55
+ const value = (this.value !== null ? builder.createString(this.value) : 0);
56
+ return VariableValueString.createVariableValueString(builder, value);
57
+ }
58
+ }
@@ -0,0 +1,58 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ import * as flatbuffers from 'flatbuffers';
4
+ import { Timestamp } from '../../../weidmueller/ucontrol/hub/timestamp.js';
5
+ /**
6
+ * A date and time value of a variable.
7
+ */
8
+ export class VariableValueTimestamp {
9
+ constructor() {
10
+ this.bb = null;
11
+ this.bb_pos = 0;
12
+ }
13
+ __init(i, bb) {
14
+ this.bb_pos = i;
15
+ this.bb = bb;
16
+ return this;
17
+ }
18
+ static getRootAsVariableValueTimestamp(bb, obj) {
19
+ return (obj || new VariableValueTimestamp()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
20
+ }
21
+ static getSizePrefixedRootAsVariableValueTimestamp(bb, obj) {
22
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
23
+ return (obj || new VariableValueTimestamp()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
24
+ }
25
+ value(obj) {
26
+ const offset = this.bb.__offset(this.bb_pos, 4);
27
+ return offset ? (obj || new Timestamp()).__init(this.bb_pos + offset, this.bb) : null;
28
+ }
29
+ static startVariableValueTimestamp(builder) {
30
+ builder.startObject(1);
31
+ }
32
+ static addValue(builder, valueOffset) {
33
+ builder.addFieldStruct(0, valueOffset, 0);
34
+ }
35
+ static endVariableValueTimestamp(builder) {
36
+ const offset = builder.endObject();
37
+ return offset;
38
+ }
39
+ static createVariableValueTimestamp(builder, valueOffset) {
40
+ VariableValueTimestamp.startVariableValueTimestamp(builder);
41
+ VariableValueTimestamp.addValue(builder, valueOffset);
42
+ return VariableValueTimestamp.endVariableValueTimestamp(builder);
43
+ }
44
+ unpack() {
45
+ return new VariableValueTimestampT((this.value() !== null ? this.value().unpack() : null));
46
+ }
47
+ unpackTo(_o) {
48
+ _o.value = (this.value() !== null ? this.value().unpack() : null);
49
+ }
50
+ }
51
+ export class VariableValueTimestampT {
52
+ constructor(value = null) {
53
+ this.value = value;
54
+ }
55
+ pack(builder) {
56
+ return VariableValueTimestamp.createVariableValueTimestamp(builder, (this.value !== null ? this.value.pack(builder) : 0));
57
+ }
58
+ }
@@ -0,0 +1,45 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3
+ import { VariableValueBoolean } from '../../../weidmueller/ucontrol/hub/variable-value-boolean.js';
4
+ import { VariableValueDuration } from '../../../weidmueller/ucontrol/hub/variable-value-duration.js';
5
+ import { VariableValueFloat64 } from '../../../weidmueller/ucontrol/hub/variable-value-float64.js';
6
+ import { VariableValueInt64 } from '../../../weidmueller/ucontrol/hub/variable-value-int64.js';
7
+ import { VariableValueString } from '../../../weidmueller/ucontrol/hub/variable-value-string.js';
8
+ import { VariableValueTimestamp } from '../../../weidmueller/ucontrol/hub/variable-value-timestamp.js';
9
+ /**
10
+ * The value of a variable.
11
+ */
12
+ export var VariableValue;
13
+ (function (VariableValue) {
14
+ VariableValue[VariableValue["NONE"] = 0] = "NONE";
15
+ VariableValue[VariableValue["Boolean"] = 1] = "Boolean";
16
+ VariableValue[VariableValue["Duration"] = 2] = "Duration";
17
+ VariableValue[VariableValue["Float64"] = 3] = "Float64";
18
+ VariableValue[VariableValue["Int64"] = 4] = "Int64";
19
+ VariableValue[VariableValue["String"] = 5] = "String";
20
+ VariableValue[VariableValue["Timestamp"] = 6] = "Timestamp";
21
+ })(VariableValue || (VariableValue = {}));
22
+ export function unionToVariableValue(type, accessor) {
23
+ switch (VariableValue[type]) {
24
+ case 'NONE': return null;
25
+ case 'Boolean': return accessor(new VariableValueBoolean());
26
+ case 'Duration': return accessor(new VariableValueDuration());
27
+ case 'Float64': return accessor(new VariableValueFloat64());
28
+ case 'Int64': return accessor(new VariableValueInt64());
29
+ case 'String': return accessor(new VariableValueString());
30
+ case 'Timestamp': return accessor(new VariableValueTimestamp());
31
+ default: return null;
32
+ }
33
+ }
34
+ export function unionListToVariableValue(type, accessor, index) {
35
+ switch (VariableValue[type]) {
36
+ case 'NONE': return null;
37
+ case 'Boolean': return accessor(index, new VariableValueBoolean());
38
+ case 'Duration': return accessor(index, new VariableValueDuration());
39
+ case 'Float64': return accessor(index, new VariableValueFloat64());
40
+ case 'Int64': return accessor(index, new VariableValueInt64());
41
+ case 'String': return accessor(index, new VariableValueString());
42
+ case 'Timestamp': return accessor(index, new VariableValueTimestamp());
43
+ default: return null;
44
+ }
45
+ }