mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7364 Extract method for appending string.
This commit is contained in:
parent
cf6680415f
commit
4bf0e8e493
@ -1170,23 +1170,23 @@ QString RimStimPlanFractureTemplate::generatePropertiesTable() const
|
|||||||
{
|
{
|
||||||
QString body;
|
QString body;
|
||||||
|
|
||||||
if ( formationDip() != HUGE_VAL )
|
|
||||||
{
|
|
||||||
body += QString( "Formation Dip: %1<br>" ).arg( formationDip() );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !m_stimPlanFractureDefinitionData.isNull() )
|
if ( !m_stimPlanFractureDefinitionData.isNull() )
|
||||||
{
|
{
|
||||||
if ( m_stimPlanFractureDefinitionData->topPerfMd() != HUGE_VAL )
|
appendTextIfValidValue( body, "Formation Dip", m_stimPlanFractureDefinitionData->formationDip() );
|
||||||
{
|
appendTextIfValidValue( body, "Top MD", m_stimPlanFractureDefinitionData->topPerfMd() );
|
||||||
body += QString( "Top MD: %1<br>" ).arg( m_stimPlanFractureDefinitionData->topPerfMd() );
|
appendTextIfValidValue( body, "Bottom MD", m_stimPlanFractureDefinitionData->bottomPerfMd() );
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_stimPlanFractureDefinitionData->bottomPerfMd() != HUGE_VAL )
|
|
||||||
{
|
|
||||||
body += QString( "Bottom MD: %1<br>" ).arg( m_stimPlanFractureDefinitionData->bottomPerfMd() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimStimPlanFractureTemplate::appendTextIfValidValue( QString& body, const QString& title, double value )
|
||||||
|
{
|
||||||
|
if ( value != HUGE_VAL )
|
||||||
|
{
|
||||||
|
body += QString( "%1: %2<br>" ).arg( title ).arg( value );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -134,6 +134,7 @@ private:
|
|||||||
double conversionFactorForBetaValues() const;
|
double conversionFactorForBetaValues() const;
|
||||||
|
|
||||||
QString generatePropertiesTable() const;
|
QString generatePropertiesTable() const;
|
||||||
|
static void appendTextIfValidValue( QString& body, const QString& title, double value );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_activeTimeStepIndex;
|
caf::PdmField<int> m_activeTimeStepIndex;
|
||||||
|
Loading…
Reference in New Issue
Block a user