From dafe2319d953f45c923f38eb761cb030ca797b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Fri, 22 Jun 2018 15:32:10 +0200 Subject: [PATCH] #2609 Uiordering of splitted well path class ok --- .../ProjectDataModel/RimWellPath.cpp | 24 ++++++-------- .../ProjectDataModel/RimWellPath.h | 31 +++++++------------ 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.cpp b/ApplicationCode/ProjectDataModel/RimWellPath.cpp index c0fee1fbb2..739a2f2cc9 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPath.cpp @@ -165,9 +165,9 @@ void RimFileWellPath::setSurveyType(QString surveyType) { m_surveyType = surveyType; if (m_surveyType == "PLAN") - m_wellPathColor = cvf::Color3f(0.999f, 0.333f, 0.0f); + setWellPathColor(cvf::Color3f(0.999f, 0.333f, 0.0f)); else if (m_surveyType == "PROTOTYPE") - m_wellPathColor = cvf::Color3f(0.0f, 0.333f, 0.999f); + setWellPathColor(cvf::Color3f(0.0f, 0.333f, 0.999f)); } //-------------------------------------------------------------------------------------------------- @@ -177,20 +177,16 @@ void RimFileWellPath::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& { RimWellPath::defineUiOrdering(uiConfigName, uiOrdering); - // Todo : Insert at correct place - - caf::PdmUiGroup* fileInfoGroup = uiOrdering.addNewGroup("File"); + caf::PdmUiGroup* fileInfoGroup = uiOrdering.createGroupBeforeGroup("Simulation Well", "File"); fileInfoGroup->add(&m_filepath); fileInfoGroup->add(&m_wellPathIndexInFile); - caf::PdmUiGroup* ssihubGroup = uiOrdering.addNewGroup("Well Info"); - ssihubGroup->add(&id); - ssihubGroup->add(&sourceSystem); - ssihubGroup->add(&utmZone); - ssihubGroup->add(&updateDate); - ssihubGroup->add(&updateUser); - ssihubGroup->add(&m_surveyType); - + if ( !id().isEmpty() ) uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &id); + if ( !sourceSystem().isEmpty() ) uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &sourceSystem); + if ( !utmZone().isEmpty() ) uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &utmZone); + if ( !updateDate().isEmpty() ) uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &updateDate); + if ( !updateUser().isEmpty() ) uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &updateUser); + if ( !m_surveyType().isEmpty() ) uiOrdering.insertBeforeItem(m_datumElevation.uiCapability(), &m_surveyType); } //-------------------------------------------------------------------------------------------------- @@ -546,7 +542,7 @@ bool RimFileWellPath::readWellPathFile(QString* errorMessage, RifWellPathImporte setSurveyType(wellMetaData.m_surveyType); updateDate = wellMetaData.m_updateDate.toString("d MMMM yyyy"); - m_wellPath = wellData.m_wellPathGeometry; + setWellPathGeometry(wellData.m_wellPathGeometry.p()); return true; } else diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.h b/ApplicationCode/ProjectDataModel/RimWellPath.h index b5e7e16c73..9864b000cc 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.h +++ b/ApplicationCode/ProjectDataModel/RimWellPath.h @@ -129,51 +129,44 @@ protected: virtual void initAfterRead() override; virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; -private: - void setWellPathGeometry(RigWellPath* wellPathModel); - virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override; - - - - static size_t simulationWellBranchCount(const QString& simWellName); - -private: // Fields +protected: + caf::PdmField m_datumElevation; +private: caf::PdmField m_name; - caf::PdmField m_simWellName; caf::PdmField m_branchIndex; caf::PdmField m_unitSystem; - caf::PdmField m_datumElevation; - caf::PdmField m_wellPathFormationFilePath; caf::PdmField m_formationKeyInFile; - caf::PdmField m_showWellPath; caf::PdmField m_showWellPathLabel; caf::PdmField m_wellPathRadiusScaleFactor; + caf::PdmField m_wellPathColor; caf::PdmChildArrayField m_wellLogFiles; caf::PdmChildField m_3dWellLogCurves; caf::PdmChildField m_completions; - // Geometry and data +private: - cvf::ref m_wellPathFormations; - -protected: - cvf::ref m_wellPath; - caf::PdmField m_wellPathColor; + virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override; + static size_t simulationWellBranchCount(const QString& simWellName); private: + // Geometry and data + + cvf::ref m_wellPath; + cvf::ref m_wellPathFormations; + // Obsolete fields caf::PdmChildField m_wellLogFile_OBSOLETE;