#5061 WAP: fix update of well allocation data when changing depth type

This commit is contained in:
Gaute Lindkvist
2019-11-19 13:19:56 +01:00
parent 4d38c2ea39
commit 60b09d7bfd
23 changed files with 271 additions and 288 deletions

View File

@@ -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 )
{

View File

@@ -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 );

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -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 );

View File

@@ -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();
}