Add itemUiText method on RifEclipseSummaryAddress

This commit is contained in:
Jacob Støren 2020-02-25 15:56:08 +01:00
parent 2a4fd959e9
commit bec8afaf39
2 changed files with 31 additions and 13 deletions

View File

@ -583,72 +583,89 @@ std::string RifEclipseSummaryAddress::uiText() const
if ( m_isErrorResult ) text += "ERR:";
text += m_quantityName;
std::string itemText = itemUiText();
if ( !itemText.empty() )
{
text += ":" + itemText;
}
return text;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::string RifEclipseSummaryAddress::itemUiText() const
{
std::string text;
switch ( this->category() )
{
case SUMMARY_REGION:
{
text += ":" + std::to_string( this->regionNumber() );
text += std::to_string( this->regionNumber() );
}
break;
case SUMMARY_REGION_2_REGION:
{
text += ":" + formatUiTextRegionToRegion();
text += formatUiTextRegionToRegion();
}
break;
case SUMMARY_WELL_GROUP:
{
text += ":" + this->wellGroupName();
text += this->wellGroupName();
}
break;
case SUMMARY_WELL:
{
text += ":" + this->wellName();
text += this->wellName();
}
break;
case SUMMARY_WELL_COMPLETION:
{
text += ":" + this->wellName();
text += this->wellName();
text += ":" + blockAsString();
}
break;
case SUMMARY_WELL_LGR:
{
text += ":" + this->lgrName();
text += this->lgrName();
text += ":" + this->wellName();
}
break;
case SUMMARY_WELL_COMPLETION_LGR:
{
text += ":" + this->lgrName();
text += this->lgrName();
text += ":" + this->wellName();
text += ":" + blockAsString();
}
break;
case SUMMARY_WELL_SEGMENT:
{
text += ":" + this->wellName();
text += this->wellName();
text += ":" + std::to_string( this->wellSegmentNumber() );
}
break;
case SUMMARY_BLOCK:
{
text += ":" + blockAsString();
text += blockAsString();
}
break;
case SUMMARY_BLOCK_LGR:
{
text += ":" + this->lgrName();
text += this->lgrName();
text += ":" + blockAsString();
}
break;
case SUMMARY_AQUIFER:
{
text += ":" + std::to_string( this->aquiferNumber() );
text += std::to_string( this->aquiferNumber() );
}
break;
case SUMMARY_CALCULATED:
{
text += ":" + std::to_string( this->id() );
text += std::to_string( this->id() );
}
break;
}
@ -657,7 +674,7 @@ std::string RifEclipseSummaryAddress::uiText() const
}
//--------------------------------------------------------------------------------------------------
/// Returns the stringified value for the specified identifier type
/// Returns the stringified address component requested
//--------------------------------------------------------------------------------------------------
std::string
RifEclipseSummaryAddress::addressComponentUiText( RifEclipseSummaryAddress::SummaryIdentifierType identifierType ) const

View File

@ -183,6 +183,7 @@ public:
// Derived properties
std::string uiText() const;
std::string itemUiText() const;
std::string addressComponentUiText( RifEclipseSummaryAddress::SummaryIdentifierType itemTypeInput ) const;
bool isUiTextMatchingFilterText( const QString& filterString ) const;