Per-project flow-units state + label helpers.
More...
#include <unitsystem.h>
Per-project flow-units state + label helpers.
Each SWMMVisProjectWindow owns one instance and writes/reads the FLOW_UNITS option through it. The class also exposes a delegating facade via UnitSystem::instance() — a singleton whose accessors forward to whichever per-project instance is currently active (set on MDI tab switch).
Existing callsites like UnitSystem::instance()->depthLabel() keep working unchanged; the value reflects the focused project, not a global setting.
◆ UnitSystem()
| UnitSystem::UnitSystem |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ activeProject()
Returns the currently-bound per-project UnitSystem (may be null).
◆ areaLabel()
| QString UnitSystem::areaLabel |
( |
| ) |
const |
◆ depthLabel()
| QString UnitSystem::depthLabel |
( |
| ) |
const |
◆ flowUnitLabel()
| QString UnitSystem::flowUnitLabel |
( |
| ) |
const |
◆ flowUnits()
| swmm_FlowUnitsProperty UnitSystem::flowUnits |
( |
| ) |
const |
◆ instance()
Singleton facade — accessors below forward to the active project.
◆ isSI()
| bool UnitSystem::isSI |
( |
| ) |
const |
◆ lengthLabel()
| QString UnitSystem::lengthLabel |
( |
| ) |
const |
◆ setActiveProject()
| void UnitSystem::setActiveProject |
( |
UnitSystem * |
units | ) |
|
|
static |
Bind the facade to a per-project UnitSystem (or null when no project).
◆ setFlowUnits()
| void UnitSystem::setFlowUnits |
( |
swmm_FlowUnitsProperty |
units, |
|
|
SWMM_Engine |
engine = nullptr |
|
) |
| |
Write new units to an open engine and emit unitsChanged.
◆ syncFromEngine()
Read units from an open engine (call after swmm_engine_open).
◆ unitsChanged
| void UnitSystem::unitsChanged |
( |
swmm_FlowUnitsProperty |
newUnits | ) |
|
|
signal |
◆ velocityLabel()
| QString UnitSystem::velocityLabel |
( |
| ) |
const |
◆ volumeLabel()
| QString UnitSystem::volumeLabel |
( |
| ) |
const |
The documentation for this class was generated from the following files:
- /home/runner/work/openswmm.gui/openswmm.gui/include/core/unitsystem.h
- /home/runner/work/openswmm.gui/openswmm.gui/src/core/unitsystem.cpp