#1618 Using proxy-fields for wellpathazimuth and wellFractureAzimuthDifference

This commit is contained in:
astridkbjorke 2017-06-29 10:34:20 +02:00
parent 2625ce6ea9
commit dad066adf0
6 changed files with 41 additions and 43 deletions

View File

@ -100,9 +100,14 @@ RimFracture::RimFracture(void)
CAF_PDM_InitField(&stimPlanTimeIndexToPlot, "timeIndexToPlot", 0, "StimPlan Time Step", "", "", "");
CAF_PDM_InitField(&m_wellPathAzimuth, "WellPathAzimuth", 0.0, "Well Path Azimuth", "", "", "");
CAF_PDM_InitField(&m_wellFractureAzimuthDiff, "WellFractureAzimuthDiff", 0.0, "Azimuth Difference Between Fracture and Well", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_uiWellPathAzimuth, "WellPathAzimuth", "Well Path Azimuth", "", "", "");
m_uiWellPathAzimuth.registerGetMethod(this, &RimFracture::wellAzimuthAtFracturePosition);
m_uiWellPathAzimuth.uiCapability()->setUiReadOnly(true);
CAF_PDM_InitFieldNoDefault(&m_uiWellFractureAzimuthDiff, "WellFractureAzimuthDiff", "Azimuth Difference Between Fracture and Well", "", "", "");
m_uiWellFractureAzimuthDiff.registerGetMethod(this, &RimFracture::wellFractureAzimuthDiff);
m_uiWellFractureAzimuthDiff.uiCapability()->setUiReadOnly(true);
CAF_PDM_InitField(&m_wellFractureAzimuthAngleWarning, "WellFractureAzimithAngleWarning", QString("Difference is below 10 degrees. Consider longitudinal fracture"), "", "", "", "");
m_wellFractureAzimuthAngleWarning.uiCapability()->setUiReadOnly(true);
m_fracturePartMgr = new RivWellFracturePartMgr(this);
}
@ -163,7 +168,6 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
this->firstAncestorOrThisOfTypeAsserted(proj);
proj->reloadCompletionTypeResultsInAllViews();
}
setWellFractureAzimuthDiffAndWarning();
}
}
@ -176,6 +180,15 @@ cvf::Vec3d RimFracture::fracturePosition() const
return m_anchorPosition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFracture::wellFractureAzimuthDiff() const
{
double wellDifference = abs(wellAzimuthAtFracturePosition() - azimuth);
return wellDifference;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -352,10 +365,6 @@ QList<caf::PdmOptionItemInfo> RimFracture::calculateValueOptions(const caf::PdmF
//--------------------------------------------------------------------------------------------------
void RimFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
m_wellPathAzimuth.uiCapability()->setUiReadOnly(true);
m_wellFractureAzimuthDiff.uiCapability()->setUiReadOnly(true);
m_wellFractureAzimuthAngleWarning.uiCapability()->setUiReadOnly(true);
if (m_fractureUnit() == RiaEclipseUnitTools::UNITS_METRIC)
{
wellDiameter.uiCapability()->setUiName("Well Diameter [m]");
@ -372,18 +381,24 @@ void RimFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiO
if (fractureTemplate()->orientationType == RimFractureTemplate::ALONG_WELL_PATH
|| fractureTemplate()->orientationType == RimFractureTemplate::TRANSVERSE_WELL_PATH)
{
m_uiWellPathAzimuth.uiCapability()->setUiHidden(true);
m_uiWellFractureAzimuthDiff.uiCapability()->setUiHidden(true);
m_wellFractureAzimuthAngleWarning.uiCapability()->setUiHidden(true);
}
else if (fractureTemplate()->orientationType == RimFractureTemplate::AZIMUTH)
{
if (abs(m_wellFractureAzimuthDiff) > 10)
m_uiWellPathAzimuth.uiCapability()->setUiHidden(false);
m_uiWellFractureAzimuthDiff.uiCapability()->setUiHidden(false);
if (wellFractureAzimuthDiff() < 10
|| (wellFractureAzimuthDiff() > 170 && wellFractureAzimuthDiff() < 190 )
|| wellFractureAzimuthDiff() > 350)
{
m_wellFractureAzimuthAngleWarning.uiCapability()->setUiHidden(true);
m_wellFractureAzimuthAngleWarning.uiCapability()->setUiHidden(false);
}
else
{
m_wellFractureAzimuthAngleWarning.uiCapability()->setUiHidden(false);
m_wellFractureAzimuthAngleWarning.uiCapability()->setUiHidden(true);
}
}
@ -438,18 +453,6 @@ void RimFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiO
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFracture::setWellFractureAzimuthDiffAndWarning() //TODO: updateWellFra
{
double wellFractureDiffAngle = abs(m_wellPathAzimuth - azimuth);
if (wellFractureDiffAngle > 180) wellFractureDiffAngle = 360 - wellFractureDiffAngle;
m_wellFractureAzimuthDiff = wellFractureDiffAngle;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -94,16 +94,17 @@ public:
cvf::Vec3d fracturePosition() const;
virtual void updateAzimuthFromFractureTemplate() = 0;
virtual double wellAzimuthAtFracturePosition() = 0;
virtual double wellAzimuthAtFracturePosition() const = 0;
protected:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
void setWellFractureAzimuthDiffAndWarning();
private:
cvf::Vec3d fracturePositionForUi() const;
double wellFractureAzimuthDiff() const;
virtual cvf::BoundingBox boundingBoxInDomainCoords() override;
@ -113,8 +114,8 @@ protected:
caf::PdmProxyValueField<cvf::Vec3d> m_uiAnchorPosition;
caf::PdmField< RiaEclipseUnitTools::UnitSystemType > m_fractureUnit;
caf::PdmField<double> m_wellPathAzimuth;
caf::PdmField<double> m_wellFractureAzimuthDiff;
caf::PdmProxyValueField<double> m_uiWellPathAzimuth;
caf::PdmProxyValueField<double> m_uiWellFractureAzimuthDiff;
caf::PdmField<QString> m_wellFractureAzimuthAngleWarning;

View File

@ -79,6 +79,8 @@ void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branch
//--------------------------------------------------------------------------------------------------
void RimSimWellFracture::updateAzimuthFromFractureTemplate()
{
updateBranchGeometry();
RimFractureTemplate::FracOrientationEnum orientation;
if (fractureTemplate()) orientation = fractureTemplate()->orientationType();
else orientation = RimFractureTemplate::AZIMUTH;
@ -107,9 +109,8 @@ void RimSimWellFracture::updateAzimuthFromFractureTemplate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimSimWellFracture::wellAzimuthAtFracturePosition()
double RimSimWellFracture::wellAzimuthAtFracturePosition() const
{
updateBranchGeometry();
double simWellAzimuth = m_branchCenterLines[m_branchIndex].simWellAzimuthAngle(fracturePosition());
if (simWellAzimuth < 0) simWellAzimuth += 360;
@ -180,8 +181,6 @@ void RimSimWellFracture::updateFracturePositionFromLocation()
this->firstAncestorOrThisOfType(proj);
if (proj) proj->createDisplayModelAndRedrawAllViews();
}
m_wellPathAzimuth = wellAzimuthAtFracturePosition();
setWellFractureAzimuthDiffAndWarning();
}
@ -199,8 +198,8 @@ void RimSimWellFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderi
locationGroup->add(&m_location);
locationGroup->add(&m_branchIndex);
locationGroup->add(&azimuth);
locationGroup->add(&m_wellPathAzimuth);
locationGroup->add(&m_wellFractureAzimuthDiff);
locationGroup->add(&m_uiWellPathAzimuth);
locationGroup->add(&m_uiWellFractureAzimuthDiff);
locationGroup->add(&m_wellFractureAzimuthAngleWarning);
locationGroup->add(&dip);
locationGroup->add(&tilt);

View File

@ -44,7 +44,7 @@ public:
void updateFracturePositionFromLocation();
void updateAzimuthFromFractureTemplate() override;
double wellAzimuthAtFracturePosition() override;
double wellAzimuthAtFracturePosition() const override;
double wellDipAtFracturePosition();
int branchIndex() const { return m_branchIndex(); }

View File

@ -118,13 +118,10 @@ void RimWellPathFracture::updateAzimuthFromFractureTemplate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellPathFracture::wellAzimuthAtFracturePosition()
double RimWellPathFracture::wellAzimuthAtFracturePosition() const
{
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(this);
if (!objHandle) return cvf::UNDEFINED_DOUBLE;
RimWellPath* wellPath = nullptr;
objHandle->firstAncestorOrThisOfType(wellPath);
this->firstAncestorOrThisOfType(wellPath);
if (!wellPath) return cvf::UNDEFINED_DOUBLE;
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
@ -153,8 +150,6 @@ void RimWellPathFracture::updatePositionFromMeasuredDepth()
positionAlongWellpath = wellPathGeometry->interpolatedPointAlongWellPath(m_measuredDepth());
this->setAnchorPosition(positionAlongWellpath);
m_wellPathAzimuth = wellAzimuthAtFracturePosition();
setWellFractureAzimuthDiffAndWarning();
}
//--------------------------------------------------------------------------------------------------
@ -170,8 +165,8 @@ void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
caf::PdmUiGroup* locationGroup = uiOrdering.addNewGroup("Location / Orientation");
locationGroup->add(&m_measuredDepth);
locationGroup->add(&azimuth);
locationGroup->add(&m_wellPathAzimuth);
locationGroup->add(&m_wellFractureAzimuthDiff);
locationGroup->add(&m_uiWellPathAzimuth);
locationGroup->add(&m_uiWellFractureAzimuthDiff);
locationGroup->add(&m_wellFractureAzimuthAngleWarning);
locationGroup->add(&dip);
locationGroup->add(&tilt);

View File

@ -43,7 +43,7 @@ public:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
virtual void updateAzimuthFromFractureTemplate() override;
double wellAzimuthAtFracturePosition() override;
double wellAzimuthAtFracturePosition() const override;
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;