Files
machineGroupControl/examples/01-Basic.json

83 lines
1.8 KiB
JSON
Raw Permalink Normal View History

feat(mgc): editor defaults, compact status badge, mode-case fix, real example flows + dashboard Editor (mgc.html) - Drag-in defaults now expose mode (optimalControl) and scaling (normalized) via dropdowns in the edit dialog. Was: no control fields in the UI at all, so users had to send set.mode/set.scaling after deploy or live with the hidden schema defaults. Wire-up (src/nodeClass.js) - buildDomainConfig now bridges the flat editor fields (mode, scaling) into the nested schema shape (mode.current, scaling.current). Was: returned {} so the editor's mode/scaling never reached the runtime. Mode-case bug fix (src/specificClass.js) - Schema enum values are camelCase (optimalControl, priorityControl) but the runtime switch in _runDispatch matched lowercase only. With the default config, dispatch silently fell through to the warning branch and nothing ran. Normalise via String(this.mode).toLowerCase() so both forms work. Status badge (src/io/output.js) - Compacted from ~80 chars (mode | Ⓝ: 💨=Q/Qmax | ⚡=P | N machine(s)) to ~50 chars (mode | norm | Q=Q/Qmax m³/h | P=P kW | active/total x). Drops emoji glyphs that rendered inconsistently across themes; uses the same dot+fill convention as pumpingStation. Output extension (src/io/output.js) - getOutput() now also emits flowCapacityMin/Max, machineCount, machineCountActive. Was: only group-level totals + dist-from-peak + mode/scaling, so dashboards couldn't show capacity / active count without subscribing to each rotatingMachine individually. Examples - Drop pre-refactor stubs (basic.flow.json, integration.flow.json, edge.flow.json). They had a single MGC + inject + debug, no children, and never dispatched anything. - 01-Basic.json: 1 MGC + 3 rotatingMachine pumps + Setup once-fires virtualControl + cmd.startup on all pumps via fan-out function. Numbered driver groups for Control mode / Scaling / Operator demand. Pumps register with MGC via Port 2 (child.register, automatic). - 02-Dashboard.json: same plumbing + FlowFuse Dashboard 2.0 page with Controls (mode + scaling buttons, demand slider 0–100, stop + init buttons), Status (7 ui-text rows), Trends (3 charts: flow + capacity, power, BEP rel %), and a raw-output ui-template dumping every Port 0 field. Fan-out function caches last-known values so deltas don't blank. Wiki + README - examples/README.md rewritten for the two-file set with canonical command surface table and "what to try" recipes. - wiki/Home.md §11 (Examples) updated; §14 #4 (TODO flow item) replaced with the actual current limitation (no per-pump fan-out on Port 0). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:24:03 +02:00
[
{
"id": "grp_drv_mode",
"type": "group",
"z": "tab_mgc_basic",
"name": "1. Control mode",
"style": {
"stroke": "#666666",
"fill": "#ffdf7f",
"fill-opacity": "0.15",
"label": true,
"color": "#333333"
},
"nodes": [
"inj_mode_optimal",
"inj_mode_priority"
],
governance + unit-self-describing demand + dashboard fixes Two governance items from the 2026-05-14 quality review: - test/_output-manifest.md enumerates every Port 0/1/2 key MGC emits, its source, type, range, and which tests cover it in populated/degraded states (per .claude/rules/output-coverage.md). - src/control/strategies.js extracts computeEqualFlowDistribution as a pure function so the equal-flow algorithm is testable without an MGC fixture. test/basic/equalFlowDistribution.basic.test.js (6 tests) covers all three demand branches and pins the legacy quirk where the default branch counts active machines but iterates priority-ordered first-N (documented in the test so the future cleanup is a deliberate change). Plus rolled-up session work that landed alongside: - set.demand is now unit-self-describing ({value, unit:'m3/h'|'l/s'|'%'|...} or bare number = %); setScaling/scaling.current removed from MGC, commands, editor (mgc.html), specificClass. - _optimalControl + equalFlowControl now compute eta = (Q*dP)/P_shaft rather than Q/P, keeping the metric in the same scale as each child's cog. - groupEfficiency.calcRelativeDistanceFromPeak returns undefined (was 1) when pumps are homogeneous (|max-min| < 1e-9). Dashboard treats undefined as '-' instead of showing a misleading 100% / 0% reading. - examples/02-Dashboard.json: auto-init inject so the dashboard populates at deploy, NCog formatter normalizes the SUM emitted by MGC by machineCountActive, Q-H fanout trims the flat-Q tail so the H axis isn't stretched to 40m by curve-envelope clamp points, num/pct treat null AND undefined as no-data (closes the +null === 0 trap). - new test/integration/dashboard-fanout.integration.test.js (17 tests), bep-distance-demand-sweep.integration.test.js (3 tests), group-bep-cascade.integration.test.js -- total suite now 108/108 green. - .gitignore: wiki/test.gif (143 MB screen recording, kept locally only). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 22:31:25 +02:00
"x": 714,
"y": 19,
"w": 292,
feat(mgc): editor defaults, compact status badge, mode-case fix, real example flows + dashboard Editor (mgc.html) - Drag-in defaults now expose mode (optimalControl) and scaling (normalized) via dropdowns in the edit dialog. Was: no control fields in the UI at all, so users had to send set.mode/set.scaling after deploy or live with the hidden schema defaults. Wire-up (src/nodeClass.js) - buildDomainConfig now bridges the flat editor fields (mode, scaling) into the nested schema shape (mode.current, scaling.current). Was: returned {} so the editor's mode/scaling never reached the runtime. Mode-case bug fix (src/specificClass.js) - Schema enum values are camelCase (optimalControl, priorityControl) but the runtime switch in _runDispatch matched lowercase only. With the default config, dispatch silently fell through to the warning branch and nothing ran. Normalise via String(this.mode).toLowerCase() so both forms work. Status badge (src/io/output.js) - Compacted from ~80 chars (mode | Ⓝ: 💨=Q/Qmax | ⚡=P | N machine(s)) to ~50 chars (mode | norm | Q=Q/Qmax m³/h | P=P kW | active/total x). Drops emoji glyphs that rendered inconsistently across themes; uses the same dot+fill convention as pumpingStation. Output extension (src/io/output.js) - getOutput() now also emits flowCapacityMin/Max, machineCount, machineCountActive. Was: only group-level totals + dist-from-peak + mode/scaling, so dashboards couldn't show capacity / active count without subscribing to each rotatingMachine individually. Examples - Drop pre-refactor stubs (basic.flow.json, integration.flow.json, edge.flow.json). They had a single MGC + inject + debug, no children, and never dispatched anything. - 01-Basic.json: 1 MGC + 3 rotatingMachine pumps + Setup once-fires virtualControl + cmd.startup on all pumps via fan-out function. Numbered driver groups for Control mode / Scaling / Operator demand. Pumps register with MGC via Port 2 (child.register, automatic). - 02-Dashboard.json: same plumbing + FlowFuse Dashboard 2.0 page with Controls (mode + scaling buttons, demand slider 0–100, stop + init buttons), Status (7 ui-text rows), Trends (3 charts: flow + capacity, power, BEP rel %), and a raw-output ui-template dumping every Port 0 field. Fan-out function caches last-known values so deltas don't blank. Wiki + README - examples/README.md rewritten for the two-file set with canonical command surface table and "what to try" recipes. - wiki/Home.md §11 (Examples) updated; §14 #4 (TODO flow item) replaced with the actual current limitation (no per-pump fan-out on Port 0). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:24:03 +02:00
"h": 122
},
{
"id": "inj_mode_optimal",
"type": "inject",
"z": "tab_mgc_basic",
"g": "grp_drv_mode",
"name": "set.mode = optimalControl",
"props": [
governance + unit-self-describing demand + dashboard fixes Two governance items from the 2026-05-14 quality review: - test/_output-manifest.md enumerates every Port 0/1/2 key MGC emits, its source, type, range, and which tests cover it in populated/degraded states (per .claude/rules/output-coverage.md). - src/control/strategies.js extracts computeEqualFlowDistribution as a pure function so the equal-flow algorithm is testable without an MGC fixture. test/basic/equalFlowDistribution.basic.test.js (6 tests) covers all three demand branches and pins the legacy quirk where the default branch counts active machines but iterates priority-ordered first-N (documented in the test so the future cleanup is a deliberate change). Plus rolled-up session work that landed alongside: - set.demand is now unit-self-describing ({value, unit:'m3/h'|'l/s'|'%'|...} or bare number = %); setScaling/scaling.current removed from MGC, commands, editor (mgc.html), specificClass. - _optimalControl + equalFlowControl now compute eta = (Q*dP)/P_shaft rather than Q/P, keeping the metric in the same scale as each child's cog. - groupEfficiency.calcRelativeDistanceFromPeak returns undefined (was 1) when pumps are homogeneous (|max-min| < 1e-9). Dashboard treats undefined as '-' instead of showing a misleading 100% / 0% reading. - examples/02-Dashboard.json: auto-init inject so the dashboard populates at deploy, NCog formatter normalizes the SUM emitted by MGC by machineCountActive, Q-H fanout trims the flat-Q tail so the H axis isn't stretched to 40m by curve-envelope clamp points, num/pct treat null AND undefined as no-data (closes the +null === 0 trap). - new test/integration/dashboard-fanout.integration.test.js (17 tests), bep-distance-demand-sweep.integration.test.js (3 tests), group-bep-cascade.integration.test.js -- total suite now 108/108 green. - .gitignore: wiki/test.gif (143 MB screen recording, kept locally only). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 22:31:25 +02:00
{
"p": "topic",
"vt": "str"
},
{
"p": "payload",
"v": "optimalControl",
"vt": "str"
}
feat(mgc): editor defaults, compact status badge, mode-case fix, real example flows + dashboard Editor (mgc.html) - Drag-in defaults now expose mode (optimalControl) and scaling (normalized) via dropdowns in the edit dialog. Was: no control fields in the UI at all, so users had to send set.mode/set.scaling after deploy or live with the hidden schema defaults. Wire-up (src/nodeClass.js) - buildDomainConfig now bridges the flat editor fields (mode, scaling) into the nested schema shape (mode.current, scaling.current). Was: returned {} so the editor's mode/scaling never reached the runtime. Mode-case bug fix (src/specificClass.js) - Schema enum values are camelCase (optimalControl, priorityControl) but the runtime switch in _runDispatch matched lowercase only. With the default config, dispatch silently fell through to the warning branch and nothing ran. Normalise via String(this.mode).toLowerCase() so both forms work. Status badge (src/io/output.js) - Compacted from ~80 chars (mode | Ⓝ: 💨=Q/Qmax | ⚡=P | N machine(s)) to ~50 chars (mode | norm | Q=Q/Qmax m³/h | P=P kW | active/total x). Drops emoji glyphs that rendered inconsistently across themes; uses the same dot+fill convention as pumpingStation. Output extension (src/io/output.js) - getOutput() now also emits flowCapacityMin/Max, machineCount, machineCountActive. Was: only group-level totals + dist-from-peak + mode/scaling, so dashboards couldn't show capacity / active count without subscribing to each rotatingMachine individually. Examples - Drop pre-refactor stubs (basic.flow.json, integration.flow.json, edge.flow.json). They had a single MGC + inject + debug, no children, and never dispatched anything. - 01-Basic.json: 1 MGC + 3 rotatingMachine pumps + Setup once-fires virtualControl + cmd.startup on all pumps via fan-out function. Numbered driver groups for Control mode / Scaling / Operator demand. Pumps register with MGC via Port 2 (child.register, automatic). - 02-Dashboard.json: same plumbing + FlowFuse Dashboard 2.0 page with Controls (mode + scaling buttons, demand slider 0–100, stop + init buttons), Status (7 ui-text rows), Trends (3 charts: flow + capacity, power, BEP rel %), and a raw-output ui-template dumping every Port 0 field. Fan-out function caches last-known values so deltas don't blank. Wiki + README - examples/README.md rewritten for the two-file set with canonical command surface table and "what to try" recipes. - wiki/Home.md §11 (Examples) updated; §14 #4 (TODO flow item) replaced with the actual current limitation (no per-pump fan-out on Port 0). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:24:03 +02:00
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"topic": "set.mode",
governance + unit-self-describing demand + dashboard fixes Two governance items from the 2026-05-14 quality review: - test/_output-manifest.md enumerates every Port 0/1/2 key MGC emits, its source, type, range, and which tests cover it in populated/degraded states (per .claude/rules/output-coverage.md). - src/control/strategies.js extracts computeEqualFlowDistribution as a pure function so the equal-flow algorithm is testable without an MGC fixture. test/basic/equalFlowDistribution.basic.test.js (6 tests) covers all three demand branches and pins the legacy quirk where the default branch counts active machines but iterates priority-ordered first-N (documented in the test so the future cleanup is a deliberate change). Plus rolled-up session work that landed alongside: - set.demand is now unit-self-describing ({value, unit:'m3/h'|'l/s'|'%'|...} or bare number = %); setScaling/scaling.current removed from MGC, commands, editor (mgc.html), specificClass. - _optimalControl + equalFlowControl now compute eta = (Q*dP)/P_shaft rather than Q/P, keeping the metric in the same scale as each child's cog. - groupEfficiency.calcRelativeDistanceFromPeak returns undefined (was 1) when pumps are homogeneous (|max-min| < 1e-9). Dashboard treats undefined as '-' instead of showing a misleading 100% / 0% reading. - examples/02-Dashboard.json: auto-init inject so the dashboard populates at deploy, NCog formatter normalizes the SUM emitted by MGC by machineCountActive, Q-H fanout trims the flat-Q tail so the H axis isn't stretched to 40m by curve-envelope clamp points, num/pct treat null AND undefined as no-data (closes the +null === 0 trap). - new test/integration/dashboard-fanout.integration.test.js (17 tests), bep-distance-demand-sweep.integration.test.js (3 tests), group-bep-cascade.integration.test.js -- total suite now 108/108 green. - .gitignore: wiki/test.gif (143 MB screen recording, kept locally only). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 22:31:25 +02:00
"x": 870,
"y": 60,
feat(mgc): editor defaults, compact status badge, mode-case fix, real example flows + dashboard Editor (mgc.html) - Drag-in defaults now expose mode (optimalControl) and scaling (normalized) via dropdowns in the edit dialog. Was: no control fields in the UI at all, so users had to send set.mode/set.scaling after deploy or live with the hidden schema defaults. Wire-up (src/nodeClass.js) - buildDomainConfig now bridges the flat editor fields (mode, scaling) into the nested schema shape (mode.current, scaling.current). Was: returned {} so the editor's mode/scaling never reached the runtime. Mode-case bug fix (src/specificClass.js) - Schema enum values are camelCase (optimalControl, priorityControl) but the runtime switch in _runDispatch matched lowercase only. With the default config, dispatch silently fell through to the warning branch and nothing ran. Normalise via String(this.mode).toLowerCase() so both forms work. Status badge (src/io/output.js) - Compacted from ~80 chars (mode | Ⓝ: 💨=Q/Qmax | ⚡=P | N machine(s)) to ~50 chars (mode | norm | Q=Q/Qmax m³/h | P=P kW | active/total x). Drops emoji glyphs that rendered inconsistently across themes; uses the same dot+fill convention as pumpingStation. Output extension (src/io/output.js) - getOutput() now also emits flowCapacityMin/Max, machineCount, machineCountActive. Was: only group-level totals + dist-from-peak + mode/scaling, so dashboards couldn't show capacity / active count without subscribing to each rotatingMachine individually. Examples - Drop pre-refactor stubs (basic.flow.json, integration.flow.json, edge.flow.json). They had a single MGC + inject + debug, no children, and never dispatched anything. - 01-Basic.json: 1 MGC + 3 rotatingMachine pumps + Setup once-fires virtualControl + cmd.startup on all pumps via fan-out function. Numbered driver groups for Control mode / Scaling / Operator demand. Pumps register with MGC via Port 2 (child.register, automatic). - 02-Dashboard.json: same plumbing + FlowFuse Dashboard 2.0 page with Controls (mode + scaling buttons, demand slider 0–100, stop + init buttons), Status (7 ui-text rows), Trends (3 charts: flow + capacity, power, BEP rel %), and a raw-output ui-template dumping every Port 0 field. Fan-out function caches last-known values so deltas don't blank. Wiki + README - examples/README.md rewritten for the two-file set with canonical command surface table and "what to try" recipes. - wiki/Home.md §11 (Examples) updated; §14 #4 (TODO flow item) replaced with the actual current limitation (no per-pump fan-out on Port 0). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:24:03 +02:00
"wires": [
[
"mgc_basic_node"
]
]
},
{
"id": "inj_mode_priority",
"type": "inject",
"z": "tab_mgc_basic",
"g": "grp_drv_mode",
"name": "set.mode = priorityControl",
"props": [
governance + unit-self-describing demand + dashboard fixes Two governance items from the 2026-05-14 quality review: - test/_output-manifest.md enumerates every Port 0/1/2 key MGC emits, its source, type, range, and which tests cover it in populated/degraded states (per .claude/rules/output-coverage.md). - src/control/strategies.js extracts computeEqualFlowDistribution as a pure function so the equal-flow algorithm is testable without an MGC fixture. test/basic/equalFlowDistribution.basic.test.js (6 tests) covers all three demand branches and pins the legacy quirk where the default branch counts active machines but iterates priority-ordered first-N (documented in the test so the future cleanup is a deliberate change). Plus rolled-up session work that landed alongside: - set.demand is now unit-self-describing ({value, unit:'m3/h'|'l/s'|'%'|...} or bare number = %); setScaling/scaling.current removed from MGC, commands, editor (mgc.html), specificClass. - _optimalControl + equalFlowControl now compute eta = (Q*dP)/P_shaft rather than Q/P, keeping the metric in the same scale as each child's cog. - groupEfficiency.calcRelativeDistanceFromPeak returns undefined (was 1) when pumps are homogeneous (|max-min| < 1e-9). Dashboard treats undefined as '-' instead of showing a misleading 100% / 0% reading. - examples/02-Dashboard.json: auto-init inject so the dashboard populates at deploy, NCog formatter normalizes the SUM emitted by MGC by machineCountActive, Q-H fanout trims the flat-Q tail so the H axis isn't stretched to 40m by curve-envelope clamp points, num/pct treat null AND undefined as no-data (closes the +null === 0 trap). - new test/integration/dashboard-fanout.integration.test.js (17 tests), bep-distance-demand-sweep.integration.test.js (3 tests), group-bep-cascade.integration.test.js -- total suite now 108/108 green. - .gitignore: wiki/test.gif (143 MB screen recording, kept locally only). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 22:31:25 +02:00
{
"p": "topic",
"vt": "str"
},
{
"p": "payload",
"v": "priorityControl",
"vt": "str"
}
feat(mgc): editor defaults, compact status badge, mode-case fix, real example flows + dashboard Editor (mgc.html) - Drag-in defaults now expose mode (optimalControl) and scaling (normalized) via dropdowns in the edit dialog. Was: no control fields in the UI at all, so users had to send set.mode/set.scaling after deploy or live with the hidden schema defaults. Wire-up (src/nodeClass.js) - buildDomainConfig now bridges the flat editor fields (mode, scaling) into the nested schema shape (mode.current, scaling.current). Was: returned {} so the editor's mode/scaling never reached the runtime. Mode-case bug fix (src/specificClass.js) - Schema enum values are camelCase (optimalControl, priorityControl) but the runtime switch in _runDispatch matched lowercase only. With the default config, dispatch silently fell through to the warning branch and nothing ran. Normalise via String(this.mode).toLowerCase() so both forms work. Status badge (src/io/output.js) - Compacted from ~80 chars (mode | Ⓝ: 💨=Q/Qmax | ⚡=P | N machine(s)) to ~50 chars (mode | norm | Q=Q/Qmax m³/h | P=P kW | active/total x). Drops emoji glyphs that rendered inconsistently across themes; uses the same dot+fill convention as pumpingStation. Output extension (src/io/output.js) - getOutput() now also emits flowCapacityMin/Max, machineCount, machineCountActive. Was: only group-level totals + dist-from-peak + mode/scaling, so dashboards couldn't show capacity / active count without subscribing to each rotatingMachine individually. Examples - Drop pre-refactor stubs (basic.flow.json, integration.flow.json, edge.flow.json). They had a single MGC + inject + debug, no children, and never dispatched anything. - 01-Basic.json: 1 MGC + 3 rotatingMachine pumps + Setup once-fires virtualControl + cmd.startup on all pumps via fan-out function. Numbered driver groups for Control mode / Scaling / Operator demand. Pumps register with MGC via Port 2 (child.register, automatic). - 02-Dashboard.json: same plumbing + FlowFuse Dashboard 2.0 page with Controls (mode + scaling buttons, demand slider 0–100, stop + init buttons), Status (7 ui-text rows), Trends (3 charts: flow + capacity, power, BEP rel %), and a raw-output ui-template dumping every Port 0 field. Fan-out function caches last-known values so deltas don't blank. Wiki + README - examples/README.md rewritten for the two-file set with canonical command surface table and "what to try" recipes. - wiki/Home.md §11 (Examples) updated; §14 #4 (TODO flow item) replaced with the actual current limitation (no per-pump fan-out on Port 0). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:24:03 +02:00
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"topic": "set.mode",
governance + unit-self-describing demand + dashboard fixes Two governance items from the 2026-05-14 quality review: - test/_output-manifest.md enumerates every Port 0/1/2 key MGC emits, its source, type, range, and which tests cover it in populated/degraded states (per .claude/rules/output-coverage.md). - src/control/strategies.js extracts computeEqualFlowDistribution as a pure function so the equal-flow algorithm is testable without an MGC fixture. test/basic/equalFlowDistribution.basic.test.js (6 tests) covers all three demand branches and pins the legacy quirk where the default branch counts active machines but iterates priority-ordered first-N (documented in the test so the future cleanup is a deliberate change). Plus rolled-up session work that landed alongside: - set.demand is now unit-self-describing ({value, unit:'m3/h'|'l/s'|'%'|...} or bare number = %); setScaling/scaling.current removed from MGC, commands, editor (mgc.html), specificClass. - _optimalControl + equalFlowControl now compute eta = (Q*dP)/P_shaft rather than Q/P, keeping the metric in the same scale as each child's cog. - groupEfficiency.calcRelativeDistanceFromPeak returns undefined (was 1) when pumps are homogeneous (|max-min| < 1e-9). Dashboard treats undefined as '-' instead of showing a misleading 100% / 0% reading. - examples/02-Dashboard.json: auto-init inject so the dashboard populates at deploy, NCog formatter normalizes the SUM emitted by MGC by machineCountActive, Q-H fanout trims the flat-Q tail so the H axis isn't stretched to 40m by curve-envelope clamp points, num/pct treat null AND undefined as no-data (closes the +null === 0 trap). - new test/integration/dashboard-fanout.integration.test.js (17 tests), bep-distance-demand-sweep.integration.test.js (3 tests), group-bep-cascade.integration.test.js -- total suite now 108/108 green. - .gitignore: wiki/test.gif (143 MB screen recording, kept locally only). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 22:31:25 +02:00
"x": 870,
"y": 100,
feat(mgc): editor defaults, compact status badge, mode-case fix, real example flows + dashboard Editor (mgc.html) - Drag-in defaults now expose mode (optimalControl) and scaling (normalized) via dropdowns in the edit dialog. Was: no control fields in the UI at all, so users had to send set.mode/set.scaling after deploy or live with the hidden schema defaults. Wire-up (src/nodeClass.js) - buildDomainConfig now bridges the flat editor fields (mode, scaling) into the nested schema shape (mode.current, scaling.current). Was: returned {} so the editor's mode/scaling never reached the runtime. Mode-case bug fix (src/specificClass.js) - Schema enum values are camelCase (optimalControl, priorityControl) but the runtime switch in _runDispatch matched lowercase only. With the default config, dispatch silently fell through to the warning branch and nothing ran. Normalise via String(this.mode).toLowerCase() so both forms work. Status badge (src/io/output.js) - Compacted from ~80 chars (mode | Ⓝ: 💨=Q/Qmax | ⚡=P | N machine(s)) to ~50 chars (mode | norm | Q=Q/Qmax m³/h | P=P kW | active/total x). Drops emoji glyphs that rendered inconsistently across themes; uses the same dot+fill convention as pumpingStation. Output extension (src/io/output.js) - getOutput() now also emits flowCapacityMin/Max, machineCount, machineCountActive. Was: only group-level totals + dist-from-peak + mode/scaling, so dashboards couldn't show capacity / active count without subscribing to each rotatingMachine individually. Examples - Drop pre-refactor stubs (basic.flow.json, integration.flow.json, edge.flow.json). They had a single MGC + inject + debug, no children, and never dispatched anything. - 01-Basic.json: 1 MGC + 3 rotatingMachine pumps + Setup once-fires virtualControl + cmd.startup on all pumps via fan-out function. Numbered driver groups for Control mode / Scaling / Operator demand. Pumps register with MGC via Port 2 (child.register, automatic). - 02-Dashboard.json: same plumbing + FlowFuse Dashboard 2.0 page with Controls (mode + scaling buttons, demand slider 0–100, stop + init buttons), Status (7 ui-text rows), Trends (3 charts: flow + capacity, power, BEP rel %), and a raw-output ui-template dumping every Port 0 field. Fan-out function caches last-known values so deltas don't blank. Wiki + README - examples/README.md rewritten for the two-file set with canonical command surface table and "what to try" recipes. - wiki/Home.md §11 (Examples) updated; §14 #4 (TODO flow item) replaced with the actual current limitation (no per-pump fan-out on Port 0). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:24:03 +02:00
"wires": [
[
"mgc_basic_node"
]
]
}
governance + unit-self-describing demand + dashboard fixes Two governance items from the 2026-05-14 quality review: - test/_output-manifest.md enumerates every Port 0/1/2 key MGC emits, its source, type, range, and which tests cover it in populated/degraded states (per .claude/rules/output-coverage.md). - src/control/strategies.js extracts computeEqualFlowDistribution as a pure function so the equal-flow algorithm is testable without an MGC fixture. test/basic/equalFlowDistribution.basic.test.js (6 tests) covers all three demand branches and pins the legacy quirk where the default branch counts active machines but iterates priority-ordered first-N (documented in the test so the future cleanup is a deliberate change). Plus rolled-up session work that landed alongside: - set.demand is now unit-self-describing ({value, unit:'m3/h'|'l/s'|'%'|...} or bare number = %); setScaling/scaling.current removed from MGC, commands, editor (mgc.html), specificClass. - _optimalControl + equalFlowControl now compute eta = (Q*dP)/P_shaft rather than Q/P, keeping the metric in the same scale as each child's cog. - groupEfficiency.calcRelativeDistanceFromPeak returns undefined (was 1) when pumps are homogeneous (|max-min| < 1e-9). Dashboard treats undefined as '-' instead of showing a misleading 100% / 0% reading. - examples/02-Dashboard.json: auto-init inject so the dashboard populates at deploy, NCog formatter normalizes the SUM emitted by MGC by machineCountActive, Q-H fanout trims the flat-Q tail so the H axis isn't stretched to 40m by curve-envelope clamp points, num/pct treat null AND undefined as no-data (closes the +null === 0 trap). - new test/integration/dashboard-fanout.integration.test.js (17 tests), bep-distance-demand-sweep.integration.test.js (3 tests), group-bep-cascade.integration.test.js -- total suite now 108/108 green. - .gitignore: wiki/test.gif (143 MB screen recording, kept locally only). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 22:31:25 +02:00
]