mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#538) Display correct unit in curve name
This commit is contained in:
parent
de14b93f6b
commit
a215e080cc
@ -263,7 +263,11 @@ QString RimWellLogFileCurve::createCurveName()
|
||||
RigWellLogFile* wellLogFile = logFileInfo ? logFileInfo->wellLogFile() : NULL;
|
||||
if (wellLogFile)
|
||||
{
|
||||
QString unitName = wellLogFile->wellLogChannelUnitString(m_wellLogChannnelName);
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
firstAnchestorOrThisOfType(wellLogPlot);
|
||||
CVF_ASSERT(wellLogPlot);
|
||||
|
||||
QString unitName = wellLogFile->wellLogChannelUnitString(m_wellLogChannnelName, wellLogPlot->depthUnit());
|
||||
if (!unitName.isEmpty())
|
||||
{
|
||||
txt += QString(" [%1]").arg(unitName);
|
||||
|
@ -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;
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
std::vector<double> depthValues() const;
|
||||
std::vector<double> values(const QString& name) const;
|
||||
|
||||
QString wellLogChannelUnitString(const QString& wellLogChannelName) const;
|
||||
QString wellLogChannelUnitString(const QString& wellLogChannelName, RimDefines::DepthUnitType displayDepthUnit) const;
|
||||
RimDefines::DepthUnitType depthUnit() const;
|
||||
|
||||
static bool exportToLasFile(const RimWellLogCurve* curve, const QString& fileName);
|
||||
|
Loading…
Reference in New Issue
Block a user