#1288 Added defaultFlowDiagSolution to RimEclipseResultCase

This commit is contained in:
Magne Sjaastad 2017-03-09 22:45:47 +01:00
parent 7e4906fced
commit 40a5f8dc02
6 changed files with 22 additions and 8 deletions

View File

@ -48,8 +48,8 @@ bool RicShowWellAllocationPlotFeature::isCommandEnabled()
activeView->firstAncestorOrThisOfType(eclCase);
if (eclCase)
{
std::vector<RimFlowDiagSolution*> flowSols = eclCase->flowDiagSolutions();
if (flowSols.size() > 0)
RimFlowDiagSolution* defaultFlowDiagSolution = eclCase->defaultFlowDiagSolution();
if (defaultFlowDiagSolution)
{
return true;
}

View File

@ -138,8 +138,7 @@ void RimWellAllocationPlot::setFromSimulationWell(RimEclipseWell* simWell)
m_flowDiagSolution = eclView->cellResult()->flowDiagSolution();
if ( !m_flowDiagSolution )
{
std::vector<RimFlowDiagSolution*> flowSolutions = m_case->flowDiagSolutions();
if ( flowSolutions.size() ) m_flowDiagSolution = flowSolutions.front();
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
}
loadDataAndUpdate();

View File

@ -354,6 +354,19 @@ void RimEclipseResultCase::updateFilePathsFromProjectPath(const QString& newProj
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFlowDiagSolution* RimEclipseResultCase::defaultFlowDiagSolution()
{
if (m_flowDiagSolutions.size() > 0)
{
return m_flowDiagSolutions[0];
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -52,6 +52,7 @@ public:
virtual QString gridFileName() const { return caseFileName();}
virtual void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
RimFlowDiagSolution* defaultFlowDiagSolution();
std::vector<RimFlowDiagSolution*> flowDiagSolutions();
RigFlowDiagSolverInterface* flowDiagSolverInterface();

View File

@ -278,10 +278,10 @@ void RimEclipseResultDefinition::assignFlowSolutionFromCase()
this->firstAncestorOrThisOfType(eclCase);
if (eclCase)
{
std::vector<RimFlowDiagSolution*> flowSols = eclCase->flowDiagSolutions();
if (flowSols.size() > 0)
RimFlowDiagSolution* defaultFlowDiagSolution = eclCase->defaultFlowDiagSolution();
if (defaultFlowDiagSolution)
{
this->setFlowSolution(flowSols[0]);
this->setFlowSolution(defaultFlowDiagSolution);
}
}
}

View File

@ -68,6 +68,8 @@ public:
void setPorosityModel(RimDefines::PorosityModelType val);
QString resultVariable() const { return m_resultVariable(); }
virtual void setResultVariable(const QString& val);
void setFlowSolution(RimFlowDiagSolution* flowSol);
RimFlowDiagSolution* flowDiagSolution();
RigFlowDiagResultAddress flowDiagResAddress() const;
@ -125,7 +127,6 @@ protected:
caf::PdmPointer<RimEclipseCase> m_eclipseCase;
private:
void setFlowSolution(RimFlowDiagSolution* flowSol);
void setSelectedTracers(const std::vector<QString>& selectedTracers);
void assignFlowSolutionFromCase();