#2127 Sim Well Branches : Move logic related to uiOrdering to RiaSimWellBranchTools

This commit is contained in:
Magne Sjaastad
2017-12-08 09:27:37 +01:00
parent f8e7a8aa26
commit 9c4077a040
3 changed files with 40 additions and 11 deletions

View File

@@ -22,6 +22,8 @@
#include "RigEclipseCaseData.h"
#include "RimEclipseCase.h"
#include "RimProject.h"
#include "RimWellPlotTools.h"
#include "cafPdmUiOrdering.h"
//--------------------------------------------------------------------------------------------------
///
@@ -66,3 +68,27 @@ QList<caf::PdmOptionItemInfo> RiaSimWellBranchTools::valueOptionsForBranchIndexF
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);
}
}
}
}