mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-31 09:14:11 -05:00
Add support for summary cross plot curves in summary plots
This commit is contained in:
1 parent
b87fa0bc74
commit
146412c600
44 files changed
+970
-440
No files matched your search
@@ -32,6 +32,7 @@ using namespace RifEclipseSummaryAddressDefines;
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaSummaryAddressAnalyzer::RiaSummaryAddressAnalyzer()
|
||||
: m_onlyCrossPlotCurves( false )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -57,6 +58,23 @@ 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
|
||||
|
||||
m_onlyCrossPlotCurves = true;
|
||||
|
||||
for ( const auto& adr : addresses )
|
||||
{
|
||||
analyzeSingleAddress( adr.summaryAddressX() );
|
||||
analyzeSingleAddress( adr.summaryAddressY() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -100,6 +118,14 @@ bool RiaSummaryAddressAnalyzer::isSingleQuantityIgnoreHistory() const
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaSummaryAddressAnalyzer::onlyCrossPlotCurves() const
|
||||
{
|
||||
return m_onlyCrossPlotCurves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -110,6 +136,20 @@ std::string RiaSummaryAddressAnalyzer::quantityNameForTitle() const
|
||||
return *quantities().begin();
|
||||
}
|
||||
|
||||
if ( quantities().size() == 2 && m_onlyCrossPlotCurves )
|
||||
{
|
||||
// We have a cross plot with only one curve
|
||||
|
||||
std::string title;
|
||||
for ( const auto& quantity : quantities() )
|
||||
{
|
||||
if ( !title.empty() ) title += " | ";
|
||||
title += quantity;
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
if ( quantities().size() == 2 && quantityNamesWithHistory().size() == 1 )
|
||||
{
|
||||
return *quantityNamesWithHistory().begin();
|
||||
@@ -429,6 +469,14 @@ void RiaSummaryAddressAnalyzer::computeQuantityNamesWithHistory() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAddress& address )
|
||||
{
|
||||
if ( address.category() == SummaryCategory::SUMMARY_TIME )
|
||||
{
|
||||
m_onlyCrossPlotCurves = false;
|
||||
|
||||
// A time address has no other information than SummaryCategory::SUMMARY_TIME
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string& wellName = address.wellName();
|
||||
|
||||
if ( !wellName.empty() )
|
||||
|
||||
Reference in new issue
Block a user