#2037 RFT Plot: Set formation case from plot

This commit is contained in:
Rebecca Cox 2017-11-06 13:39:14 +01:00
parent 1e943e1607
commit bac2d2b4b2
3 changed files with 26 additions and 33 deletions

View File

@ -260,7 +260,7 @@ void RimWellRftPlot::updateFormationNamesData() const
{ {
for (size_t i = 0; i < m_wellLogPlot->trackCount(); i++) for (size_t i = 0; i < m_wellLogPlot->trackCount(); i++)
{ {
m_wellLogPlot->trackByIndex(i)->updateFormationNamesData(RimWellLogTrack::WELL_PATH, nullptr, QString(), 0); m_wellLogPlot->trackByIndex(i)->updateFormationNamesData(nullptr, RimWellLogTrack::WELL_PATH, nullptr, QString(), 0);
} }
return; return;
} }
@ -282,9 +282,17 @@ void RimWellRftPlot::updateFormationNamesData() const
trajectoryType = RimWellLogTrack::SIMULATION_WELL; trajectoryType = RimWellLogTrack::SIMULATION_WELL;
} }
RimCase* rimCase = nullptr;
std::vector<RimCase*> cases;
proj->allCases(cases);
if (!cases.empty())
{
rimCase = cases[0];
}
if (m_wellLogPlot->trackCount() > 0) if (m_wellLogPlot->trackCount() > 0)
{ {
m_wellLogPlot->trackByIndex(0)->updateFormationNamesData(trajectoryType, wellPath, m_wellName, m_branchIndex); m_wellLogPlot->trackByIndex(0)->updateFormationNamesData(rimCase, trajectoryType, wellPath, m_wellName, m_branchIndex);
} }
} }

View File

@ -44,9 +44,7 @@
#include "RimProject.h" #include "RimProject.h"
#include "RimTools.h" #include "RimTools.h"
#include "RimWellFlowRateCurve.h" #include "RimWellFlowRateCurve.h"
#include "RimWellAllocationPlot.h"
#include "RimWellLogCurve.h" #include "RimWellLogCurve.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h" #include "RimWellLogPlotCollection.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RimWellPathCollection.h" #include "RimWellPathCollection.h"
@ -248,30 +246,6 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
} }
else if (changedField == &m_showFormations) else if (changedField == &m_showFormations)
{ {
if (!m_formationCase && m_showFormations)
{
RimProject* proj = RiaApplication::instance()->project();
if (proj)
{
std::vector<RimCase*> cases;
proj->allCases(cases);
if (!cases.empty())
{
m_formationCase = cases[0];
}
}
RimWellAllocationPlot* wellAllocationPlot;
firstAncestorOrThisOfType(wellAllocationPlot);
if (wellAllocationPlot)
{
m_formationTrajectoryType = RimWellLogTrack::SIMULATION_WELL;
m_simulationWellChosen = true;
m_formationSimWellName = wellAllocationPlot->wellName();
}
}
loadDataAndUpdate(); loadDataAndUpdate();
} }
else if (changedField == &m_formationCase) else if (changedField == &m_formationCase)
@ -497,13 +471,15 @@ void RimWellLogTrack::loadDataAndUpdate()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateFormationNamesData(TrajectoryType trajectoryType, RimWellPath* wellPath, QString simWellName, int branchIndex) void RimWellLogTrack::updateFormationNamesData(RimCase* rimCase, TrajectoryType trajectoryType, RimWellPath* wellPath, QString simWellName, int branchIndex)
{ {
m_formationCase = rimCase;
m_formationTrajectoryType = trajectoryType; m_formationTrajectoryType = trajectoryType;
m_formationWellPath = wellPath; m_formationWellPath = wellPath;
m_formationSimWellName = simWellName; m_formationSimWellName = simWellName;
m_formationBranchIndex = branchIndex; m_formationBranchIndex = branchIndex;
updateConnectedEditors();
updateFormationNamesOnPlot(); updateFormationNamesOnPlot();
} }
@ -518,11 +494,19 @@ void RimWellLogTrack::setXAxisTitle(const QString& text)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setBranchIndex(int branchIndex) void RimWellLogTrack::setFormationBranchIndex(int branchIndex)
{ {
m_formationBranchIndex = branchIndex; m_formationBranchIndex = branchIndex;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimWellLogTrack::formationBranchIndex() const
{
return m_formationBranchIndex;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -77,13 +77,14 @@ public:
size_t curveIndex(RimWellLogCurve* curve); size_t curveIndex(RimWellLogCurve* curve);
size_t curveCount() { return curves.size(); } size_t curveCount() { return curves.size(); }
void setXAxisTitle(const QString& text); void setXAxisTitle(const QString& text);
void setBranchIndex(int branchIndex); void setFormationBranchIndex(int branchIndex);
int formationBranchIndex() const;
void recreateViewer(); void recreateViewer();
void detachAllCurves(); void detachAllCurves();
void loadDataAndUpdate(); void loadDataAndUpdate();
void updateFormationNamesData(TrajectoryType trajectoryType, RimWellPath* wellPath, QString simWellName, int branchIndex); void updateFormationNamesData(RimCase* rimCase, TrajectoryType trajectoryType, RimWellPath* wellPath, QString simWellName, int branchIndex);
void availableDepthRange(double* minimumDepth, double* maximumDepth); void availableDepthRange(double* minimumDepth, double* maximumDepth);
void updateXZoomAndParentPlotDepthZoom(); void updateXZoomAndParentPlotDepthZoom();