@bitpoolos/edge-bacnet 1.5.0 → 1.5.2
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/CHANGELOG.md +93 -81
- package/bacnet_client.js +141 -60
- package/bacnet_gateway.html +24 -38
- package/bacnet_gateway.js +2 -0
- package/bacnet_read.html +1032 -1021
- package/package.json +2 -2
- package/resources/style.css +5 -0
package/bacnet_client.js
CHANGED
|
@@ -6,7 +6,15 @@ const bacnet = require("./resources/node-bacstack-ts/dist/index.js");
|
|
|
6
6
|
const baEnum = bacnet.enum;
|
|
7
7
|
const bacnetIdMax = baEnum.ASN1_MAX_PROPERTY_ID;
|
|
8
8
|
const { EventEmitter } = require("events");
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
getUnit,
|
|
11
|
+
roundDecimalPlaces,
|
|
12
|
+
parseBacnetError,
|
|
13
|
+
getBacnetErrorString,
|
|
14
|
+
Read_Config_Sync,
|
|
15
|
+
isNumber,
|
|
16
|
+
decodeBitArray,
|
|
17
|
+
} = require("./common");
|
|
10
18
|
const { ToadScheduler, SimpleIntervalJob, Task } = require("toad-scheduler");
|
|
11
19
|
const { BacnetDevice } = require("./bacnet_device");
|
|
12
20
|
const { Mutex } = require("async-mutex");
|
|
@@ -65,13 +73,12 @@ class BacnetClient extends EventEmitter {
|
|
|
65
73
|
};
|
|
66
74
|
|
|
67
75
|
try {
|
|
68
|
-
|
|
69
76
|
that.client = new bacnet.Client({
|
|
70
77
|
apduTimeout: config.apduTimeout,
|
|
71
78
|
interface: config.localIpAdrress,
|
|
72
79
|
port: config.port,
|
|
73
80
|
broadcastAddress: config.broadCastAddr,
|
|
74
|
-
portRangeMatrix: config.portRangeMatrix
|
|
81
|
+
portRangeMatrix: config.portRangeMatrix,
|
|
75
82
|
});
|
|
76
83
|
that.setMaxListeners(1);
|
|
77
84
|
|
|
@@ -193,15 +200,34 @@ class BacnetClient extends EventEmitter {
|
|
|
193
200
|
|
|
194
201
|
let addressObject = {
|
|
195
202
|
address: address,
|
|
196
|
-
port: port
|
|
203
|
+
port: port,
|
|
197
204
|
};
|
|
198
205
|
|
|
206
|
+
const propertiesArray = [{ objectId: { type: type, instance: instance }, properties: [{ id: property }] }];
|
|
207
|
+
|
|
208
|
+
that.client.readPropertyMultiple(addressObject, propertiesArray, that.readPropertyMultipleOptions, (err, value) => {
|
|
209
|
+
console.log("1 - readPropertyMultiple: ");
|
|
210
|
+
|
|
211
|
+
console.log(value);
|
|
212
|
+
if (value) {
|
|
213
|
+
// If the result has value, resolve the promise
|
|
214
|
+
console.log(value.values[0]);
|
|
215
|
+
value.values[0].values.forEach(function (value) {
|
|
216
|
+
console.log("value: ", value.value);
|
|
217
|
+
});
|
|
218
|
+
} else {
|
|
219
|
+
console.log(err);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
199
223
|
that.client.readProperty(
|
|
200
224
|
addressObject,
|
|
201
225
|
{ type: type, instance: instance },
|
|
202
226
|
property,
|
|
203
227
|
that.readPropertyMultipleOptions,
|
|
204
228
|
(err, value) => {
|
|
229
|
+
console.log("2 - readProperty: ");
|
|
230
|
+
|
|
205
231
|
console.log(value);
|
|
206
232
|
if (value) {
|
|
207
233
|
// If the result has value, resolve the promise
|
|
@@ -264,7 +290,7 @@ class BacnetClient extends EventEmitter {
|
|
|
264
290
|
let that = this;
|
|
265
291
|
let addressObject = {
|
|
266
292
|
address: device.getAddress(),
|
|
267
|
-
port: device.getPort()
|
|
293
|
+
port: device.getPort(),
|
|
268
294
|
};
|
|
269
295
|
return new Promise((resolve, reject) => {
|
|
270
296
|
that.client.readProperty(
|
|
@@ -339,6 +365,20 @@ class BacnetClient extends EventEmitter {
|
|
|
339
365
|
});
|
|
340
366
|
}
|
|
341
367
|
|
|
368
|
+
forceUpdateDevices(deviceArray) {
|
|
369
|
+
let that = this;
|
|
370
|
+
try {
|
|
371
|
+
deviceArray.forEach(async function (deviceId) {
|
|
372
|
+
let device = that.deviceList.find((ele) => ele.getDeviceId() === deviceId);
|
|
373
|
+
if (device) {
|
|
374
|
+
await that.buildJsonObject(device);
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
} catch (e) {
|
|
378
|
+
that.logOut("forceUpdateDevices error: ", e);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
342
382
|
async updatePointsForDevice(deviceObject) {
|
|
343
383
|
try {
|
|
344
384
|
let device = this.deviceList.find((ele) => ele.getDeviceId() === deviceObject.deviceId);
|
|
@@ -370,6 +410,7 @@ class BacnetClient extends EventEmitter {
|
|
|
370
410
|
await this.getDevicePointListWithoutObjectList(device);
|
|
371
411
|
await this.buildJsonObject(device);
|
|
372
412
|
} catch (e) {
|
|
413
|
+
await this.buildJsonObject(device);
|
|
373
414
|
this.logOut(`Update points list error 4: ${this.getDeviceAddress(device)}`, e);
|
|
374
415
|
}
|
|
375
416
|
}
|
|
@@ -469,11 +510,11 @@ class BacnetClient extends EventEmitter {
|
|
|
469
510
|
});
|
|
470
511
|
}
|
|
471
512
|
|
|
472
|
-
//test re write
|
|
473
513
|
async queryDevices() {
|
|
474
514
|
let that = this;
|
|
475
515
|
try {
|
|
476
516
|
that.pollInProgress = true;
|
|
517
|
+
|
|
477
518
|
let index = 0;
|
|
478
519
|
await query(index);
|
|
479
520
|
|
|
@@ -493,6 +534,7 @@ class BacnetClient extends EventEmitter {
|
|
|
493
534
|
}
|
|
494
535
|
}
|
|
495
536
|
try {
|
|
537
|
+
|
|
496
538
|
await that.updateDeviceName(device);
|
|
497
539
|
|
|
498
540
|
if (device.getSegmentation() !== 3) {
|
|
@@ -717,6 +759,7 @@ class BacnetClient extends EventEmitter {
|
|
|
717
759
|
|
|
718
760
|
// Process the batch when the request array is full or the last point is reached
|
|
719
761
|
if (requestArray.length === maxObjectCount || i === pointNames.length - 1) {
|
|
762
|
+
|
|
720
763
|
if (device.getProtocolServiceSupport("ReadPropertyMultiple") == true) {
|
|
721
764
|
await that.processBatch(device, requestArray, deviceName, bacnetResults, that, roundDecimal);
|
|
722
765
|
} else {
|
|
@@ -731,6 +774,7 @@ class BacnetClient extends EventEmitter {
|
|
|
731
774
|
// Check if all points for the device have been processed
|
|
732
775
|
if (processedPoints >= totalPoints) {
|
|
733
776
|
pendingRequests++;
|
|
777
|
+
|
|
734
778
|
// Emit the `values` event for the current device
|
|
735
779
|
that.emit(
|
|
736
780
|
"values",
|
|
@@ -825,22 +869,30 @@ class BacnetClient extends EventEmitter {
|
|
|
825
869
|
for (const request of requestArray) {
|
|
826
870
|
const { objectId, pointRef, pointName } = request;
|
|
827
871
|
try {
|
|
872
|
+
|
|
873
|
+
|
|
828
874
|
const result = await that.updatePoint(device, pointRef);
|
|
829
|
-
const val = result.values[0].value;
|
|
830
875
|
|
|
831
|
-
|
|
832
|
-
pointRef.presentValue = roundDecimalPlaces(val, roundDecimal);
|
|
833
|
-
} else {
|
|
834
|
-
pointRef.presentValue = val;
|
|
835
|
-
}
|
|
876
|
+
//const result = await that.updatePointWithRetry(device, pointRef, 1);
|
|
836
877
|
|
|
837
|
-
pointRef.meta["device"] = deviceMetaInfo;
|
|
838
|
-
pointRef.timestamp = Date.now();
|
|
839
|
-
pointRef.status = "online";
|
|
840
|
-
pointRef.error = "none";
|
|
841
878
|
|
|
842
|
-
|
|
843
|
-
|
|
879
|
+
if (result.objectId.type == objectId.type && result.objectId.instance == objectId.instance) {
|
|
880
|
+
const val = result.values[0].value;
|
|
881
|
+
|
|
882
|
+
if (isNumber(val)) {
|
|
883
|
+
pointRef.presentValue = roundDecimalPlaces(val, roundDecimal);
|
|
884
|
+
} else {
|
|
885
|
+
pointRef.presentValue = val;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
pointRef.meta["device"] = deviceMetaInfo;
|
|
889
|
+
pointRef.timestamp = Date.now();
|
|
890
|
+
pointRef.status = "online";
|
|
891
|
+
pointRef.error = "none";
|
|
892
|
+
|
|
893
|
+
// Store the point data in results
|
|
894
|
+
bacnetResults[deviceName][pointName] = pointRef;
|
|
895
|
+
}
|
|
844
896
|
} catch (err) {
|
|
845
897
|
that.logOut(`Error updating point ${pointName}:`, err);
|
|
846
898
|
|
|
@@ -856,6 +908,12 @@ class BacnetClient extends EventEmitter {
|
|
|
856
908
|
updateManyPoints(device, points) {
|
|
857
909
|
let that = this;
|
|
858
910
|
return new Promise((resolve, reject) => {
|
|
911
|
+
|
|
912
|
+
// let readOptions = {
|
|
913
|
+
// maxSegments: device.getMaxSe,
|
|
914
|
+
// maxApdu: that.readPropertyMultipleOptions.maxApdu,
|
|
915
|
+
// };
|
|
916
|
+
|
|
859
917
|
that
|
|
860
918
|
._readObjectWithRequestArray(device, points, that.readPropertyMultipleOptions)
|
|
861
919
|
.then(function (results) {
|
|
@@ -867,11 +925,27 @@ class BacnetClient extends EventEmitter {
|
|
|
867
925
|
});
|
|
868
926
|
}
|
|
869
927
|
|
|
928
|
+
updatePointWithRetry(device, point, retryCount = 1) {
|
|
929
|
+
let that = this;
|
|
930
|
+
const tryUpdate = (retriesLeft) => {
|
|
931
|
+
return that.updatePoint(device, point).catch((err) => {
|
|
932
|
+
if (retriesLeft > 0) {
|
|
933
|
+
that.logOut(`Retrying updatePoint... Attempts left: ${retriesLeft}`);
|
|
934
|
+
return tryUpdate(retriesLeft - 1);
|
|
935
|
+
}
|
|
936
|
+
// If no retries are left, reject with the original error
|
|
937
|
+
return Promise.reject(err);
|
|
938
|
+
});
|
|
939
|
+
};
|
|
940
|
+
|
|
941
|
+
return tryUpdate(retryCount);
|
|
942
|
+
}
|
|
943
|
+
|
|
870
944
|
updatePoint(device, point) {
|
|
871
945
|
let that = this;
|
|
872
946
|
let addressObject = {
|
|
873
947
|
address: device.getAddress(),
|
|
874
|
-
port: device.getPort()
|
|
948
|
+
port: device.getPort(),
|
|
875
949
|
};
|
|
876
950
|
return new Promise((resolve, reject) => {
|
|
877
951
|
that.client.readProperty(
|
|
@@ -1029,7 +1103,7 @@ class BacnetClient extends EventEmitter {
|
|
|
1029
1103
|
|
|
1030
1104
|
let addressObject = {
|
|
1031
1105
|
address: device.getAddress(),
|
|
1032
|
-
port: device.getPort()
|
|
1106
|
+
port: device.getPort(),
|
|
1033
1107
|
};
|
|
1034
1108
|
|
|
1035
1109
|
let index = 1;
|
|
@@ -1068,7 +1142,7 @@ class BacnetClient extends EventEmitter {
|
|
|
1068
1142
|
let that = this;
|
|
1069
1143
|
let addressObject = {
|
|
1070
1144
|
address: device.getAddress(),
|
|
1071
|
-
port: device.getPort()
|
|
1145
|
+
port: device.getPort(),
|
|
1072
1146
|
};
|
|
1073
1147
|
return new Promise((resolve, reject) => {
|
|
1074
1148
|
that.client.readPropertyMultiple(addressObject, requestArray, readOptions, (error, value) => {
|
|
@@ -1085,7 +1159,7 @@ class BacnetClient extends EventEmitter {
|
|
|
1085
1159
|
|
|
1086
1160
|
let addressObject = {
|
|
1087
1161
|
address: device.getAddress(),
|
|
1088
|
-
port: device.getPort()
|
|
1162
|
+
port: device.getPort(),
|
|
1089
1163
|
};
|
|
1090
1164
|
let deviceId = device.getDeviceId();
|
|
1091
1165
|
|
|
@@ -1102,7 +1176,7 @@ class BacnetClient extends EventEmitter {
|
|
|
1102
1176
|
let that = this;
|
|
1103
1177
|
let addressObject = {
|
|
1104
1178
|
address: device.getAddress(),
|
|
1105
|
-
port: device.getPort()
|
|
1179
|
+
port: device.getPort(),
|
|
1106
1180
|
};
|
|
1107
1181
|
let deviceId = device.getDeviceId();
|
|
1108
1182
|
try {
|
|
@@ -1150,7 +1224,7 @@ class BacnetClient extends EventEmitter {
|
|
|
1150
1224
|
|
|
1151
1225
|
let addressObject = {
|
|
1152
1226
|
address: device.getAddress(),
|
|
1153
|
-
port: device.getPort()
|
|
1227
|
+
port: device.getPort(),
|
|
1154
1228
|
};
|
|
1155
1229
|
|
|
1156
1230
|
// Define all properties to be read
|
|
@@ -1251,7 +1325,7 @@ class BacnetClient extends EventEmitter {
|
|
|
1251
1325
|
|
|
1252
1326
|
let addressObject = {
|
|
1253
1327
|
address: device.getAddress(),
|
|
1254
|
-
port: device.getPort()
|
|
1328
|
+
port: device.getPort(),
|
|
1255
1329
|
};
|
|
1256
1330
|
|
|
1257
1331
|
// Define all properties to be read
|
|
@@ -1333,7 +1407,7 @@ class BacnetClient extends EventEmitter {
|
|
|
1333
1407
|
let device = that.deviceList.find((ele) => ele.getDeviceId() === point.deviceId);
|
|
1334
1408
|
let addressObject = {
|
|
1335
1409
|
address: device.getAddress(),
|
|
1336
|
-
port: device.getPort()
|
|
1410
|
+
port: device.getPort(),
|
|
1337
1411
|
};
|
|
1338
1412
|
|
|
1339
1413
|
let writeObject = {
|
|
@@ -1671,7 +1745,6 @@ class BacnetClient extends EventEmitter {
|
|
|
1671
1745
|
that.buildJsonInProgress = false;
|
|
1672
1746
|
}
|
|
1673
1747
|
|
|
1674
|
-
|
|
1675
1748
|
async buildJsonObject(device) {
|
|
1676
1749
|
try {
|
|
1677
1750
|
const pointList = device.getPointsList();
|
|
@@ -1755,32 +1828,36 @@ class BacnetClient extends EventEmitter {
|
|
|
1755
1828
|
|
|
1756
1829
|
switch (object.id) {
|
|
1757
1830
|
case baEnum.PropertyIdentifier.PRESENT_VALUE:
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
if (
|
|
1762
|
-
values[objectId].presentValue = false;
|
|
1763
|
-
} else if (object.value[0].value == 1) {
|
|
1764
|
-
values[objectId].presentValue = true;
|
|
1765
|
-
}
|
|
1766
|
-
} else if (objectType == 40) {
|
|
1767
|
-
//character string
|
|
1768
|
-
values[objectId].presentValue = object.value[0].value;
|
|
1769
|
-
} else if (objectType == 13 || objectType == 14 || objectType == 19) {
|
|
1770
|
-
//check for MSV MSI MSO - for enum state text
|
|
1771
|
-
if (values[objectId].stateTextArray && values[objectId].stateTextArray.length > 0) {
|
|
1831
|
+
try {
|
|
1832
|
+
if (object.value[0] && object.value[0].value !== "undefined" && object.value[0].value !== null) {
|
|
1833
|
+
//check for binary object type
|
|
1834
|
+
if (objectType == 3 || objectType == 4 || objectType == 5) {
|
|
1772
1835
|
if (object.value[0].value == 0) {
|
|
1773
|
-
values[objectId].presentValue =
|
|
1774
|
-
} else if (object.value[0].value
|
|
1775
|
-
values[objectId].presentValue =
|
|
1776
|
-
values[objectId].stateTextArray[object.value[0].value - 1].value;
|
|
1836
|
+
values[objectId].presentValue = false;
|
|
1837
|
+
} else if (object.value[0].value == 1) {
|
|
1838
|
+
values[objectId].presentValue = true;
|
|
1777
1839
|
}
|
|
1840
|
+
} else if (objectType == 40) {
|
|
1841
|
+
//character string
|
|
1842
|
+
values[objectId].presentValue = object.value[0].value;
|
|
1843
|
+
} else if (objectType == 13 || objectType == 14 || objectType == 19) {
|
|
1844
|
+
//check for MSV MSI MSO - for enum state text
|
|
1845
|
+
if (values[objectId].stateTextArray && values[objectId].stateTextArray.length > 0) {
|
|
1846
|
+
if (object.value[0].value == 0) {
|
|
1847
|
+
values[objectId].presentValue = values[objectId].stateTextArray[object.value[0].value].value;
|
|
1848
|
+
} else if (object.value[0].value !== 0) {
|
|
1849
|
+
values[objectId].presentValue =
|
|
1850
|
+
values[objectId].stateTextArray[object.value[0].value - 1].value;
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
} else if (objectType !== 8) {
|
|
1854
|
+
values[objectId].presentValue = roundDecimalPlaces(object.value[0].value, 2);
|
|
1778
1855
|
}
|
|
1779
|
-
} else if (objectType !== 8) {
|
|
1780
|
-
values[objectId].presentValue = roundDecimalPlaces(object.value[0].value, 2);
|
|
1781
1856
|
}
|
|
1857
|
+
values[objectId].meta.arrayIndex = object.index;
|
|
1858
|
+
} catch (e) {
|
|
1859
|
+
that.logOut("buildResponse PRESENT_VALUE error: ", e);
|
|
1782
1860
|
}
|
|
1783
|
-
values[objectId].meta.arrayIndex = object.index;
|
|
1784
1861
|
break;
|
|
1785
1862
|
case baEnum.PropertyIdentifier.DESCRIPTION:
|
|
1786
1863
|
if (object.value[0]) values[objectId].description = object.value[0].value;
|
|
@@ -1828,20 +1905,24 @@ class BacnetClient extends EventEmitter {
|
|
|
1828
1905
|
}
|
|
1829
1906
|
break;
|
|
1830
1907
|
case baEnum.PropertyIdentifier.STATE_TEXT:
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1908
|
+
try {
|
|
1909
|
+
if (object.value) {
|
|
1910
|
+
values[objectId].stateTextArray = object.value;
|
|
1911
|
+
if (
|
|
1912
|
+
typeof values[objectId].presentValue == "number" &&
|
|
1913
|
+
values[objectId].presentValue !== null &&
|
|
1914
|
+
values[objectId].presentValue !== undefined
|
|
1915
|
+
) {
|
|
1916
|
+
const tempIndex = values[objectId].presentValue;
|
|
1917
|
+
if (tempIndex == 0) {
|
|
1918
|
+
values[objectId].presentValue = values[objectId].stateTextArray[tempIndex].value;
|
|
1919
|
+
} else if (tempIndex !== 0) {
|
|
1920
|
+
values[objectId].presentValue = values[objectId].stateTextArray[tempIndex - 1].value;
|
|
1921
|
+
}
|
|
1843
1922
|
}
|
|
1844
1923
|
}
|
|
1924
|
+
} catch (e) {
|
|
1925
|
+
that.logOut("buildResponse STATE_TEXT error: ", e);
|
|
1845
1926
|
}
|
|
1846
1927
|
break;
|
|
1847
1928
|
case baEnum.PropertyIdentifier.VENDOR_NAME:
|
package/bacnet_gateway.html
CHANGED
|
@@ -238,14 +238,15 @@
|
|
|
238
238
|
|
|
239
239
|
queryAdapters();
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
window.confirmDialogExists = window.confirmDialogExists || false;
|
|
242
|
+
|
|
243
|
+
if (node.vm1 == undefined && !window.confirmDialogExists) {
|
|
242
244
|
const confirmDialog = document.createElement("p-confirm-dialog");
|
|
243
245
|
document.getElementById("serverParent").appendChild(confirmDialog);
|
|
246
|
+
window.confirmDialogExists = true;
|
|
244
247
|
}
|
|
245
248
|
|
|
246
249
|
const { createApp, ref, onMounted } = Vue;
|
|
247
|
-
const ConfirmDialog = primevue.confirmdialog;
|
|
248
|
-
const ConfirmationService = primevue.confirmationservice;
|
|
249
250
|
const ListBox = primevue.listbox;
|
|
250
251
|
|
|
251
252
|
//prime vue app
|
|
@@ -517,7 +518,6 @@
|
|
|
517
518
|
document.getElementById("node-input-reg-block-count-portRangeMatrix").innerHTML = $(
|
|
518
519
|
"#node-input-portRangeMatrix-container"
|
|
519
520
|
).editableList("length");
|
|
520
|
-
|
|
521
521
|
},
|
|
522
522
|
removeItem: function (data) {
|
|
523
523
|
document.getElementById("node-input-reg-block-count-portRangeMatrix").innerHTML = $(
|
|
@@ -587,7 +587,6 @@
|
|
|
587
587
|
|
|
588
588
|
document.getElementById("node-input-reg-block-count-portRangeMatrix").innerHTML = node.portRangeRegisters.length;
|
|
589
589
|
//end port range matrix
|
|
590
|
-
|
|
591
590
|
},
|
|
592
591
|
oneditsave: function () {
|
|
593
592
|
let node = this;
|
|
@@ -619,7 +618,6 @@
|
|
|
619
618
|
node.deviceRangeRegisters.push(mapItem);
|
|
620
619
|
});
|
|
621
620
|
|
|
622
|
-
|
|
623
621
|
node.portRangeRegisters = [];
|
|
624
622
|
let portRanges = $("#node-input-portRangeMatrix-container").editableList("items");
|
|
625
623
|
portRanges.each(function (i) {
|
|
@@ -631,7 +629,6 @@
|
|
|
631
629
|
};
|
|
632
630
|
node.portRangeRegisters.push(mapItem);
|
|
633
631
|
});
|
|
634
|
-
|
|
635
632
|
},
|
|
636
633
|
});
|
|
637
634
|
|
|
@@ -680,10 +677,6 @@
|
|
|
680
677
|
margin-top: 20px;
|
|
681
678
|
margin-left: 50px;
|
|
682
679
|
}
|
|
683
|
-
.p-confirm-dialog-accept > .p-button-label,
|
|
684
|
-
.bacnetServerRebuildSchedule_clearButton > .p-button-label {
|
|
685
|
-
color: white;
|
|
686
|
-
}
|
|
687
680
|
.red-ui-editor label {
|
|
688
681
|
font-size: 12px;
|
|
689
682
|
}
|
|
@@ -761,8 +754,7 @@
|
|
|
761
754
|
|
|
762
755
|
<div class="form-row bp-row" id="networkInterfaceDiv">
|
|
763
756
|
<label for="node-input-local_device_address"
|
|
764
|
-
><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.local_device_address"></span> Network
|
|
765
|
-
Interface</label
|
|
757
|
+
><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.local_device_address"></span> Network Interface</label
|
|
766
758
|
>
|
|
767
759
|
<select id="node-input-local_device_address"></select>
|
|
768
760
|
</div>
|
|
@@ -795,7 +787,6 @@
|
|
|
795
787
|
<div class="form-row node-input-deviceIdRangeMatrix-container-row bp-row">
|
|
796
788
|
<ol id="node-input-deviceIdRangeMatrix-container"></ol>
|
|
797
789
|
</div>
|
|
798
|
-
|
|
799
790
|
</div>
|
|
800
791
|
|
|
801
792
|
<div id="read-discover-tab" style="display:none">
|
|
@@ -898,8 +889,8 @@
|
|
|
898
889
|
|
|
899
890
|
<div class="form-row bp-row" style="align-items: center; display: none;">
|
|
900
891
|
<label for="node-input-sanitise_device_schedule_value"
|
|
901
|
-
><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.sanitise_device_schedule"></span>Device
|
|
902
|
-
|
|
892
|
+
><i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.sanitise_device_schedule"></span>Device Sanitisation
|
|
893
|
+
Frequency</label
|
|
903
894
|
>
|
|
904
895
|
<p style="margin-right: 5px; margin-bottom: 0px; padding-left: 7px;">Every</p>
|
|
905
896
|
<input type="text" id="node-input-sanitise_device_schedule" style="display: none;" />
|
|
@@ -917,17 +908,17 @@
|
|
|
917
908
|
</div>
|
|
918
909
|
|
|
919
910
|
<div class="form-row bp-checkbox-row">
|
|
920
|
-
<input type="checkbox" id="node-input-cacheFileEnabled" class="bp-checkbox"/>
|
|
911
|
+
<input type="checkbox" id="node-input-cacheFileEnabled" class="bp-checkbox" />
|
|
921
912
|
<label for="node-input-cacheFileEnabled"> Enable cache file </label>
|
|
922
913
|
</div>
|
|
923
914
|
|
|
924
915
|
<div class="form-row bp-checkbox-row">
|
|
925
|
-
<input type="checkbox" id="node-input-toLogIam" class="bp-checkbox"/>
|
|
916
|
+
<input type="checkbox" id="node-input-toLogIam" class="bp-checkbox" />
|
|
926
917
|
<label for="node-input-toLogIam"> Log found device </label>
|
|
927
918
|
</div>
|
|
928
919
|
|
|
929
920
|
<div class="form-row bp-checkbox-row" style="border-bottom: 1px solid #cbcbcb; padding-bottom: 20px;">
|
|
930
|
-
<input type="checkbox" id="node-input-logErrorToConsole" class="bp-checkbox"/>
|
|
921
|
+
<input type="checkbox" id="node-input-logErrorToConsole" class="bp-checkbox" />
|
|
931
922
|
<label for="node-input-logErrorToConsole"> Log BACnet errors to console </label>
|
|
932
923
|
</div>
|
|
933
924
|
|
|
@@ -949,15 +940,12 @@
|
|
|
949
940
|
|
|
950
941
|
<div id="read-server-tab" style="display:none">
|
|
951
942
|
<div class="form-row bp-checkbox-row">
|
|
952
|
-
<input type="checkbox" id="node-input-serverEnabled" class="bp-checkbox"/>
|
|
943
|
+
<input type="checkbox" id="node-input-serverEnabled" class="bp-checkbox" />
|
|
953
944
|
<label for="node-input-serverEnabled"> Enable Server </label>
|
|
954
945
|
</div>
|
|
955
946
|
|
|
956
947
|
<div class="read_server_parent_div" id="serverParent">
|
|
957
|
-
<div
|
|
958
|
-
class="form-row bp-row clearServerContainer"
|
|
959
|
-
id="clearServerContainer"
|
|
960
|
-
style="align-items: center; display: flex;">
|
|
948
|
+
<div class="form-row bp-row clearServerContainer" id="clearServerContainer" style="align-items: center; display: flex;">
|
|
961
949
|
<p-button class="bacnetServerRebuildSchedule_clearButton" @click="confirmAll($event)" label="Reinitialize Server">
|
|
962
950
|
</p-button>
|
|
963
951
|
</div>
|
|
@@ -990,8 +978,8 @@
|
|
|
990
978
|
<h3><strong>Gateway Tab</strong></h3>
|
|
991
979
|
<ul class="node-ports">
|
|
992
980
|
<li>
|
|
993
|
-
Network Interface - the desired interface for the bacstack client to bind to. This interface must not have any other
|
|
994
|
-
|
|
981
|
+
Network Interface - the desired interface for the bacstack client to bind to. This interface must not have any other BACnet
|
|
982
|
+
clients bound to it.
|
|
995
983
|
</li>
|
|
996
984
|
<li>
|
|
997
985
|
Broadcast Address - the desired subnet for global msgs to be broadcast and recieved on. This should be as strict as
|
|
@@ -1006,13 +994,13 @@
|
|
|
1006
994
|
<li>Max APDU Size - BACnet max apdu size</li>
|
|
1007
995
|
<li>Max Segments - BACnet max segments</li>
|
|
1008
996
|
<li>
|
|
1009
|
-
Global Discover Frequency - the frequency at which the gateway issues global WhoIs BACnet commands. This should be
|
|
1010
|
-
|
|
997
|
+
Global Discover Frequency - the frequency at which the gateway issues global WhoIs BACnet commands. This should be limited
|
|
998
|
+
to the least amount possible, as over-loading a network can be a serious issue with BACnet commmunications.
|
|
1011
999
|
</li>
|
|
1012
1000
|
<li>
|
|
1013
|
-
Manual Point Discovery Instance Range - if a BACnet device doesnt have a Object list (BACnet objectType:propertyId -
|
|
1014
|
-
|
|
1015
|
-
|
|
1001
|
+
Manual Point Discovery Instance Range - if a BACnet device doesnt have a Object list (BACnet objectType:propertyId - 8:76),
|
|
1002
|
+
the this bacnet client will enter into manual discovery mode, where it iterates through types and instnace ranges. This
|
|
1003
|
+
range can be used to limit this manual scanning
|
|
1016
1004
|
</li>
|
|
1017
1005
|
<li>Log Device Found - toggles logging of found devices to the node-red debug tab.</li>
|
|
1018
1006
|
<li>Log BACnet Errors to Console - toggles logging of BACnet related errors to the node-red console</li>
|
|
@@ -1025,20 +1013,18 @@
|
|
|
1025
1013
|
devices via BACnet/IP
|
|
1026
1014
|
</p>
|
|
1027
1015
|
<p>
|
|
1028
|
-
This node only supports 2 BACnet object types, Analog Value - to show numeric data, and a Character String - to show
|
|
1029
|
-
|
|
1016
|
+
This node only supports 2 BACnet object types, Analog Value - to show numeric data, and a Character String - to show string
|
|
1017
|
+
data.
|
|
1030
1018
|
</p>
|
|
1031
1019
|
<ul class="node-ports">
|
|
1032
1020
|
<li>Enabled - toggles whether or not the local BACnet server is started or not.</li>
|
|
1033
|
-
<li>
|
|
1034
|
-
Clear Server Points - a schedule for the locally generated BACnet points to get cleared from the node object store
|
|
1035
|
-
</li>
|
|
1021
|
+
<li>Clear Server Points - a schedule for the locally generated BACnet points to get cleared from the node object store</li>
|
|
1036
1022
|
</ul>
|
|
1037
1023
|
|
|
1038
1024
|
<h3><strong>Examples</strong></h3>
|
|
1039
1025
|
<p>
|
|
1040
|
-
For example flows, please use the examples section for this node. These examples can be found at: Node-red hamburger menu
|
|
1041
|
-
|
|
1026
|
+
For example flows, please use the examples section for this node. These examples can be found at: Node-red hamburger menu on
|
|
1027
|
+
top right -> Import -> Examples -> @bitpoolos/edge-bacnet
|
|
1042
1028
|
</p>
|
|
1043
1029
|
<p>
|
|
1044
1030
|
To find captured examples of settings and flows, please go to our wiki
|
package/bacnet_gateway.js
CHANGED
|
@@ -240,6 +240,8 @@ module.exports = function (RED) {
|
|
|
240
240
|
}).catch(function (error) {
|
|
241
241
|
logOut("Error in applyDisplayNames: ", error);
|
|
242
242
|
});
|
|
243
|
+
} else if (msg.forceUpdateDevices == true) {
|
|
244
|
+
node.bacnetClient.forceUpdateDevices(msg.deviceIdArray);
|
|
243
245
|
}
|
|
244
246
|
});
|
|
245
247
|
|