Skip to content

Commit

Permalink
fix init monthly data
Browse files Browse the repository at this point in the history
  • Loading branch information
lauracosta committed Feb 22, 2024
1 parent 36dab3f commit a81d8f4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion 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,7 +2317,6 @@ bool Crit3DMeteoGridDbHandler::loadGridAllMonthlyData(QString &myError, QDate fi
myError = "Missing MeteoPoint id";
return false;
}
_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 a81d8f4

Please sign in to comment.