mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7761 Objective Function : Change formula and add several options
This commit is contained in:
@@ -186,6 +186,30 @@ void RiuSummaryVectorSelectionDialog::enableIndividualEnsembleCaseSelection( boo
|
||||
summaryAddressSelection()->enableIndividualEnsembleCaseSelection( enable );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryVectorSelectionDialog::hideHistoryVectors()
|
||||
{
|
||||
summaryAddressSelection()->hideHistoryVectors( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryVectorSelectionDialog::hideDifferenceVectors()
|
||||
{
|
||||
summaryAddressSelection()->hideDifferenceVectors( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryVectorSelectionDialog::hideVectorsWithNoHistory()
|
||||
{
|
||||
summaryAddressSelection()->hideVectorsWithoutHistory( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -52,6 +52,10 @@ public:
|
||||
void enableMultiSelect( bool enable );
|
||||
void enableIndividualEnsembleCaseSelection( bool enable );
|
||||
|
||||
void hideHistoryVectors();
|
||||
void hideDifferenceVectors();
|
||||
void hideVectorsWithNoHistory();
|
||||
|
||||
private:
|
||||
RiuSummaryVectorSelectionUi* summaryAddressSelection() const;
|
||||
void updateLabel();
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RimCalculatedSummaryCase.h"
|
||||
@@ -383,6 +384,10 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi()
|
||||
m_hideEnsembles = false;
|
||||
m_hideSummaryCases = false;
|
||||
|
||||
m_hideDifferenceVectors = false;
|
||||
m_hideHistoryVectors = false;
|
||||
m_hideVectorsWithoutHistory = false;
|
||||
|
||||
m_prevCurveCount = 0;
|
||||
m_prevCurveSetCount = 0;
|
||||
}
|
||||
@@ -566,6 +571,30 @@ void RiuSummaryVectorSelectionUi::enableIndividualEnsembleCaseSelection( bool en
|
||||
m_showIndividualEnsembleCases = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryVectorSelectionUi::hideDifferenceVectors( bool hide )
|
||||
{
|
||||
m_hideDifferenceVectors = hide;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryVectorSelectionUi::hideHistoryVectors( bool hide )
|
||||
{
|
||||
m_hideHistoryVectors = hide;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryVectorSelectionUi::hideVectorsWithoutHistory( bool hide )
|
||||
{
|
||||
m_hideVectorsWithoutHistory = hide;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1128,6 +1157,40 @@ std::set<RifEclipseSummaryAddress>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_hideHistoryVectors || m_hideDifferenceVectors )
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress> filteredAddresses;
|
||||
|
||||
for ( const auto& adr : addrUnion )
|
||||
{
|
||||
if ( m_hideHistoryVectors && adr.isHistoryQuantity() ) continue;
|
||||
|
||||
if ( m_hideDifferenceVectors )
|
||||
{
|
||||
const auto diffText = RifReaderEclipseSummary::differenceIdentifier();
|
||||
if ( RiaStdStringTools::endsWith( adr.quantityName(), diffText ) ) continue;
|
||||
}
|
||||
|
||||
if ( m_hideVectorsWithoutHistory )
|
||||
{
|
||||
auto candidateName = adr.quantityName() + RifReaderEclipseSummary::historyIdentifier();
|
||||
|
||||
bool found = false;
|
||||
for ( const auto& ad : addrUnion )
|
||||
{
|
||||
if ( ad.quantityName() == candidateName ) found = true;
|
||||
}
|
||||
|
||||
if ( !found ) continue;
|
||||
}
|
||||
|
||||
filteredAddresses.insert( adr );
|
||||
}
|
||||
|
||||
addrUnion.swap( filteredAddresses );
|
||||
}
|
||||
|
||||
return addrUnion;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,10 @@ public:
|
||||
void hideSummaryCases( bool hide );
|
||||
void enableIndividualEnsembleCaseSelection( bool enable );
|
||||
|
||||
void hideDifferenceVectors( bool hide );
|
||||
void hideHistoryVectors( bool hide );
|
||||
void hideVectorsWithoutHistory( bool hide );
|
||||
|
||||
void setFieldChangedHandler( const std::function<void()>& handlerFunc );
|
||||
|
||||
void setDefaultSelection( const std::vector<SummarySource*>& defaultCases );
|
||||
@@ -129,6 +133,10 @@ private:
|
||||
bool m_hideSummaryCases;
|
||||
bool m_showIndividualEnsembleCases;
|
||||
|
||||
bool m_hideHistoryVectors;
|
||||
bool m_hideVectorsWithoutHistory;
|
||||
bool m_hideDifferenceVectors;
|
||||
|
||||
std::function<void()> m_toggleChangedHandler;
|
||||
|
||||
size_t m_prevCurveCount;
|
||||
|
||||
Reference in New Issue
Block a user