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