mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-05 21:53:27 -06:00
#1263 Flow : Command : Show Contributing Wells command present when applicable
This commit is contained in:
parent
e41979563b
commit
4559b9f31a
@ -18,6 +18,10 @@
|
|||||||
|
|
||||||
#include "RicShowContributingWellsFeature.h"
|
#include "RicShowContributingWellsFeature.h"
|
||||||
|
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
#include "RimEclipseResultCase.h"
|
||||||
|
#include "RimView.h"
|
||||||
|
|
||||||
#include "cafCmdFeatureManager.h"
|
#include "cafCmdFeatureManager.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@ -29,7 +33,21 @@ CAF_CMD_SOURCE_INIT(RicShowContributingWellsFeature, "RicShowContributingWellsFe
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicShowContributingWellsFeature::isCommandEnabled()
|
bool RicShowContributingWellsFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
return true;
|
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||||
|
if (!activeView) return false;
|
||||||
|
|
||||||
|
RimEclipseResultCase* eclCase = nullptr;
|
||||||
|
activeView->firstAncestorOrThisOfType(eclCase);
|
||||||
|
if (eclCase)
|
||||||
|
{
|
||||||
|
std::vector<RimFlowDiagSolution*> flowSols = eclCase->flowDiagSolutions();
|
||||||
|
if (flowSols.size() > 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -20,10 +20,12 @@
|
|||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include "RimEclipseResultCase.h"
|
||||||
#include "RimEclipseWell.h"
|
#include "RimEclipseWell.h"
|
||||||
#include "RimFlowPlotCollection.h"
|
#include "RimFlowPlotCollection.h"
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
#include "RimView.h"
|
||||||
#include "RimWellAllocationPlot.h"
|
#include "RimWellAllocationPlot.h"
|
||||||
|
|
||||||
#include "RiuMainPlotWindow.h"
|
#include "RiuMainPlotWindow.h"
|
||||||
@ -39,7 +41,21 @@ CAF_CMD_SOURCE_INIT(RicShowWellAllocationPlotFeature, "RicShowWellAllocationPlot
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicShowWellAllocationPlotFeature::isCommandEnabled()
|
bool RicShowWellAllocationPlotFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
return true;
|
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||||
|
if (!activeView) return false;
|
||||||
|
|
||||||
|
RimEclipseResultCase* eclCase = nullptr;
|
||||||
|
activeView->firstAncestorOrThisOfType(eclCase);
|
||||||
|
if (eclCase)
|
||||||
|
{
|
||||||
|
std::vector<RimFlowDiagSolution*> flowSols = eclCase->flowDiagSolutions();
|
||||||
|
if (flowSols.size() > 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user