From e2ecde6dad558308a69652c7bd8b08285720172a Mon Sep 17 00:00:00 2001 From: ftomei Date: Tue, 30 Jul 2024 18:03:25 +0200 Subject: [PATCH] update 3D --- DATA/PROJECT/VINE3D_test/DATA/crop_test.db | Bin 16384 -> 16384 bytes .../VINE3D_test/{test.ini => VINE3D_test.ini} | 8 +++-- bin/CRITERIA3D/CRITERIA3D.pro | 29 +++++++++--------- bin/CRITERIA3D/criteria3DProject.cpp | 3 ++ .../dialogWaterFluxesSettings.cpp | 0 .../{ => shared}/dialogWaterFluxesSettings.h | 0 bin/CRITERIA3D/shared/project3D.cpp | 7 +++-- bin/VINE3D/mainWindow.cpp | 7 +++++ bin/VINE3D/mainWindow.h | 2 ++ bin/VINE3D/mainWindow.ui | 4 +-- bin/VINE3D/vine3DProject.cpp | 4 +-- 11 files changed, 40 insertions(+), 24 deletions(-) rename DATA/PROJECT/VINE3D_test/{test.ini => VINE3D_test.ini} (85%) rename bin/CRITERIA3D/{ => shared}/dialogWaterFluxesSettings.cpp (100%) rename bin/CRITERIA3D/{ => shared}/dialogWaterFluxesSettings.h (100%) diff --git a/DATA/PROJECT/VINE3D_test/DATA/crop_test.db b/DATA/PROJECT/VINE3D_test/DATA/crop_test.db index a666f014912a3a799fa13736390b897b40747edf..26934c923ee36f8850cc140eb77359eb8062135d 100644 GIT binary patch delta 26 hcmZo@U~Fh$oFL7ZJ5k1&F?VBvzY!z*<_$&xyZ~>*2nGNE delta 26 hcmZo@U~Fh$oFL7ZGf~EwF=u0fzY!zH<_$&xyZ~>k2n7HD diff --git a/DATA/PROJECT/VINE3D_test/test.ini b/DATA/PROJECT/VINE3D_test/VINE3D_test.ini similarity index 85% rename from DATA/PROJECT/VINE3D_test/test.ini rename to DATA/PROJECT/VINE3D_test/VINE3D_test.ini index fc650e9b9..32ec96bb4 100644 --- a/DATA/PROJECT/VINE3D_test/test.ini +++ b/DATA/PROJECT/VINE3D_test/VINE3D_test.ini @@ -6,17 +6,21 @@ time_zone=1 is_utc=true [project] -name=vine3d_test +name=Monteleone dem=./DEM/DEM_test.flt meteo_points=./METEOPOINT/test_meteopoints.db soil_db=./SOIL/test_soil.db soil_map=./GEO/soil_map.flt landuse_map=./GEO/land_units.flt -db_vine3d=./DATA/fields.db + +# VINE3D +vine3d_db=./DATA/fields.db +# CRITERIA3D crop_db=./DATA/crop_test.db [settings] parameters_file=./SETTINGS/parameters.ini log_file=./log/test.txt + soil_depth=1.0 compute_diseases=false diff --git a/bin/CRITERIA3D/CRITERIA3D.pro b/bin/CRITERIA3D/CRITERIA3D.pro index cdabb801c..45d4b1d86 100644 --- a/bin/CRITERIA3D/CRITERIA3D.pro +++ b/bin/CRITERIA3D/CRITERIA3D.pro @@ -84,10 +84,22 @@ CONFIG(debug, debug|release) { } +HEADERS += \ + shared/project3D.h \ + shared/dialogWaterFluxesSettings.h \ + dialogModelProcesses.h \ + mainwindow.h \ + criteria3DProject.h \ + dialogLoadState.h \ + dialogSnowSettings.h \ + geometry.h \ + glWidget.h \ + viewer3D.h + SOURCES += \ - dialogModelProcesses.cpp \ - dialogWaterFluxesSettings.cpp \ shared/project3D.cpp \ + shared/dialogWaterFluxesSettings.cpp \ + dialogModelProcesses.cpp \ mainwindow.cpp \ criteria3DProject.cpp \ dialogLoadState.cpp \ @@ -98,19 +110,6 @@ SOURCES += \ viewer3D.cpp -HEADERS += \ - dialogModelProcesses.h \ - dialogWaterFluxesSettings.h \ - shared/project3D.h \ - mainwindow.h \ - criteria3DProject.h \ - dialogLoadState.h \ - dialogSnowSettings.h \ - geometry.h \ - glWidget.h \ - viewer3D.h - - FORMS += mainwindow.ui DISTFILES += \ diff --git a/bin/CRITERIA3D/criteria3DProject.cpp b/bin/CRITERIA3D/criteria3DProject.cpp index cedd577d3..84fd7bb74 100644 --- a/bin/CRITERIA3D/criteria3DProject.cpp +++ b/bin/CRITERIA3D/criteria3DProject.cpp @@ -976,6 +976,7 @@ bool Crit3DProject::runModelHour(const QString& hourlyOutputPath, bool isRestart { if (! interpolateAndSaveHourlyMeteo(globalIrradiance, myDateTime, hourlyOutputPath, isSaveOutputRaster())) return false; + qApp->processEvents(); } @@ -1044,6 +1045,8 @@ bool Crit3DProject::runModelHour(const QString& hourlyOutputPath, bool isRestart } runWaterFluxes3DModel(3600, isRestart); + + qApp->processEvents(); } // soil heat diff --git a/bin/CRITERIA3D/dialogWaterFluxesSettings.cpp b/bin/CRITERIA3D/shared/dialogWaterFluxesSettings.cpp similarity index 100% rename from bin/CRITERIA3D/dialogWaterFluxesSettings.cpp rename to bin/CRITERIA3D/shared/dialogWaterFluxesSettings.cpp diff --git a/bin/CRITERIA3D/dialogWaterFluxesSettings.h b/bin/CRITERIA3D/shared/dialogWaterFluxesSettings.h similarity index 100% rename from bin/CRITERIA3D/dialogWaterFluxesSettings.h rename to bin/CRITERIA3D/shared/dialogWaterFluxesSettings.h diff --git a/bin/CRITERIA3D/shared/project3D.cpp b/bin/CRITERIA3D/shared/project3D.cpp index 1d38fb299..3d720a290 100644 --- a/bin/CRITERIA3D/shared/project3D.cpp +++ b/bin/CRITERIA3D/shared/project3D.cpp @@ -257,11 +257,10 @@ bool Project3D::loadProject3DSettings() projectSettings->endGroup(); - // OUTPUT VARIABLES (optional) - QList depthList; + // output variables (optional) projectSettings->beginGroup("output"); - depthList = projectSettings->value("waterContent").toStringList(); + QList depthList = projectSettings->value("waterContent").toStringList(); if (! setVariableDepth(depthList, waterContentDepth)) { errorString = "Wrong water content depth in the settings file: " + projectSettings->fileName(); @@ -285,6 +284,8 @@ bool Project3D::loadProject3DSettings() errorString = "Wrong factor of safety depth in the settings file: " + projectSettings->fileName(); } + projectSettings->endGroup(); + return true; } diff --git a/bin/VINE3D/mainWindow.cpp b/bin/VINE3D/mainWindow.cpp index 3372142c6..21ad1efc9 100644 --- a/bin/VINE3D/mainWindow.cpp +++ b/bin/VINE3D/mainWindow.cpp @@ -729,3 +729,10 @@ void MainWindow::on_actionShow_model_cases_map_triggered() } } + + +void MainWindow::on_actionCriteria3D_settings_triggered() +{ + +} + diff --git a/bin/VINE3D/mainWindow.h b/bin/VINE3D/mainWindow.h index 85a11b8d8..3e0923729 100644 --- a/bin/VINE3D/mainWindow.h +++ b/bin/VINE3D/mainWindow.h @@ -75,6 +75,8 @@ void on_actionShow_model_cases_map_triggered(); + void on_actionCriteria3D_settings_triggered(); + protected: /*! * \brief mouseReleaseEvent call moveCenter diff --git a/bin/VINE3D/mainWindow.ui b/bin/VINE3D/mainWindow.ui index 2027d6c8f..0453c9a51 100644 --- a/bin/VINE3D/mainWindow.ui +++ b/bin/VINE3D/mainWindow.ui @@ -1757,7 +1757,7 @@ 0 1752 10 - 13 + 12 @@ -2507,7 +2507,7 @@ - Initialize 3D + Initialize diff --git a/bin/VINE3D/vine3DProject.cpp b/bin/VINE3D/vine3DProject.cpp index 0b836299c..327293d8d 100644 --- a/bin/VINE3D/vine3DProject.cpp +++ b/bin/VINE3D/vine3DProject.cpp @@ -77,7 +77,7 @@ void Vine3DProject::loadVine3DSettings() { projectSettings->beginGroup("project"); - dbVine3DFileName = projectSettings->value("db_vine3d").toString(); + dbVine3DFileName = projectSettings->value("vine3d_db").toString(); projectSettings->endGroup(); @@ -94,7 +94,7 @@ bool Vine3DProject::openVine3DDatabase(QString fileName) { if (fileName == "") { - errorString = "VINE3D database fileName missing.\nSet the 'db_vine3d' field in the .ini settings file."; + errorString = "VINE3D database fileName missing.\nSet the 'vine3d_db' field in the .ini settings file."; return false; }