#4354 Export Completion Data: Auto-select "MSW" in GUI when Valves are exported

This commit is contained in:
Magne Sjaastad 2019-04-24 13:31:11 +02:00
parent 521e170178
commit 1adbc499d6
3 changed files with 25 additions and 4 deletions

View File

@ -113,6 +113,14 @@ RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi()
m_fishbonesEnabled = true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionDataSettingsUi::enableIncludeMsw()
{
includeMsw = true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -78,6 +78,7 @@ public:
caf::PdmField<bool> includeFractures;
void enableIncludeMsw();
void showForSimWells();
void showForWellPath();

View File

@ -21,8 +21,8 @@
#include "RiaApplication.h"
#include "RicExportFeatureImpl.h"
#include "ExportCommands/RicExportLgrFeature.h"
#include "RicExportFeatureImpl.h"
#include "RimDialogData.h"
#include "RimFishbonesMultipleSubs.h"
@ -35,6 +35,7 @@
#include "RimWellPathCollection.h"
#include "RimWellPathCompletions.h"
#include "RimWellPathFracture.h"
#include "RimWellPathValve.h"
#include "Riu3DMainWindowTools.h"
@ -123,6 +124,17 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl
if (!wellPathPerforations.empty())
{
exportSettings->showPerforationsInUi(true);
std::vector<const RimWellPathValve*> perforationValves;
for (const auto& perf : wellPathPerforations)
{
perf->descendantsIncludingThisOfType(perforationValves);
}
if (!perforationValves.empty())
{
exportSettings->enableIncludeMsw();
}
}
else
{
@ -184,7 +196,6 @@ void RicWellPathExportCompletionDataFeature::setupActionLook(QAction* actionToSe
actionToSetup->setText("Export Completion Data for Selected Well Paths");
}
actionToSetup->setIcon(QIcon(":/ExportCompletionsSymbol16x16.png"));
}
//--------------------------------------------------------------------------------------------------
@ -200,13 +211,14 @@ std::vector<RimWellPath*> RicWellPathExportCompletionDataFeature::selectedWellPa
if (wellPaths.empty())
{
RimWellPathCompletions* completions = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPathCompletions>();
RimWellPathCompletions* completions =
caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPathCompletions>();
if (completions)
{
RimWellPath* wellPath = nullptr;
completions->firstAncestorOrThisOfTypeAsserted(wellPath);
wellPaths.push_back(wellPath);
}
}
}
return wellPaths;