From f9e57714780c7231ccb2e8cc3702480f70596334 Mon Sep 17 00:00:00 2001 From: ftomei Date: Fri, 1 Mar 2024 15:35:12 +0100 Subject: [PATCH] update meteowidget --- agrolib/graphics/stationMarker.cpp | 6 +++--- agrolib/project/project.cpp | 5 +++-- agrolib/project/project.h | 3 ++- bin/CRITERIA3D/CRITERIA3D.pro | 6 +++--- bin/CRITERIA3D/mainwindow.cpp | 13 ++++++------- bin/CRITERIA3D/mainwindow.h | 6 +++--- bin/Makeall_CRITERIA3D/Makeall_CRITERIA3D.pro | 2 +- 7 files changed, 21 insertions(+), 20 deletions(-) diff --git a/agrolib/graphics/stationMarker.cpp b/agrolib/graphics/stationMarker.cpp index 00cf8dbed..233edb7dc 100644 --- a/agrolib/graphics/stationMarker.cpp +++ b/agrolib/graphics/stationMarker.cpp @@ -133,14 +133,14 @@ void StationMarker::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (selection != nullptr) { - std::string lapseRateName = getLapseRateCodeName(_lapseRateCode); + std::string lapseRateCode = getLapseRateCodeName(_lapseRateCode); if (selection == openMeteoWidget) { - emit newStationClicked(_id, _name, _dataset, _altitude, lapseRateName, isGrid); + emit newStationClicked(_id, _name, _dataset, _altitude, lapseRateCode, isGrid); } else if (selection == appendMeteoWidget) { - emit appendStationClicked(_id, _name, _dataset, _altitude, lapseRateName, isGrid); + emit appendStationClicked(_id, _name, _dataset, _altitude, lapseRateCode, isGrid); } else if (selection == openPointStatisticsWidget) { diff --git a/agrolib/project/project.cpp b/agrolib/project/project.cpp index ee8d21972..545465a04 100644 --- a/agrolib/project/project.cpp +++ b/agrolib/project/project.cpp @@ -3173,7 +3173,8 @@ void Project::importHourlyMeteoData(const QString& csvFileName, bool importAllFi } -void Project::showMeteoWidgetPoint(std::string idMeteoPoint, std::string namePoint, std::string dataset, double altitude, std::string lapseRate, bool isAppend) +void Project::showMeteoWidgetPoint(std::string idMeteoPoint, std::string namePoint, std::string dataset, + double altitude, std::string lapseRateCode, bool isAppend) { logInfoGUI("Loading data..."); @@ -3219,7 +3220,7 @@ void Project::showMeteoWidgetPoint(std::string idMeteoPoint, std::string namePoi Crit3DMeteoPoint mp; mp.setId(idMeteoPoint); mp.setName(namePoint); - mp.setLapseRateCode(lapseRate); + mp.setLapseRateCode(lapseRateCode); mp.setDataset(dataset); mp.point.z = altitude; diff --git a/agrolib/project/project.h b/agrolib/project/project.h index 1ce436483..5ef235f91 100644 --- a/agrolib/project/project.h +++ b/agrolib/project/project.h @@ -259,7 +259,8 @@ void importHourlyMeteoData(const QString& fileName, bool importAllFiles, bool deletePreviousData); gis::Crit3DRasterGrid* getHourlyMeteoRaster(meteoVariable myVar); - void showMeteoWidgetPoint(std::string idMeteoPoint, std::string namePoint, std::string dataset, double altitude, std::string lapseRate, bool isAppend); + void showMeteoWidgetPoint(std::string idMeteoPoint, std::string namePoint, std::string dataset, + double altitude, std::string lapseRateCode, bool isAppend); void showMeteoWidgetGrid(std::string idCell, bool isAppend); void showProxyGraph(); diff --git a/bin/CRITERIA3D/CRITERIA3D.pro b/bin/CRITERIA3D/CRITERIA3D.pro index c0d001c9e..f683922a4 100644 --- a/bin/CRITERIA3D/CRITERIA3D.pro +++ b/bin/CRITERIA3D/CRITERIA3D.pro @@ -24,7 +24,7 @@ INCLUDEPATH += ./shared \ ../../agrolib/interpolation ../../agrolib/solarRadiation ../../agrolib/snow \ ../../agrolib/outputPoints ../../agrolib/soilWidget ../../agrolib/utilities \ ../../agrolib/dbMeteoPoints ../../agrolib/outputPoints ../../agrolib/dbMeteoGrid \ - ../../agrolib/importDataXML ../../agrolib/proxyWidget ../../agrolib/project \ + ../../agrolib/inOutDataXML ../../agrolib/proxyWidget ../../agrolib/project \ ../../agrolib/graphics ../../agrolib/commonChartElements ../../agrolib/commonDialogs \ ../../mapGraphics ../../agrolib/meteoWidget @@ -38,7 +38,7 @@ CONFIG(debug, debug|release) { } LIBS += -L../../agrolib/project/debug -lproject LIBS += -L../../agrolib/proxyWidget/debug -lproxyWidget - LIBS += -L../../agrolib/importDataXML/debug -limportDataXML + LIBS += -L../../agrolib/inOutDataXML/debug -linOutDataXML LIBS += -L../../agrolib/meteoWidget/debug -lmeteoWidget LIBS += -L../../agrolib/commonDialogs/debug -lcommonDialogs LIBS += -L../../agrolib/dbMeteoGrid/debug -ldbMeteoGrid @@ -63,7 +63,7 @@ CONFIG(debug, debug|release) { LIBS += -L../../mapGraphics/release -lMapGraphics LIBS += -L../../agrolib/project/release -lproject LIBS += -L../../agrolib/proxyWidget/release -lproxyWidget - LIBS += -L../../agrolib/importDataXML/release -limportDataXML + LIBS += -L../../agrolib/inOutDataXML/release -linOutDataXML LIBS += -L../../agrolib/meteoWidget/release -lmeteoWidget LIBS += -L../../agrolib/commonDialogs/release -lcommonDialogs LIBS += -L../../agrolib/dbMeteoGrid/release -ldbMeteoGrid diff --git a/bin/CRITERIA3D/mainwindow.cpp b/bin/CRITERIA3D/mainwindow.cpp index 5a83153bc..805329b69 100644 --- a/bin/CRITERIA3D/mainwindow.cpp +++ b/bin/CRITERIA3D/mainwindow.cpp @@ -546,14 +546,13 @@ void MainWindow::addMeteoPoints() this->mapView->scene()->addObject(this->meteoPointList[i]); point->setToolTip(); - connect(point, SIGNAL(newStationClicked(std::string, std::string, bool)), this, SLOT(callNewMeteoWidget(std::string, std::string, bool))); - connect(point, SIGNAL(appendStationClicked(std::string, std::string, bool)), this, SLOT(callAppendMeteoWidget(std::string, std::string, bool))); + connect(point, SIGNAL(newStationClicked(std::string, std::string, std::string, double, std::string, bool)), this, SLOT(callNewMeteoWidget(std::string, std::string, std::string, double, std::string, bool))); + connect(point, SIGNAL(appendStationClicked(std::string, std::string, std::string, double, std::string, bool)), this, SLOT(callAppendMeteoWidget(std::string, std::string, std::string, double, std::string, bool))); } } - -void MainWindow::callNewMeteoWidget(std::string id, std::string name, bool isGrid) +void MainWindow::callNewMeteoWidget(std::string id, std::string name, std::string dataset, double altitude, std::string lapseRateCode, bool isGrid) { bool isAppend = false; if (isGrid) @@ -562,13 +561,13 @@ void MainWindow::callNewMeteoWidget(std::string id, std::string name, bool isGri } else { - myProject.showMeteoWidgetPoint(id, name, isAppend); + myProject.showMeteoWidgetPoint(id, name, dataset, altitude, lapseRateCode, isAppend); } return; } -void MainWindow::callAppendMeteoWidget(std::string id, std::string name, bool isGrid) +void MainWindow::callAppendMeteoWidget(std::string id, std::string name, std::string dataset, double altitude, std::string lapseRateCode, bool isGrid) { bool isAppend = true; if (isGrid) @@ -577,7 +576,7 @@ void MainWindow::callAppendMeteoWidget(std::string id, std::string name, bool is } else { - myProject.showMeteoWidgetPoint(id, name, isAppend); + myProject.showMeteoWidgetPoint(id, name, dataset, altitude, lapseRateCode, isAppend); } return; } diff --git a/bin/CRITERIA3D/mainwindow.h b/bin/CRITERIA3D/mainwindow.h index 4fb49c794..e3b387a31 100644 --- a/bin/CRITERIA3D/mainwindow.h +++ b/bin/CRITERIA3D/mainwindow.h @@ -41,6 +41,9 @@ void updateMaps(); void updateOutputMap(); + void callNewMeteoWidget(std::string id, std::string name, std::string dataset, double altitude, std::string lapseRateCode, bool isGrid); + void callAppendMeteoWidget(std::string id, std::string name, std::string dataset, double altitude, std::string lapseRateCode, bool isGrid); + void on_actionOpenProject_triggered(); void on_actionCloseProject_triggered(); void on_actionLoad_DEM_triggered(); @@ -95,9 +98,6 @@ void on_actionComputePeriod_meteoVariables_triggered(); void on_actionComputeHour_meteoVariables_triggered(); - void callNewMeteoWidget(std::string id, std::string name, bool isGrid); - void callAppendMeteoWidget(std::string id, std::string name, bool isGrid); - void on_actionRadiation_settings_triggered(); void on_actionRadiation_compute_current_hour_triggered(); void on_actionRadiation_run_model_triggered(); diff --git a/bin/Makeall_CRITERIA3D/Makeall_CRITERIA3D.pro b/bin/Makeall_CRITERIA3D/Makeall_CRITERIA3D.pro index f9dee0e31..f82d5a230 100644 --- a/bin/Makeall_CRITERIA3D/Makeall_CRITERIA3D.pro +++ b/bin/Makeall_CRITERIA3D/Makeall_CRITERIA3D.pro @@ -6,7 +6,7 @@ SUBDIRS = ../../agrolib/soilFluxes3D \ ../../agrolib/utilities ../../agrolib/soil ../../agrolib/crop \ ../../agrolib/interpolation ../../agrolib/solarRadiation ../../agrolib/snow \ ../../agrolib/dbMeteoPoints ../../agrolib/outputPoints \ - ../../agrolib/dbMeteoGrid ../../agrolib/importDataXML \ + ../../agrolib/dbMeteoGrid ../../agrolib/inOutDataXML \ ../../agrolib/proxyWidget ../../agrolib/project \ ../../agrolib/meteoWidget ../../agrolib/soilWidget \ ../../agrolib/commonDialogs ../../agrolib/commonChartElements ../../agrolib/graphics \