forked from RnD/pumpingStation
Changed names
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user