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, minHeightBasedOn: uiConfig.minHeightBasedOn, basinBottomRef: uiConfig.basinBottomRef, }, control: { mode: uiConfig.controlMode, levelbased: { minLevel: uiConfig.minLevel, startLevel: uiConfig.startLevel, maxLevel: uiConfig.maxLevel, }, }, safety: { enableDryRunProtection: uiConfig.enableDryRunProtection, dryRunThresholdPercent: uiConfig.dryRunThresholdPercent, enableOverfillProtection: uiConfig.enableOverfillProtection, overfillThresholdPercent: uiConfig.overfillThresholdPercent, timeleftToFullOrEmptyThresholdSeconds: uiConfig.timeleftToFullOrEmptyThresholdSeconds, }, }; } } module.exports = nodeClass;