mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3459 Set initial start and end depth from well path
This commit is contained in:
parent
fbc49e2b02
commit
461e3b87b8
@ -62,7 +62,14 @@ void RicNewWellPathAttributeFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimWellPathAttributeCollection* attributeCollection = nullptr;
|
||||
attributes[0]->firstAncestorOrThisOfTypeAsserted(attributeCollection);
|
||||
attributeCollection->insertAttribute(attributes[0], new RimWellPathAttribute);
|
||||
|
||||
RimWellPathAttribute* attribute = new RimWellPathAttribute;
|
||||
RimWellPath* wellPath = nullptr;
|
||||
attributeCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
|
||||
attribute->setDepthsFromWellPath(wellPath);
|
||||
attributeCollection->insertAttribute(attributes[0], attribute);
|
||||
|
||||
attributeCollection->updateAllRequiredEditors();
|
||||
return;
|
||||
}
|
||||
@ -74,7 +81,10 @@ void RicNewWellPathAttributeFeature::onActionTriggered(bool isChecked)
|
||||
wellPath->descendantsIncludingThisOfType(attributeCollections);
|
||||
if (!attributeCollections.empty())
|
||||
{
|
||||
attributeCollections[0]->insertAttribute(nullptr, new RimWellPathAttribute);
|
||||
RimWellPathAttribute* attribute = new RimWellPathAttribute;
|
||||
attribute->setDepthsFromWellPath(wellPath);
|
||||
|
||||
attributeCollections[0]->insertAttribute(nullptr, attribute);
|
||||
attributeCollections[0]->updateAllRequiredEditors();
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimWellPathAttribute.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "RimWellPathAttributeCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
@ -48,8 +49,8 @@ RimWellPathAttribute::RimWellPathAttribute()
|
||||
{
|
||||
CAF_PDM_InitObject("RimWellPathAttribute", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_type, "AttributeType", "Type ", "", "", "");
|
||||
CAF_PDM_InitField(&m_depthStart, "DepthStart", 0.0, "Start MD", "", "", "");
|
||||
CAF_PDM_InitField(&m_depthEnd, "DepthEnd", 0.0, "End MD", "", "", "");
|
||||
CAF_PDM_InitField(&m_depthStart, "DepthStart", -1.0, "Start MD", "", "", "");
|
||||
CAF_PDM_InitField(&m_depthEnd, "DepthEnd", -1.0, "End MD", "", "", "");
|
||||
CAF_PDM_InitField(&m_diameterInInches, "DiameterInInches", MAX_DIAMETER_IN_INCHES, "Diameter", "", "", "");
|
||||
m_diameterInInches.uiCapability()->setUiEditorTypeName(caf::PdmUiComboBoxEditor::uiEditorTypeName());
|
||||
}
|
||||
@ -133,6 +134,15 @@ bool RimWellPathAttribute::operator<(const RimWellPathAttribute& rhs) const
|
||||
return depthEnd() > rhs.depthEnd();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttribute::setDepthsFromWellPath(const RimWellPath* wellPath)
|
||||
{
|
||||
m_depthStart = wellPath->wellPathGeometry()->measureDepths().front();
|
||||
m_depthEnd = wellPath->wellPathGeometry()->measureDepths().back();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -186,7 +196,9 @@ void RimWellPathAttribute::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
|
||||
{
|
||||
if (m_type() == AttributeCasing)
|
||||
{
|
||||
m_depthStart = 0;
|
||||
RimWellPath* wellPath = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
m_depthStart = wellPath->wellPathGeometry()->measureDepths().front();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RimWellPath;
|
||||
|
||||
class RimWellPathAttribute : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
@ -45,7 +47,7 @@ public:
|
||||
AttributeFishbonesInterval,
|
||||
AttributeAICD,
|
||||
AttributeICD,
|
||||
AttributeICV,
|
||||
AttributeICV
|
||||
};
|
||||
typedef caf::AppEnum<AttributeType> AttributeTypeEnum;
|
||||
|
||||
@ -59,6 +61,7 @@ public:
|
||||
QString label() const;
|
||||
QString diameterLabel() const;
|
||||
bool operator<(const RimWellPathAttribute& rhs) const;
|
||||
void setDepthsFromWellPath(const RimWellPath* wellPath);
|
||||
|
||||
private:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
|
Loading…
Reference in New Issue
Block a user