mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3034 Perforation Interval: Set default start/end to start/end of simulation
This commit is contained in:
parent
9e7dd7d4ea
commit
74ced5107f
@ -89,7 +89,8 @@ void RicWellPathImportPerforationIntervalsFeature::onActionTriggered(bool isChec
|
||||
perforationInterval->setSkinFactor(interval.skinFactor);
|
||||
if (!interval.startOfHistory)
|
||||
{
|
||||
perforationInterval->setStartDate(interval.date);
|
||||
perforationInterval->setCustomStartDate(interval.date);
|
||||
perforationInterval->enableCustomStartDate(true);
|
||||
}
|
||||
wellPath->perforationIntervalCollection()->appendPerforation(perforationInterval);
|
||||
lastPerforationInterval = perforationInterval;
|
||||
|
@ -21,9 +21,10 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimProject.h"
|
||||
#include "Rim3dView.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
@ -78,6 +79,37 @@ void RimPerforationCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPerforationCollection::appendPerforation(RimPerforationInterval* perforation)
|
||||
{
|
||||
QDate firstTimeStepFromCase;
|
||||
QDate lastTimeStepFromCase;
|
||||
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
if (activeView)
|
||||
{
|
||||
activeView->hasUserRequestedAnimation = true;
|
||||
|
||||
RimEclipseCase* eclipseCase = nullptr;
|
||||
activeView->firstAncestorOrThisOfType(eclipseCase);
|
||||
if (eclipseCase)
|
||||
{
|
||||
auto dates = eclipseCase->timeStepDates();
|
||||
if (!dates.empty())
|
||||
{
|
||||
firstTimeStepFromCase = dates.front().date();
|
||||
|
||||
lastTimeStepFromCase = dates.back().date();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (firstTimeStepFromCase.isValid())
|
||||
{
|
||||
perforation->setCustomStartDate(firstTimeStepFromCase);
|
||||
}
|
||||
|
||||
if (lastTimeStepFromCase.isValid())
|
||||
{
|
||||
perforation->setCustomEndDate(lastTimeStepFromCase);
|
||||
}
|
||||
|
||||
m_perforations.push_back(perforation);
|
||||
|
||||
perforation->setUnitSystemSpecificDefaults();
|
||||
@ -85,12 +117,6 @@ void RimPerforationCollection::appendPerforation(RimPerforationInterval* perfora
|
||||
updateConnectedEditors();
|
||||
Riu3DMainWindowTools::selectAsCurrentItem(perforation);
|
||||
|
||||
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
if (activeView)
|
||||
{
|
||||
activeView->hasUserRequestedAnimation = true;
|
||||
}
|
||||
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfTypeAsserted(proj);
|
||||
proj->reloadCompletionTypeResultsInAllViews();
|
||||
@ -103,7 +129,7 @@ std::vector<const RimPerforationInterval*> RimPerforationCollection::perforation
|
||||
{
|
||||
std::vector<const RimPerforationInterval*> myPerforations;
|
||||
|
||||
for (auto perforation : m_perforations)
|
||||
for (const auto& perforation : m_perforations)
|
||||
{
|
||||
myPerforations.push_back(perforation);
|
||||
}
|
||||
|
@ -72,11 +72,18 @@ void RimPerforationInterval::setStartAndEndMD(double startMD, double endMD)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPerforationInterval::setStartDate(const QDate& date)
|
||||
void RimPerforationInterval::enableCustomStartDate(bool enable)
|
||||
{
|
||||
m_useCustomStartDate = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPerforationInterval::setCustomStartDate(const QDate& date)
|
||||
{
|
||||
if (date.isValid())
|
||||
{
|
||||
m_useCustomStartDate = true;
|
||||
m_startDate = QDateTime(date);
|
||||
}
|
||||
}
|
||||
@ -84,11 +91,18 @@ void RimPerforationInterval::setStartDate(const QDate& date)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPerforationInterval::setEndDate(const QDate& date)
|
||||
void RimPerforationInterval::enableCustomEndDate(bool enable)
|
||||
{
|
||||
m_useCustomEndDate = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPerforationInterval::setCustomEndDate(const QDate& date)
|
||||
{
|
||||
if (date.isValid())
|
||||
{
|
||||
m_useCustomEndDate = true;
|
||||
m_endDate = QDateTime(date);
|
||||
}
|
||||
}
|
||||
|
@ -41,8 +41,13 @@ public:
|
||||
virtual ~RimPerforationInterval();
|
||||
|
||||
void setStartAndEndMD(double startMD, double endMD);
|
||||
void setStartDate(const QDate& date);
|
||||
void setEndDate(const QDate& date);
|
||||
|
||||
void enableCustomStartDate(bool enable);
|
||||
void setCustomStartDate(const QDate& date);
|
||||
|
||||
void enableCustomEndDate(bool enable);
|
||||
void setCustomEndDate(const QDate& date);
|
||||
|
||||
void setDiameter(double diameter);
|
||||
void setSkinFactor(double skinFactor);
|
||||
double startMD() const;
|
||||
|
Loading…
Reference in New Issue
Block a user