@bldgblocks/node-red-contrib-control 0.1.31 → 0.1.33
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/nodes/accumulate-block.html +1 -1
- package/nodes/add-block.html +1 -1
- package/nodes/analog-switch-block.html +1 -1
- package/nodes/and-block.html +1 -1
- package/nodes/average-block.html +1 -1
- package/nodes/boolean-switch-block.html +1 -1
- package/nodes/boolean-to-number-block.html +1 -1
- package/nodes/cache-block.html +1 -1
- package/nodes/call-status-block.html +1 -1
- package/nodes/changeover-block.html +1 -1
- package/nodes/comment-block.html +1 -1
- package/nodes/compare-block.html +1 -1
- package/nodes/contextual-label-block.html +1 -1
- package/nodes/convert-block.html +1 -1
- package/nodes/count-block.html +2 -2
- package/nodes/delay-block.html +1 -1
- package/nodes/divide-block.html +1 -1
- package/nodes/edge-block.html +1 -1
- package/nodes/enum-switch-block.html +1 -1
- package/nodes/frequency-block.html +1 -1
- package/nodes/global-getter.html +43 -4
- package/nodes/global-getter.js +114 -34
- package/nodes/global-setter.html +21 -10
- package/nodes/global-setter.js +154 -79
- package/nodes/history-collector.html +283 -0
- package/nodes/history-collector.js +150 -0
- package/nodes/history-config.html +236 -0
- package/nodes/history-config.js +8 -0
- package/nodes/hysteresis-block.html +1 -1
- package/nodes/interpolate-block.html +1 -1
- package/nodes/latch-block.html +1 -1
- package/nodes/load-sequence-block.html +1 -1
- package/nodes/max-block.html +1 -1
- package/nodes/memory-block.html +1 -1
- package/nodes/min-block.html +1 -1
- package/nodes/minmax-block.html +1 -1
- package/nodes/modulo-block.html +1 -1
- package/nodes/multiply-block.html +1 -1
- package/nodes/negate-block.html +1 -1
- package/nodes/network-point-registry.html +86 -0
- package/nodes/network-point-registry.js +90 -0
- package/nodes/network-read.html +56 -0
- package/nodes/network-read.js +59 -0
- package/nodes/network-register.html +110 -0
- package/nodes/network-register.js +161 -0
- package/nodes/network-write.html +64 -0
- package/nodes/network-write.js +126 -0
- package/nodes/nullify-block.html +1 -1
- package/nodes/on-change-block.html +1 -1
- package/nodes/oneshot-block.html +1 -1
- package/nodes/or-block.html +1 -1
- package/nodes/pid-block.html +1 -1
- package/nodes/priority-block.html +1 -1
- package/nodes/rate-limit-block.html +2 -2
- package/nodes/rate-of-change-block.html +1 -1
- package/nodes/rate-of-change-block.js +5 -2
- package/nodes/round-block.html +6 -5
- package/nodes/round-block.js +5 -3
- package/nodes/saw-tooth-wave-block.html +2 -2
- package/nodes/scale-range-block.html +1 -1
- package/nodes/sine-wave-block.html +2 -2
- package/nodes/string-builder-block.html +1 -1
- package/nodes/subtract-block.html +1 -1
- package/nodes/thermistor-block.html +1 -1
- package/nodes/tick-tock-block.html +2 -2
- package/nodes/time-sequence-block.html +1 -1
- package/nodes/triangle-wave-block.html +2 -2
- package/nodes/tstat-block.html +1 -1
- package/nodes/units-block.html +8 -38
- package/nodes/units-block.js +3 -42
- package/package.json +11 -4
package/nodes/add-block.html
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<!-- JavaScript Section: Registers the node and handles editor logic -->
|
|
14
14
|
<script type="text/javascript">
|
|
15
15
|
RED.nodes.registerType("analog-switch-block", {
|
|
16
|
-
category: "control",
|
|
16
|
+
category: "bldgblocks control",
|
|
17
17
|
color: "#301934",
|
|
18
18
|
defaults: {
|
|
19
19
|
name: { value: "" },
|
package/nodes/and-block.html
CHANGED
package/nodes/average-block.html
CHANGED
package/nodes/cache-block.html
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<!-- JavaScript Section: Registers the node and handles editor logic -->
|
|
14
14
|
<script type="text/javascript">
|
|
15
15
|
RED.nodes.registerType("cache-block", {
|
|
16
|
-
category: "control",
|
|
16
|
+
category: "bldgblocks control",
|
|
17
17
|
color: "#301934",
|
|
18
18
|
defaults: {
|
|
19
19
|
name: { value: "" },
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<!-- JavaScript Section: Registers the node and handles editor logic -->
|
|
34
34
|
<script type="text/javascript">
|
|
35
35
|
RED.nodes.registerType("call-status-block", {
|
|
36
|
-
category: "control",
|
|
36
|
+
category: "bldgblocks control",
|
|
37
37
|
color: "#301934",
|
|
38
38
|
defaults: {
|
|
39
39
|
name: { value: "" },
|
package/nodes/comment-block.html
CHANGED
package/nodes/compare-block.html
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<!-- JavaScript Section: Registers the node and handles editor logic -->
|
|
14
14
|
<script type="text/javascript">
|
|
15
15
|
RED.nodes.registerType("compare-block", {
|
|
16
|
-
category: "control",
|
|
16
|
+
category: "bldgblocks control",
|
|
17
17
|
color: "#301934",
|
|
18
18
|
defaults: {
|
|
19
19
|
name: { value: "" },
|
package/nodes/convert-block.html
CHANGED
package/nodes/count-block.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<!-- JavaScript Section: Registers the node and handles editor logic -->
|
|
10
10
|
<script type="text/javascript">
|
|
11
11
|
RED.nodes.registerType("count-block", {
|
|
12
|
-
category: "control",
|
|
12
|
+
category: "bldgblocks control",
|
|
13
13
|
color: "#301934",
|
|
14
14
|
defaults: {
|
|
15
15
|
name: { value: "" }
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
outputs: 1,
|
|
19
19
|
inputLabels: ["input"],
|
|
20
20
|
outputLabels: ["count"],
|
|
21
|
-
icon: "font-awesome/fa-
|
|
21
|
+
icon: "font-awesome/fa-calculator",
|
|
22
22
|
paletteLabel: "count",
|
|
23
23
|
label: function() {
|
|
24
24
|
return this.name || "count";
|
package/nodes/delay-block.html
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<!-- JavaScript Section: Registers the node and handles editor logic -->
|
|
34
34
|
<script type="text/javascript">
|
|
35
35
|
RED.nodes.registerType("delay-block", {
|
|
36
|
-
category: "control",
|
|
36
|
+
category: "bldgblocks control",
|
|
37
37
|
color: "#301934",
|
|
38
38
|
defaults: {
|
|
39
39
|
name: { value: "" },
|
package/nodes/divide-block.html
CHANGED
package/nodes/edge-block.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<!-- JavaScript Section: Registers the node and handles editor logic -->
|
|
10
10
|
<script type="text/javascript">
|
|
11
11
|
RED.nodes.registerType("frequency-block", {
|
|
12
|
-
category: "control",
|
|
12
|
+
category: "bldgblocks control",
|
|
13
13
|
color: "#301934",
|
|
14
14
|
defaults: {
|
|
15
15
|
name: { value: "" }
|
package/nodes/global-getter.html
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
</button>
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
|
-
<!-- NEW: Trigger Mode Selection -->
|
|
16
15
|
<div class="form-row">
|
|
17
16
|
<label for="node-input-updates"><i class="fa fa-bolt"></i> Trigger</label>
|
|
18
17
|
<select id="node-input-updates" style="width: 70%;">
|
|
@@ -26,6 +25,14 @@
|
|
|
26
25
|
<input type="text" id="node-input-outputProperty" placeholder="payload" style="width:70%;">
|
|
27
26
|
</div>
|
|
28
27
|
|
|
28
|
+
<div class="form-row">
|
|
29
|
+
<label for="node-input-detail"><i class="fa fa-book"></i> Detail</label>
|
|
30
|
+
<select id="node-input-detail" style="width: 70%;">
|
|
31
|
+
<option value="getValue">Get Simple Value</option>
|
|
32
|
+
<option value="getObject">Get Full Object</option>
|
|
33
|
+
</select>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
29
36
|
<div class="form-tips">
|
|
30
37
|
<b>Note:</b> Targeting by Node ID allows the source path to change without breaking this link.
|
|
31
38
|
</div>
|
|
@@ -33,13 +40,14 @@
|
|
|
33
40
|
|
|
34
41
|
<script type="text/javascript">
|
|
35
42
|
RED.nodes.registerType('global-getter', {
|
|
36
|
-
category:
|
|
43
|
+
category: "bldgblocks control",
|
|
37
44
|
color: '#3FADB5',
|
|
38
45
|
defaults: {
|
|
39
46
|
name: { value: "" },
|
|
40
47
|
targetNode: { value: "", required: true },
|
|
41
48
|
outputProperty: { value: "payload", required: true },
|
|
42
|
-
updates: { value: "always", required: true }
|
|
49
|
+
updates: { value: "always", required: true },
|
|
50
|
+
detail: {value: "getObject", required: true }
|
|
43
51
|
},
|
|
44
52
|
inputs: 1,
|
|
45
53
|
outputs: 1,
|
|
@@ -48,7 +56,7 @@
|
|
|
48
56
|
if (this.targetNode) {
|
|
49
57
|
const target = RED.nodes.node(this.targetNode);
|
|
50
58
|
if (target) {
|
|
51
|
-
let lbl = target.
|
|
59
|
+
let lbl = target.name || target.path;
|
|
52
60
|
if(lbl && lbl.startsWith("#") && lbl.includes(":")) {
|
|
53
61
|
lbl = lbl.substring(lbl.indexOf(":") + 1);
|
|
54
62
|
}
|
|
@@ -91,3 +99,34 @@
|
|
|
91
99
|
}
|
|
92
100
|
});
|
|
93
101
|
</script>
|
|
102
|
+
|
|
103
|
+
<!-- Help Section -->
|
|
104
|
+
<script type="text/markdown" data-help-name="global-setter">
|
|
105
|
+
Manage a global variable in a repeatable way.
|
|
106
|
+
|
|
107
|
+
### Inputs
|
|
108
|
+
Retreived object will overwrite msg.
|
|
109
|
+
|
|
110
|
+
### Outputs
|
|
111
|
+
: payload (object) : The stored object with values and metadata.
|
|
112
|
+
|
|
113
|
+
### Details
|
|
114
|
+
Global variables are meant to be retrieved in other places, this necessarily means managing the same string in multiple places.
|
|
115
|
+
|
|
116
|
+
This node allows you to get a global variable anywhere from one source, while supporting rename and deletion.
|
|
117
|
+
|
|
118
|
+
The source can be found using the search button. The payload property can be specified and can be set to only the value for chaining.
|
|
119
|
+
|
|
120
|
+
Reactive updates means every time the source is updated those nodes will receive the new value via event.
|
|
121
|
+
|
|
122
|
+
### Status
|
|
123
|
+
- Green (dot): Configuration update
|
|
124
|
+
- Blue (dot): State changed
|
|
125
|
+
- Blue (ring): State unchanged
|
|
126
|
+
- Red (ring): Error
|
|
127
|
+
- Yellow (ring): Warning
|
|
128
|
+
|
|
129
|
+
### References
|
|
130
|
+
- [Node-RED Documentation](https://nodered.org/docs/)
|
|
131
|
+
- [GitHub Repository](https://github.com/BldgBlocks/node-red-contrib-buildingblocks-control.git)
|
|
132
|
+
</script>
|
package/nodes/global-getter.js
CHANGED
|
@@ -5,38 +5,44 @@ module.exports = function(RED) {
|
|
|
5
5
|
node.targetNodeId = config.targetNode;
|
|
6
6
|
node.outputProperty = config.outputProperty || "payload";
|
|
7
7
|
node.updates = config.updates;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
node.detail = config.detail;
|
|
9
|
+
|
|
10
|
+
let setterNode = null;
|
|
11
|
+
let retryAction = null;
|
|
12
|
+
let healthCheckAction = null;
|
|
13
|
+
let updateListener = null;
|
|
14
|
+
let retryCount = 0;
|
|
15
|
+
const retryDelays = [0, 100, 500, 1000, 2000, 4000, 8000, 16000];
|
|
16
|
+
const maxRetries = retryDelays.length - 1;
|
|
10
17
|
|
|
11
|
-
// ---
|
|
18
|
+
// --- Process Wrapper and Send Msg ---
|
|
12
19
|
function sendValue(storedObject, msgToReuse) {
|
|
13
20
|
const msg = msgToReuse || {};
|
|
14
21
|
|
|
15
|
-
if (storedObject !== undefined) {
|
|
22
|
+
if (storedObject !== undefined && storedObject !== null) {
|
|
16
23
|
|
|
17
24
|
// CHECK: Is this our Wrapper Format? (Created by Global Setter)
|
|
18
|
-
if (storedObject && typeof storedObject === 'object' && storedObject.hasOwnProperty('value')) {
|
|
19
|
-
|
|
20
|
-
// 1. Separate the Value from everything else (Rest operator)
|
|
21
|
-
// 'attributes' will contain: priority, units, metadata, topic, etc.
|
|
22
|
-
const { value, ...attributes } = storedObject;
|
|
25
|
+
if (storedObject && typeof storedObject === 'object' && storedObject.hasOwnProperty('value')) {
|
|
23
26
|
|
|
24
|
-
//
|
|
25
|
-
RED.util.setMessageProperty(msg, node.outputProperty, value);
|
|
26
|
-
|
|
27
|
-
// 3. Merge all attributes onto the msg root
|
|
27
|
+
// Merge all attributes onto the msg root
|
|
28
28
|
// This automatically handles priority, units, metadata, and any future fields
|
|
29
|
-
|
|
29
|
+
if (node.detail === "getObject") {
|
|
30
|
+
Object.assign(msg, storedObject);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Set the Main Output (e.g. msg.payload = 75)
|
|
34
|
+
RED.util.setMessageProperty(msg, node.outputProperty, storedObject.value);
|
|
30
35
|
|
|
31
36
|
} else {
|
|
32
|
-
// Handle Legacy/Raw values (not created by
|
|
37
|
+
// Handle Legacy/Raw values (not created by Setter)
|
|
33
38
|
RED.util.setMessageProperty(msg, node.outputProperty, storedObject);
|
|
34
39
|
msg.metadata = { path: setterNode ? setterNode.varName : "unknown", legacy: true };
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
// Update Status
|
|
43
|
+
let valDisplay = RED.util.getMessageProperty(msg, node.outputProperty);
|
|
44
|
+
valDisplay = typeof valDisplay === "number" ? valDisplay : valDisplay;
|
|
45
|
+
node.status({ fill: "blue", shape: "dot", text: `get: ${valDisplay}` });
|
|
40
46
|
|
|
41
47
|
node.send(msg);
|
|
42
48
|
|
|
@@ -45,13 +51,87 @@ module.exports = function(RED) {
|
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
53
|
|
|
48
|
-
// ---
|
|
54
|
+
// --- Manage Event Subscription ---
|
|
55
|
+
function establishListener() {
|
|
56
|
+
// Look for source node
|
|
57
|
+
setterNode = RED.nodes.getNode(node.targetNodeId);
|
|
58
|
+
|
|
59
|
+
// If found, subscribe
|
|
60
|
+
if (setterNode && setterNode.varName && node.updates === 'always') {
|
|
61
|
+
if (updateListener) {
|
|
62
|
+
// Remove existing listener if we're retrying
|
|
63
|
+
RED.events.removeListener("bldgblocks-global-update", updateListener);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
updateListener = function(evt) {
|
|
67
|
+
if (evt.key === setterNode.varName && evt.store === setterNode.storeName) {
|
|
68
|
+
sendValue(evt.data, {});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
RED.events.on("bldgblocks-global-update", updateListener);
|
|
73
|
+
|
|
74
|
+
// Clear retry interval once successful
|
|
75
|
+
if (retryAction) {
|
|
76
|
+
clearInterval(retryAction);
|
|
77
|
+
retryAction = null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
node.status({ fill: "green", shape: "dot", text: "Connected" });
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// --- Maintain event subscription ---
|
|
87
|
+
function startHealthCheck() {
|
|
88
|
+
const healthCheckAction = () => {
|
|
89
|
+
const listeners = RED.events.listeners("bldgblocks-global-update");
|
|
90
|
+
const hasOurListener = listeners.includes(updateListener);
|
|
91
|
+
|
|
92
|
+
if (!hasOurListener) {
|
|
93
|
+
node.warn("Event listener lost, reconnecting...");
|
|
94
|
+
if (establishListener()) {
|
|
95
|
+
node.status({ fill: "green", shape: "dot", text: "Reconnected" });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Schedule next health check regardless of outcome
|
|
100
|
+
setTimeout(healthCheckAction, 30000);
|
|
101
|
+
};
|
|
102
|
+
// Inital start
|
|
103
|
+
setTimeout(healthCheckAction, 30000);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function subscribeWithRetry() {
|
|
107
|
+
// Recursive retry
|
|
108
|
+
retryAction = () => {
|
|
109
|
+
if (retryCount >= maxRetries) {
|
|
110
|
+
node.error("Failed to connect to setter node after multiple attempts");
|
|
111
|
+
node.status({ fill: "red", shape: "ring", text: "Connection failed" });
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (establishListener()) {
|
|
116
|
+
retryCount = 0;
|
|
117
|
+
return; // Success
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
retryCount++;
|
|
121
|
+
setTimeout(retryAction, retryDelays[Math.min(retryCount, maxRetries - 1)]);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
setTimeout(retryAction, retryDelays[0]);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// --- HANDLE MANUAL INPUT ---
|
|
49
128
|
node.on('input', function(msg, send, done) {
|
|
50
129
|
send = send || function() { node.send.apply(node, arguments); };
|
|
51
130
|
|
|
131
|
+
setterNode ??= RED.nodes.getNode(node.targetNodeId);
|
|
132
|
+
|
|
52
133
|
if (setterNode && setterNode.varName) {
|
|
53
|
-
const
|
|
54
|
-
const storedObject = globalContext.get(setterNode.varName, setterNode.storeName);
|
|
134
|
+
const storedObject = node.context().global.get(setterNode.varName, setterNode.storeName);
|
|
55
135
|
sendValue(storedObject, msg);
|
|
56
136
|
} else {
|
|
57
137
|
node.warn("Source node not found or not configured.");
|
|
@@ -61,24 +141,24 @@ module.exports = function(RED) {
|
|
|
61
141
|
if (done) done();
|
|
62
142
|
});
|
|
63
143
|
|
|
64
|
-
// ---
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
updateListener = function(evt) {
|
|
69
|
-
if (evt.key === setterNode.varName && evt.store === setterNode.storeName) {
|
|
70
|
-
// Pass data directly from event
|
|
71
|
-
sendValue(evt.data, {});
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
RED.events.on("bldgblocks-global-update", updateListener);
|
|
144
|
+
// --- HANDLE REACTIVE UPDATES ---
|
|
145
|
+
if (node.updates === 'always') {
|
|
146
|
+
subscribeWithRetry();
|
|
147
|
+
startHealthCheck();
|
|
75
148
|
}
|
|
76
149
|
|
|
77
150
|
// --- CLEANUP ---
|
|
78
|
-
node.on('close', function() {
|
|
79
|
-
if (
|
|
151
|
+
node.on('close', function(removed, done) {
|
|
152
|
+
if (healthCheckAction) {
|
|
153
|
+
clearInterval(healthCheckAction);
|
|
154
|
+
}
|
|
155
|
+
if (retryAction) {
|
|
156
|
+
clearInterval(retryAction);
|
|
157
|
+
}
|
|
158
|
+
if (removed && updateListener) {
|
|
80
159
|
RED.events.removeListener("bldgblocks-global-update", updateListener);
|
|
81
160
|
}
|
|
161
|
+
done();
|
|
82
162
|
});
|
|
83
163
|
}
|
|
84
164
|
RED.nodes.registerType("global-getter", GlobalGetterNode);
|
package/nodes/global-setter.html
CHANGED
|
@@ -20,45 +20,56 @@
|
|
|
20
20
|
<hr>
|
|
21
21
|
|
|
22
22
|
<div class="form-row">
|
|
23
|
-
<label for="node-input-defaultValue" title="
|
|
23
|
+
<label for="node-input-defaultValue" title="Manual default value to ensure one always exists. You may write to default through message configuration but may not set it to null."><i class="fa fa-undo"></i> Default</label>
|
|
24
24
|
<input type="text" id="node-input-defaultValue" placeholder="e.g. 0 or false">
|
|
25
|
+
<input type="hidden" id="node-input-defaultValueType">
|
|
25
26
|
</div>
|
|
26
27
|
|
|
27
28
|
<div class="form-tips">
|
|
28
|
-
<b>Note:</b> This node writes to the selected <b>Priority
|
|
29
|
+
<b>Note:</b> This node writes to the selected <b>Priority</b>, manually, by msg or flow. The actual Global Variable value will be the highest active priority.
|
|
29
30
|
</div>
|
|
30
31
|
</script>
|
|
31
32
|
|
|
32
33
|
<script type="text/javascript">
|
|
33
34
|
RED.nodes.registerType('global-setter', {
|
|
34
|
-
category:
|
|
35
|
+
category: "bldgblocks control",
|
|
35
36
|
color: '#E2D96E',
|
|
36
37
|
defaults: {
|
|
37
38
|
name: { value: "" },
|
|
38
39
|
path: { value: "", required: true },
|
|
39
40
|
property: { value: "payload", required: true },
|
|
40
41
|
defaultValue: { value: "", required: true },
|
|
41
|
-
|
|
42
|
+
defaultValueType: { value: "num", required: true },
|
|
43
|
+
writePriority: { value: "default", required: true },
|
|
42
44
|
writePriorityType: { value: "dropdown" }
|
|
43
45
|
},
|
|
44
46
|
inputs: 1,
|
|
45
47
|
outputs: 1,
|
|
46
48
|
icon: "font-awesome/fa-align-right",
|
|
47
49
|
label: function() {
|
|
48
|
-
let lbl = this.path;
|
|
49
|
-
if (lbl
|
|
50
|
-
lbl
|
|
50
|
+
let lbl = this.name || this.path;
|
|
51
|
+
if (lbl) {
|
|
52
|
+
if (lbl && lbl.startsWith("#") && lbl.includes(":")) {
|
|
53
|
+
lbl = lbl.substring(lbl.indexOf(":") + 1);
|
|
54
|
+
}
|
|
55
|
+
return "set: " + lbl;
|
|
51
56
|
}
|
|
52
|
-
return this.name || "
|
|
57
|
+
return this.name || "global set";
|
|
53
58
|
},
|
|
54
59
|
paletteLabel: "global set",
|
|
55
60
|
oneditprepare: function() {
|
|
61
|
+
const node = this;
|
|
62
|
+
|
|
56
63
|
// These are read as strings not evaluated typed-inputs.
|
|
57
64
|
$("#node-input-path").typedInput({ types: ['global'] });
|
|
58
65
|
// getMessageProperty handles msg access on the incoming message at the specified path.
|
|
59
66
|
$("#node-input-property").typedInput({ types: ['msg'] });
|
|
60
67
|
// Default for the default value, meaning it should only be manually set. You can still pass default values through messages.
|
|
61
|
-
$("#node-input-defaultValue").typedInput({
|
|
68
|
+
$("#node-input-defaultValue").typedInput({
|
|
69
|
+
default: "num",
|
|
70
|
+
types: ["str", "num", "bool", "json"],
|
|
71
|
+
typeField: "#node-input-defaultValueType"
|
|
72
|
+
}).typedInput("type", node.defaultValueType || "num").typedInput("value", node.defaultValue);
|
|
62
73
|
|
|
63
74
|
$("#node-input-writePriority").typedInput({
|
|
64
75
|
default: "dropdown",
|
|
@@ -80,7 +91,7 @@
|
|
|
80
91
|
{ value: "13", label: "13"},
|
|
81
92
|
{ value: "14", label: "14"},
|
|
82
93
|
{ value: "15", label: "15"},
|
|
83
|
-
{ value: "16", label: "16 (
|
|
94
|
+
{ value: "16", label: "16 (Network Logic)"},
|
|
84
95
|
{ value: "default", label: "default (fallback)"},
|
|
85
96
|
]
|
|
86
97
|
}, "msg", "flow"],
|