mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1799 Ensure tracers and time steps have values when entering flow characteristics plot initially
This commit is contained in:
@@ -175,16 +175,13 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
|
|||||||
{
|
{
|
||||||
std::vector<RimEclipseResultCase*> cases;
|
std::vector<RimEclipseResultCase*> cases;
|
||||||
proj->descendantsIncludingThisOfType(cases);
|
proj->descendantsIncludingThisOfType(cases);
|
||||||
RimEclipseResultCase* defaultCase = nullptr;
|
|
||||||
for ( RimEclipseResultCase* c : cases )
|
for ( RimEclipseResultCase* c : cases )
|
||||||
{
|
{
|
||||||
if ( c->defaultFlowDiagSolution() )
|
if ( c->defaultFlowDiagSolution() )
|
||||||
{
|
{
|
||||||
options.push_back(caf::PdmOptionItemInfo(c->caseUserDescription(), c, false, c->uiIcon()));
|
options.push_back(caf::PdmOptionItemInfo(c->caseUserDescription(), c, false, c->uiIcon()));
|
||||||
if (!defaultCase) defaultCase = c; // Select first
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!m_case() && defaultCase) m_case = defaultCase;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( fieldNeedingOptions == &m_flowDiagSolution )
|
else if ( fieldNeedingOptions == &m_flowDiagSolution )
|
||||||
@@ -290,6 +287,29 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimFlowCharacteristicsPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
void RimFlowCharacteristicsPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
// Ensure a case is selected if one is available
|
||||||
|
RimProject* proj = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(proj);
|
||||||
|
if (proj)
|
||||||
|
{
|
||||||
|
std::vector<RimEclipseResultCase*> cases;
|
||||||
|
proj->descendantsIncludingThisOfType(cases);
|
||||||
|
RimEclipseResultCase* defaultCase = nullptr;
|
||||||
|
for (RimEclipseResultCase* c : cases)
|
||||||
|
{
|
||||||
|
if (c->defaultFlowDiagSolution())
|
||||||
|
{
|
||||||
|
if (!defaultCase) defaultCase = c; // Select first
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!m_case() && defaultCase)
|
||||||
|
{
|
||||||
|
m_case = defaultCase;
|
||||||
|
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
caf::PdmUiGroup* timeStepsGroup = uiOrdering.addNewGroup("Time Steps");
|
caf::PdmUiGroup* timeStepsGroup = uiOrdering.addNewGroup("Time Steps");
|
||||||
|
|||||||
Reference in New Issue
Block a user