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
climatologydialog.h
Go to the documentation of this file.
1
15#ifndef CLIMATOLOGYDIALOG_H
16#define CLIMATOLOGYDIALOG_H
17
18#include <QDialog>
19#include <QString>
20
21#include <openswmm/engine/openswmm_engine.h>
22
23class QTabWidget;
24class QComboBox;
25class QLineEdit;
26class QCheckBox;
27class QDateEdit;
28class QDoubleSpinBox;
29class QTableWidget;
30class QStackedWidget;
31
32class SWMMModelLayer;
33
34namespace openswmmvis::ui { class RelativePathPicker; }
35
40class ClimatologyDialog : public QDialog
41{
42 Q_OBJECT
43
44public:
55
56 explicit ClimatologyDialog(SWMM_Engine engine,
57 SWMMModelLayer *layer = nullptr,
58 QWidget *parent = nullptr);
59 ~ClimatologyDialog() override = default;
60
62 [[nodiscard]] bool wroteAnyChanges() const { return m_wroteChanges; }
63
65 void setCurrentTab(int idx);
66
71 void setProjectAnchor(const QString &dir);
72
73private slots:
74 void onAccept();
75 void onEvapTypeChanged();
76 void onTempSourceChanged();
77 void onWindTypeChanged();
78 void onHumidityTypeChanged();
79 void onHumidityVarChanged();
80 void onAdcPreset(int column, bool natural);
81 void onClearAdjustments();
82
83private:
84 void buildUi();
85 void buildTemperatureTab(QTabWidget *tabs);
86 void buildEvaporationTab(QTabWidget *tabs);
87 void buildWindTab(QTabWidget *tabs);
88 void buildHumidityTab(QTabWidget *tabs);
89 void buildSnowTab(QTabWidget *tabs);
90 void buildAdcTab(QTabWidget *tabs);
91 void buildAdjustmentsTab(QTabWidget *tabs);
92
93 void readFromEngine();
94 void writeToEngine();
96 [[nodiscard]] QString serialize() const;
97
98 [[nodiscard]] bool isSI() const { return m_unitSystem == 1; }
99 void populateTimeseriesCombo(QComboBox *combo) const;
100 void populatePatternCombo(QComboBox *combo) const;
101
102 SWMM_Engine m_engine = nullptr;
103 SWMMModelLayer *m_layer = nullptr;
104 QTabWidget *m_tabs = nullptr;
105 bool m_wroteChanges = false;
106 int m_unitSystem = 0; // 0=US, 1=SI
107 QString m_initialSig; // widget signature captured after read
108
109 // --- Temperature ---
110 QComboBox *m_tempSource = nullptr; // 0 None / 1 TimeSeries / 2 File
111 QComboBox *m_tempTs = nullptr;
112 openswmmvis::ui::RelativePathPicker *m_tempFile = nullptr;
113 QString m_projectAnchor;
114 QCheckBox *m_tempStartCheck = nullptr;
115 QDateEdit *m_tempStartDate = nullptr;
116 QComboBox *m_tempUnits = nullptr; // -1 Auto / 0 C10 / 1 C / 2 F
117
118 // --- Evaporation ---
119 QComboBox *m_evapType = nullptr; // engine enum via itemData
120 QStackedWidget *m_evapStack = nullptr;
121 QDoubleSpinBox *m_evapConstant = nullptr;
122 QTableWidget *m_evapMonthly = nullptr; // 12 rows
123 QComboBox *m_evapTs = nullptr;
124 QTableWidget *m_panCoeff = nullptr; // 12 rows
125 QComboBox *m_recovery = nullptr;
126 QCheckBox *m_dryOnly = nullptr;
127
128 // --- Wind ---
129 QComboBox *m_windType = nullptr; // 0 Monthly / 1 File
130 QTableWidget *m_windMonthly = nullptr; // 12 rows
131
132 // --- Humidity ([TEMPERATURE] HUMIDITY) ---
133 QComboBox *m_humVar = nullptr; // 0 Relative % / 1 Dew point
134 QComboBox *m_humType = nullptr; // 0 Constant / 1 Monthly / 2 TimeSeries
135 QStackedWidget *m_humStack = nullptr;
136 QDoubleSpinBox *m_humConstant = nullptr;
137 QTableWidget *m_humMonthly = nullptr; // 12 rows
138 QComboBox *m_humTs = nullptr;
139
140 // --- Snow Melt ---
141 QDoubleSpinBox *m_snowTemp = nullptr;
142 QDoubleSpinBox *m_atiWeight = nullptr;
143 QDoubleSpinBox *m_negMelt = nullptr;
144 QDoubleSpinBox *m_elevation = nullptr;
145 QDoubleSpinBox *m_latitude = nullptr;
146 QDoubleSpinBox *m_longitude = nullptr;
147
148 // --- Areal depletion ---
149 QTableWidget *m_adc = nullptr; // 10 rows x 2 cols (imperv, perv)
150
151 // --- Adjustments ---
152 QTableWidget *m_adjust = nullptr; // 12 rows x 4 cols
153};
154
155#endif // CLIMATOLOGYDIALOG_H
Modal editor for the model climatology configuration.
Definition climatologydialog.h:41
Tab
Definition climatologydialog.h:46
@ TabSnowMelt
Definition climatologydialog.h:51
@ TabArealDepletion
Definition climatologydialog.h:52
@ TabEvaporation
Definition climatologydialog.h:48
@ TabAdjustments
Definition climatologydialog.h:53
@ TabTemperature
Definition climatologydialog.h:47
@ TabWind
Definition climatologydialog.h:49
@ TabHumidity
Definition climatologydialog.h:50
void setCurrentTab(int idx)
Definition climatologydialog.cpp:105
void setProjectAnchor(const QString &dir)
Definition climatologydialog.cpp:563
bool wroteAnyChanges() const
Definition climatologydialog.h:62
~ClimatologyDialog() override=default
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine mo...
Definition swmmmodellayer.h:133
A QLineEdit + browse-button widget that normalises display paths against a project anchor.
Definition relativepathpicker.h:50
Definition openswmmvislayer.h:43
void * SWMM_Engine
Definition objectdefaultsapplier.h:19
QVector< int > parent
union-find
Definition pslgminsize.cpp:176