#4792 Fix xValue range for Well Allocation Plots

This commit is contained in:
Gaute Lindkvist
2019-09-30 09:48:05 +02:00
parent 2daa4dea93
commit f2eac1e2ec
6 changed files with 121 additions and 58 deletions

View File

@@ -236,7 +236,7 @@ void RimWellFlowRateCurve::updateStackedPlotData()
stackedCurves = stackedCurveGroups[groupId()];
}
std::vector<double> allDepthValues = m_curveData->measuredDepths();
std::vector<double> allDepthValues = curveData()->measuredDepths();
std::vector<double> allStackedValues( allDepthValues.size() );
for ( RimWellFlowRateCurve* stCurve : stackedCurves )
@@ -305,6 +305,9 @@ void RimWellFlowRateCurve::updateStackedPlotData()
polyLineStartStopIndices.front().second += 1;
}
auto minmax_it = std::minmax_element( stackedValues.begin(), stackedValues.end() );
this->setOverrideCurveDataXRange( *( minmax_it.first ), *( minmax_it.second ) );
m_qwtPlotCurve->setSamples( stackedValues.data(), depthValues.data(), static_cast<int>( depthValues.size() ) );
m_qwtPlotCurve->setLineSegmentStartStopIndices( polyLineStartStopIndices );
@@ -344,9 +347,7 @@ void RimWellFlowRateCurve::setFlowValuesPrDepthValue( const QString&
const std::vector<double>& depthValues,
const std::vector<double>& flowRates )
{
m_curveData = new RigWellLogCurveData;
m_curveData->setValuesAndMD( flowRates, depthValues, RiaDefines::UNIT_NONE, false );
this->setValuesAndMD( flowRates, depthValues, RiaDefines::UNIT_NONE, false );
m_curveAutoName = curveName;
}