Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ARPA-SIMC/CRITERIA3D
Browse files Browse the repository at this point in the history
  • Loading branch information
giadasan committed Mar 1, 2024
2 parents 075882c + e6e63c7 commit 936dce6
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
6 changes: 3 additions & 3 deletions agrolib/graphics/stationMarker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 3 additions & 2 deletions agrolib/project/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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...");

Expand Down Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion agrolib/project/project.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
6 changes: 3 additions & 3 deletions bin/CRITERIA3D/CRITERIA3D.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down
13 changes: 6 additions & 7 deletions bin/CRITERIA3D/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions bin/CRITERIA3D/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion bin/Makeall_CRITERIA3D/Makeall_CRITERIA3D.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 936dce6

Please sign in to comment.