mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Discard display of delta curves if data is missing
Add a flag used to control if missing data from either of the ensembles will return no data, or use zero if data is missing.
This commit is contained in:
parent
7550b8702c
commit
8b221c26ab
@ -22,6 +22,7 @@
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "RimDeltaSummaryEnsemble.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryEnsemble.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
@ -93,6 +94,27 @@ std::pair<bool, std::vector<double>> RimDeltaSummaryCase::values( const RifEclip
|
||||
{
|
||||
if ( !resultAddress.isValid() ) return { false, {} };
|
||||
|
||||
if ( auto deltaEnsemble = firstAncestorOfType<RimDeltaSummaryEnsemble>() )
|
||||
{
|
||||
if ( deltaEnsemble->discardSummaryAddressOnlyPresentInOneCase() )
|
||||
{
|
||||
RifSummaryReaderInterface* reader1 = m_summaryCase1 ? m_summaryCase1->summaryReader() : nullptr;
|
||||
RifSummaryReaderInterface* reader2 = m_summaryCase2 ? m_summaryCase2->summaryReader() : nullptr;
|
||||
|
||||
if ( !reader1 || !reader2 ) return { false, {} };
|
||||
|
||||
if ( !reader1->hasAddress( resultAddress ) || !reader2->hasAddress( resultAddress ) )
|
||||
{
|
||||
QString txt = "Summary vector " + QString::fromStdString( resultAddress.toEclipseTextAddress() ) +
|
||||
" is only present in one of the source ensembles, no values are calculated for this vector.";
|
||||
|
||||
RiaLogging::warning( txt );
|
||||
|
||||
return { false, {} };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( needsCalculation( resultAddress ) )
|
||||
{
|
||||
calculate( resultAddress );
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiTreeSelectionEditor.h"
|
||||
|
||||
@ -73,6 +74,13 @@ RimDeltaSummaryEnsemble::RimDeltaSummaryEnsemble()
|
||||
m_caseCount.uiCapability()->setUiReadOnly( true );
|
||||
|
||||
CAF_PDM_InitField( &m_matchOnParameters, "MatchOnParameters", false, "Match On Parameters" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_matchOnParameters );
|
||||
|
||||
CAF_PDM_InitField( &m_discardAddressPresentInOneSourceCase,
|
||||
"DiscardAddressPresentInOneSourceCase",
|
||||
false,
|
||||
"Discard Vectors if Missing in One of the Source Ensembles" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_discardAddressPresentInOneSourceCase );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_useFixedTimeStep, "UseFixedTimeStep", "Use Fixed Time Step" );
|
||||
CAF_PDM_InitField( &m_fixedTimeStepIndex, "FixedTimeStepIndex", 0, "Time Step" );
|
||||
@ -195,6 +203,14 @@ void RimDeltaSummaryEnsemble::createDerivedEnsembleCases()
|
||||
deleteCasesNoInUse();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimDeltaSummaryEnsemble::discardSummaryAddressOnlyPresentInOneCase() const
|
||||
{
|
||||
return m_discardAddressPresentInOneSourceCase();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -290,7 +306,6 @@ void RimDeltaSummaryEnsemble::defineUiOrdering( QString uiConfigName, caf::PdmUi
|
||||
uiOrdering.add( &m_operator );
|
||||
uiOrdering.add( &m_ensemble2 );
|
||||
uiOrdering.add( &m_swapEnsemblesButton );
|
||||
uiOrdering.add( &m_matchOnParameters );
|
||||
|
||||
uiOrdering.add( &m_useFixedTimeStep );
|
||||
if ( m_useFixedTimeStep() != RimDeltaSummaryEnsemble::FixedTimeStepMode::FIXED_TIME_STEP_NONE )
|
||||
@ -298,6 +313,9 @@ void RimDeltaSummaryEnsemble::defineUiOrdering( QString uiConfigName, caf::PdmUi
|
||||
uiOrdering.add( &m_fixedTimeStepIndex );
|
||||
}
|
||||
|
||||
uiOrdering.add( &m_matchOnParameters );
|
||||
uiOrdering.add( &m_discardAddressPresentInOneSourceCase );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
|
||||
updateAutoName();
|
||||
|
@ -62,6 +62,8 @@ public:
|
||||
|
||||
void createDerivedEnsembleCases();
|
||||
|
||||
bool discardSummaryAddressOnlyPresentInOneCase() const;
|
||||
|
||||
private:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
@ -91,6 +93,7 @@ private:
|
||||
caf::PdmField<bool> m_swapEnsemblesButton;
|
||||
caf::PdmField<QString> m_caseCount;
|
||||
caf::PdmField<bool> m_matchOnParameters;
|
||||
caf::PdmField<bool> m_discardAddressPresentInOneSourceCase;
|
||||
|
||||
caf::PdmField<caf::AppEnum<FixedTimeStepMode>> m_useFixedTimeStep;
|
||||
caf::PdmField<int> m_fixedTimeStepIndex;
|
||||
|
Loading…
Reference in New Issue
Block a user