#2580 Export Completion Data : Add command in File/Export menu

This commit is contained in:
Magne Sjaastad
2018-04-20 15:08:18 +02:00
parent 8a02fc3095
commit 1ff149c668
2 changed files with 29 additions and 4 deletions

View File

@@ -18,9 +18,12 @@
#include "RicExportCompletionsForVisibleWellPathsFeature.h"
#include "RiaApplication.h"
#include "RicWellPathExportCompletionDataFeature.h"
#include "RimWellPath.h"
#include "RimProject.h"
#include "RimWellPathCollection.h"
#include "cafSelectionManager.h"
@@ -93,16 +96,33 @@ std::vector<RimWellPath*> RicExportCompletionsForVisibleWellPathsFeature::visibl
}
}
for (auto wellPathCollection : wellPathCollections)
if (!wellPathCollections.empty())
{
for (auto wellPath : wellPathCollection->wellPaths())
for (auto wellPathCollection : wellPathCollections)
{
if (wellPath->showWellPath())
for (const auto& wellPath : wellPathCollection->wellPaths())
{
wellPaths.push_back(wellPath);
if (wellPath->showWellPath())
{
wellPaths.push_back(wellPath);
}
}
}
}
else
{
// No well path or well path collection selected
auto allWellPaths = RiaApplication::instance()->project()->allWellPaths();
for (const auto& w : allWellPaths)
{
if (w->showWellPath())
{
wellPaths.push_back(w);
}
}
}
}
std::set<RimWellPath*> uniqueWellPaths(wellPaths.begin(), wellPaths.end());

View File

@@ -398,6 +398,7 @@ void RiuMainWindow::createMenus()
exportMenu->addAction(cmdFeatureMgr->action("RicExportMultipleSnapshotsFeature"));
exportMenu->addSeparator();
exportMenu->addAction(cmdFeatureMgr->action("RicSaveEclipseInputActiveVisibleCellsFeature"));
exportMenu->addAction(cmdFeatureMgr->action("RicExportCompletionsForVisibleWellPathsFeature"));
fileMenu->addSeparator();
fileMenu->addAction(cmdFeatureMgr->action("RicSaveProjectFeature"));
@@ -753,6 +754,10 @@ void RiuMainWindow::slotRefreshFileActions()
CVF_ASSERT(cmdFeatureMgr);
cmdFeatureMgr->action("RicWellPathsImportSsihubFeature")->setEnabled(projectFileExists);
QStringList commandIdList;
commandIdList << "RicExportCompletionsForVisibleWellPathsFeature";
cmdFeatureMgr->refreshStates(commandIdList);
}