(#498) Picking and displaying well log channel unit from LAS files

This commit is contained in:
Pål Hagen
2015-09-21 10:10:25 +02:00
parent 22d033669d
commit 5e8a6d90cd
7 changed files with 62 additions and 1 deletions

View File

@@ -92,10 +92,14 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
RimWellLogFileCurve* curve = new RimWellLogFileCurve;
plotTrack->addCurve(curve);
RigWellLogFile* wellLogDataFile = wellLogFile->wellLogFile();
CVF_ASSERT(wellLogDataFile);
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromIndex(curveIdx);
curve->setColor(curveColor);
curve->setWellPath(wellPath);
curve->setWellLogChannelName(wellLog->name());
curve->setWellLogChannelUnit(wellLogDataFile->wellLogChannelUnit(wellLog->name()));
curve->updatePlotData();

View File

@@ -112,6 +112,14 @@ void RimWellLogFileCurve::setWellLogChannelName(const QString& name)
m_wellLogChannnelName = name;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFileCurve::setWellLogChannelUnit(const QString& name)
{
m_wellLogChannnelUnit = name;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -246,6 +254,11 @@ QString RimWellLogFileCurve::createCurveName()
txt += " : ";
txt += m_wellLogChannnelName;
if (!m_wellLogChannnelUnit().isEmpty())
{
txt += QString(" [%1]").arg(m_wellLogChannnelUnit);
}
return txt;
}

View File

@@ -43,6 +43,7 @@ public:
void setWellPath(RimWellPath* wellPath);
void setWellLogChannelName(const QString& name);
void setWellLogChannelUnit(const QString& name);
// Overrides from RimWellLogPlotCurve
virtual void updatePlotData();
@@ -60,6 +61,7 @@ protected:
protected:
caf::PdmPtrField<RimWellPath*> m_wellPath;
caf::PdmField<QString> m_wellLogChannnelName;
caf::PdmField<QString> m_wellLogChannnelUnit;
};

View File

@@ -172,3 +172,25 @@ QString RigWellLogFile::depthUnit() const
return unit;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RigWellLogFile::wellLogChannelUnit(const QString& wellLogChannelName) const
{
QString unit;
NRLib::LasWell* lasWell = dynamic_cast<NRLib::LasWell*>(m_wellLogFile);
if (lasWell)
{
unit = QString::fromStdString(lasWell->unitName(wellLogChannelName.toStdString()));
}
// Special handling of depth unit - we convert depth to meter
if (unit == depthUnit())
{
return "m";
}
return unit;
}

View File

@@ -49,6 +49,7 @@ public:
std::vector<double> values(const QString& name) const;
QString depthUnit() const;
QString wellLogChannelUnit(const QString& wellLogChannelName) const;
private:
void close();