#1605 Add Well Name for Completion Export field

This commit is contained in:
Bjørnar Grip Fjær 2017-06-14 13:13:48 +02:00
parent c4172d4c19
commit 8fceb8c74f
8 changed files with 57 additions and 15 deletions

View File

@ -112,7 +112,7 @@ void RicNewWellPathIntersectionFeatureCmd::redo()
CVF_ASSERT(m_wellPath);
RimIntersection* intersection = new RimIntersection();
intersection->name = m_wellPath->name;
intersection->name = m_wellPath->name();
intersection->type = RimIntersection::CS_WELL_PATH;
intersection->wellPath = m_wellPath;

View File

@ -66,7 +66,7 @@ bool RicWellPathViewerEventHandler::handleEvent(cvf::Object* eventObject)
cvf::Vec3d trueVerticalDepth = wellPathSourceInfo->trueVerticalDepth(uiEvent->firstPartTriangleIndex, domainCoord);
QString wellPathText;
wellPathText += QString("Well path name : %1\n").arg(wellPathSourceInfo->wellPath()->name);
wellPathText += QString("Well path name : %1\n").arg(wellPathSourceInfo->wellPath()->name());
wellPathText += QString("Measured depth : %1\n").arg(measuredDepth);
QString formattedText;

View File

@ -40,6 +40,8 @@ RimWellPathCompletions::RimWellPathCompletions()
CAF_PDM_InitFieldNoDefault(&m_fishbonesCollection, "Fishbones", "Fishbones", "", "", "");
m_fishbonesCollection = new RimFishbonesCollection;
m_fishbonesCollection.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_wellNameForExport, "WellNameForExport", QString(), "Well Name for Completion Export", "", "", "");
}
//--------------------------------------------------------------------------------------------------
@ -62,3 +64,19 @@ RimPerforationCollection* RimWellPathCompletions::perforationCollection() const
return m_perforationCollection;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathCompletions::setWellNameForExport(const QString& name)
{
m_wellNameForExport = name;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellPathCompletions::wellNameForExport() const
{
return m_wellNameForExport();
}

View File

@ -19,6 +19,7 @@
#pragma once
#include "cafPdmObject.h"
#include "cafPdmField.h"
#include "cafPdmChildField.h"
class RimFishbonesCollection;
@ -38,7 +39,11 @@ public:
RimFishbonesCollection* fishbonesCollection() const;
RimPerforationCollection* perforationCollection() const;
void setWellNameForExport(const QString& name);
QString wellNameForExport() const;
private:
caf::PdmChildField<RimFishbonesCollection*> m_fishbonesCollection;
caf::PdmChildField<RimPerforationCollection*> m_perforationCollection;
caf::PdmField<QString> m_wellNameForExport;
};

View File

@ -148,7 +148,7 @@ bool RimWellLogFile::readFile(QString* errorMessage)
{
if (wellPath->filepath().isEmpty())
{
wellPath->name = m_wellName;
wellPath->setName(m_wellName);
}
}

View File

@ -55,11 +55,11 @@ RimWellPath::RimWellPath()
{
CAF_PDM_InitObject("WellPath", ":/Well.png", "", "");
CAF_PDM_InitFieldNoDefault(&name, "WellPathName", "Name", "", "", "");
name.uiCapability()->setUiReadOnly(true);
name.xmlCapability()->setIOWritable(false);
name.xmlCapability()->setIOReadable(false);
name.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_name, "WellPathName", "Name", "", "", "");
m_name.uiCapability()->setUiReadOnly(true);
m_name.xmlCapability()->setIOWritable(false);
m_name.xmlCapability()->setIOReadable(false);
m_name.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&id, "WellPathId", "Id", "", "", "");
id.uiCapability()->setUiReadOnly(true);
id.xmlCapability()->setIOWritable(false);
@ -149,7 +149,7 @@ RimWellPath::~RimWellPath()
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimWellPath::userDescriptionField()
{
return &name;
return &m_name;
}
//--------------------------------------------------------------------------------------------------
@ -254,6 +254,23 @@ void RimWellPath::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellPath::name() const
{
return m_name();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPath::setName(const QString& name)
{
m_name = name;
m_completions->setWellNameForExport(name);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -273,7 +290,7 @@ bool RimWellPath::readWellPathFile(QString* errorMessage, RifWellPathImporter* w
RifWellPathImporter::WellMetaData wellMetaData = wellPathImporter->readWellMetaData(filepath(), wellPathIndexInFile());
// General well info
name = wellData.m_name;
setName(wellData.m_name);
id = wellMetaData.m_id;
sourceSystem = wellMetaData.m_sourceSystem;
utmZone = wellMetaData.m_utmZone;
@ -477,5 +494,5 @@ void RimWellPath::setLogFileInfo(RimWellLogFile* logFileInfo)
m_wellLogFile = logFileInfo;
m_wellLogFile->uiCapability()->setUiHidden(true);
this->name = m_wellLogFile->wellName();
setName(m_wellLogFile->wellName());
}

View File

@ -64,7 +64,8 @@ public:
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
caf::PdmField<QString> name;
QString name() const;
void setName(const QString& name);
caf::PdmField<QString> filepath;
caf::PdmField<int> wellPathIndexInFile; // -1 means none.
@ -123,4 +124,5 @@ private:
cvf::ref<RigWellPath> m_wellPath;
cvf::ref<RivWellPathPartMgr> m_wellPathPartMgr;
caf::PdmField<QString> m_name;
};

View File

@ -158,7 +158,7 @@ void RimWellPathCollection::readWellPathFiles()
}
}
progress.setProgressDescription(QString("Reading file %1").arg(wellPaths[wpIdx]->name));
progress.setProgressDescription(QString("Reading file %1").arg(wellPaths[wpIdx]->name()));
progress.incrementProgress();
}
@ -247,10 +247,10 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector<RimWellPath*>& wellP
RimWellPath* wellPath = wellPathArray[wpIdx];
wellPath->readWellPathFile(NULL, m_wellPathImporter);
progress.setProgressDescription(QString("Reading file %1").arg(wellPath->name));
progress.setProgressDescription(QString("Reading file %1").arg(wellPath->name()));
// If a well path with this name exists already, make it read the well path file
RimWellPath* existingWellPath = wellPathByName(wellPath->name);
RimWellPath* existingWellPath = wellPathByName(wellPath->name());
if (existingWellPath)
{
existingWellPath->filepath = wellPath->filepath;