mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Temporary LGR : Hide context menu items, remove invalid assert
This commit is contained in:
parent
c334106e9c
commit
fb18e9b170
@ -26,11 +26,11 @@
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
|
||||
#include "RimGridCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimGridCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
|
||||
@ -43,6 +43,11 @@ CAF_CMD_SOURCE_INIT(RicExportCompletionsForTemporaryLgrsFeature, "RicExportCompl
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicExportCompletionsForTemporaryLgrsFeature::isCommandEnabled()
|
||||
{
|
||||
if (wellPathsAssociatedWithLgrs().empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<RimGridInfoCollection*> selGridInfos = caf::selectedObjectsByTypeStrict<RimGridInfoCollection*>();
|
||||
return selGridInfos.size() == 1 && selGridInfos.front()->uiName() == RimGridCollection::temporaryGridUiName();
|
||||
}
|
||||
@ -53,7 +58,10 @@ bool RicExportCompletionsForTemporaryLgrsFeature::isCommandEnabled()
|
||||
void RicExportCompletionsForTemporaryLgrsFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimWellPath*> wellPaths = wellPathsAssociatedWithLgrs();
|
||||
CVF_ASSERT(wellPaths.size() > 0);
|
||||
if (wellPaths.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<RimSimWellInView*> simWells;
|
||||
QString dialogTitle = "Export Completion Data for Temporary LGRs";
|
||||
@ -77,6 +85,8 @@ std::vector<RimWellPath*> RicExportCompletionsForTemporaryLgrsFeature::wellPaths
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
|
||||
auto selectedEclipseCase = caf::firstAncestorOfTypeFromSelectedObject<RimEclipseCase*>();
|
||||
if (selectedEclipseCase)
|
||||
{
|
||||
auto mainGrid = selectedEclipseCase->mainGrid();
|
||||
|
||||
std::set<QString> wellPathNames;
|
||||
@ -100,5 +110,7 @@ std::vector<RimWellPath*> RicExportCompletionsForTemporaryLgrsFeature::wellPaths
|
||||
wellPaths.push_back(wellPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return wellPaths;
|
||||
}
|
||||
|
@ -47,7 +47,12 @@ void RicDeleteTemporaryLgrsFeature::deleteAllTemporaryLgrs(RimEclipseCase* eclip
|
||||
bool RicDeleteTemporaryLgrsFeature::isCommandEnabled()
|
||||
{
|
||||
std::vector<RimGridInfoCollection*> selGridInfos = caf::selectedObjectsByTypeStrict<RimGridInfoCollection*>();
|
||||
return selGridInfos.size() == 1 && selGridInfos.front()->uiName() == RimGridCollection::temporaryGridUiName();
|
||||
if (selGridInfos.size() == 1 && selGridInfos.front()->uiName() == RimGridCollection::temporaryGridUiName())
|
||||
{
|
||||
return !selGridInfos[0]->gridInfos().empty();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user