From f14cd3f1f735d0f4cb2fad4639033a4692691a39 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 19 Mar 2019 15:52:56 +0100 Subject: [PATCH] #4200 Grid Cross Plot : Improve text for annotation items --- .../RimPlotAxisAnnotation.cpp | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimPlotAxisAnnotation.cpp b/ApplicationCode/ProjectDataModel/RimPlotAxisAnnotation.cpp index 3d2f078799..0847e6ca7d 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotAxisAnnotation.cpp +++ b/ApplicationCode/ProjectDataModel/RimPlotAxisAnnotation.cpp @@ -94,17 +94,6 @@ void RimPlotAxisAnnotation::setEquilibriumData(RimEclipseCase* eclipseCas //-------------------------------------------------------------------------------------------------- QString RimPlotAxisAnnotation::name() const { - if (m_annotationType() == PL_EQUIL_WATER_OIL_CONTACT) - { - QString text = QString("WOC %1").arg(value()); - return text; - } - else if (m_annotationType() == PL_EQUIL_GAS_OIL_CONTACT) - { - QString text = QString("GOC %1").arg(value()); - return text; - } - return m_name(); } @@ -236,14 +225,24 @@ void RimPlotAxisAnnotation::updateName() { QString text; - if (m_annotationType() == PL_EQUIL_WATER_OIL_CONTACT) + if (m_annotationType() == PL_EQUIL_WATER_OIL_CONTACT || m_annotationType() == PL_EQUIL_GAS_OIL_CONTACT) { - text = QString("WOC %1").arg(value()); - } - else if (m_annotationType() == PL_EQUIL_GAS_OIL_CONTACT) - { - text = QString("GOC %1").arg(value()); - } + double diffBetweenTwoContactDepths = + std::fabs(selectedItem().gasOilContactDepth() - selectedItem().waterOilContactDepth()); - m_name = text; + if (diffBetweenTwoContactDepths < 0.1) + { + text = QString("GWC %1").arg(selectedItem().gasOilContactDepth()); + } + else if (m_annotationType() == PL_EQUIL_WATER_OIL_CONTACT) + { + text = QString("WOC %1").arg(value()); + } + else if (m_annotationType() == PL_EQUIL_GAS_OIL_CONTACT) + { + text = QString("GOC %1").arg(value()); + } + + m_name = text; + } }