Skip to content

Commit

Permalink
choose processes
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Jun 20, 2024
1 parent 0b38138 commit 31912f0
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bin/CRITERIA3D/criteria3DProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,8 @@ bool Crit3DProject::loadModelState(QString statePath)
}

processes.computeWater = true;
processes.computeEvaporation = true;
processes.computeSlopeStability = true;
}

return true;
Expand Down
22 changes: 22 additions & 0 deletions bin/CRITERIA3D/dialogWaterFluxesSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ DialogWaterFluxesSettings::DialogWaterFluxesSettings()
{
setWindowTitle("3D water fluxes settings");

QGroupBox* processesGroupBox = new QGroupBox("Required processes");
QLabel *snowLabel = new QLabel(tr("Snow "));
snowProcess = new QCheckBox();
QLabel *evaporationLabel = new QLabel(tr("Evaporation"));
evaporationProcess = new QCheckBox();
QLabel *cropLabel = new QLabel(tr("Crop "));
cropProcess = new QCheckBox();
QLabel *waterLabel = new QLabel(tr("Water flow"));
waterFluxesProcess = new QCheckBox();

QHBoxLayout *layoutProcesses = new QHBoxLayout();
layoutProcesses->addWidget(snowProcess);
layoutProcesses->addWidget(snowLabel);
layoutProcesses->addWidget(evaporationProcess);
layoutProcesses->addWidget(evaporationLabel);
layoutProcesses->addWidget(cropProcess);
layoutProcesses->addWidget(cropLabel);
layoutProcesses->addWidget(waterFluxesProcess);
layoutProcesses->addWidget(waterLabel);
processesGroupBox->setLayout(layoutProcesses);

// initial water potential [m]
QGroupBox* initialGroupBox = new QGroupBox("Initial conditions");
QLabel *initialWaterPotentialLabel = new QLabel(tr("Initial water potential [m]"));
Expand Down Expand Up @@ -53,6 +74,7 @@ DialogWaterFluxesSettings::DialogWaterFluxesSettings()
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);

QVBoxLayout *mainLayout = new QVBoxLayout();
mainLayout->addWidget(processesGroupBox);
mainLayout->addWidget(initialGroupBox);
mainLayout->addWidget(depthGroupBox);
mainLayout->addWidget(soilGroupBox);
Expand Down
6 changes: 6 additions & 0 deletions bin/CRITERIA3D/dialogWaterFluxesSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <QDialog>
#include <QLineEdit>
#include <QRadioButton>
#include <QCheckBox>

class DialogWaterFluxesSettings : public QDialog
{
Expand All @@ -12,6 +13,11 @@
QLineEdit *imposedComputationDepthEdit;

public:
QCheckBox *snowProcess;
QCheckBox *evaporationProcess;
QCheckBox *cropProcess;
QCheckBox *waterFluxesProcess;

QRadioButton *onlySurface;
QRadioButton *allSoilDepth;
QRadioButton *imposedDepth;
Expand Down
32 changes: 30 additions & 2 deletions bin/CRITERIA3D/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2179,6 +2179,11 @@ void MainWindow::on_actionWaterFluxes_settings_triggered()
dialogWaterFluxes.setInitialWaterPotential(myProject.waterFluxesParameters.initialWaterPotential);
dialogWaterFluxes.setImposedComputationDepth(myProject.waterFluxesParameters.imposedComputationDepth);

dialogWaterFluxes.snowProcess->setChecked(myProject.processes.computeSnow);
dialogWaterFluxes.evaporationProcess->setChecked(myProject.processes.computeEvaporation);
dialogWaterFluxes.cropProcess->setChecked(myProject.processes.computeCrop);
dialogWaterFluxes.waterFluxesProcess->setChecked(myProject.processes.computeWater);

if (myProject.waterFluxesParameters.computeOnlySurface)
dialogWaterFluxes.onlySurface->setChecked(true);
else if (myProject.waterFluxesParameters.computeAllSoilDepth)
Expand All @@ -2201,17 +2206,40 @@ void MainWindow::on_actionWaterFluxes_settings_triggered()
myProject.waterFluxesParameters.computeAllSoilDepth = dialogWaterFluxes.allSoilDepth->isChecked();
myProject.fittingOptions.useWaterRetentionData = dialogWaterFluxes.useWaterRetentionFitting->isChecked();

myProject.processes.computeSnow = dialogWaterFluxes.snowProcess->isChecked();
if (myProject.processes.computeSnow)
{
myProject.processes.computeMeteo = true;
myProject.processes.computeRadiation = true;
}
myProject.processes.computeEvaporation = dialogWaterFluxes.evaporationProcess->isChecked();
if (myProject.processes.computeEvaporation)
{
myProject.processes.computeMeteo = true;
myProject.processes.computeRadiation = true;
}
myProject.processes.computeCrop = dialogWaterFluxes.cropProcess->isChecked();
if (myProject.processes.computeCrop)
{
myProject.processes.computeMeteo = true;
myProject.processes.computeRadiation = true;
}
myProject.processes.computeWater = dialogWaterFluxes.waterFluxesProcess->isChecked();
if (myProject.processes.computeWater)
{
myProject.processes.computeMeteo = true;
myProject.processes.computeSlopeStability = true;
}

/*if (! myProject.writeCriteria3DParameters())
{
myProject.logError("Error writing soil fluxes parameters");
}*/
}

// layer thickness
// processes (snow crop)
// boundary (lateral free drainage, bottom free drainage)
// lateral conductivity ratio
// model accuracy
}


Expand Down

0 comments on commit 31912f0

Please sign in to comment.