22#ifndef OPENSWMMVIS_PLOT_IRUNLAYER_H
23#define OPENSWMMVIS_PLOT_IRUNLAYER_H
77 default:
return !
name.isEmpty();
83 return kind == other.kind &&
name == other.name
107 static const QVector<PlotAttribute> kEmpty;
127 QVector<ResultDescriptor> out;
129 out.reserve(fixed.size() + speciesNames.size());
141 for (
const QString &sp : speciesNames)
218 QStringLiteral(
"Source '%1' carries no species results")
Per-project flow-units state + label helpers.
Definition unitsystem.h:28
Abstract source backing one comparison-plot run.
Definition irunlayer.h:171
virtual QString persistenceKey() const
Stable identity string for .oswp round-trip. Defaults to the scenario name; subclasses may override w...
Definition irunlayer.h:242
virtual int reportStepSeconds() const =0
Report step in seconds. 0 if unknown.
virtual ~IRunLayer()=default
virtual UnitSystem unitSystem() const =0
Unit system the source advertises (drives axis labels).
virtual double startDateJulian() const =0
Start date of the simulation as SWMM Julian, or NaN if unknown.
virtual QVector< ResultDescriptor > resultDescriptorsForKind(ObjectRef::Kind kind) const
Y2b-1 (amendment D-Y4): everything plottable for kind on THIS run — the fixed attribute set as descri...
Definition irunlayer.h:236
virtual void getSeriesAt(const ObjectRef &ref, const ResultDescriptor &descriptor, SeriesData &out) const
Y2b-2 (amendment D-Y4): resolve a series by DESCRIPTOR. Fixed attributes forward to the enum overload...
Definition irunlayer.h:211
virtual void getSeriesAt(const ObjectRef &ref, PlotAttribute attr, SeriesData &out) const =0
Resolve a series. Returns timesJulian + values for the spec. Implementations are responsible for reso...
virtual QString scenarioName() const =0
Human label shown in the SeriesPanel tree + legends.
virtual int periodCount() const =0
Total number of time periods available (grows during live mode).
virtual bool supportsAttribute(PlotAttribute) const
Convenience: does this source carry the given attribute at all? Default impl returns true; subclasses...
Definition irunlayer.h:202
std::size_t n
Definition mesh2dresultsexport.cpp:426
int k
Definition mesh2dresultsexport.cpp:549
int a
Definition meshquadmatch.cpp:46
Definition chartproperties.h:34
const QVector< PlotAttribute > & mesh2DCellPlotAttributes()
The 7 per-2D-cell attributes, presentation order.
Definition plotattribute.cpp:69
const QVector< PlotAttribute > & mesh2DVertexPlotAttributes()
The 2 per-2D-vertex attributes (depth, HGL — interpolated).
Definition plotattribute.cpp:92
const QVector< PlotAttribute > & nodePlotAttributes()
The 6 per-node attributes, presentation order.
Definition plotattribute.cpp:11
PlotAttribute
What a series plots. One row per attribute in the Nx2 grid.
Definition plotattribute.h:38
const QVector< PlotAttribute > & mesh2DEdgePlotAttributes()
The 2 per-2D-edge attributes (flow, unit-width flux).
Definition plotattribute.cpp:83
const QVector< PlotAttribute > & attributesForKind(ObjectRef::Kind k)
The canonical plottable-attribute list for k (presentation order), dispatching to the shared lists in...
Definition irunlayer.h:96
QVector< ResultDescriptor > resultDescriptorsForKind(ObjectRef::Kind kind, const QStringList &speciesNames)
Y2b-1 (amendment D-Y4): the kind-keyed DESCRIPTOR list — the fixed attributesForKind(kind) set wrappe...
Definition irunlayer.h:124
const QVector< PlotAttribute > & systemPlotAttributes()
The 14 system-wide attributes, presentation order (matches the long-standing system picker menu: Rain...
Definition plotattribute.cpp:48
const QVector< PlotAttribute > & subcatchPlotAttributes()
The 5 per-subcatchment attributes, presentation order.
Definition plotattribute.cpp:36
const QVector< PlotAttribute > & linkPlotAttributes()
The 5 per-link attributes, presentation order.
Definition plotattribute.cpp:24
Slice BL — canonical enumeration of plottable result attributes.
EdgeRef ref
Definition pslgminsize.cpp:377
TokenKind kind
Definition queryparser.cpp:34
Y2b-1 (amendment D-Y4) — one plottable result, fixed or species.
Identifies what object a series is about. Kind is the discriminator; the active union member is impli...
Definition irunlayer.h:38
static ObjectRef forObserved(QString lbl)
Definition irunlayer.h:66
static ObjectRef forSystem()
Definition irunlayer.h:67
bool isValid() const noexcept
Definition irunlayer.h:69
Kind
Definition irunlayer.h:39
@ Mesh2DEdge
triIdx + edgeLocal valid; name unused — for edge-flux series
@ Observed
name = observed series label (e.g. CSV header)
@ Node
name = SWMM node ID
@ Link
name = SWMM link ID
@ System
single global series per attribute; name unused (AT.2)
@ Mesh2DCell
triIdx valid; name unused (CF.3)
@ Mesh2DVertex
triIdx holds the vertex index; depth/HGL interpolated from incident cells
@ Subcatch
name = SWMM subcatchment ID
constexpr ObjectRef()=default
QString name
SWMM ID for 1D kinds; observed-series label for Observed; unused for System.
Definition irunlayer.h:52
static ObjectRef forMesh2DVertex(int idx)
Definition irunlayer.h:64
static ObjectRef forNode(QString n)
Definition irunlayer.h:58
bool operator!=(const ObjectRef &other) const noexcept
Definition irunlayer.h:86
static ObjectRef forLink(QString n)
Definition irunlayer.h:59
ObjectRef(Kind k, QString n)
Definition irunlayer.h:57
static ObjectRef forMesh2DEdge(int tri, int edge)
Definition irunlayer.h:62
static ObjectRef forSubcatch(QString n)
Definition irunlayer.h:60
static ObjectRef forMesh2DCell(int idx)
Definition irunlayer.h:61
bool operator==(const ObjectRef &other) const noexcept
Definition irunlayer.h:81
int edgeLocal
Local edge index 0..2 for Mesh2DEdge; -1 otherwise.
Definition irunlayer.h:54
Kind kind
Definition irunlayer.h:51
int triIdx
Triangle index for Mesh2DCell / Mesh2DEdge; vertex index for Mesh2DVertex; -1 otherwise.
Definition irunlayer.h:53
One plottable result: a fixed attribute OR a species by name.
Definition resultdescriptor.h:39
bool isSpecies() const noexcept
Definition resultdescriptor.h:47
static ResultDescriptor forAttribute(PlotAttribute a)
Definition resultdescriptor.h:65
PlotAttribute attr
Definition resultdescriptor.h:41
static ResultDescriptor forSpecies(const QString &name)
Definition resultdescriptor.h:68
Result of one series resolution. Times are SWMM DateTime doubles (OLE-Automation epoch,...
Definition irunlayer.h:151
QString errorMessage
Populated when ok == false.
Definition irunlayer.h:155
std::vector< double > values
Same length as timesJulian.
Definition irunlayer.h:153
int firstPeriod
Definition irunlayer.h:164
std::vector< double > timesJulian
SWMM DateTime; convert via openswmmvis::core::swmmDateTimeToQDateTime.
Definition irunlayer.h:152
bool ok
False if the source couldn't fulfil the request.
Definition irunlayer.h:154
int periodCount
Definition irunlayer.h:167