Skip to content

Commit

Permalink
fix locale - radiation settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Oct 30, 2023
1 parent 21bc575 commit 28fc85d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions agrolib/project/dialogRadiation.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <QtWidgets>
#include <QLocale>

#include "project.h"
#include "radiationSettings.h"
Expand All @@ -24,16 +25,16 @@ DialogRadiation::DialogRadiation(Project* myProject)
comboRealSky = new QComboBox();
comboLinkeMode = new QComboBox();
groupLinke = new QGroupBox("Linke turbidity factor");
editLinke = new QLineEdit(QString::number(double(project_->radSettings.getLinke())));
editLinke = new QLineEdit(QLocale().toString(project_->radSettings.getLinke()));
buttonLinke = new QPushButton("Load Linke map...");
editLinkeMap = new QLineEdit();
comboAlbedoMode = new QComboBox();
buttonAlbedo = new QPushButton("Load albedo map...");
editAlbedoMap = new QLineEdit();
editAlbedo = new QLineEdit(QString::number(double(project_->radSettings.getAlbedo())));
editAlbedo = new QLineEdit(QLocale().toString(project_->radSettings.getAlbedo()));
comboTiltMode = new QComboBox();
editTilt = new QLineEdit(QString::number(double(project_->radSettings.getTilt())));
editAspect = new QLineEdit(QString::number(double(project_->radSettings.getAspect())));
editTilt = new QLineEdit(QLocale().toString(project_->radSettings.getTilt()));
editAspect = new QLineEdit(QLocale().toString(project_->radSettings.getAspect()));

// --------------------------------------------------------
// algorithm
Expand Down Expand Up @@ -88,7 +89,7 @@ DialogRadiation::DialogRadiation(Project* myProject)
layoutTransSettings->addLayout(layoutTransAlgorithm);

QLabel* labelTransClear = new QLabel("clear sky transmissivity");
editTransClearSky = new QLineEdit(QString::number(double(project_->radSettings.getClearSky())));
editTransClearSky = new QLineEdit(QLocale().toString(project_->radSettings.getClearSky()));
QDoubleValidator* doubleValClearSky = new QDoubleValidator(0.0, 1.0, 2, this);
editTransClearSky->setValidator(doubleValClearSky);
layoutTransSettings->addWidget(labelTransClear);
Expand Down Expand Up @@ -343,7 +344,7 @@ void DialogRadiation::accept()
return;
}
else {
linke = editLinke->text().toFloat();
linke = QLocale().toFloat(editLinke->text());
}
}
else if (linkeMode == PARAM_MODE_MAP)
Expand All @@ -365,7 +366,7 @@ void DialogRadiation::accept()
return;
}
else {
albedo = editAlbedo->text().toFloat();
albedo = QLocale().toFloat(editAlbedo->text());
}

}
Expand All @@ -386,7 +387,7 @@ void DialogRadiation::accept()
return;
}
else {
tilt = editTilt->text().toFloat();
tilt = QLocale().toFloat(editTilt->text());
}


Expand All @@ -396,7 +397,7 @@ void DialogRadiation::accept()
return;
}
else {
aspect = editAspect->text().toFloat();
aspect = QLocale().toFloat(editAspect->text());
}
}

Expand All @@ -407,7 +408,7 @@ void DialogRadiation::accept()
project_->radSettings.setTiltMode(tiltMode);
project_->radSettings.setRealSky(realSky);
project_->radSettings.setShadowing(checkShadowing->isChecked());
project_->radSettings.setClearSky(editTransClearSky->text().toFloat());
project_->radSettings.setClearSky(QLocale().toFloat(editTransClearSky->text()));

if (linke != NODATA) project_->radSettings.setLinke(linke);
if (albedo != NODATA) project_->radSettings.setAlbedo(albedo);
Expand Down

0 comments on commit 28fc85d

Please sign in to comment.