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:
Magne Sjaastad
2024-11-12 15:55:10 +01:00
parent 7550b8702c
commit 8b221c26ab
3 changed files with 44 additions and 1 deletions

View File

@@ -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 );