work in progress

This commit is contained in:
Jon Jenssen 2024-12-19 18:46:28 +01:00
parent 4e1994d779
commit a3f9dd863e
2 changed files with 34 additions and 4 deletions

View File

@ -147,6 +147,13 @@ double RimStatisticsContourMapProjection::sampleSpacing() const
//--------------------------------------------------------------------------------------------------
void RimStatisticsContourMapProjection::clearGridMappingAndRedraw()
{
clearGridMapping();
updateConnectedEditors();
generateResultsIfNecessary( view()->currentTimeStep() );
updateLegend();
RimEclipseView* parentView = firstAncestorOrThisOfTypeAsserted<RimEclipseView>();
parentView->scheduleCreateDisplayModelAndRedraw();
}
//--------------------------------------------------------------------------------------------------
@ -260,10 +267,15 @@ std::pair<double, double> RimStatisticsContourMapProjection::minmaxValuesAllTime
{
clearTimeStepRange();
// TODO - step through all time steps here!
std::vector<double> aggregatedResults = statisticsContourMap()->result( 0, m_statisticsType() );
m_minResultAllTimeSteps = RigContourMapProjection::minValue( aggregatedResults );
m_maxResultAllTimeSteps = RigContourMapProjection::maxValue( aggregatedResults );
if ( auto map = statisticsContourMap() )
{
for ( auto ts : map->selectedTimeSteps() )
{
std::vector<double> aggregatedResults = statisticsContourMap()->result( ts, m_statisticsType() );
m_minResultAllTimeSteps = std::min( m_minResultAllTimeSteps, RigContourMapProjection::minValue( aggregatedResults ) );
m_maxResultAllTimeSteps = std::max( m_maxResultAllTimeSteps, RigContourMapProjection::maxValue( aggregatedResults ) );
}
}
}
return std::make_pair( m_minResultAllTimeSteps, m_maxResultAllTimeSteps );
@ -303,3 +315,20 @@ QString RimStatisticsContourMapProjection::resultAggregationText() const
else
return "";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStatisticsContourMapProjection::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
if ( changedField == &m_statisticsType )
{
clearGridMappingAndRedraw();
}
else
{
RimContourMapProjection::fieldChangedByUi( changedField, oldValue, newValue );
}
}

View File

@ -77,6 +77,7 @@ protected:
protected:
// Framework overrides
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
protected:
caf::PdmField<caf::AppEnum<RimStatisticsContourMap::StatisticsType>> m_statisticsType;