#1176 Read out state directly from well using RigSingleWellResultsData

This commit is contained in:
Magne Sjaastad 2017-02-06 14:00:05 +01:00
parent 8bc1a3ee3d
commit e4830b629c
2 changed files with 48 additions and 26 deletions

View File

@ -252,33 +252,8 @@ void RimWellAllocationPlot::updateFromWell()
}
QString wellStatusText;
QString wellStatusText = QString("(%1)").arg(RimWellAllocationPlot::wellStatusTextForTimeStep(m_wellName, m_case, m_timeStep));
{
QString wellStatus;
RimFlowDiagSolution::TracerStatusType wellStatusForTimeStep = m_flowDiagSolution->tracerStatusInTimeStep(m_wellName, m_timeStep);
switch (wellStatusForTimeStep)
{
case RimFlowDiagSolution::CLOSED:
wellStatus = "Closed";
break;
case RimFlowDiagSolution::PRODUCER:
wellStatus = "Producer";
break;
case RimFlowDiagSolution::INJECTOR:
wellStatus = "Injector";
break;
case RimFlowDiagSolution::UNDEFINED:
wellStatus = "Undefined";
break;
default:
break;
}
wellStatusText = QString("(%1)").arg(wellStatus);
}
setDescription("Well Allocation: " + m_wellName + " " + wellStatusText + ", " + m_case->timeStepStrings()[m_timeStep] + " (" + m_case->caseUserDescription() + ")");
/// Pie chart
@ -363,6 +338,52 @@ void RimWellAllocationPlot::updateWidgetTitleWindowTitle()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellAllocationPlot::wellStatusTextForTimeStep(const QString& wellName, const RimEclipseResultCase* eclipseResultCase, size_t timeStep)
{
QString statusText = "Undefined";
if (eclipseResultCase)
{
const RigSingleWellResultsData* wellResults = nullptr;
wellResults = eclipseResultCase->reservoirData()->findWellResult(wellName);
if (wellResults)
{
if (wellResults->hasWellResult(timeStep))
{
const RigWellResultFrame& wellResultFrame = wellResults->wellResultFrame(timeStep);
RigWellResultFrame::WellProductionType prodType = wellResultFrame.m_productionType;
switch (prodType)
{
case RigWellResultFrame::PRODUCER:
statusText = "Producer";
break;
case RigWellResultFrame::OIL_INJECTOR:
statusText = "Oil Injector";
break;
case RigWellResultFrame::GAS_INJECTOR:
statusText = "Gas Injector";
break;
case RigWellResultFrame::WATER_INJECTOR:
statusText = "Water Injector";
break;
case RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE:
break;
default:
break;
}
}
}
}
return statusText;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -87,6 +87,7 @@ private:
RimWellLogTrack* plotTrack);
void updateWidgetTitleWindowTitle();
static QString wellStatusTextForTimeStep(const QString& wellName, const RimEclipseResultCase* eclipseResultCase, size_t timeStep);
// RimViewWindow overrides