Rixed multiplying message bug.

This commit is contained in:
2025-06-16 17:52:31 +02:00
parent 3ba98d2362
commit c8c588600c
2 changed files with 13 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ module.exports = function(RED) {
let name = config.name;
let F2 = parseFloat(config.F2);
let inlet = parseInt(config.inlet);
const inlet_F2 = parseInt(config.inlet);
node.on('input', function(msg, send, done) {
switch (msg.topic) {
@@ -15,12 +15,12 @@ module.exports = function(RED) {
let F_diff = Math.max(F1 - F2, 0);
let F2_corr = F1 < F2 ? F1 : F2;
let msg_F1 = structuredClone(msg);
let msg_F1 = {...msg};
msg_F1.payload.F = F_diff;
let msg_F2 = structuredClone(msg);
msg_F2.payload.F = F2_corr;
msg_F2.payload.inlet = inlet;
msg_F2.payload.inlet = inlet_F2;
send([msg_F1, msg_F2]);
break;