Fix RBE greater than change not emitting on first message

And fix missing close tags
This commit is contained in:
Dave Conway-Jones
2020-05-31 21:52:37 +01:00
parent 01d675b372
commit cd85fe8df2
4 changed files with 9 additions and 6 deletions

View File

@@ -54,7 +54,7 @@ module.exports = function(RED) {
if (node.pc) { node.gap = Math.abs(node.previous[t] * node.g / 100) || 0; }
else { node.gap = Number(node.gap); }
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 - 1; }
if (Math.abs(n - node.previous[t]) === node.gap) {
if ((this.func === "deadbandEq")||(this.func === "narrowband")) {
if (node.inout === "out") { node.previous[t] = n; }