Skip to content

Commit

Permalink
Merge commit 'a81d8f44d2201bb6d3e226034ea4f69eb1654140'
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Feb 23, 2024
2 parents 0ce7c3d + a81d8f4 commit f09764c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions agrolib/dbMeteoGrid/dbMeteoGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,15 @@ bool Crit3DMeteoGridDbHandler::loadGridAllMonthlyData(QString &myError, QDate fi
return false;
}

// init all monthly data
for (int row = 0; row < gridStructure().header().nrRows; row++)
{
for (int col = 0; col < gridStructure().header().nrCols; col++)
{
_meteoGrid->meteoPointPointer(row,col)->initializeObsDataM(numberOfMonths, firstDate.month(), firstDate.year());
}
}

QSqlQuery qry(_db);
QDate date;
unsigned row, col;
Expand Down Expand Up @@ -2308,11 +2317,6 @@ bool Crit3DMeteoGridDbHandler::loadGridAllMonthlyData(QString &myError, QDate fi
myError = "Missing MeteoPoint id";
return false;
}

if (_meteoGrid->meteoPointPointer(row,col)->nrObsDataDaysM == 0)
{
_meteoGrid->meteoPointPointer(row,col)->initializeObsDataM(numberOfMonths, firstDate.month(), firstDate.year());
}
}
if (! _meteoGrid->meteoPointPointer(row,col)->setMeteoPointValueM(getCrit3DDate(date), variable, value))
return false;
Expand Down

0 comments on commit f09764c

Please sign in to comment.