mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2127 Sim Well Branches : Use helper function instead of local function
This commit is contained in:
parent
9ef040d891
commit
97743e6d70
@ -167,7 +167,7 @@ bool RimWellPlotTools::hasFlowData(RimWellPath* wellPath)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPlotTools::isWellPath(const QString& wellName)
|
||||
bool RimWellPlotTools::hasAssociatedWellPath(const QString& wellName)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimWellPath* wellPath = proj->wellPathByName(wellName);
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
|
||||
// others
|
||||
static bool hasFlowData(const RimWellLogFile* wellLogFile);
|
||||
static bool isWellPath(const QString& wellName);
|
||||
static bool hasAssociatedWellPath(const QString& wellName);
|
||||
|
||||
// Both
|
||||
static std::vector<RimEclipseResultCase*> gridCasesForWell(const QString& simWellName);
|
||||
|
@ -104,24 +104,6 @@ RimWellRftPlot::RimWellRftPlot()
|
||||
m_isOnLoad = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogTrack::TrajectoryType trajectoryTypeFromWellName(const QString& wellPathOrSimWellName)
|
||||
{
|
||||
RimWellLogTrack::TrajectoryType trajectoryType = RimWellLogTrack::SIMULATION_WELL;
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimWellPath* wellPath = proj->wellPathByName(wellPathOrSimWellName);
|
||||
|
||||
if (wellPath)
|
||||
{
|
||||
trajectoryType = RimWellLogTrack::WELL_PATH;
|
||||
}
|
||||
|
||||
return trajectoryType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -255,8 +237,6 @@ void RimWellRftPlot::updateFormationsOnPlot() const
|
||||
{
|
||||
if (m_wellLogPlot->trackCount() > 0)
|
||||
{
|
||||
RimWellLogTrack::TrajectoryType trajectoryType = trajectoryTypeFromWellName(m_wellPathNameOrSimWellName);
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimWellPath* wellPath = proj->wellPathByName(m_wellPathNameOrSimWellName);
|
||||
|
||||
@ -273,15 +253,14 @@ void RimWellRftPlot::updateFormationsOnPlot() const
|
||||
formationNamesCase = cases[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (trajectoryType == RimWellLogTrack::SIMULATION_WELL)
|
||||
{
|
||||
m_wellLogPlot->trackByIndex(0)->setAndUpdateSimWellFormationNamesAndBranchData(formationNamesCase, associatedSimWellName(), m_branchIndex, m_branchDetection);
|
||||
}
|
||||
else if (trajectoryType == RimWellLogTrack::WELL_PATH)
|
||||
else if (wellPath)
|
||||
{
|
||||
m_wellLogPlot->trackByIndex(0)->setAndUpdateWellPathFormationNamesData(formationNamesCase, wellPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_wellLogPlot->trackByIndex(0)->setAndUpdateSimWellFormationNamesAndBranchData(formationNamesCase, associatedSimWellName(), m_branchIndex, m_branchDetection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -780,7 +759,7 @@ void RimWellRftPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
uiOrdering.add(&m_userName);
|
||||
uiOrdering.add(&m_wellPathNameOrSimWellName);
|
||||
|
||||
if (trajectoryTypeFromWellName(m_wellPathNameOrSimWellName) == RimWellLogTrack::SIMULATION_WELL)
|
||||
if (!RimWellPlotTools::hasAssociatedWellPath(m_wellPathNameOrSimWellName))
|
||||
{
|
||||
uiOrdering.add(&m_branchDetection);
|
||||
|
||||
|
@ -353,7 +353,7 @@ void RimWellLogRftCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderi
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Curve Data");
|
||||
curveDataGroup->add(&m_eclipseResultCase);
|
||||
curveDataGroup->add(&m_wellName);
|
||||
if (!RimWellPlotTools::isWellPath(m_wellName))
|
||||
if (!RimWellPlotTools::hasAssociatedWellPath(m_wellName))
|
||||
{
|
||||
curveDataGroup->add(&m_branchDetection);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user