@bitpoolos/edge-bacnet 1.4.3 → 1.4.5

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_read.html CHANGED
@@ -359,7 +359,8 @@
359
359
  //update UI
360
360
  let parentDeviceName = slotProps.node.parentDevice;
361
361
  let parentDevice = this.devices.find((ele) => ele.label == parentDeviceName);
362
- let device = this.deviceList.find((ele) => ele.deviceName == parentDeviceName);
362
+ const slotDeviceId = slotProps.node.parentDeviceId;
363
+ let device = this.deviceList.find((ele) => ele.deviceId == slotDeviceId);
363
364
  let foundDeviceIndex = this.readDevices
364
365
  ? this.readDevices.findIndex((ele) => ele.deviceId == device.deviceId)
365
366
  : -1;
@@ -1105,17 +1106,19 @@
1105
1106
  </p-dialog>
1106
1107
 
1107
1108
  <div class="headerDiv">
1108
- <a class="countStatus" style="margin-left: 15px;">Count: {{deviceCount}} device(s)</a>
1109
- <p-progressbar :value="progressBarValue" :show-value="true" style="width: 300px; height: 20px;"></p-progressbar>
1109
+ <a class="countStatus" style="margin-left: 15px;"> <span class="bp-deviceCount">{{deviceCount}}</span> Device(s)</a>
1110
+ <p-progressbar :value="progressBarValue" :show-value="true" style="width: 220px; height: 20px;"></p-progressbar>
1110
1111
  <div class="buttonGroup" style="padding-left: 15px;">
1111
1112
  <button @click="rebuildDataModel()" class="rebuildDataButton" title="Rebuild Data Model">
1112
- <i class="pi pi-wrench" style="color: #ff0000;"></i>
1113
- </button>
1114
- <button @click="getData()" class="reloadButton" title="Reload Data">
1115
- <i class="pi pi-refresh" style="color: #00AEEF;"></i>
1113
+ <i class="pi pi-wrench" style="color: #969696;"></i>
1116
1114
  </button>
1115
+
1117
1116
  <button @click="addAllDevices()" class="reloadButton" title="Add all devices">
1118
- <i class="pi pi-plus" style="color: #00AEEF;"></i>
1117
+ <i class="pi pi-plus" style="color: #62ABE9;"></i> <span>Add all devices</span>
1118
+ </button>
1119
+
1120
+ <button @click="getData()" class="reloadButton" title="Reload Data">
1121
+ <i class="fa fa-refresh" style="color: #4D88B7;"></i> <span>Refresh tree</span>
1119
1122
  </button>
1120
1123
  </div>
1121
1124
  </div>
@@ -1157,12 +1160,12 @@
1157
1160
  </template>
1158
1161
  <template v-else>
1159
1162
  <button @click="addAllClicked(slotProps)" class="addAllButton bacnetbutton">
1160
- <i class="pi pi-plus-circle "><a class="allFunctionsText">Add all</a></i>
1163
+ <i class="pi pi-plus " title="Add all points"><a class="allFunctionsText"></a></i>
1161
1164
  </button>
1162
1165
  </template>
1163
1166
 
1164
1167
  <button @click="removeAllClicked(slotProps, this)" class="removeAllButton bacnetbutton">
1165
- <i class="pi pi-minus-circle "><a class="allFunctionsText">Remove all</a></i>
1168
+ <i class="pi pi-times" title="Remove all points"><a class="allFunctionsText">Remove all</a></i>
1166
1169
  </button>
1167
1170
  </div>
1168
1171
  </template>
@@ -1210,33 +1213,35 @@
1210
1213
  *
1211
1214
  *
1212
1215
  -->
1213
- <div id="read-readList-tab" style="display:none">
1216
+ <div id="read-readList-tab" class="read-readList-tab" style="display:none">
1214
1217
  <div class="removeAllDevicesDiv">
1215
1218
  <button @click="exportReadList()" class="export-points-button" title="Export Read List">
