#1618 Changing proxy fields from double to QString to have more control over the output and limit accuracy of numbers printed.

This commit is contained in:
astridkbjorke
2017-06-29 11:28:30 +02:00
parent dad066adf0
commit e7043db156
2 changed files with 22 additions and 5 deletions

View File

@@ -101,10 +101,10 @@ RimFracture::RimFracture(void)
CAF_PDM_InitField(&stimPlanTimeIndexToPlot, "timeIndexToPlot", 0, "StimPlan Time Step", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_uiWellPathAzimuth, "WellPathAzimuth", "Well Path Azimuth", "", "", "");
m_uiWellPathAzimuth.registerGetMethod(this, &RimFracture::wellAzimuthAtFracturePosition);
m_uiWellPathAzimuth.registerGetMethod(this, &RimFracture::wellAzimuthAtFracturePositionText);
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.registerGetMethod(this, &RimFracture::wellFractureAzimuthDiffText);
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);
@@ -189,6 +189,21 @@ double RimFracture::wellFractureAzimuthDiff() const
return wellDifference;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFracture::wellFractureAzimuthDiffText() const
{
double wellDifference = wellFractureAzimuthDiff();
return QString::number(wellDifference, 'f', 2);
}
QString RimFracture::wellAzimuthAtFracturePositionText() const
{
double wellAzimuth = wellAzimuthAtFracturePosition();
return QString::number(wellAzimuth, 'f', 2);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -106,7 +106,9 @@ private:
cvf::Vec3d fracturePositionForUi() const;
double wellFractureAzimuthDiff() const;
QString wellFractureAzimuthDiffText() const;
QString wellAzimuthAtFracturePositionText() const;
virtual cvf::BoundingBox boundingBoxInDomainCoords() override;
protected:
@@ -114,8 +116,8 @@ protected:
caf::PdmProxyValueField<cvf::Vec3d> m_uiAnchorPosition;
caf::PdmField< RiaEclipseUnitTools::UnitSystemType > m_fractureUnit;
caf::PdmProxyValueField<double> m_uiWellPathAzimuth;
caf::PdmProxyValueField<double> m_uiWellFractureAzimuthDiff;
caf::PdmProxyValueField<QString> m_uiWellPathAzimuth;
caf::PdmProxyValueField<QString> m_uiWellFractureAzimuthDiff;
caf::PdmField<QString> m_wellFractureAzimuthAngleWarning;