#5792 Python : Add import_summary_case and find summary case from ID

Add example of use and updated documentation
This commit is contained in:
Magne Sjaastad
2020-04-15 13:23:05 +02:00
committed by Gaute Lindkvist
parent dfc93164d0
commit 8662ff90d2
15 changed files with 533 additions and 64 deletions

View File

@@ -225,22 +225,31 @@ caf::PdmObjectHandle* RimSummaryCase_resampleValues::execute()
QString periodString = m_resamplingPeriod().trimmed();
RiaQDateTimeTools::DateTimePeriod period = RiaQDateTimeTools::DateTimePeriodEnum::fromText( periodString );
RiaTimeHistoryCurveResampler resampler;
resampler.setCurveData( values, timeValues );
auto dataObject = new RimcSummaryResampleData();
if ( RiaSummaryTools::hasAccumulatedData( adr ) )
if ( period != RiaQDateTimeTools::DateTimePeriod::NONE )
{
resampler.resampleAndComputePeriodEndValues( period );
RiaTimeHistoryCurveResampler resampler;
resampler.setCurveData( values, timeValues );
if ( RiaSummaryTools::hasAccumulatedData( adr ) )
{
resampler.resampleAndComputePeriodEndValues( period );
}
else
{
resampler.resampleAndComputeWeightedMeanValues( period );
}
dataObject->m_timeValues = resampler.resampledTimeSteps();
dataObject->m_doubleValues = resampler.resampledValues();
}
else
{
resampler.resampleAndComputeWeightedMeanValues( period );
dataObject->m_timeValues = timeValues;
dataObject->m_doubleValues = values;
}
auto dataObject = new RimcSummaryResampleData();
dataObject->m_timeValues = resampler.resampledTimeSteps();
dataObject->m_doubleValues = resampler.resampledValues();
return dataObject;
}