From 9b42c9fde693384c8b34c98156ef732ea5639045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Wed, 7 Nov 2018 07:46:33 +0100 Subject: [PATCH] #3605 Temp LGR. Delete existing temp LGRs when creating new --- .../RicfCreateLgrForCompletions.cpp | 3 +++ .../Commands/RicCreateTemporaryLgrFeature.cpp | 3 +++ .../Commands/RicDeleteTemporaryLgrsFeature.cpp | 10 +++++++++- .../Commands/RicDeleteTemporaryLgrsFeature.h | 4 ++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/CommandFileInterface/RicfCreateLgrForCompletions.cpp b/ApplicationCode/CommandFileInterface/RicfCreateLgrForCompletions.cpp index 2a03afc01f..4c77b3472b 100644 --- a/ApplicationCode/CommandFileInterface/RicfCreateLgrForCompletions.cpp +++ b/ApplicationCode/CommandFileInterface/RicfCreateLgrForCompletions.cpp @@ -21,6 +21,7 @@ #include "RicfCommandFileExecutor.h" #include "RicfCreateMultipleFractures.h" +#include "RicDeleteTemporaryLgrsFeature.h" #include "RicCreateTemporaryLgrFeature.h" #include "ExportCommands/RicExportLgrFeature.h" @@ -83,6 +84,8 @@ void RicfCreateLgrForCompletions::execute() } } + RicDeleteTemporaryLgrsFeature::deleteAllTemporaryLgrs(eclipseCase); + caf::VecIjk lgrCellCounts(m_refinementI, m_refinementJ, m_refinementK); QStringList wellsWithIntersectingLgrs; for (const auto wellPath : wellPaths) diff --git a/ApplicationCode/Commands/RicCreateTemporaryLgrFeature.cpp b/ApplicationCode/Commands/RicCreateTemporaryLgrFeature.cpp index a9cb647f88..51a5cacb12 100644 --- a/ApplicationCode/Commands/RicCreateTemporaryLgrFeature.cpp +++ b/ApplicationCode/Commands/RicCreateTemporaryLgrFeature.cpp @@ -23,6 +23,7 @@ #include "RiaCompletionTypeCalculationScheduler.h" #include "RiaLogging.h" +#include "RicDeleteTemporaryLgrsFeature.h" #include "CompletionExportCommands/RicWellPathExportCompletionDataFeature.h" #include "ExportCommands/RicExportLgrFeature.h" #include "ExportCommands/RicExportLgrUi.h" @@ -171,6 +172,8 @@ void RicCreateTemporaryLgrFeature::onActionTriggered(bool isChecked) auto splitType = dialogData->splitType(); const auto completionTypes = dialogData->completionTypes(); + RicDeleteTemporaryLgrsFeature::deleteAllTemporaryLgrs(eclipseCase); + bool intersectingOtherLgrs = false; for (const auto& wellPath : wellPaths) { diff --git a/ApplicationCode/Commands/RicDeleteTemporaryLgrsFeature.cpp b/ApplicationCode/Commands/RicDeleteTemporaryLgrsFeature.cpp index d21641e207..cf236e7858 100644 --- a/ApplicationCode/Commands/RicDeleteTemporaryLgrsFeature.cpp +++ b/ApplicationCode/Commands/RicDeleteTemporaryLgrsFeature.cpp @@ -29,6 +29,14 @@ CAF_CMD_SOURCE_INIT(RicDeleteTemporaryLgrsFeature, "RicDeleteTemporaryLgrsFeature"); +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicDeleteTemporaryLgrsFeature::deleteAllTemporaryLgrs(RimEclipseCase* eclipseCase) +{ + if (eclipseCase) eclipseCase->reloadDataAndUpdate(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -49,7 +57,7 @@ void RicDeleteTemporaryLgrsFeature::onActionTriggered(bool isChecked) RimEclipseCase* eclipseCase; selGridInfos.front()->firstAncestorOrThisOfType(eclipseCase); - if (eclipseCase) eclipseCase->reloadDataAndUpdate(); + deleteAllTemporaryLgrs(eclipseCase); } } diff --git a/ApplicationCode/Commands/RicDeleteTemporaryLgrsFeature.h b/ApplicationCode/Commands/RicDeleteTemporaryLgrsFeature.h index 880778d77b..bcb1411a5e 100644 --- a/ApplicationCode/Commands/RicDeleteTemporaryLgrsFeature.h +++ b/ApplicationCode/Commands/RicDeleteTemporaryLgrsFeature.h @@ -21,10 +21,14 @@ #include "cafCmdFeature.h" +class RimEclipseCase; + class RicDeleteTemporaryLgrsFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; + static void deleteAllTemporaryLgrs(RimEclipseCase* eclipseCase); + protected: bool isCommandEnabled() override; void onActionTriggered(bool isChecked) override;