1216
- <i class="fa fa-cloud-download"> </i><a id="fileLabelText" style="padding-left: 10px;">Export</a>
1219
+ <i class="fa fa-arrow-circle-down"> </i><a id="fileLabelText" style="padding-left: 10px;">Export</a>
1217
1220
  </button>
1218
1221
  <a id="exportJSON" style="display: none"></a>
1219
1222
 
1220
1223
  <button @click="importReadList()" class="export-points-button" title="Import Read List">
1221
- <i class="fa fa-cloud-upload" id="importReadListButton"></i
1224
+ <i class="fa fa-arrow-circle-up" id="importReadListButton"></i
1222
1225
  ><a id="fileLabelText" style="padding-left: 10px;">Import</a>
1223
1226
  </button>
1224
1227
  <input type="file" id="readlist-file-upload" accept="application/JSON" class="inputStyle" style="display: none;" />
1225
1228
 
1226
1229
  <button @click="removeAllDevices()" class="removeAllDevicesButton" title="Remove all devices">
1227
- <a style="color: #ff0000;">Remove All Devices</a>
1230
+ <i class="pi pi-times" title="Remove all points"></i> <a>Remove all devices</a>
1228
1231
  </button>
1229
1232
 
1230
- <button @click="refreshReadListTree()" class="refreshReadListButton" title="Refresh tree">
1231
- <i class="pi pi-refresh" style="color: #00AEEF;"> </i>
1233
+ <button @click="refreshReadListTree()" class="reloadButton bp-read-list-refresh-button" title="Refresh tree">
1234
+ <i class="fa fa-refresh" style="color: #4D88B7;"> </i><span>Refresh tree</span>
1232
1235
  </button>
1236
+
1237
+
1233
1238
  </div>
1234
1239
 
1235
1240
  <p-tree :value="readDevices">
1236
1241
  <template #device="slotProps">
1237
1242
  <b class="deviceLabel">{{slotProps.node.label}} </b>
1238
1243
  <button @click="removeAllClicked(slotProps, this)" class="removeAllButton bacnetbutton">
1239
- <i class="pi pi-minus-circle "><a class="allFunctionsText">Remove all</a></i>
1244
+ <i class="pi pi-times"><a class="allFunctionsText">Remove device</a></i>
1240
1245
  </button>
1241
1246
  </template>
1242
1247
 
@@ -1256,16 +1261,17 @@
1256
1261
  *
1257
1262
  -->
1258
1263
  <div id="read-properties-tab" style="display:none">
1259
- <div class="form-row" style="display: flex; width: fit-content; flex-wrap: nowrap; flex-direction: column;">
1264
+ <div class="form-row bp-prop-row" style="display: flex; flex-wrap: nowrap; flex-direction: column;">
1260
1265
  <label
1261
1266
  for="node-input-object_properties_group"
1262
- style="display: flex; align-items: center; white-space: nowrap; text-decoration: underline;"
1263
- >Object Properties:</label
1267
+ style="display: flex; align-items: center; white-space: nowrap;"
1268
+ class="bp-prop-heading"
1269
+ >Object Properties</label
1264
1270
  >
1265
1271
 
1266
1272
  <div
1267
1273
  id="node-input-object_properties_group"
1268
- style="display: flex; align-items: flex-start; flex-direction: column; padding-left: 50px;">
1274
+ style="display: flex; align-items: flex-start; flex-direction: column;">
1269
1275
  <div class="objectPropertiesLabel">
1270
1276
  <label
1271
1277
  for="node-input-object_property_simplePayload"
@@ -1274,7 +1280,7 @@
1274
1280
  <i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_property_simplePayload"></span>
1275
1281
  <input
1276
1282
  style="margin-left: 5px;"
1277
- class=" objectProp"
1283
+ class=" objectProp checkbox-round"
1278
1284
  type="checkbox"
1279
1285
  id="node-input-object_property_simplePayload" />
1280
1286
  <a style="white-space: nowrap; padding-left: 20px;">Simple Payload</a>
@@ -1289,7 +1295,7 @@
1289
1295
  <i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_property_simpleWithStatus"></span>
1290
1296
  <input
