mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3304 Implement common data source changing for zonation and well path attributes
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "RimWellLogFileCurve.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
@@ -193,7 +194,7 @@ void RimWellLogCurveCommonDataSource::resetDefaultOptions()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogCurveCommonDataSource::updateDefaultOptions(const std::vector<RimWellLogCurve*>& curves)
|
||||
void RimWellLogCurveCommonDataSource::updateDefaultOptions(const std::vector<RimWellLogCurve*>& curves, const std::vector<RimWellLogTrack*>& tracks)
|
||||
{
|
||||
// Reset all options in the UI
|
||||
resetDefaultOptions();
|
||||
@@ -226,6 +227,13 @@ void RimWellLogCurveCommonDataSource::updateDefaultOptions(const std::vector<Rim
|
||||
uniqueWellNames.insert(fileCurve->wellName());
|
||||
}
|
||||
}
|
||||
for (RimWellLogTrack* track : tracks)
|
||||
{
|
||||
uniqueTrajectoryTypes.insert(static_cast<int>(RimWellLogExtractionCurve::WELL_PATH));
|
||||
uniqueWellPaths.insert(track->wellPathAttributeSource());
|
||||
uniqueCases.insert(track->formationNamesCase());
|
||||
uniqueWellPaths.insert(track->formationWellPath());
|
||||
}
|
||||
|
||||
|
||||
if (uniqueCases.size() == 1u)
|
||||
@@ -273,14 +281,18 @@ void RimWellLogCurveCommonDataSource::updateDefaultOptions()
|
||||
{
|
||||
std::vector<RimWellLogCurve*> curves;
|
||||
parentPlot->descendantsIncludingThisOfType(curves);
|
||||
this->updateDefaultOptions(curves);
|
||||
|
||||
std::vector<RimWellLogTrack*> tracks;
|
||||
parentPlot->descendantsIncludingThisOfType(tracks);
|
||||
|
||||
this->updateDefaultOptions(curves, tracks);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogCurveCommonDataSource::updateCurves(std::vector<RimWellLogCurve*>& curves)
|
||||
void RimWellLogCurveCommonDataSource::updateCurvesAndTracks(std::vector<RimWellLogCurve*>& curves, std::vector<RimWellLogTrack*>& tracks)
|
||||
{
|
||||
std::set<RimWellLogPlot*> plots;
|
||||
for (RimWellLogCurve* curve : curves)
|
||||
@@ -359,12 +371,55 @@ void RimWellLogCurveCommonDataSource::updateCurves(std::vector<RimWellLogCurve*>
|
||||
}
|
||||
}
|
||||
|
||||
for (RimWellLogTrack* track : tracks)
|
||||
{
|
||||
bool updatedSomething = false;
|
||||
if (caseToApply() != nullptr)
|
||||
{
|
||||
track->setFormationCase(caseToApply());
|
||||
updatedSomething = true;
|
||||
}
|
||||
|
||||
if (wellPathToApply() != nullptr)
|
||||
{
|
||||
track->setWellPathAttributesSource(wellPathToApply());
|
||||
track->setFormationWellPath(wellPathToApply());
|
||||
updatedSomething = true;
|
||||
}
|
||||
|
||||
if (updatedSomething)
|
||||
{
|
||||
RimWellLogPlot* parentPlot = nullptr;
|
||||
track->firstAncestorOrThisOfTypeAsserted(parentPlot);
|
||||
plots.insert(parentPlot);
|
||||
}
|
||||
}
|
||||
|
||||
for (RimWellLogPlot* plot : plots)
|
||||
{
|
||||
plot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogCurveCommonDataSource::updateCurvesAndTracks()
|
||||
{
|
||||
RimWellLogPlot* parentPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(parentPlot);
|
||||
if (parentPlot)
|
||||
{
|
||||
std::vector<RimWellLogCurve*> curves;
|
||||
parentPlot->descendantsIncludingThisOfType(curves);
|
||||
|
||||
std::vector<RimWellLogTrack*> tracks;
|
||||
parentPlot->descendantsIncludingThisOfType(tracks);
|
||||
|
||||
this->updateCurvesAndTracks(curves, tracks);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -445,13 +500,7 @@ void RimWellLogCurveCommonDataSource::fieldChangedByUi(const caf::PdmFieldHandle
|
||||
}
|
||||
}
|
||||
|
||||
if (parentPlot)
|
||||
{
|
||||
std::vector<RimWellLogCurve*> wellLogCurves;
|
||||
parentPlot->descendantsIncludingThisOfType(wellLogCurves);
|
||||
this->updateCurves(wellLogCurves);
|
||||
parentPlot->updateConnectedEditors();
|
||||
}
|
||||
this->updateCurvesAndTracks();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -461,14 +510,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogCurveCommonDataSource::calculateValueOpt
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
RimWellLogPlot* parentPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(parentPlot);
|
||||
if (parentPlot)
|
||||
{
|
||||
std::vector<RimWellLogCurve*> wellLogCurves;
|
||||
parentPlot->descendantsIncludingThisOfType(wellLogCurves);
|
||||
this->updateDefaultOptions(wellLogCurves);
|
||||
}
|
||||
this->updateDefaultOptions();
|
||||
|
||||
if (fieldNeedingOptions == &m_case)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
class RimCase;
|
||||
class RimWellLogCurve;
|
||||
class RimWellLogPlot;
|
||||
class RimWellLogTrack;
|
||||
class RimWellPath;
|
||||
|
||||
//==================================================================================================
|
||||
@@ -57,10 +58,10 @@ public:
|
||||
void setTimeStepToApply(int val);
|
||||
|
||||
void resetDefaultOptions();
|
||||
void updateDefaultOptions(const std::vector<RimWellLogCurve*>& curves);
|
||||
void updateDefaultOptions(const std::vector<RimWellLogCurve*>& curves, const std::vector<RimWellLogTrack*>& tracks);
|
||||
void updateDefaultOptions();
|
||||
void updateCurves(std::vector<RimWellLogCurve*>& curves);
|
||||
|
||||
void updateCurvesAndTracks(std::vector<RimWellLogCurve*>& curves, std::vector<RimWellLogTrack*>& tracks);
|
||||
void updateCurvesAndTracks();
|
||||
void applyPrevCase();
|
||||
void applyNextCase();
|
||||
|
||||
|
||||
@@ -844,6 +844,14 @@ void RimWellLogTrack::setFormationWellPath(RimWellPath* wellPath)
|
||||
m_formationWellPathForSourceCase = wellPath;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPath* RimWellLogTrack::formationWellPath() const
|
||||
{
|
||||
return m_formationWellPathForSourceCase;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1106,6 +1114,14 @@ void RimWellLogTrack::setShowFormations(bool on)
|
||||
m_showFormations = on;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellLogTrack::showFormations() const
|
||||
{
|
||||
return m_showFormations;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1122,6 +1138,14 @@ void RimWellLogTrack::setShowWellPathAttributes(bool on)
|
||||
m_showWellPathAttributes = on;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellLogTrack::showWellPathAttributes() const
|
||||
{
|
||||
return m_showWellPathAttributes;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1131,6 +1155,14 @@ void RimWellLogTrack::setWellPathAttributesSource(RimWellPath* wellPath)
|
||||
updateWellPathAttributesCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPath* RimWellLogTrack::wellPathAttributeSource() const
|
||||
{
|
||||
return m_wellPathAttributeSource;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -89,6 +89,7 @@ public:
|
||||
void setWidthScaleFactor(WidthScaleFactor scaleFactor);
|
||||
|
||||
void setFormationWellPath(RimWellPath* wellPath);
|
||||
RimWellPath* formationWellPath() const;
|
||||
void setFormationSimWellName(const QString& simWellName);
|
||||
void setFormationBranchIndex(int branchIndex);
|
||||
void setFormationCase(RimCase* rimCase);
|
||||
@@ -116,15 +117,18 @@ public:
|
||||
void setTickIntervals(double majorTickInterval, double minorTickInterval);
|
||||
void setXAxisGridVisibility(RimWellLogPlot::AxisGridVisibility gridLines);
|
||||
void setShowFormations(bool on);
|
||||
bool showFormations() const;
|
||||
void setShowFormationLabels(bool on);
|
||||
void setShowWellPathAttributes(bool on);
|
||||
bool showWellPathAttributes() const;
|
||||
void setWellPathAttributesSource(RimWellPath* wellPath);
|
||||
|
||||
|
||||
RimWellPath* wellPathAttributeSource() const;
|
||||
RiuWellLogTrack* viewer();
|
||||
|
||||
RimWellLogCurve* curveDefinitionFromCurve(const QwtPlotCurve* curve) const;
|
||||
|
||||
void setLogarithmicScale(bool enable);
|
||||
void setLogarithmicScale(bool enable);
|
||||
|
||||
std::map<int, std::vector<RimWellFlowRateCurve*>> visibleStackedCurves();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user