Skip to content

Commit

Permalink
#1288 Added defaultFlowDiagSolution to RimEclipseResultCase
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Mar 9, 2017
1 parent 7e4906f commit 40a5f8d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
13 changes: 13 additions & 0 deletions ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,19 @@ void RimEclipseResultCase::updateFilePathsFromProjectPath(const QString& newProj
}


//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFlowDiagSolution* RimEclipseResultCase::defaultFlowDiagSolution()
{
if (m_flowDiagSolutions.size() > 0)
{
return m_flowDiagSolutions[0];
}

return nullptr;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions ApplicationCode/ProjectDataModel/RimEclipseResultCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class RimEclipseResultCase : public RimEclipseCase
virtual QString gridFileName() const { return caseFileName();}
virtual void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);

RimFlowDiagSolution* defaultFlowDiagSolution();
std::vector<RimFlowDiagSolution*> flowDiagSolutions();
RigFlowDiagSolverInterface* flowDiagSolverInterface();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class RimEclipseResultDefinition : public caf::PdmObject
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;

Expand Down Expand Up @@ -125,7 +127,6 @@ class RimEclipseResultDefinition : public caf::PdmObject
caf::PdmPointer<RimEclipseCase> m_eclipseCase;

private:
void setFlowSolution(RimFlowDiagSolution* flowSol);
void setSelectedTracers(const std::vector<QString>& selectedTracers);
void assignFlowSolutionFromCase();

Expand Down

0 comments on commit 40a5f8d

Please sign in to comment.