@halsystems/red-bacnet 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.0]
|
|
4
|
+
### Changed
|
|
5
|
+
- `read_point` readMethod removed `Read Multiple Fallback Single` option
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Fixed dummy event emitter not catching output and error
|
|
9
|
+
- Fixed read point event emitter not catching error
|
|
10
|
+
|
|
11
|
+
## [1.3.0]
|
|
12
|
+
### Added
|
|
13
|
+
- WritePoint added concurrentTaskDelay config to control delay between concurrent tasks
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Default maxConcurrentDeviceRead to 1 for discover_point, read_point and write_point
|
|
17
|
+
|
|
3
18
|
## [1.2.0]
|
|
4
19
|
### Added
|
|
5
20
|
- DiscoverPoint and ReadPoint added concurrentTaskDelay config to control delay between concurrent tasks
|
package/common/bacnet.js
CHANGED
|
@@ -6,7 +6,7 @@ const EventEmitter = require('events');
|
|
|
6
6
|
const bacnet = require('@root/ext/node-bacstack/dist/index.js')
|
|
7
7
|
const baEnum = bacnet.enum;
|
|
8
8
|
|
|
9
|
-
const { EVENT_ERROR } = require('@root/common/core/constant.js')
|
|
9
|
+
const { EVENT_ERROR, EVENT_OUTPUT } = require('@root/common/core/constant.js')
|
|
10
10
|
const { concurrentTasks } = require('@root/common/core/concurrent.js')
|
|
11
11
|
const { getErrMsg } = require('@root/common/func.js')
|
|
12
12
|
|
|
@@ -266,6 +266,9 @@ module.exports = {
|
|
|
266
266
|
let failedCount = 0
|
|
267
267
|
let result_single = []
|
|
268
268
|
const dummyEventEmitter = new EventEmitter();
|
|
269
|
+
dummyEventEmitter.on(EVENT_OUTPUT, () => { });
|
|
270
|
+
dummyEventEmitter.on(EVENT_ERROR, () => { });
|
|
271
|
+
|
|
269
272
|
const tasks = reqArr.slice(reqArrIndexNext).flatMap((req, x) =>
|
|
270
273
|
req.properties.map((prop, y) => ({
|
|
271
274
|
id: `${x}-${y}`,
|
package/common/job/read_point.js
CHANGED
|
@@ -223,6 +223,10 @@ module.exports = {
|
|
|
223
223
|
count++;
|
|
224
224
|
});
|
|
225
225
|
|
|
226
|
+
smartReadEvent.on(EVENT_ERROR, (data) => {
|
|
227
|
+
this.eventEmitter.emit(EVENT_ERROR, data)
|
|
228
|
+
});
|
|
229
|
+
|
|
226
230
|
const tasks = entries
|
|
227
231
|
.filter(([_, v]) => Array.isArray(v.points) && v.points.length > 0) // eslint-disable-line
|
|
228
232
|
.map(([k, v]) => ({
|
package/package.json
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
discoverMode: { value: 0, required: true, validate: RED.validators.number() },
|
|
9
9
|
readMethod: { value: 2, required: true, validate: RED.validators.number() },
|
|
10
10
|
groupExportDeviceCount: { value: 30000, required: true, validate: RED.validators.number() },
|
|
11
|
-
maxConcurrentDeviceRead: { value:
|
|
11
|
+
maxConcurrentDeviceRead: { value: 1, required: true, validate: RED.validators.number() },
|
|
12
12
|
maxConcurrentSinglePointRead: { value: 10, required: true, validate: RED.validators.number() },
|
|
13
|
-
concurrentTaskDelay: { value:
|
|
13
|
+
concurrentTaskDelay: { value: 0, required: true, validate: RED.validators.number() },
|
|
14
14
|
},
|
|
15
15
|
inputs: 1,
|
|
16
16
|
outputs: 1,
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
</div>
|
|
53
53
|
<div class="form-row">
|
|
54
54
|
<label for="node-input-maxConcurrentDeviceRead"><i class="fa fa-tag"></i> Max Concurrent Device Read</label>
|
|
55
|
-
<input type="number" id="node-input-maxConcurrentDeviceRead" placeholder="
|
|
55
|
+
<input type="number" id="node-input-maxConcurrentDeviceRead" placeholder="1" , min="1" , max="1000">
|
|
56
56
|
</div>
|
|
57
57
|
<div class="form-row">
|
|
58
58
|
<label for="node-input-maxConcurrentSinglePointRead"><i class="fa fa-tag"></i> Max Concurrent Single Point Read</label>
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
</div>
|
|
61
61
|
<div class="form-row">
|
|
62
62
|
<label for="node-input-concurrentTaskDelay"><i class="fa fa-tag"></i> Concurrent Task Delay (ms)</label>
|
|
63
|
-
<input type="number" id="node-input-concurrentTaskDelay" placeholder="
|
|
63
|
+
<input type="number" id="node-input-concurrentTaskDelay" placeholder="0" min="0" max="10000">
|
|
64
64
|
</div>
|
|
65
65
|
</script>
|
|
66
66
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
name: { value: "" },
|
|
7
7
|
client: { type: "bacnet client", required: true },
|
|
8
8
|
readMethod: { value: 1, required: true, validate: RED.validators.number() },
|
|
9
|
-
maxConcurrentDeviceRead: { value:
|
|
9
|
+
maxConcurrentDeviceRead: { value: 1, required: true, validate: RED.validators.number() },
|
|
10
10
|
maxConcurrentSinglePointRead: { value: 10, required: true, validate: RED.validators.number() },
|
|
11
|
-
concurrentTaskDelay: { value:
|
|
11
|
+
concurrentTaskDelay: { value: 0, required: true, validate: RED.validators.number() },
|
|
12
12
|
},
|
|
13
13
|
inputs: 1,
|
|
14
14
|
outputs: 1,
|
|
@@ -33,13 +33,12 @@
|
|
|
33
33
|
<label for="node-input-readMethod"><i class="fa fa-list"></i> Read Method</label>
|
|
34
34
|
<select id="node-input-readMethod">
|
|
35
35
|
<option value="0">Read Single Only</option>
|
|
36
|
-
<option value="1">Read
|
|
37
|
-
<option value="2">Comprehensive Read</option>
|
|
36
|
+
<option value="1">Comprehensive Read</option>
|
|
38
37
|
</select>
|
|
39
38
|
</div>
|
|
40
39
|
<div class="form-row">
|
|
41
40
|
<label for="node-input-maxConcurrentDeviceRead"><i class="fa fa-tag"></i> Max Concurrent Device Read</label>
|
|
42
|
-
<input type="number" id="node-input-maxConcurrentDeviceRead" placeholder="
|
|
41
|
+
<input type="number" id="node-input-maxConcurrentDeviceRead" placeholder="1" , min="1" , max="1000">
|
|
43
42
|
</div>
|
|
44
43
|
<div class="form-row">
|
|
45
44
|
<label for="node-input-maxConcurrentSinglePointRead"><i class="fa fa-tag"></i> Max Concurrent Single Point
|
|
@@ -48,7 +47,7 @@
|
|
|
48
47
|
</div>
|
|
49
48
|
<div class="form-row">
|
|
50
49
|
<label for="node-input-concurrentTaskDelay"><i class="fa fa-tag"></i> Concurrent Task Delay (ms)</label>
|
|
51
|
-
<input type="number" id="node-input-concurrentTaskDelay" placeholder="
|
|
50
|
+
<input type="number" id="node-input-concurrentTaskDelay" placeholder="0" , min="0" , max="10000">
|
|
52
51
|
</div>
|
|
53
52
|
</script>
|
|
54
53
|
|
|
@@ -62,8 +61,7 @@
|
|
|
62
61
|
|
|
63
62
|
<dt>readMethod<span class="property-type">number</span></dt>
|
|
64
63
|
<dd> <b>Read Single Only</b>: use <code>readProperty</code></dd>
|
|
65
|
-
<dd> <b>Read
|
|
66
|
-
<dd> <b>Comprehensive Read</b>: try <code>readPropertyMultiple</code> twice with high and conservative query size,fallback to <code>readProperty</code> if failed</dd>
|
|
64
|
+
<dd> <b>Comprehensive Read</b>: try <code>readPropertyMultiple</code>, reduce query size if failed, and fallback to <code>readProperty</code> if query size reduced to 1</dd>
|
|
67
65
|
|
|
68
66
|
<dt>maxConcurrentDeviceRead<span class="property-type">number</span></dt>
|
|
69
67
|
<dd> Devices count to discover simultaneously.</dd>
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
defaults: {
|
|
6
6
|
name: { value: "" },
|
|
7
7
|
client: { type: "bacnet client", required: true },
|
|
8
|
-
maxConcurrentDeviceWrite: { value:
|
|
8
|
+
maxConcurrentDeviceWrite: { value: 1, required: true, validate: RED.validators.number() },
|
|
9
9
|
maxConcurrentPointWrite: { value: 5, required: true, validate: RED.validators.number() },
|
|
10
|
+
concurrentTaskDelay: { value: 0, required: true, validate: RED.validators.number() },
|
|
10
11
|
},
|
|
11
12
|
inputs: 1,
|
|
12
13
|
outputs: 1,
|
|
@@ -29,12 +30,16 @@
|
|
|
29
30
|
</div>
|
|
30
31
|
<div class="form-row">
|
|
31
32
|
<label for="node-input-maxConcurrentDeviceWrite"><i class="fa fa-tag"></i> Max Concurrent Device Write</label>
|
|
32
|
-
<input type="number" id="node-input-maxConcurrentDeviceWrite" placeholder="
|
|
33
|
+
<input type="number" id="node-input-maxConcurrentDeviceWrite" placeholder="1" , min="1" , max="1000">
|
|
33
34
|
</div>
|
|
34
35
|
<div class="form-row">
|
|
35
36
|
<label for="node-input-maxConcurrentPointWrite"><i class="fa fa-tag"></i> Max Concurrent Point Write</label>
|
|
36
37
|
<input type="number" id="node-input-maxConcurrentPointWrite" placeholder="5" , min="1" , max="1000">
|
|
37
38
|
</div>
|
|
39
|
+
<div class="form-row">
|
|
40
|
+
<label for="node-input-concurrentTaskDelay"><i class="fa fa-tag"></i> Concurrent Task Delay</label>
|
|
41
|
+
<input type="number" id="node-input-concurrentTaskDelay" placeholder="0" , min="0" , max="10000">
|
|
42
|
+
</div>
|
|
38
43
|
</script>
|
|
39
44
|
|
|
40
45
|
<script type="text/html" data-help-name="write point">
|
|
@@ -52,6 +57,9 @@
|
|
|
52
57
|
<dt>maxConcurrentPointWrite<span class="property-type">number</span></dt>
|
|
53
58
|
<dd> Number of points to write simultaneously</dd>
|
|
54
59
|
<dd> <b>USE WITH CAUTION!</b> Reduce to low value if field BACnet device is underpowered</dd>
|
|
60
|
+
|
|
61
|
+
<dt>concurrentTaskDelay<span class="property-type">number</span></dt>
|
|
62
|
+
<dd> Delay in milliseconds between delay writing</dd>
|
|
55
63
|
</dl>
|
|
56
64
|
|
|
57
65
|
<h3>Inputs</h3>
|
|
@@ -73,4 +81,4 @@
|
|
|
73
81
|
|
|
74
82
|
<h3>Details</h3>
|
|
75
83
|
<p>If node is triggered while existing job is running, new job will be coalesced if <code>msg.id</code> are identical, else new job will be put in queue until current job is completed.</p>
|
|
76
|
-
</script>
|
|
84
|
+
</script>
|
|
@@ -23,6 +23,7 @@ module.exports = function (RED) {
|
|
|
23
23
|
this.client = RED.nodes.getNode(config.client).instance;
|
|
24
24
|
this.maxConcurrentDeviceWrite = +config.maxConcurrentDeviceWrite
|
|
25
25
|
this.maxConcurrentPointWrite = +config.maxConcurrentPointWrite
|
|
26
|
+
this.concurrentTaskDelay = +config.concurrentTaskDelay
|
|
26
27
|
|
|
27
28
|
// events
|
|
28
29
|
this.#subscribeListeners();
|
|
@@ -45,7 +46,8 @@ module.exports = function (RED) {
|
|
|
45
46
|
msg.points,
|
|
46
47
|
msg.writePoints,
|
|
47
48
|
this.maxConcurrentDeviceWrite,
|
|
48
|
-
this.maxConcurrentPointWrite
|
|
49
|
+
this.maxConcurrentPointWrite,
|
|
50
|
+
this.concurrentTaskDelay
|
|
49
51
|
);
|
|
50
52
|
|
|
51
53
|
this.job.addJob({
|
|
@@ -81,4 +83,3 @@ module.exports = function (RED) {
|
|
|
81
83
|
// ----- register node -----
|
|
82
84
|
RED.nodes.registerType('write point', WritePoint);
|
|
83
85
|
}
|
|
84
|
-
|