Fix ESLint errors and bugs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Rene De Ren
2026-03-11 13:39:57 +01:00
parent 6e9ae9fc7e
commit 8fe9c7ec05
2 changed files with 8 additions and 5 deletions

View File

@@ -203,13 +203,14 @@ class nodeClass {
this.source.handleInput(msg); this.source.handleInput(msg);
break; break;
*/ */
case 'registerChild': case 'registerChild': {
// Register this node as a child of the parent node // Register this node as a child of the parent node
const childId = msg.payload; 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); this.source.childRegistrationUtils.registerChild(childObj.source ,msg.positionVsParent);
break; break;
} }
}
done(); done();
}); });
} }

View File

@@ -97,7 +97,7 @@ class pumpingStation {
// add one for group later // add one for group later
if( softwareType == "machineGroup" ){ if( softwareType == "machineGroup" ){
/* intentionally empty */
} }
// add one for pumping station // add one for pumping station
@@ -139,7 +139,7 @@ class pumpingStation {
//get downflow //get downflow
const seriesExists = this.measurements.type("flow").variant("predicted").position(flowDir).exists(); 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 series = this.measurements.type("flow").variant("predicted").position(flowDir);
const currFLow = series.getLaggedValue(0, "m3/s"); // { value, timestamp, unit } const currFLow = series.getLaggedValue(0, "m3/s"); // { value, timestamp, unit }
@@ -327,6 +327,7 @@ class pumpingStation {
const { heightOverflow, heightOutlet, surfaceArea } = this.basin; const { heightOverflow, heightOutlet, surfaceArea } = this.basin;
const flowDiff = this.measurements.type("flow").variant(variant).difference({ from: "downstream", to: "upstream", unit: "m3/s" }); const flowDiff = this.measurements.type("flow").variant(variant).difference({ from: "downstream", to: "upstream", unit: "m3/s" });
let remainingHeight;
switch(true){ switch(true){
case(flowDiff>0): case(flowDiff>0):
remainingHeight = Math.max(heightOverflow - level, 0); remainingHeight = Math.max(heightOverflow - level, 0);
@@ -348,6 +349,7 @@ class pumpingStation {
_calcDirection(flowDiff){ _calcDirection(flowDiff){
let direction = null; let direction = null;
const flowThreshold = 0.001;
switch (true){ switch (true){
case flowDiff > flowThreshold: case flowDiff > flowThreshold:
@@ -564,7 +566,7 @@ function createFlowMeasurementConfig(name, position) {
function createMachineConfig(name) { 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 { return {
general: { general: {