mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1263 Flow : Command : Show Contributing Wells command present when applicable
This commit is contained in:
@@ -18,6 +18,10 @@
|
||||
|
||||
#include "RicShowContributingWellsFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "cafCmdFeatureManager.h"
|
||||
|
||||
#include <QAction>
|
||||
@@ -29,7 +33,21 @@ CAF_CMD_SOURCE_INIT(RicShowContributingWellsFeature, "RicShowContributingWellsFe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user