mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3267 MSW export. Add Max Segment Length field to MSW properties
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user