Skip to content

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjenssen committed Dec 19, 2024
1 parent 4e1994d commit a3f9dd8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ double RimStatisticsContourMapProjection::sampleSpacing() const
//--------------------------------------------------------------------------------------------------
void RimStatisticsContourMapProjection::clearGridMappingAndRedraw()
{
clearGridMapping();
updateConnectedEditors();
generateResultsIfNecessary( view()->currentTimeStep() );
updateLegend();

RimEclipseView* parentView = firstAncestorOrThisOfTypeAsserted<RimEclipseView>();
parentView->scheduleCreateDisplayModelAndRedraw();
}

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class RimStatisticsContourMapProjection : public RimContourMapProjection
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;
Expand Down

0 comments on commit a3f9dd8

Please sign in to comment.