#1603 Adjust start MD when importing fishbones laterals

This commit is contained in:
Bjørnar Grip Fjær 2017-06-15 12:48:22 +02:00
parent 5365d92e66
commit 9caf412b6c
4 changed files with 44 additions and 27 deletions

View File

@ -62,5 +62,5 @@ private:
caf::PdmField< std::vector< cvf::Vec3d> > m_coordinates;
caf::PdmField< std::vector< double > > m_measuredDepths;
caf::PdmProxyValueField< QString > m_displayCoordinates;
caf::PdmProxyValueField< QString > m_displayCoordinates;
};

View File

@ -23,6 +23,7 @@
#include "RimFishboneWellPath.h"
#include "RimView.h"
#include "RimProject.h"
#include "RimFishbonesCollection.h"
#include "RigWellPath.h"
@ -53,6 +54,36 @@ RimFishboneWellPathCollection::RimFishboneWellPathCollection()
m_pipeProperties = new RimFishbonesPipeProperties;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFishboneWellPathCollection::importCompletionsFromFile(const QStringList& filePaths)
{
RifWellPathImporter wellPathImporter;
for (const QString& filePath : filePaths)
{
size_t wellDataCount = wellPathImporter.wellDataCount(filePath);
for (size_t i = 0; i < wellDataCount; ++i)
{
RifWellPathImporter::WellData wellData = wellPathImporter.readWellData(filePath, i);
RimFishboneWellPath* wellCompletion = new RimFishboneWellPath();
wellCompletion->setName(wellData.m_name);
wellCompletion->setCoordinates(wellData.m_wellPathGeometry->m_wellPathPoints);
wellCompletion->setMeasuredDepths(wellData.m_wellPathGeometry->m_measuredDepths);
appendCompletion(wellCompletion);
}
}
RimFishbonesCollection* fishbonesCollection;
firstAncestorOrThisOfType(fishbonesCollection);
if (fishbonesCollection != nullptr)
{
fishbonesCollection->recalculateStartMD();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -106,25 +137,3 @@ void RimFishboneWellPathCollection::appendCompletion(RimFishboneWellPath* comple
project->reloadCompletionTypeResultsInAllViews();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFishboneWellPathCollection::importCompletionsFromFile(const QStringList& filePaths)
{
RifWellPathImporter wellPathImporter;
foreach(const QString& filePath, filePaths) {
size_t wellDataCount = wellPathImporter.wellDataCount(filePath);
for (size_t i = 0; i < wellDataCount; ++i)
{
RifWellPathImporter::WellData wellData = wellPathImporter.readWellData(filePath, i);
RimFishboneWellPath* wellCompletion = new RimFishboneWellPath();
wellCompletion->setName(wellData.m_name);
wellCompletion->setCoordinates(wellData.m_wellPathGeometry->m_wellPathPoints);
wellCompletion->setMeasuredDepths(wellData.m_wellPathGeometry->m_measuredDepths);
appendCompletion(wellCompletion);
}
}
}

View File

@ -40,19 +40,19 @@ class RimFishboneWellPathCollection : public RimCheckableNamedObject
public:
RimFishboneWellPathCollection();
void importCompletionsFromFile(const QStringList& filePaths);
void importCompletionsFromFile(const QStringList& filePaths);
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
std::vector<const RimFishboneWellPath*> wellPaths() const;
double holeDiameter() const { return m_pipeProperties->holeDiameter(); }
double skinFactor() const { return m_pipeProperties->skinFactor(); }
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
private:
void appendCompletion(RimFishboneWellPath* completion);
void appendCompletion(RimFishboneWellPath* completion);
private:
caf::PdmChildArrayField<RimFishboneWellPath*> m_wellPaths;

View File

@ -143,6 +143,14 @@ void RimFishbonesCollection::recalculateStartMD()
}
}
for (const RimFishboneWellPath* wellPath : m_wellPathCollection->wellPaths())
{
if (wellPath->measuredDepths().size() > 0)
{
minStartMD = std::min(minStartMD, wellPath->measuredDepths()[0] - 13.0);
}
}
if (!manuallyModifiedStartMD || minStartMD < m_startMD())
{
m_startMD = minStartMD;