diff --git a/bin/CRITERIA3D/mainwindow.cpp b/bin/CRITERIA3D/mainwindow.cpp index 673b269bc..e75cb91b3 100644 --- a/bin/CRITERIA3D/mainwindow.cpp +++ b/bin/CRITERIA3D/mainwindow.cpp @@ -2214,7 +2214,6 @@ void MainWindow::on_actionCriteria3D_waterFluxes_settings_triggered() }*/ // layer thickness - // lateral conductivity ratio } } diff --git a/bin/VINE3D/VINE3D.pro b/bin/VINE3D/VINE3D.pro index 76c8cb66e..d60fa91b1 100644 --- a/bin/VINE3D/VINE3D.pro +++ b/bin/VINE3D/VINE3D.pro @@ -84,6 +84,8 @@ CONFIG(debug, debug|release) { } SOURCES += \ + ../CRITERIA3D/shared/project3D.cpp \ + ../CRITERIA3D/shared/dialogWaterFluxesSettings.cpp \ atmosphere.cpp \ dataHandler.cpp \ disease.cpp \ @@ -93,11 +95,12 @@ SOURCES += \ vine3DShell.cpp \ waterBalance.cpp \ vine3DProject.cpp \ - mainWindow.cpp \ - ../CRITERIA3D/shared/project3D.cpp + mainWindow.cpp HEADERS += \ + ../CRITERIA3D/shared/project3D.h \ + ../CRITERIA3D/shared/dialogWaterFluxesSettings.h \ atmosphere.h \ dataHandler.h \ disease.h \ @@ -105,8 +108,8 @@ HEADERS += \ plant.h \ waterBalance.h \ vine3DProject.h \ - mainWindow.h \ - ../CRITERIA3D/shared/project3D.h + mainWindow.h + FORMS += \ mainWindow.ui \ diff --git a/bin/VINE3D/mainWindow.cpp b/bin/VINE3D/mainWindow.cpp index 21ad1efc9..dd3a221a9 100644 --- a/bin/VINE3D/mainWindow.cpp +++ b/bin/VINE3D/mainWindow.cpp @@ -9,6 +9,7 @@ #include "dialogSettings.h" #include "dialogSelection.h" #include "formTimePeriod.h" +#include "dialogWaterFluxesSettings.h" #include "mainWindow.h" #include "ui_mainWindow.h" @@ -733,6 +734,52 @@ void MainWindow::on_actionShow_model_cases_map_triggered() void MainWindow::on_actionCriteria3D_settings_triggered() { + DialogWaterFluxesSettings dialogWaterFluxes; + dialogWaterFluxes.setInitialWaterPotential(myProject.waterFluxesParameters.initialWaterPotential); + dialogWaterFluxes.setInitialDegreeOfSaturation(myProject.waterFluxesParameters.initialDegreeOfSaturation); + dialogWaterFluxes.setConductivityHVRatio(myProject.waterFluxesParameters.conductivityHorizVertRatio); + + dialogWaterFluxes.setImposedComputationDepth(myProject.waterFluxesParameters.imposedComputationDepth); + + dialogWaterFluxes.accuracySlider->setValue(myProject.waterFluxesParameters.modelAccuracy); + + if (myProject.waterFluxesParameters.computeOnlySurface) + dialogWaterFluxes.onlySurface->setChecked(true); + else if (myProject.waterFluxesParameters.computeAllSoilDepth) + dialogWaterFluxes.allSoilDepth->setChecked(true); + else + dialogWaterFluxes.imposedDepth->setChecked(true); + + dialogWaterFluxes.useWaterRetentionFitting->setChecked(myProject.fittingOptions.useWaterRetentionData); + + dialogWaterFluxes.exec(); + + if (dialogWaterFluxes.isUpdateAccuracy()) + { + myProject.waterFluxesParameters.modelAccuracy = dialogWaterFluxes.accuracySlider->value(); + } + + if (dialogWaterFluxes.result() == QDialog::Accepted) + { + myProject.waterFluxesParameters.initialWaterPotential = dialogWaterFluxes.getInitialWaterPotential(); + myProject.waterFluxesParameters.initialDegreeOfSaturation = dialogWaterFluxes.getInitialDegreeOfSaturation(); + myProject.waterFluxesParameters.conductivityHorizVertRatio = dialogWaterFluxes.getConductivityHVRatio(); + + myProject.waterFluxesParameters.imposedComputationDepth = dialogWaterFluxes.getImposedComputationDepth(); + myProject.waterFluxesParameters.computeOnlySurface = dialogWaterFluxes.onlySurface->isChecked(); + myProject.waterFluxesParameters.computeAllSoilDepth = dialogWaterFluxes.allSoilDepth->isChecked(); + + myProject.waterFluxesParameters.modelAccuracy = dialogWaterFluxes.accuracySlider->value(); + + myProject.fittingOptions.useWaterRetentionData = dialogWaterFluxes.useWaterRetentionFitting->isChecked(); + + /*if (! myProject.writeCriteria3DParameters()) + { + myProject.logError("Error writing soil fluxes parameters"); + }*/ + + // layer thickness + } }