#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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -51,6 +51,7 @@ public:
static double defaultRoughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem);
PressureDropEnum pressureDrop() const;
LengthAndDepthEnum lengthAndDepth() const;
double maxSegmentLength() const;
void setLinerDiameter(double diameter);
void setRoughnessFactor(double roughnessFactor);
void setPressureDrop(PressureDropType pressureDropType);
@@ -60,6 +61,9 @@ public:
void setUnitSystemSpecificDefaults();
protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue);
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void initAfterRead() override;
@@ -69,4 +73,7 @@ private:
caf::PdmField<PressureDropEnum> m_pressureDrop;
caf::PdmField<LengthAndDepthEnum> m_lengthAndDepth;
caf::PdmField<bool> m_enforceMaxSegmentLength;
caf::PdmField<double> m_maxSegmentLength;
};