#1263 ShowWellAllocationPlot must be available when well is selected

This commit is contained in:
Magne Sjaastad 2017-03-14 13:15:00 +01:00
parent 2b7927e5a6
commit 4498e353df

View File

@ -41,18 +41,12 @@ CAF_CMD_SOURCE_INIT(RicShowWellAllocationPlotFeature, "RicShowWellAllocationPlot
//--------------------------------------------------------------------------------------------------
bool RicShowWellAllocationPlotFeature::isCommandEnabled()
{
RimView* activeView = RiaApplication::instance()->activeReservoirView();
if (!activeView) return false;
std::vector<RimEclipseWell*> collection;
caf::SelectionManager::instance()->objectsByType(&collection);
RimEclipseResultCase* eclCase = nullptr;
activeView->firstAncestorOrThisOfType(eclCase);
if (eclCase)
if (collection.size() > 0)
{
RimFlowDiagSolution* defaultFlowDiagSolution = eclCase->defaultFlowDiagSolution();
if (defaultFlowDiagSolution)
{
return true;
}
return true;
}
return false;