mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5621 Delta case : Improve name of delta case based on input cases
This commit is contained in:
parent
41fafb1eac
commit
b01d826acf
@ -216,17 +216,6 @@ void RimDerivedSummaryCase::calculate( const RifEclipseSummaryAddress& address )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RimDerivedSummaryCase::caseName() const
|
QString RimDerivedSummaryCase::caseName() const
|
||||||
{
|
{
|
||||||
if ( m_summaryCase1 && m_summaryCase2 )
|
|
||||||
{
|
|
||||||
auto case1Name = m_summaryCase1->displayCaseName();
|
|
||||||
auto case2Name = m_summaryCase2->displayCaseName();
|
|
||||||
|
|
||||||
if ( case1Name == case2Name )
|
|
||||||
return case1Name;
|
|
||||||
else
|
|
||||||
return QString( "%1/%2" ).arg( case1Name ).arg( case2Name );
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_shortName;
|
return m_shortName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,6 +280,33 @@ void RimDerivedSummaryCase::clearData( const RifEclipseSummaryAddress& address )
|
|||||||
m_dataCache.erase( address );
|
m_dataCache.erase( address );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimDerivedSummaryCase::updateNameFromInputCases()
|
||||||
|
{
|
||||||
|
QString case1Name = "None";
|
||||||
|
QString case2Name = "None";
|
||||||
|
|
||||||
|
if ( m_summaryCase1 )
|
||||||
|
{
|
||||||
|
case1Name = m_summaryCase1->displayCaseName();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m_summaryCase2 )
|
||||||
|
{
|
||||||
|
case2Name = m_summaryCase2->displayCaseName();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString operatorText;
|
||||||
|
if ( m_operator() == DerivedSummaryOperator::DERIVED_OPERATOR_SUB )
|
||||||
|
operatorText = "Delta";
|
||||||
|
else if ( m_operator() == DerivedSummaryOperator::DERIVED_OPERATOR_ADD )
|
||||||
|
operatorText = "Sum";
|
||||||
|
|
||||||
|
m_shortName = QString( "%1 (%2, %3)" ).arg( operatorText ).arg( case1Name ).arg( case2Name );
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -354,6 +370,8 @@ void RimDerivedSummaryCase::fieldChangedByUi( const caf::PdmFieldHandle* changed
|
|||||||
|
|
||||||
if ( reloadData )
|
if ( reloadData )
|
||||||
{
|
{
|
||||||
|
updateNameFromInputCases();
|
||||||
|
|
||||||
m_dataCache.clear();
|
m_dataCache.clear();
|
||||||
|
|
||||||
std::vector<caf::PdmObjectHandle*> referringObjects;
|
std::vector<caf::PdmObjectHandle*> referringObjects;
|
||||||
|
@ -75,6 +75,7 @@ private:
|
|||||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||||
|
|
||||||
void clearData( const RifEclipseSummaryAddress& address );
|
void clearData( const RifEclipseSummaryAddress& address );
|
||||||
|
void updateNameFromInputCases();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmPtrField<RimSummaryCase*> m_summaryCase1;
|
caf::PdmPtrField<RimSummaryCase*> m_summaryCase1;
|
||||||
|
Loading…
Reference in New Issue
Block a user