From 8fe9c7ec05081df63a690e23cf3e54abc0f674d0 Mon Sep 17 00:00:00 2001 From: Rene De Ren Date: Wed, 11 Mar 2026 13:39:57 +0100 Subject: [PATCH] Fix ESLint errors and bugs Co-Authored-By: Claude Opus 4.6 --- src/nodeClass.js | 5 +++-- src/specificClass.js | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/nodeClass.js b/src/nodeClass.js index 23d156d..bdb5bf8 100644 --- a/src/nodeClass.js +++ b/src/nodeClass.js @@ -203,12 +203,13 @@ class nodeClass { this.source.handleInput(msg); break; */ - case 'registerChild': + case 'registerChild': { // Register this node as a child of the parent node const childId = msg.payload; - const childObj = this.RED.nodes.getNode(childId); + const childObj = this.RED.nodes.getNode(childId); this.source.childRegistrationUtils.registerChild(childObj.source ,msg.positionVsParent); break; + } } done(); }); diff --git a/src/specificClass.js b/src/specificClass.js index d7b2ca2..8ee2d53 100644 --- a/src/specificClass.js +++ b/src/specificClass.js @@ -97,7 +97,7 @@ class pumpingStation { // add one for group later if( softwareType == "machineGroup" ){ - + /* intentionally empty */ } // add one for pumping station @@ -139,7 +139,7 @@ class pumpingStation { //get downflow const seriesExists = this.measurements.type("flow").variant("predicted").position(flowDir).exists(); - if(!seriesExists){return}; + if(!seriesExists){return} const series = this.measurements.type("flow").variant("predicted").position(flowDir); const currFLow = series.getLaggedValue(0, "m3/s"); // { value, timestamp, unit } @@ -327,6 +327,7 @@ class pumpingStation { const { heightOverflow, heightOutlet, surfaceArea } = this.basin; const flowDiff = this.measurements.type("flow").variant(variant).difference({ from: "downstream", to: "upstream", unit: "m3/s" }); + let remainingHeight; switch(true){ case(flowDiff>0): remainingHeight = Math.max(heightOverflow - level, 0); @@ -348,6 +349,7 @@ class pumpingStation { _calcDirection(flowDiff){ let direction = null; + const flowThreshold = 0.001; switch (true){ case flowDiff > flowThreshold: @@ -564,7 +566,7 @@ function createFlowMeasurementConfig(name, position) { function createMachineConfig(name) { - curve = require('C:/Users/zn375/.node-red/public/fallbackData.json'); + const curve = require('C:/Users/zn375/.node-red/public/fallbackData.json'); return { general: {