From d3bcc1644cf682e21be667751e569eb17d91a7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Grip=20Fj=C3=A6r?= Date: Thu, 11 May 2017 13:33:18 +0200 Subject: [PATCH] #1451 Add data structures for perforation intervals --- .../ProjectDataModel/CMakeLists_files.cmake | 4 + .../RimPerforationCollection.cpp | 85 +++++++++++++++++++ .../RimPerforationCollection.h | 48 +++++++++++ .../RimPerforationInterval.cpp | 72 ++++++++++++++++ .../ProjectDataModel/RimPerforationInterval.h | 47 ++++++++++ .../ProjectDataModel/RimWellPath.cpp | 9 ++ .../ProjectDataModel/RimWellPath.h | 2 + 7 files changed, 267 insertions(+) create mode 100644 ApplicationCode/ProjectDataModel/RimPerforationCollection.cpp create mode 100644 ApplicationCode/ProjectDataModel/RimPerforationCollection.h create mode 100644 ApplicationCode/ProjectDataModel/RimPerforationInterval.cpp create mode 100644 ApplicationCode/ProjectDataModel/RimPerforationInterval.h diff --git a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake index 8241efe4f1..fafdfbc7b4 100644 --- a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake @@ -16,6 +16,8 @@ ${CEE_CURRENT_LIST_DIR}RimCellRangeFilterCollection.h ${CEE_CURRENT_LIST_DIR}RimDefines.h ${CEE_CURRENT_LIST_DIR}RimLegendConfig.h ${CEE_CURRENT_LIST_DIR}RimOilField.h +${CEE_CURRENT_LIST_DIR}RimPerforationCollection.h +${CEE_CURRENT_LIST_DIR}RimPerforationInterval.h ${CEE_CURRENT_LIST_DIR}RimProject.h ${CEE_CURRENT_LIST_DIR}RimEclipseCase.h ${CEE_CURRENT_LIST_DIR}RimIdenticalGridCaseGroup.h @@ -106,6 +108,8 @@ ${CEE_CURRENT_LIST_DIR}RimCellRangeFilterCollection.cpp ${CEE_CURRENT_LIST_DIR}RimDefines.cpp ${CEE_CURRENT_LIST_DIR}RimLegendConfig.cpp ${CEE_CURRENT_LIST_DIR}RimOilField.cpp +${CEE_CURRENT_LIST_DIR}RimPerforationCollection.cpp +${CEE_CURRENT_LIST_DIR}RimPerforationInterval.cpp ${CEE_CURRENT_LIST_DIR}RimProject.cpp ${CEE_CURRENT_LIST_DIR}RimEclipseCase.cpp ${CEE_CURRENT_LIST_DIR}RimIdenticalGridCaseGroup.cpp diff --git a/ApplicationCode/ProjectDataModel/RimPerforationCollection.cpp b/ApplicationCode/ProjectDataModel/RimPerforationCollection.cpp new file mode 100644 index 0000000000..b1012729e7 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimPerforationCollection.cpp @@ -0,0 +1,85 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- Ceetron Solutions AS +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimPerforationCollection.h" + +#include "RimEclipseWell.h" +#include "RimPerforationInterval.h" +#include "RimView.h" +#include "RimProject.h" + +#include "RigWellPath.h" + +#include "RifWellPathImporter.h" + +#include "RiuMainWindow.h" + + +CAF_PDM_SOURCE_INIT(RimPerforationCollection, "PerforationCollection"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationCollection::RimPerforationCollection() +{ + CAF_PDM_InitObject("Perforations", ":/Folder.png", "", ""); + + m_name.uiCapability()->setUiHidden(true); + m_name = "Perforations"; + + CAF_PDM_InitFieldNoDefault(&m_perforations, "Perforations", "Perforations", "", "", ""); + m_perforations.uiCapability()->setUiHidden(true); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationCollection::~RimPerforationCollection() +{ + m_perforations.deleteAllChildObjects(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) +{ + RimProject* proj; + this->firstAncestorOrThisOfTypeAsserted(proj); + proj->createDisplayModelAndRedrawAllViews(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationCollection::appendPerforation(RimPerforationInterval* perforation) +{ + m_perforations.push_back(perforation); + + updateConnectedEditors(); + RiuMainWindow::instance()->selectAsCurrentItem(perforation); + + RimView* rimView = NULL; + firstAncestorOrThisOfType(rimView); + if (rimView) + { + rimView->scheduleCreateDisplayModelAndRedraw(); + } +} + diff --git a/ApplicationCode/ProjectDataModel/RimPerforationCollection.h b/ApplicationCode/ProjectDataModel/RimPerforationCollection.h new file mode 100644 index 0000000000..df612c31bb --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimPerforationCollection.h @@ -0,0 +1,48 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- Ceetron Solutions AS +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimCheckableNamedObject.h" + +#include "cafPdmObject.h" +#include "cafPdmChildArrayField.h" +#include "cafPdmField.h" + +class RimPerforationInterval; + +//================================================================================================== +// +// +// +//================================================================================================== +class RimPerforationCollection : public RimCheckableNamedObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimPerforationCollection(); + ~RimPerforationCollection(); + + void appendPerforation(RimPerforationInterval* perforation); + + void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); + + caf::PdmChildArrayField m_perforations; +}; diff --git a/ApplicationCode/ProjectDataModel/RimPerforationInterval.cpp b/ApplicationCode/ProjectDataModel/RimPerforationInterval.cpp new file mode 100644 index 0000000000..121213575f --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimPerforationInterval.cpp @@ -0,0 +1,72 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011- Statoil ASA +// Copyright (C) 2013- Ceetron Solutions AS +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimPerforationInterval.h" + +#include "RimProject.h" + +#include "cafPdmUiListEditor.h" +#include "cafPdmUiTextEditor.h" + +CAF_PDM_SOURCE_INIT(RimPerforationInterval, "Perforation"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationInterval::RimPerforationInterval() +{ + CAF_PDM_InitObject("Perforation", ":/Default.png", "", ""); + m_name = "Perforation"; + CAF_PDM_InitField(&m_startMD, "StartMeasuredDepth", 0.0, "Start MD [m]", "", "", ""); + CAF_PDM_InitField(&m_endMD, "EndMeasuredDepth", 0.0, "End MD [m]", "", "", ""); + CAF_PDM_InitField(&m_radius, "Radius", 0.0, "Radius [m]", "", "", ""); + CAF_PDM_InitField(&m_skinFactor, "SkinFactor", 0.0, "Skin Factor", "", "", ""); +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationInterval::~RimPerforationInterval() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationInterval::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) +{ + RimProject* proj; + this->firstAncestorOrThisOfType(proj); + if (proj) proj->createDisplayModelAndRedrawAllViews(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationInterval::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + uiOrdering.add(&m_name); + + uiOrdering.add(&m_startMD); + uiOrdering.add(&m_endMD); + uiOrdering.add(&m_radius); + uiOrdering.add(&m_skinFactor); +} + diff --git a/ApplicationCode/ProjectDataModel/RimPerforationInterval.h b/ApplicationCode/ProjectDataModel/RimPerforationInterval.h new file mode 100644 index 0000000000..1ba761c90b --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimPerforationInterval.h @@ -0,0 +1,47 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011- Statoil ASA +// Copyright (C) 2013- Ceetron Solutions AS +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimCheckableNamedObject.h" + +#include "cafPdmField.h" +#include "cafPdmObject.h" + +//================================================================================================== +/// +/// +//================================================================================================== +class RimPerforationInterval : public RimCheckableNamedObject +{ + CAF_PDM_HEADER_INIT; +public: + + RimPerforationInterval(); + virtual ~RimPerforationInterval(); + + virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + +private: + caf::PdmField< double > m_startMD; + caf::PdmField< double > m_endMD; + caf::PdmField< double > m_radius; + caf::PdmField< double > m_skinFactor; +}; diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.cpp b/ApplicationCode/ProjectDataModel/RimWellPath.cpp index d29ac75678..5197da21ed 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPath.cpp @@ -31,6 +31,7 @@ #include "RimWellLogPlotCollection.h" #include "RimWellPathCollection.h" #include "RimWellPathCompletionCollection.h" +#include "RimPerforationCollection.h" #include "RimFishbonesMultipleSubs.h" @@ -105,6 +106,10 @@ RimWellPath::RimWellPath() CAF_PDM_InitFieldNoDefault(&m_completionCollection, "Completions", "Completions", "", "", ""); m_completionCollection = new RimWellPathCompletionCollection; m_completionCollection.uiCapability()->setUiHidden(true); + + CAF_PDM_InitFieldNoDefault(&m_perforationCollection, "Perforations", "Perforations", "", "", ""); + m_perforationCollection = new RimPerforationCollection; + m_perforationCollection.uiCapability()->setUiHidden(true); CAF_PDM_InitFieldNoDefault(&m_wellLogFile, "WellLogFile", "Well Log File", "", "", ""); m_wellLogFile.uiCapability()->setUiHidden(true); @@ -288,6 +293,10 @@ void RimWellPath::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, Q { uiTreeOrdering.add(&m_completionCollection); } + if (!m_perforationCollection->m_perforations.empty()) + { + uiTreeOrdering.add(&m_perforationCollection); + } uiTreeOrdering.add(&fishbonesSubs); } diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.h b/ApplicationCode/ProjectDataModel/RimWellPath.h index 4c33bb802a..be5a31c372 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.h +++ b/ApplicationCode/ProjectDataModel/RimWellPath.h @@ -40,6 +40,7 @@ class RimWellPathCompletionCollection; class RivWellPathPartMgr; class RimFishbonesMultipleSubs; +class RimPerforationCollection; //================================================================================================== /// @@ -73,6 +74,7 @@ public: caf::PdmChildField m_wellLogFile; caf::PdmChildField m_completionCollection; + caf::PdmChildField m_perforationCollection; RigWellPath* wellPathGeometry(); caf::PdmChildArrayField fishbonesSubs;