@bitpoolos/edge-bacnet 1.2.6 → 1.2.8
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.
- package/bacnet_client.js +1852 -1373
- package/bacnet_device.js +52 -0
- package/bacnet_gateway.html +38 -3
- package/bacnet_gateway.js +95 -37
- package/bacnet_read.html +53 -33
- package/bacnet_read.js +8 -2
- package/bacnet_write.html +733 -668
- package/bacnet_write.js +1 -1
- package/common.js +17 -7
- package/package.json +1 -1
- package/resources/icons/icon-read.svg +19 -0
- package/resources/icons/icon-write.svg +16 -0
- package/resources/node-bacstack-ts/dist/lib/client.js +3 -3
- package/resources/style.css +11 -0
package/bacnet_write.html
CHANGED
|
@@ -3,691 +3,756 @@
|
|
|
3
3
|
-->
|
|
4
4
|
|
|
5
5
|
<script type="text/javascript">
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
RED.nodes.registerType("Bacnet-Write", {
|
|
7
|
+
category: "Bitpool BACnet",
|
|
8
|
+
color: "#00aeef",
|
|
9
|
+
defaults: {
|
|
10
|
+
name: { value: "" },
|
|
11
|
+
applicationTag: { value: "4" },
|
|
12
|
+
priority: { value: "16" },
|
|
13
|
+
pointsToWrite: { value: [] },
|
|
14
|
+
writeDevices: { value: [] },
|
|
15
|
+
hiddenDeployToggle: { value: false },
|
|
16
|
+
prevHiddenToggleState: { value: false },
|
|
17
|
+
},
|
|
18
|
+
inputs: 1,
|
|
19
|
+
outputs: 1,
|
|
20
|
+
icon: "bitpool.svg",
|
|
21
|
+
label: function () {
|
|
22
|
+
return "write";
|
|
23
|
+
},
|
|
24
|
+
paletteLabel: function () {
|
|
25
|
+
return "write";
|
|
26
|
+
},
|
|
27
|
+
oneditprepare: function () {
|
|
28
|
+
let node = this;
|
|
29
|
+
|
|
30
|
+
node.prevHiddenToggleState = node.hiddenDeployToggle;
|
|
31
|
+
|
|
32
|
+
const { createApp, ref, onMounted } = Vue;
|
|
33
|
+
|
|
34
|
+
//prime vue app
|
|
35
|
+
const App = {
|
|
36
|
+
data() {
|
|
37
|
+
return {
|
|
38
|
+
devices: ref(),
|
|
39
|
+
writeDevices: ref(),
|
|
40
|
+
deviceList: ref(),
|
|
41
|
+
pointList: ref(),
|
|
42
|
+
pointsToWrite: ref([]),
|
|
43
|
+
nodeService: ref(new NodeService()),
|
|
44
|
+
deviceCount: ref(),
|
|
45
|
+
};
|
|
18
46
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
47
|
+
setup() {
|
|
48
|
+
let pointList;
|
|
49
|
+
let deviceList;
|
|
50
|
+
const selectedKeys = ref(null);
|
|
51
|
+
const nodes = ref();
|
|
52
|
+
const expandedKeys = ref({});
|
|
53
|
+
|
|
54
|
+
const expandAll = () => {
|
|
55
|
+
for (let node of devices.value) {
|
|
56
|
+
expandNode(node);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
expandedKeys.value = { ...expandedKeys.value };
|
|
60
|
+
};
|
|
61
|
+
const collapseAll = () => {
|
|
62
|
+
expandedKeys.value = {};
|
|
63
|
+
};
|
|
64
|
+
const expandNode = (node) => {
|
|
65
|
+
if (node.children && node.children.length) {
|
|
66
|
+
expandedKeys.value[node.key] = true;
|
|
67
|
+
|
|
68
|
+
for (let child of node.children) {
|
|
69
|
+
expandNode(child);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
nodes,
|
|
76
|
+
expandedKeys,
|
|
77
|
+
expandAll,
|
|
78
|
+
collapseAll,
|
|
79
|
+
expandNode,
|
|
80
|
+
};
|
|
24
81
|
},
|
|
25
|
-
|
|
26
|
-
|
|
82
|
+
mounted() {
|
|
83
|
+
this.getData();
|
|
27
84
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
setup() {
|
|
50
|
-
let pointList;
|
|
51
|
-
let deviceList;
|
|
52
|
-
const selectedKeys = ref(null);
|
|
53
|
-
const nodes = ref();
|
|
54
|
-
const expandedKeys = ref({});
|
|
55
|
-
|
|
56
|
-
const expandAll = () => {
|
|
57
|
-
for (let node of devices.value) {
|
|
58
|
-
expandNode(node);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
expandedKeys.value = {...expandedKeys.value};
|
|
62
|
-
};
|
|
63
|
-
const collapseAll = () => {
|
|
64
|
-
expandedKeys.value = {};
|
|
65
|
-
};
|
|
66
|
-
const expandNode = (node) => {
|
|
67
|
-
if (node.children && node.children.length) {
|
|
68
|
-
expandedKeys.value[node.key] = true;
|
|
69
|
-
|
|
70
|
-
for (let child of node.children) {
|
|
71
|
-
expandNode(child);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
nodes,
|
|
78
|
-
expandedKeys,
|
|
79
|
-
expandAll,
|
|
80
|
-
collapseAll,
|
|
81
|
-
expandNode,
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
mounted() {
|
|
85
|
-
this.getData();
|
|
86
|
-
},
|
|
87
|
-
methods: {
|
|
88
|
-
getData() {
|
|
89
|
-
let app = this;
|
|
90
|
-
this.nodeService.getNetworkData().then(function (result) {
|
|
91
|
-
app.devices = result.renderList;
|
|
92
|
-
app.deviceList = result.deviceList;
|
|
93
|
-
app.pointList = result.pointList;
|
|
94
|
-
app.pollFrequency = parseInt(result.pollFrequency);
|
|
95
|
-
app.deviceCount = result.deviceList.length;
|
|
96
|
-
});
|
|
97
|
-
},
|
|
98
|
-
addAllClicked(slotProps) {
|
|
99
|
-
let app = this;
|
|
100
|
-
//update UI
|
|
101
|
-
if (this.writeDevices) {
|
|
102
|
-
let foundIndex = this.writeDevices.findIndex(ele => ele.key == slotProps.node.key && ele.label == slotProps.node.label);
|
|
103
|
-
if (foundIndex == -1) this.writeDevices.push(slotProps.node);
|
|
104
|
-
} else {
|
|
105
|
-
this.writeDevices = [slotProps.node];
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
this.$forceUpdate()
|
|
109
|
-
|
|
110
|
-
//update node-red data structure to forward to gateway
|
|
111
|
-
let device = this.deviceList.find(ele => {
|
|
112
|
-
if(ele.address.address) {
|
|
113
|
-
return ele.address.address == slotProps.node.ipAddr && ele.deviceId == slotProps.node.deviceId;
|
|
114
|
-
} else{
|
|
115
|
-
return ele.address == slotProps.node.ipAddr && ele.deviceId == slotProps.node.deviceId;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
let deviceAddress = app.getDeviceAddress(device.address);
|
|
119
|
-
let key = `${deviceAddress}-${device.deviceId}`;
|
|
120
|
-
let points = this.pointList[key];
|
|
121
|
-
|
|
122
|
-
if (!this.pointsToWrite[key] || typeof this.pointsToWrite[key] == 'undefined') {
|
|
123
|
-
this.pointsToWrite[key] = {};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
for (let pointName in points) {
|
|
127
|
-
let point = this.pointList[key][pointName];
|
|
128
|
-
this.pointsToWrite[key][point.objectName] = point;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
//force a deploy state
|
|
132
|
-
node.hiddenDeployToggle = !node.prevHiddenToggleState;
|
|
133
|
-
},
|
|
134
|
-
removeAllClicked(slotProps) {
|
|
135
|
-
let app = this;
|
|
136
|
-
//update UI
|
|
137
|
-
if (this.writeDevices.length > 0) {
|
|
138
|
-
let foundIndex = this.writeDevices.findIndex(ele => ele.key == slotProps.node.key && ele.label == slotProps.node.label);
|
|
139
|
-
if (foundIndex !== -1) this.writeDevices.splice(foundIndex, 1);
|
|
140
|
-
}
|
|
141
|
-
this.$forceUpdate()
|
|
142
|
-
|
|
143
|
-
//update node-red data structure
|
|
144
|
-
let device = this.deviceList.find(ele => {
|
|
145
|
-
if(ele.address.address) {
|
|
146
|
-
return ele.address.address == slotProps.node.ipAddr && ele.deviceId == slotProps.node.deviceId;
|
|
147
|
-
} else{
|
|
148
|
-
return ele.address == slotProps.node.ipAddr && ele.deviceId == slotProps.node.deviceId;
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
let deviceAddress = app.getDeviceAddress(device.address);
|
|
152
|
-
let key = `${deviceAddress}-${device.deviceId}`;
|
|
153
|
-
if (this.pointsToWrite[key]) {
|
|
154
|
-
delete this.pointsToWrite[key];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
//force a deploy state
|
|
158
|
-
node.hiddenDeployToggle = !node.prevHiddenToggleState;
|
|
159
|
-
},
|
|
160
|
-
addPointClicked(slotProps) {
|
|
161
|
-
let app = this;
|
|
162
|
-
//update UI
|
|
163
|
-
let parentDeviceName = slotProps.node.parentDevice;
|
|
164
|
-
let foundDeviceIndex = this.writeDevices ? this.writeDevices.findIndex(ele => ele.label == parentDeviceName) : -1;
|
|
165
|
-
let parentDevice = this.devices.find(ele => ele.label == parentDeviceName);
|
|
166
|
-
|
|
167
|
-
if (foundDeviceIndex == -1) {
|
|
168
|
-
//no read devices present, add new
|
|
169
|
-
let newReadParent = {...parentDevice};
|
|
170
|
-
newReadParent.children = [];
|
|
171
|
-
newReadParent.children.push(slotProps.node);
|
|
172
|
-
|
|
173
|
-
if (this.writeDevices) {
|
|
174
|
-
this.writeDevices.push(newReadParent);
|
|
175
|
-
} else {
|
|
176
|
-
this.writeDevices = [newReadParent];
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
} else {
|
|
180
|
-
// read device found, add point to existing
|
|
181
|
-
this.writeDevices[foundDeviceIndex].children.push(slotProps.node);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
slotProps.node.showAdded = true;
|
|
185
|
-
|
|
186
|
-
this.$forceUpdate();
|
|
187
|
-
|
|
188
|
-
//update node-red data structure
|
|
189
|
-
let device = this.deviceList.find(ele => {
|
|
190
|
-
if(ele.address.address) {
|
|
191
|
-
return ele.address.address == parentDevice.ipAddr && ele.deviceId == parentDevice.deviceId;
|
|
192
|
-
} else {
|
|
193
|
-
return ele.address == parentDevice.ipAddr && ele.deviceId == parentDevice.deviceId;
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
let deviceAddress = app.getDeviceAddress(device.address);
|
|
197
|
-
let key = `${deviceAddress}-${device.deviceId}`;
|
|
198
|
-
let point = this.pointList[key][slotProps.node.pointName];
|
|
199
|
-
point.deviceId = device.deviceId;
|
|
200
|
-
point.deviceAddress = device.address;
|
|
201
|
-
|
|
202
|
-
if (!this.pointsToWrite || this.pointsToWrite.length == 'undefined') {
|
|
203
|
-
this.pointsToWrite = [];
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
let found = this.pointsToWrite.find(ele =>
|
|
207
|
-
ele.deviceId == point.deviceId &&
|
|
208
|
-
ele.objectName == point.objectName &&
|
|
209
|
-
ele.meta.arrayIndex == point.meta.arrayIndex &&
|
|
210
|
-
ele.meta.objectId.instance == point.meta.objectId.instance &&
|
|
211
|
-
ele.meta.objectId.type == point.meta.objectId.type);
|
|
212
|
-
|
|
213
|
-
if (!found) this.pointsToWrite.push(point);
|
|
214
|
-
|
|
215
|
-
//force a deploy state
|
|
216
|
-
node.hiddenDeployToggle = !node.prevHiddenToggleState;
|
|
217
|
-
},
|
|
218
|
-
removePointClicked(slotProps) {
|
|
219
|
-
let app = this;
|
|
220
|
-
//update UI
|
|
221
|
-
let parentDeviceName = slotProps.node.parentDevice;
|
|
222
|
-
let foundDeviceIndex = this.writeDevices ? this.writeDevices.findIndex(ele => ele.label == parentDeviceName) : -1;
|
|
223
|
-
let parentDevice = this.devices.find(ele => ele.label == parentDeviceName);
|
|
224
|
-
|
|
225
|
-
if (foundDeviceIndex !== -1) {
|
|
226
|
-
let foundIndex = this.writeDevices[foundDeviceIndex].children.findIndex(ele => ele.key == slotProps.node.key && ele.label == slotProps.node.label);
|
|
227
|
-
if (foundIndex !== -1) this.writeDevices[foundDeviceIndex].children.splice(foundIndex, 1);
|
|
228
|
-
if (this.writeDevices[foundDeviceIndex].children.length == 0) {
|
|
229
|
-
this.writeDevices.splice(foundDeviceIndex, 1);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
slotProps.node.showAdded = false;
|
|
234
|
-
|
|
235
|
-
this.$forceUpdate();
|
|
236
|
-
|
|
237
|
-
//update node-red data stucture
|
|
238
|
-
let device = this.deviceList.find(ele => {
|
|
239
|
-
if(ele.address.address) {
|
|
240
|
-
return ele.address.address == parentDevice.ipAddr && ele.deviceId == parentDevice.deviceId;
|
|
241
|
-
} else {
|
|
242
|
-
return ele.address == parentDevice.ipAddr && ele.deviceId == parentDevice.deviceId;
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
let deviceAddress = app.getDeviceAddress(device.address);
|
|
246
|
-
let key = `${deviceAddress}-${device.deviceId}`;
|
|
247
|
-
let point = this.pointList[key][slotProps.node.pointName];
|
|
248
|
-
point.deviceId = device.deviceId;
|
|
249
|
-
|
|
250
|
-
let foundIndex = this.pointsToWrite.findIndex(ele =>
|
|
251
|
-
ele.deviceId == point.deviceId &&
|
|
252
|
-
ele.objectName == point.objectName &&
|
|
253
|
-
ele.meta.arrayIndex == point.meta.arrayIndex &&
|
|
254
|
-
ele.meta.objectId.instance == point.meta.objectId.instance &&
|
|
255
|
-
ele.meta.objectId.type == point.meta.objectId.type);
|
|
256
|
-
|
|
257
|
-
if (foundIndex !== -1) {
|
|
258
|
-
this.pointsToWrite.splice(foundIndex, 1);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
//force a deploy state
|
|
262
|
-
node.hiddenDeployToggle = !node.prevHiddenToggleState;
|
|
263
|
-
},
|
|
264
|
-
getDeviceAddress(addr) {
|
|
265
|
-
switch(typeof addr) {
|
|
266
|
-
case "object":
|
|
267
|
-
return addr.address;
|
|
268
|
-
case "string":
|
|
269
|
-
return addr;
|
|
270
|
-
default:
|
|
271
|
-
return addr;
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
isDeviceActive(slotProps) {
|
|
275
|
-
let app = this;
|
|
276
|
-
if (((Date.now() - slotProps.node.lastSeen) / 1000) < app.pollFrequency) {
|
|
277
|
-
return true;
|
|
278
|
-
}
|
|
279
|
-
return false;
|
|
280
|
-
},
|
|
281
|
-
isSlotAdded(slotProps) {
|
|
282
|
-
if (slotProps.node.showAdded == true) {
|
|
283
|
-
return true;
|
|
284
|
-
} else {
|
|
285
|
-
return false;
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
hasData() {
|
|
289
|
-
if (this.devices && this.devices.length > 0) {
|
|
290
|
-
return true
|
|
291
|
-
} else {
|
|
292
|
-
return false;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
components: {
|
|
297
|
-
"p-tree": primevue.tree,
|
|
298
|
-
"p-button": primevue.button,
|
|
299
|
-
"p-timeline": primevue.timeline
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
let vueapp = createApp(App);
|
|
304
|
-
vueapp.use(primevue.config.default)
|
|
305
|
-
node.vm = vueapp.mount("#node-input-tabs-content");
|
|
306
|
-
|
|
307
|
-
//reinstate device data
|
|
308
|
-
if (node.writeDevices) {
|
|
309
|
-
node.vm.$data.writeDevices = node.writeDevices;
|
|
85
|
+
methods: {
|
|
86
|
+
getData() {
|
|
87
|
+
let app = this;
|
|
88
|
+
this.nodeService.getNetworkData().then(function (result) {
|
|
89
|
+
app.devices = result.renderList;
|
|
90
|
+
app.deviceList = result.deviceList;
|
|
91
|
+
app.pointList = result.pointList;
|
|
92
|
+
app.pollFrequency = parseInt(result.pollFrequency);
|
|
93
|
+
app.deviceCount = result.deviceList.length;
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
addAllClicked(slotProps) {
|
|
97
|
+
let app = this;
|
|
98
|
+
//update UI
|
|
99
|
+
if (this.writeDevices) {
|
|
100
|
+
let foundIndex = this.writeDevices.findIndex(
|
|
101
|
+
(ele) => ele.key == slotProps.node.key && ele.label == slotProps.node.label
|
|
102
|
+
);
|
|
103
|
+
if (foundIndex == -1) this.writeDevices.push(slotProps.node);
|
|
104
|
+
} else {
|
|
105
|
+
this.writeDevices = [slotProps.node];
|
|
310
106
|
}
|
|
311
|
-
|
|
312
|
-
|
|
107
|
+
|
|
108
|
+
this.$forceUpdate();
|
|
109
|
+
|
|
110
|
+
//update node-red data structure to forward to gateway
|
|
111
|
+
let device = this.deviceList.find((ele) => {
|
|
112
|
+
if (ele.address.address) {
|
|
113
|
+
return ele.address.address == slotProps.node.ipAddr && ele.deviceId == slotProps.node.deviceId;
|
|
114
|
+
} else {
|
|
115
|
+
return ele.address == slotProps.node.ipAddr && ele.deviceId == slotProps.node.deviceId;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
let deviceAddress = app.getDeviceAddress(device.address);
|
|
119
|
+
let key = `${deviceAddress}-${device.deviceId}`;
|
|
120
|
+
let points = this.pointList[key];
|
|
121
|
+
|
|
122
|
+
if (!this.pointsToWrite[key] || typeof this.pointsToWrite[key] == "undefined") {
|
|
123
|
+
this.pointsToWrite[key] = {};
|
|
313
124
|
}
|
|
314
125
|
|
|
315
|
-
let
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
$("#node-input-tabs-content").children().hide()
|
|
320
|
-
$("#" + tab.id).show()
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
tabs.addTab(
|
|
325
|
-
{
|
|
326
|
-
id: "read-networkTree-tab",
|
|
327
|
-
label: "Device List"
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
tabs.addTab(
|
|
331
|
-
{
|
|
332
|
-
id: "read-writeList-tab",
|
|
333
|
-
label: "Write List"
|
|
334
|
-
});
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
tabs.addTab(
|
|
338
|
-
{
|
|
339
|
-
id: "read-write-tab",
|
|
340
|
-
label: "Properties"
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
document.getElementById("node-input-applicationTag").value = node.applicationTag;
|
|
344
|
-
document.getElementById("node-input-priority").value = node.priority;
|
|
345
|
-
|
|
346
|
-
//remove loading animation
|
|
347
|
-
let loadingGif = document.getElementById("loadingGif");
|
|
348
|
-
let loadingText = document.getElementById("loadingText");
|
|
349
|
-
let table = document.getElementById("read-networkTree-tab-content");
|
|
350
|
-
loadingGif.style.display = "none";
|
|
351
|
-
loadingText.style.display = "none";
|
|
352
|
-
table.style.display = "inherit";
|
|
126
|
+
for (let pointName in points) {
|
|
127
|
+
let point = this.pointList[key][pointName];
|
|
128
|
+
this.pointsToWrite[key][point.objectName] = point;
|
|
129
|
+
}
|
|
353
130
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
131
|
+
//force a deploy state
|
|
132
|
+
node.hiddenDeployToggle = !node.prevHiddenToggleState;
|
|
133
|
+
},
|
|
134
|
+
removeAllClicked(slotProps) {
|
|
135
|
+
let app = this;
|
|
136
|
+
//update UI
|
|
137
|
+
if (this.writeDevices.length > 0) {
|
|
138
|
+
let foundIndex = this.writeDevices.findIndex(
|
|
139
|
+
(ele) => ele.key == slotProps.node.key && ele.label == slotProps.node.label
|
|
140
|
+
);
|
|
141
|
+
if (foundIndex !== -1) this.writeDevices.splice(foundIndex, 1);
|
|
142
|
+
}
|
|
143
|
+
this.$forceUpdate();
|
|
144
|
+
|
|
145
|
+
//update node-red data structure
|
|
146
|
+
let device = this.deviceList.find((ele) => {
|
|
147
|
+
if (ele.address.address) {
|
|
148
|
+
return ele.address.address == slotProps.node.ipAddr && ele.deviceId == slotProps.node.deviceId;
|
|
149
|
+
} else {
|
|
150
|
+
return ele.address == slotProps.node.ipAddr && ele.deviceId == slotProps.node.deviceId;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
let deviceAddress = app.getDeviceAddress(device.address);
|
|
154
|
+
let key = `${deviceAddress}-${device.deviceId}`;
|
|
155
|
+
if (this.pointsToWrite[key]) {
|
|
156
|
+
delete this.pointsToWrite[key];
|
|
157
|
+
}
|
|
362
158
|
|
|
363
|
-
|
|
159
|
+
//force a deploy state
|
|
160
|
+
node.hiddenDeployToggle = !node.prevHiddenToggleState;
|
|
161
|
+
},
|
|
162
|
+
addPointClicked(slotProps) {
|
|
163
|
+
let app = this;
|
|
164
|
+
//update UI
|
|
165
|
+
let parentDeviceName = slotProps.node.parentDevice;
|
|
166
|
+
let foundDeviceIndex = this.writeDevices
|
|
167
|
+
? this.writeDevices.findIndex((ele) => ele.label == parentDeviceName)
|
|
168
|
+
: -1;
|
|
169
|
+
let device = this.deviceList.find((ele) => ele.deviceName == parentDeviceName);
|
|
170
|
+
let deviceAddress = app.getDeviceAddress(device.address);
|
|
171
|
+
let key = `${deviceAddress}-${device.deviceId}`;
|
|
172
|
+
let parentDevice = this.devices.find((ele) => ele.ipAddr == deviceAddress);
|
|
173
|
+
let childDevice;
|
|
174
|
+
if (device.isMstp) {
|
|
175
|
+
let foundChildIndex = parentDevice.children[1].children.findIndex((ele) => ele.label == parentDeviceName);
|
|
176
|
+
if (foundChildIndex !== -1) {
|
|
177
|
+
childDevice = parentDevice.children[1].children[foundChildIndex];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
364
180
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
/* background: #282A36 !important; */
|
|
387
|
-
background: #d5d5d5 !important;
|
|
388
|
-
}
|
|
389
|
-
.pointLabel {
|
|
390
|
-
font-weight: 400;
|
|
391
|
-
}
|
|
392
|
-
/* .p-treenode-children {
|
|
393
|
-
background-color: #f0f0f0;
|
|
394
|
-
} */
|
|
395
|
-
.deviceLabel {
|
|
396
|
-
font-weight: 100;
|
|
397
|
-
}
|
|
398
|
-
.removeAllButton {
|
|
399
|
-
float: right;
|
|
400
|
-
}
|
|
401
|
-
.addAllButton {
|
|
402
|
-
float: right;
|
|
403
|
-
}
|
|
404
|
-
.bacnetbutton {
|
|
405
|
-
background: none;
|
|
406
|
-
border: none;
|
|
407
|
-
/* color: white; */
|
|
408
|
-
color: black;
|
|
409
|
-
font-weight: 400;
|
|
410
|
-
}
|
|
411
|
-
.bacnetbutton:hover {
|
|
412
|
-
/* background: #21232e; */
|
|
413
|
-
background: #f0f0f0;
|
|
414
|
-
border-radius: 10px;
|
|
415
|
-
}
|
|
416
|
-
.allFunctionsText {
|
|
417
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;
|
|
418
|
-
padding-left: 5px;
|
|
419
|
-
}
|
|
420
|
-
.p-treenode-children > li > .p-treenode-children > li {
|
|
421
|
-
font-size: 14px;
|
|
422
|
-
height: 25px;
|
|
423
|
-
color: #b5b5b5 !important;
|
|
424
|
-
}
|
|
425
|
-
.p-treenode-children > li > .p-treenode-children > .p-treenode-label {
|
|
426
|
-
color: #b5b5b5 !important;
|
|
427
|
-
}
|
|
428
|
-
.p-treenode-children > li > .p-treenode-children > li:last-child {
|
|
429
|
-
padding-bottom: 30px;
|
|
430
|
-
}
|
|
431
|
-
.p-tree-toggler:enabled:hover {
|
|
432
|
-
/* background: #21232e !important; */
|
|
433
|
-
background: #d5d5d5 !important;
|
|
434
|
-
}
|
|
435
|
-
.p-tree-toggler:focus {
|
|
436
|
-
border: none !important;
|
|
437
|
-
box-shadow: none !important;
|
|
438
|
-
}
|
|
439
|
-
.deviceStatus {
|
|
440
|
-
font-size: 10px;
|
|
441
|
-
}
|
|
442
|
-
.statusOnline {
|
|
443
|
-
color: #11c511;
|
|
181
|
+
if (foundDeviceIndex == -1) {
|
|
182
|
+
//no read devices present, add new
|
|
183
|
+
let newReadParent;
|
|
184
|
+
if (childDevice) {
|
|
185
|
+
newReadParent = { ...childDevice };
|
|
186
|
+
} else {
|
|
187
|
+
newReadParent = { ...parentDevice };
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
newReadParent.children = [];
|
|
191
|
+
newReadParent.children.push(slotProps.node);
|
|
192
|
+
|
|
193
|
+
if (this.writeDevices) {
|
|
194
|
+
this.writeDevices.push(newReadParent);
|
|
195
|
+
} else {
|
|
196
|
+
this.writeDevices = [newReadParent];
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
// read device found, add point to existing
|
|
200
|
+
this.writeDevices[foundDeviceIndex].children.push(slotProps.node);
|
|
201
|
+
}
|
|
444
202
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
color: red;
|
|
448
|
-
}
|
|
449
|
-
.deviceLabel {
|
|
450
|
-
position: relative;
|
|
451
|
-
}
|
|
452
|
-
.objectPropertiesLabel {
|
|
453
|
-
display: flex !important;
|
|
454
|
-
flex-direction: row;
|
|
455
|
-
align-items: center;
|
|
456
|
-
}
|
|
457
|
-
.p-tree .p-tree-container .p-treenode .p-treenode-content:focus {
|
|
458
|
-
outline: 0 none !important;
|
|
459
|
-
outline-offset: 0 !important;
|
|
460
|
-
box-shadow: inset 0 0 0 0.15rem #44475a !important;
|
|
461
|
-
}
|
|
462
|
-
.p-tree-filter:focus, .p-tree-filter:focus-visible, .p-inputtext:enabled:hover {
|
|
463
|
-
box-shadow: inset 0 0 0 0.15rem #44475a !important;
|
|
464
|
-
border-color: transparent !important;
|
|
465
|
-
}
|
|
466
|
-
.bacnetbutton > .pi {
|
|
467
|
-
display: flex;
|
|
468
|
-
}
|
|
469
|
-
.reloadButtonIcon {
|
|
470
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;
|
|
471
|
-
}
|
|
472
|
-
.reloadButton {
|
|
473
|
-
border: none;
|
|
474
|
-
background: none;
|
|
475
|
-
margin-right: 20px !important;
|
|
476
|
-
margin-bottom: 10px !important;
|
|
477
|
-
font-size: 14px !important;
|
|
478
|
-
float: right;
|
|
479
|
-
}
|
|
480
|
-
.reloadButton:hover {
|
|
481
|
-
background-color: #d5d5d5;
|
|
482
|
-
border-radius: 10px;
|
|
483
|
-
}
|
|
484
|
-
.p-treenode-label {
|
|
485
|
-
overflow: hidden;
|
|
486
|
-
white-space: nowrap;
|
|
487
|
-
text-overflow: ellipsis;
|
|
488
|
-
}
|
|
203
|
+
slotProps.node.showAdded = true;
|
|
204
|
+
this.$forceUpdate();
|
|
489
205
|
|
|
490
|
-
|
|
206
|
+
//update node-red data structure
|
|
207
|
+
let point = this.pointList[key][slotProps.node.pointName];
|
|
208
|
+
point.deviceId = device.deviceId;
|
|
209
|
+
point.deviceAddress = device.address;
|
|
210
|
+
point.key = slotProps.node.key;
|
|
491
211
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
</div>
|
|
212
|
+
if (!this.pointsToWrite || this.pointsToWrite.length == "undefined") {
|
|
213
|
+
this.pointsToWrite = [];
|
|
214
|
+
}
|
|
496
215
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
216
|
+
let found = this.pointsToWrite.find(
|
|
217
|
+
(ele) =>
|
|
218
|
+
ele.deviceId == point.deviceId &&
|
|
219
|
+
ele.objectName == point.objectName &&
|
|
220
|
+
ele.meta.arrayIndex == point.meta.arrayIndex &&
|
|
221
|
+
ele.meta.objectId.instance == point.meta.objectId.instance &&
|
|
222
|
+
ele.meta.objectId.type == point.meta.objectId.type
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
if (!found) this.pointsToWrite.push(point);
|
|
226
|
+
|
|
227
|
+
//force a deploy state
|
|
228
|
+
node.hiddenDeployToggle = !node.prevHiddenToggleState;
|
|
229
|
+
},
|
|
230
|
+
removePointClicked(slotProps) {
|
|
231
|
+
let app = this;
|
|
232
|
+
|
|
233
|
+
//update UI
|
|
234
|
+
let parentDeviceName = slotProps.node.parentDevice;
|
|
235
|
+
let foundDeviceIndex = this.writeDevices
|
|
236
|
+
? this.writeDevices.findIndex((ele) => ele.label == parentDeviceName)
|
|
237
|
+
: -1;
|
|
238
|
+
let parentDevice = this.devices.find((ele) => ele.label == parentDeviceName);
|
|
239
|
+
|
|
240
|
+
if (foundDeviceIndex !== -1) {
|
|
241
|
+
let foundIndex = this.writeDevices[foundDeviceIndex].children.findIndex(
|
|
242
|
+
(ele) => ele.key == slotProps.node.key && ele.label == slotProps.node.label
|
|
243
|
+
);
|
|
244
|
+
if (foundIndex !== -1) this.writeDevices[foundDeviceIndex].children.splice(foundIndex, 1);
|
|
245
|
+
if (this.writeDevices[foundDeviceIndex].children.length == 0) {
|
|
246
|
+
this.writeDevices.splice(foundDeviceIndex, 1);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
500
249
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
<div>
|
|
507
|
-
<a class="countStatus" style="margin-left: 15px;">Count: {{deviceCount}} device(s)</a>
|
|
508
|
-
<button @click="getData()" class="reloadButton">
|
|
509
|
-
<i class="pi pi-refresh" style="color: #00AEEF;"><a class="allFunctionsText">Reload data</a></i>
|
|
510
|
-
</button>
|
|
511
|
-
</div>
|
|
512
|
-
|
|
513
|
-
<div id="deviceListApp">
|
|
514
|
-
<p-tree :value="devices" selectable="false" :filter="true" filterMode="lenient" v-if="hasData()">
|
|
515
|
-
<template #device="slotProps">
|
|
516
|
-
<div v-if="isDeviceActive(slotProps)" class="deviceLabelParent" >
|
|
517
|
-
<b class="deviceLabel">{{slotProps.node.label}} <b class="statusOnline deviceStatus">Online</b></b>
|
|
518
|
-
</div>
|
|
519
|
-
<div v-else>
|
|
520
|
-
<b class="deviceLabel">{{slotProps.node.label}} <b class="statusOffline deviceStatus">Offline</b></b>
|
|
521
|
-
</div>
|
|
522
|
-
</template>
|
|
523
|
-
|
|
524
|
-
<template #point="slotProps" v-model:class="pointContent">
|
|
525
|
-
<b class="pointLabel">{{slotProps.node.label}}</b>
|
|
526
|
-
<template v-if="isSlotAdded(slotProps)">
|
|
527
|
-
<button class="addPointButton bacnetbutton">
|
|
528
|
-
<i class="pi pi-check-circle " style="color: #00AEEF;"></i>
|
|
529
|
-
</button>
|
|
530
|
-
</template>
|
|
531
|
-
<template v-else>
|
|
532
|
-
<button @click="addPointClicked(slotProps, this)" class="addPointButton bacnetbutton">
|
|
533
|
-
<i class="pi pi-plus-circle "></i>
|
|
534
|
-
</button>
|
|
535
|
-
</template>
|
|
536
|
-
|
|
537
|
-
<button @click="removePointClicked(slotProps, this)" class="minusPointButton bacnetbutton">
|
|
538
|
-
<i class="pi pi-minus-circle "></i>
|
|
539
|
-
</button>
|
|
540
|
-
|
|
541
|
-
</template>
|
|
542
|
-
</p-tree>
|
|
543
|
-
<div v-else style="text-align: center; padding-top: 20px;">
|
|
544
|
-
<a>No devices found.</a>
|
|
545
|
-
</div>
|
|
546
|
-
</div>
|
|
547
|
-
|
|
548
|
-
</div>
|
|
549
|
-
|
|
550
|
-
<img id="loadingGif" src="resources/@bitpoolos/edge-bacnet/BitpoolCube_Blue_350.gif" style="width: 70px; display: block; margin-left: auto; margin-right: auto;" />
|
|
551
|
-
<p id="loadingText" style="display: block; margin-left: auto; margin-right: auto; text-align: center; color: #505050;">Loading current network info</p>
|
|
552
|
-
</div>
|
|
250
|
+
let foundIndex = this.pointsToWrite.findIndex((ele) => ele.key == slotProps.node.key);
|
|
251
|
+
|
|
252
|
+
if (foundIndex !== -1) {
|
|
253
|
+
this.pointsToWrite.splice(foundIndex, 1);
|
|
254
|
+
}
|
|
553
255
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
256
|
+
slotProps.node.showAdded = false;
|
|
257
|
+
|
|
258
|
+
this.$forceUpdate();
|
|
259
|
+
|
|
260
|
+
//force a deploy state
|
|
261
|
+
node.hiddenDeployToggle = !node.prevHiddenToggleState;
|
|
262
|
+
},
|
|
263
|
+
getDeviceAddress(addr) {
|
|
264
|
+
switch (typeof addr) {
|
|
265
|
+
case "object":
|
|
266
|
+
return addr.address;
|
|
267
|
+
case "string":
|
|
268
|
+
return addr;
|
|
269
|
+
default:
|
|
270
|
+
return addr;
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
isDeviceActive(slotProps) {
|
|
274
|
+
let app = this;
|
|
275
|
+
if ((Date.now() - slotProps.node.lastSeen) / 1000 < app.pollFrequency) {
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
return false;
|
|
279
|
+
},
|
|
280
|
+
isSlotAdded(slotProps) {
|
|
281
|
+
if (slotProps.node.showAdded == true) {
|
|
282
|
+
return true;
|
|
283
|
+
} else {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
hasData() {
|
|
288
|
+
if (this.devices && this.devices.length > 0) {
|
|
289
|
+
return true;
|
|
290
|
+
} else {
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
components: {
|
|
296
|
+
"p-tree": primevue.tree,
|
|
297
|
+
"p-button": primevue.button,
|
|
298
|
+
"p-timeline": primevue.timeline,
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
let vueapp = createApp(App);
|
|
303
|
+
vueapp.use(primevue.config.default);
|
|
304
|
+
node.vm = vueapp.mount("#node-input-tabs-content");
|
|
305
|
+
|
|
306
|
+
//reinstate device data
|
|
307
|
+
if (node.writeDevices) {
|
|
308
|
+
node.vm.$data.writeDevices = node.writeDevices;
|
|
309
|
+
}
|
|
310
|
+
if (node.pointsToWrite) {
|
|
311
|
+
node.vm.$data.pointsToWrite = node.pointsToWrite;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
let tabs = RED.tabs.create({
|
|
315
|
+
id: "node-input-read-tabs",
|
|
316
|
+
onchange: function (tab) {
|
|
317
|
+
$("#node-input-tabs-content").children().hide();
|
|
318
|
+
$("#" + tab.id).show();
|
|
319
|
+
},
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
tabs.addTab({
|
|
323
|
+
id: "read-networkTree-tab",
|
|
324
|
+
label: "Device List",
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
tabs.addTab({
|
|
328
|
+
id: "read-writeList-tab",
|
|
329
|
+
label: "Write List",
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
tabs.addTab({
|
|
333
|
+
id: "read-write-tab",
|
|
334
|
+
label: "Properties",
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
document.getElementById("node-input-applicationTag").value = node.applicationTag;
|
|
338
|
+
document.getElementById("node-input-priority").value = node.priority;
|
|
339
|
+
|
|
340
|
+
//remove loading animation
|
|
341
|
+
let loadingGif = document.getElementById("loadingGif");
|
|
342
|
+
let loadingText = document.getElementById("loadingText");
|
|
343
|
+
let table = document.getElementById("read-networkTree-tab-content");
|
|
344
|
+
loadingGif.style.display = "none";
|
|
345
|
+
loadingText.style.display = "none";
|
|
346
|
+
table.style.display = "inherit";
|
|
347
|
+
},
|
|
348
|
+
oneditsave: function () {
|
|
349
|
+
let node = this;
|
|
350
|
+
if (node.vm.$data.devices && node.vm.$data.devices.length > 0) node.devices = node.vm.$data.devices;
|
|
351
|
+
if (node.vm.$data.writeDevices && node.vm.$data.writeDevices.length > 0)
|
|
352
|
+
node.writeDevices = node.vm.$data.writeDevices;
|
|
353
|
+
if (node.vm.$data.pointsToWrite && node.vm.$data.pointsToWrite.length > 0)
|
|
354
|
+
node.pointsToWrite = node.vm.$data.pointsToWrite;
|
|
355
|
+
},
|
|
356
|
+
});
|
|
357
|
+
</script>
|
|
358
|
+
|
|
359
|
+
<script type="text/html" data-template-name="Bacnet-Write">
|
|
360
|
+
<style>
|
|
361
|
+
.p-treenode-label {
|
|
362
|
+
color: black;
|
|
363
|
+
width: 100%;
|
|
364
|
+
}
|
|
365
|
+
.p-tree {
|
|
366
|
+
background: inherit !important;
|
|
367
|
+
border: inherit !important;
|
|
368
|
+
padding-right: 0px !important;
|
|
369
|
+
}
|
|
370
|
+
.p-button {
|
|
371
|
+
margin-right: 0.5rem;
|
|
372
|
+
}
|
|
373
|
+
.addPointButton {
|
|
374
|
+
float: right;
|
|
375
|
+
}
|
|
376
|
+
.minusPointButton {
|
|
377
|
+
float: right;
|
|
378
|
+
}
|
|
379
|
+
.addPointButton:hover,
|
|
380
|
+
.minusPointButton:hover {
|
|
381
|
+
background: #d5d5d5 !important;
|
|
382
|
+
}
|
|
383
|
+
.pointLabel {
|
|
384
|
+
font-weight: 400;
|
|
385
|
+
}
|
|
386
|
+
.deviceLabel {
|
|
387
|
+
font-weight: 100;
|
|
388
|
+
}
|
|
389
|
+
.removeAllButton {
|
|
390
|
+
float: right;
|
|
391
|
+
}
|
|
392
|
+
.addAllButton {
|
|
393
|
+
float: right;
|
|
394
|
+
}
|
|
395
|
+
.bacnetbutton {
|
|
396
|
+
background: none;
|
|
397
|
+
border: none;
|
|
398
|
+
color: black;
|
|
399
|
+
font-weight: 400;
|
|
400
|
+
}
|
|
401
|
+
.bacnetbutton:hover {
|
|
402
|
+
background: #f0f0f0;
|
|
403
|
+
border-radius: 10px;
|
|
404
|
+
}
|
|
405
|
+
.allFunctionsText {
|
|
406
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
|
|
407
|
+
"Segoe UI Emoji", "Segoe UI Symbol" !important;
|
|
408
|
+
padding-left: 5px;
|
|
409
|
+
}
|
|
410
|
+
.p-treenode-children > li > .p-treenode-children > li {
|
|
411
|
+
font-size: 14px;
|
|
412
|
+
/* height: 35px; */
|
|
413
|
+
color: #b5b5b5 !important;
|
|
414
|
+
}
|
|
415
|
+
.p-treenode-children > li > .p-treenode-children > .p-treenode-label {
|
|
416
|
+
color: #b5b5b5 !important;
|
|
417
|
+
}
|
|
418
|
+
.p-tree-toggler:enabled:hover {
|
|
419
|
+
background: #d5d5d5 !important;
|
|
420
|
+
}
|
|
421
|
+
.p-tree-toggler:focus {
|
|
422
|
+
border: none !important;
|
|
423
|
+
box-shadow: none !important;
|
|
424
|
+
}
|
|
425
|
+
.deviceStatus {
|
|
426
|
+
font-size: 10px;
|
|
427
|
+
}
|
|
428
|
+
.statusOnline {
|
|
429
|
+
color: #11c511;
|
|
430
|
+
}
|
|
431
|
+
.statusOffline {
|
|
432
|
+
color: red;
|
|
433
|
+
}
|
|
434
|
+
/*
|
|
435
|
+
.deviceLabel {
|
|
436
|
+
position: absolute;
|
|
437
|
+
}
|
|
438
|
+
*/
|
|
439
|
+
.objectPropertiesLabel {
|
|
440
|
+
display: flex !important;
|
|
441
|
+
flex-direction: row;
|
|
442
|
+
align-items: center;
|
|
443
|
+
}
|
|
444
|
+
.p-tree .p-tree-container .p-treenode .p-treenode-content:focus {
|
|
445
|
+
outline: 0 none !important;
|
|
446
|
+
outline-offset: 0 !important;
|
|
447
|
+
box-shadow: inset 0 0 0 1px #bdbdbd !important;
|
|
448
|
+
}
|
|
449
|
+
.checkbox-round {
|
|
450
|
+
width: 13px !important;
|
|
451
|
+
height: 13px !important;
|
|
452
|
+
background-color: white;
|
|
453
|
+
border-radius: 50%;
|
|
454
|
+
vertical-align: middle;
|
|
455
|
+
border: 1px solid #ddd;
|
|
456
|
+
appearance: none;
|
|
457
|
+
-webkit-appearance: none;
|
|
458
|
+
outline: none;
|
|
459
|
+
cursor: pointer;
|
|
460
|
+
}
|
|
461
|
+
.checkbox-round:checked {
|
|
462
|
+
background-color: #00aeef;
|
|
463
|
+
}
|
|
464
|
+
.checkbox-round:focus {
|
|
465
|
+
outline: none !important;
|
|
466
|
+
}
|
|
467
|
+
.p-tree-filter:focus,
|
|
468
|
+
.p-tree-filter:focus-visible,
|
|
469
|
+
.p-inputtext:enabled:hover {
|
|
470
|
+
box-shadow: inset 0 0 0 0.15rem #dfdcdc !important;
|
|
471
|
+
border-color: transparent !important;
|
|
472
|
+
}
|
|
473
|
+
.bacnetbutton > .pi {
|
|
474
|
+
display: flex;
|
|
475
|
+
}
|
|
476
|
+
.p-tree-container {
|
|
477
|
+
margin: 0 !important;
|
|
478
|
+
}
|
|
479
|
+
.reloadButtonIcon {
|
|
480
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
|
|
481
|
+
"Segoe UI Emoji", "Segoe UI Symbol" !important;
|
|
482
|
+
}
|
|
483
|
+
.removeAllDevicesButton {
|
|
484
|
+
border: none;
|
|
485
|
+
background: none;
|
|
486
|
+
font-size: 14px !important;
|
|
487
|
+
float: right;
|
|
488
|
+
display: flex;
|
|
489
|
+
align-items: center;
|
|
490
|
+
}
|
|
491
|
+
.removeAllDevicesButton:hover {
|
|
492
|
+
background-color: #d5d5d5;
|
|
493
|
+
border-radius: 10px;
|
|
494
|
+
}
|
|
495
|
+
.reloadButton {
|
|
496
|
+
border: none;
|
|
497
|
+
background: none;
|
|
498
|
+
font-size: 14px !important;
|
|
499
|
+
float: right;
|
|
500
|
+
}
|
|
501
|
+
.rebuildDataButton {
|
|
502
|
+
border: none;
|
|
503
|
+
background: none;
|
|
504
|
+
font-size: 14px !important;
|
|
505
|
+
float: right;
|
|
506
|
+
}
|
|
507
|
+
.reloadButton:hover {
|
|
508
|
+
background-color: #d5d5d5;
|
|
509
|
+
border-radius: 10px;
|
|
510
|
+
}
|
|
511
|
+
.rebuildDataButton:hover {
|
|
512
|
+
background-color: #d5d5d5;
|
|
513
|
+
border-radius: 10px;
|
|
514
|
+
}
|
|
515
|
+
.headerDiv {
|
|
516
|
+
display: flex;
|
|
517
|
+
flex-direction: row;
|
|
518
|
+
flex-wrap: nowrap;
|
|
519
|
+
justify-content: space-around;
|
|
520
|
+
height: 20px;
|
|
521
|
+
}
|
|
522
|
+
.msgTypeDiv {
|
|
523
|
+
display: flex;
|
|
524
|
+
align-items: flex-start;
|
|
525
|
+
flex-direction: column;
|
|
526
|
+
}
|
|
527
|
+
.p-progressbar .p-progressbar-value {
|
|
528
|
+
background: #00aeef !important;
|
|
529
|
+
}
|
|
530
|
+
.p-treenode-label {
|
|
531
|
+
overflow: hidden;
|
|
532
|
+
white-space: nowrap;
|
|
533
|
+
text-overflow: ellipsis;
|
|
534
|
+
}
|
|
535
|
+
.buttonGroup {
|
|
536
|
+
padding-left: 7px;
|
|
537
|
+
}
|
|
538
|
+
#read-readList-tab {
|
|
539
|
+
display: flex;
|
|
540
|
+
flex-direction: column;
|
|
541
|
+
}
|
|
542
|
+
.removeAllDevicesDiv {
|
|
543
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
|
|
544
|
+
"Segoe UI Emoji", "Segoe UI Symbol";
|
|
545
|
+
padding-right: 20px;
|
|
546
|
+
}
|
|
547
|
+
.p-tree .p-treenode-children {
|
|
548
|
+
padding: 0 !important;
|
|
549
|
+
}
|
|
550
|
+
.p-tree-toggler .p-link {
|
|
551
|
+
width: 25px !important;
|
|
552
|
+
}
|
|
553
|
+
</style>
|
|
554
|
+
|
|
555
|
+
<div class="form-row">
|
|
556
|
+
<label for="node-input-name"><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.name"></span> Name</label>
|
|
557
|
+
<input type="text" id="node-input-name" placeholder="Name" />
|
|
558
|
+
</div>
|
|
559
|
+
|
|
560
|
+
<div class="form-row node-input-read-tabs-row">
|
|
561
|
+
<ul style="min-width:600px;margin-bottom:20px" id="node-input-read-tabs"></ul>
|
|
562
|
+
</div>
|
|
563
|
+
|
|
564
|
+
<div id="node-input-tabs-content">
|
|
565
|
+
<div id="read-networkTree-tab" style="display:none">
|
|
566
|
+
<div id="read-networkTree-tab-content" class="networkTreeContent" style="display:none">
|
|
567
|
+
<div>
|
|
568
|
+
<a class="countStatus" style="margin-left: 15px;">Count: {{deviceCount}} device(s)</a>
|
|
569
|
+
<button @click="getData()" class="reloadButton">
|
|
570
|
+
<i class="pi pi-refresh" style="color: #00AEEF;"><a class="allFunctionsText">Reload data</a></i>
|
|
571
|
+
</button>
|
|
567
572
|
</div>
|
|
568
573
|
|
|
569
|
-
<div id=
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
<option value="111">COV_SUBSCRIPTION</option>
|
|
602
|
-
<option value="112">CALENDAR_ENTRY</option>
|
|
603
|
-
<option value="113">WEEKLY_SCHEDULE</option>
|
|
604
|
-
<option value="114">SPECIAL_EVENT</option>
|
|
605
|
-
<option value="115">READ_ACCESS_SPECIFICATION</option>
|
|
606
|
-
<option value="116">READ_ACCESS_RESULT</option>
|
|
607
|
-
<option value="117">LIGHTING_COMMAND</option>
|
|
608
|
-
<option value="118">CONTEXT_SPECIFIC_DECODED</option>
|
|
609
|
-
<option value="119">CONTEXT_SPECIFIC_ENCODED</option>
|
|
610
|
-
<option value="120">LOG_RECORD</option>
|
|
611
|
-
</select>
|
|
612
|
-
</div>
|
|
613
|
-
|
|
614
|
-
<div class="form-row">
|
|
615
|
-
<label for="node-input-priority"><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.priority"></span> Priority</label>
|
|
616
|
-
<select id="node-input-priority">
|
|
617
|
-
<option value="1">1 - Manual-Life Safety</option>
|
|
618
|
-
<option value="2">2 - Automatic-Life Safety</option>
|
|
619
|
-
<option value="3">3 - Available</option>
|
|
620
|
-
<option value="4">4 - Available</option>
|
|
621
|
-
<option value="5">5 - Critical Equipment Control</option>
|
|
622
|
-
<option value="6">6 - Minimum On/Off</option>
|
|
623
|
-
<option value="7">7 - Available</option>
|
|
624
|
-
<option value="8">8 - Manual Operator</option>
|
|
625
|
-
<option value="9">9 - Available</option>
|
|
626
|
-
<option value="10">10 - Available</option>
|
|
627
|
-
<option value="11">11 - Available</option>
|
|
628
|
-
<option value="12">12 - Available</option>
|
|
629
|
-
<option value="13">13 - Available</option>
|
|
630
|
-
<option value="14">14 - Available</option>
|
|
631
|
-
<option value="15">15 - Available</option>
|
|
632
|
-
<option value="16">16 - Available</option>
|
|
633
|
-
</select>
|
|
634
|
-
</div>
|
|
635
|
-
|
|
636
|
-
<label for="node-input-hiddenDeployToggle" style="display: none !important;" >
|
|
637
|
-
<i class="icon-tag" style="display: none !important;"></i> <span data-i18n="bitpool-bacnet.label.hiddenDeployToggle" style="display: none !important;"></span>
|
|
638
|
-
<input style="display: none !important;" type="checkbox" id="node-input-hiddenDeployToggle">
|
|
639
|
-
</label>
|
|
574
|
+
<div id="deviceListApp">
|
|
575
|
+
<p-tree :value="devices" selectable="false" :filter="true" filterMode="lenient" v-if="hasData()">
|
|
576
|
+
<template #device="slotProps">
|
|
577
|
+
<div v-if="isDeviceActive(slotProps)" class="deviceLabelParent">
|
|
578
|
+
<b class="deviceLabel">{{slotProps.node.label}} <b class="statusOnline deviceStatus">Online</b></b>
|
|
579
|
+
</div>
|
|
580
|
+
<div v-else>
|
|
581
|
+
<b class="deviceLabel">{{slotProps.node.label}} <b class="statusOffline deviceStatus">Offline</b></b>
|
|
582
|
+
</div>
|
|
583
|
+
</template>
|
|
584
|
+
|
|
585
|
+
<template #point="slotProps" v-model:class="pointContent">
|
|
586
|
+
<b class="pointLabel">{{slotProps.node.label}}</b>
|
|
587
|
+
<template v-if="isSlotAdded(slotProps)">
|
|
588
|
+
<button class="addPointButton bacnetbutton">
|
|
589
|
+
<i class="pi pi-check-circle " style="color: #00AEEF;"></i>
|
|
590
|
+
</button>
|
|
591
|
+
</template>
|
|
592
|
+
<template v-else>
|
|
593
|
+
<button @click="addPointClicked(slotProps, this)" class="addPointButton bacnetbutton">
|
|
594
|
+
<i class="pi pi-plus-circle "></i>
|
|
595
|
+
</button>
|
|
596
|
+
</template>
|
|
597
|
+
|
|
598
|
+
<button @click="removePointClicked(slotProps, this)" class="minusPointButton bacnetbutton">
|
|
599
|
+
<i class="pi pi-minus-circle "></i>
|
|
600
|
+
</button>
|
|
601
|
+
</template>
|
|
602
|
+
</p-tree>
|
|
603
|
+
<div v-else style="text-align: center; padding-top: 20px;">
|
|
604
|
+
<a>No devices found.</a>
|
|
605
|
+
</div>
|
|
640
606
|
</div>
|
|
607
|
+
</div>
|
|
608
|
+
|
|
609
|
+
<img
|
|
610
|
+
id="loadingGif"
|
|
611
|
+
src="resources/@bitpoolos/edge-bacnet/BitpoolCube_Blue_350.gif"
|
|
612
|
+
style="width: 70px; display: block; margin-left: auto; margin-right: auto;" />
|
|
613
|
+
<p id="loadingText" style="display: block; margin-left: auto; margin-right: auto; text-align: center; color: #505050;">
|
|
614
|
+
Loading current network info
|
|
615
|
+
</p>
|
|
616
|
+
</div>
|
|
641
617
|
|
|
618
|
+
<div id="read-writeList-tab" style="display:none">
|
|
619
|
+
<p-tree :value="writeDevices">
|
|
620
|
+
<template #device="slotProps">
|
|
621
|
+
<b class="deviceLabel">{{slotProps.node.label}} </b>
|
|
622
|
+
</template>
|
|
623
|
+
|
|
624
|
+
<template #point="slotProps" v-model:class="pointContent">
|
|
625
|
+
<b class="pointLabel">{{slotProps.node.label}}</b>
|
|
626
|
+
<button @click="removePointClicked(slotProps, this)" class="minusPointButton bacnetbutton">
|
|
627
|
+
<i class="pi pi-minus-circle "></i>
|
|
628
|
+
</button>
|
|
629
|
+
</template>
|
|
630
|
+
</p-tree>
|
|
642
631
|
</div>
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
<
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
</
|
|
632
|
+
|
|
633
|
+
<div id="read-write-tab" style="display:none">
|
|
634
|
+
<div class="form-row">
|
|
635
|
+
<label for="node-input-applicationTag"
|
|
636
|
+
><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.applicationTag"></span> Application Tag</label
|
|
637
|
+
>
|
|
638
|
+
<select id="node-input-applicationTag">
|
|
639
|
+
<option value="0">NULL</option>
|
|
640
|
+
<option value="1">BOOLEAN</option>
|
|
641
|
+
<option value="2">UNSIGNED_INT</option>
|
|
642
|
+
<option value="3">SIGNED_INT</option>
|
|
643
|
+
<option value="4">REAL</option>
|
|
644
|
+
<option value="5">DOUBLE</option>
|
|
645
|
+
<option value="6">OCTET_STRING</option>
|
|
646
|
+
<option value="7">CHARACTER_STRING</option>
|
|
647
|
+
<option value="8">BIT_STRING</option>
|
|
648
|
+
<option value="9">ENUMERATED</option>
|
|
649
|
+
<option value="10">DATE</option>
|
|
650
|
+
<option value="11">TIME</option>
|
|
651
|
+
<option value="12">OBJECT_ID</option>
|
|
652
|
+
<option value="13">RESERVE1</option>
|
|
653
|
+
<option value="14">RESERVE2</option>
|
|
654
|
+
<option value="15">RESERVE3</option>
|
|
655
|
+
<option value="16">MAX_BACNET_APPLICATION_TAG</option>
|
|
656
|
+
<option value="100">EMPTYLIST</option>
|
|
657
|
+
<option value="101">WEEKNDAY</option>
|
|
658
|
+
<option value="102">DATERANGE</option>
|
|
659
|
+
<option value="103">DATETIME</option>
|
|
660
|
+
<option value="104">TIMESTAMP</option>
|
|
661
|
+
<option value="105">ERROR</option>
|
|
662
|
+
<option value="106">DEVICE_OBJECT_PROPERTY_REFERENCE</option>
|
|
663
|
+
<option value="107">DEVICE_OBJECT_REFERENCE</option>
|
|
664
|
+
<option value="108">OBJECT_PROPERTY_REFERENCE</option>
|
|
665
|
+
<option value="109">DESTINATION</option>
|
|
666
|
+
<option value="110">RECIPIENT</option>
|
|
667
|
+
<option value="111">COV_SUBSCRIPTION</option>
|
|
668
|
+
<option value="112">CALENDAR_ENTRY</option>
|
|
669
|
+
<option value="113">WEEKLY_SCHEDULE</option>
|
|
670
|
+
<option value="114">SPECIAL_EVENT</option>
|
|
671
|
+
<option value="115">READ_ACCESS_SPECIFICATION</option>
|
|
672
|
+
<option value="116">READ_ACCESS_RESULT</option>
|
|
673
|
+
<option value="117">LIGHTING_COMMAND</option>
|
|
674
|
+
<option value="118">CONTEXT_SPECIFIC_DECODED</option>
|
|
675
|
+
<option value="119">CONTEXT_SPECIFIC_ENCODED</option>
|
|
676
|
+
<option value="120">LOG_RECORD</option>
|
|
677
|
+
</select>
|
|
678
|
+
</div>
|
|
679
|
+
|
|
680
|
+
<div class="form-row">
|
|
681
|
+
<label for="node-input-priority"
|
|
682
|
+
><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.priority"></span> Priority</label
|
|
683
|
+
>
|
|
684
|
+
<select id="node-input-priority">
|
|
685
|
+
<option value="1">1 - Manual-Life Safety</option>
|
|
686
|
+
<option value="2">2 - Automatic-Life Safety</option>
|
|
687
|
+
<option value="3">3 - Available</option>
|
|
688
|
+
<option value="4">4 - Available</option>
|
|
689
|
+
<option value="5">5 - Critical Equipment Control</option>
|
|
690
|
+
<option value="6">6 - Minimum On/Off</option>
|
|
691
|
+
<option value="7">7 - Available</option>
|
|
692
|
+
<option value="8">8 - Manual Operator</option>
|
|
693
|
+
<option value="9">9 - Available</option>
|
|
694
|
+
<option value="10">10 - Available</option>
|
|
695
|
+
<option value="11">11 - Available</option>
|
|
696
|
+
<option value="12">12 - Available</option>
|
|
697
|
+
<option value="13">13 - Available</option>
|
|
698
|
+
<option value="14">14 - Available</option>
|
|
699
|
+
<option value="15">15 - Available</option>
|
|
700
|
+
<option value="16">16 - Available</option>
|
|
701
|
+
</select>
|
|
702
|
+
</div>
|
|
703
|
+
|
|
704
|
+
<label for="node-input-hiddenDeployToggle" style="display: none !important;">
|
|
705
|
+
<i class="icon-tag" style="display: none !important;"></i>
|
|
706
|
+
<span data-i18n="bitpool-bacnet.label.hiddenDeployToggle" style="display: none !important;"></span>
|
|
707
|
+
<input style="display: none !important;" type="checkbox" id="node-input-hiddenDeployToggle" />
|
|
708
|
+
</label>
|
|
709
|
+
</div>
|
|
710
|
+
</div>
|
|
711
|
+
</script>
|
|
712
|
+
<script type="text/html" data-help-name="Bacnet-Write">
|
|
713
|
+
<p>A node used to view, select devices, device points, and point properties to add to the Write polling list.</p>
|
|
714
|
+
|
|
715
|
+
<h3><strong>Device List</strong></h3>
|
|
716
|
+
<ol class="node-ports">
|
|
717
|
+
<p>
|
|
718
|
+
This tab displays the devices and device points that are a result of a network Discover. The data is broken down and
|
|
719
|
+
listed as Devices, Points for the Device, and Point properties for the Points. On this tab the user may choose specific
|
|
720
|
+
points to Write values to. The reload button may be used to show any new data that may have been recieved by the
|
|
721
|
+
bitpool BACnet node. Please note: Data can only be shown here once a Discover sucessfully recieves a response from
|
|
722
|
+
online devices on the network
|
|
723
|
+
</p>
|
|
724
|
+
</ol>
|
|
725
|
+
|
|
726
|
+
<h3><strong>Write List</strong></h3>
|
|
727
|
+
<ol class="node-ports">
|
|
728
|
+
<p>This tab shows all of the devices and points that have been chosen to write.</p>
|
|
729
|
+
</ol>
|
|
730
|
+
|
|
731
|
+
<h3><strong>Properties</strong></h3>
|
|
732
|
+
<ol class="node-ports">
|
|
733
|
+
<p>
|
|
734
|
+
This tab allows the user to choose the Application Tag and Priority to be used in a Write function. Please make sure
|
|
735
|
+
the device / controller is configured correctly to accept the write command.
|
|
736
|
+
</p>
|
|
737
|
+
</ol>
|
|
738
|
+
|
|
739
|
+
<h3><strong>Examples</strong></h3>
|
|
740
|
+
<p>
|
|
741
|
+
For example flows, please use the examples section for this node. These examples can be found at: Node-red hamburger menu
|
|
742
|
+
on top right -> Import -> Examples -> @bitpoolos/edge-bacnet
|
|
743
|
+
</p>
|
|
744
|
+
<p>
|
|
745
|
+
To find captured examples of settings and flows, please go to our wiki
|
|
746
|
+
<a href="https://wiki.bitpool.com/en/edge/apps/bitpool-edge/nr-bacnet">here</a>
|
|
747
|
+
</p>
|
|
748
|
+
|
|
749
|
+
<h3>Resources:</h3>
|
|
750
|
+
<p><a href="https://youtu.be/4K7mVxfvfbc">Video Walk-through </a></p>
|
|
751
|
+
<h4><strong>Online Docs:</strong></h4>
|
|
752
|
+
<ul type="1">
|
|
753
|
+
<li><a href="https://www.bitpool.com/">bitpool.com</a> - check us out here.</li>
|
|
754
|
+
<li><a href="https://app.bitpool.com/">app.bitpool.com</a> - set up your account.</li>
|
|
755
|
+
<li><a href="https://wiki.bitpool.com/">wiki.bitpool.com</a> - find more documentation.</li>
|
|
756
|
+
<li><a href="https://bacnet.org/">BACnet</a> - find more about the protocol.</li>
|
|
757
|
+
</ul>
|
|
758
|
+
</script>
|