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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user