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
openswmmvis::plot::SwmmOutRunLayer Class Referencefinal

#include <swmmoutrunlayer.h>

Inheritance diagram for openswmmvis::plot::SwmmOutRunLayer:
Collaboration diagram for openswmmvis::plot::SwmmOutRunLayer:

Public Member Functions

 SwmmOutRunLayer (SWMMResultsLayer *layer)
 Wrap an existing on-canvas SWMMResultsLayer (non-owning).
 
 ~SwmmOutRunLayer () override=default
 
SWMMResultsLayerlayer () const
 Underlying layer (may be null if it was destroyed).
 
QString scenarioName () const override
 Human label shown in the SeriesPanel tree + legends.
 
UnitSystem unitSystem () const override
 Unit system the source advertises (drives axis labels).
 
double startDateJulian () const override
 Start date of the simulation as SWMM Julian, or NaN if unknown.
 
int periodCount () const override
 Total number of time periods available (grows during live mode).
 
int reportStepSeconds () const override
 Report step in seconds. 0 if unknown.
 
QString persistenceKey () const override
 Stable identity string for .oswp round-trip. Defaults to the scenario name; subclasses may override with a file path or layer GUID.
 
void getSeriesAt (const ObjectRef &ref, PlotAttribute attr, SeriesData &out) const override
 Resolve a series. Returns timesJulian + values for the spec. Implementations are responsible for resolving ref against their own indexing (e.g. SWMM ID → output-file index, triIdx → mesh face). When ref or attr is not supported, set out.ok = false and fill out.errorMessage.
 
bool supportsAttribute (PlotAttribute attr) const override
 Convenience: does this source carry the given attribute at all? Default impl returns true; subclasses can refine (e.g. hide velocity attributes when CF.2 edge-flux data is missing).
 
QVector< ResultDescriptorresultDescriptorsForKind (ObjectRef::Kind kind) const override
 Y2b-1: fixed set + the open run's species BY NAME (D-G1). Legacy .out (no quality) serves the fixed set only.
 
void getSeriesAt (const ObjectRef &ref, const ResultDescriptor &descriptor, SeriesData &out) const override
 Y2b-2: species series resolve NAME → index → per-kind SWMM_OUT_*_POLLUT_BASE + index against the run's live species list on every call (D-G1 — a stored index would repoint when a model edit reorders species). Fixed attributes take the enum path unchanged.
 
- Public Member Functions inherited from openswmmvis::plot::IRunLayer
virtual ~IRunLayer ()=default
 

Static Public Member Functions

static int speciesVariableCodeFor (const QString &species, const QStringList &runSpecies, ObjectRef::Kind kind)
 Map a species NAME to the engine's per-object var code: SWMM_OUT_{NODE,LINK,SUBCATCH}_POLLUT_BASE + indexOf(name). Returns -1 when the run does not carry the species or the kind has no species columns. Pure mapping — exposed for testing, and reorder-safe by construction (the index comes from runSpecies at call time, never from storage).
 
static int variableCodeFor (PlotAttribute attr, ObjectRef::Kind kind)
 Map a PlotAttribute + ObjectRef::Kind to the engine's per-object var code (SWMM_OUT_NODE_*, SWMM_OUT_LINK_*, SWMM_OUT_SUBCATCH_*, SWMM_OUT_SYS_*). Returns -1 when the combination isn't valid (e.g. NodeDepth on a Link, or a Mesh2D attribute on any kind). Pure mapping — exposed for testing.
 

Constructor & Destructor Documentation

◆ SwmmOutRunLayer()

openswmmvis::plot::SwmmOutRunLayer::SwmmOutRunLayer ( SWMMResultsLayer layer)
explicit

Wrap an existing on-canvas SWMMResultsLayer (non-owning).

◆ ~SwmmOutRunLayer()

openswmmvis::plot::SwmmOutRunLayer::~SwmmOutRunLayer ( )
overridedefault

Member Function Documentation

◆ getSeriesAt() [1/2]

void openswmmvis::plot::SwmmOutRunLayer::getSeriesAt ( const ObjectRef ref,
const ResultDescriptor descriptor,
SeriesData out 
) const
overridevirtual

Y2b-2: species series resolve NAME → index → per-kind SWMM_OUT_*_POLLUT_BASE + index against the run's live species list on every call (D-G1 — a stored index would repoint when a model edit reorders species). Fixed attributes take the enum path unchanged.

