mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-03 12:10:57 -06:00
#2038 RFT Plot: move formation logic from track to rft plot
This commit is contained in:
parent
2fc796ac27
commit
1e943e1607
@ -251,6 +251,43 @@ void RimWellRftPlot::updateSelectedTimeStepsFromSelectedSources()
|
||||
m_selectedTimeSteps = newTimeStepsSelections;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellRftPlot::updateFormationNamesData() const
|
||||
{
|
||||
if (m_selectedTimeSteps().empty())
|
||||
{
|
||||
for (size_t i = 0; i < m_wellLogPlot->trackCount(); i++)
|
||||
{
|
||||
m_wellLogPlot->trackByIndex(i)->updateFormationNamesData(RimWellLogTrack::WELL_PATH, nullptr, QString(), 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimOilField* oilField = proj->activeOilField();
|
||||
|
||||
RimWellPathCollection* wellPathCollection = oilField->wellPathCollection();
|
||||
RimWellPath* wellPath = wellPathCollection->wellPathByName(m_wellName);
|
||||
|
||||
RimWellLogTrack::TrajectoryType trajectoryType;
|
||||
|
||||
if (wellPath)
|
||||
{
|
||||
trajectoryType = RimWellLogTrack::WELL_PATH;
|
||||
}
|
||||
else
|
||||
{
|
||||
trajectoryType = RimWellLogTrack::SIMULATION_WELL;
|
||||
}
|
||||
|
||||
if (m_wellLogPlot->trackCount() > 0)
|
||||
{
|
||||
m_wellLogPlot->trackByIndex(0)->updateFormationNamesData(trajectoryType, wellPath, m_wellName, m_branchIndex);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1117,6 +1154,7 @@ void RimWellRftPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
}
|
||||
m_timeStepsToAddresses.clear();
|
||||
updateEditorsFromCurves();
|
||||
updateFormationNamesData();
|
||||
}
|
||||
else if (changedField == &m_selectedSources)
|
||||
{
|
||||
@ -1127,6 +1165,7 @@ void RimWellRftPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
if (changedField == &m_selectedSources ||
|
||||
changedField == &m_selectedTimeSteps)
|
||||
{
|
||||
updateFormationNamesData();
|
||||
syncCurvesFromUiSelection();
|
||||
m_selectedSourcesOrTimeStepsFieldsChanged = true;
|
||||
}
|
||||
@ -1373,6 +1412,7 @@ QString RimWellRftPlot::description() const
|
||||
void RimWellRftPlot::onLoadDataAndUpdate()
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
updateFormationNamesData();
|
||||
m_wellLogPlot->loadDataAndUpdate();
|
||||
updateEditorsFromCurves();
|
||||
}
|
||||
|
@ -151,6 +151,7 @@ private:
|
||||
void applyCurveAppearance(RimWellLogCurve* newCurve);
|
||||
void updateSelectedTimeStepsFromSelectedSources();
|
||||
|
||||
void updateFormationNamesData() const;
|
||||
private:
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
caf::PdmField<QString> m_userName;
|
||||
|
@ -472,7 +472,6 @@ void RimWellLogTrack::loadDataAndUpdate()
|
||||
m_wellLogTrackPlotWidget->setDepthTitle(wellLogPlot->depthPlotTitle());
|
||||
m_wellLogTrackPlotWidget->setXTitle(m_xAxisTitle);
|
||||
}
|
||||
|
||||
for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx)
|
||||
{
|
||||
curves[cIdx]->loadDataAndUpdate(true);
|
||||
@ -483,76 +482,31 @@ void RimWellLogTrack::loadDataAndUpdate()
|
||||
m_simulationWellChosen = true;
|
||||
}
|
||||
|
||||
RimWellRftPlot* rftPlot(nullptr);
|
||||
firstAncestorOrThisOfType(rftPlot);
|
||||
|
||||
RimWellPltPlot* pltPlot = nullptr;
|
||||
if (!rftPlot)
|
||||
if (m_showFormations)
|
||||
{
|
||||
firstAncestorOrThisOfType(pltPlot);
|
||||
}
|
||||
|
||||
RimWellAllocationPlot* wellAllocationPlot = nullptr;
|
||||
|
||||
if (rftPlot || pltPlot)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimOilField* oilField = proj->activeOilField();
|
||||
|
||||
RimWellPathCollection* wellPathCollection = oilField->wellPathCollection();
|
||||
RimWellPath* wellPath;
|
||||
|
||||
QString wellName;
|
||||
|
||||
if (rftPlot)
|
||||
{
|
||||
wellName = rftPlot->currentWellName();
|
||||
m_formationBranchIndex = rftPlot->branchIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
wellName = pltPlot->currentWellName();
|
||||
m_formationBranchIndex = pltPlot->branchIndex();
|
||||
}
|
||||
|
||||
wellPath = wellPathCollection->wellPathByName(wellName);
|
||||
|
||||
if (wellPath)
|
||||
{
|
||||
m_formationTrajectoryType = RimWellLogTrack::WELL_PATH;
|
||||
m_formationWellPath = wellPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_formationTrajectoryType = RimWellLogTrack::SIMULATION_WELL;
|
||||
m_simulationWellChosen = true;
|
||||
m_formationSimWellName = wellName;
|
||||
}
|
||||
setFormationFieldsUiReadOnly(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
firstAncestorOrThisOfType(wellAllocationPlot);
|
||||
}
|
||||
|
||||
if (wellAllocationPlot)
|
||||
{
|
||||
setFormationFieldsUiReadOnly(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_showFormations)
|
||||
{
|
||||
setFormationFieldsUiReadOnly(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
setFormationFieldsUiReadOnly(true);
|
||||
}
|
||||
}
|
||||
|
||||
updateFormationNamesOnPlot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::updateFormationNamesData(TrajectoryType trajectoryType, RimWellPath* wellPath, QString simWellName, int branchIndex)
|
||||
{
|
||||
m_formationTrajectoryType = trajectoryType;
|
||||
m_formationWellPath = wellPath;
|
||||
m_formationSimWellName = simWellName;
|
||||
m_formationBranchIndex = branchIndex;
|
||||
|
||||
updateFormationNamesOnPlot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -83,6 +83,7 @@ public:
|
||||
void detachAllCurves();
|
||||
|
||||
void loadDataAndUpdate();
|
||||
void updateFormationNamesData(TrajectoryType trajectoryType, RimWellPath* wellPath, QString simWellName, int branchIndex);
|
||||
|
||||
void availableDepthRange(double* minimumDepth, double* maximumDepth);
|
||||
void updateXZoomAndParentPlotDepthZoom();
|
||||
|
Loading…
Reference in New Issue
Block a user