![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Classes | |
| struct | AttributeRow |
| Derived aggregation for one chart row. The model recomputes these whenever the spec list changes; views read them to lay out axes. More... | |
| class | ChartProperties |
| struct | ComparisonPair |
| One user-configured 1v1 comparison: X-series vs Y-series (COMPARISON_PLOT_1V1_AND_TREE_PLAN Phase 5). Both series must target the same PlotAttribute (same chart row). When the pair list is empty the view falls back to auto pairing (baseline vs every other run, matched by objectRef). More... | |
| class | ComparisonPlotModel |
| Model layer for the Comparison Plot Dialog. More... | |
| struct | ExportSeries |
| One series to export — name becomes the CSV column header / .dat comment line. Times are SWMM Julian doubles (see core/swmmdatetime.h). More... | |
| struct | FitMetrics |
| class | IRunLayer |
| Abstract source backing one comparison-plot run. More... | |
| class | Mesh2DRunLayer |
| struct | NumberFormat |
| A mode + count describing how to render a double. More... | |
| struct | ObjectRef |
| Identifies what object a series is about. Kind is the discriminator; the active union member is implied by kind. More... | |
| class | ObservedCsvRunLayer |
| struct | PairedSamples |
| Paired (x, y) sample values produced by pairSamplesNearest. More... | |
| class | RainfallSeriesModel |
| struct | RainGageRainfall |
| One rain gage's metadata + resolved rainfall series. More... | |
| struct | RainGageStats |
| Per-gage summary statistics (computed from the resolved series). More... | |
| struct | ResultDescriptor |
| One plottable result: a fixed attribute OR a species by name. More... | |
| struct | RunSource |
One loaded run in the plot — a 1D .out, an observed CSV, or a 2D mesh layer. More... | |
| struct | SeriesData |
| Result of one series resolution. Times are SWMM DateTime doubles (OLE-Automation epoch, not astronomical Julian — see core/swmmdatetime.h); values are in the unit system the source advertises. More... | |
| struct | SeriesSpec |
| One chart series — points at a RunSource via index and identifies what to read from it. More... | |
| struct | SeriesStatistics |
| struct | SeriesStyle |
| Aggregated rendering parameters for one chart series. More... | |
| class | SeriesStyleObject |
| class | SwmmOutRunLayer |
| class | UtcTimeAxis |
Enumerations | |
| enum class | NumberFormatMode { Decimals = 0 , SignificantFigures = 1 , Scientific = 2 , Engineering = 3 , Thousands = 4 } |
Interpretation of NumberFormat::count. More... | |
| enum | AxisNumberFormatPreset { Integer = 0 , Decimals1 = 1 , Decimals2 = 2 , Decimals3 = 3 , Decimals4 = 4 , Decimals6 = 5 , SigFigs3 = 6 , SigFigs4 = 7 , SigFigs6 = 8 , Scientific2 = 9 , Scientific3 = 10 , Scientific4 = 11 , Engineering2 = 12 , Engineering3 = 13 , ThousandsInteger = 14 , Thousands1 = 15 , Thousands2 = 16 } |
| The axis-format choices offered to the user, as one combined list. More... | |
| enum class | UnitSystem { US , SI } |
Unit system carried per .out file. Sourced from swmm_output_get_flow_units: 0=CFS / 1=GPM / 2=MGD → US, 3=CMS / 4=LPS / 5=MLD → SI. More... | |
| enum class | PlotAttribute { Unknown = 0 , NodeDepth = 1 , NodeHead = 2 , NodeVolume = 3 , NodeLateralInflow = 4 , NodeTotalInflow = 5 , NodeOverflow = 6 , LinkFlow = 7 , LinkDepth = 8 , LinkVelocity = 9 , LinkVolume = 10 , LinkCapacity = 11 , SubcatchRainfall = 12 , SubcatchSnowDepth = 13 , SubcatchEvap = 14 , SubcatchInfil = 15 , SubcatchRunoff = 16 , Mesh2DDepth = 17 , Mesh2DHGL = 18 , Mesh2DVelocityMag = 19 , Mesh2DVelocityX = 20 , Mesh2DVelocityY = 21 , SystemTemperature = 22 , SystemRainfall = 23 , SystemSnowDepth = 24 , SystemEvap = 25 , SystemInfil = 26 , SystemRunoff = 27 , SystemDwInflow = 28 , SystemGwInflow = 29 , SystemLatInflow = 30 , SystemFlooding = 31 , SystemOutflow = 32 , SystemStorage = 33 , SystemEvapTotal = 34 , SystemPET = 35 , Mesh2DEdgeFlux = 36 , Mesh2DEdgeFlow = 37 , Mesh2DRainfall = 38 , Mesh2DRainVolume = 39 } |
| What a series plots. One row per attribute in the Nx2 grid. More... | |
| enum class | MarkerShape { Circle , Square , Triangle , Diamond , Cross , Plus } |
Marker shape used when SeriesStyle::showMarkers == true. More... | |
Functions | |
| const QVector< PlotAttribute > & | attributesForKind (ObjectRef::Kind k) |
The canonical plottable-attribute list for k (presentation order), dispatching to the shared lists in plotattribute.h. Lives here rather than there because the nested ObjectRef::Kind cannot be named in plotattribute.h without an include cycle. Empty for kinds with no fixed list (Observed and Unknown). Mesh kinds return their full list; per-layer availability (edge flux, rainfall datasets) is gated by IRunLayer::supportsAttribute. | |
| QVector< ResultDescriptor > | resultDescriptorsForKind (ObjectRef::Kind kind, const QStringList &speciesNames) |
Y2b-1 (amendment D-Y4): the kind-keyed DESCRIPTOR list — the fixed attributesForKind(kind) set wrapped, plus one species descriptor per name in speciesNames for the element kinds that carry species columns (node/link/subcatch). Species ride BY NAME (D-G1). INLINE because IRunLayer's default implementation below calls it, and IRunLayer must stay a header-only interface — hundreds of tests stub it without linking any plot TU, so nothing reachable from a virtual's default may live in a .cpp (measured twice: an out-of-line default anchored the vtable in resultdescriptor.cpp, and an out-of-line list builder left the same tests with an undefined free-function symbol). | |
| NumberFormat | numberFormatForPreset (int preset) |
| The mode + count a preset stands for. Out-of-range input falls back to two decimals, which is the historic default. | |
| int | presetForNumberFormat (NumberFormatMode mode, int count) |
| The preset that best represents mode + count. | |
| QString | labelFor (PlotAttribute a) |
| Short human label, e.g. "Depth", "Flow", "Velocity |V|". | |
| QString | unitsFor (PlotAttribute a, UnitSystem u) |
| Unit string for the given attribute + unit system, e.g. "m", "ft³/s". | |
| QString | labelWithUnits (PlotAttribute a, UnitSystem u) |
Concatenation of labelFor(a) + "(" + unitsFor(a,u) + ")". | |
| UnitSystem | unitSystemFromFlowUnits (int flowUnits) |
Map an engine swmm_output_get_flow_units return value to UnitSystem. | |
| const QVector< PlotAttribute > & | nodePlotAttributes () |
| The 6 per-node attributes, presentation order. | |
| const QVector< PlotAttribute > & | linkPlotAttributes () |
| The 5 per-link attributes, presentation order. | |
| const QVector< PlotAttribute > & | subcatchPlotAttributes () |
| The 5 per-subcatchment attributes, presentation order. | |
| const QVector< PlotAttribute > & | systemPlotAttributes () |
| The 14 system-wide attributes, presentation order (matches the long-standing system picker menu: Rainfall first, Temperature last). | |
| const QVector< PlotAttribute > & | mesh2DCellPlotAttributes () |
| The 7 per-2D-cell attributes, presentation order. | |
| const QVector< PlotAttribute > & | mesh2DEdgePlotAttributes () |
| The 2 per-2D-edge attributes (flow, unit-width flux). | |
| const QVector< PlotAttribute > & | mesh2DVertexPlotAttributes () |
| The 2 per-2D-vertex attributes (depth, HGL — interpolated). | |
| bool | isMesh2DAttribute (PlotAttribute a) noexcept |
| True iff the attribute is a 2D mesh-cell quantity (CF.3). | |
| bool | isSystemAttribute (PlotAttribute a) noexcept |
True iff the attribute is a system-wide quantity (Slice AT.2). System attributes resolve via swmm_output_get_system_series and carry no per-object name (ObjectRef::Kind::System suffices). | |
| QString | seriesToCsvText (const QVector< ExportSeries > &series) |
| Build wide-format CSV text: column 0 = ISO timestamp, one column per series. Rows are the sorted union of all series' timestamps; a cell is empty where its series has no sample (or a non-finite value) at that time. | |
| QString | seriesToDatText (const ExportSeries &series) |
| Build SWMM .dat text for a single series: ";name" comment line followed by "MM/dd/yyyy HH:mm:ss value" rows. Non-finite values are skipped (SWMM cannot parse them). | |
| bool | writeSeriesCsv (const QString &path, const QVector< ExportSeries > &series, QString *errorOut=nullptr) |
Write CSV to path. Returns false and populates errorOut on failure. | |
| QStringList | writeSeriesDat (const QString &path, const QVector< ExportSeries > &series, QString *errorOut=nullptr) |
Write .dat file(s). A single series writes exactly path; multiple series write one file each, named "<base>_<sanitized series name>.dat" beside path. Returns the list of files written (empty on failure, with errorOut populated). | |
| QString | sanitizedFileToken (const QString &name) |
| Reduce a series name to a filesystem-safe token for the multi-series .dat fan-out (non [A-Za-z0-9_-] runs collapse to '_'). | |
| PairedSamples | pairSamplesNearest (const std::vector< double > &bt, const std::vector< double > &bv, const std::vector< double > &ct, const std::vector< double > &cv) |
| Pair two time series by nearest timestamp. | |
| SeriesStatistics | computeStatistics (const std::vector< double > &values) |
Compute summary statistics over values. NaN / Inf samples are skipped. Empty input yields count=0 and all-NaN fields. | |
| QString | formatStatisticValue (double value, const NumberFormat &format) |
| Format one statistics value using the supplied numeric format. Non-finite values render as an em dash. | |
| SeriesStyle | defaultStyleForCycle (int cycleIndex) |
| Returns a default styled cycle position — the 12-color cycle used when new series are added without an explicit style. Wraps modulo 12. | |
| QString | markerShapeToString (MarkerShape s) |
String key for MarkerShape ↔ JSON. | |
| MarkerShape | markerShapeFromString (const QString &s) |
| QString | penStyleToString (Qt::PenStyle s) |
String key for Qt::PenStyle (Solid / Dash / Dot / DashDot / DashDotDot). | |
| Qt::PenStyle | penStyleFromString (const QString &s) |
| QString | penCapStyleToString (Qt::PenCapStyle s) |
String keys for Qt::PenCapStyle and Qt::PenJoinStyle (JSON round-trip). | |
| Qt::PenCapStyle | penCapStyleFromString (const QString &s) |
| QString | penJoinStyleToString (Qt::PenJoinStyle s) |
| Qt::PenJoinStyle | penJoinStyleFromString (const QString &s) |
| QPen | penForStyle (const SeriesStyle &style) |
Build a QPen from the line-related fields of style. Width / cap / join / dash all wired up; colour with alpha from opacity. | |
| void | applySeriesStyle (const SeriesStyle &style, QXYSeries *series, QScatterSeries *markerOverlay=nullptr) |
| Apply every field of style to series. | |
Variables | |
| constexpr int | axisNumberFormatPresetCount = 17 |
| Number of presets; the valid range is [0, axisNumberFormatPresetCount). | |
The axis-format choices offered to the user, as one combined list.
A mode enum plus a free integer count is two controls that can express nonsense (0 significant figures) and reads as an unlabelled number in a property grid. These presets are the meaningful combinations, so every chart offers one dropdown instead.
The values are a stable wire format: they are persisted in QSettings and in project files, so append new presets at the end and never renumber.
Each Q_OBJECT that exposes this to the property grid mirrors it as its own Q_ENUM (QPropertyModel resolves the enumerator list through the declaring class's meta-object, and labels each entry with the enumerator's own name — hence names that read as labels). The mapping to a real NumberFormat lives here so those mirrors never drift apart.
|
strong |
Marker shape used when SeriesStyle::showMarkers == true.
| Enumerator | |
|---|---|
| Circle | |
| Square | |
| Triangle | |
| Diamond | |
| Cross | |
| Plus | |
|
strong |
Interpretation of NumberFormat::count.
Values are persisted (QSettings / project files): append, never renumber. Scientific maps 1:1 onto printf 'e'. Engineering and Thousands have no printf equivalent, so on a QValueAxis (printf-only labels) they degrade to 'e' / 'f' respectively via printfSpec(); hand-drawn ticks, tooltips and stats use format() and render them exactly.
|
strong |
What a series plots. One row per attribute in the Nx2 grid.
|
strong |
| void openswmmvis::plot::applySeriesStyle | ( | const SeriesStyle & | style, |
| QXYSeries * | series, | ||
| QScatterSeries * | markerOverlay = nullptr |
||
| ) |
Apply every field of style to series.
Sets the line pen, marker visibility / shape / size / fill / border, series opacity, point-label visibility / font / colour / precision, optional area-fill brush (only honoured if the series supports it via setBrush() — the area-fill toggle wires that on automatically), and the legend name when style.legendName is non-empty.
Marker shape is encoded via a paired QScatterSeries overlay (since QLineSeries itself lacks shape choice). If markerOverlay is given, it is reconfigured in-place; if it is nullptr, marker shape is applied to a wrapped QScatterSeries only when series is itself one — otherwise the line's built-in dot markers are toggled.
|
inline |
The canonical plottable-attribute list for k (presentation order), dispatching to the shared lists in plotattribute.h. Lives here rather than there because the nested ObjectRef::Kind cannot be named in plotattribute.h without an include cycle. Empty for kinds with no fixed list (Observed and Unknown). Mesh kinds return their full list; per-layer availability (edge flux, rainfall datasets) is gated by IRunLayer::supportsAttribute.
| SeriesStatistics openswmmvis::plot::computeStatistics | ( | const std::vector< double > & | values | ) |
Compute summary statistics over values. NaN / Inf samples are skipped. Empty input yields count=0 and all-NaN fields.
| SeriesStyle openswmmvis::plot::defaultStyleForCycle | ( | int | cycleIndex | ) |
Returns a default styled cycle position — the 12-color cycle used when new series are added without an explicit style. Wraps modulo 12.
| QString openswmmvis::plot::formatStatisticValue | ( | double | value, |
| const NumberFormat & | format | ||
| ) |
Format one statistics value using the supplied numeric format. Non-finite values render as an em dash.
|
inlinenoexcept |
True iff the attribute is a 2D mesh-cell quantity (CF.3).
|
inlinenoexcept |
True iff the attribute is a system-wide quantity (Slice AT.2). System attributes resolve via swmm_output_get_system_series and carry no per-object name (ObjectRef::Kind::System suffices).
| QString openswmmvis::plot::labelFor | ( | PlotAttribute | a | ) |
Short human label, e.g. "Depth", "Flow", "Velocity |V|".
| QString openswmmvis::plot::labelWithUnits | ( | PlotAttribute | a, |
| UnitSystem | u | ||
| ) |
Concatenation of labelFor(a) + "(" + unitsFor(a,u) + ")".
| const QVector< PlotAttribute > & openswmmvis::plot::linkPlotAttributes | ( | ) |
The 5 per-link attributes, presentation order.
| MarkerShape openswmmvis::plot::markerShapeFromString | ( | const QString & | s | ) |
| QString openswmmvis::plot::markerShapeToString | ( | MarkerShape | s | ) |
String key for MarkerShape ↔ JSON.
| const QVector< PlotAttribute > & openswmmvis::plot::mesh2DCellPlotAttributes | ( | ) |
The 7 per-2D-cell attributes, presentation order.
| const QVector< PlotAttribute > & openswmmvis::plot::mesh2DEdgePlotAttributes | ( | ) |
The 2 per-2D-edge attributes (flow, unit-width flux).
| const QVector< PlotAttribute > & openswmmvis::plot::mesh2DVertexPlotAttributes | ( | ) |
The 2 per-2D-vertex attributes (depth, HGL — interpolated).
| const QVector< PlotAttribute > & openswmmvis::plot::nodePlotAttributes | ( | ) |
The 6 per-node attributes, presentation order.
| NumberFormat openswmmvis::plot::numberFormatForPreset | ( | int | preset | ) |
The mode + count a preset stands for. Out-of-range input falls back to two decimals, which is the historic default.
| PairedSamples openswmmvis::plot::pairSamplesNearest | ( | const std::vector< double > & | bt, |
| const std::vector< double > & | bv, | ||
| const std::vector< double > & | ct, | ||
| const std::vector< double > & | cv | ||
| ) |
Pair two time series by nearest timestamp.
Walks both streams in lockstep; when |tb − tc| ≤ tolerance the pair is kept (non-finite values dropped), otherwise the earlier sample is skipped. Tolerance is half the smaller of the two streams' first report steps; when either stream has fewer than 2 samples, the other stream's step is used, and when neither has a usable step, a small epsilon makes exact timestamps still pair (the legacy walk degenerated to exact double equality there, which silently produced empty scatters).
| bt | baseline times (Julian, ascending) |
| bv | baseline values (parallel to bt) |
| ct | comparison times (Julian, ascending) |
| cv | comparison values (parallel to ct) |
| Qt::PenCapStyle openswmmvis::plot::penCapStyleFromString | ( | const QString & | s | ) |
| QString openswmmvis::plot::penCapStyleToString | ( | Qt::PenCapStyle | s | ) |
String keys for Qt::PenCapStyle and Qt::PenJoinStyle (JSON round-trip).
| QPen openswmmvis::plot::penForStyle | ( | const SeriesStyle & | style | ) |
Build a QPen from the line-related fields of style. Width / cap / join / dash all wired up; colour with alpha from opacity.
| Qt::PenJoinStyle openswmmvis::plot::penJoinStyleFromString | ( | const QString & | s | ) |
| QString openswmmvis::plot::penJoinStyleToString | ( | Qt::PenJoinStyle | s | ) |
| Qt::PenStyle openswmmvis::plot::penStyleFromString | ( | const QString & | s | ) |
| QString openswmmvis::plot::penStyleToString | ( | Qt::PenStyle | s | ) |
String key for Qt::PenStyle (Solid / Dash / Dot / DashDot / DashDotDot).
| int openswmmvis::plot::presetForNumberFormat | ( | NumberFormatMode | mode, |
| int | count | ||
| ) |
The preset that best represents mode + count.
Used when migrating a stored mode/count pair, and when seeding a chart from the preferences default. A count with no exact preset snaps to the nearest one in the same mode, so an old "5 decimals" setting lands on Decimals6 rather than silently becoming an integer.
|
inline |
Y2b-1 (amendment D-Y4): the kind-keyed DESCRIPTOR list — the fixed attributesForKind(kind) set wrapped, plus one species descriptor per name in speciesNames for the element kinds that carry species columns (node/link/subcatch). Species ride BY NAME (D-G1). INLINE because IRunLayer's default implementation below calls it, and IRunLayer must stay a header-only interface — hundreds of tests stub it without linking any plot TU, so nothing reachable from a virtual's default may live in a .cpp (measured twice: an out-of-line default anchored the vtable in resultdescriptor.cpp, and an out-of-line list builder left the same tests with an undefined free-function symbol).
| QString openswmmvis::plot::sanitizedFileToken | ( | const QString & | name | ) |
Reduce a series name to a filesystem-safe token for the multi-series .dat fan-out (non [A-Za-z0-9_-] runs collapse to '_').
| QString openswmmvis::plot::seriesToCsvText | ( | const QVector< ExportSeries > & | series | ) |
Build wide-format CSV text: column 0 = ISO timestamp, one column per series. Rows are the sorted union of all series' timestamps; a cell is empty where its series has no sample (or a non-finite value) at that time.
| QString openswmmvis::plot::seriesToDatText | ( | const ExportSeries & | series | ) |
Build SWMM .dat text for a single series: ";name" comment line followed by "MM/dd/yyyy HH:mm:ss value" rows. Non-finite values are skipped (SWMM cannot parse them).
| const QVector< PlotAttribute > & openswmmvis::plot::subcatchPlotAttributes | ( | ) |
The 5 per-subcatchment attributes, presentation order.
| const QVector< PlotAttribute > & openswmmvis::plot::systemPlotAttributes | ( | ) |
The 14 system-wide attributes, presentation order (matches the long-standing system picker menu: Rainfall first, Temperature last).
| QString openswmmvis::plot::unitsFor | ( | PlotAttribute | a, |
| UnitSystem | u | ||
| ) |
Unit string for the given attribute + unit system, e.g. "m", "ft³/s".
| UnitSystem openswmmvis::plot::unitSystemFromFlowUnits | ( | int | flowUnits | ) |
Map an engine swmm_output_get_flow_units return value to UnitSystem.
| bool openswmmvis::plot::writeSeriesCsv | ( | const QString & | path, |
| const QVector< ExportSeries > & | series, | ||
| QString * | errorOut = nullptr |
||
| ) |
Write CSV to path. Returns false and populates errorOut on failure.
| QStringList openswmmvis::plot::writeSeriesDat | ( | const QString & | path, |
| const QVector< ExportSeries > & | series, | ||
| QString * | errorOut = nullptr |
||
| ) |
Write .dat file(s). A single series writes exactly path; multiple series write one file each, named "<base>_<sanitized series name>.dat" beside path. Returns the list of files written (empty on failure, with errorOut populated).
|
inlineconstexpr |
Number of presets; the valid range is [0, axisNumberFormatPresetCount).