From 1ebbcb62cc0facc9a7271f077f3d8076de17ad93 Mon Sep 17 00:00:00 2001 From: znetsixe Date: Thu, 23 Apr 2026 09:58:17 +0200 Subject: [PATCH] Editor: pipe-edge conventions + live derived safety levels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### P1 — match diagram naming (labels only, no schema change) - "Inlet Elevation" → "Inlet (bottom of pipe, m)" - "Outlet Elevation" → "Outlet (top of pipe, m)" - "Overflow Level" → "Overflow (weir crest, m)" - "Basin Bottom (m Refheight)" → "Basin floor above datum (m)" - Added a one-line banner at the top of Basin Geometry: "All heights measured from the basin floor (0 m)." These map directly to the clarifications added to basin-model.drawio.svg so editor and diagram speak the same vocabulary. ### P3 — live derived safety levels next to the % fields Low/High Volume Threshold fields now show the resulting trip level live as the operator types: Low Volume Threshold (%) [ 2 ] → dryRunLevel ≈ 0.21 m High Volume Threshold (%) [ 98 ] → overfillLevel ≈ 4.41 m Recomputed on every input/change of outflowLevel, inflowLevel, overflowLevel, minHeightBasedOn, or either %. Pure UI feedback — no schema change, no save-side change, same formulas as specificClass._validateThresholdOrdering(). Also includes the user's latest basin-model.drawio.svg update (inlet=bottom/outlet=top labels + datum annotation). Co-Authored-By: Claude Opus 4.7 (1M context) --- pumpingStation.html | 41 ++++++++++++++++++++++++---- wiki/diagrams/basin-model.drawio.svg | 4 +-- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/pumpingStation.html b/pumpingStation.html index 74506a9..f9472b3 100644 --- a/pumpingStation.html +++ b/pumpingStation.html @@ -173,6 +173,32 @@ setNumberField('node-input-flowSetpoint', this.flowSetpoint); setNumberField('node-input-flowDeadband', this.flowDeadband); + // Live-compute derived safety levels so the operator can see + // what the % will actually trip at. Mirrors the code formula + // in specificClass._validateThresholdOrdering. + const fNum = (id) => parseFloat(document.getElementById(`node-input-${id}`)?.value); + const updateDerivedLevels = () => { + const basedOn = document.getElementById('node-input-minHeightBasedOn')?.value || 'outlet'; + const refLow = basedOn === 'inlet' ? fNum('inflowLevel') : fNum('outflowLevel'); + const dryRunPct = fNum('dryRunThresholdPercent'); + const overfillPct = fNum('overfillThresholdPercent'); + const overflow = fNum('overflowLevel'); + const dryRunLvl = Number.isFinite(refLow) && Number.isFinite(dryRunPct) + ? refLow * (1 + dryRunPct / 100) : null; + const overfillLvl = Number.isFinite(overflow) && Number.isFinite(overfillPct) + ? overflow * (overfillPct / 100) : null; + const dryEl = document.getElementById('derived-dryRunLevel'); + const ovfEl = document.getElementById('derived-overfillLevel'); + if (dryEl) dryEl.textContent = dryRunLvl != null ? `→ dryRunLevel ≈ ${dryRunLvl.toFixed(2)} m` : '→ dryRunLevel ≈ — m'; + if (ovfEl) ovfEl.textContent = overfillLvl != null ? `→ overfillLevel ≈ ${overfillLvl.toFixed(2)} m` : '→ overfillLevel ≈ — m'; + }; + ['inflowLevel','outflowLevel','overflowLevel','minHeightBasedOn','dryRunThresholdPercent','overfillThresholdPercent'] + .forEach((id) => { + const el = document.getElementById(`node-input-${id}`); + if (el) { el.addEventListener('input', updateDerivedLevels); el.addEventListener('change', updateDerivedLevels); } + }); + setTimeout(updateDerivedLevels, 50); + //------------------- END OF CUSTOM config UI ELEMENTS ------------------- // }, oneditsave: function () { @@ -225,6 +251,7 @@

Basin Geometry

+

All heights measured from the basin floor (0 m).

@@ -236,15 +263,15 @@
- +
- +
- +
@@ -306,7 +333,7 @@
- +
@@ -329,7 +356,8 @@
- + + → dryRunLevel ≈ — m
@@ -341,7 +369,8 @@
- + + → overfillLevel ≈ — m

diff --git a/wiki/diagrams/basin-model.drawio.svg b/wiki/diagrams/basin-model.drawio.svg index 0279225..cf97656 100644 --- a/wiki/diagrams/basin-model.drawio.svg +++ b/wiki/diagrams/basin-model.drawio.svg @@ -1,6 +1,6 @@ -
5. overflowLevel
4. maxLevel
3. startLevel
Sewage + Tank buffer
2. minLevel
Spare volume before spilling
Notes: 
  • All levels should be dynamic. It could also very well be that at a certain time we want to dynamically move the startLevel up or down depending on the situation the weather or incoming flow is in.
  • All level heights are measured from the ref at bottom of basin
1. dryRunLevel
  1. At this level pumps cant pump anymore they will run dry. 
  2. This is the minimum level that should be obtained to protect the pumps from dry-running. Again minLevel and dryLevel can theoretically be the same but isnt advisable seeing there are mechanical delays and other system effects which could harm the pumps.
  3. System is active and pumps flow away.
  4. Flow goes out in the basin or somewhere else in the system. This is the height where gray water will spill over to the river without being cleaned.
  5. MaxLevel is up to where we can "store water" maxLevel and OverflowLevel can theoretically be the same. Its always smart to have a minimum buffer of n %. Its important to factor in measurement deviation in repeatability and accuracy in determining this.
Tank buffer
Inlet Level 
Bottom Of Pipe
(m)
Outlet Level 
Top of pipe
(m)
Tank buffer
Dead volume
Volume (m3)
-----------------------------
Basin height (m)
0 meter (Ref height)
Bottom of pipe 
(m)
\ No newline at end of file