#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() bool RicShowWellAllocationPlotFeature::isCommandEnabled()
{ {
RimView* activeView = RiaApplication::instance()->activeReservoirView(); std::vector<RimEclipseWell*> collection;
if (!activeView) return false; caf::SelectionManager::instance()->objectsByType(&collection);
RimEclipseResultCase* eclCase = nullptr; if (collection.size() > 0)
activeView->firstAncestorOrThisOfType(eclCase);
if (eclCase)
{ {
RimFlowDiagSolution* defaultFlowDiagSolution = eclCase->defaultFlowDiagSolution(); return true;
if (defaultFlowDiagSolution)
{
return true;
}
} }
return false; return false;