2026-05-10 20:28:05 +02:00
|
|
|
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 {
|
2026-03-11 14:59:35 +01:00
|
|
|
basin: {
|
2025-10-16 14:44:45 +02:00
|
|
|
volume: uiConfig.basinVolume,
|
|
|
|
|
height: uiConfig.basinHeight,
|
2026-04-22 16:13:59 +02:00
|
|
|
inflowLevel: uiConfig.inflowLevel,
|
|
|
|
|
outflowLevel: uiConfig.outflowLevel,
|
|
|
|
|
overflowLevel: uiConfig.overflowLevel,
|
2025-10-16 14:44:45 +02:00
|
|
|
},
|
2026-03-11 14:59:35 +01:00
|
|
|
hydraulics: {
|
2025-10-16 14:44:45 +02:00
|
|
|
refHeight: uiConfig.refHeight,
|
2025-11-20 12:15:46 +01:00
|
|
|
minHeightBasedOn: uiConfig.minHeightBasedOn,
|
2025-10-16 14:44:45 +02:00
|
|
|
basinBottomRef: uiConfig.basinBottomRef,
|
2025-11-25 14:57:39 +01:00
|
|
|
},
|
2026-05-10 20:28:05 +02:00
|
|
|
control: {
|
2025-11-27 17:46:24 +01:00
|
|
|
mode: uiConfig.controlMode,
|
2026-05-10 20:28:05 +02:00
|
|
|
levelbased: {
|
|
|
|
|
minLevel: uiConfig.minLevel,
|
|
|
|
|
startLevel: uiConfig.startLevel,
|
|
|
|
|
maxLevel: uiConfig.maxLevel,
|
|
|
|
|
},
|
2025-11-27 17:46:24 +01:00
|
|
|
},
|
2026-05-10 20:28:05 +02:00
|
|
|
safety: {
|
2025-11-25 14:57:39 +01:00
|
|
|
enableDryRunProtection: uiConfig.enableDryRunProtection,
|
|
|
|
|
dryRunThresholdPercent: uiConfig.dryRunThresholdPercent,
|
|
|
|
|
enableOverfillProtection: uiConfig.enableOverfillProtection,
|
|
|
|
|
overfillThresholdPercent: uiConfig.overfillThresholdPercent,
|
2026-05-10 20:28:05 +02:00
|
|
|
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;
|