mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
fix long standing rbe % change bug (should be abs change)
to close #312
This commit is contained in:
parent
a89379c631
commit
559edcf0f8
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-rbe",
|
"name" : "node-red-node-rbe",
|
||||||
"version" : "0.2.0",
|
"version" : "0.2.1",
|
||||||
"description" : "A Node-RED node that provides report-by-exception (RBE) and deadband capability.",
|
"description" : "A Node-RED node that provides report-by-exception (RBE) and deadband capability.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
@ -51,7 +51,7 @@ module.exports = function(RED) {
|
|||||||
if (node.start === '') { node.previous[t] = n; }
|
if (node.start === '') { node.previous[t] = n; }
|
||||||
else { node.previous[t] = node.start; }
|
else { node.previous[t] = node.start; }
|
||||||
}
|
}
|
||||||
if (node.pc) { node.gap = (node.previous[t] * node.g / 100) || 0; }
|
if (node.pc) { node.gap = Math.abs(node.previous[t] * node.g / 100) || 0; }
|
||||||
else { node.gap = Number(node.gap); }
|
else { node.gap = Number(node.gap); }
|
||||||
if ((node.previous[t] === undefined) && (node.func === "narrowbandEq")) { node.previous[t] = n; }
|
if ((node.previous[t] === undefined) && (node.func === "narrowbandEq")) { node.previous[t] = n; }
|
||||||
if (node.previous[t] === undefined) { node.previous[t] = n - node.gap; }
|
if (node.previous[t] === undefined) { node.previous[t] = n - node.gap; }
|
||||||
|
Loading…
Reference in New Issue
Block a user