mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6227 Filter out zero values in logarithmic plot.
This commit is contained in:
committed by
Magne Sjaastad
parent
55034759c5
commit
ad07b18781
@@ -32,6 +32,7 @@
|
||||
#include "RimStimPlanModel.h"
|
||||
#include "RimStimPlanModelCalculator.h"
|
||||
#include "RimStimPlanModelPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
@@ -158,6 +159,13 @@ void RimStimPlanModelCurve::performDataExtraction( bool* isUsingPseudoLength )
|
||||
bool performDataSmoothing = false;
|
||||
if ( !values.empty() && !measuredDepthValues.empty() && measuredDepthValues.size() == values.size() )
|
||||
{
|
||||
RimWellLogTrack* track = nullptr;
|
||||
firstAncestorOfType( track );
|
||||
if ( track && track->isLogarithmicScale() )
|
||||
{
|
||||
filterInvalidValuesForLogarithmicScale( values );
|
||||
}
|
||||
|
||||
this->setValuesWithMdAndTVD( values, measuredDepthValues, tvDepthValues, rkbDiff, depthUnit, !performDataSmoothing, xUnits );
|
||||
}
|
||||
}
|
||||
@@ -172,3 +180,17 @@ QString RimStimPlanModelCurve::createCurveAutoName()
|
||||
|
||||
return textWithLineFeed;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanModelCurve::filterInvalidValuesForLogarithmicScale( std::vector<double>& values )
|
||||
{
|
||||
for ( double& v : values )
|
||||
{
|
||||
if ( v <= 0.0 )
|
||||
{
|
||||
v = RiaDefines::zeroReplacementForLogarithmicPlot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ protected:
|
||||
|
||||
QString createCurveAutoName();
|
||||
|
||||
static void filterInvalidValuesForLogarithmicScale( std::vector<double>& values );
|
||||
|
||||
caf::PdmPtrField<RimStimPlanModel*> m_stimPlanModel;
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::CurveProperty>> m_curveProperty;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user