(#507) Picking unit name from LAS file in curve's update method

This commit is contained in:
Pål Hagen 2015-09-22 15:12:33 +02:00
parent 0f1321bc73
commit 81b973a74c
3 changed files with 11 additions and 13 deletions

View File

@ -99,7 +99,6 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
curve->setColor(curveColor); curve->setColor(curveColor);
curve->setWellPath(wellPath); curve->setWellPath(wellPath);
curve->setWellLogChannelName(wellLog->name()); curve->setWellLogChannelName(wellLog->name());
curve->setWellLogChannelUnit(wellLogDataFile->wellLogChannelUnit(wellLog->name()));
curve->updatePlotData(); curve->updatePlotData();

View File

@ -87,6 +87,8 @@ void RimWellLogFileCurve::updatePlotData()
{ {
m_plotCurve->setSamples(NULL, NULL, 0); m_plotCurve->setSamples(NULL, NULL, 0);
} }
m_plotCurve->setTitle(createCurveName());
} }
} }
else else
@ -116,14 +118,6 @@ void RimWellLogFileCurve::setWellLogChannelName(const QString& name)
m_wellLogChannnelName = name; m_wellLogChannnelName = name;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFileCurve::setWellLogChannelUnit(const QString& name)
{
m_wellLogChannnelUnit = name;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -219,7 +213,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogFileCurve::calculateValueOptions(const c
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RimWellLogFileCurve::createCurveName() QString RimWellLogFileCurve::createCurveName()
{ {
if (m_wellPath()) if (m_wellPath)
{ {
QString txt; QString txt;
@ -227,9 +221,15 @@ QString RimWellLogFileCurve::createCurveName()
txt += " : "; txt += " : ";
txt += m_wellLogChannnelName; txt += m_wellLogChannnelName;
if (!m_wellLogChannnelUnit().isEmpty()) RimWellLogFile* logFileInfo = m_wellPath->m_wellLogFile;
RigWellLogFile* wellLogFile = logFileInfo ? logFileInfo->wellLogFile() : NULL;
if (wellLogFile)
{ {
txt += QString(" [%1]").arg(m_wellLogChannnelUnit); QString unitName = wellLogFile->wellLogChannelUnit(m_wellLogChannnelName);
if (!unitName.isEmpty())
{
txt += QString(" [%1]").arg(wellLogFile->wellLogChannelUnit(m_wellLogChannnelName));
}
} }
return txt; return txt;

View File

@ -43,7 +43,6 @@ public:
void setWellPath(RimWellPath* wellPath); void setWellPath(RimWellPath* wellPath);
void setWellLogChannelName(const QString& name); void setWellLogChannelName(const QString& name);
void setWellLogChannelUnit(const QString& name);
// Overrides from RimWellLogPlotCurve // Overrides from RimWellLogPlotCurve
virtual void updatePlotData(); virtual void updatePlotData();