Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Nov 16, 2023
1 parent ee133e6 commit c9199d5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion agrolib/criteriaModel/criteria1DProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ int Crit1DProject::computeAllUnits()
}
}

if ((i+1) % infoStep == 0)
if ((i+1) % infoStep == 0 && nrUnitsComputed > 0)
{
double percentage = (i+1) * 100.0 / compUnitList.size();
logger.writeInfo("..." + QString::number(round(percentage)) + "%");
Expand Down
8 changes: 4 additions & 4 deletions agrolib/utilities/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ bool Logger::setLog(QString path, QString fileName, bool addDateTime)
}


void Logger::writeInfo(const QString &value)
void Logger::writeInfo(const QString &infoStr)
{
QString text = value;
QString text = infoStr;
if (m_showDate)
{
text = QDateTime::currentDateTime().toString("yyyy-MM-dd hh.mm") + " " + text;
Expand All @@ -57,9 +57,9 @@ void Logger::writeInfo(const QString &value)
}


void Logger::writeError(const QString &value)
void Logger::writeError(const QString &errorStr)
{
QString text = "----ERROR!----\n" + value;
QString text = " ----ERROR!---- \n" + errorStr;
if (m_showDate)
{
text = QDateTime::currentDateTime().toString("yyyy-MM-dd hh.mm") + text;
Expand Down
4 changes: 2 additions & 2 deletions agrolib/utilities/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

bool setLog(QString path, QString fileName, bool addDateTime);
void setShowDateTime(bool value);
void writeInfo(const QString &value);
void writeError(const QString &value);
void writeInfo(const QString &infoStr);
void writeError(const QString &errorStr);

private:
QFile *file;
Expand Down
2 changes: 1 addition & 1 deletion bin/CRITERIA1D/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main(int argc, char *argv[])

#ifdef TEST
//projectFileName = projectPath + "kiwifruit/kiwifruit.ini";
projectFileName = projectPath + "montue/montue.ini";
projectFileName = projectPath + "test/test.ini";
//projectFileName = "//moses-arpae/CRITERIA1D/PROJECTS/CLARA/monthlyClimate/C4_June_climate.ini";
#else
#ifdef TEST_GEO
Expand Down

0 comments on commit c9199d5

Please sign in to comment.