#3205 Improved default name of modelled wellpaths. Made sure that the name is read and written.

This commit is contained in:
Jacob Støren 2018-08-14 13:22:42 +02:00
parent 319203b7fc
commit a6d91873e6
4 changed files with 18 additions and 3 deletions

View File

@ -68,7 +68,7 @@ void RicNewEditableWellPathFeature::onActionTriggered(bool isChecked)
{ {
std::vector<RimWellPath*> newWellPaths; std::vector<RimWellPath*> newWellPaths;
newWellPaths.push_back(new RimModeledWellPath()); newWellPaths.push_back(new RimModeledWellPath());
newWellPaths.back()->setName("UWell-" + QString::number(wellPathCollection->wellPaths.size())); newWellPaths.back()->setName("UWell-" + QString::number(wellPathCollection->modelledWellPathCount()+1));
wellPathCollection->addWellPaths(newWellPaths); wellPathCollection->addWellPaths(newWellPaths);
wellPathCollection->uiCapability()->updateConnectedEditors(); wellPathCollection->uiCapability()->updateConnectedEditors();
wellPathCollection->scheduleRedrawAffectedViews(); wellPathCollection->scheduleRedrawAffectedViews();

View File

@ -36,7 +36,6 @@ RimModeledWellPath::RimModeledWellPath()
CAF_PDM_InitObject("Modeled WellPath", ":/Well.png", "", ""); CAF_PDM_InitObject("Modeled WellPath", ":/Well.png", "", "");
CAF_PDM_InitFieldNoDefault(&m_geometryDefinition, "WellPathGeometryDef", "Trajectory", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_geometryDefinition, "WellPathGeometryDef", "Trajectory", "", "", "");
//m_geometryDefinition.uiCapability()->setUiHidden(true);
m_geometryDefinition = new RimWellPathGeometryDef; m_geometryDefinition = new RimWellPathGeometryDef;
m_name.uiCapability()->setUiReadOnly(false); m_name.uiCapability()->setUiReadOnly(false);

View File

@ -448,6 +448,22 @@ bool RimWellPathCollection::anyWellsContainingPerforationIntervals() const
return false; return false;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimWellPathCollection::modelledWellPathCount() const
{
size_t count = 0;
for (size_t wellPathIdx = 0; wellPathIdx < wellPaths.size(); wellPathIdx++)
{
if (dynamic_cast<RimModeledWellPath*>( wellPaths[wellPathIdx]))
{
count++;
}
}
return count;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -109,7 +109,7 @@ public:
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath); void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
bool anyWellsContainingPerforationIntervals() const; bool anyWellsContainingPerforationIntervals() const;
size_t modelledWellPathCount() const;
protected: protected:
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;