mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2044 Close LAS file. Update plots after LAS delete and import
This commit is contained in:
@@ -19,10 +19,19 @@
|
||||
|
||||
#include "RicWellLogFileCloseFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellPltPlot.h"
|
||||
#include "RimWellRftPlot.h"
|
||||
#include "RimWellAllocationPlot.h"
|
||||
#include "RimViewWindow.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
#include "cafPdmObjectHandle.h"
|
||||
#include "cafPdmUiObjectEditorHandle.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
@@ -53,10 +62,18 @@ void RicWellLogFileCloseFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
if (parentWellPath != nullptr)
|
||||
{
|
||||
std::set<RimViewWindow*> referringPlots = referringWellLogPlots(wellLogFile);
|
||||
parentWellPath->deleteWellLogFile(wellLogFile);
|
||||
|
||||
for (RimViewWindow* plot : referringPlots)
|
||||
{
|
||||
plot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
parentWellPath->updateConnectedEditors();
|
||||
}
|
||||
|
||||
caf::PdmUiObjectEditorHandle::updateUiAllObjectEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -67,3 +84,40 @@ void RicWellLogFileCloseFeature::setupActionLook(QAction* actionToSetup)
|
||||
actionToSetup->setText("Close Well Log File(s)");
|
||||
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RimViewWindow*> RicWellLogFileCloseFeature::referringWellLogPlots(const RimWellLogFile* wellLogFile)
|
||||
{
|
||||
// Remove all curves displaying data from the specified wellLogFile
|
||||
std::vector<caf::PdmObjectHandle*> referringObjects;
|
||||
wellLogFile->objectsWithReferringPtrFields(referringObjects);
|
||||
|
||||
std::set<RimViewWindow*> plots;
|
||||
for (const auto& obj : referringObjects)
|
||||
{
|
||||
RimWellAllocationPlot* allocationPlot;
|
||||
RimWellPltPlot* pltPlot;
|
||||
RimWellRftPlot* rftPlot;
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
|
||||
obj->firstAncestorOrThisOfType(allocationPlot);
|
||||
obj->firstAncestorOrThisOfType(pltPlot);
|
||||
obj->firstAncestorOrThisOfType(rftPlot);
|
||||
obj->firstAncestorOrThisOfType(wellLogPlot);
|
||||
|
||||
RimViewWindow* plot =
|
||||
allocationPlot ? dynamic_cast<RimViewWindow*>(allocationPlot) :
|
||||
pltPlot ? dynamic_cast<RimViewWindow*>(pltPlot) :
|
||||
rftPlot ? dynamic_cast<RimViewWindow*>(rftPlot) :
|
||||
wellLogPlot ? dynamic_cast<RimViewWindow*>(wellLogPlot) :
|
||||
nullptr;
|
||||
|
||||
if (plot != nullptr)
|
||||
{
|
||||
plots.insert(plot);
|
||||
}
|
||||
}
|
||||
return plots;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user