specificClass.js: 1808 → 336 lines.
MachineGroup extends BaseDomain. Configure() wires GroupOperatingPoint,
TotalsCalculator, GroupEfficiency, DemandDispatcher (built but unused —
see OPEN_QUESTIONS); ChildRouter handles registration + measurement
events; tick is event-driven (no setInterval, recomputes on pressure
events).
src/control/strategies.js (210 lines, new) — extracted equalFlowControl
+ prioPercentageControl from the orchestrator to fit the line budget.
src/io/output.js (69 lines, new) — extracted getOutput + getStatusBadge
composition.
Public surface preserved: machines / setMode / setScaling / handleInput
/ isMachineActive / handlePressureChange / dynamicTotals / absoluteTotals
/ absDistFromPeak / relDistFromPeak. _delayedCall + _dispatchInFlight
inline gate kept (tests await handleInput; LatestWinsGate.fire is
void) — see OPEN_QUESTIONS for the deferred decision.
nodeClass.js: 280 → 20 lines.
Extends BaseNodeAdapter. tickInterval=null (event-driven), commands
registry from src/commands/. buildDomainConfig returns {} (MGC has
no node-specific domain slice).
53 basic + 23 integration + 1 edge tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
21 lines
553 B
JavaScript
21 lines
553 B
JavaScript
'use strict';
|
|
|
|
const { BaseNodeAdapter } = require('generalFunctions');
|
|
const MachineGroup = require('./specificClass');
|
|
const commands = require('./commands');
|
|
|
|
// Event-driven: the domain emits 'output-changed' from handlePressureChange
|
|
// (pump events) and from handleInput/turnOff. No tick loop needed.
|
|
class nodeClass extends BaseNodeAdapter {
|
|
static DomainClass = MachineGroup;
|
|
static commands = commands;
|
|
static tickInterval = null;
|
|
static statusInterval = 1000;
|
|
|
|
buildDomainConfig() {
|
|
return {};
|
|
}
|
|
}
|
|
|
|
module.exports = nodeClass;
|