mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add data source for x-values
Default data source for x-values is RifEclipseSummaryAddress::timeAddress()
This commit is contained in:
parent
0cd6cdd67e
commit
471790eebd
@ -17,8 +17,10 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
|
||||
@ -29,6 +31,8 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition()
|
||||
: m_summaryCase( nullptr )
|
||||
, m_summaryCaseX( nullptr )
|
||||
, m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() )
|
||||
, m_ensemble( nullptr )
|
||||
, m_isEnsembleCurve( false )
|
||||
{
|
||||
@ -42,6 +46,8 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase*
|
||||
bool isEnsembleCurve )
|
||||
: m_summaryCase( summaryCase )
|
||||
, m_summaryAddress( summaryAddress )
|
||||
, m_summaryCaseX( nullptr )
|
||||
, m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() )
|
||||
, m_ensemble( nullptr )
|
||||
, m_isEnsembleCurve( isEnsembleCurve )
|
||||
{
|
||||
@ -53,6 +59,8 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase*
|
||||
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress )
|
||||
: m_summaryCase( nullptr )
|
||||
, m_summaryAddress( summaryAddress )
|
||||
, m_summaryCaseX( nullptr )
|
||||
, m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() )
|
||||
, m_ensemble( ensemble )
|
||||
, m_isEnsembleCurve( true )
|
||||
{
|
||||
@ -98,6 +106,71 @@ void RiaSummaryCurveDefinition::setSummaryAddress( const RifEclipseSummaryAddres
|
||||
m_summaryAddress = address;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveDefinition::setSummaryCaseX( RimSummaryCase* summaryCase )
|
||||
{
|
||||
m_summaryCaseX = summaryCase;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveDefinition::setSummaryAddressX( const RifEclipseSummaryAddress& summaryAddress )
|
||||
{
|
||||
m_summaryAddressX = summaryAddress;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCase* RiaSummaryCurveDefinition::summaryCaseX() const
|
||||
{
|
||||
return m_summaryCaseX;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RiaSummaryCurveDefinition::summaryAddressX() const
|
||||
{
|
||||
return m_summaryAddressX;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveDefinition::setIdentifierText( SummaryCategory category, const std::string& name )
|
||||
{
|
||||
if ( RifEclipseSummaryAddress::isDependentOnWellName( category ) )
|
||||
{
|
||||
m_summaryAddress.setWellName( name );
|
||||
m_summaryAddressX.setWellName( name );
|
||||
}
|
||||
|
||||
int id = RiaStdStringTools::toInt( name );
|
||||
|
||||
switch ( category )
|
||||
{
|
||||
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER:
|
||||
m_summaryAddress.setAquiferNumber( id );
|
||||
m_summaryAddressX.setAquiferNumber( id );
|
||||
break;
|
||||
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION:
|
||||
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION:
|
||||
m_summaryAddress.setRegion( id );
|
||||
m_summaryAddressX.setRegion( id );
|
||||
break;
|
||||
case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP:
|
||||
m_summaryAddress.setGroupName( name );
|
||||
m_summaryAddressX.setGroupName( name );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifEclipseSummaryAddressDefines.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
@ -40,12 +41,21 @@ public:
|
||||
explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& summaryAddress, bool isEnsembleCurve );
|
||||
explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress );
|
||||
|
||||
// Y Axis
|
||||
RimSummaryCase* summaryCase() const;
|
||||
const RifEclipseSummaryAddress& summaryAddress() const;
|
||||
RimSummaryCaseCollection* ensemble() const;
|
||||
bool isEnsembleCurve() const;
|
||||
void setSummaryAddress( const RifEclipseSummaryAddress& address );
|
||||
|
||||
// X Axis
|
||||
void setSummaryCaseX( RimSummaryCase* summaryCase );
|
||||
void setSummaryAddressX( const RifEclipseSummaryAddress& summaryAddress );
|
||||
RimSummaryCase* summaryCaseX() const;
|
||||
RifEclipseSummaryAddress summaryAddressX() const;
|
||||
|
||||
void setIdentifierText( SummaryCategory category, const std::string& name );
|
||||
|
||||
bool operator<( const RiaSummaryCurveDefinition& other ) const;
|
||||
|
||||
// TODO: Consider moving to a separate tools class
|
||||
@ -59,6 +69,8 @@ public:
|
||||
private:
|
||||
RimSummaryCase* m_summaryCase;
|
||||
RifEclipseSummaryAddress m_summaryAddress;
|
||||
RimSummaryCase* m_summaryCaseX;
|
||||
RifEclipseSummaryAddress m_summaryAddressX;
|
||||
RimSummaryCaseCollection* m_ensemble;
|
||||
bool m_isEnsembleCurve;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user