Skip to content

Commit

Permalink
(#507) Picking unit name from LAS file in curve's update method
Browse files Browse the repository at this point in the history
  • Loading branch information
palhagen committed Sep 22, 2015
1 parent 0f1321b commit 81b973a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
curve->setColor(curveColor);
curve->setWellPath(wellPath);
curve->setWellLogChannelName(wellLog->name());
curve->setWellLogChannelUnit(wellLogDataFile->wellLogChannelUnit(wellLog->name()));

curve->updatePlotData();

Expand Down
22 changes: 11 additions & 11 deletions ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ void RimWellLogFileCurve::updatePlotData()
{
m_plotCurve->setSamples(NULL, NULL, 0);
}

m_plotCurve->setTitle(createCurveName());
}
}
else
Expand Down Expand Up @@ -116,14 +118,6 @@ void RimWellLogFileCurve::setWellLogChannelName(const QString& name)
m_wellLogChannnelName = name;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFileCurve::setWellLogChannelUnit(const QString& name)
{
m_wellLogChannnelUnit = name;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -219,17 +213,23 @@ QList<caf::PdmOptionItemInfo> RimWellLogFileCurve::calculateValueOptions(const c
//--------------------------------------------------------------------------------------------------
QString RimWellLogFileCurve::createCurveName()
{
if (m_wellPath())
if (m_wellPath)
{
QString txt;

txt += m_wellPath()->name();
txt += " : ";
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;
Expand Down
1 change: 0 additions & 1 deletion ApplicationCode/ProjectDataModel/RimWellLogFileCurve.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class RimWellLogFileCurve : public RimWellLogPlotCurve

void setWellPath(RimWellPath* wellPath);
void setWellLogChannelName(const QString& name);
void setWellLogChannelUnit(const QString& name);

// Overrides from RimWellLogPlotCurve
virtual void updatePlotData();
Expand Down

0 comments on commit 81b973a

Please sign in to comment.