mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-14 09:22:13 -05:00
Janitor : Trim unit text for summary vectors
This commit is contained in:
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 "";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user