mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #5210 from OPM/fix-show-plot-on-calculated-curves-5140
Fix show plot on calculated curves 5140
This commit is contained in:
commit
dd5ebe494a
@ -25,13 +25,17 @@
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
#include "RimSummaryCalculationVariable.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -44,6 +48,16 @@ RimSummaryPlotCollection* RiaSummaryTools::summaryPlotCollection()
|
||||
return project->mainPlotCollection()->summaryPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCrossPlotCollection* RiaSummaryTools::summaryCrossPlotCollection()
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
|
||||
return project->mainPlotCollection()->summaryCrossPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -58,8 +72,7 @@ RimSummaryCaseMainCollection* RiaSummaryTools::summaryCaseMainCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Update the summary curves referencing this curve, as the curve is identified by the name
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryTools::notifyCalculatedCurveNameHasChanged( const QString& previousCurveName,
|
||||
const QString& currentCurveName )
|
||||
void RiaSummaryTools::notifyCalculatedCurveNameHasChanged( int calculationId, const QString& currentCurveName )
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotColl = RiaSummaryTools::summaryPlotCollection();
|
||||
|
||||
@ -68,14 +81,11 @@ void RiaSummaryTools::notifyCalculatedCurveNameHasChanged( const QString& previo
|
||||
for ( RimSummaryCurve* curve : plot->summaryCurves() )
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
if ( adr.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
if ( adr.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED && adr.id() == calculationId )
|
||||
{
|
||||
if ( adr.quantityName() == previousCurveName.toStdString() )
|
||||
{
|
||||
RifEclipseSummaryAddress updatedAdr = RifEclipseSummaryAddress::calculatedAddress(
|
||||
currentCurveName.toStdString() );
|
||||
curve->setSummaryAddressYAndApplyInterpolation( updatedAdr );
|
||||
}
|
||||
RifEclipseSummaryAddress updatedAdr =
|
||||
RifEclipseSummaryAddress::calculatedAddress( currentCurveName.toStdString(), calculationId );
|
||||
curve->setSummaryAddressYAndApplyInterpolation( updatedAdr );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -153,3 +163,51 @@ bool RiaSummaryTools::isSummaryCrossPlot( const RimSummaryPlot* plot )
|
||||
{
|
||||
return dynamic_cast<const RimSummaryCrossPlot*>( plot );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaSummaryTools::hasAccumulatedData( const RifEclipseSummaryAddress& address )
|
||||
{
|
||||
if ( address.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
{
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
std::vector<RifEclipseSummaryAddress> addresses;
|
||||
|
||||
getSummaryCasesAndAddressesForCalculation( address.id(), cases, addresses );
|
||||
for ( const RifEclipseSummaryAddress& variableAddress : addresses )
|
||||
{
|
||||
if ( !variableAddress.hasAccumulatedData() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// All the variables are accumulated
|
||||
return true;
|
||||
}
|
||||
|
||||
return address.hasAccumulatedData();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( int id,
|
||||
std::vector<RimSummaryCase*>& cases,
|
||||
std::vector<RifEclipseSummaryAddress>& addresses )
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
RimSummaryCalculationCollection* calculationColl = proj->calculationCollection();
|
||||
if ( !calculationColl ) return;
|
||||
|
||||
RimSummaryCalculation* calculation = calculationColl->findCalculationById( id );
|
||||
if ( !calculation ) return;
|
||||
|
||||
for ( RimSummaryCalculationVariable* v : calculation->allVariables() )
|
||||
{
|
||||
cases.push_back( v->summaryCase() );
|
||||
addresses.push_back( v->summaryAddress()->address() );
|
||||
}
|
||||
}
|
||||
|
@ -18,11 +18,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryPlot;
|
||||
class RimSummaryCrossPlot;
|
||||
class RimSummaryCrossPlotCollection;
|
||||
class RimSummaryCaseMainCollection;
|
||||
class RimSummaryCase;
|
||||
|
||||
class RifEclipseSummaryAddress;
|
||||
|
||||
class QString;
|
||||
|
||||
@ -37,9 +42,11 @@ class PdmObject;
|
||||
class RiaSummaryTools
|
||||
{
|
||||
public:
|
||||
static RimSummaryPlotCollection* summaryPlotCollection();
|
||||
static RimSummaryCaseMainCollection* summaryCaseMainCollection();
|
||||
static void notifyCalculatedCurveNameHasChanged( const QString& previousCurveName, const QString& currentCurveName );
|
||||
static RimSummaryPlotCollection* summaryPlotCollection();
|
||||
static RimSummaryCrossPlotCollection* summaryCrossPlotCollection();
|
||||
static RimSummaryCaseMainCollection* summaryCaseMainCollection();
|
||||
|
||||
static void notifyCalculatedCurveNameHasChanged( int calculationId, const QString& currentCurveName );
|
||||
|
||||
static RimSummaryPlot* parentSummaryPlot( caf::PdmObject* object );
|
||||
static RimSummaryPlotCollection* parentSummaryPlotCollection( caf::PdmObject* object );
|
||||
@ -47,4 +54,9 @@ public:
|
||||
static RimSummaryCrossPlot* parentCrossPlot( caf::PdmObject* object );
|
||||
static RimSummaryCrossPlotCollection* parentCrossPlotCollection( caf::PdmObject* object );
|
||||
static bool isSummaryCrossPlot( const RimSummaryPlot* plot );
|
||||
|
||||
static bool hasAccumulatedData( const RifEclipseSummaryAddress& address );
|
||||
static void getSummaryCasesAndAddressesForCalculation( int id,
|
||||
std::vector<RimSummaryCase*>& cases,
|
||||
std::vector<RifEclipseSummaryAddress>& addresses );
|
||||
};
|
||||
|
@ -322,7 +322,8 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot*
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
false );
|
||||
false,
|
||||
-1 );
|
||||
|
||||
if ( !gridSummaryCase->summaryReader()->hasAddress( addr ) )
|
||||
{
|
||||
|
@ -18,15 +18,25 @@
|
||||
|
||||
#include "RicReplaceSummaryCaseFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
|
||||
#include "RimCalculatedSummaryCase.h"
|
||||
#include "RimFileSummaryCase.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
#include "RimSummaryCalculationVariable.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
@ -65,9 +75,89 @@ void RicReplaceSummaryCaseFeature::onActionTriggered( bool isChecked )
|
||||
summaryCase->createRftReaderInterface();
|
||||
RiaLogging::info( QString( "Replaced summary data for %1" ).arg( oldSummaryHeaderFilename ) );
|
||||
|
||||
RimSummaryCalculationCollection* calcColl = RiaApplication::instance()->project()->calculationCollection();
|
||||
|
||||
// Find and update all changed calculations
|
||||
std::set<int> ids;
|
||||
for ( RimSummaryCalculation* summaryCalculation : calcColl->calculations() )
|
||||
{
|
||||
bool needsUpdate = checkIfCalculationNeedsUpdate( summaryCalculation, summaryCase );
|
||||
if ( needsUpdate )
|
||||
{
|
||||
ids.insert( summaryCalculation->id() );
|
||||
summaryCalculation->parseExpression();
|
||||
summaryCalculation->calculate();
|
||||
summaryCalculation->updateDependentCurvesAndPlots();
|
||||
}
|
||||
}
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotColl = RiaSummaryTools::summaryPlotCollection();
|
||||
for ( RimSummaryPlot* summaryPlot : summaryPlotColl->summaryPlots )
|
||||
{
|
||||
// Update summary curves on calculated data
|
||||
std::vector<RimSummaryCurve*> summaryCurves = summaryPlot->summaryCurves();
|
||||
for ( RimSummaryCurve* summaryCurve : summaryCurves )
|
||||
{
|
||||
RifEclipseSummaryAddress summaryAddressY = summaryCurve->summaryAddressY();
|
||||
if ( summaryAddressY.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED &&
|
||||
ids.find( summaryAddressY.id() ) != ids.end() )
|
||||
{
|
||||
if ( calcColl )
|
||||
{
|
||||
RimSummaryCalculation* calculation = calcColl->findCalculationById( summaryAddressY.id() );
|
||||
QString description = calculation->description();
|
||||
|
||||
RifEclipseSummaryAddress updatedAdr =
|
||||
RifEclipseSummaryAddress::calculatedAddress( description.toStdString(), calculation->id() );
|
||||
summaryCurve->setSummaryAddressYAndApplyInterpolation( updatedAdr );
|
||||
summaryCurve->loadDataAndUpdate( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
summaryPlot->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
RimSummaryCrossPlotCollection* summaryCrossPlotColl = RiaSummaryTools::summaryCrossPlotCollection();
|
||||
for ( RimSummaryPlot* summaryPlot : summaryCrossPlotColl->summaryPlots() )
|
||||
{
|
||||
// Update summary curves on calculated data
|
||||
std::vector<RimSummaryCurve*> summaryCurves = summaryPlot->summaryCurves();
|
||||
for ( RimSummaryCurve* summaryCurve : summaryCurves )
|
||||
{
|
||||
RifEclipseSummaryAddress summaryAddressX = summaryCurve->summaryAddressX();
|
||||
if ( summaryAddressX.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED &&
|
||||
ids.find( summaryAddressX.id() ) != ids.end() )
|
||||
{
|
||||
if ( calcColl )
|
||||
{
|
||||
RimSummaryCalculation* calculation = calcColl->findCalculationById( summaryAddressX.id() );
|
||||
QString description = calculation->description();
|
||||
|
||||
RifEclipseSummaryAddress updatedAdr =
|
||||
RifEclipseSummaryAddress::calculatedAddress( description.toStdString(), calculation->id() );
|
||||
summaryCurve->setSummaryAddressX( updatedAdr );
|
||||
summaryCurve->loadDataAndUpdate( true );
|
||||
}
|
||||
}
|
||||
|
||||
RifEclipseSummaryAddress summaryAddressY = summaryCurve->summaryAddressY();
|
||||
if ( summaryAddressY.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED &&
|
||||
ids.find( summaryAddressY.id() ) != ids.end() )
|
||||
{
|
||||
if ( calcColl )
|
||||
{
|
||||
RimSummaryCalculation* calculation = calcColl->findCalculationById( summaryAddressX.id() );
|
||||
QString description = calculation->description();
|
||||
|
||||
RifEclipseSummaryAddress updatedAdr =
|
||||
RifEclipseSummaryAddress::calculatedAddress( description.toStdString(), calculation->id() );
|
||||
summaryCurve->setSummaryAddressYAndApplyInterpolation( updatedAdr );
|
||||
summaryCurve->loadDataAndUpdate( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
summaryPlot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
@ -80,3 +170,21 @@ void RicReplaceSummaryCaseFeature::setupActionLook( QAction* actionToSetup )
|
||||
actionToSetup->setText( "Replace" );
|
||||
actionToSetup->setIcon( QIcon( ":/ReplaceCase16x16.png" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicReplaceSummaryCaseFeature::checkIfCalculationNeedsUpdate( const RimSummaryCalculation* summaryCalculation,
|
||||
const RimFileSummaryCase* summaryCase )
|
||||
{
|
||||
std::vector<RimSummaryCalculationVariable*> variables = summaryCalculation->allVariables();
|
||||
for ( RimSummaryCalculationVariable* variable : variables )
|
||||
{
|
||||
if ( variable->summaryCase() == summaryCase )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -20,6 +20,9 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryCalculation;
|
||||
class RimFileSummaryCase;
|
||||
|
||||
class RicReplaceSummaryCaseFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
@ -28,4 +31,7 @@ protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
bool checkIfCalculationNeedsUpdate( const RimSummaryCalculation* summaryCalculation,
|
||||
const RimFileSummaryCase* summaryCase );
|
||||
};
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "RimCalculatedSummaryCurveReader.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
@ -64,10 +63,13 @@ void RicEditSummaryCurveCalculationFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RifEclipseSummaryAddress selectedAddress = selectedCurves.front()->summaryAddressY();
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RifCalculatedSummaryCurveReader* reader = dynamic_cast<RifCalculatedSummaryCurveReader*>(
|
||||
proj->calculationCollection->calculationSummaryCase()->summaryReader() );
|
||||
calculation = reader != nullptr ? reader->findCalculationByName( selectedAddress ) : nullptr;
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimSummaryCalculationCollection* calculationColl = proj->calculationCollection();
|
||||
|
||||
if ( calculationColl )
|
||||
{
|
||||
calculation = calculationColl->findCalculationById( selectedAddress.id() );
|
||||
}
|
||||
}
|
||||
|
||||
RicSummaryCurveCalculatorDialog* dialog = RicShowSummaryCurveCalculatorFeature::curveCalculatorDialog();
|
||||
|
@ -101,7 +101,7 @@ bool RicSummaryCurveCalculator::parseExpression() const
|
||||
QString currentCurveName = m_currentCalculation->description();
|
||||
if ( previousCurveName != currentCurveName )
|
||||
{
|
||||
RiaSummaryTools::notifyCalculatedCurveNameHasChanged( previousCurveName, currentCurveName );
|
||||
RiaSummaryTools::notifyCalculatedCurveNameHasChanged( m_currentCalculation()->id(), currentCurveName );
|
||||
}
|
||||
|
||||
m_currentCalculation()->updateDependentCurvesAndPlots();
|
||||
@ -121,8 +121,7 @@ void RicSummaryCurveCalculator::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
{
|
||||
m_newCalculation = false;
|
||||
|
||||
RimSummaryCalculation* rimCalc = calculationCollection()->addCalculation();
|
||||
m_currentCalculation = rimCalc;
|
||||
m_currentCalculation = calculationCollection()->addCalculation();
|
||||
|
||||
this->updateConnectedEditors();
|
||||
}
|
||||
@ -246,7 +245,7 @@ bool RicSummaryCurveCalculator::calculate() const
|
||||
QString currentCurveName = m_currentCalculation->description();
|
||||
if ( previousCurveName != currentCurveName )
|
||||
{
|
||||
RiaSummaryTools::notifyCalculatedCurveNameHasChanged( previousCurveName, currentCurveName );
|
||||
RiaSummaryTools::notifyCalculatedCurveNameHasChanged( m_currentCalculation()->id(), currentCurveName );
|
||||
}
|
||||
|
||||
if ( !m_currentCalculation()->calculate() )
|
||||
|
@ -41,6 +41,7 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory
|
||||
, m_cellK( -1 )
|
||||
, m_aquiferNumber( -1 )
|
||||
, m_isErrorResult( false )
|
||||
, m_id( -1 )
|
||||
{
|
||||
std::tuple<int32_t, int32_t, int32_t> ijkTuple;
|
||||
std::pair<int16_t, int16_t> reg2regPair;
|
||||
@ -98,6 +99,9 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory
|
||||
case SUMMARY_AQUIFER:
|
||||
m_aquiferNumber = RiaStdStringTools::toInt( identifiers[INPUT_AQUIFER_NUMBER] );
|
||||
break;
|
||||
case SUMMARY_CALCULATED:
|
||||
m_id = RiaStdStringTools::toInt( identifiers[INPUT_ID] );
|
||||
break;
|
||||
}
|
||||
|
||||
// Set quantity for all categories
|
||||
@ -252,7 +256,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromEclipseTextAddress( const
|
||||
break;
|
||||
|
||||
case SUMMARY_CALCULATED:
|
||||
address = calculatedAddress( quantityName );
|
||||
address = calculatedAddress( quantityName, RiaStdStringTools::toInt( names[0].toStdString() ) );
|
||||
break;
|
||||
|
||||
case SUMMARY_IMPORTED:
|
||||
@ -503,11 +507,12 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::blockLgrAddress( const std::s
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::calculatedAddress( const std::string& quantityName )
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::calculatedAddress( const std::string& quantityName, int id )
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_CALCULATED;
|
||||
addr.m_quantityName = quantityName;
|
||||
addr.m_id = id;
|
||||
return addr;
|
||||
}
|
||||
|
||||
@ -646,6 +651,11 @@ std::string RifEclipseSummaryAddress::uiText() const
|
||||
text += ":" + std::to_string( this->aquiferNumber() );
|
||||
}
|
||||
break;
|
||||
case SUMMARY_CALCULATED:
|
||||
{
|
||||
text += ":" + std::to_string( this->id() );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return text;
|
||||
@ -676,6 +686,8 @@ std::string RifEclipseSummaryAddress::uiText( RifEclipseSummaryAddress::SummaryI
|
||||
return std::to_string( aquiferNumber() );
|
||||
case INPUT_VECTOR_NAME:
|
||||
return quantityName();
|
||||
case INPUT_ID:
|
||||
return std::to_string( id() );
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@ -967,6 +979,11 @@ bool operator==( const RifEclipseSummaryAddress& first, const RifEclipseSummaryA
|
||||
if ( first.aquiferNumber() != second.aquiferNumber() ) return false;
|
||||
}
|
||||
break;
|
||||
case RifEclipseSummaryAddress::SUMMARY_CALCULATED:
|
||||
{
|
||||
if ( first.id() != second.id() ) return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ( first.isErrorResult() != second.isErrorResult() ) return false;
|
||||
return true;
|
||||
|
@ -71,6 +71,7 @@ public:
|
||||
INPUT_SEGMENT_NUMBER,
|
||||
INPUT_AQUIFER_NUMBER,
|
||||
INPUT_VECTOR_NAME,
|
||||
INPUT_ID
|
||||
};
|
||||
|
||||
public:
|
||||
@ -84,6 +85,7 @@ public:
|
||||
, m_cellK( -1 )
|
||||
, m_aquiferNumber( -1 )
|
||||
, m_isErrorResult( false )
|
||||
, m_id( -1 )
|
||||
{
|
||||
}
|
||||
|
||||
@ -99,7 +101,8 @@ public:
|
||||
int32_t cellJ,
|
||||
int32_t cellK,
|
||||
int16_t aquiferNumber,
|
||||
bool isErrorResult )
|
||||
bool isErrorResult,
|
||||
int32_t id )
|
||||
: m_variableCategory( category )
|
||||
, m_quantityName( quantityName )
|
||||
, m_regionNumber( regionNumber )
|
||||
@ -113,6 +116,7 @@ public:
|
||||
, m_cellK( cellK )
|
||||
, m_aquiferNumber( aquiferNumber )
|
||||
, m_isErrorResult( isErrorResult )
|
||||
, m_id( id )
|
||||
{
|
||||
}
|
||||
|
||||
@ -147,7 +151,7 @@ public:
|
||||
static RifEclipseSummaryAddress blockAddress( const std::string& quantityName, int i, int j, int k );
|
||||
static RifEclipseSummaryAddress
|
||||
blockLgrAddress( const std::string& quantityName, const std::string& lgrName, int i, int j, int k );
|
||||
static RifEclipseSummaryAddress calculatedAddress( const std::string& quantityName );
|
||||
static RifEclipseSummaryAddress calculatedAddress( const std::string& quantityName, int id );
|
||||
static RifEclipseSummaryAddress importedAddress( const std::string& quantityName );
|
||||
static RifEclipseSummaryAddress ensembleStatisticsAddress( const std::string& quantityName,
|
||||
const std::string& dataQuantityName );
|
||||
@ -207,6 +211,10 @@ public:
|
||||
{
|
||||
return m_aquiferNumber;
|
||||
}
|
||||
int id() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
std::string blockAsString() const;
|
||||
|
||||
const std::string ensembleStatisticsQuantityName() const;
|
||||
@ -252,6 +260,12 @@ public:
|
||||
{
|
||||
return m_isErrorResult;
|
||||
}
|
||||
|
||||
void setId( int id )
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
bool hasAccumulatedData() const;
|
||||
|
||||
private:
|
||||
@ -274,6 +288,7 @@ private:
|
||||
int16_t m_aquiferNumber;
|
||||
SummaryVarCategory m_variableCategory;
|
||||
bool m_isErrorResult;
|
||||
int32_t m_id;
|
||||
};
|
||||
|
||||
bool operator==( const RifEclipseSummaryAddress& first, const RifEclipseSummaryAddress& second );
|
||||
|
@ -183,6 +183,7 @@ RifEclipseSummaryAddress
|
||||
int cellK = -1;
|
||||
int aquiferNumber = -1;
|
||||
bool isErrorResult = false;
|
||||
int id = -1;
|
||||
|
||||
switch ( category )
|
||||
{
|
||||
@ -292,7 +293,8 @@ RifEclipseSummaryAddress
|
||||
cellJ,
|
||||
cellK,
|
||||
aquiferNumber,
|
||||
isErrorResult );
|
||||
isErrorResult,
|
||||
id );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -168,7 +168,8 @@ bool RifKeywordVectorUserData::parse( const QString& data, const QString& custom
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
false );
|
||||
false,
|
||||
-1 );
|
||||
|
||||
m_allResultAddresses.insert( addr );
|
||||
|
||||
|
@ -288,6 +288,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu
|
||||
int cellK( -1 );
|
||||
int aquiferNumber( -1 );
|
||||
bool isErrorResult( false );
|
||||
int id( -1 );
|
||||
|
||||
quantityName = stringFromPointer( ertSumVarNode.get_keyword() );
|
||||
|
||||
@ -414,7 +415,8 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu
|
||||
cellJ,
|
||||
cellK,
|
||||
aquiferNumber,
|
||||
isErrorResult );
|
||||
isErrorResult,
|
||||
id );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -164,6 +164,7 @@ RifEclipseSummaryAddress RifReaderObservedData::address( const QString&
|
||||
int cellK( -1 );
|
||||
int aquiferNumber( -1 );
|
||||
bool isErrorResult( false );
|
||||
int id( -1 );
|
||||
|
||||
switch ( summaryCategory )
|
||||
{
|
||||
@ -192,7 +193,8 @@ RifEclipseSummaryAddress RifReaderObservedData::address( const QString&
|
||||
cellJ,
|
||||
cellK,
|
||||
aquiferNumber,
|
||||
isErrorResult );
|
||||
isErrorResult,
|
||||
id );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -926,13 +926,25 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
|
||||
return;
|
||||
}
|
||||
|
||||
bool showLegendInQwt = m_showLegend();
|
||||
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType( summaryPlot );
|
||||
|
||||
bool showLegendInQwt = m_showLegend();
|
||||
if ( summaryPlot )
|
||||
{
|
||||
if ( summaryPlot->ensembleCurveSetCollection()->curveSets().empty() && summaryPlot->curveCount() == 1 )
|
||||
bool anyCalculated = false;
|
||||
for ( const auto c : summaryPlot->summaryCurves() )
|
||||
{
|
||||
if ( c->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
{
|
||||
// Never hide the legend for calculated curves, as the curve legend is used to
|
||||
// show some essential auto generated data
|
||||
anyCalculated = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !anyCalculated && summaryPlot->ensembleCurveSetCollection()->curveSets().empty() &&
|
||||
summaryPlot->curveCount() == 1 )
|
||||
{
|
||||
// Disable display of legend if the summary plot has only one single curve
|
||||
showLegendInQwt = false;
|
||||
|
@ -65,6 +65,7 @@
|
||||
#include "RimRftPlotCollection.h"
|
||||
#include "RimSaturationPressurePlotCollection.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
@ -106,6 +107,7 @@ RimProject::RimProject( void )
|
||||
, m_nextValidCaseGroupId( 0 )
|
||||
, m_nextValidViewId( 1 )
|
||||
, m_nextValidPlotId( 1 )
|
||||
, m_nextValidCalculationId( 1 )
|
||||
{
|
||||
CAF_PDM_InitObject( "Project", "", "", "" );
|
||||
|
||||
@ -243,10 +245,11 @@ void RimProject::close()
|
||||
plotWindowCurrentModelIndexPath = "";
|
||||
plotWindowTreeViewState = "";
|
||||
|
||||
m_nextValidCaseId = 0;
|
||||
m_nextValidCaseGroupId = 0;
|
||||
m_nextValidViewId = 1;
|
||||
m_nextValidPlotId = 1;
|
||||
m_nextValidCaseId = 0;
|
||||
m_nextValidCaseGroupId = 0;
|
||||
m_nextValidViewId = 1;
|
||||
m_nextValidPlotId = 1;
|
||||
m_nextValidCalculationId = 1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -539,6 +542,22 @@ void RimProject::assignPlotIdToPlotWindow( RimPlotWindow* plotWindow )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimProject::assignCalculationIdToCalculation( RimSummaryCalculation* calculation )
|
||||
{
|
||||
if ( calculation )
|
||||
{
|
||||
for ( RimSummaryCalculation* existingCalculation : calculationCollection->calculations() )
|
||||
{
|
||||
m_nextValidCalculationId = std::max( m_nextValidCalculationId, existingCalculation->id() + 1 );
|
||||
}
|
||||
|
||||
calculation->setId( m_nextValidCalculationId++ );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -39,6 +39,7 @@ class RimTextAnnotation;
|
||||
class RimReachCircleAnnotation;
|
||||
class RimPolylinesAnnotation;
|
||||
class RimSummaryCalculationCollection;
|
||||
class RimSummaryCalculation;
|
||||
class RimCase;
|
||||
class RimCommandObject;
|
||||
class RimCommandObject;
|
||||
@ -119,6 +120,7 @@ public:
|
||||
void assignIdToCaseGroup( RimIdenticalGridCaseGroup* caseGroup );
|
||||
void assignViewIdToView( Rim3dView* view );
|
||||
void assignPlotIdToPlotWindow( RimPlotWindow* plotWindow );
|
||||
void assignCalculationIdToCalculation( RimSummaryCalculation* calculation );
|
||||
|
||||
void allCases( std::vector<RimCase*>& cases ) const;
|
||||
|
||||
@ -207,6 +209,7 @@ private:
|
||||
int m_nextValidCaseGroupId;
|
||||
int m_nextValidViewId;
|
||||
int m_nextValidPlotId;
|
||||
int m_nextValidCalculationId;
|
||||
|
||||
caf::PdmChildArrayField<RimEclipseCase*> casesObsolete; // obsolete
|
||||
caf::PdmChildArrayField<RimIdenticalGridCaseGroup*> caseGroupsObsolete; // obsolete
|
||||
|
@ -64,6 +64,8 @@ RimSummaryCalculation::RimSummaryCalculation()
|
||||
CAF_PDM_InitFieldNoDefault( &m_calculatedValues, "CalculatedValues", "Calculated Values", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_timesteps, "TimeSteps", "Time Steps", "", "", "" );
|
||||
CAF_PDM_InitField( &m_id, "Id", -1, "Id", "", "", "" );
|
||||
m_id.uiCapability()->setUiHidden( true );
|
||||
|
||||
m_exprContextMenuMgr = std::unique_ptr<RiuExpressionContextMenuManager>( new RiuExpressionContextMenuManager() );
|
||||
|
||||
@ -86,6 +88,22 @@ QString RimSummaryCalculation::description() const
|
||||
return m_description;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCalculation::setId( int id )
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimSummaryCalculation::id() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -478,3 +496,15 @@ void RimSummaryCalculation::updateDependentCurvesAndPlots()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCalculationVariable*> RimSummaryCalculation::allVariables() const
|
||||
{
|
||||
std::vector<RimSummaryCalculationVariable*> outVariables;
|
||||
for ( RimSummaryCalculationVariable* v : m_variables )
|
||||
outVariables.push_back( v );
|
||||
|
||||
return outVariables;
|
||||
}
|
||||
|
@ -42,10 +42,15 @@ public:
|
||||
void setDescription( const QString& description );
|
||||
QString description() const;
|
||||
|
||||
void setId( int id );
|
||||
int id() const;
|
||||
|
||||
bool isDirty() const;
|
||||
|
||||
caf::PdmChildArrayFieldHandle* variables();
|
||||
|
||||
std::vector<RimSummaryCalculationVariable*> allVariables() const;
|
||||
|
||||
const std::vector<double>& values() const;
|
||||
const std::vector<time_t>& timeSteps() const;
|
||||
|
||||
@ -85,6 +90,7 @@ private:
|
||||
|
||||
caf::PdmField<std::vector<double>> m_calculatedValues;
|
||||
caf::PdmField<std::vector<time_t>> m_timesteps;
|
||||
caf::PdmField<int> m_id;
|
||||
|
||||
std::unique_ptr<RiuExpressionContextMenuManager> m_exprContextMenuMgr;
|
||||
|
||||
|
@ -18,7 +18,10 @@
|
||||
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCalculatedSummaryCase.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
|
||||
#include "cafPdmUiGroup.h"
|
||||
@ -46,8 +49,9 @@ RimSummaryCalculationCollection::RimSummaryCalculationCollection()
|
||||
RimSummaryCalculation* RimSummaryCalculationCollection::addCalculation()
|
||||
{
|
||||
RimSummaryCalculation* calculation = new RimSummaryCalculation;
|
||||
RiaApplication::instance()->project()->assignCalculationIdToCalculation( calculation );
|
||||
|
||||
QString varName = QString( "Calculation_%1" ).arg( m_calcuations.size() + 1 );
|
||||
QString varName = QString( "Calculation_%1" ).arg( calculation->id() );
|
||||
calculation->setDescription( varName );
|
||||
calculation->setExpression( varName + " := x + y" );
|
||||
calculation->parseExpression();
|
||||
@ -115,6 +119,22 @@ std::vector<RimSummaryCalculation*> RimSummaryCalculationCollection::calculation
|
||||
return m_calcuations.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCalculation* RimSummaryCalculationCollection::findCalculationById( int id ) const
|
||||
{
|
||||
for ( RimSummaryCalculation* calc : m_calcuations )
|
||||
{
|
||||
if ( calc->id() == id )
|
||||
{
|
||||
return calc;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
RimSummaryCalculation* addCalculationCopy( const RimSummaryCalculation* sourceCalculation );
|
||||
void deleteCalculation( RimSummaryCalculation* calculation );
|
||||
std::vector<RimSummaryCalculation*> calculations() const;
|
||||
RimSummaryCalculation* findCalculationById( int id ) const;
|
||||
|
||||
RimSummaryCase* calculationSummaryCase();
|
||||
|
||||
|
@ -85,7 +85,8 @@ void RifCalculatedSummaryCurveReader::buildMetaData()
|
||||
|
||||
for ( RimSummaryCalculation* calc : m_calculationCollection->calculations() )
|
||||
{
|
||||
m_allResultAddresses.insert( RifEclipseSummaryAddress::calculatedAddress( calc->description().toStdString() ) );
|
||||
m_allResultAddresses.insert(
|
||||
RifEclipseSummaryAddress::calculatedAddress( calc->description().toStdString(), calc->id() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,15 +98,7 @@ RimSummaryCalculation*
|
||||
{
|
||||
if ( m_calculationCollection && resultAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
{
|
||||
QString calculatedName = QString::fromStdString( resultAddress.quantityName() );
|
||||
|
||||
for ( RimSummaryCalculation* calc : m_calculationCollection->calculations() )
|
||||
{
|
||||
if ( calc->description() == calculatedName )
|
||||
{
|
||||
return calc;
|
||||
}
|
||||
}
|
||||
return m_calculationCollection->findCalculationById( resultAddress.id() );
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
@ -41,10 +41,11 @@ public:
|
||||
|
||||
void buildMetaData();
|
||||
|
||||
RimSummaryCalculation* findCalculationByName( const RifEclipseSummaryAddress& resultAddress ) const;
|
||||
|
||||
RiaEclipseUnitTools::UnitSystem unitSystem() const override;
|
||||
|
||||
private:
|
||||
RimSummaryCalculation* findCalculationByName( const RifEclipseSummaryAddress& resultAddress ) const;
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimSummaryCalculationCollection> m_calculationCollection;
|
||||
};
|
||||
|
@ -20,7 +20,9 @@
|
||||
|
||||
#include "RifEnsembleStatisticsReader.h"
|
||||
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RiaTimeHistoryCurveResampler.h"
|
||||
|
||||
#include "RigStatisticsMath.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
@ -158,7 +160,7 @@ void RimEnsembleStatisticsCase::calculate( const std::vector<RimSummaryCase*> su
|
||||
|
||||
RiaTimeHistoryCurveResampler resampler;
|
||||
resampler.setCurveData( values, timeSteps );
|
||||
if ( inputAddress.hasAccumulatedData() )
|
||||
if ( RiaSummaryTools::hasAccumulatedData( inputAddress ) )
|
||||
resampler.resampleAndComputePeriodEndValues( DateTimePeriod::DAY );
|
||||
else
|
||||
resampler.resampleAndComputeWeightedMeanValues( DateTimePeriod::DAY );
|
||||
|
@ -65,6 +65,7 @@ RimSummaryAddress::RimSummaryAddress()
|
||||
CAF_PDM_InitFieldNoDefault( &m_cellK, "SummaryCellK", "K", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_aquiferNumber, "SummaryAquifer", "Aquifer", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_isErrorResult, "IsErrorResult", "Is Error Result", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_calculationId, "CalculationId", "Calculation Id", "", "", "" );
|
||||
|
||||
m_category = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
m_regionNumber = -1;
|
||||
@ -75,6 +76,7 @@ RimSummaryAddress::RimSummaryAddress()
|
||||
m_cellK = -1;
|
||||
m_aquiferNumber = -1;
|
||||
m_isErrorResult = false;
|
||||
m_calculationId = -1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -98,9 +100,10 @@ void RimSummaryAddress::setAddress( const RifEclipseSummaryAddress& addr )
|
||||
m_aquiferNumber = addr.aquiferNumber();
|
||||
m_isErrorResult = addr.isErrorResult();
|
||||
|
||||
m_cellI = addr.cellI();
|
||||
m_cellJ = addr.cellJ();
|
||||
m_cellK = addr.cellK();
|
||||
m_cellI = addr.cellI();
|
||||
m_cellJ = addr.cellJ();
|
||||
m_cellK = addr.cellK();
|
||||
m_calculationId = addr.id();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -120,5 +123,6 @@ RifEclipseSummaryAddress RimSummaryAddress::address()
|
||||
m_cellJ(),
|
||||
m_cellK(),
|
||||
m_aquiferNumber,
|
||||
m_isErrorResult );
|
||||
m_isErrorResult,
|
||||
m_calculationId );
|
||||
}
|
||||
|
@ -62,4 +62,5 @@ private:
|
||||
caf::PdmField<int> m_cellK;
|
||||
caf::PdmField<int> m_aquiferNumber;
|
||||
caf::PdmField<bool> m_isErrorResult;
|
||||
caf::PdmField<int> m_calculationId;
|
||||
};
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaStatisticsTools.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
|
||||
@ -1125,7 +1126,7 @@ void RimSummaryCurve::calculateCurveInterpolationFromAddress()
|
||||
if ( m_yValuesSummaryAddress() )
|
||||
{
|
||||
auto address = m_yValuesSummaryAddress()->address();
|
||||
if ( address.hasAccumulatedData() )
|
||||
if ( RiaSummaryTools::hasAccumulatedData( address ) )
|
||||
{
|
||||
m_curveInterpolation = RiuQwtPlotCurve::INTERPOLATION_POINT_TO_POINT;
|
||||
}
|
||||
|
@ -18,11 +18,15 @@
|
||||
|
||||
#include "RimSummaryCurveAutoName.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaStatisticsTools.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
@ -197,6 +201,18 @@ QString RimSummaryCurveAutoName::buildCurveName( const RifEclipseSummaryAddress&
|
||||
QString::fromStdString( summaryAddress.quantityName() ) )
|
||||
.toStdString();
|
||||
}
|
||||
else if ( summaryAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
{
|
||||
// Need to add case name for calculated summary
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimSummaryCalculationCollection* calcColl = proj->calculationCollection();
|
||||
|
||||
RimSummaryCalculation* calculation = calcColl->findCalculationById( summaryAddress.id() );
|
||||
if ( calculation )
|
||||
{
|
||||
text = calculation->description().toStdString();
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_unit && !unitText.empty() )
|
||||
{
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RiaFieldHandleTools.h"
|
||||
#include "RiaSummaryCurveAnalyzer.h"
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
#include "RiaSummaryTools.h"
|
||||
#include "RiaTimeHistoryCurveResampler.h"
|
||||
|
||||
#include "SummaryPlotCommands/RicSummaryCurveCreator.h"
|
||||
@ -1779,16 +1780,25 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na
|
||||
{
|
||||
for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() )
|
||||
{
|
||||
addresses.push_back( curve->summaryAddressY() );
|
||||
sumCases.push_back( curve->summaryCaseY() );
|
||||
|
||||
if ( curve->summaryCaseX() )
|
||||
if ( curve->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
{
|
||||
sumCases.push_back( curve->summaryCaseX() );
|
||||
RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( curve->summaryAddressY().id(),
|
||||
sumCases,
|
||||
addresses );
|
||||
}
|
||||
else
|
||||
{
|
||||
addresses.push_back( curve->summaryAddressY() );
|
||||
sumCases.push_back( curve->summaryCaseY() );
|
||||
|
||||
if ( curve->summaryAddressX().category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
||||
if ( curve->summaryCaseX() )
|
||||
{
|
||||
addresses.push_back( curve->summaryAddressX() );
|
||||
sumCases.push_back( curve->summaryCaseX() );
|
||||
|
||||
if ( curve->summaryAddressX().category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
||||
{
|
||||
addresses.push_back( curve->summaryAddressX() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2207,7 +2217,8 @@ void prepareCaseCurvesForExport( DateTimePeriod period,
|
||||
{
|
||||
resampler.setCurveData( curveDataItem.values, caseTimeSteps );
|
||||
|
||||
if ( curveDataItem.address.hasAccumulatedData() || algorithm == ResampleAlgorithm::PERIOD_END )
|
||||
if ( RiaSummaryTools::hasAccumulatedData( curveDataItem.address ) ||
|
||||
algorithm == ResampleAlgorithm::PERIOD_END )
|
||||
{
|
||||
resampler.resampleAndComputePeriodEndValues( period );
|
||||
}
|
||||
|
@ -569,7 +569,7 @@ TEST( RifColumnBasedRsmspecParserTest, TestTableValues )
|
||||
userData.parse( data );
|
||||
|
||||
RifEclipseSummaryAddress
|
||||
adr( RifEclipseSummaryAddress::SUMMARY_WELL, "WOPR", -1, -1, "", "P-15P", -1, "", -1, -1, -1, -1, false );
|
||||
adr( RifEclipseSummaryAddress::SUMMARY_WELL, "WOPR", -1, -1, "", "P-15P", -1, "", -1, -1, -1, -1, false, -1 );
|
||||
|
||||
QDateTime firstTimeStep = RiaQDateTimeTools::addDays( RiaQDateTimeTools::epoch(), 1.0 );
|
||||
auto timeSteps = userData.timeSteps( adr );
|
||||
|
@ -138,7 +138,8 @@ RiuSummaryCurveDefSelection::RiuSummaryCurveDefSelection()
|
||||
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK )},
|
||||
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
|
||||
{RifEclipseSummaryAddress::SUMMARY_CALCULATED,
|
||||
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
|
||||
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID )},
|
||||
{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
|
||||
{RifEclipseSummaryAddress::SUMMARY_IMPORTED,
|
||||
{{new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME )}}},
|
||||
} )
|
||||
@ -350,6 +351,13 @@ RiuSummaryCurveDefSelection::RiuSummaryCurveDefSelection()
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_CALCULATED][0]->pdmField(),
|
||||
"CalculatedVectorsId",
|
||||
"Calculated Vectors Id",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_CALCULATED][1]->pdmField(),
|
||||
"CalculatedVectors",
|
||||
"Calculated Vectors",
|
||||
"",
|
||||
@ -940,7 +948,7 @@ void RiuSummaryCurveDefSelection::defineUiOrdering( QString uiConfigName, caf::P
|
||||
}
|
||||
else if ( sumCategory == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
{
|
||||
summaryiesField = m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_CALCULATED][0]->pdmField();
|
||||
summaryiesField = m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_CALCULATED][1]->pdmField();
|
||||
}
|
||||
else if ( sumCategory == RifEclipseSummaryAddress::SUMMARY_IMPORTED )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user