mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5129 Fix depth ranges when curve units don't match display units
This commit is contained in:
@@ -251,7 +251,7 @@ public:
|
||||
|
||||
double minDepth = 0.0;
|
||||
double maxDepth = 0.0;
|
||||
firstCurveData->calculateDepthRange( RiaDefines::MEASURED_DEPTH, &minDepth, &maxDepth );
|
||||
firstCurveData->calculateDepthRange( RiaDefines::MEASURED_DEPTH, firstCurveData->depthUnit(), &minDepth, &maxDepth );
|
||||
|
||||
lasFile->setStartDepth( minDepth );
|
||||
lasFile->setStopDepth( maxDepth );
|
||||
|
||||
@@ -326,6 +326,7 @@ void RigWellLogCurveData::splitIntervalAtEmptySpace( const std::vector<double>&
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigWellLogCurveData::calculateDepthRange( RiaDefines::DepthTypeEnum depthType,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
double* minimumDepth,
|
||||
double* maximumDepth ) const
|
||||
{
|
||||
@@ -334,9 +335,10 @@ bool RigWellLogCurveData::calculateDepthRange( RiaDefines::DepthTypeEnum depthTy
|
||||
double minValue = HUGE_VAL;
|
||||
double maxValue = -HUGE_VAL;
|
||||
|
||||
for ( size_t vIdx = 0; vIdx < depths( depthType ).size(); vIdx++ )
|
||||
std::vector<double> depthValues = depthPlotValues( depthType, depthUnit );
|
||||
for ( size_t vIdx = 0; vIdx < depthValues.size(); vIdx++ )
|
||||
{
|
||||
double value = depths( depthType )[vIdx];
|
||||
double value = depthValues[vIdx];
|
||||
|
||||
if ( value < minValue )
|
||||
{
|
||||
@@ -406,12 +408,13 @@ std::vector<double> RigWellLogCurveData::convertDepthValues( RiaDefines::DepthUn
|
||||
{
|
||||
CVF_ASSERT( destinationDepthUnit != m_depthUnit );
|
||||
|
||||
if ( destinationDepthUnit == RiaDefines::UNIT_METER )
|
||||
if ( destinationDepthUnit == RiaDefines::UNIT_METER && m_depthUnit == RiaDefines::UNIT_FEET )
|
||||
{
|
||||
return convertFromFeetToMeter( values );
|
||||
}
|
||||
else
|
||||
else if ( destinationDepthUnit == RiaDefines::UNIT_FEET && m_depthUnit == RiaDefines::UNIT_METER )
|
||||
{
|
||||
return convertFromMeterToFeet( values );
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,10 @@ public:
|
||||
|
||||
std::set<RiaDefines::DepthTypeEnum> availableDepthTypes() const;
|
||||
|
||||
bool calculateDepthRange( RiaDefines::DepthTypeEnum depthType, double* minMD, double* maxMD ) const;
|
||||
bool calculateDepthRange( RiaDefines::DepthTypeEnum depthType,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
double* minMD,
|
||||
double* maxMD ) const;
|
||||
|
||||
RiaDefines::DepthUnitType depthUnit() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user