SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
UnitSystem Class Reference

Per-project flow-units state + label helpers. More...

#include <unitsystem.h>

Inheritance diagram for UnitSystem:
Collaboration diagram for UnitSystem:

Signals

void unitsChanged (swmm_FlowUnitsProperty newUnits)
 

Public Member Functions

 UnitSystem (QObject *parent=nullptr)
 
swmm_FlowUnitsProperty flowUnits () const
 
void syncFromEngine (SWMM_Engine engine)
 
void setFlowUnits (swmm_FlowUnitsProperty units, SWMM_Engine engine=nullptr)
 
bool isSI () const
 
QString flowUnitLabel () const
 
QString lengthLabel () const
 
QString depthLabel () const
 
QString velocityLabel () const
 
QString areaLabel () const
 
QString volumeLabel () const
 

Static Public Member Functions

static UnitSysteminstance ()
 
static void setActiveProject (UnitSystem *units)
 
static UnitSystemactiveProject ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ UnitSystem()

UnitSystem::UnitSystem ( QObject *  parent = nullptr)
explicit

Member Function Documentation

◆ activeProject()

UnitSystem * UnitSystem::activeProject ( )
static

Returns the currently-bound per-project UnitSystem (may be null).

◆ areaLabel()

QString UnitSystem::areaLabel ( ) const
Here is the call graph for this function:

◆ depthLabel()

QString UnitSystem::depthLabel ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ flowUnitLabel()

QString UnitSystem::flowUnitLabel ( ) const
Here is the call graph for this function:

◆ flowUnits()

swmm_FlowUnitsProperty UnitSystem::flowUnits ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ instance()

UnitSystem * UnitSystem::instance ( )
static

Singleton facade — accessors below forward to the active project.

Here is the caller graph for this function:

◆ isSI()

bool UnitSystem::isSI ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lengthLabel()

QString UnitSystem::lengthLabel ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setActiveProject()

void UnitSystem::setActiveProject ( UnitSystem units)
static

Bind the facade to a per-project UnitSystem (or null when no project).

Here is the call graph for this function:

◆ setFlowUnits()

void UnitSystem::setFlowUnits ( swmm_FlowUnitsProperty  units,
SWMM_Engine  engine = nullptr 
)

Write new units to an open engine and emit unitsChanged.

Here is the call graph for this function:

◆ syncFromEngine()

void UnitSystem::syncFromEngine ( SWMM_Engine  engine)

Read units from an open engine (call after swmm_engine_open).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unitsChanged

void UnitSystem::unitsChanged ( swmm_FlowUnitsProperty  newUnits)
signal
Here is the caller graph for this function:

◆ velocityLabel()

QString UnitSystem::velocityLabel ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ volumeLabel()

QString UnitSystem::volumeLabel ( ) const
Here is the call graph for this function:

The documentation for this class was generated from the following files: