mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3957 Add button to valve for creating new valve template or editing existing template
* Also added separate delete valve feature so we can clear the template and update the valves referencing it.
This commit is contained in:
parent
a32ebe4dff
commit
5c24153646
@ -8,6 +8,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalFeature.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalAtMeasuredDepthFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalAtMeasuredDepthFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewValveFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicNewValveFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewValveTemplateFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicNewValveTemplateFeature.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicDeleteValveTemplateFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportCompletionsFileFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportCompletionsFileFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.h
|
||||||
)
|
)
|
||||||
@ -21,6 +22,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalFeature.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewValveFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicNewValveFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicNewValveTemplateFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicNewValveTemplateFeature.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicDeleteValveTemplateFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportCompletionsFileFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportCompletionsFileFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.cpp
|
||||||
)
|
)
|
||||||
|
@ -0,0 +1,82 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2019- Equinor ASA
|
||||||
|
//
|
||||||
|
// 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.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
#include "RicDeleteValveTemplateFeature.h"
|
||||||
|
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimValveTemplate.h"
|
||||||
|
#include "RimValveTemplateCollection.h"
|
||||||
|
#include "RimWellPathValve.h"
|
||||||
|
|
||||||
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT(RicDeleteValveTemplateFeature, "RicDeleteValveTemplateFeature");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicDeleteValveTemplateFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
if (caf::SelectionManager::instance()->selectedItemOfType<RimValveTemplate>())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicDeleteValveTemplateFeature::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
RimValveTemplate* valveTemplate = caf::SelectionManager::instance()->selectedItemOfType<RimValveTemplate>();
|
||||||
|
|
||||||
|
if (valveTemplate)
|
||||||
|
{
|
||||||
|
RimProject* project = nullptr;
|
||||||
|
valveTemplate->firstAncestorOrThisOfTypeAsserted(project);
|
||||||
|
std::vector<RimWellPathValve*> valves;
|
||||||
|
project->descendantsIncludingThisOfType(valves);
|
||||||
|
for (RimWellPathValve* valve : valves)
|
||||||
|
{
|
||||||
|
if (valve->valveTemplate() == valveTemplate)
|
||||||
|
{
|
||||||
|
valve->setValveTemplate(nullptr);
|
||||||
|
valve->updateAllRequiredEditors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RimValveTemplateCollection* collection = nullptr;
|
||||||
|
valveTemplate->firstAncestorOrThisOfTypeAsserted(collection);
|
||||||
|
collection->removeAndDeleteValveTemplate(valveTemplate);
|
||||||
|
collection->updateAllRequiredEditors();
|
||||||
|
|
||||||
|
project->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicDeleteValveTemplateFeature::setupActionLook(QAction* actionToSetup)
|
||||||
|
{
|
||||||
|
actionToSetup->setText("Delete Valve Template");
|
||||||
|
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2019- Equinor ASA
|
||||||
|
//
|
||||||
|
// 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.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicDeleteValveTemplateFeature : public caf::CmdFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Overrides
|
||||||
|
bool isCommandEnabled() override;
|
||||||
|
void onActionTriggered(bool isChecked) override;
|
||||||
|
void setupActionLook(QAction* actionToSetup) override;
|
||||||
|
};
|
@ -25,6 +25,7 @@
|
|||||||
#include "RimValveTemplateCollection.h"
|
#include "RimValveTemplateCollection.h"
|
||||||
#include "RimOilField.h"
|
#include "RimOilField.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
#include "RimWellPathValve.h"
|
||||||
|
|
||||||
#include "Riu3DMainWindowTools.h"
|
#include "Riu3DMainWindowTools.h"
|
||||||
|
|
||||||
@ -39,12 +40,16 @@ CAF_CMD_SOURCE_INIT(RicNewValveTemplateFeature, "RicNewValveTemplateFeature");
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewValveTemplateFeature::selectValveTemplateAndUpdate(RimValveTemplateCollection* templateCollection,
|
void RicNewValveTemplateFeature::selectValveTemplateAndUpdate(RimValveTemplate* valveTemplate)
|
||||||
RimValveTemplate* valveTemplate)
|
|
||||||
{
|
{
|
||||||
valveTemplate->loadDataAndUpdate();
|
valveTemplate->loadDataAndUpdate();
|
||||||
|
|
||||||
templateCollection->updateConnectedEditors();
|
RimValveTemplateCollection* templateCollection = nullptr;
|
||||||
|
valveTemplate->firstAncestorOrThisOfType(templateCollection);
|
||||||
|
if (templateCollection)
|
||||||
|
{
|
||||||
|
templateCollection->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
RimProject* project = RiaApplication::instance()->project();
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
|
|
||||||
@ -65,26 +70,48 @@ void RicNewValveTemplateFeature::selectValveTemplateAndUpdate(RimValveTemplateCo
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicNewValveTemplateFeature::onActionTriggered(bool isChecked)
|
void RicNewValveTemplateFeature::createNewValveTemplateForValveAndUpdate(RimWellPathValve* valve)
|
||||||
|
{
|
||||||
|
RimValveTemplate* valveTemplate = createNewValveTemplate();
|
||||||
|
valve->setValveTemplate(valveTemplate);
|
||||||
|
selectValveTemplateAndUpdate(valveTemplate);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimValveTemplate* RicNewValveTemplateFeature::createNewValveTemplate()
|
||||||
{
|
{
|
||||||
RimProject* project = RiaApplication::instance()->project();
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
CVF_ASSERT(project);
|
CVF_ASSERT(project);
|
||||||
|
|
||||||
RimOilField* oilfield = project->activeOilField();
|
RimOilField* oilfield = project->activeOilField();
|
||||||
if (oilfield == nullptr) return;
|
if (oilfield == nullptr) return nullptr;
|
||||||
|
|
||||||
RimValveTemplateCollection* valveTemplateColl = oilfield->valveTemplateCollection();
|
RimValveTemplateCollection* valveTemplateColl = oilfield->valveTemplateCollection();
|
||||||
|
|
||||||
if (valveTemplateColl)
|
if (valveTemplateColl)
|
||||||
{
|
{
|
||||||
RimValveTemplate* valveTemplate = new RimValveTemplate();
|
RimValveTemplate* valveTemplate = new RimValveTemplate();
|
||||||
QString userLabel = QString("Valve Template #%1").arg(valveTemplateColl->valveTemplates().size() + 1);
|
QString userLabel = QString("Valve Template #%1").arg(valveTemplateColl->valveTemplates().size() + 1);
|
||||||
valveTemplate->setUserLabel(userLabel);
|
valveTemplate->setUserLabel(userLabel);
|
||||||
valveTemplateColl->addValveTemplate(valveTemplate);
|
valveTemplateColl->addValveTemplate(valveTemplate);
|
||||||
valveTemplate->setUnitSystem(valveTemplateColl->defaultUnitSystemType());
|
valveTemplate->setUnitSystem(valveTemplateColl->defaultUnitSystemType());
|
||||||
valveTemplate->setDefaultValuesFromUnits();
|
valveTemplate->setDefaultValuesFromUnits();
|
||||||
|
return valveTemplate;
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
selectValveTemplateAndUpdate(valveTemplateColl, valveTemplate);
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicNewValveTemplateFeature::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
RimValveTemplate* valveTemplate = createNewValveTemplate();
|
||||||
|
if (valveTemplate)
|
||||||
|
{
|
||||||
|
selectValveTemplateAndUpdate(valveTemplate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
class RimValveTemplate;
|
class RimValveTemplate;
|
||||||
class RimValveTemplateCollection;
|
class RimValveTemplateCollection;
|
||||||
|
class RimWellPathValve;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@ -33,10 +34,10 @@ class RicNewValveTemplateFeature : public caf::CmdFeature
|
|||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void selectValveTemplateAndUpdate(RimValveTemplateCollection* templateCollection,
|
static void selectValveTemplateAndUpdate(RimValveTemplate* valveTemplate);
|
||||||
RimValveTemplate* valveTemplate);
|
static void createNewValveTemplateForValveAndUpdate(RimWellPathValve* valve);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
static RimValveTemplate* createNewValveTemplate();
|
||||||
void onActionTriggered(bool isChecked) override;
|
void onActionTriggered(bool isChecked) override;
|
||||||
void setupActionLook(QAction* actionToSetup) override;
|
void setupActionLook(QAction* actionToSetup) override;
|
||||||
bool isCommandEnabled() override;
|
bool isCommandEnabled() override;
|
||||||
|
@ -51,8 +51,6 @@
|
|||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
|
|
||||||
#include "RimFractureTemplateCollection.h"
|
#include "RimFractureTemplateCollection.h"
|
||||||
#include "RimValveTemplateCollection.h"
|
|
||||||
|
|
||||||
|
|
||||||
#include "cafNotificationCenter.h"
|
#include "cafNotificationCenter.h"
|
||||||
#include "cafPdmChildArrayField.h"
|
#include "cafPdmChildArrayField.h"
|
||||||
@ -156,11 +154,9 @@ void RicDeleteItemExec::redo()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RimValveTemplateCollection* valveTemplateColl;
|
|
||||||
RimFractureTemplateCollection* fracTemplateColl;
|
RimFractureTemplateCollection* fracTemplateColl;
|
||||||
parentObj->firstAncestorOrThisOfType(fracTemplateColl);
|
parentObj->firstAncestorOrThisOfType(fracTemplateColl);
|
||||||
parentObj->firstAncestorOrThisOfType(valveTemplateColl);
|
if (fracTemplateColl)
|
||||||
if (fracTemplateColl || valveTemplateColl)
|
|
||||||
{
|
{
|
||||||
RimProject* proj = nullptr;
|
RimProject* proj = nullptr;
|
||||||
parentObj->firstAncestorOrThisOfType(proj);
|
parentObj->firstAncestorOrThisOfType(proj);
|
||||||
|
@ -60,7 +60,6 @@
|
|||||||
#include "RimSimWellFracture.h"
|
#include "RimSimWellFracture.h"
|
||||||
#include "RimSimWellFractureCollection.h"
|
#include "RimSimWellFractureCollection.h"
|
||||||
#include "RimStimPlanFractureTemplate.h"
|
#include "RimStimPlanFractureTemplate.h"
|
||||||
#include "RimValveTemplate.h"
|
|
||||||
#include "RimWellPathFracture.h"
|
#include "RimWellPathFracture.h"
|
||||||
#include "RimWellPathFractureCollection.h"
|
#include "RimWellPathFractureCollection.h"
|
||||||
|
|
||||||
@ -123,7 +122,6 @@ bool isDeletable(caf::PdmUiItem* uiItem)
|
|||||||
if (dynamic_cast<RimWellPathFracture*>(uiItem)) return true;
|
if (dynamic_cast<RimWellPathFracture*>(uiItem)) return true;
|
||||||
if (dynamic_cast<RimEllipseFractureTemplate*>(uiItem)) return true;
|
if (dynamic_cast<RimEllipseFractureTemplate*>(uiItem)) return true;
|
||||||
if (dynamic_cast<RimStimPlanFractureTemplate*>(uiItem)) return true;
|
if (dynamic_cast<RimStimPlanFractureTemplate*>(uiItem)) return true;
|
||||||
if (dynamic_cast<RimValveTemplate*>(uiItem)) return true;
|
|
||||||
if (dynamic_cast<RimSimWellFractureCollection*>(uiItem)) return true;
|
if (dynamic_cast<RimSimWellFractureCollection*>(uiItem)) return true;
|
||||||
if (dynamic_cast<RimSimWellFracture*>(uiItem)) return true;
|
if (dynamic_cast<RimSimWellFracture*>(uiItem)) return true;
|
||||||
if (dynamic_cast<RimEnsembleCurveSet*>(uiItem)) return true;
|
if (dynamic_cast<RimEnsembleCurveSet*>(uiItem)) return true;
|
||||||
|
@ -47,7 +47,6 @@ public:
|
|||||||
QString typeLabel() const;
|
QString typeLabel() const;
|
||||||
QString fullLabel() const;
|
QString fullLabel() const;
|
||||||
void setUserLabel(const QString& userLabel);
|
void setUserLabel(const QString& userLabel);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||||
bool* useOptionsOnly) override;
|
bool* useOptionsOnly) override;
|
||||||
@ -68,6 +67,5 @@ private:
|
|||||||
caf::PdmField<double> m_flowCoefficient;
|
caf::PdmField<double> m_flowCoefficient;
|
||||||
// AICDs
|
// AICDs
|
||||||
caf::PdmChildField<RimWellPathAicdParameters*> m_aicdParameters;
|
caf::PdmChildField<RimWellPathAicdParameters*> m_aicdParameters;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -66,6 +66,15 @@ void RimValveTemplateCollection::addValveTemplate(RimValveTemplate* valveTemplat
|
|||||||
m_valveDefinitions.push_back(valveTemplate);
|
m_valveDefinitions.push_back(valveTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimValveTemplateCollection::removeAndDeleteValveTemplate(RimValveTemplate* valveTemplate)
|
||||||
|
{
|
||||||
|
m_valveDefinitions.removeChildObject(valveTemplate);
|
||||||
|
delete valveTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -40,6 +40,7 @@ public:
|
|||||||
|
|
||||||
std::vector<RimValveTemplate*> valveTemplates() const;
|
std::vector<RimValveTemplate*> valveTemplates() const;
|
||||||
void addValveTemplate(RimValveTemplate* valveTemplate);
|
void addValveTemplate(RimValveTemplate* valveTemplate);
|
||||||
|
void removeAndDeleteValveTemplate(RimValveTemplate* valveTemplate);
|
||||||
|
|
||||||
RiaEclipseUnitTools::UnitSystemType defaultUnitSystemType() const;
|
RiaEclipseUnitTools::UnitSystemType defaultUnitSystemType() const;
|
||||||
void setDefaultUnitSystemBasedOnLoadedCases();
|
void setDefaultUnitSystemBasedOnLoadedCases();
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
#include "RiaColorTables.h"
|
#include "RiaColorTables.h"
|
||||||
#include "RiaEclipseUnitTools.h"
|
#include "RiaEclipseUnitTools.h"
|
||||||
|
|
||||||
|
#include "Riu3DMainWindowTools.h"
|
||||||
|
|
||||||
#include "RigWellPath.h"
|
#include "RigWellPath.h"
|
||||||
|
|
||||||
#include "RimMultipleValveLocations.h"
|
#include "RimMultipleValveLocations.h"
|
||||||
@ -30,7 +32,10 @@
|
|||||||
#include "RimValveTemplate.h"
|
#include "RimValveTemplate.h"
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
|
|
||||||
|
#include "CompletionCommands/RicNewValveTemplateFeature.h"
|
||||||
|
|
||||||
#include "cafPdmUiDoubleSliderEditor.h"
|
#include "cafPdmUiDoubleSliderEditor.h"
|
||||||
|
#include "cafPdmUiToolButtonEditor.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimWellPathValve, "WellPathValve");
|
CAF_PDM_SOURCE_INIT(RimWellPathValve, "WellPathValve");
|
||||||
|
|
||||||
@ -42,14 +47,15 @@ RimWellPathValve::RimWellPathValve()
|
|||||||
CAF_PDM_InitObject("WellPathValve", ":/ICDValve16x16.png", "", "");
|
CAF_PDM_InitObject("WellPathValve", ":/ICDValve16x16.png", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_valveTemplate, "ValveTemplate", "Valve Template", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_valveTemplate, "ValveTemplate", "Valve Template", "", "", "");
|
||||||
|
CAF_PDM_InitField(&m_measuredDepth, "StartMeasuredDepth", 0.0, "Start MD", "", "", "");
|
||||||
CAF_PDM_InitField(&m_measuredDepth, "StartMeasuredDepth", 0.0, "Start MD", "", "", "");
|
|
||||||
m_measuredDepth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_multipleValveLocations, "ValveLocations", "Valve Locations", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_multipleValveLocations, "ValveLocations", "Valve Locations", "", "", "");
|
||||||
|
CAF_PDM_InitField(&m_createOrEditValveTemplate, "CreateTemplate", false, "Create new", "", "", "");
|
||||||
|
|
||||||
|
m_measuredDepth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||||
m_multipleValveLocations = new RimMultipleValveLocations;
|
m_multipleValveLocations = new RimMultipleValveLocations;
|
||||||
m_multipleValveLocations.uiCapability()->setUiTreeHidden(true);
|
m_multipleValveLocations.uiCapability()->setUiTreeHidden(true);
|
||||||
m_multipleValveLocations.uiCapability()->setUiTreeChildrenHidden(true);
|
m_multipleValveLocations.uiCapability()->setUiTreeChildrenHidden(true);
|
||||||
|
m_createOrEditValveTemplate.uiCapability()->setUiEditorTypeName(caf::PdmUiToolButtonEditor::uiEditorTypeName());
|
||||||
nameField()->uiCapability()->setUiReadOnly(true);
|
nameField()->uiCapability()->setUiReadOnly(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -150,6 +156,14 @@ double RimWellPathValve::flowCoefficient() const
|
|||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimValveTemplate* RimWellPathValve::valveTemplate() const
|
||||||
|
{
|
||||||
|
return m_valveTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -407,6 +421,18 @@ void RimWellPathValve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
|||||||
applyValveLabelAndIcon();
|
applyValveLabelAndIcon();
|
||||||
this->updateConnectedEditors();
|
this->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
|
else if (changedField == &m_createOrEditValveTemplate)
|
||||||
|
{
|
||||||
|
m_createOrEditValveTemplate = false;
|
||||||
|
if (m_valveTemplate == nullptr)
|
||||||
|
{
|
||||||
|
RicNewValveTemplateFeature::createNewValveTemplateForValveAndUpdate(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Riu3DMainWindowTools::selectAsCurrentItem(m_valveTemplate());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RimPerforationInterval* perfInterval;
|
RimPerforationInterval* perfInterval;
|
||||||
this->firstAncestorOrThisOfTypeAsserted(perfInterval);
|
this->firstAncestorOrThisOfTypeAsserted(perfInterval);
|
||||||
@ -426,7 +452,23 @@ void RimWellPathValve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering
|
|||||||
|
|
||||||
uiOrdering.add(&m_valveTemplate);
|
uiOrdering.add(&m_valveTemplate);
|
||||||
|
|
||||||
if (componentType() == RiaDefines::UNDEFINED_COMPONENT) return;
|
{
|
||||||
|
uiOrdering.add(&m_createOrEditValveTemplate, false);
|
||||||
|
if (m_valveTemplate() == nullptr)
|
||||||
|
{
|
||||||
|
m_createOrEditValveTemplate.uiCapability()->setUiName("New");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_createOrEditValveTemplate.uiCapability()->setUiName("Edit");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_valveTemplate())
|
||||||
|
{
|
||||||
|
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Parameters from Template");
|
||||||
|
m_valveTemplate->uiOrdering("InsideValve", *group);
|
||||||
|
}
|
||||||
|
|
||||||
if (componentType() == RiaDefines::ICV || componentType() == RiaDefines::ICD)
|
if (componentType() == RiaDefines::ICV || componentType() == RiaDefines::ICD)
|
||||||
{
|
{
|
||||||
@ -454,13 +496,8 @@ void RimWellPathValve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering
|
|||||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Multiple Valve Locations");
|
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Multiple Valve Locations");
|
||||||
m_multipleValveLocations->uiOrdering(uiConfigName, *group);
|
m_multipleValveLocations->uiOrdering(uiConfigName, *group);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_valveTemplate)
|
uiOrdering.skipRemainingFields(true);
|
||||||
{
|
|
||||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Parameters from Template");
|
|
||||||
m_valveTemplate->uiOrdering("InsideValve", *group);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -50,6 +50,7 @@ public:
|
|||||||
std::vector<double> valveLocations() const;
|
std::vector<double> valveLocations() const;
|
||||||
double orificeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
double orificeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||||
double flowCoefficient() const;
|
double flowCoefficient() const;
|
||||||
|
RimValveTemplate* valveTemplate() const;
|
||||||
void setValveTemplate(RimValveTemplate* valveTemplate);
|
void setValveTemplate(RimValveTemplate* valveTemplate);
|
||||||
void applyValveLabelAndIcon();
|
void applyValveLabelAndIcon();
|
||||||
const RimWellPathAicdParameters* aicdParameters() const;
|
const RimWellPathAicdParameters* aicdParameters() const;
|
||||||
@ -82,7 +83,7 @@ private:
|
|||||||
caf::PdmPtrField<RimValveTemplate*> m_valveTemplate;
|
caf::PdmPtrField<RimValveTemplate*> m_valveTemplate;
|
||||||
caf::PdmField<double> m_measuredDepth;
|
caf::PdmField<double> m_measuredDepth;
|
||||||
caf::PdmChildField<RimMultipleValveLocations*> m_multipleValveLocations;
|
caf::PdmChildField<RimMultipleValveLocations*> m_multipleValveLocations;
|
||||||
|
caf::PdmField<bool> m_createOrEditValveTemplate;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -664,6 +664,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
|||||||
{
|
{
|
||||||
menuBuilder << "RicNewValveTemplateFeature";
|
menuBuilder << "RicNewValveTemplateFeature";
|
||||||
}
|
}
|
||||||
|
else if (dynamic_cast<RimValveTemplate*>(uiItem))
|
||||||
|
{
|
||||||
|
menuBuilder << "RicDeleteValveTemplateFeature";
|
||||||
|
}
|
||||||
else if (dynamic_cast<RimFractureTemplateCollection*>(uiItem))
|
else if (dynamic_cast<RimFractureTemplateCollection*>(uiItem))
|
||||||
{
|
{
|
||||||
menuBuilder << "RicPasteEllipseFractureFeature";
|
menuBuilder << "RicPasteEllipseFractureFeature";
|
||||||
|
Loading…
Reference in New Issue
Block a user