1291
1297
  style="margin-left: 5px;"
1292
- class=" objectProp"
1298
+ class=" objectProp checkbox-round"
1293
1299
  type="checkbox"
1294
1300
  id="node-input-object_property_simpleWithStatus" />
1295
1301
  <a style="white-space: nowrap; padding-left: 20px;">Simple With Status</a>
@@ -1304,23 +1310,20 @@
1304
1310
  <i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.object_property_fullObject"></span>
1305
1311
  <input
1306
1312
  style="margin-left: 5px;"
1307
- class=" objectProp"
1313
+ class=" objectProp checkbox-round"
1308
1314
  type="checkbox"
1309
1315
  id="node-input-object_property_fullObject" />
1310
1316
  <a style="white-space: nowrap; padding-left: 20px;">Full Object</a>
1311
1317
  </label>
1312
1318
  </div>
1313
-
1314
1319
  </div>
1315
1320
  </div>
1316
1321
 
1317
- <hr />
1318
-
1319
- <div class="form-row msgTypeDiv" style="display: flex;">
1320
- <label for="node-input-msgType" style="text-decoration: underline;"> Message type: </label>
1322
+ <div class="form-row msgTypeDiv bp-prop-row" style="display: flex;">
1323
+ <label for="node-input-msgType" class="bp-prop-heading"> Message type </label>
1321
1324
  <div
1322
1325
  id="node-input-msgType"
1323
- style="display: flex; align-items: flex-start; flex-direction: column; padding-left: 50px;">
1326
+ style="display: flex; align-items: flex-start; flex-direction: column;">
1324
1327
  <!-- class= checkbox-round -->
1325
1328
  <div style="display: flex; flex-direction: row; align-items: flex-start;">
1326
1329
  <input
@@ -1358,24 +1361,23 @@
1358
1361
  </div>
1359
1362
  </div>
1360
1363
 
1361
- <hr />
1362
-
1363
- <div class="objectPropertiesLabel" style="margin-top: 20px; margin-bottom: 20px;">
1364
+ <div class="bp-checkbox-row bp-readnode-useDeviceName">
1364
1365
  <label
1365
1366
  for="node-input-useDeviceName"
1366
- style="width: auto; align-items: start;"
1367
+ style="padding-left: 4px; align-items: start;"
1367
1368
  class="objectPropertiesLabel">
1368
- <i class="icon-tag"></i> <span data-i18n="bitpool-bacnet.label.useDeviceName"></span>
1369
+ <span data-i18n="bitpool-bacnet.label.useDeviceName"></span>
1370
+ <a style="white-space: nowrap;">Use device name in topic</a>
1369
1371
  <input
1370
- class=" objectProp"
1372
+ style="margin-left: 10px; bottom: 3px;"
1373
+ class=" objectProp bp-checkbox"
1371
1374
  type="checkbox"
1372
1375
  id="node-input-useDeviceName" />
1373
- <a style="white-space: nowrap; padding-left: 20px;">Use device name in topic</a>
1374
1376
  </label>
1375
1377
  </div>
1376
1378
 
1377
- <div class="form-row">
1378
- <label for="node-input-roundDecimal"> Decimal place precision </label>
1379
+ <div class="form-row bp-row">
1380
+ <label> Decimal place precision </label>
1379
1381
  <input type="number" id="node-input-roundDecimal" placeholder="None" />
1380
1382
  </div>
1381
1383
 
@@ -1385,10 +1387,11 @@
1385
1387
  <input style="display: none !important;" type="checkbox" id="node-input-hiddenDeployToggle" />
1386
1388
  </label>
1387
1389
 
1388
- <div class="form-row">
1389
- <label for="node-input-exportCsv"> Points List </label>
1390
+ <hr>
1391
+
1392
+ <div class="form-row bp-import-buttons">
1390
1393
  <label for="points-export" class="export-points-button" @click="exportPointListCsv()">
1391
- <i class="fa fa-cloud-download" id="fileLabel"></i> <a id="points-export" style="padding-left: 10px;">Export</a>
1394
+ <i class="fa fa-arrow-circle-down" id="fileLabel"></i> <a id="points-export" style="padding-left: 10px;">Export point list</a>
1392
1395
  </label>
