mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Make sure the detection of only cross plot curves works as expected
This commit is contained in:
parent
8bc7562e9e
commit
da20b81c0e
@ -63,17 +63,25 @@ void RiaSummaryAddressAnalyzer::appendAddresses( const std::set<RifEclipseSummar
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryAddressAnalyzer::appendAddresses( const std::vector<RiaSummaryCurveAddress>& addresses )
|
||||
{
|
||||
// RiaSummaryCurveAddress can be used to represent cross plot curves. Set the flag m_onlyCrossPlotCurves to true, and this will be set
|
||||
// to false in analyzeSingleAddress if we detect a time curve
|
||||
// RiaSummaryCurveAddress can be used to represent cross plot curves. Count curves, and set the flag m_onlyCrossPlotCurves to true if
|
||||
// all curves are cross plot curves
|
||||
|
||||
m_onlyCrossPlotCurves = true;
|
||||
size_t crossPlotCurveCount = 0;
|
||||
|
||||
for ( const auto& adr : addresses )
|
||||
{
|
||||
auto adrX = adr.summaryAddressX();
|
||||
if ( adrX.isValid() && adrX.category() != SummaryCategory::SUMMARY_TIME )
|
||||
{
|
||||
crossPlotCurveCount++;
|
||||
}
|
||||
|
||||
// Use Y address first, to make sure the ordering of cross plot names is correct
|
||||
analyzeSingleAddress( adr.summaryAddressY() );
|
||||
analyzeSingleAddress( adr.summaryAddressX() );
|
||||
}
|
||||
|
||||
m_onlyCrossPlotCurves = ( crossPlotCurveCount == addresses.size() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -474,8 +482,6 @@ void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAdd
|
||||
|
||||
if ( address.category() == SummaryCategory::SUMMARY_TIME )
|
||||
{
|
||||
m_onlyCrossPlotCurves = false;
|
||||
|
||||
// A time address has no other information than SummaryCategory::SUMMARY_TIME
|
||||
return;
|
||||
}
|
||||
|
@ -169,6 +169,7 @@ void RicSummaryPlotEditorUi::updateFromSummaryPlot( RimSummaryPlot* targetPlot,
|
||||
{
|
||||
setDefaultCurveSelection( defaultSources );
|
||||
m_previewPlot->enableAutoPlotTitle( true );
|
||||
m_previewPlot->setPlotTitleVisible( false );
|
||||
syncPreviewCurvesFromUiSelection();
|
||||
m_plotContainer = nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user