node-red-contrib-mobius-flow-base 2.5.86-beta.1 → 2.5.86-beta.101

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.
Files changed (39) hide show
  1. package/dist/nodes/icons/mobius-inject.png +0 -0
  2. package/dist/nodes/icons/mobius.png +0 -0
  3. package/dist/nodes/mobius-clear-resource.html +178 -0
  4. package/dist/nodes/mobius-clear-resource.js +109 -0
  5. package/dist/nodes/mobius-connection.html +68 -0
  6. package/dist/nodes/mobius-connection.js +675 -0
  7. package/dist/nodes/mobius-discover-object-list.html +272 -0
  8. package/dist/nodes/mobius-discover-object-list.js +263 -0
  9. package/dist/nodes/mobius-discover.html +139 -0
  10. package/dist/nodes/mobius-discover.js +100 -0
  11. package/dist/nodes/mobius-filter-by-rid-value.html +206 -0
  12. package/dist/nodes/mobius-filter-by-rid-value.js +123 -0
  13. package/dist/nodes/mobius-flow-inject.html +162 -0
  14. package/dist/nodes/mobius-flow-inject.js +124 -0
  15. package/dist/nodes/mobius-get-multi-object.html +176 -0
  16. package/dist/nodes/mobius-get-multi-object.js +127 -0
  17. package/dist/nodes/mobius-get-multi-resource.html +195 -0
  18. package/dist/nodes/mobius-get-multi-resource.js +140 -0
  19. package/dist/nodes/mobius-get-object.html +168 -0
  20. package/dist/nodes/mobius-get-object.js +102 -0
  21. package/dist/nodes/mobius-get-resource.html +169 -0
  22. package/dist/nodes/mobius-get-resource.js +101 -0
  23. package/dist/nodes/mobius-object-cov.html +171 -0
  24. package/dist/nodes/mobius-object-cov.js +83 -0
  25. package/dist/nodes/mobius-resource-cov.html +155 -0
  26. package/dist/nodes/mobius-resource-cov.js +77 -0
  27. package/dist/nodes/mobius-send-bcmd.html +93 -0
  28. package/dist/nodes/mobius-send-bcmd.js +61 -0
  29. package/dist/nodes/mobius-send-dcmd.html +130 -0
  30. package/dist/nodes/mobius-send-dcmd.js +80 -0
  31. package/dist/nodes/mobius-set-multi-resource.html +150 -0
  32. package/dist/nodes/mobius-set-multi-resource.js +104 -0
  33. package/dist/nodes/mobius-set-resource.html +180 -0
  34. package/dist/nodes/mobius-set-resource.js +145 -0
  35. package/dist/nodes/mobius-sub-bcmd.html +94 -0
  36. package/dist/nodes/mobius-sub-bcmd.js +64 -0
  37. package/dist/nodes/node-red-ui-discover-devices.js +103 -0
  38. package/dist/nodes/validateURI.js +51 -0
  39. package/package.json +1 -1
