(#464) Set logarithmic scale if PERM is selected as single curve

This commit is contained in:
Magne Sjaastad 2015-12-09 11:32:46 +01:00
parent b80639436c
commit c67a413926
4 changed files with 40 additions and 2 deletions

View File

@ -276,6 +276,8 @@ void RimWellLogExtractionCurve::updatePlotData()
zoomAllOwnerTrackAndPlot();
setLogScaleFromSelectedResult();
if (m_ownerQwtTrack) m_ownerQwtTrack->replot();
}
}
@ -418,6 +420,26 @@ void RimWellLogExtractionCurve::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiT
uiTreeOrdering.setForgetRemainingFields(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::setLogScaleFromSelectedResult()
{
QString resVar = m_eclipseResultDefinition->resultVariable();
if (resVar.toUpper().contains("PERM"))
{
RimWellLogTrack* track = NULL;
this->firstAnchestorOrThisOfType(track);
if (track)
{
if (track->curveCount() == 1)
{
track->setLogarithmicScale(true);
}
}
}
}
//--------------------------------------------------------------------------------------------------
///

View File

@ -27,8 +27,8 @@
class RimCase;
class RimEclipseResultDefinition;
class RimGeoMechResultDefinition;
class RimWellPath;
class RimView;
class RimWellPath;
//==================================================================================================
///
@ -62,6 +62,10 @@ protected:
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
private:
void setLogScaleFromSelectedResult();
private:
caf::PdmPtrField<RimWellPath*> m_wellPath;
caf::PdmPtrField<RimCase*> m_case;
caf::PdmChildField<RimEclipseResultDefinition*> m_eclipseResultDefinition;
@ -75,4 +79,3 @@ protected:
caf::PdmField<bool> m_addDateToCurveName;
};

View File

@ -436,3 +436,14 @@ void RimWellLogTrack::computeAndSetXRangeMinForLogarithmicScale()
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setLogarithmicScale(bool enable)
{
m_isLogarithmicScaleEnabled = enable;
updateAxisScaleEngine();
computeAndSetXRangeMinForLogarithmicScale();
}

View File

@ -64,6 +64,8 @@ public:
RimWellLogCurve* curveDefinitionFromCurve(const QwtPlotCurve* curve) const;
void setLogarithmicScale(bool enable);
protected:
// Overridden PDM methods
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);