mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5061 WAP: fix update of well allocation data when changing depth type
This commit is contained in:
parent
4d38c2ea39
commit
60b09d7bfd
@ -48,6 +48,16 @@ void caf::AppEnum<RiaDefines::DepthUnitType>::setUp()
|
||||
setDefault( RiaDefines::UNIT_METER );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::DepthTypeEnum>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::MEASURED_DEPTH, "MEASURED_DEPTH", "Measured Depth" );
|
||||
addItem( RiaDefines::TRUE_VERTICAL_DEPTH, "TRUE_VERTICAL_DEPTH", "True Vertical Depth (MSL)" );
|
||||
addItem( RiaDefines::PSEUDO_LENGTH, "PSEUDO_LENGTH", "Pseudo Length" );
|
||||
addItem( RiaDefines::CONNECTION_NUMBER, "CONNECTION_NUMBER", "Connection Number" );
|
||||
setDefault( RiaDefines::MEASURED_DEPTH );
|
||||
}
|
||||
|
||||
template <>
|
||||
void caf::AppEnum<RiaDefines::PlotAxis>::setUp()
|
||||
{
|
||||
|
@ -137,6 +137,15 @@ enum DepthUnitType
|
||||
UNIT_NONE
|
||||
};
|
||||
|
||||
// Depth types used for well log plots
|
||||
enum DepthTypeEnum
|
||||
{
|
||||
MEASURED_DEPTH,
|
||||
TRUE_VERTICAL_DEPTH,
|
||||
PSEUDO_LENGTH,
|
||||
CONNECTION_NUMBER
|
||||
};
|
||||
|
||||
// Defines relate to plotting
|
||||
enum PlotAxis
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ RimWellBoreStabilityPlot*
|
||||
plot->setPlotTitleVisible( true );
|
||||
plot->setLegendsVisible( true );
|
||||
plot->setLegendsHorizontal( true );
|
||||
plot->setDepthType( RimWellLogPlot::TRUE_VERTICAL_DEPTH );
|
||||
plot->setDepthType( RiaDefines::TRUE_VERTICAL_DEPTH );
|
||||
plot->setAutoScaleYEnabled( true );
|
||||
|
||||
RicNewWellLogPlotFeatureImpl::updateAfterCreation( plot );
|
||||
|
@ -99,7 +99,7 @@ RimWellAllocationPlot::RimWellAllocationPlot()
|
||||
m_accumulatedWellFlowPlot.uiCapability()->setUiHidden( true );
|
||||
m_accumulatedWellFlowPlot = new RimWellLogPlot;
|
||||
m_accumulatedWellFlowPlot->setDepthUnit( RiaDefines::UNIT_NONE );
|
||||
m_accumulatedWellFlowPlot->setDepthType( RimWellLogPlot::CONNECTION_NUMBER );
|
||||
m_accumulatedWellFlowPlot->setDepthType( RiaDefines::CONNECTION_NUMBER );
|
||||
m_accumulatedWellFlowPlot->setLegendsVisible( false );
|
||||
m_accumulatedWellFlowPlot->uiCapability()->setUiIconFromResourceString( ":/WellFlowPlot16x16.png" );
|
||||
|
||||
@ -124,7 +124,7 @@ RimWellAllocationPlot::RimWellAllocationPlot()
|
||||
|
||||
m_accumulatedWellFlowPlot->setAvailableDepthUnits( {} );
|
||||
m_accumulatedWellFlowPlot->setAvailableDepthTypes(
|
||||
{RimWellLogPlot::CONNECTION_NUMBER, RimWellLogPlot::TRUE_VERTICAL_DEPTH, RimWellLogPlot::PSEUDO_LENGTH} );
|
||||
{RiaDefines::CONNECTION_NUMBER, RiaDefines::TRUE_VERTICAL_DEPTH, RiaDefines::PSEUDO_LENGTH} );
|
||||
|
||||
m_accumulatedWellFlowPlot->setCommonDataSourceEnabled( false );
|
||||
|
||||
@ -264,7 +264,7 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
|
||||
auto depthType = accumulatedWellFlowPlot()->depthType();
|
||||
|
||||
if ( depthType == RimWellLogPlot::MEASURED_DEPTH ) return;
|
||||
if ( depthType == RiaDefines::MEASURED_DEPTH ) return;
|
||||
|
||||
// Create tracks and curves from the calculated data
|
||||
|
||||
@ -282,11 +282,11 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
|
||||
accumulatedWellFlowPlot()->addPlot( plotTrack );
|
||||
|
||||
const std::vector<double>& depthValues = depthType == RimWellLogPlot::CONNECTION_NUMBER
|
||||
const std::vector<double>& depthValues = depthType == RiaDefines::CONNECTION_NUMBER
|
||||
? wfCalculator->connectionNumbersFromTop( brIdx )
|
||||
: depthType == RimWellLogPlot::PSEUDO_LENGTH
|
||||
: depthType == RiaDefines::PSEUDO_LENGTH
|
||||
? wfCalculator->pseudoLengthFromTop( brIdx )
|
||||
: depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH
|
||||
: depthType == RiaDefines::TRUE_VERTICAL_DEPTH
|
||||
? wfCalculator->trueVerticalDepth( brIdx )
|
||||
: std::vector<double>();
|
||||
|
||||
@ -295,13 +295,13 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
for ( const QString& tracerName : tracerNames )
|
||||
{
|
||||
const std::vector<double>* accFlow = nullptr;
|
||||
if ( depthType == RimWellLogPlot::CONNECTION_NUMBER )
|
||||
if ( depthType == RiaDefines::CONNECTION_NUMBER )
|
||||
{
|
||||
accFlow = &( m_flowType == ACCUMULATED
|
||||
? wfCalculator->accumulatedTracerFlowPrConnection( tracerName, brIdx )
|
||||
: wfCalculator->tracerFlowPrConnection( tracerName, brIdx ) );
|
||||
}
|
||||
else if ( depthType == RimWellLogPlot::PSEUDO_LENGTH || depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
else if ( depthType == RiaDefines::PSEUDO_LENGTH || depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
accFlow = &( m_flowType == ACCUMULATED
|
||||
? wfCalculator->accumulatedTracerFlowPrPseudoLength( tracerName, brIdx )
|
||||
@ -310,7 +310,7 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
|
||||
if ( accFlow )
|
||||
{
|
||||
addStackedCurve( tracerName, depthValues, *accFlow, plotTrack );
|
||||
addStackedCurve( tracerName, depthType, depthValues, *accFlow, plotTrack );
|
||||
// TODO: THIs is the data to be plotted...
|
||||
}
|
||||
}
|
||||
@ -463,12 +463,13 @@ void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle( RimWellLogTrack* plotT
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellAllocationPlot::addStackedCurve( const QString& tracerName,
|
||||
RiaDefines::DepthTypeEnum depthType,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& accFlow,
|
||||
RimWellLogTrack* plotTrack )
|
||||
{
|
||||
RimWellFlowRateCurve* curve = new RimWellFlowRateCurve;
|
||||
curve->setFlowValuesPrDepthValue( tracerName, depthValues, accFlow );
|
||||
curve->setFlowValuesPrDepthValue( tracerName, depthType, depthValues, accFlow );
|
||||
|
||||
if ( m_flowDiagSolution )
|
||||
{
|
||||
|
@ -115,6 +115,7 @@ private:
|
||||
void updateWellFlowPlotXAxisTitle( RimWellLogTrack* plotTrack );
|
||||
|
||||
void addStackedCurve( const QString& tracerName,
|
||||
RiaDefines::DepthTypeEnum depthType,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& accFlow,
|
||||
RimWellLogTrack* plotTrack );
|
||||
|
@ -218,7 +218,8 @@ void RimWellFlowRateCurve::updateStackedPlotData()
|
||||
|
||||
bool isFirstTrack = ( wellLogTrack == wellLogPlot->plotByIndex( 0 ) );
|
||||
|
||||
RiaDefines::DepthUnitType displayUnit = RiaDefines::UNIT_NONE;
|
||||
RimWellLogPlot::DepthTypeEnum depthType = wellLogPlot->depthType();
|
||||
RiaDefines::DepthUnitType displayUnit = RiaDefines::UNIT_NONE;
|
||||
|
||||
std::vector<double> depthValues;
|
||||
std::vector<double> stackedValues;
|
||||
@ -236,7 +237,7 @@ void RimWellFlowRateCurve::updateStackedPlotData()
|
||||
stackedCurves = stackedCurveGroups[groupId()];
|
||||
}
|
||||
|
||||
std::vector<double> allDepthValues = curveData()->measuredDepths();
|
||||
std::vector<double> allDepthValues = curveData()->depths( depthType );
|
||||
std::vector<double> allStackedValues( allDepthValues.size() );
|
||||
|
||||
for ( RimWellFlowRateCurve* stCurve : stackedCurves )
|
||||
@ -256,9 +257,9 @@ void RimWellFlowRateCurve::updateStackedPlotData()
|
||||
}
|
||||
|
||||
RigWellLogCurveData tempCurveData;
|
||||
tempCurveData.setValuesAndMD( allStackedValues, allDepthValues, RiaDefines::UNIT_NONE, false );
|
||||
tempCurveData.setValuesAndDepths( allStackedValues, allDepthValues, depthType, RiaDefines::UNIT_NONE, false );
|
||||
|
||||
depthValues = tempCurveData.measuredDepthPlotValues( displayUnit );
|
||||
depthValues = tempCurveData.depthPlotValues( depthType, displayUnit );
|
||||
stackedValues = tempCurveData.xPlotValues();
|
||||
polyLineStartStopIndices = tempCurveData.polylineStartStopIndices();
|
||||
}
|
||||
@ -321,7 +322,7 @@ bool RimWellFlowRateCurve::isUsingConnectionNumberDepthType() const
|
||||
{
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
firstAncestorOrThisOfType( wellLogPlot );
|
||||
if ( wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::CONNECTION_NUMBER )
|
||||
if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::CONNECTION_NUMBER )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -344,10 +345,11 @@ RimWellAllocationPlot* RimWellFlowRateCurve::wellAllocationPlot() const
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellFlowRateCurve::setFlowValuesPrDepthValue( const QString& curveName,
|
||||
RiaDefines::DepthTypeEnum depthType,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& flowRates )
|
||||
{
|
||||
this->setValuesAndMD( flowRates, depthValues, RiaDefines::UNIT_NONE, false );
|
||||
this->setValuesAndDepths( flowRates, depthValues, depthType, RiaDefines::UNIT_NONE, false );
|
||||
|
||||
m_curveAutoName = curveName;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ public:
|
||||
~RimWellFlowRateCurve() override;
|
||||
|
||||
void setFlowValuesPrDepthValue( const QString& curveName,
|
||||
RiaDefines::DepthTypeEnum depthType,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& flowRates );
|
||||
void updateStackedPlotData();
|
||||
|
@ -139,7 +139,7 @@ RimWellPltPlot::RimWellPltPlot()
|
||||
m_doInitAfterLoad = false;
|
||||
m_isOnLoad = true;
|
||||
|
||||
setAvailableDepthTypes( {RimWellLogPlot::MEASURED_DEPTH} );
|
||||
setAvailableDepthTypes( {RiaDefines::MEASURED_DEPTH} );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -725,7 +725,7 @@ void RimWellPltPlot::addStackedCurve( const QString& curveName,
|
||||
bool doFillCurve )
|
||||
{
|
||||
RimWellFlowRateCurve* curve = new RimWellFlowRateCurve;
|
||||
curve->setFlowValuesPrDepthValue( curveName, depthValues, accFlow );
|
||||
curve->setFlowValuesPrDepthValue( curveName, depthType(), depthValues, accFlow );
|
||||
|
||||
curve->setColor( color );
|
||||
curve->setGroupId( curveGroupId );
|
||||
|
@ -88,7 +88,7 @@ RimWellRftPlot::RimWellRftPlot()
|
||||
m_wellLogPlot_OBSOLETE.uiCapability()->setUiHidden( true );
|
||||
m_wellLogPlot_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
|
||||
m_depthType = RimWellLogPlot::TRUE_VERTICAL_DEPTH;
|
||||
m_depthType = RiaDefines::TRUE_VERTICAL_DEPTH;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_wellPathNameOrSimWellName, "WellName", "Well Name", "", "", "" );
|
||||
CAF_PDM_InitField( &m_branchIndex, "BranchIndex", 0, "Branch Index", "", "", "" );
|
||||
@ -620,7 +620,7 @@ void RimWellRftPlot::updateCurvesInPlot( const std::set<RiaRftPltCurveDefinition
|
||||
}
|
||||
}
|
||||
|
||||
if ( depthType() == RimWellLogPlot::MEASURED_DEPTH )
|
||||
if ( depthType() == RiaDefines::MEASURED_DEPTH )
|
||||
{
|
||||
assignWellPathToExtractionCurves();
|
||||
}
|
||||
@ -1038,7 +1038,7 @@ void RimWellRftPlot::onLoadDataAndUpdate()
|
||||
updateMdiWindowVisibility();
|
||||
updateFormationsOnPlot();
|
||||
|
||||
if ( depthType() == RimWellLogPlot::MEASURED_DEPTH )
|
||||
if ( depthType() == RiaDefines::MEASURED_DEPTH )
|
||||
{
|
||||
assignWellPathToExtractionCurves();
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ void Rim3dWellLogRftCurve::curveValuesAndMds( std::vector<double>* values, std::
|
||||
|
||||
// These values are for a simulation well
|
||||
*values = curveData->xValues();
|
||||
*measuredDepthValues = curveData->measuredDepths();
|
||||
*measuredDepthValues = curveData->depths( RiaDefines::MEASURED_DEPTH );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -52,12 +52,8 @@ RimWellLogCurve::RimWellLogCurve()
|
||||
|
||||
m_curveData = new RigWellLogCurveData;
|
||||
|
||||
m_curveDataXRange = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||
m_curveDataXRange = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||
-std::numeric_limits<double>::infinity() );
|
||||
m_curveDataMDRange = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||
-std::numeric_limits<double>::infinity() );
|
||||
m_curveDataTVDRange = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||
-std::numeric_limits<double>::infinity() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -104,28 +100,19 @@ bool RimWellLogCurve::yValueRangeInData( double* minimumValue, double* maximumVa
|
||||
RimWellLogPlot* wellLogPlot = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted( wellLogPlot );
|
||||
|
||||
if ( wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
auto depthRangeIt = m_curveDataDepthRange.find( wellLogPlot->depthType() );
|
||||
if ( depthRangeIt == m_curveDataDepthRange.end() )
|
||||
{
|
||||
if ( m_curveDataTVDRange.first == -std::numeric_limits<double>::infinity() ||
|
||||
m_curveDataTVDRange.second == std::numeric_limits<double>::infinity() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
*minimumValue = m_curveDataTVDRange.first;
|
||||
*maximumValue = m_curveDataTVDRange.second;
|
||||
return false;
|
||||
}
|
||||
else // MD, Connection number and Pseudo length.
|
||||
|
||||
if ( depthRangeIt->second.first == -std::numeric_limits<double>::infinity() ||
|
||||
depthRangeIt->second.second == std::numeric_limits<double>::infinity() )
|
||||
{
|
||||
if ( m_curveDataMDRange.first == -std::numeric_limits<double>::infinity() ||
|
||||
m_curveDataMDRange.second == std::numeric_limits<double>::infinity() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
*minimumValue = m_curveDataMDRange.first;
|
||||
*maximumValue = m_curveDataMDRange.second;
|
||||
return false;
|
||||
}
|
||||
*minimumValue = depthRangeIt->second.first;
|
||||
*maximumValue = depthRangeIt->second.second;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -133,12 +120,25 @@ bool RimWellLogCurve::yValueRangeInData( double* minimumValue, double* maximumVa
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogCurve::setValuesAndMD( const std::vector<double>& xValues,
|
||||
const std::vector<double>& measuredDepths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve )
|
||||
void RimWellLogCurve::setValuesAndDepths( const std::vector<double>& xValues,
|
||||
const std::vector<double>& measuredDepths,
|
||||
RiaDefines::DepthTypeEnum depthType,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve )
|
||||
{
|
||||
m_curveData->setValuesAndMD( xValues, measuredDepths, depthUnit, isExtractionCurve );
|
||||
m_curveData->setValuesAndDepths( xValues, measuredDepths, depthType, depthUnit, isExtractionCurve );
|
||||
calculateCurveDataRanges();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogCurve::setValuesAndDepths( const std::vector<double>& xValues,
|
||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve )
|
||||
{
|
||||
m_curveData->setValuesAndDepths( xValues, depths, depthUnit, isExtractionCurve );
|
||||
calculateCurveDataRanges();
|
||||
}
|
||||
|
||||
@ -151,8 +151,9 @@ void RimWellLogCurve::setValuesWithTVD( const std::vector<double>& xValues,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve )
|
||||
{
|
||||
m_curveData->setValuesWithTVD( xValues, measuredDepths, tvDepths, depthUnit, isExtractionCurve );
|
||||
calculateCurveDataRanges();
|
||||
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> depths = {{RiaDefines::MEASURED_DEPTH, measuredDepths},
|
||||
{RiaDefines::TRUE_VERTICAL_DEPTH, tvDepths}};
|
||||
setValuesAndDepths( xValues, depths, depthUnit, isExtractionCurve );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -204,15 +205,18 @@ void RimWellLogCurve::setOverrideCurveDataXRange( double minimumValue, double ma
|
||||
void RimWellLogCurve::calculateCurveDataRanges()
|
||||
{
|
||||
// Invalidate range first
|
||||
m_curveDataXRange = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||
m_curveDataXRange = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||
-std::numeric_limits<double>::infinity() );
|
||||
m_curveDataMDRange = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||
-std::numeric_limits<double>::infinity() );
|
||||
m_curveDataTVDRange = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||
-std::numeric_limits<double>::infinity() );
|
||||
|
||||
m_curveData->calculateMDRange( &m_curveDataMDRange.first, &m_curveDataMDRange.second );
|
||||
m_curveData->calculateTVDRange( &m_curveDataTVDRange.first, &m_curveDataTVDRange.second );
|
||||
for ( auto depthType : m_curveData->availableDepthTypes() )
|
||||
{
|
||||
m_curveDataDepthRange[depthType] = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||
-std::numeric_limits<double>::infinity() );
|
||||
|
||||
m_curveData->calculateDepthRange( depthType,
|
||||
&m_curveDataDepthRange[depthType].first,
|
||||
&m_curveDataDepthRange[depthType].second );
|
||||
}
|
||||
|
||||
for ( double xValue : m_curveData->xValues() )
|
||||
{
|
||||
|
@ -42,16 +42,20 @@ public:
|
||||
bool xValueRangeInData( double* minimumValue, double* maximumValue ) const;
|
||||
bool yValueRangeInData( double* minimumValue, double* maximumValue ) const;
|
||||
|
||||
void setValuesAndMD( const std::vector<double>& xValues,
|
||||
const std::vector<double>& measuredDepths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve );
|
||||
|
||||
void setValuesAndDepths( const std::vector<double>& xValues,
|
||||
const std::vector<double>& depths,
|
||||
RiaDefines::DepthTypeEnum depthType,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve );
|
||||
void setValuesWithTVD( const std::vector<double>& xValues,
|
||||
const std::vector<double>& measuredDepths,
|
||||
const std::vector<double>& tvDepths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve );
|
||||
void setValuesAndDepths( const std::vector<double>& xValues,
|
||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve );
|
||||
|
||||
const RigWellLogCurveData* curveData() const;
|
||||
|
||||
@ -71,8 +75,7 @@ private:
|
||||
void calculateCurveDataRanges();
|
||||
|
||||
private:
|
||||
cvf::ref<RigWellLogCurveData> m_curveData;
|
||||
std::pair<double, double> m_curveDataXRange;
|
||||
std::pair<double, double> m_curveDataMDRange;
|
||||
std::pair<double, double> m_curveDataTVDRange;
|
||||
cvf::ref<RigWellLogCurveData> m_curveData;
|
||||
std::pair<double, double> m_curveDataXRange;
|
||||
std::map<RiaDefines::DepthTypeEnum, std::pair<double, double>> m_curveDataDepthRange;
|
||||
};
|
||||
|
@ -338,27 +338,16 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
bool isUsingPseudoLength = false;
|
||||
performDataExtraction( &isUsingPseudoLength );
|
||||
|
||||
RiaDefines::DepthUnitType displayUnit = RiaDefines::UNIT_METER;
|
||||
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
firstAncestorOrThisOfType( wellLogPlot );
|
||||
if ( !wellLogPlot ) return;
|
||||
|
||||
displayUnit = wellLogPlot->depthUnit();
|
||||
RiaDefines::DepthTypeEnum depthType = wellLogPlot->depthType();
|
||||
RiaDefines::DepthUnitType displayUnit = wellLogPlot->depthUnit();
|
||||
|
||||
if ( wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
m_qwtPlotCurve->setSamples( curveData()->xPlotValues().data(),
|
||||
curveData()->trueDepthPlotValues( displayUnit ).data(),
|
||||
static_cast<int>( curveData()->xPlotValues().size() ) );
|
||||
isUsingPseudoLength = false;
|
||||
}
|
||||
else if ( wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH )
|
||||
{
|
||||
m_qwtPlotCurve->setSamples( curveData()->xPlotValues().data(),
|
||||
curveData()->measuredDepthPlotValues( displayUnit ).data(),
|
||||
static_cast<int>( curveData()->xPlotValues().size() ) );
|
||||
}
|
||||
m_qwtPlotCurve->setSamples( curveData()->xPlotValues().data(),
|
||||
curveData()->depthPlotValues( depthType, displayUnit ).data(),
|
||||
static_cast<int>( curveData()->xPlotValues().size() ) );
|
||||
|
||||
m_qwtPlotCurve->setLineSegmentStartStopIndices( curveData()->polylineStartStopIndices() );
|
||||
|
||||
@ -523,7 +512,11 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength,
|
||||
{
|
||||
if ( !tvDepthValues.size() )
|
||||
{
|
||||
this->setValuesAndMD( values, measuredDepthValues, depthUnit, !performDataSmoothing );
|
||||
this->setValuesAndDepths( values,
|
||||
measuredDepthValues,
|
||||
RiaDefines::MEASURED_DEPTH,
|
||||
depthUnit,
|
||||
!performDataSmoothing );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -89,7 +89,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
std::vector<double> values = wellLogFile->values( m_wellLogChannnelName );
|
||||
std::vector<double> measuredDepthValues = wellLogFile->depthValues();
|
||||
|
||||
if ( wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
bool canUseTvd = false;
|
||||
if ( wellLogFile->hasTvdChannel() )
|
||||
@ -112,21 +112,21 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
RigWellPath* rigWellPath = m_wellPath->wellPathGeometry();
|
||||
if ( rigWellPath )
|
||||
{
|
||||
std::vector<double> trueVerticeldepthValues;
|
||||
std::vector<double> trueVerticalDepthValues;
|
||||
|
||||
for ( double measuredDepthValue : measuredDepthValues )
|
||||
{
|
||||
trueVerticeldepthValues.push_back(
|
||||
trueVerticalDepthValues.push_back(
|
||||
-rigWellPath->interpolatedPointAlongWellPath( measuredDepthValue ).z() );
|
||||
}
|
||||
if ( values.size() == trueVerticeldepthValues.size() &&
|
||||
if ( values.size() == trueVerticalDepthValues.size() &&
|
||||
values.size() == measuredDepthValues.size() )
|
||||
{
|
||||
this->setValuesWithTVD( values,
|
||||
measuredDepthValues,
|
||||
trueVerticeldepthValues,
|
||||
wellLogFile->depthUnit(),
|
||||
false );
|
||||
this->setValuesAndDepths( values,
|
||||
measuredDepthValues,
|
||||
RiaDefines::MEASURED_DEPTH,
|
||||
wellLogFile->depthUnit(),
|
||||
false );
|
||||
canUseTvd = true;
|
||||
}
|
||||
}
|
||||
@ -150,7 +150,11 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
{
|
||||
if ( values.size() == measuredDepthValues.size() )
|
||||
{
|
||||
this->setValuesAndMD( values, measuredDepthValues, wellLogFile->depthUnit(), false );
|
||||
this->setValuesAndDepths( values,
|
||||
measuredDepthValues,
|
||||
RiaDefines::MEASURED_DEPTH,
|
||||
wellLogFile->depthUnit(),
|
||||
false );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -166,16 +170,18 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
{
|
||||
displayUnit = wellLogPlot->depthUnit();
|
||||
}
|
||||
if ( wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH &&
|
||||
this->curveData()->availableDepthTypes().count( RiaDefines::TRUE_VERTICAL_DEPTH ) )
|
||||
{
|
||||
m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(),
|
||||
this->curveData()->trueDepthPlotValues( displayUnit ).data(),
|
||||
static_cast<int>( this->curveData()->xPlotValues().size() ) );
|
||||
m_qwtPlotCurve
|
||||
->setSamples( this->curveData()->xPlotValues().data(),
|
||||
this->curveData()->depthPlotValues( RiaDefines::TRUE_VERTICAL_DEPTH, displayUnit ).data(),
|
||||
static_cast<int>( this->curveData()->xPlotValues().size() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(),
|
||||
this->curveData()->measuredDepthPlotValues( displayUnit ).data(),
|
||||
this->curveData()->depthPlotValues( RiaDefines::MEASURED_DEPTH, displayUnit ).data(),
|
||||
static_cast<int>( this->curveData()->xPlotValues().size() ) );
|
||||
}
|
||||
m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
|
||||
|
@ -49,16 +49,6 @@
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void caf::AppEnum<RimWellLogPlot::DepthTypeEnum>::setUp()
|
||||
{
|
||||
addItem( RimWellLogPlot::MEASURED_DEPTH, "MEASURED_DEPTH", "Measured Depth" );
|
||||
addItem( RimWellLogPlot::TRUE_VERTICAL_DEPTH, "TRUE_VERTICAL_DEPTH", "True Vertical Depth (MSL)" );
|
||||
addItem( RimWellLogPlot::PSEUDO_LENGTH, "PSEUDO_LENGTH", "Pseudo Length" );
|
||||
addItem( RimWellLogPlot::CONNECTION_NUMBER, "CONNECTION_NUMBER", "Connection Number" );
|
||||
setDefault( RimWellLogPlot::MEASURED_DEPTH );
|
||||
}
|
||||
|
||||
template <>
|
||||
void RimWellLogPlot::AxisGridEnum::setUp()
|
||||
{
|
||||
@ -90,7 +80,7 @@ RimWellLogPlot::RimWellLogPlot()
|
||||
m_commonDataSource.xmlCapability()->disableIO();
|
||||
m_commonDataSource = new RimWellLogCurveCommonDataSource;
|
||||
|
||||
caf::AppEnum<RimWellLogPlot::DepthTypeEnum> depthType = MEASURED_DEPTH;
|
||||
caf::AppEnum<RimWellLogPlot::DepthTypeEnum> depthType = RiaDefines::MEASURED_DEPTH;
|
||||
CAF_PDM_InitField( &m_depthType, "DepthType", depthType, "Type", "", "", "" );
|
||||
|
||||
caf::AppEnum<RiaDefines::DepthUnitType> depthUnit = RiaDefines::UNIT_METER;
|
||||
@ -108,7 +98,7 @@ RimWellLogPlot::RimWellLogPlot()
|
||||
m_nameConfig = new RimWellLogPlotNameConfig();
|
||||
|
||||
m_availableDepthUnits = {RiaDefines::UNIT_METER, RiaDefines::UNIT_FEET};
|
||||
m_availableDepthTypes = {MEASURED_DEPTH, TRUE_VERTICAL_DEPTH};
|
||||
m_availableDepthTypes = {RiaDefines::MEASURED_DEPTH, RiaDefines::TRUE_VERTICAL_DEPTH};
|
||||
|
||||
m_minAvailableDepth = HUGE_VAL;
|
||||
m_maxAvailableDepth = -HUGE_VAL;
|
||||
@ -741,24 +731,24 @@ QString RimWellLogPlot::depthAxisTitle() const
|
||||
|
||||
switch ( m_depthType.value() )
|
||||
{
|
||||
case MEASURED_DEPTH:
|
||||
case RiaDefines::MEASURED_DEPTH:
|
||||
depthTitle = "MD";
|
||||
break;
|
||||
|
||||
case TRUE_VERTICAL_DEPTH:
|
||||
case RiaDefines::TRUE_VERTICAL_DEPTH:
|
||||
depthTitle = "TVDMSL";
|
||||
break;
|
||||
|
||||
case PSEUDO_LENGTH:
|
||||
case RiaDefines::PSEUDO_LENGTH:
|
||||
depthTitle = "PL";
|
||||
break;
|
||||
|
||||
case CONNECTION_NUMBER:
|
||||
case RiaDefines::CONNECTION_NUMBER:
|
||||
depthTitle = "Connection";
|
||||
break;
|
||||
}
|
||||
|
||||
if ( m_depthType() == CONNECTION_NUMBER ) return depthTitle;
|
||||
if ( m_depthType() == RiaDefines::CONNECTION_NUMBER ) return depthTitle;
|
||||
|
||||
if ( m_depthUnit == RiaDefines::UNIT_METER )
|
||||
{
|
||||
|
@ -48,14 +48,6 @@ class RimWellLogPlot : public RimGridPlotWindow, public RimNameConfigHolderInter
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum DepthTypeEnum
|
||||
{
|
||||
MEASURED_DEPTH,
|
||||
TRUE_VERTICAL_DEPTH,
|
||||
PSEUDO_LENGTH,
|
||||
CONNECTION_NUMBER
|
||||
};
|
||||
|
||||
enum AxisGridVisibility
|
||||
{
|
||||
AXIS_GRID_NONE = 0x00,
|
||||
@ -65,6 +57,7 @@ public:
|
||||
};
|
||||
|
||||
typedef caf::AppEnum<AxisGridVisibility> AxisGridEnum;
|
||||
using DepthTypeEnum = RiaDefines::DepthTypeEnum;
|
||||
|
||||
public:
|
||||
RimWellLogPlot();
|
||||
@ -106,7 +99,7 @@ public:
|
||||
void setCommonDataSourceEnabled( bool enable );
|
||||
|
||||
void setAvailableDepthUnits( const std::set<RiaDefines::DepthUnitType>& depthUnits );
|
||||
void setAvailableDepthTypes( const std::set<RimWellLogPlot::DepthTypeEnum>& depthTypes );
|
||||
void setAvailableDepthTypes( const std::set<DepthTypeEnum>& depthTypes );
|
||||
|
||||
void onPlotAdditionOrRemoval() override;
|
||||
|
||||
@ -146,8 +139,8 @@ protected:
|
||||
|
||||
caf::PdmChildField<RimWellLogPlotNameConfig*> m_nameConfig;
|
||||
|
||||
std::set<RiaDefines::DepthUnitType> m_availableDepthUnits;
|
||||
std::set<RimWellLogPlot::DepthTypeEnum> m_availableDepthTypes;
|
||||
std::set<RiaDefines::DepthUnitType> m_availableDepthUnits;
|
||||
std::set<DepthTypeEnum> m_availableDepthTypes;
|
||||
|
||||
double m_minAvailableDepth;
|
||||
double m_maxAvailableDepth;
|
||||
|
@ -445,12 +445,13 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
displayUnit = wellLogPlot->depthUnit();
|
||||
}
|
||||
|
||||
if ( wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH )
|
||||
if ( wellLogPlot->depthType() == RiaDefines::MEASURED_DEPTH )
|
||||
{
|
||||
m_qwtPlotCurve->showErrorBars( showErrorBarsInObservedData );
|
||||
m_qwtPlotCurve->setPerPointLabels( perPointLabels );
|
||||
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( this->curveData()->xPlotValues(),
|
||||
this->curveData()->measuredDepthPlotValues( displayUnit ),
|
||||
this->curveData()->depthPlotValues( RiaDefines::MEASURED_DEPTH,
|
||||
displayUnit ),
|
||||
errors,
|
||||
false,
|
||||
RiuQwtPlotCurve::ERROR_ALONG_X_AXIS );
|
||||
@ -485,7 +486,8 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
m_qwtPlotCurve->showErrorBars( showErrorBarsInObservedData );
|
||||
m_qwtPlotCurve->setPerPointLabels( perPointLabels );
|
||||
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( this->curveData()->xPlotValues(),
|
||||
this->curveData()->trueDepthPlotValues( displayUnit ),
|
||||
this->curveData()->depthPlotValues( RiaDefines::TRUE_VERTICAL_DEPTH,
|
||||
displayUnit ),
|
||||
errors,
|
||||
false,
|
||||
RiuQwtPlotCurve::ERROR_ALONG_X_AXIS );
|
||||
|
@ -781,14 +781,7 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
|
||||
|
||||
if ( curveNames.size() == 1 )
|
||||
{
|
||||
if ( depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
curveDepths = curveData->trueDepthPlotValues( depthUnit );
|
||||
}
|
||||
else
|
||||
{
|
||||
curveDepths = curveData->measuredDepthPlotValues( depthUnit );
|
||||
}
|
||||
curveDepths = curveData->depthPlotValues( depthType, depthUnit );
|
||||
}
|
||||
|
||||
std::vector<double> xPlotValues = curveData->xPlotValues();
|
||||
@ -809,13 +802,13 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
|
||||
{
|
||||
if ( i == 0 )
|
||||
{
|
||||
if ( depthType == RimWellLogPlot::CONNECTION_NUMBER )
|
||||
if ( depthType == RiaDefines::CONNECTION_NUMBER )
|
||||
out += "Connection";
|
||||
else if ( depthType == RimWellLogPlot::MEASURED_DEPTH )
|
||||
else if ( depthType == RiaDefines::MEASURED_DEPTH )
|
||||
out += "MD ";
|
||||
else if ( depthType == RimWellLogPlot::PSEUDO_LENGTH )
|
||||
else if ( depthType == RiaDefines::PSEUDO_LENGTH )
|
||||
out += "PL ";
|
||||
else if ( depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
|
||||
out += "TVD ";
|
||||
for ( QString name : curveNames )
|
||||
out += " \t" + name;
|
||||
@ -1971,11 +1964,11 @@ void RimWellLogTrack::findRegionNamesToPlot( const CurveSamplingPointData&
|
||||
|
||||
std::vector<double> depthVector;
|
||||
|
||||
if ( depthType == RimWellLogPlot::MEASURED_DEPTH || depthType == RimWellLogPlot::PSEUDO_LENGTH )
|
||||
if ( depthType == RiaDefines::MEASURED_DEPTH || depthType == RiaDefines::PSEUDO_LENGTH )
|
||||
{
|
||||
depthVector = curveData.md;
|
||||
}
|
||||
else if ( depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
depthVector = curveData.tvd;
|
||||
}
|
||||
@ -2171,8 +2164,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
|
||||
{
|
||||
if ( m_formationWellPathForSourceWellPath == nullptr ) return;
|
||||
|
||||
if ( !( plot->depthType() == RimWellLogPlot::MEASURED_DEPTH ||
|
||||
plot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH ) )
|
||||
if ( !( plot->depthType() == RiaDefines::MEASURED_DEPTH || plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -202,26 +202,32 @@ public:
|
||||
|
||||
if ( firstCurveData->depthUnit() == RiaDefines::UNIT_METER )
|
||||
{
|
||||
lasFile->AddLog( "DEPTH", "M", "Depth in meters", firstCurveData->measuredDepths() );
|
||||
lasFile->AddLog( "DEPTH", "M", "Depth in meters", firstCurveData->depths( RiaDefines::MEASURED_DEPTH ) );
|
||||
}
|
||||
else if ( firstCurveData->depthUnit() == RiaDefines::UNIT_FEET )
|
||||
{
|
||||
lasFile->AddLog( "DEPTH", "FT", "Depth in feet", firstCurveData->measuredDepths() );
|
||||
lasFile->AddLog( "DEPTH", "FT", "Depth in feet", firstCurveData->depths( RiaDefines::MEASURED_DEPTH ) );
|
||||
}
|
||||
else if ( firstCurveData->depthUnit() == RiaDefines::UNIT_NONE )
|
||||
{
|
||||
CVF_ASSERT( false );
|
||||
lasFile->AddLog( "DEPTH", "", "Depth in Connection number", firstCurveData->measuredDepths() );
|
||||
lasFile->AddLog( "DEPTH",
|
||||
"",
|
||||
"Depth in Connection number",
|
||||
firstCurveData->depths( RiaDefines::MEASURED_DEPTH ) );
|
||||
}
|
||||
|
||||
if ( firstCurveData->tvDepths().size() )
|
||||
if ( firstCurveData->depths( RiaDefines::TRUE_VERTICAL_DEPTH ).size() )
|
||||
{
|
||||
lasFile->AddLog( "TVDMSL", "M", "True vertical depth in meters", firstCurveData->tvDepths() );
|
||||
lasFile->AddLog( "TVDMSL",
|
||||
"M",
|
||||
"True vertical depth in meters",
|
||||
firstCurveData->depths( RiaDefines::TRUE_VERTICAL_DEPTH ) );
|
||||
|
||||
if ( m_exportTvdrkb && m_rkbDiff != -1.0 )
|
||||
{
|
||||
// Export True Vertical Depth Rotary Kelly Bushing - TVDRKB
|
||||
std::vector<double> tvdrkbValues = firstCurveData->tvDepths();
|
||||
std::vector<double> tvdrkbValues = firstCurveData->depths( RiaDefines::TRUE_VERTICAL_DEPTH );
|
||||
for ( auto& value : tvdrkbValues )
|
||||
{
|
||||
value += m_rkbDiff;
|
||||
@ -245,7 +251,7 @@ public:
|
||||
|
||||
double minDepth = 0.0;
|
||||
double maxDepth = 0.0;
|
||||
firstCurveData->calculateMDRange( &minDepth, &maxDepth );
|
||||
firstCurveData->calculateDepthRange( RiaDefines::MEASURED_DEPTH, &minDepth, &maxDepth );
|
||||
|
||||
lasFile->setStartDepth( minDepth );
|
||||
lasFile->setStopDepth( maxDepth );
|
||||
|
@ -45,17 +45,17 @@ RigWellLogCurveData::~RigWellLogCurveData() {}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigWellLogCurveData::setValuesAndMD( const std::vector<double>& xValues,
|
||||
const std::vector<double>& measuredDepths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve )
|
||||
void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues,
|
||||
const std::vector<double>& depths,
|
||||
RiaDefines::DepthTypeEnum depthType,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve )
|
||||
{
|
||||
CVF_ASSERT( xValues.size() == measuredDepths.size() );
|
||||
CVF_ASSERT( xValues.size() == depths.size() );
|
||||
|
||||
m_xValues = xValues;
|
||||
m_measuredDepths = measuredDepths;
|
||||
m_tvDepths.clear();
|
||||
m_depthUnit = depthUnit;
|
||||
m_xValues = xValues;
|
||||
m_depths[depthType] = depths;
|
||||
m_depthUnit = depthUnit;
|
||||
|
||||
// Disable depth value filtering is intended to be used for
|
||||
// extraction curve data
|
||||
@ -67,19 +67,22 @@ void RigWellLogCurveData::setValuesAndMD( const std::vector<double>& xValues,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigWellLogCurveData::setValuesWithTVD( const std::vector<double>& xValues,
|
||||
const std::vector<double>& measuredDepths,
|
||||
const std::vector<double>& tvDepths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve )
|
||||
void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues,
|
||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve )
|
||||
{
|
||||
CVF_ASSERT( xValues.size() == measuredDepths.size() );
|
||||
for ( auto it = depths.begin(); it != depths.end(); ++it )
|
||||
{
|
||||
CVF_ASSERT( xValues.size() == it->second.size() );
|
||||
}
|
||||
|
||||
m_xValues = xValues;
|
||||
m_measuredDepths = measuredDepths;
|
||||
m_tvDepths = tvDepths;
|
||||
m_depthUnit = depthUnit;
|
||||
m_xValues = xValues;
|
||||
m_depths = depths;
|
||||
m_depthUnit = depthUnit;
|
||||
|
||||
// Disable depth value filtering is intended to be used for
|
||||
// extraction curve data
|
||||
m_isExtractionCurve = isExtractionCurve;
|
||||
|
||||
calculateIntervalsOfContinousValidValues();
|
||||
@ -96,17 +99,24 @@ const std::vector<double>& RigWellLogCurveData::xValues() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RigWellLogCurveData::measuredDepths() const
|
||||
std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depthType ) const
|
||||
{
|
||||
return m_measuredDepths;
|
||||
auto it = m_depths.find( depthType );
|
||||
return it != m_depths.end() ? it->second : std::vector<double>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RigWellLogCurveData::tvDepths() const
|
||||
std::set<RiaDefines::DepthTypeEnum> RigWellLogCurveData::availableDepthTypes() const
|
||||
{
|
||||
return m_tvDepths;
|
||||
std::set<RiaDefines::DepthTypeEnum> depthTypes;
|
||||
|
||||
for ( auto depthValuePair : m_depths )
|
||||
{
|
||||
depthTypes.insert( depthValuePair.first );
|
||||
}
|
||||
return depthTypes;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -123,18 +133,21 @@ std::vector<double> RigWellLogCurveData::xPlotValues() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigWellLogCurveData::trueDepthPlotValues( RiaDefines::DepthUnitType destinationDepthUnit ) const
|
||||
std::vector<double> RigWellLogCurveData::depthPlotValues( RiaDefines::DepthTypeEnum depthType,
|
||||
RiaDefines::DepthUnitType destinationDepthUnit ) const
|
||||
{
|
||||
std::vector<double> filteredValues;
|
||||
if ( m_tvDepths.size() )
|
||||
|
||||
const std::vector<double> depthValues = depths( depthType );
|
||||
if ( !depthValues.empty() )
|
||||
{
|
||||
if ( destinationDepthUnit == m_depthUnit )
|
||||
{
|
||||
RiaCurveDataTools::getValuesByIntervals( m_tvDepths, m_intervalsOfContinousValidValues, &filteredValues );
|
||||
RiaCurveDataTools::getValuesByIntervals( depthValues, m_intervalsOfContinousValidValues, &filteredValues );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<double> convertedValues = convertDepthValues( destinationDepthUnit, m_tvDepths );
|
||||
std::vector<double> convertedValues = convertDepthValues( destinationDepthUnit, depthValues );
|
||||
RiaCurveDataTools::getValuesByIntervals( convertedValues, m_intervalsOfContinousValidValues, &filteredValues );
|
||||
}
|
||||
}
|
||||
@ -142,26 +155,6 @@ std::vector<double> RigWellLogCurveData::trueDepthPlotValues( RiaDefines::DepthU
|
||||
return filteredValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigWellLogCurveData::measuredDepthPlotValues( RiaDefines::DepthUnitType destinationDepthUnit ) const
|
||||
{
|
||||
std::vector<double> filteredValues;
|
||||
|
||||
if ( destinationDepthUnit == m_depthUnit )
|
||||
{
|
||||
RiaCurveDataTools::getValuesByIntervals( m_measuredDepths, m_intervalsOfContinousValidValues, &filteredValues );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<double> convertedValues = convertDepthValues( destinationDepthUnit, m_measuredDepths );
|
||||
RiaCurveDataTools::getValuesByIntervals( convertedValues, m_intervalsOfContinousValidValues, &filteredValues );
|
||||
}
|
||||
|
||||
return filteredValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -181,17 +174,20 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
|
||||
bool isTvDepthsAvailable = false;
|
||||
std::vector<double> tvDepths;
|
||||
|
||||
if ( m_tvDepths.size() > 0 ) isTvDepthsAvailable = true;
|
||||
auto mdIt = m_depths.find( RiaDefines::MEASURED_DEPTH );
|
||||
auto tvdIt = m_depths.find( RiaDefines::TRUE_VERTICAL_DEPTH );
|
||||
|
||||
if ( m_measuredDepths.size() > 0 )
|
||||
if ( tvdIt != m_depths.end() && !tvdIt->second.empty() ) isTvDepthsAvailable = true;
|
||||
|
||||
if ( mdIt != m_depths.end() && !mdIt->second.empty() )
|
||||
{
|
||||
double currentMd = m_measuredDepths[0];
|
||||
double currentMd = mdIt->second.front();
|
||||
|
||||
size_t segmentStartIdx = 0;
|
||||
while ( segmentStartIdx < m_measuredDepths.size() - 1 )
|
||||
while ( segmentStartIdx < mdIt->second.size() - 1 )
|
||||
{
|
||||
double segmentStartMd = m_measuredDepths[segmentStartIdx];
|
||||
double segmentEndMd = m_measuredDepths[segmentStartIdx + 1];
|
||||
double segmentStartMd = mdIt->second[segmentStartIdx];
|
||||
double segmentEndMd = mdIt->second[segmentStartIdx + 1];
|
||||
double segmentStartX = m_xValues[segmentStartIdx];
|
||||
double segmentEndX = m_xValues[segmentStartIdx + 1];
|
||||
|
||||
@ -199,8 +195,8 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
|
||||
double segmentEndTvd = 0.0;
|
||||
if ( isTvDepthsAvailable )
|
||||
{
|
||||
segmentStartTvd = m_tvDepths[segmentStartIdx];
|
||||
segmentEndTvd = m_tvDepths[segmentStartIdx + 1];
|
||||
segmentStartTvd = tvdIt->second[segmentStartIdx];
|
||||
segmentEndTvd = tvdIt->second[segmentStartIdx + 1];
|
||||
}
|
||||
|
||||
while ( currentMd <= segmentEndMd )
|
||||
@ -228,11 +224,17 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
|
||||
|
||||
if ( isTvDepthsAvailable )
|
||||
{
|
||||
reSampledData->setValuesWithTVD( xValues, measuredDepths, tvDepths, m_depthUnit, true );
|
||||
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths =
|
||||
{{RiaDefines::TRUE_VERTICAL_DEPTH, tvDepths}, {RiaDefines::MEASURED_DEPTH, measuredDepths}};
|
||||
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_depthUnit, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
reSampledData->setValuesAndMD( xValues, measuredDepths, m_depthUnit, m_isExtractionCurve );
|
||||
reSampledData->setValuesAndDepths( xValues,
|
||||
measuredDepths,
|
||||
RiaDefines::MEASURED_DEPTH,
|
||||
m_depthUnit,
|
||||
m_isExtractionCurve );
|
||||
}
|
||||
|
||||
return reSampledData;
|
||||
@ -258,7 +260,7 @@ void RigWellLogCurveData::calculateIntervalsOfContinousValidValues()
|
||||
for ( size_t intIdx = 0; intIdx < intervalsCount; intIdx++ )
|
||||
{
|
||||
std::vector<std::pair<size_t, size_t>> depthValuesIntervals;
|
||||
splitIntervalAtEmptySpace( m_measuredDepths,
|
||||
splitIntervalAtEmptySpace( m_depths[RiaDefines::MEASURED_DEPTH],
|
||||
intervalsOfValidValues[intIdx].first,
|
||||
intervalsOfValidValues[intIdx].second,
|
||||
&depthValuesIntervals );
|
||||
@ -323,16 +325,18 @@ void RigWellLogCurveData::splitIntervalAtEmptySpace( const std::vector<double>&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigWellLogCurveData::calculateMDRange( double* minimumDepth, double* maximumDepth ) const
|
||||
bool RigWellLogCurveData::calculateDepthRange( RiaDefines::DepthTypeEnum depthType,
|
||||
double* minimumDepth,
|
||||
double* maximumDepth ) const
|
||||
{
|
||||
CVF_ASSERT( minimumDepth && maximumDepth );
|
||||
|
||||
double minValue = HUGE_VAL;
|
||||
double maxValue = -HUGE_VAL;
|
||||
|
||||
for ( size_t vIdx = 0; vIdx < m_measuredDepths.size(); vIdx++ )
|
||||
for ( size_t vIdx = 0; vIdx < depths( depthType ).size(); vIdx++ )
|
||||
{
|
||||
double value = m_measuredDepths[vIdx];
|
||||
double value = depths( depthType )[vIdx];
|
||||
|
||||
if ( value < minValue )
|
||||
{
|
||||
@ -356,42 +360,6 @@ bool RigWellLogCurveData::calculateMDRange( double* minimumDepth, double* maximu
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigWellLogCurveData::calculateTVDRange( double* minTVD, double* maxTVD ) const
|
||||
{
|
||||
CVF_ASSERT( minTVD && maxTVD );
|
||||
|
||||
double minValue = HUGE_VAL;
|
||||
double maxValue = -HUGE_VAL;
|
||||
|
||||
for ( size_t vIdx = 0; vIdx < m_tvDepths.size(); vIdx++ )
|
||||
{
|
||||
double value = m_tvDepths[vIdx];
|
||||
|
||||
if ( value < minValue )
|
||||
{
|
||||
minValue = value;
|
||||
}
|
||||
|
||||
if ( value > maxValue )
|
||||
{
|
||||
maxValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
if ( maxValue >= minValue )
|
||||
{
|
||||
*minTVD = minValue;
|
||||
*maxTVD = maxValue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include "cvfObject.h"
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
class RigWellLogCurveDataTestInterface;
|
||||
@ -36,28 +38,29 @@ public:
|
||||
RigWellLogCurveData();
|
||||
~RigWellLogCurveData() override;
|
||||
|
||||
void setValuesAndMD( const std::vector<double>& xValues,
|
||||
const std::vector<double>& measuredDepths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve );
|
||||
|
||||
void setValuesWithTVD( const std::vector<double>& xValues,
|
||||
const std::vector<double>& measuredDepths,
|
||||
const std::vector<double>& tvDepths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve );
|
||||
void setValuesAndDepths( const std::vector<double>& xValues,
|
||||
const std::vector<double>& depths,
|
||||
RiaDefines::DepthTypeEnum depthType,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve );
|
||||
void setValuesAndDepths( const std::vector<double>& xValues,
|
||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
|
||||
RiaDefines::DepthUnitType depthUnit,
|
||||
bool isExtractionCurve );
|
||||
|
||||
const std::vector<double>& xValues() const;
|
||||
const std::vector<double>& measuredDepths() const;
|
||||
const std::vector<double>& tvDepths() const;
|
||||
bool calculateMDRange( double* minMD, double* maxMD ) const;
|
||||
bool calculateTVDRange( double* minTVD, double* maxTVD ) const;
|
||||
|
||||
std::vector<double> depths( RiaDefines::DepthTypeEnum depthType ) const;
|
||||
|
||||
std::set<RiaDefines::DepthTypeEnum> availableDepthTypes() const;
|
||||
|
||||
bool calculateDepthRange( RiaDefines::DepthTypeEnum depthType, double* minMD, double* maxMD ) const;
|
||||
|
||||
RiaDefines::DepthUnitType depthUnit() const;
|
||||
|
||||
std::vector<double> xPlotValues() const;
|
||||
std::vector<double> trueDepthPlotValues( RiaDefines::DepthUnitType destinationDepthUnit ) const;
|
||||
std::vector<double> measuredDepthPlotValues( RiaDefines::DepthUnitType destinationDepthUnit ) const;
|
||||
std::vector<double> xPlotValues() const;
|
||||
std::vector<double> depthPlotValues( RiaDefines::DepthTypeEnum depthType,
|
||||
RiaDefines::DepthUnitType destinationDepthUnit ) const;
|
||||
std::vector<std::pair<size_t, size_t>> polylineStartStopIndices() const;
|
||||
|
||||
cvf::ref<RigWellLogCurveData> calculateResampledCurveData( double newMeasuredDepthStepSize ) const;
|
||||
@ -77,10 +80,9 @@ private:
|
||||
static std::vector<double> convertFromFeetToMeter( const std::vector<double>& valuesInFeet );
|
||||
|
||||
private:
|
||||
std::vector<double> m_xValues;
|
||||
std::vector<double> m_measuredDepths;
|
||||
std::vector<double> m_tvDepths;
|
||||
bool m_isExtractionCurve;
|
||||
std::vector<double> m_xValues;
|
||||
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> m_depths;
|
||||
bool m_isExtractionCurve;
|
||||
|
||||
std::vector<std::pair<size_t, size_t>> m_intervalsOfContinousValidValues;
|
||||
|
||||
|
@ -55,7 +55,7 @@ void RigWellPathFormations::depthAndFormationNamesWithoutDuplicatesOnDepth( std:
|
||||
{
|
||||
std::map<double, bool, DepthComp> tempMakeVectorUniqueOnMeasuredDepth;
|
||||
|
||||
if ( depthType == RimWellLogPlot::MEASURED_DEPTH )
|
||||
if ( depthType == RiaDefines::MEASURED_DEPTH )
|
||||
{
|
||||
for ( const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations )
|
||||
{
|
||||
@ -77,7 +77,7 @@ void RigWellPathFormations::depthAndFormationNamesWithoutDuplicatesOnDepth( std:
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
for ( const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations )
|
||||
{
|
||||
@ -106,11 +106,11 @@ void RigWellPathFormations::depthAndFormationNamesWithoutDuplicatesOnDepth( std:
|
||||
if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.first.mdTop))
|
||||
{
|
||||
double depth;
|
||||
if (depthType == RimWellLogPlot::MEASURED_DEPTH)
|
||||
if (depthType == RiaDefines::MEASURED_DEPTH)
|
||||
{
|
||||
depth = formation.first.mdTop;
|
||||
}
|
||||
else if (depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH)
|
||||
else if (depthType == RiaDefines::TRUE_VERTICAL_DEPTH)
|
||||
{
|
||||
depth = formation.first.tvdTop;
|
||||
}
|
||||
@ -125,11 +125,11 @@ void RigWellPathFormations::depthAndFormationNamesWithoutDuplicatesOnDepth( std:
|
||||
for (const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations)
|
||||
{
|
||||
double depth;
|
||||
if (depthType == RimWellLogPlot::MEASURED_DEPTH)
|
||||
if (depthType == RiaDefines::MEASURED_DEPTH)
|
||||
{
|
||||
depth = formation.first.mdBase;
|
||||
}
|
||||
else if (depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH)
|
||||
else if (depthType == RiaDefines::TRUE_VERTICAL_DEPTH)
|
||||
{
|
||||
depth = formation.first.tvdBase;
|
||||
}
|
||||
@ -169,7 +169,7 @@ void RigWellPathFormations::evaluateFormationsForOnePosition(
|
||||
{
|
||||
double depth;
|
||||
|
||||
if ( depthType == RimWellLogPlot::MEASURED_DEPTH )
|
||||
if ( depthType == RiaDefines::MEASURED_DEPTH )
|
||||
{
|
||||
if ( position == TOP )
|
||||
{
|
||||
@ -180,7 +180,7 @@ void RigWellPathFormations::evaluateFormationsForOnePosition(
|
||||
depth = formation.first.mdBase;
|
||||
}
|
||||
}
|
||||
else if ( depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
if ( position == TOP )
|
||||
{
|
||||
@ -237,11 +237,11 @@ void RigWellPathFormations::evaluateFluids( const std::vector<RigWellPathFormati
|
||||
for ( const RigWellPathFormation& formation : fluidFormations )
|
||||
{
|
||||
double depthBase;
|
||||
if ( depthType == RimWellLogPlot::MEASURED_DEPTH )
|
||||
if ( depthType == RiaDefines::MEASURED_DEPTH )
|
||||
{
|
||||
depthBase = formation.mdBase;
|
||||
}
|
||||
else if ( depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
depthBase = formation.tvdBase;
|
||||
}
|
||||
@ -254,11 +254,11 @@ void RigWellPathFormations::evaluateFluids( const std::vector<RigWellPathFormati
|
||||
for ( const RigWellPathFormation& formation : fluidFormations )
|
||||
{
|
||||
double depthTop;
|
||||
if ( depthType == RimWellLogPlot::MEASURED_DEPTH )
|
||||
if ( depthType == RiaDefines::MEASURED_DEPTH )
|
||||
{
|
||||
depthTop = formation.mdTop;
|
||||
}
|
||||
else if ( depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
depthTop = formation.tvdTop;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem( const RimWellPath* w
|
||||
: m_wellPath( wellPath )
|
||||
, m_componentType( RiaDefines::WELL_PATH )
|
||||
, m_columnOffset( 0.0 )
|
||||
, m_depthType( RimWellLogPlot::MEASURED_DEPTH )
|
||||
, m_depthType( RiaDefines::MEASURED_DEPTH )
|
||||
, m_maxColumnOffset( 0.0 )
|
||||
, m_showLabel( false )
|
||||
{
|
||||
@ -68,7 +68,7 @@ RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem( const RimWellPath*
|
||||
const RimWellPathComponentInterface* component )
|
||||
: m_wellPath( wellPath )
|
||||
, m_columnOffset( 0.0 )
|
||||
, m_depthType( RimWellLogPlot::MEASURED_DEPTH )
|
||||
, m_depthType( RiaDefines::MEASURED_DEPTH )
|
||||
, m_maxColumnOffset( 0.0 )
|
||||
, m_showLabel( false )
|
||||
{
|
||||
@ -333,7 +333,7 @@ std::pair<double, double> RiuWellPathComponentPlotItem::depthsOfDepthType() cons
|
||||
double startDepth = m_startMD;
|
||||
double endDepth = m_endMD;
|
||||
|
||||
if ( m_depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||
if ( m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
|
||||
{
|
||||
cvf::Vec3d startPoint = m_wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( m_startMD );
|
||||
cvf::Vec3d endPoint = m_wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( m_endMD );
|
||||
|
Loading…
Reference in New Issue
Block a user