#4200 Grid Cross Plot : Improve text for annotation items

This commit is contained in:
Magne Sjaastad
2019-03-19 15:52:56 +01:00
parent a07f375daf
commit f14cd3f1f7

View File

@@ -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;
}
}