refactor docs: lock in topic-prefix glossary, child-getters, opt-in tick
Resolves the 5 open questions answered during Phase 1 setup: - Topic naming: canonical from Phase 1 (set/cmd/data/child/query/evt), with full glossary in CONTRACTS.md §1. - Parent EVOLV branch lineage: rebased onto origin/main. - Deprecated paths: tracked as Phase 8.5 in TASKS.md. - Child storage: registry-as-truth + named getters via declareChildGetter. - Tick: opt-in via static tickInterval; default is event-driven via source.emitter 'output-changed'. statusInterval (always-on, 1Hz) is separate. Plus two new pre-existing-issue notes from the sanity gate: - dashboardAPI uses Mocha-style describe() under node:test (broken). - reactor tests are mathjs-bound (~13s/file load). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -233,12 +233,17 @@ class PumpingStation extends BaseDomain {
|
||||
}
|
||||
|
||||
// What the Node-RED status badge shows — see section 7.
|
||||
// Aggregators (no clean state machine) use compose. State-machine
|
||||
// nodes (rotatingMachine) use byState. Both return {fill, shape, text}.
|
||||
getStatusBadge() {
|
||||
return statusBadge.fromState({
|
||||
direction: this.flowAggregator.direction,
|
||||
vol: this.measurements.type('volume').variant('measured').position('atequipment').getCurrentValue('m3'),
|
||||
maxVol: this.basin.maxVolAtOverflow,
|
||||
});
|
||||
const direction = this.flowAggregator.direction;
|
||||
const vol = this.measurements.type('volume').variant('measured').position('atequipment').getCurrentValue('m3');
|
||||
const pct = (vol / this.basin.maxVolAtOverflow * 100).toFixed(1);
|
||||
const arrow = direction === 'filling' ? '⬆️' : direction === 'draining' ? '⬇️' : '⏸️';
|
||||
return statusBadge.compose([
|
||||
`${arrow} ${pct}%`,
|
||||
`V=${vol.toFixed(2)}/${this.basin.maxVolAtOverflow.toFixed(2)} m³`,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user