#1174 Create TOF property filter with selected tracer

This commit is contained in:
Magne Sjaastad
2017-02-13 15:00:49 +01:00
parent 07dc89bceb
commit 73053b0bb7
3 changed files with 66 additions and 7 deletions

View File

@@ -250,6 +250,43 @@ void RimEclipseResultDefinition::updateAnyFieldHasChanged()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::setTofAndSelectTracer(const QString& tracerName)
{
setResultType(RimDefines::FLOW_DIAGNOSTICS);
setResultVariable("TOF");
m_flowTracerSelectionMode = FLOW_TR_BY_SELECTION;
std::vector<QString> tracers;
tracers.push_back(tracerName);
setSelectedTracers(tracers);
if (m_flowSolution() == nullptr)
{
assignFlowSolutionFromCase();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::assignFlowSolutionFromCase()
{
RimEclipseResultCase* eclCase = nullptr;
this->firstAncestorOrThisOfType(eclCase);
if (eclCase)
{
std::vector<RimFlowDiagSolution*> flowSols = eclCase->flowDiagSolutions();
if (flowSols.size() > 0)
{
this->setFlowSolution(flowSols[0]);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -891,13 +928,7 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
if ( m_flowSolution() == nullptr )
{
RimEclipseResultCase* eclCase;
this->firstAncestorOrThisOfType(eclCase);
if ( eclCase )
{
std::vector<RimFlowDiagSolution*> flowSols = eclCase->flowDiagSolutions();
if (flowSols.size()){ this->setFlowSolution(flowSols[0]); }
}
assignFlowSolutionFromCase();
}
}
uiOrdering.add(&m_resultVariableUiField);