#3864 Update and clamp valve positions to perforation interval when perforation interval changes.

This commit is contained in:
Gaute Lindkvist
2018-12-14 08:44:36 +01:00
parent 543b8fc1cc
commit 47bb14eb06
6 changed files with 82 additions and 35 deletions

View File

@@ -69,6 +69,25 @@ RimWellPathValve::~RimWellPathValve()
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathValve::perforationIntervalUpdated()
{
if (m_type() == RiaDefines::ICV)
{
const RimPerforationInterval* perfInterval = nullptr;
this->firstAncestorOrThisOfType(perfInterval);
double startMD = perfInterval->startMD();
double endMD = perfInterval->endMD();
m_measuredDepth = cvf::Math::clamp(m_measuredDepth(), startMD, endMD);
}
else
{
m_multipleValveLocations->perforationIntervalUpdated();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -436,19 +455,22 @@ void RimWellPathValve::defineEditorAttribute(const caf::PdmFieldHandle* field, Q
//--------------------------------------------------------------------------------------------------
void RimWellPathValve::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
{
QString fullName = componentLabel() + QString(" %1").arg(m_measuredDepth());
this->setName(fullName);
if ( m_type() == RiaDefines::ICD )
{
this->setUiIcon(QIcon(":/ICDValve16x16.png"));
}
else if ( m_type() == RiaDefines::ICV )
if ( m_type() == RiaDefines::ICV )
{
this->setUiIcon(QIcon(":/ICVValve16x16.png"));
QString fullName = QString("%1: %2").arg(componentLabel()).arg(m_measuredDepth());
this->setName(fullName);
}
else if ( m_type() == RiaDefines::ICD )
{
this->setUiIcon(QIcon(":/ICDValve16x16.png"));
QString fullName = QString("%1: %2 - %3").arg(componentLabel()).arg(m_multipleValveLocations->rangeStart()).arg(m_multipleValveLocations->rangeEnd());
this->setName(fullName);
}
else if ( m_type() == RiaDefines::AICD )
{
this->setUiIcon(QIcon(":/AICDValve16x16.png"));
QString fullName = QString("%1: %2 - %3").arg(componentLabel()).arg(m_multipleValveLocations->rangeStart()).arg(m_multipleValveLocations->rangeEnd());
this->setName(fullName);
}
}