Changed names

This commit is contained in:
znetsixe
2025-10-14 08:36:45 +02:00
parent 856477df57
commit fa30be5e2d
5 changed files with 22 additions and 26 deletions

View File

@@ -109,7 +109,7 @@ class nodeClass {
* Execute a single tick: update measurement, format and send outputs.
*/
_tick() {
this.source.tick();
//this.source.tick();
const raw = this.source.getOutput();
const processMsg = this._output.formatMsg(raw, this.config, 'process');
@@ -125,14 +125,14 @@ class nodeClass {
_attachInputHandler() {
this.node.on('input', (msg, send, done) => {
switch (msg.topic) {
case 'simulator': this.source.toggleSimulation(); break;
case 'outlierDetection': this.source.toggleOutlierDetection(); break;
case 'calibrate': this.source.calibrate(); break;
case 'measurement':
if (typeof msg.payload === 'number') {
this.source.inputValue = parseFloat(msg.payload);
}
//example
/*case 'simulator':
this.source.toggleSimulation();
break;
default:
this.source.handleInput(msg);
break;
*/
}
done();
});

View File

@@ -1,12 +1,12 @@
const EventEmitter = require('events');
const {logger,configUtils,configManager,MeasurementContainer,coolprop} = require('generalFunctions');
class Basin {
class pumpingStation {
constructor(config={}) {
this.emitter = new EventEmitter(); // Own EventEmitter
this.configManager = new configManager();
this.defaultConfig = this.configManager.getConfig('basin');
this.defaultConfig = this.configManager.getConfig('pumpingStation');
this.configUtils = new configUtils(this.defaultConfig);
this.config = this.configUtils.initConfig(config);
@@ -19,7 +19,7 @@ class Basin {
windowSize: this.config.smoothing.smoothWindow
});
// Basin-specific properties
// pumpingStation-specific properties
this.flowrate = null; // Function to calculate flow rate based on water level rise or fall
this.timeBeforeOverflow = null; // Time before the basin overflows at current inflow rate
this.timeBeforeEmpty = null; // Time before the basin empties at current outflow rate
@@ -131,7 +131,6 @@ class Basin {
this.crossSectionalArea = this.config.basin.crossSectionalArea || 1; // Default to 1 m² if not specified
}
measurement
getOutput() {
return {