#3267 MSW export. Add Max Segment Length field to MSW properties

This commit is contained in:
Bjørn Erik Jensen
2018-09-11 10:41:20 +02:00
parent 086fbd6756
commit 244741d96b
3 changed files with 42 additions and 2 deletions

View File

@@ -19,6 +19,9 @@
#include "RimWellPath.h"
#include "cafPdmUiObjectEditorHandle.h"
#include <limits>
namespace caf {
template<>
@@ -52,6 +55,10 @@ RimMswCompletionParameters::RimMswCompletionParameters()
CAF_PDM_InitFieldNoDefault(&m_pressureDrop, "PressureDrop", "Pressure Drop", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_lengthAndDepth, "LengthAndDepth", "Length and Depth", "", "", "");
CAF_PDM_InitField(&m_enforceMaxSegmentLength, "EnforceMaxSegmentLength", false, "Enforce Max Segment Length", "", "", "");
CAF_PDM_InitField(&m_maxSegmentLength, "MaxSegmentLength", 10.0, "Max Segment Length", "", "", "");
m_maxSegmentLength.uiCapability()->setUiHidden(true);
}
//--------------------------------------------------------------------------------------------------
@@ -144,6 +151,14 @@ RimMswCompletionParameters::LengthAndDepthEnum RimMswCompletionParameters::lengt
return m_lengthAndDepth();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimMswCompletionParameters::maxSegmentLength() const
{
return m_enforceMaxSegmentLength ? m_maxSegmentLength : std::numeric_limits<double>::infinity();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -176,6 +191,18 @@ void RimMswCompletionParameters::setLengthAndDepth(LengthAndDepthType lengthAndD
m_lengthAndDepth = lengthAndDepthType;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMswCompletionParameters::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
if (changedField == &m_enforceMaxSegmentLength)
{
m_maxSegmentLength.uiCapability()->setUiHidden(!m_enforceMaxSegmentLength());
caf::PdmUiObjectEditorHandle::updateUiAllObjectEditors();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -203,6 +230,10 @@ void RimMswCompletionParameters::defineUiOrdering(QString uiConfigName, caf::Pdm
uiOrdering.add(&m_roughnessFactor);
uiOrdering.add(&m_pressureDrop);
uiOrdering.add(&m_lengthAndDepth);
uiOrdering.add(&m_enforceMaxSegmentLength);
uiOrdering.add(&m_maxSegmentLength);
uiOrdering.skipRemainingFields(true);
}
//--------------------------------------------------------------------------------------------------