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
speciesattributes.h
Go to the documentation of this file.
1
33#ifndef OPENSWMM_LAYERS_SPECIESATTRIBUTES_H
34#define OPENSWMM_LAYERS_SPECIESATTRIBUTES_H
35
36#include <QSet>
37#include <QString>
38#include <QStringList>
39
41{
42
46inline constexpr const char *kWaterAgeName = "__WATER_AGE__";
47inline constexpr const char *kTemperatureName = "__TEMPERATURE__";
48
50inline constexpr const char *kSpeciesAttrPrefix = "qual:";
51
53[[nodiscard]] QString speciesAttributeName(const QString &species);
54
56[[nodiscard]] bool isSpeciesAttribute(const QString &attr);
57
61[[nodiscard]] QString speciesFromAttribute(const QString &attr);
62
65[[nodiscard]] QString speciesDisplayLabel(const QString &species);
66
70[[nodiscard]] QString speciesUnitLabel(const QString &species,
71 const QString &concentrationUnit);
72
74[[nodiscard]] bool isReservedSpecies(const QString &species);
75
84[[nodiscard]] int speciesOutCode(const QString &attr,
85 const QStringList &species,
86 int pollutBase);
87
93[[nodiscard]] QStringList inflowConstituentNames(const QStringList &pollutants);
94
98[[nodiscard]] QString inflowConstituentLabel(const QString &name);
99
103[[nodiscard]] bool inflowMassAllowed(const QString &name);
104
112{
113public:
116 [[nodiscard]] QString noteMiss(const QString &attr,
117 const QString &runName);
118 void reset() { m_warned.clear(); }
119
120private:
121 QSet<QString> m_warned;
122};
123
124} // namespace OpenSWMMVis::Species
125
126#endif // OPENSWMM_LAYERS_SPECIESATTRIBUTES_H
D-G1 warn-on-miss (Y2b-3): a saved theme or series may name a species the currently-open run does not...
Definition speciesattributes.h:112
void reset()
Definition speciesattributes.h:118
QString noteMiss(const QString &attr, const QString &runName)
Message for a failed species token, or empty when attr is not a species token or was already warned s...
Definition speciesattributes.cpp:92
Definition speciesattributes.h:41
constexpr const char * kSpeciesAttrPrefix
Definition speciesattributes.h:50
QString speciesFromAttribute(const QString &attr)
"qual:TSS" → "TSS"; empty for a non-species attribute.
Definition speciesattributes.cpp:26
bool inflowMassAllowed(const QString &name)
MASS is a pollutant-only inflow type: meaningless for FLOW and for the age species (the engine takes ...
Definition speciesattributes.cpp:87
QString speciesDisplayLabel(const QString &species)
Picker label for a species: friendly text for the reserved pair, the bare name for an ordinary pollut...
Definition speciesattributes.cpp:39
QStringList inflowConstituentNames(const QStringList &pollutants)
Y4 (amendment D-Y4): constituent choices for an [INFLOWS] editor — FLOW, every pollutant,...
Definition speciesattributes.cpp:70
QString inflowConstituentLabel(const QString &name)
Combo label for an inflow constituent: the species display label for the reserved pair ("Water age (h...
Definition speciesattributes.cpp:80
QString speciesAttributeName(const QString &species)
"TSS" → "qual:TSS" — the token persisted in .oswp.
Definition speciesattributes.cpp:15
constexpr const char * kWaterAgeName
Definition speciesattributes.h:46
int speciesOutCode(const QString &attr, const QStringList &species, int pollutBase)
Resolve attr to an engine output variable code.
Definition speciesattributes.cpp:59
bool isSpeciesAttribute(const QString &attr)
True if attr is a species attribute token.
Definition speciesattributes.cpp:21
constexpr const char * kTemperatureName
Definition speciesattributes.h:47
QString speciesUnitLabel(const QString &species, const QString &concentrationUnit)
Unit string for a species. The reserved pair carry fixed units the .out enum cannot express (hours / ...
Definition speciesattributes.cpp:48
bool isReservedSpecies(const QString &species)
True for the reserved species (age / temperature).
Definition speciesattributes.cpp:33
QString name
Definition sectionmodelbuilders.cpp:474