Binary file
@@ -0,0 +1,178 @@
1
+ <!--
2
+ Copyright (C) 2016, IAConnects Technology Limited
3
+ All Rights Reserved
4
+
5
+ ALL INFORMATION CONTAINED HEREIN IS, AND REMAINS
6
+ THE PROPERTY OF IACONNECTS TECHNOLOGY LIMITED AND ITS SUPPLIERS,
7
+ IF ANY. THE INTELLECTUAL AND TECHNICAL CONCEPTS CONTAINED
8
+ HEREIN ARE PROPRIETARY TO IACONNECTS TECHNOLOGY LIMITED
9
+ AND ITS SUPPLIERS AND ARE PROTECTED BY TRADE SECRET OR COPYRIGHT LAW.
10
+ DISSEMINATION OF THIS INFORMATION OR REPRODUCTION OF THIS MATERIAL
11
+ IS STRICTLY FORBIDDEN UNLESS PRIOR WRITTEN PERMISSION IS OBTAINED
12
+ FROM IACONNECTS TECHNOLOGY LIMITED.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
18
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ POSSIBILITY OF SUCH DAMAGE.
25
+ -->
26
+
27
+ <script type="text/x-red" data-template-name="mobius clear resource">
28
+ <div class="form-row">
29
+ <label for="node-input-connection"><i class="fa fa-globe"></i> MOBiUS</label>
30
+ <input type="text" id="node-input-connection">
31
+ </div>
32
+ <div class="form-row">
33
+ <label for="node-input-resource"><i class="fa fa-tasks"></i> URI</label>
34
+ <input type="text" id="node-input-resource" placeholder="Resource URI (hid/sid/pid/ins/rid)">
35
+ </div>
36
+ <div class="form-row">
37
+ <label for="node-input-priority"><i class="fa fa-exclamation-triangle"></i> Priority</label>
38
+ <input type="text" id="node-input-priority" placeholder="Priotity to clear">
39
+ </div>
40
+ <div class="form-row">
41
+ <label>&nbsp;</label>
42
+ <input type="checkbox" id="node-input-detailedOutput" style="display: inline-block; width: auto; vertical-align: top;">
43
+ <label for="node-input-detailedOutput" style="width: 70%;"> Use detailed outputs</label>
44
+ </div>
45
+ <hr>
46
+ <div class="form-row">
47
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
48
+ <input type="text" id="node-input-name" placeholder="Name">
49
+ </div>
50
+ </script>
51
+
52
+ <script type="text/javascript">
53
+ RED.nodes.registerType('mobius clear resource',{
54
+ category: 'mobius',
55
+ defaults: {
56
+ name: {value:""},
57
+ detailedOutput: {value:false},
58
+ resource: {value:"", validate:function(v) {
59
+ if(v === '') { return true; }
60
+ let parts = v.split('/');
61
+ for(let lp = 0; lp < parts.length; lp++) {
62
+ if(parts[lp] === null || parts[lp] === '') { return false;}
63
+ }
64
+ if(parts.length === 5) { return true; }
65
+ if(parts.length < 5 && parts[parts.length - 1] === '#') { return true; }
66
+ return false;
67
+ }},
68
+ priority: {value:15, type: 'Number', validate:function(v) { return (v > 0 && v < 16) }},
69
+ connection: {type:"mobius connection", required:true}
70
+ },
71
+ color:"#8abff5",
72
+ inputs:1,
73
+ outputs:2,
74
+ outputLabels: function (index) {
75
+ if(index === 0) return ("Resource's PV");
76
+ if(index === 1) return ("Resource's PV and name");
77
+ if(index === 2) return ("MOBiUS resource");
78
+ if(index === 3) return ("Full MOBiUS response");
79
+ },
80
+ icon: "mobius.png",
81
+ align: "right",
82
+ paletteLabel: 'clr resource',
83
+ label: function() {
84
+ if(this.name) {
85
+ return this.name;
86
+ } else {
87
+ return this.resource ? `Clr - ${this.resource}` : "clear resource";
88
+ }
89
+ },
90
+ labelStyle: function() {
91
+ return this.name ? "node_label_italic":"";
92
+ },
93
+ oneditsave: function() {
94
+ if($("#node-input-detailedOutput").prop('checked')) {
95
+ this.outputs = 4;
96
+ } else {
97
+ this.outputs = 2;
98
+ }
99
+ }
100
+ });
101
+ </script>
102
+
103
+ <script type="text/x-red" data-help-name="mobius clear resource">
104
+ <p>Clear a MOBiUS resource priority.</p>
105
+
106
+ <h3>Configuration Page</h3>
107
+ <dl class="message-properties">
108
+ <dt>MOBiUS <span class="property-type">node</span></dt>
109
+ <dd>Shared MOBiUS connection for communication with the MOBiUS Hub.</dd>
110
+ <dt>URI <span class="property-type">string</span></dt>
111
+ <dd>The MOBiUS URI of the resource.</dd>
112
+ <dt>Priority <span class="property-type">number</span></dt>
113
+ <dd>The priority to clear.</dd>
114
+ <dt>Use detailed outputs <span class="property-type">boolean</span></dt>
115
+ <dd>If checked the full resource is sent on output 3 and the full MOBiUS response is sent on output 4.</dd>
116
+ </dl>
117
+
118
+ <h3>Inputs</h3>
119
+ <ol class="node-ports">
120
+ <li>Input message to trigger clearing a resource priority
121
+ <dl class="message-properties">
122
+ <dt class="optional">topic <span class="property-type">string</span></dt>
123
+ <dd>An optional property that overwrites the URI set in the node configuration page.
124
+ If the topic is not a valid URI it is ignored and the value set in the node configuration page is used.</dd>
125
+ <dt class="optional">priority <span class="property-type">number</span></dt>
126
+ <dd><An optional property that overwrites the priority set in the node configuration page.</dd>
127
+ </dl>
128
+ </li>
129
+ </ol>
130
+
131
+ <h3>Outputs</h3>
132
+ <ol class="node-ports">
133
+ <li>Output 1 (Present value)
134
+ <dl class="message-properties">
135
+ <dt>topic <span class="property-type">string</span></dt>
136
+ <dd>The full URI of the resource.</dd>
137
+ <dt>payload <span class="property-type">object</span></dt>
138
+ <dd>The resource's pv.</dd>
139
+ </dl>
140
+ </li>
141
+ <li>Output 2 (Present value and name of resource)
142
+ <dl class="message-properties">
143
+ <dt>topic <span class="property-type">string</span></dt>
144
+ <dd>The full URI of the resource.</dd>
145
+ <dt>payload.pv <span class="property-type">object</span></dt>
146
+ <dd>The resource's pv.</dd>
147
+ <dt>payload.name <span class="property-type">object</span></dt>
148
+ <dd>The resource's name.</dd>
149
+ </dl>
150
+ </li>
151
+ <li>Output 3 (The MOBiUS resource - optional)
152
+ <dl class="message-properties">
153
+ <dt>topic <span class="property-type">string</span></dt>
154
+ <dd>The full URI of the resource.</dd>
155
+ <dt>payload <span class="property-type">object</span></dt>
156
+ <dd>The resource.</dd>
157
+ </dl>
158
+ </li>
159
+ <li>Output 4 (Full MOBiUS response - optional)
160
+ <dl class="message-properties">
161
+ <dt>topic <span class="property-type">string</span></dt>
162
+ <dd>The full URI of the resource.</dd>
163
+ <dt>error <span class="property-type">boolean</span></dt>
164
+ <dd>True if an error occured, else false.</dd>
165
+ <dt>response <span class="property-type">object</span></dt>
166
+ <dd>The full MOBiUS response message.</dd>
167
+ </dl>
168
+ </li>
169
+ </ol>
170
+
171
+ <h3>Details</h3>
172
+ <p>Outputs 3 and 4 are only sent if <b>Use detailed outputs</b> is checked on the configuration page.</p>
173
+ <p>Outputs 1, 2 and 3 are only sent if no error occurs. The <b>error</b> property in output 4
174
+ can be used to determine if an error has occurred.</p>
175
+
176
+ <br>
177
+ <p align="center" style="color:#000080">iaconnects © 2017</p>
178
+ </script>
@@ -0,0 +1,109 @@
1
+ /**
2
+ Copyright (C) 2016, IAConnects Technology Limited
3
+ All Rights Reserved
4
+
5
+ ALL INFORMATION CONTAINED HEREIN IS, AND REMAINS
6
+ THE PROPERTY OF IACONNECTS TECHNOLOGY LIMITED AND ITS SUPPLIERS,
7
+ IF ANY. THE INTELLECTUAL AND TECHNICAL CONCEPTS CONTAINED
8
+ HEREIN ARE PROPRIETARY TO IACONNECTS TECHNOLOGY LIMITED
9
+ AND ITS SUPPLIERS AND ARE PROTECTED BY TRADE SECRET OR COPYRIGHT LAW.
10
+ DISSEMINATION OF THIS INFORMATION OR REPRODUCTION OF THIS MATERIAL
11
+ IS STRICTLY FORBIDDEN UNLESS PRIOR WRITTEN PERMISSION IS OBTAINED
12
+ FROM IACONNECTS TECHNOLOGY LIMITED.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
18
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ POSSIBILITY OF SUCH DAMAGE.
25
+ **/
26
+
27
+ /* jshint elision: true */
28
+ 'use strict';
29
+
30
+ module.exports = function (RED) {
31
+ function MobiusClearResourceNode (n) {
32
+ RED.nodes.createNode(this, n);
33
+ this.detailedOutput = n.detailedOutput;
34
+ this.resource = n.resource;
35
+ this.priority = n.priority;
36
+ this.serviceConn = RED.nodes.getNode(n.connection);
37
+ var node = this;
38
+
39
+ if (node.serviceConn) {
40
+ node.status({
41
+ fill: 'red',
42
+ shape: 'ring',
43
+ text: 'Disconnected'
44
+ });
45
+
46
+ node.on('input', function (msg) {
47
+ let uri = node.resource;
48
+ let pri = parseInt(node.priority);
49
+ if (msg.hasOwnProperty('topic') && require('./validateURI')(msg.topic, 5)) {
50
+ uri = msg.topic;
51
+ }
52
+ if (msg.hasOwnProperty('priority')) {
53
+ pri = msg.priority;
54
+ }
55
+
56
+ if (uri) {
57
+ node.status({
58
+ fill: 'green',
59
+ shape: 'ring',
60
+ text: 'Busy'
61
+ });
62
+
63
+ node.serviceConn.clearResourcePriority(uri, pri, (err, response) => {
64
+ if (err) {
65
+ node.status({
66
+ fill: 'yellow',
67
+ shape: 'dot',
68
+ text: 'Error: ' + JSON.stringify(err.code)
69
+ });
70
+ node.error('Mobius error clearing resource priority ' + JSON.stringify(err));
71
+ if (node.detailedOutput === true) {
72
+ node.send([null, null, null, {topic: uri, payload: { error: true, response: err }}]);
73
+ }
74
+ } else {
75
+ node.status({
76
+ fill: 'green',
77
+ shape: 'dot',
78
+ text: JSON.stringify(response.value.pv)
79
+ });
80
+ if (node.detailedOutput === true) {
81
+ node.send([
82
+ { topic: uri, payload: response.value.pv },
83
+ { topic: uri, payload: { pv: response.value.pv, name: response.value.name } },
84
+ { topic: uri, payload: response.value },
85
+ { topic: uri, payload: { error: false, response: response } }
86
+ ]);
87
+ } else {
88
+ node.send([
89
+ { topic: uri, payload: response.value.pv },
90
+ { topic: uri, payload: { pv: response.value.pv, name: response.value.name } }
91
+ ]);
92
+ }
93
+ }
94
+ });
95
+ }
96
+ });
97
+
98
+ node.serviceConn.register(node);
99
+
100
+ node.on('close', function (done) {
101
+ node.serviceConn.deregister(node, done);
102
+ });
103
+ } else {
104
+ node.error(RED._('Mobius service not defined'));
105
+ }
106
+ }
107
+
108
+ RED.nodes.registerType('mobius clear resource', MobiusClearResourceNode);
109
+ };
@@ -0,0 +1,68 @@
1
+ <!--
2
+ Copyright (C) 2016, IAConnects Technology Limited
3
+ All Rights Reserved
4
+
5
+ ALL INFORMATION CONTAINED HEREIN IS, AND REMAINS
6
+ THE PROPERTY OF IACONNECTS TECHNOLOGY LIMITED AND ITS SUPPLIERS,
7
+ IF ANY. THE INTELLECTUAL AND TECHNICAL CONCEPTS CONTAINED
8
+ HEREIN ARE PROPRIETARY TO IACONNECTS TECHNOLOGY LIMITED
9
+ AND ITS SUPPLIERS AND ARE PROTECTED BY TRADE SECRET OR COPYRIGHT LAW.
10
+ DISSEMINATION OF THIS INFORMATION OR REPRODUCTION OF THIS MATERIAL
11
+ IS STRICTLY FORBIDDEN UNLESS PRIOR WRITTEN PERMISSION IS OBTAINED
12
+ FROM IACONNECTS TECHNOLOGY LIMITED.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
18
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ POSSIBILITY OF SUCH DAMAGE.
25
+ -->
26
+
27
+ <script type="text/x-red" data-template-name="mobius connection">
28
+ <div class="form-row">
29
+ <label for="node-config-input-host"><i class="fa fa-globe"></i> Host</label>
30
+ <input class="input-append-left" type="text" id="node-config-input-host" placeholder="e.g. localhost" style="width: 40%;" >
31
+ <label for="node-config-input-port" style="margin-left: 10px; width: 35px; "> Port</label>
32
+ <input type="text" id="node-config-input-port" placeholder="1890" style="width:50px">
33
+ </div>
34
+ <div class="form-row">
35
+ <label for="node-config-input-psk"><i class="fa fa-key"></i> PSK</label>
36
+ <input type="text" id="node-config-input-psk" placeholder="Pre-shared key">
37
+ </div>
38
+ </script>
39
+
40
+ <script type="text/javascript">
41
+ RED.nodes.registerType('mobius connection', {
42
+ category: 'config',
43
+ defaults: {
44
+ host: {required: true, value: 'localhost'},
45
+ port: {required: true, value: 1890, validate: RED.validators.number()},
46
+ psk: {required: true}
47
+ },
48
+ label: function() {
49
+ return `${this.host}:${this.port}`;
50
+ }
51
+ });
52
+ </script>
53
+
54
+ <script type="text/x-red" data-help-name="mobius connection">
55
+ <p>Shared MOBiUS Flow Connection used by all of the MOBiUS Flow nodes to connect to a MOBiUS Flow hub.</p>
56
+
57
+ <h3>Configuration Page</h3>
58
+ <dl class="message-properties">
59
+ <dt>Host <span class="property-type">string</span></dt>
60
+ <dd>The IP Address of the MOBiUS TCP/IP spoke.</dd>
61
+ <dt>Port <span class="property-type">number</span></dt>
62
+ <dd>The TCP/IP port that the spoke is listening for connections on.</dd>
63
+ <dt>PSK <span class="property-type">string</span></dt>
64
+ <dd>The pre-shared key used to encode and decode all messages to and from the spoke.</dd>
65
+ </dl>
66
+ <br>
67
+ <p align="center" style="color:#000080">iaconnects © 2017</p>
68
+ </script>