mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-30 17:10:19 -05:00
#9925 Improve stepping on history vectors
Do not show the extension H for available summery vectors in toolbar for source stepping. Make sure that curves with "NAME"H and "NAME"_DIFF will be modified when the summary vector "NAME" is changed.
This commit is contained in:
1 parent
871a064289
commit
265dd16093
5 files changed
+45
-120
No files matched your search
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "Summary/RiaSummaryCurveDefinition.h"
|
||||
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
|
||||
@@ -92,39 +94,12 @@ std::vector<std::string> RiaSummaryAddressAnalyzer::quantities() const
|
||||
return m_quantities;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::quantityNamesWithHistory() const
|
||||
{
|
||||
assignCategoryToQuantities();
|
||||
|
||||
return m_quantitiesWithMatchingHistory;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::quantityNamesNoHistory() const
|
||||
{
|
||||
assignCategoryToQuantities();
|
||||
|
||||
return m_quantitiesNoMatchingHistory;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaSummaryAddressAnalyzer::isSingleQuantityIgnoreHistory() const
|
||||
{
|
||||
if ( quantities().size() == 1 ) return true;
|
||||
|
||||
if ( quantities().size() == 2 && quantityNamesWithHistory().size() == 1 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return quantities().size() == 1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -159,11 +134,6 @@ std::string RiaSummaryAddressAnalyzer::quantityNameForTitle() const
|
||||
return title;
|
||||
}
|
||||
|
||||
if ( quantities().size() == 2 && quantityNamesWithHistory().size() == 1 )
|
||||
{
|
||||
return *quantityNamesWithHistory().begin();
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -405,22 +375,6 @@ std::vector<RifEclipseSummaryAddress> RiaSummaryAddressAnalyzer::addressesForCat
|
||||
return filteredAddresses;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RiaSummaryAddressAnalyzer::correspondingHistorySummaryCurveName( const std::string& curveName )
|
||||
{
|
||||
static std::string historyIdentifier = "H";
|
||||
|
||||
if ( RiaStdStringTools::endsWith( curveName, historyIdentifier ) )
|
||||
{
|
||||
std::string candidate = curveName.substr( 0, curveName.size() - 1 );
|
||||
return candidate;
|
||||
}
|
||||
|
||||
return curveName + historyIdentifier;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -448,56 +402,6 @@ void RiaSummaryAddressAnalyzer::clear()
|
||||
m_wellCompletionNumbers.clear();
|
||||
m_blocks.clear();
|
||||
m_aquifers.clear();
|
||||
|
||||
m_quantitiesNoMatchingHistory.clear();
|
||||
m_quantitiesWithMatchingHistory.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryAddressAnalyzer::assignCategoryToQuantities() const
|
||||
{
|
||||
if ( !m_quantities.empty() )
|
||||
{
|
||||
if ( m_quantitiesWithMatchingHistory.empty() && m_quantitiesNoMatchingHistory.empty() )
|
||||
{
|
||||
computeQuantityNamesWithHistory();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryAddressAnalyzer::computeQuantityNamesWithHistory() const
|
||||
{
|
||||
m_quantitiesNoMatchingHistory.clear();
|
||||
m_quantitiesWithMatchingHistory.clear();
|
||||
|
||||
const std::string historyIdentifier( "H" );
|
||||
|
||||
for ( const auto& s : m_quantities )
|
||||
{
|
||||
std::string correspondingHistoryCurve = correspondingHistorySummaryCurveName( s );
|
||||
|
||||
if ( std::find( m_quantities.begin(), m_quantities.end(), correspondingHistoryCurve ) != m_quantities.end() )
|
||||
{
|
||||
// Insert the curve name without H
|
||||
if ( RiaStdStringTools::endsWith( s, historyIdentifier ) )
|
||||
{
|
||||
m_quantitiesWithMatchingHistory.insert( correspondingHistoryCurve );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_quantitiesWithMatchingHistory.insert( s );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_quantitiesNoMatchingHistory.insert( s );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -520,12 +424,13 @@ void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAdd
|
||||
m_wellNames.insert( { wellName, address } );
|
||||
}
|
||||
|
||||
if ( !address.vectorName().empty() )
|
||||
const auto [vectorNameToUse, extension] = RifEclipseSummaryTools::vectorNameAndExtension( address.vectorName() );
|
||||
if ( !vectorNameToUse.empty() )
|
||||
{
|
||||
// The ordering of the quantities is used when creating titles of plots
|
||||
if ( std::find( m_quantities.begin(), m_quantities.end(), address.vectorName() ) == m_quantities.end() )
|
||||
if ( std::find( m_quantities.begin(), m_quantities.end(), vectorNameToUse ) == m_quantities.end() )
|
||||
{
|
||||
m_quantities.push_back( address.vectorName() );
|
||||
m_quantities.push_back( vectorNameToUse );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,10 +486,10 @@ void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAdd
|
||||
{
|
||||
if ( m_categories.count( address.category() ) == 0 )
|
||||
{
|
||||
m_categories[address.category()] = { address.vectorName() };
|
||||
m_categories[address.category()] = { vectorNameToUse };
|
||||
}
|
||||
else
|
||||
m_categories[address.category()].insert( address.vectorName() );
|
||||
m_categories[address.category()].insert( vectorNameToUse );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,6 @@ public:
|
||||
void clear();
|
||||
|
||||
std::vector<std::string> quantities() const;
|
||||
std::set<std::string> quantityNamesWithHistory() const;
|
||||
std::set<std::string> quantityNamesNoHistory() const;
|
||||
|
||||
bool isSingleQuantityIgnoreHistory() const;
|
||||
|
||||
@@ -74,14 +72,9 @@ public:
|
||||
static std::vector<RifEclipseSummaryAddress> addressesForCategory( const std::set<RifEclipseSummaryAddress>& addresses,
|
||||
RifEclipseSummaryAddressDefines::SummaryCategory category );
|
||||
|
||||
static std::string correspondingHistorySummaryCurveName( const std::string& curveName );
|
||||
|
||||
std::set<std::string> vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category );
|
||||
|
||||
private:
|
||||
void assignCategoryToQuantities() const;
|
||||
void computeQuantityNamesWithHistory() const;
|
||||
|
||||
void analyzeSingleAddress( const RifEclipseSummaryAddress& address );
|
||||
|
||||
static std::set<std::string> keysInMap( const std::multimap<std::string, RifEclipseSummaryAddress>& map );
|
||||
@@ -94,9 +87,7 @@ private:
|
||||
static std::vector<std::vector<RifEclipseSummaryAddress>> valuesInMap( const std::multimap<int, RifEclipseSummaryAddress>& map );
|
||||
|
||||
private:
|
||||
std::vector<std::string> m_quantities;
|
||||
mutable std::set<std::string> m_quantitiesWithMatchingHistory;
|
||||
mutable std::set<std::string> m_quantitiesNoMatchingHistory;
|
||||
std::vector<std::string> m_quantities;
|
||||
|
||||
std::vector<RifEclipseSummaryAddress> m_otherCategory;
|
||||
std::multimap<std::string, RifEclipseSummaryAddress> m_wellNames;
|
||||
|
||||
Reference in new issue
Block a user