Skip to content

Commit

Permalink
#1535 Run flow diag for current timestep when invoking Flow Char Plot…
Browse files Browse the repository at this point in the history
… command
  • Loading branch information
JacobStoren committed May 31, 2017
1 parent e13fa7d commit 23870ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "RimEclipseResultCase.h"
#include "RimEclipseView.h"
#include "RimFlowCharacteristicsPlot.h"
#include "RigFlowDiagResults.h"
#include "RimFlowDiagSolution.h"
#include "RimFlowPlotCollection.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
Expand Down Expand Up @@ -71,6 +73,16 @@ void RicShowFlowCharacteristicsPlotFeature::onActionTriggered(bool isChecked)

if (eclCase && eclCase->defaultFlowDiagSolution())
{
// Make sure flow results for the the active timestep is calculated, to avoid an empty plot
{
RimView * activeView = RiaApplication::instance()->activeReservoirView();
if (activeView && eclCase->defaultFlowDiagSolution()->flowDiagResults())
{
// Trigger calculation
eclCase->defaultFlowDiagSolution()->flowDiagResults()->maxAbsPairFlux(activeView->currentTimeStep());
}
}

if (RiaApplication::instance()->project())
{
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,16 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
{
std::vector<RimEclipseResultCase*> cases;
proj->descendantsIncludingThisOfType(cases);

RimEclipseResultCase* defaultCase = nullptr;
for ( RimEclipseResultCase* c : cases )
{
if ( c->defaultFlowDiagSolution() )
{
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 )
Expand Down

0 comments on commit 23870ca

Please sign in to comment.