Files
pumpingStation/src/nodeClass.js

46 lines
1.5 KiB
JavaScript
Raw Normal View History

const { BaseNodeAdapter } = require('generalFunctions');
const PumpingStation = require('./specificClass');
const commands = require('./commands');
class nodeClass extends BaseNodeAdapter {
static DomainClass = PumpingStation;
static commands = commands;
// Tick-driven: predicted-volume integrator needs delta-time per second.
static tickInterval = 1000;
static statusInterval = 1000;
buildDomainConfig(uiConfig) {
return {
basin: {
volume: uiConfig.basinVolume,
height: uiConfig.basinHeight,
inflowLevel: uiConfig.inflowLevel,
outflowLevel: uiConfig.outflowLevel,
overflowLevel: uiConfig.overflowLevel,
},
hydraulics: {
refHeight: uiConfig.refHeight,
2025-11-20 12:15:46 +01:00
minHeightBasedOn: uiConfig.minHeightBasedOn,
basinBottomRef: uiConfig.basinBottomRef,
2025-11-25 14:57:39 +01:00
},
control: {
2025-11-27 17:46:24 +01:00
mode: uiConfig.controlMode,
levelbased: {
minLevel: uiConfig.minLevel,
startLevel: uiConfig.startLevel,
maxLevel: uiConfig.maxLevel,
},
2025-11-27 17:46:24 +01:00
},
safety: {
2025-11-25 14:57:39 +01:00
enableDryRunProtection: uiConfig.enableDryRunProtection,
dryRunThresholdPercent: uiConfig.dryRunThresholdPercent,
enableOverfillProtection: uiConfig.enableOverfillProtection,
overfillThresholdPercent: uiConfig.overfillThresholdPercent,
timeleftToFullOrEmptyThresholdSeconds: uiConfig.timeleftToFullOrEmptyThresholdSeconds,
},
2025-11-03 07:42:51 +01:00
};
2025-10-21 12:45:19 +02:00
}
2025-10-07 18:05:54 +02:00
}
module.exports = nodeClass;