(#538) Display correct unit in curve name

This commit is contained in:
Magne Sjaastad
2015-12-02 14:21:22 +01:00
parent de14b93f6b
commit a215e080cc
3 changed files with 18 additions and 5 deletions

View File

@@ -206,7 +206,7 @@ QString RigWellLogFile::depthUnitString() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RigWellLogFile::wellLogChannelUnitString(const QString& wellLogChannelName) const
QString RigWellLogFile::wellLogChannelUnitString(const QString& wellLogChannelName, RimDefines::DepthUnitType displayDepthUnit) const
{
QString unit;
@@ -216,10 +216,19 @@ QString RigWellLogFile::wellLogChannelUnitString(const QString& wellLogChannelNa
unit = QString::fromStdString(lasWell->unitName(wellLogChannelName.toStdString()));
}
// Special handling of depth unit - we convert depth to meter
if (unit == depthUnitString())
{
return "m";
if (displayDepthUnit != depthUnit())
{
if (displayDepthUnit == RimDefines::UNIT_METER)
{
return "M";
}
else if (displayDepthUnit == RimDefines::UNIT_FEET)
{
return "FT";
}
}
}
return unit;