mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1171 Disable the Fake 0-connection number value for pseudo depth
This commit is contained in:
parent
9e73fadada
commit
577fc8204d
@ -119,14 +119,9 @@ void RimWellFlowRateCurve::updateCurveAppearance()
|
|||||||
{
|
{
|
||||||
RimWellLogCurve::updateCurveAppearance();
|
RimWellLogCurve::updateCurveAppearance();
|
||||||
|
|
||||||
// Use step-type curves if using connection numbers
|
if ( isUsingConnectionNumberDepthType() )
|
||||||
{
|
{
|
||||||
RimWellLogPlot* wellLogPlot;
|
m_qwtPlotCurve->setStyle(QwtPlotCurve::Steps);
|
||||||
firstAncestorOrThisOfType(wellLogPlot);
|
|
||||||
if ( wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::CONNECTION_NUMBER )
|
|
||||||
{
|
|
||||||
m_qwtPlotCurve->setStyle(QwtPlotCurve::Steps);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor curveQColor = QColor (m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte());
|
QColor curveQColor = QColor (m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte());
|
||||||
@ -167,7 +162,7 @@ void RimWellFlowRateCurve::updateStackedPlotData()
|
|||||||
RimDefines::DepthUnitType displayUnit = RimDefines::UNIT_NONE;
|
RimDefines::DepthUnitType displayUnit = RimDefines::UNIT_NONE;
|
||||||
|
|
||||||
std::vector<double> depthValues = m_curveData->measuredDepthPlotValues(displayUnit);
|
std::vector<double> depthValues = m_curveData->measuredDepthPlotValues(displayUnit);
|
||||||
if (depthValues.size()) depthValues.insert(depthValues.begin(), depthValues[0]); // Insert the first depth position again, to make room for a real 0 value
|
std::vector< std::pair<size_t, size_t> > polyLineStartStopIndices = m_curveData->polylineStartStopIndices();
|
||||||
std::vector<double> stackedValues(depthValues.size(), 0.0);
|
std::vector<double> stackedValues(depthValues.size(), 0.0);
|
||||||
|
|
||||||
std::vector<RimWellFlowRateCurve*> stackedCurves = wellLogTrack->visibleStackedCurves();
|
std::vector<RimWellFlowRateCurve*> stackedCurves = wellLogTrack->visibleStackedCurves();
|
||||||
@ -177,29 +172,53 @@ void RimWellFlowRateCurve::updateStackedPlotData()
|
|||||||
std::vector<double> values = stCurve->curveData()->xPlotValues();
|
std::vector<double> values = stCurve->curveData()->xPlotValues();
|
||||||
for ( size_t i = 0; i < values.size(); ++i )
|
for ( size_t i = 0; i < values.size(); ++i )
|
||||||
{
|
{
|
||||||
stackedValues[i+1] += values[i];
|
stackedValues[i] += values[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( stCurve == this ) break;
|
if ( stCurve == this ) break;
|
||||||
zPos -= 1.0;
|
zPos -= 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Insert the first depth position again, to add a <maxdepth, 0.0> value pair
|
||||||
|
|
||||||
|
if ( depthValues.size() ) // Should we really do this for all curve variants ?
|
||||||
|
{
|
||||||
|
depthValues.insert(depthValues.begin(), depthValues[0]);
|
||||||
|
stackedValues.insert(stackedValues.begin(), 0.0);
|
||||||
|
polyLineStartStopIndices.front().second += 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Add a dummy point for the zeroth connection to make the "end" distribution show better.
|
// Add a dummy point for the zeroth connection to make the "end" distribution show better.
|
||||||
|
|
||||||
stackedValues.push_back(stackedValues.back());
|
if ( isFirstTrack && isUsingConnectionNumberDepthType() )
|
||||||
depthValues.push_back(0.0);
|
{
|
||||||
std::vector< std::pair<size_t, size_t> > polyLineStartStopIndices = m_curveData->polylineStartStopIndices();
|
stackedValues.push_back(stackedValues.back());
|
||||||
|
depthValues.push_back(0.0);
|
||||||
if ( isFirstTrack ) polyLineStartStopIndices.front().second += 2;
|
|
||||||
else polyLineStartStopIndices.front().second += 1;
|
|
||||||
|
|
||||||
|
polyLineStartStopIndices.front().second += 1;
|
||||||
|
}
|
||||||
|
|
||||||
m_qwtPlotCurve->setSamples(stackedValues.data(), depthValues.data(), static_cast<int>(depthValues.size()));
|
m_qwtPlotCurve->setSamples(stackedValues.data(), depthValues.data(), static_cast<int>(depthValues.size()));
|
||||||
m_qwtPlotCurve->setLineSegmentStartStopIndices(polyLineStartStopIndices);
|
m_qwtPlotCurve->setLineSegmentStartStopIndices(polyLineStartStopIndices);
|
||||||
|
|
||||||
m_qwtPlotCurve->setZ(zPos);
|
m_qwtPlotCurve->setZ(zPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimWellFlowRateCurve::isUsingConnectionNumberDepthType() const
|
||||||
|
{
|
||||||
|
RimWellLogPlot* wellLogPlot;
|
||||||
|
firstAncestorOrThisOfType(wellLogPlot);
|
||||||
|
if ( wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::CONNECTION_NUMBER )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -50,6 +50,7 @@ protected:
|
|||||||
virtual void updateCurveAppearance() override;
|
virtual void updateCurveAppearance() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool isUsingConnectionNumberDepthType() const;
|
||||||
RimWellAllocationPlot* wellAllocationPlot() const;
|
RimWellAllocationPlot* wellAllocationPlot() const;
|
||||||
|
|
||||||
QString m_tracerName;
|
QString m_tracerName;
|
||||||
|
Loading…
Reference in New Issue
Block a user