mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 07:03:25 -06:00
#1535 Run flow diag for current timestep when invoking Flow Char Plot command
This commit is contained in:
parent
e13fa7dc84
commit
23870cac1e
@ -23,6 +23,8 @@
|
|||||||
#include "RimEclipseResultCase.h"
|
#include "RimEclipseResultCase.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimFlowCharacteristicsPlot.h"
|
#include "RimFlowCharacteristicsPlot.h"
|
||||||
|
#include "RigFlowDiagResults.h"
|
||||||
|
#include "RimFlowDiagSolution.h"
|
||||||
#include "RimFlowPlotCollection.h"
|
#include "RimFlowPlotCollection.h"
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
@ -71,6 +73,16 @@ void RicShowFlowCharacteristicsPlotFeature::onActionTriggered(bool isChecked)
|
|||||||
|
|
||||||
if (eclCase && eclCase->defaultFlowDiagSolution())
|
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())
|
if (RiaApplication::instance()->project())
|
||||||
{
|
{
|
||||||
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
|
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
|
||||||
|
@ -141,14 +141,16 @@ 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 )
|
||||||
|
Loading…
Reference in New Issue
Block a user