mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-30 17:10:19 -05:00
#14292 Update stepping dimension after summary address change
When a summary vector is selected by manipulation of a curve, recompute the source stepping dimension from the current curve content and refresh the stepping toolbar. This keeps the toolbar consistent with the displayed vectors, which is required for 3D view well selection to step the plot correctly.
This commit is contained in:
1 parent
9d92ac5229
commit
d71ee1176f
4 files changed
+47
-2
No files matched your search
@@ -1096,6 +1096,7 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
m_yValuesSummaryAddress->setAddress( m_yValuesSummaryAddressUiField() );
|
||||
|
||||
calculateCurveInterpolationFromAddress();
|
||||
updateSourceSteppingAfterAddressChange();
|
||||
|
||||
loadAndUpdate = true;
|
||||
}
|
||||
@@ -1104,6 +1105,7 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
m_xValuesSummaryAddress->setAddress( m_xValuesSummaryAddressUiField() );
|
||||
|
||||
calculateCurveInterpolationFromAddress();
|
||||
updateSourceSteppingAfterAddressChange();
|
||||
|
||||
loadAndUpdate = true;
|
||||
}
|
||||
@@ -1205,6 +1207,8 @@ void RimSummaryCurve::selectYSummaryAddress()
|
||||
m_yValuesSummaryCase = curveSelection[0].summaryCaseY();
|
||||
m_yValuesSummaryAddress->setAddress( curveSelection[0].summaryAddressY() );
|
||||
|
||||
updateSourceSteppingAfterAddressChange();
|
||||
|
||||
checkForMatchingCrossPlotTimeSteps();
|
||||
loadAndUpdateDataAndPlot();
|
||||
}
|
||||
@@ -1241,6 +1245,8 @@ void RimSummaryCurve::selectXSummaryAddress()
|
||||
m_xValuesSummaryCase = curveSelection[0].summaryCaseY();
|
||||
m_xValuesSummaryAddress->setAddress( curveSelection[0].summaryAddressY() );
|
||||
|
||||
updateSourceSteppingAfterAddressChange();
|
||||
|
||||
checkForMatchingCrossPlotTimeSteps();
|
||||
loadAndUpdateDataAndPlot();
|
||||
}
|
||||
@@ -1324,6 +1330,18 @@ void RimSummaryCurve::loadAndUpdateDataAndPlot()
|
||||
dataChanged.send();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// When the summary vector of this curve is changed, make sure the toolbar 'Step By' field stays
|
||||
/// consistent with the selected vector.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::updateSourceSteppingAfterAddressChange()
|
||||
{
|
||||
if ( auto summaryMultiPlot = firstAncestorOrThisOfType<RimSummaryMultiPlot>() )
|
||||
{
|
||||
summaryMultiPlot->updateStepDimensionFromCurves();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -146,6 +146,8 @@ private:
|
||||
void calculateCurveInterpolationFromAddress();
|
||||
void calculateCurveTypeFromAddress();
|
||||
|
||||
void updateSourceSteppingAfterAddressChange();
|
||||
|
||||
static void appendOptionItemsForSummaryAddresses( QList<caf::PdmOptionItemInfo>* options, RimSummaryCase* summaryCase );
|
||||
|
||||
private:
|
||||
|
||||
@@ -826,7 +826,7 @@ void RimSummaryMultiPlot::updateTimeAxisRangesFromFirstTimePlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlot::setDefaultRangeAggregationSteppingDimension()
|
||||
RimSummaryDataSourceStepping::SourceSteppingDimension RimSummaryMultiPlot::calculateStepDimensionFromCurves()
|
||||
{
|
||||
RiaSummaryAddressAnalyzer analyzer;
|
||||
|
||||
@@ -879,7 +879,15 @@ void RimSummaryMultiPlot::setDefaultRangeAggregationSteppingDimension()
|
||||
stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK;
|
||||
}
|
||||
|
||||
m_sourceStepping->setStepDimension( stepDimension );
|
||||
return stepDimension;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlot::setDefaultRangeAggregationSteppingDimension()
|
||||
{
|
||||
m_sourceStepping->setStepDimension( calculateStepDimensionFromCurves() );
|
||||
|
||||
// Previously, when the stepping dimension was set to 'well' for range aggregation, it was based on all wells. If one of the wells
|
||||
// had extreme values and was not visible, it would set the y-range to match the extreme value, making some curves invisible. We
|
||||
@@ -1833,6 +1841,20 @@ void RimSummaryMultiPlot::updateStepDimensionFromDefault()
|
||||
m_sourceStepping->setStepDimension( m_defaultStepDimension() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Recompute the source stepping dimension when a summary vector is selected by manipulation of a curve,
|
||||
/// so the toolbar 'Step By' field stays consistent with what the curves actually display.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlot::updateStepDimensionFromCurves()
|
||||
{
|
||||
auto stepDimension = calculateStepDimensionFromCurves();
|
||||
|
||||
m_sourceStepping->setStepDimension( stepDimension );
|
||||
m_defaultStepDimension = stepDimension;
|
||||
|
||||
RiuPlotMainWindowTools::refreshToolbars();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -106,6 +106,7 @@ public:
|
||||
|
||||
void storeStepDimensionFromToolbar();
|
||||
void updateStepDimensionFromDefault();
|
||||
void updateStepDimensionFromCurves();
|
||||
|
||||
void selectWell( QString wellName );
|
||||
|
||||
@@ -135,6 +136,8 @@ private:
|
||||
void computeAggregatedAxisRange();
|
||||
void updateSourceStepper();
|
||||
|
||||
RimSummaryDataSourceStepping::SourceSteppingDimension calculateStepDimensionFromCurves();
|
||||
|
||||
void updatePlotVisibility();
|
||||
void setAutoValueStates();
|
||||
static void setAutoValueStatesForPlot( RimSummaryPlot* summaryPlot, bool isMinMaxOverridden, bool isAppearanceOverridden );
|
||||
|
||||
Reference in new issue
Block a user