node-red-contrib-prib-functions 0.16.1 → 0.17.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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "recommendations": [
3
+ "bibhasdn.git-easy",
4
+ "github.vscode-pull-request-github"
5
+ ]
6
+ }
package/README.md CHANGED
@@ -159,7 +159,7 @@ Test example:
159
159
 
160
160
  The levenshtein distance between two character strings.
161
161
 
162
- ![Levenshtein Distance](documentation/levenshteinDistance.JPG "Levenshtein Distance")
162
+ ![Levenshtein Distance](documentation/levenshteinDistance.jpg "Levenshtein Distance")
163
163
 
164
164
  ------------------------------------------------------------
165
165
 
@@ -247,6 +247,8 @@ Test/example flow in test/generalTest.json
247
247
 
248
248
  # Version
249
249
 
250
+ 0.17.0 Add finished wire to load injector
251
+
250
252
  0.16.10 data analysis add eulcidean distance functions. Add array pairs
251
253
 
252
254
  0.16.0 fix data analysis variance and stddev, add sample, add tests
@@ -265,40 +267,6 @@ Test/example flow in test/generalTest.json
265
267
 
266
268
  0.11.0 Transform for AVRO and snappy. Add JSON to CSV
267
269
 
268
- 0.10.2 Transform validate for array source, bug fixes on transform and add improvements to array to messages. Added node for levenshtein distance.
269
-
270
- 0.10.1 Real time weighted moving average, levenshtein Distance, for test allow testing of "infinity","-infinity" and "NaN" in JSON.
271
-
272
- 0.10.0 Many fixes to transform. Array and csv to various forms work. Added test to validate.
273
- Improved test to allow for escape to put special characters into a string.
274
-
275
- 0.9.6 Enhance transform with csv ignore lead or trailing lines.
276
- Add Array and CSV to Messages. Add in topic override
277
-
278
- 0.9.5 Enhance transform with path and setting source and target.
279
- Outlier allowed to set number of deviations if median and reset or set stats
280
- Add outlier detection and Pearson R realtime metrics.
281
-
282
- 0.8.1 Add realtime metrics to data analysis.
283
-
284
- 0.7.1
285
- * fix json to table html and minor code improvements.
286
- turn off debug mode on spawn process.
287
- clear down timer on close for host available
288
- * add Host Available
289
-
290
- 0.6.0
291
- * add Spawn Process
292
- * improve experimental transform with json to table html
293
-
294
- 0.5.0
295
- * test node add select property tested for result
296
- * dataAnalysis add property analysed
297
- * add experimental transform
298
-
299
- 0.4.0 Add test, monitor flow, data analysis
300
-
301
- 0.0.1 base
302
270
 
303
271
  # Author
304
272
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-prib-functions",
3
- "version": "0.16.1",
3
+ "version": "0.17.0",
4
4
  "description": "Node-RED added node functions.",
5
5
  "dependencies": {
6
6
  "avsc": "^5.6.1",
@@ -13,8 +13,8 @@
13
13
  "axios": ">=0.21.1",
14
14
  "bcrypt": "^5.0.1",
15
15
  "bl": "^5.0.0",
16
- "mocha": "^8.3.2",
17
- "node-red": "^1.3.1",
16
+ "mocha": "^9.2.2",
17
+ "node-red": "^2.2.2",
18
18
  "node-red-node-test-helper": "^0.2.7"
19
19
  },
20
20
  "scripts": {
@@ -14,8 +14,8 @@
14
14
  },
15
15
  inputs:1,
16
16
  inputLabels: "",
17
- outputs:1,
18
- outputLabels: ["admin"],
17
+ outputs:2,
18
+ outputLabels: ["Messages","Finished"],
19
19
  icon: "inject.png",
20
20
  label: function() {
21
21
  return this.name||this._("Load Injector");
@@ -8,8 +8,9 @@ function thinkTimeTime() {
8
8
  }
9
9
  function nextMessageInjection() {
10
10
  if (this.runtimeTimer) {
11
+ this.count++;
11
12
  this.receive();
12
- var node=this;
13
+ const node=this;
13
14
  this.nextMessageInjectTimer=setTimeout(function(node){nextMessageInjection.apply(node);},thinkTimeTime.apply(node),node);
14
15
  }
15
16
  }
@@ -22,11 +23,15 @@ function runtimeStop() {
22
23
  clearTimeout(this.nextMessageInjectTimer);
23
24
  this.nextMessageInjectTimer=null;
24
25
  }
26
+ this.stopped=Date.now();
27
+ this.send([null,{payload:{count:this.count,started:this.started,stopped:this.stopped}}])
25
28
  this.status({fill:"red",shape:"ring",text:"Stopped"});
26
29
  this.error("Stopped injector");
27
30
  }
28
31
  function runtimeStart() {
29
- var node=this;
32
+ const node=this;
33
+ this.started=Date.now();
34
+ this.count=0;
30
35
  this.runtimeTimer=true;
31
36
  this.runtimeTimer=setTimeout(function(){runtimeStop.apply(node);},this.runtime*1000);
32
37
  this.status({fill:"green",shape:"ring",text:"Started"});
@@ -37,7 +42,7 @@ function runtimeStart() {
37
42
  module.exports = function (RED) {
38
43
  function LoadInjectorNode(n) {
39
44
  RED.nodes.createNode(this, n);
40
- var node=Object.assign(this,n);
45
+ const node=Object.assign(this,n);
41
46
  this.thinktimemin=Number(this.thinktimemin);
42
47
  this.thinktimemax=Number(this.thinktimemax);
43
48
  if(this.thinktimemax<this.thinktimemin) {
@@ -96,7 +101,7 @@ module.exports = function (RED) {
96
101
 
97
102
  // RED.httpAdmin.post("/loadinjector/:id", RED.auth.needsPermission("inject.write"), function(req,res) {
98
103
  RED.httpAdmin.get("/loadinjector/:id", function(req,res) {
99
- var node = RED.nodes.getNode(req.params.id);
104
+ const node = RED.nodes.getNode(req.params.id);
100
105
  if (node && node.type==="Load Injector") {
101
106
  try {
102
107
  node.warn("Request to "+(node.runtimeTimer?"stop":"start")+" injector");