2018-07-03 01:42:31 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2019-01-09 08:21:38 -06:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2018-07-03 01:42:31 -05:00
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-06-27 10:22:08 -05:00
|
|
|
#include "RimModeledWellPath.h"
|
2018-07-03 01:42:31 -05:00
|
|
|
|
|
|
|
#include "RimWellPathGeometryDef.h"
|
2018-07-02 07:51:17 -05:00
|
|
|
#include "RimProject.h"
|
|
|
|
|
2018-07-03 01:42:31 -05:00
|
|
|
#include "RigWellPath.h"
|
|
|
|
|
|
|
|
#include "cafPdmUiTreeOrdering.h"
|
2018-08-29 10:33:58 -05:00
|
|
|
#include "RimPlotCurve.h"
|
2018-09-12 06:18:48 -05:00
|
|
|
#include "RiaCompletionTypeCalculationScheduler.h"
|
|
|
|
#include "RimIntersection.h"
|
|
|
|
#include "RimWellPath.h"
|
|
|
|
#include "RimWellPathFractureCollection.h"
|
|
|
|
#include "RimWellPathFracture.h"
|
2018-09-26 05:38:53 -05:00
|
|
|
#include "RifEclipseDataTableFormatter.h"
|
2018-07-03 01:42:31 -05:00
|
|
|
|
2018-06-27 10:22:08 -05:00
|
|
|
|
2018-06-28 02:00:34 -05:00
|
|
|
CAF_PDM_SOURCE_INIT(RimModeledWellPath, "ModeledWellPath");
|
2018-06-27 10:22:08 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-06-28 02:00:34 -05:00
|
|
|
RimModeledWellPath::RimModeledWellPath()
|
2018-06-27 10:22:08 -05:00
|
|
|
{
|
2018-10-02 08:55:28 -05:00
|
|
|
CAF_PDM_InitObject("Modeled WellPath", ":/EditableWell.png", "", "");
|
2018-06-27 10:22:08 -05:00
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&m_geometryDefinition, "WellPathGeometryDef", "Trajectory", "", "", "");
|
|
|
|
m_geometryDefinition = new RimWellPathGeometryDef;
|
2018-07-04 10:01:40 -05:00
|
|
|
|
2018-11-06 03:38:07 -06:00
|
|
|
// Required, as these settings are set in RimWellPath()
|
2018-07-04 10:01:40 -05:00
|
|
|
m_name.uiCapability()->setUiReadOnly(false);
|
2018-11-06 03:38:07 -06:00
|
|
|
m_name.xmlCapability()->setIOReadable(true);
|
|
|
|
m_name.xmlCapability()->setIOWritable(true);
|
2018-06-27 10:22:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-06-28 02:00:34 -05:00
|
|
|
RimModeledWellPath::~RimModeledWellPath()
|
2018-06-27 10:22:08 -05:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-02 09:55:32 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimModeledWellPath::createWellPathGeometry()
|
|
|
|
{
|
|
|
|
this->setWellPathGeometry(m_geometryDefinition->createWellPathGeometry().p());
|
|
|
|
}
|
|
|
|
|
2018-07-02 07:51:17 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimModeledWellPath::updateWellPathVisualization()
|
|
|
|
{
|
|
|
|
this->setWellPathGeometry(m_geometryDefinition->createWellPathGeometry().p());
|
2018-08-29 10:33:58 -05:00
|
|
|
|
|
|
|
std::vector<RimPlotCurve*> refferingCurves;
|
|
|
|
this->objectsWithReferringPtrFieldsOfType(refferingCurves);
|
|
|
|
|
|
|
|
for (auto curve: refferingCurves)
|
|
|
|
{
|
|
|
|
curve->loadDataAndUpdate(false);
|
|
|
|
}
|
2018-09-12 06:18:48 -05:00
|
|
|
|
|
|
|
for ( auto fracture : this->fractureCollection()->activeFractures() )
|
|
|
|
{
|
|
|
|
fracture->loadDataAndUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<RimIntersection*> refferingIntersections;
|
|
|
|
this->objectsWithReferringPtrFieldsOfType(refferingIntersections);
|
|
|
|
|
|
|
|
for (auto intersection: refferingIntersections)
|
|
|
|
{
|
|
|
|
intersection->rebuildGeometryAndScheduleCreateDisplayModel();
|
|
|
|
}
|
|
|
|
|
|
|
|
RimProject* proj;
|
|
|
|
this->firstAncestorOrThisOfTypeAsserted(proj);
|
|
|
|
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimModeledWellPath::scheduleUpdateOfDependentVisualization()
|
|
|
|
{
|
|
|
|
|
|
|
|
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
|
2018-07-02 07:51:17 -05:00
|
|
|
}
|
|
|
|
|
2018-08-29 09:03:31 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-11-06 04:23:19 -06:00
|
|
|
RimWellPathGeometryDef* RimModeledWellPath::geometryDefinition() const
|
2018-08-29 09:03:31 -05:00
|
|
|
{
|
|
|
|
return m_geometryDefinition;
|
|
|
|
}
|
|
|
|
|
2018-09-26 05:38:53 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimModeledWellPath::wellPlanText()
|
|
|
|
{
|
|
|
|
QString planText;
|
|
|
|
QTextStream qtxtStream(&planText);
|
|
|
|
|
|
|
|
RifEclipseDataTableFormatter formatter(qtxtStream);
|
2019-01-18 07:55:12 -06:00
|
|
|
formatter.setUnlimitedDataRowWidth();
|
2018-09-26 05:38:53 -05:00
|
|
|
formatter.setTableRowPrependText("");
|
|
|
|
formatter.setTableRowLineAppendText("");
|
|
|
|
|
|
|
|
std::vector<RifEclipseOutputTableColumn> tableHeader;
|
2018-11-01 04:25:41 -05:00
|
|
|
tableHeader.push_back({"MDRKB"});
|
2018-09-26 05:38:53 -05:00
|
|
|
tableHeader.push_back({"CL"});
|
|
|
|
tableHeader.push_back({"Inc"});
|
|
|
|
tableHeader.push_back({"Azi"});
|
2018-11-01 04:25:41 -05:00
|
|
|
tableHeader.push_back({"TVDMSL"});
|
2018-09-26 05:38:53 -05:00
|
|
|
tableHeader.push_back({"NS"});
|
|
|
|
tableHeader.push_back({"EW"});
|
|
|
|
tableHeader.push_back({"Dogleg"});
|
|
|
|
tableHeader.push_back({"Build"});
|
|
|
|
tableHeader.push_back({"Turn"});
|
|
|
|
formatter.header(tableHeader);
|
|
|
|
|
2018-11-01 04:25:41 -05:00
|
|
|
double mdrkbAtFirstTarget = m_geometryDefinition->mdrkbAtFirstTarget();
|
2018-09-26 05:38:53 -05:00
|
|
|
if (m_geometryDefinition)
|
|
|
|
{
|
|
|
|
std::vector<RiaWellPlanCalculator::WellPlanSegment> wellPlan = m_geometryDefinition->wellPlan();
|
|
|
|
for (const auto& segment : wellPlan)
|
|
|
|
{
|
2018-11-01 04:25:41 -05:00
|
|
|
formatter.add(segment.MD + mdrkbAtFirstTarget);
|
2018-09-26 05:38:53 -05:00
|
|
|
formatter.add(segment.CL);
|
|
|
|
formatter.add(segment.inc);
|
|
|
|
formatter.add(segment.azi);
|
|
|
|
formatter.add(segment.TVD);
|
|
|
|
formatter.add(segment.NS);
|
|
|
|
formatter.add(segment.EW);
|
|
|
|
formatter.add(segment.dogleg);
|
|
|
|
formatter.add(segment.build);
|
|
|
|
formatter.add(segment.turn);
|
|
|
|
formatter.rowCompleted();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
formatter.tableCompleted();
|
|
|
|
|
|
|
|
return planText;
|
|
|
|
}
|
|
|
|
|
2018-06-27 10:22:08 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-06-28 02:00:34 -05:00
|
|
|
void RimModeledWellPath::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName)
|
2018-06-27 10:22:08 -05:00
|
|
|
{
|
|
|
|
uiTreeOrdering.add(m_geometryDefinition());
|
|
|
|
RimWellPath::defineUiTreeOrdering(uiTreeOrdering, uiConfigName);
|
|
|
|
}
|
|
|
|
|