Janitor : Trim unit text for summary vectors

This commit is contained in:
Magne Sjaastad committed 2022-01-06 15:49:20 +01:00
1 parent 9023b01cfa
commit db8209d23a
3 files changed
+23 -8

No files matched your search

@@ -302,8 +302,20 @@ RifSummaryReaderInterface* RifReaderEclipseSummary::currentSummaryReader() const
std::string RifReaderEclipseSummary::unitName( const RifEclipseSummaryAddress& resultAddress ) const
{
auto reader = currentSummaryReader();
if ( reader )
{
auto nativeName = resultAddress.quantityName();
auto stringToRemove = RifReaderEclipseSummary::differenceIdentifier();
if ( RiaStdStringTools::endsWith( nativeName, stringToRemove ) )
{
nativeName = nativeName.substr( 0, nativeName.size() - stringToRemove.size() );
}
if ( reader ) return reader->unitName( resultAddress );
RifEclipseSummaryAddress adr( resultAddress );
adr.setQuantityName( nativeName );
return reader->unitName( adr );
}
return "";
}