Reimplemented from openswmmvis::plot::IRunLayer.

Here is the call graph for this function:

◆ getSeriesAt() [2/2]

void openswmmvis::plot::SwmmOutRunLayer::getSeriesAt ( const ObjectRef ref,
PlotAttribute  attr,
SeriesData out 
) const
overridevirtual

Resolve a series. Returns timesJulian + values for the spec. Implementations are responsible for resolving ref against their own indexing (e.g. SWMM ID → output-file index, triIdx → mesh face). When ref or attr is not supported, set out.ok = false and fill out.errorMessage.

Implements openswmmvis::plot::IRunLayer.

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

◆ layer()

SWMMResultsLayer * openswmmvis::plot::SwmmOutRunLayer::layer ( ) const

Underlying layer (may be null if it was destroyed).

◆ periodCount()

int openswmmvis::plot::SwmmOutRunLayer::periodCount ( ) const
overridevirtual

Total number of time periods available (grows during live mode).

Implements openswmmvis::plot::IRunLayer.

◆ persistenceKey()

QString openswmmvis::plot::SwmmOutRunLayer::persistenceKey ( ) const
overridevirtual

Stable identity string for .oswp round-trip. Defaults to the scenario name; subclasses may override with a file path or layer GUID.

Reimplemented from openswmmvis::plot::IRunLayer.

◆ reportStepSeconds()

int openswmmvis::plot::SwmmOutRunLayer::reportStepSeconds ( ) const
overridevirtual

Report step in seconds. 0 if unknown.

Implements openswmmvis::plot::IRunLayer.

◆ resultDescriptorsForKind()

QVector< ResultDescriptor > openswmmvis::plot::SwmmOutRunLayer::resultDescriptorsForKind ( ObjectRef::Kind  kind) const
overridevirtual

Y2b-1: fixed set + the open run's species BY NAME (D-G1). Legacy .out (no quality) serves the fixed set only.

Reimplemented from openswmmvis::plot::IRunLayer.

Here is the call graph for this function:

◆ scenarioName()

QString openswmmvis::plot::SwmmOutRunLayer::scenarioName ( ) const
overridevirtual

Human label shown in the SeriesPanel tree + legends.

Implements openswmmvis::plot::IRunLayer.

◆ speciesVariableCodeFor()

int openswmmvis::plot::SwmmOutRunLayer::speciesVariableCodeFor ( const QString &  species,
const QStringList &  runSpecies,
ObjectRef::Kind  kind 
)
static

Map a species NAME to the engine's per-object var code: SWMM_OUT_{NODE,LINK,SUBCATCH}_POLLUT_BASE + indexOf(name). Returns -1 when the run does not carry the species or the kind has no species columns. Pure mapping — exposed for testing, and reorder-safe by construction (the index comes from runSpecies at call time, never from storage).

Here is the caller graph for this function:

◆ startDateJulian()

double openswmmvis::plot::SwmmOutRunLayer::startDateJulian ( ) const
overridevirtual

Start date of the simulation as SWMM Julian, or NaN if unknown.

Implements openswmmvis::plot::IRunLayer.

◆ supportsAttribute()

bool openswmmvis::plot::SwmmOutRunLayer::supportsAttribute ( PlotAttribute  ) const
overridevirtual

Convenience: does this source carry the given attribute at all? Default impl returns true; subclasses can refine (e.g. hide velocity attributes when CF.2 edge-flux data is missing).

Reimplemented from openswmmvis::plot::IRunLayer.

Here is the call graph for this function:

◆ unitSystem()

UnitSystem openswmmvis::plot::SwmmOutRunLayer::unitSystem ( ) const
overridevirtual

Unit system the source advertises (drives axis labels).

Implements openswmmvis::plot::IRunLayer.

Here is the call graph for this function:

◆ variableCodeFor()

int openswmmvis::plot::SwmmOutRunLayer::variableCodeFor ( PlotAttribute  attr,
ObjectRef::Kind  kind 
)
static

Map a PlotAttribute + ObjectRef::Kind to the engine's per-object var code (SWMM_OUT_NODE_*, SWMM_OUT_LINK_*, SWMM_OUT_SUBCATCH_*, SWMM_OUT_SYS_*). Returns -1 when the combination isn't valid (e.g. NodeDepth on a Link, or a Mesh2D attribute on any kind). Pure mapping — exposed for testing.

Here is the caller graph for this function:

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