From 28fc85d7c4d9a6cfda8318083c6ee29111eff4b0 Mon Sep 17 00:00:00 2001 From: ftomei Date: Mon, 30 Oct 2023 16:08:17 +0100 Subject: [PATCH] fix locale - radiation settings --- agrolib/project/dialogRadiation.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/agrolib/project/dialogRadiation.cpp b/agrolib/project/dialogRadiation.cpp index 61286dca4..db8bc2c0c 100644 --- a/agrolib/project/dialogRadiation.cpp +++ b/agrolib/project/dialogRadiation.cpp @@ -1,4 +1,5 @@ #include +#include #include "project.h" #include "radiationSettings.h" @@ -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 @@ -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); @@ -343,7 +344,7 @@ void DialogRadiation::accept() return; } else { - linke = editLinke->text().toFloat(); + linke = QLocale().toFloat(editLinke->text()); } } else if (linkeMode == PARAM_MODE_MAP) @@ -365,7 +366,7 @@ void DialogRadiation::accept() return; } else { - albedo = editAlbedo->text().toFloat(); + albedo = QLocale().toFloat(editAlbedo->text()); } } @@ -386,7 +387,7 @@ void DialogRadiation::accept() return; } else { - tilt = editTilt->text().toFloat(); + tilt = QLocale().toFloat(editTilt->text()); } @@ -396,7 +397,7 @@ void DialogRadiation::accept() return; } else { - aspect = editAspect->text().toFloat(); + aspect = QLocale().toFloat(editAspect->text()); } } @@ -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);