mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3161 Implement Well path attribute table
This commit is contained in:
@@ -27,6 +27,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellPath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.h
|
||||
@@ -145,6 +147,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellPath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.cpp
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "RimTools.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimWellPathAttributeCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathCompletions.h"
|
||||
#include "RimWellPathFracture.h"
|
||||
@@ -115,6 +116,11 @@ RimWellPath::RimWellPath()
|
||||
m_wellLogFile_OBSOLETE.uiCapability()->setUiHidden(true);
|
||||
m_wellLogFile_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellPathAttributes, "WellPathAttributes", "", "", "", "");
|
||||
m_wellPathAttributes = new RimWellPathAttributeCollection;
|
||||
m_wellPathAttributes->uiCapability()->setUiTreeHidden(true);
|
||||
m_wellPathAttributes->uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
m_wellPath = nullptr;
|
||||
}
|
||||
|
||||
@@ -463,6 +469,8 @@ void RimWellPath::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiO
|
||||
formationFileInfoGroup->add(&m_wellPathFormationFilePath);
|
||||
formationFileInfoGroup->add(&m_formationKeyInFile);
|
||||
|
||||
m_wellPathAttributes->uiOrdering(uiConfigName, uiOrdering);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ class RimFishboneWellPathCollection;
|
||||
|
||||
class RimFishbonesCollection;
|
||||
class RimPerforationCollection;
|
||||
class RimWellPathAttributeCollection;
|
||||
class RimWellPathCompletions;
|
||||
class RigWellPathFormations;
|
||||
|
||||
@@ -152,9 +153,10 @@ private:
|
||||
caf::PdmField<double> m_wellPathRadiusScaleFactor;
|
||||
caf::PdmField<cvf::Color3f> m_wellPathColor;
|
||||
|
||||
caf::PdmChildArrayField<RimWellLogFile*> m_wellLogFiles;
|
||||
caf::PdmChildField<Rim3dWellLogCurveCollection*> m_3dWellLogCurves;
|
||||
caf::PdmChildField<RimWellPathCompletions*> m_completions;
|
||||
caf::PdmChildArrayField<RimWellLogFile*> m_wellLogFiles;
|
||||
caf::PdmChildField<Rim3dWellLogCurveCollection*> m_3dWellLogCurves;
|
||||
caf::PdmChildField<RimWellPathCompletions*> m_completions;
|
||||
caf::PdmChildField<RimWellPathAttributeCollection*> m_wellPathAttributes;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
107
ApplicationCode/ProjectDataModel/RimWellPathAttribute.cpp
Normal file
107
ApplicationCode/ProjectDataModel/RimWellPathAttribute.cpp
Normal file
@@ -0,0 +1,107 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 - Equinor ASA
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimWellPathAttribute.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellPathAttribute, "WellPathAttribute");
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void caf::AppEnum<RimWellPathAttribute::AttributeType>::setUp()
|
||||
{
|
||||
addItem(RimWellPathAttribute::AttributeCasing, "CASING", "Casing");
|
||||
addItem(RimWellPathAttribute::AttributeLining, "LINING", "Lining");
|
||||
setDefault(RimWellPathAttribute::AttributeCasing);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathAttribute::RimWellPathAttribute()
|
||||
{
|
||||
CAF_PDM_InitObject("RimWellPathAttribute", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_type, "AttributeType", "Type ", "", "", "");
|
||||
CAF_PDM_InitField(&m_depthStart, "DepthStart", 0.0, "Depth Start", "", "", "");
|
||||
CAF_PDM_InitField(&m_depthEnd, "DepthEnd", 0.0, "Depth End", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_label, "Label", "Label", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathAttribute::~RimWellPathAttribute()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathAttribute::AttributeType RimWellPathAttribute::type() const
|
||||
{
|
||||
return m_type();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathAttribute::depthStart() const
|
||||
{
|
||||
return m_depthStart();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathAttribute::depthEnd() const
|
||||
{
|
||||
return m_depthEnd();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathAttribute::label() const
|
||||
{
|
||||
return m_label();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttribute::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &m_type)
|
||||
{
|
||||
if (m_type() == AttributeCasing)
|
||||
{
|
||||
m_depthEnd = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttribute::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
m_depthEnd.uiCapability()->setUiReadOnly(m_type() == AttributeCasing);
|
||||
}
|
||||
56
ApplicationCode/ProjectDataModel/RimWellPathAttribute.h
Normal file
56
ApplicationCode/ProjectDataModel/RimWellPathAttribute.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 - Equinor ASA
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RimWellPathAttribute : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
enum AttributeType
|
||||
{
|
||||
AttributeCasing,
|
||||
AttributeLining
|
||||
};
|
||||
typedef caf::AppEnum<AttributeType> AttributeTypeEnum;
|
||||
|
||||
RimWellPathAttribute();
|
||||
~RimWellPathAttribute();
|
||||
|
||||
AttributeType type() const;
|
||||
double depthStart() const;
|
||||
double depthEnd() const;
|
||||
QString label() const;
|
||||
|
||||
private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
caf::PdmField<AttributeTypeEnum> m_type;
|
||||
caf::PdmField<double> m_depthStart;
|
||||
caf::PdmField<double> m_depthEnd;
|
||||
caf::PdmField<QString> m_label;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 - Equinor ASA
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimWellPathAttributeCollection.h"
|
||||
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
#include "cafPdmUiTableViewEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellPathAttributeCollection, "WellPathAttributes");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathAttributeCollection::RimWellPathAttributeCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("WellPathAttributes", ":/Well.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_attributes, "Attributes", "", "", "", "");
|
||||
m_attributes.uiCapability()->setUiEditorTypeName(caf::PdmUiTableViewEditor::uiEditorTypeName());
|
||||
m_attributes.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_attributes.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
m_attributes.uiCapability()->setCustomContextMenuEnabled(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathAttributeCollection::~RimWellPathAttributeCollection()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPathAttribute*> RimWellPathAttributeCollection::attributes() const
|
||||
{
|
||||
std::vector<RimWellPathAttribute*> attrs;
|
||||
|
||||
for (auto attr : m_attributes)
|
||||
{
|
||||
attrs.push_back(attr.p());
|
||||
}
|
||||
return attrs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttributeCollection::insertAttribute(RimWellPathAttribute* insertBefore, RimWellPathAttribute* attribute)
|
||||
{
|
||||
size_t index = m_attributes.index(insertBefore);
|
||||
if (index < m_attributes.size())
|
||||
m_attributes.insert(index, attribute);
|
||||
else
|
||||
m_attributes.push_back(attribute);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttributeCollection::deleteAttribute(RimWellPathAttribute* attributeToDelete)
|
||||
{
|
||||
m_attributes.removeChildObject(attributeToDelete);
|
||||
delete attributeToDelete;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttributeCollection::defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu,
|
||||
QMenu* menu,
|
||||
QWidget* fieldEditorWidget)
|
||||
{
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
|
||||
menuBuilder << "RicNewWellPathAttributeFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicDeleteWellPathAttributeFeature";
|
||||
|
||||
menuBuilder.appendToMenu(menu);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttributeCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
caf::PdmUiGroup* attrGroup = uiOrdering.addNewGroup("Well Path Attributes");
|
||||
attrGroup->add(&m_attributes);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 - Equinor ASA
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "RimWellPathAttribute.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
class RimWellPathAttributeCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimWellPathAttributeCollection();
|
||||
~RimWellPathAttributeCollection();
|
||||
|
||||
std::vector<RimWellPathAttribute*> attributes() const;
|
||||
void insertAttribute(RimWellPathAttribute* insertBefore, RimWellPathAttribute* attribute);
|
||||
void deleteAttribute(RimWellPathAttribute* attributeToDelete);
|
||||
|
||||
protected:
|
||||
virtual void defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu, QMenu* menu, QWidget* fieldEditorWidget) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
private:
|
||||
caf::PdmChildArrayField<RimWellPathAttribute*> m_attributes;
|
||||
};
|
||||
@@ -124,7 +124,7 @@ void RimWellPathGeometryDef::deleteTarget(RimWellPathTarget* targetTodelete)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::appendTarget()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user