Skip to content

Commit

Permalink
Merge commit '3abfff0b1f3f83a41154f73c8c2848c056004587'
Browse files Browse the repository at this point in the history
  • Loading branch information
giadasan committed Jul 5, 2024
2 parents fa4362f + 3abfff0 commit ba933b8
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 57 deletions.
8 changes: 2 additions & 6 deletions agrolib/pointStatisticsWidget/dialogElaboration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,9 @@ DialogElaboration::DialogElaboration(QSettings *settings, Crit3DClimate *clima,
settings->endGroup();
elaborationLayout.addWidget(&elaborationList);

QLocale local(QLocale::system().language());
local.setNumberOptions(QLocale::RejectGroupSeparator);
elab1Parameter.setPlaceholderText("Parameter");
elab1Parameter.setFixedWidth(90);
QDoubleValidator* validator = new QDoubleValidator(-9999.0, 9999.0, 2);
validator->setLocale(local);
elab1Parameter.setValidator(validator);
elab1Parameter.setValidator(new QDoubleValidator(-9999.0, 9999.0, 2));

QString elab1Field = elaborationList.currentText();
if ( MapElabWithParam.find(elab1Field.toStdString()) == MapElabWithParam.end())
Expand Down Expand Up @@ -272,7 +268,7 @@ void DialogElaboration::done(bool res)
clima->setElab1(elaborationList.currentText());

clima->setParam1IsClimate(false);
if (elab1Parameter.text() != "")
if (! elab1Parameter.text().isEmpty())
{
clima->setParam1(elab1Parameter.text().toFloat());
}
Expand Down
10 changes: 3 additions & 7 deletions agrolib/pragaProject/dialogMeteoComputation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,9 @@ DialogMeteoComputation::DialogMeteoComputation(QSettings *settings, bool isMeteo
settings->endGroup();
elaborationLayout.addWidget(&elaborationList);

QLocale local(QLocale::system().language());
local.setNumberOptions(QLocale::RejectGroupSeparator);
elab1Parameter.setPlaceholderText("Parameter");
elab1Parameter.setFixedWidth(90);
QDoubleValidator* validator = new QDoubleValidator(-9999.0, 9999.0, 2);
validator->setLocale(local);
elab1Parameter.setValidator(validator);
elab1Parameter.setValidator(new QDoubleValidator(-9999.0, 9999.0, 2));
readParam.setText("Read param from db Climate");
readParam.setChecked(false);
climateDbElabList.setVisible(false);
Expand Down Expand Up @@ -331,7 +327,7 @@ DialogMeteoComputation::DialogMeteoComputation(QSettings *settings, bool isMeteo

elab2Parameter.setPlaceholderText("Parameter");
elab2Parameter.setFixedWidth(90);
elab2Parameter.setValidator(validator);
elab2Parameter.setValidator(new QDoubleValidator(-9999.0, 9999.0, 2));

QString elab2Field = secondElabList.currentText();
if ( MapElabWithParam.find(elab2Field.toStdString()) == MapElabWithParam.end())
Expand Down Expand Up @@ -567,7 +563,7 @@ void DialogMeteoComputation::done(bool res)
if (!readParam.isChecked())
{
myProject.clima->setParam1IsClimate(false);
if (elab1Parameter.text() != "")
if (! elab1Parameter.text().isEmpty())
{
myProject.clima->setParam1(elab1Parameter.text().toFloat());
}
Expand Down
59 changes: 30 additions & 29 deletions agrolib/pragaProject/saveClimaLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ void SaveClimaLayout::addElab()
QString elabAdded = firstYear + "-" + lastYear + "_" + variable.remove("_") + "_" + period;
if (period == "Generic")
{
elabAdded = elabAdded + "_" + genericPeriodStartDay + "of" + genericPeriodStartMonth + "-" + genericPeriodEndDay + "of" + genericPeriodEndMonth;
elabAdded = elabAdded + "_" + genericPeriodStartDay + "of" + genericPeriodStartMonth
+ "-" + genericPeriodEndDay + "of" + genericPeriodEndMonth;
if (genericNYear != "0")
{
elabAdded = elabAdded + "-+" + genericNYear + "y";
Expand Down Expand Up @@ -152,9 +153,9 @@ QList<QString> SaveClimaLayout::getList() const
return list;
}

void SaveClimaLayout::setList(const QList<QString> &value)
void SaveClimaLayout::setList(const QList<QString> &valueList)
{
list = value;
list = valueList;
listView.addItems(list);
}

Expand All @@ -163,49 +164,49 @@ QString SaveClimaLayout::getElab1ParamFromdB() const
return elab1ParamFromdB;
}

void SaveClimaLayout::setElab1ParamFromdB(const QString &value)
void SaveClimaLayout::setElab1ParamFromdB(const QString &valueStr)
{
elab1ParamFromdB = value;
elab1ParamFromdB = valueStr;
}

QString SaveClimaLayout::getFirstYear() const
{
return firstYear;
}

void SaveClimaLayout::setFirstYear(const QString &value)
void SaveClimaLayout::setFirstYear(const QString &valueStr)
{
firstYear = value;
firstYear = valueStr;
}

QString SaveClimaLayout::getLastYear() const
{
return lastYear;
}

void SaveClimaLayout::setLastYear(const QString &value)
void SaveClimaLayout::setLastYear(const QString &valueStr)
{
lastYear = value;
lastYear = valueStr;
}

QString SaveClimaLayout::getVariable() const
{
return variable;
}

void SaveClimaLayout::setVariable(const QString &value)
void SaveClimaLayout::setVariable(const QString &valueStr)
{
variable = value;
variable = valueStr;
}

QString SaveClimaLayout::getPeriod() const
{
return period;
}

void SaveClimaLayout::setPeriod(const QString &value)
void SaveClimaLayout::setPeriod(const QString &valueStr)
{
period = value;
period = valueStr;
}

QString SaveClimaLayout::getGenericPeriodStartDay() const
Expand All @@ -223,77 +224,77 @@ QString SaveClimaLayout::getGenericPeriodStartMonth() const
return genericPeriodStartMonth;
}

void SaveClimaLayout::setGenericPeriodStartMonth(const QString &value)
void SaveClimaLayout::setGenericPeriodStartMonth(const QString &valueStr)
{
genericPeriodStartMonth = value;
genericPeriodStartMonth = valueStr;
}

QString SaveClimaLayout::getGenericPeriodEndDay() const
{
return genericPeriodEndDay;
}

void SaveClimaLayout::setGenericPeriodEndDay(const QString &value)
void SaveClimaLayout::setGenericPeriodEndDay(const QString &valueStr)
{
genericPeriodEndDay = value;
genericPeriodEndDay = valueStr;
}

QString SaveClimaLayout::getGenericPeriodEndMonth() const
{
return genericPeriodEndMonth;
}

void SaveClimaLayout::setGenericPeriodEndMonth(const QString &value)
void SaveClimaLayout::setGenericPeriodEndMonth(const QString &valueStr)
{
genericPeriodEndMonth = value;
genericPeriodEndMonth = valueStr;
}

QString SaveClimaLayout::getGenericNYear() const
{
return genericNYear;
}

void SaveClimaLayout::setGenericNYear(const QString &value)
void SaveClimaLayout::setGenericNYear(const QString &valueStr)
{
genericNYear = value;
genericNYear = valueStr;
}

QString SaveClimaLayout::getSecondElab() const
{
return secondElab;
}

void SaveClimaLayout::setSecondElab(const QString &value)
void SaveClimaLayout::setSecondElab(const QString &valueStr)
{
secondElab = value;
secondElab = valueStr;
}

QString SaveClimaLayout::getElab2Param() const
{
return elab2Param;
}

void SaveClimaLayout::setElab2Param(const QString &value)
void SaveClimaLayout::setElab2Param(const QString &valueStr)
{
elab2Param = value;
elab2Param = valueStr;
}

QString SaveClimaLayout::getElab() const
{
return elab;
}

void SaveClimaLayout::setElab(const QString &value)
void SaveClimaLayout::setElab(const QString &valueStr)
{
elab = value;
elab = valueStr;
}

QString SaveClimaLayout::getElab1Param() const
{
return elab1Param;
}

void SaveClimaLayout::setElab1Param(const QString &value)
void SaveClimaLayout::setElab1Param(const QString &valueStr)
{
elab1Param = value;
elab1Param = valueStr;
}
30 changes: 15 additions & 15 deletions agrolib/pragaProject/saveClimaLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@ class SaveClimaLayout : public QDialog
SaveClimaLayout();

QString getFirstYear() const;
void setFirstYear(const QString &value);
void setFirstYear(const QString &valueStr);
QString getLastYear() const;
void setLastYear(const QString &value);
void setLastYear(const QString &valueStr);
QString getVariable() const;
void setVariable(const QString &value);
void setVariable(const QString &valueStr);
QString getPeriod() const;
void setPeriod(const QString &value);
void setPeriod(const QString &valueStr);
QString getGenericPeriodEnd() const;
void setGenericPeriodEnd(const QString &value);
void setGenericPeriodEnd(const QString &valueStr);
QString getGenericNYear() const;
void setGenericNYear(const QString &value);
void setGenericNYear(const QString &valueStr);
QString getSecondElab() const;
void setSecondElab(const QString &value);
void setSecondElab(const QString &valueStr);
QString getElab2Param() const;
void setElab2Param(const QString &value);
void setElab2Param(const QString &valueStr);
QString getElab() const;
void setElab(const QString &value);
void setElab(const QString &valueStr);
QString getElab1Param() const;
void setElab1Param(const QString &value);
void setElab1Param(const QString &valueStr);
QString getGenericPeriodStartDay() const;
void setGenericPeriodStartDay(const QString &value);
QString getGenericPeriodStartMonth() const;
void setGenericPeriodStartMonth(const QString &value);
void setGenericPeriodStartMonth(const QString &valueStr);
QString getGenericPeriodEndDay() const;
void setGenericPeriodEndDay(const QString &value);
void setGenericPeriodEndDay(const QString &valueStr);
QString getGenericPeriodEndMonth() const;
void setGenericPeriodEndMonth(const QString &value);
void setGenericPeriodEndMonth(const QString &valueStr);

void addElab();
void deleteRaw();
Expand All @@ -52,10 +52,10 @@ class SaveClimaLayout : public QDialog
void loadElabList();

QList<QString> getList() const;
void setList(const QList<QString> &value);
void setList(const QList<QString> &valueList);

QString getElab1ParamFromdB() const;
void setElab1ParamFromdB(const QString &value);
void setElab1ParamFromdB(const QString &valueStr);

private:

Expand Down

0 comments on commit ba933b8

Please sign in to comment.