#2734 Perforation Intervals: Prepare for stop date

This commit is contained in:
Magne Sjaastad 2018-05-23 15:26:27 +02:00
parent 28278c47ec
commit fc1f79a304
3 changed files with 39 additions and 15 deletions

View File

@ -93,7 +93,7 @@ void RicWellPathImportPerforationIntervalsFeature::onActionTriggered(bool isChec
}
else
{
perforationInterval->setDate(interval.date);
perforationInterval->setStartDate(interval.date);
}
wellPath->perforationIntervalCollection()->appendPerforation(perforationInterval);
lastPerforationInterval = perforationInterval;

View File

@ -41,7 +41,7 @@ RimPerforationInterval::RimPerforationInterval()
CAF_PDM_InitField(&m_diameter, "Diameter", 0.216, "Diameter", "", "", "");
CAF_PDM_InitField(&m_skinFactor, "SkinFactor", 0.0, "Skin Factor", "", "", "");
CAF_PDM_InitField(&m_startOfHistory, "StartOfHistory", true, "All Timesteps", "", "", "");
CAF_PDM_InitField(&m_date, "StartDate", QDateTime::currentDateTime(), "Start Date", "", "", "");
CAF_PDM_InitField(&m_startDate, "StartDate", QDateTime::currentDateTime(), "Start Date", "", "", "");
nameField()->uiCapability()->setUiReadOnly(true);
}
@ -69,16 +69,16 @@ void RimPerforationInterval::setStartOfHistory()
{
m_startOfHistory = true;
m_date.uiCapability()->setUiReadOnly(m_startOfHistory());
m_startDate.uiCapability()->setUiReadOnly(m_startOfHistory());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPerforationInterval::setDate(const QDate& date)
void RimPerforationInterval::setStartDate(const QDate& date)
{
m_startOfHistory = false;
m_date = QDateTime(date);
m_startDate = QDateTime(date);
}
//--------------------------------------------------------------------------------------------------
@ -97,6 +97,22 @@ void RimPerforationInterval::setSkinFactor(double skinFactor)
m_skinFactor = skinFactor;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimPerforationInterval::startMD() const
{
return m_startMD();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimPerforationInterval::endMD() const
{
return m_endMD();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -115,6 +131,14 @@ double RimPerforationInterval::diameter(RiaEclipseUnitTools::UnitSystem unitSyst
return m_diameter();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimPerforationInterval::skinFactor() const
{
return m_skinFactor();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -127,7 +151,7 @@ bool RimPerforationInterval::isActiveOnDate(const QDateTime& date) const
if (!date.isValid()) return false;
return m_date() < date;
return m_startDate() < date;
}
//--------------------------------------------------------------------------------------------------
@ -178,7 +202,7 @@ void RimPerforationInterval::fieldChangedByUi(const caf::PdmFieldHandle* changed
if (changedField == &m_startOfHistory)
{
m_date.uiCapability()->setUiReadOnly(m_startOfHistory());
m_startDate.uiCapability()->setUiReadOnly(m_startOfHistory());
}
RimProject* proj;
@ -218,14 +242,14 @@ void RimPerforationInterval::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
}
}
}
m_date.uiCapability()->setUiReadOnly(m_startOfHistory());
m_startDate.uiCapability()->setUiReadOnly(m_startOfHistory());
uiOrdering.add(&m_startMD);
uiOrdering.add(&m_endMD);
uiOrdering.add(&m_diameter);
uiOrdering.add(&m_skinFactor);
uiOrdering.add(&m_startOfHistory);
uiOrdering.add(&m_date);
uiOrdering.add(&m_startDate);
uiOrdering.skipRemainingFields();
}
@ -235,7 +259,7 @@ void RimPerforationInterval::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
//--------------------------------------------------------------------------------------------------
void RimPerforationInterval::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
{
if (field == &m_date)
if (field == &m_startDate)
{
caf::PdmUiDateEditorAttribute* myAttr = static_cast<caf::PdmUiDateEditorAttribute*>(attribute);
if (myAttr)

View File

@ -42,13 +42,13 @@ public:
void setStartAndEndMD(double startMD, double endMD);
void setStartOfHistory();
void setDate(const QDate& date);
void setStartDate(const QDate& date);
void setDiameter(double diameter);
void setSkinFactor(double skinFactor);
double startMD() const { return m_startMD(); }
double endMD() const { return m_endMD(); }
double startMD() const;
double endMD() const;
double diameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
double skinFactor() const { return m_skinFactor(); }
double skinFactor() const;
bool isActiveOnDate(const QDateTime& date) const;
@ -68,5 +68,5 @@ private:
caf::PdmField< double > m_diameter;
caf::PdmField< double > m_skinFactor;
caf::PdmField< bool > m_startOfHistory;
caf::PdmField< QDateTime > m_date;
caf::PdmField< QDateTime > m_startDate;
};