mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added support for reading more than one timestep per day. If this is detected, show hours and minutes in animation toolbar.
p4#: 20399
This commit is contained in:
@@ -541,10 +541,24 @@ void RIMainWindow::refreshAnimationActions()
|
||||
|| app->activeReservoirView()->wellCollection()->hasVisibleWellPipes())
|
||||
{
|
||||
QList<QDateTime> timeStepDates = app->activeReservoirView()->gridCellResults()->timeStepDates(0);
|
||||
int i;
|
||||
for (i = 0; i < timeStepDates.size(); i++)
|
||||
bool showHoursAndMinutes = false;
|
||||
for (int i = 0; i < timeStepDates.size(); i++)
|
||||
{
|
||||
timeStepStrings += timeStepDates[i].toString("dd.MMM yyyy");
|
||||
if (timeStepDates[i].time().hour() != 0.0 || timeStepDates[i].time().minute() != 0.0)
|
||||
{
|
||||
showHoursAndMinutes = true;
|
||||
}
|
||||
}
|
||||
|
||||
QString formatString = "dd.MMM yyyy";
|
||||
if (showHoursAndMinutes)
|
||||
{
|
||||
formatString += " - hh:mm";
|
||||
}
|
||||
|
||||
for (int i = 0; i < timeStepDates.size(); i++)
|
||||
{
|
||||
timeStepStrings += timeStepDates[i].toString(formatString);
|
||||
}
|
||||
currentTimeStepIndex = RIApplication::instance()->activeReservoirView()->currentTimeStep();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user