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
assignraingagesdialog.h
Go to the documentation of this file.
1
29#ifndef OPENSWMMVIS_UI_DIALOGS_ASSIGNRAINGAGESDIALOG_H
30#define OPENSWMMVIS_UI_DIALOGS_ASSIGNRAINGAGESDIALOG_H
31
32#include "core/gageblend.h"
33
34#include <QDialog>
35#include <QPointF>
36#include <QPointer>
37#include <QStringList>
38#include <QVector>
39
40class MapCanvas;
41class QCheckBox;
42class QComboBox;
43class QDoubleSpinBox;
44class QLabel;
45class QPushButton;
46class QRadioButton;
47class QTableWidget;
49class SWMMModelLayer;
50
51namespace openswmmvis::ui {
52
53class AssignRainGagesDialog : public QDialog
54{
55 Q_OBJECT
56
57public:
59 MapCanvas *canvas,
60 SelectionManager *selection,
61 QWidget *parent = nullptr);
62
63private slots:
64 void onMethodChanged();
65 void onPreview();
66 void onApply();
67
68private:
70 struct GageSite
71 {
72 int index = -1;
73 QString name;
74 QPointF pos;
75 };
76
78 struct RowPlan
79 {
80 QString subcatch;
81 QString oldGage;
82 QString newGage;
83 QString detail;
84 bool changed = false;
85 };
86
88 struct GeneratedGage
89 {
90 QString gageName;
91 QString seriesName;
92 QString key;
93 QVector<GageBlend::SeriesPoint> points;
94 qint64 intervalSec = 0;
95 double snowFactor = 1.0;
96 double relError = 0.0;
97 QStringList members;
98 bool isNew = false;
99 bool isUpdate = false;
100 };
101
103 struct Plan
104 {
105 QVector<RowPlan> rows;
106 QVector<GeneratedGage> generated;
107 QStringList staleGages;
108 QStringList warnings;
109 QString error;
110 int scanned = 0;
111 int skipped = 0;
112 int changed = 0;
113 };
114
115 void buildUi();
116 void updateButtons();
117
119 [[nodiscard]] QVector<GageSite> eligibleGages(QStringList *warnings,
120 QStringList *unlocated) const;
121
123 [[nodiscard]] QVector<int> scopeSubcatchments() const;
124
125 [[nodiscard]] Plan buildPlan();
126 [[nodiscard]] Plan buildProximityPlan(const QVector<GageSite> &gages,
127 const QVector<int> &scope,
128 QStringList warnings);
129 [[nodiscard]] Plan buildInterpolatedPlan(const QVector<GageSite> &gages,
130 const QVector<int> &scope,
131 QStringList warnings,
132 const QStringList &unlocated);
133
136 [[nodiscard]] bool readSourceGage(const GageSite &site,
138 QString *error) const;
139
140 void showPlan(const Plan &plan, bool applied);
141
142 QPointer<SWMMModelLayer> m_layer;
143 QPointer<MapCanvas> m_canvas;
144 QPointer<SelectionManager> m_selection;
145
146 QRadioButton *m_methodProximity = nullptr;
147 QRadioButton *m_methodInterp = nullptr;
148 QComboBox *m_variantCombo = nullptr;
149 QDoubleSpinBox *m_tolSpin = nullptr;
150 QRadioButton *m_scopeAll = nullptr;
151 QRadioButton *m_scopeSelected = nullptr;
152 QLabel *m_gageCountLbl = nullptr;
153 QTableWidget *m_preview = nullptr;
154 QLabel *m_statusLbl = nullptr;
155 QPushButton *m_previewBtn = nullptr;
156 QPushButton *m_applyBtn = nullptr;
157};
158
159} // namespace openswmmvis::ui
160
161#endif // OPENSWMMVIS_UI_DIALOGS_ASSIGNRAINGAGESDIALOG_H
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine mo...
Definition swmmmodellayer.h:133
Owner of the canonical selection set for one SWMM project.
Definition selectionmanager.h:112
Definition assignraingagesdialog.h:54
Volume-conserving weighted blend of rain-gage time series.
const char * key
Definition meshcellparams.cpp:24
int index
Position in m_quadRegions / m_quadReports.
Definition meshgenerator.cpp:153
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
int pos
Definition queryparser.cpp:36
QString name
Definition sectionmodelbuilders.cpp:474
A contributing gage: its series plus everything needed to read it.
Definition gageblend.h:71