#1445 Use correct colors in pie chart for well alloc plots in well flow mode

This commit is contained in:
Bjørnar Grip Fjær 2017-05-03 13:39:36 +02:00
parent 3fc0a59f06
commit cd8ad75db5
2 changed files with 20 additions and 9 deletions

View File

@ -295,10 +295,10 @@ void RimWellAllocationPlot::updateFromWell()
for ( const auto& tracerVal : totalTracerFractions )
{
cvf::Color3f color;
if ( m_flowDiagSolution )
if (m_flowDiagSolution)
color = m_flowDiagSolution->tracerColor(tracerVal.first);
else
color = cvf::Color3f::DARK_GRAY;
color = getTracerColor(tracerVal.first);
double tracerPercent = 100*tracerVal.second;
@ -394,13 +394,7 @@ void RimWellAllocationPlot::addStackedCurve(const QString& tracerName,
}
else
{
cvf::Color3f color = cvf::Color3f::DARK_GRAY;
if (tracerName == RIG_FLOW_OIL_NAME) color = cvf::Color3f::DARK_GREEN;
if (tracerName == RIG_FLOW_GAS_NAME) color = cvf::Color3f::DARK_RED;
if (tracerName == RIG_FLOW_WATER_NAME) color = cvf::Color3f::BLUE;
curve->setColor(color);
curve->setColor(getTracerColor(tracerName));
}
plotTrack->addCurve(curve);
@ -767,4 +761,15 @@ QWidget* RimWellAllocationPlot::createViewWidget(QWidget* mainWindowParent)
return m_wellAllocationPlotWidget;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimWellAllocationPlot::getTracerColor(const QString& tracerName)
{
if (tracerName == RIG_FLOW_OIL_NAME) return cvf::Color3f::DARK_GREEN;
if (tracerName == RIG_FLOW_GAS_NAME) return cvf::Color3f::DARK_RED;
if (tracerName == RIG_FLOW_WATER_NAME) return cvf::Color3f::BLUE;
return cvf::Color3f::DARK_GRAY;
}

View File

@ -37,6 +37,10 @@ class RiuWellAllocationPlot;
class RimWellLogTrack;
class RigSingleWellResultsData;
namespace cvf {
class Color3f;
}
namespace caf {
class PdmOptionItemInfo;
}
@ -111,6 +115,8 @@ private:
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
virtual void deleteViewWidget() override;
cvf::Color3f getTracerColor(const QString& tracerName);
private:
caf::PdmField<bool> m_showPlotTitle;
caf::PdmField<QString> m_userName;