mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2127 Sim Well Branches : Move logic related to uiOrdering to RiaSimWellBranchTools
This commit is contained in:
parent
f8e7a8aa26
commit
9c4077a040
@ -22,6 +22,8 @@
|
|||||||
#include "RigEclipseCaseData.h"
|
#include "RigEclipseCaseData.h"
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
#include "RimWellPlotTools.h"
|
||||||
|
#include "cafPdmUiOrdering.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -66,3 +68,27 @@ QList<caf::PdmOptionItemInfo> RiaSimWellBranchTools::valueOptionsForBranchIndexF
|
|||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequired(caf::PdmUiOrdering* uiOrdering,
|
||||||
|
const QString& wellPathOrSimWellName,
|
||||||
|
const caf::PdmField<bool>& branchDetectionField,
|
||||||
|
const caf::PdmField<int>& branchIndexField)
|
||||||
|
{
|
||||||
|
if (!RimWellPlotTools::hasAssociatedWellPath(wellPathOrSimWellName))
|
||||||
|
{
|
||||||
|
const QString simWellName = RimWellPlotTools::simWellName(wellPathOrSimWellName);
|
||||||
|
|
||||||
|
if (RiaSimWellBranchTools::simulationWellBranches(simWellName, true).size() > 1)
|
||||||
|
{
|
||||||
|
uiOrdering->add(&branchDetectionField);
|
||||||
|
|
||||||
|
if (RiaSimWellBranchTools::simulationWellBranches(simWellName, branchDetectionField).size() > 1)
|
||||||
|
{
|
||||||
|
uiOrdering->add(&branchIndexField);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafPdmField.h"
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
@ -28,7 +30,8 @@ class RigWellPath;
|
|||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
class PdmOptionItemInfo;
|
class PdmOptionItemInfo;
|
||||||
}
|
class PdmUiOrdering;
|
||||||
|
} // namespace caf
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@ -38,5 +41,10 @@ class RiaSimWellBranchTools
|
|||||||
public:
|
public:
|
||||||
static std::vector<const RigWellPath*> simulationWellBranches(const QString& simWellName, bool useAutoDetectionOfBranches);
|
static std::vector<const RigWellPath*> simulationWellBranches(const QString& simWellName, bool useAutoDetectionOfBranches);
|
||||||
|
|
||||||
static QList<caf::PdmOptionItemInfo> valueOptionsForBranchIndexField(const std::vector<const RigWellPath*>& simulationWellPaths);
|
static QList<caf::PdmOptionItemInfo>
|
||||||
|
valueOptionsForBranchIndexField(const std::vector<const RigWellPath*>& simulationWellPaths);
|
||||||
|
|
||||||
|
static void appendSimWellBranchFieldsIfRequired(caf::PdmUiOrdering* uiOrdering, const QString& wellPathOrSimWellName,
|
||||||
|
const caf::PdmField<bool>& branchDetectionField,
|
||||||
|
const caf::PdmField<int>& branchIndexField);
|
||||||
};
|
};
|
||||||
|
@ -759,15 +759,10 @@ void RimWellRftPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
|||||||
uiOrdering.add(&m_userName);
|
uiOrdering.add(&m_userName);
|
||||||
uiOrdering.add(&m_wellPathNameOrSimWellName);
|
uiOrdering.add(&m_wellPathNameOrSimWellName);
|
||||||
|
|
||||||
if (!RimWellPlotTools::hasAssociatedWellPath(m_wellPathNameOrSimWellName))
|
RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequired(&uiOrdering,
|
||||||
{
|
m_wellPathNameOrSimWellName,
|
||||||
uiOrdering.add(&m_branchDetection);
|
m_branchDetection,
|
||||||
|
m_branchIndex);
|
||||||
if (RiaSimWellBranchTools::simulationWellBranches(associatedSimWellName(), m_branchDetection).size() > 1)
|
|
||||||
{
|
|
||||||
uiOrdering.add(&m_branchIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
caf::PdmUiGroup* sourcesGroup = uiOrdering.addNewGroupWithKeyword("Sources", "Sources");
|
caf::PdmUiGroup* sourcesGroup = uiOrdering.addNewGroupWithKeyword("Sources", "Sources");
|
||||||
sourcesGroup->add(&m_selectedSources);
|
sourcesGroup->add(&m_selectedSources);
|
||||||
|
Loading…
Reference in New Issue
Block a user