1393
1396
  </div>
1394
1397
  </div>
package/bacnet_read.js CHANGED
@@ -5,7 +5,6 @@
5
5
 
6
6
 
7
7
  module.exports = function (RED) {
8
- const http = require("http");
9
8
  const { ReadCommandConfig } = require('./common');
10
9
  const baEnum = require('./resources/node-bacstack-ts/dist/index.js').enum;
11
10
 
@@ -54,72 +53,82 @@ module.exports = function (RED) {
54
53
  };
55
54
 
56
55
  node.on('input', function (msg) {
57
- node.status({ fill: "blue", shape: "dot", text: "Reading values" });
58
-
59
- let object_property_simplePayload = false;
60
- let object_property_simpleWithStatus = false;
61
- let object_property_fullObject = false;
62
-
63
- let jsonType = false;
64
- let mqttType = false;
65
- let pointJsonType = false;
66
- let useDeviceName = false;
67
-
68
- if (msg.simplePayload) {
69
- object_property_simplePayload = msg.simplePayload;
70
- } else if (msg.simpleWithStatus) {
71
- object_property_simpleWithStatus = msg.simpleWithStatus;
72
- } else if (msg.fullObject) {
73
- object_property_fullObject = msg.fullObject;
74
- } else {
75
- object_property_simplePayload = node.object_property_simplePayload;
76
- object_property_simpleWithStatus = node.object_property_simpleWithStatus;
77
- object_property_fullObject = node.object_property_fullObject;
78
- }
79
56
 
80
- if (msg.json) {
81
- jsonType = msg.json;
82
- } else if (msg.mqtt) {
83
- mqttType = msg.mqtt;
84
- } else if (msg.pointJson) {
85
- pointJsonType = msg.pointJson;
86
- } else {
87
- jsonType = node.json;
88
- mqttType = node.mqtt;
89
- pointJsonType = node.pointJson
90
- }
57
+ if (msg.applyDisplayNames) {
58
+
59
+ msg.pointsToRead = node.pointsToRead;
60
+ node.send(msg);
91
61
 
92
- if (msg.useDeviceName) {
93
- useDeviceName = msg.useDeviceName;
94
62
  } else {
95
- useDeviceName = node.useDeviceName;
96
- }
97
63
 
98
- let readConfig = new ReadCommandConfig(node.pointsToRead, node.object_props, node.roundDecimal);
99
-
100
- let output = {
101
- type: "Read",
102
- id: node.id,
103
- readNodeName: node.nodeName,
104
- options: readConfig,
105
- objectPropertyType: {
106
- simplePayload: object_property_simplePayload,
107
- simpleWithStatus: object_property_simpleWithStatus,
108
- fullObject: object_property_fullObject
109
- },
110
- outputType: {
111
- json: jsonType,
112
- mqtt: mqttType,
113
- pointJson: pointJsonType,
114
- useDeviceName: useDeviceName
64
+ node.status({ fill: "blue", shape: "dot", text: "Reading values" });
65
+
66
+ let object_property_simplePayload = false;
67
+ let object_property_simpleWithStatus = false;
68
+ let object_property_fullObject = false;
69
+
70
+ let jsonType = false;
71
+ let mqttType = false;
72
+ let pointJsonType = false;
73
+ let useDeviceName = false;
74
+
75
+ if (msg.simplePayload) {
76
+ object_property_simplePayload = msg.simplePayload;
77
+ } else if (msg.simpleWithStatus) {
78
+ object_property_simpleWithStatus = msg.simpleWithStatus;
79
+ } else if (msg.fullObject) {
80
+ object_property_fullObject = msg.fullObject;
81
+ } else {
82
+ object_property_simplePayload = node.object_property_simplePayload;
83
+ object_property_simpleWithStatus = node.object_property_simpleWithStatus;
84
+ object_property_fullObject = node.object_property_fullObject;
115
85
  }
116
- };
117
86
 
118
- node.send(output);
87
+ if (msg.json) {
88
+ jsonType = msg.json;
89
+ } else if (msg.mqtt) {
90
+ mqttType = msg.mqtt;
91
+ } else if (msg.pointJson) {
92
+ pointJsonType = msg.pointJson;
93
+ } else {
94
+ jsonType = node.json;
95
+ mqttType = node.mqtt;
96
+ pointJsonType = node.pointJson
97
+ }
98
+
99
+ if (msg.useDeviceName) {
100
+ useDeviceName = msg.useDeviceName;
101
+ } else {
102
+ useDeviceName = node.useDeviceName;
103
+ }
119
104
 
120
- setTimeout(() => {
121
- node.status({});
122
- }, 3000);
105
+ let readConfig = new ReadCommandConfig(node.pointsToRead, node.object_props, node.roundDecimal);
106
+
107
+ let output = {
108
+ type: "Read",
109
+ id: node.id,
110
+ readNodeName: node.nodeName,
111
+ options: readConfig,
112
+ objectPropertyType: {
113
+ simplePayload: object_property_simplePayload,
114
+ simpleWithStatus: object_property_simpleWithStatus,
115
+ fullObject: object_property_fullObject
116
+ },
117
+ outputType: {
118
+ json: jsonType,
119
+ mqtt: mqttType,
120
+ pointJson: pointJsonType,
121
+ useDeviceName: useDeviceName
122
+ }
123
+ };
124
+
125
+ node.send(output);
126
+
127
+ setTimeout(() => {
128
+ node.status({});
129
+ }, 3000);
130
+
131
+ }
123
132
 
124
133
  });
125
134
 
package/bacnet_write.html CHANGED
@@ -170,7 +170,9 @@
170
170
  let foundDeviceIndex = this.writeDevices
171
171
  ? this.writeDevices.findIndex((ele) => ele.label == parentDeviceName)
172
172
  : -1;
173
- let device = this.deviceList.find((ele) => ele.deviceName == parentDeviceName);
173
+
174
+ const slotDeviceId = slotProps.node.parentDeviceId;
175
+ let device = this.deviceList.find((ele) => ele.deviceId == slotDeviceId);
174
176
  let deviceAddress = app.getDeviceAddress(device.address);
175
177
  let key = `${deviceAddress}-${device.deviceId}`;
176
178
  let parentDevice = this.devices.find((ele) => ele.ipAddr == deviceAddress);
@@ -852,7 +854,7 @@
852
854
  <div>
853
855
  <a class="countStatus" style="margin-left: 15px;">Count: {{deviceCount}} device(s)</a>
854
856
  <button @click="getData()" class="reloadButton">
855
- <i class="pi pi-refresh" style="color: #00AEEF;"><a class="allFunctionsText">Reload data</a></i>
857
+ <i class="fa fa-refresh" style="color: #4D88B7;"><a class="allFunctionsText">Refresh list</a></i>
856
858
  </button>
857
859
  </div>
858
860
 
@@ -920,7 +922,7 @@
920
922
  </p>
921
923
  </div>
922
924
 
923
- <div id="read-writeList-tab" style="display:none">
925
+ <div id="read-writeList-tab" class="read-writeList-tab" style="display:none">
924
926
  <p-tree :value="writeDevices">
925
927
  <template #device="slotProps">
926
928
  <b class="deviceLabel">{{slotProps.node.label}} </b>
@@ -936,7 +938,7 @@
936
938
  </div>
937
939
 
938
940
  <div id="read-write-tab" style="display:none">
939
- <div class="form-row">
941
+ <div class="form-row bp-row">
940
942
  <label for="node-input-applicationTag"
941
943
  ><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.applicationTag"></span> Application Tag</label
942
944
  >
@@ -982,7 +984,7 @@
982
984
  </select>
983
985
  </div>
984
986
 
985
- <div class="form-row">
987
+ <div class="form-row bp-row">
986
988
  <label for="node-input-priority"
987
989
  ><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.priority"></span> Priority</label
988
990
  >