mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 23:20:29 -05:00
Histogram: provide more reasonable default for data sources.
This commit is contained in:
1 parent
5662b43ec5
commit
f743394d8b
8 files changed
+78
No files matched your search
+22
@@ -303,3 +303,25 @@ QString RimEnsembleSummaryVectorHistogramDataSource::formatDateTime( const QDate
|
||||
RiaDefines::DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY );
|
||||
return RiaQDateTimeTools::toStringUsingApplicationLocale( dateTime, dateFormatString );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleSummaryVectorHistogramDataSource::setDefaults()
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
|
||||
std::vector<RimSummaryEnsemble*> ensembles = proj->summaryEnsembles();
|
||||
if ( !ensembles.empty() )
|
||||
{
|
||||
m_ensemble = ensembles[0];
|
||||
auto addr = RifEclipseSummaryAddress::fieldAddress( "FOPT" );
|
||||
setSummaryAddress( addr );
|
||||
std::set<time_t> allTimeSteps = m_ensemble->ensembleTimeSteps();
|
||||
if ( !allTimeSteps.empty() )
|
||||
{
|
||||
QDateTime dateTime = RiaQDateTimeTools::fromTime_t( *( allTimeSteps.rbegin() ) );
|
||||
setTimeStep( dateTime );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user