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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user