#2136, #2136 Zoom PLT plot when adding curves (respect autoscale)

Fix "New PLT plot" command using simwell name and not wellpath name
Rename of some methods
Use Phase Split as default
This commit is contained in:
Jacob Støren
2017-11-17 15:35:07 +01:00
parent 8c95975054
commit 5731acb319
10 changed files with 30 additions and 21 deletions

View File

@@ -65,7 +65,7 @@ bool RicNewPltPlotFeature::isCommandEnabled()
RimProject* proj = RiaApplication::instance()->project(); RimProject* proj = RiaApplication::instance()->project();
QString simWellName = simWell->name(); QString simWellName = simWell->name();
RimWellPath* wellPath = proj->wellPathFromSimulationWell(simWellName); RimWellPath* wellPath = proj->wellPathFromSimWellName(simWellName);
enable = wellPath != nullptr; enable = wellPath != nullptr;
} }
return enable; return enable;
@@ -81,22 +81,26 @@ void RicNewPltPlotFeature::onActionTriggered(bool isChecked)
RimPltPlotCollection* pltPlotColl = proj->mainPlotCollection()->pltPlotCollection(); RimPltPlotCollection* pltPlotColl = proj->mainPlotCollection()->pltPlotCollection();
if (pltPlotColl) if (pltPlotColl)
{ {
QString wellName; QString wellPathName;
RimWellPath* wellPath = nullptr; RimWellPath* wellPath = nullptr;
RimSimWellInView* eclipseWell = nullptr; RimSimWellInView* eclipseWell = nullptr;
if ((wellPath = caf::firstAncestorOfTypeFromSelectedObject<RimWellPath*>()) != nullptr) if ((wellPath = caf::firstAncestorOfTypeFromSelectedObject<RimWellPath*>()) != nullptr)
{ {
wellName = wellPath->name(); wellPathName = wellPath->name();
} }
else if ((eclipseWell = caf::firstAncestorOfTypeFromSelectedObject<RimSimWellInView*>()) != nullptr) else if ((eclipseWell = caf::firstAncestorOfTypeFromSelectedObject<RimSimWellInView*>()) != nullptr)
{ {
wellName = eclipseWell->name(); RimWellPath* wellPath = proj->wellPathFromSimWellName(eclipseWell->name());
if (!wellPath ) return;
wellPathName = wellPath->name();
} }
QString plotName = QString(RimWellPltPlot::plotNameFormatString()).arg(wellName); QString plotName = QString(RimWellPltPlot::plotNameFormatString()).arg(wellPathName);
RimWellPltPlot* pltPlot = new RimWellPltPlot(); RimWellPltPlot* pltPlot = new RimWellPltPlot();
pltPlot->setCurrentWellName(wellName); pltPlot->setCurrentWellName(wellPathName);
RimWellLogTrack* plotTrack = new RimWellLogTrack(); RimWellLogTrack* plotTrack = new RimWellLogTrack();
pltPlot->wellLogPlot()->addTrack(plotTrack); pltPlot->wellLogPlot()->addTrack(plotTrack);

View File

@@ -253,7 +253,7 @@ std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingPressure(co
for (auto wellPath : wellPaths) for (auto wellPath : wellPaths)
{ {
if (simWellName == wellPath->associatedSimulationWell()) if (simWellName == wellPath->associatedSimulationWellName())
{ {
const std::vector<RimWellLogFile*> files = wellPath->wellLogFiles(); const std::vector<RimWellLogFile*> files = wellPath->wellLogFiles();
@@ -582,7 +582,7 @@ RimWellPath* RimWellPlotTools::wellPathByWellPathNameOrSimWellName(const QString
RimProject* proj = RiaApplication::instance()->project(); RimProject* proj = RiaApplication::instance()->project();
RimWellPath* wellPath = proj->wellPathByName(wellPathNameOrSimwellName); RimWellPath* wellPath = proj->wellPathByName(wellPathNameOrSimwellName);
return wellPath != nullptr ? wellPath : proj->wellPathFromSimulationWell(wellPathNameOrSimwellName); return wellPath != nullptr ? wellPath : proj->wellPathFromSimWellName(wellPathNameOrSimwellName);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -591,7 +591,7 @@ RimWellPath* RimWellPlotTools::wellPathByWellPathNameOrSimWellName(const QString
QString RimWellPlotTools::simWellName(const QString& wellPathNameOrSimWellName) QString RimWellPlotTools::simWellName(const QString& wellPathNameOrSimWellName)
{ {
RimWellPath* wellPath = wellPathByWellPathNameOrSimWellName(wellPathNameOrSimWellName); RimWellPath* wellPath = wellPathByWellPathNameOrSimWellName(wellPathNameOrSimWellName);
return wellPath != nullptr ? wellPath->associatedSimulationWell() : wellPathNameOrSimWellName; return wellPath != nullptr ? wellPath->associatedSimulationWellName() : wellPathNameOrSimWellName;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -40,7 +40,7 @@ class RigEclipseCaseData;
//================================================================================================== //==================================================================================================
/// ///
//================================================================================================== //==================================================================================================
enum FlowType { FLOW_TYPE_TOTAL, FLOW_TYPE_PHASE_SPLIT }; enum FlowType { FLOW_TYPE_PHASE_SPLIT, FLOW_TYPE_TOTAL };
enum FlowPhase { FLOW_PHASE_NONE, FLOW_PHASE_OIL, FLOW_PHASE_GAS, FLOW_PHASE_WATER, FLOW_PHASE_TOTAL }; enum FlowPhase { FLOW_PHASE_NONE, FLOW_PHASE_OIL, FLOW_PHASE_GAS, FLOW_PHASE_WATER, FLOW_PHASE_TOTAL };
//================================================================================================== //==================================================================================================

View File

@@ -76,8 +76,9 @@ namespace caf
template<> template<>
void caf::AppEnum< FlowType>::setUp() void caf::AppEnum< FlowType>::setUp()
{ {
addItem(FLOW_TYPE_TOTAL, "TOTAL", "Total Flow");
addItem(FLOW_TYPE_PHASE_SPLIT, "PHASE_SPLIT", "Phase Split"); addItem(FLOW_TYPE_PHASE_SPLIT, "PHASE_SPLIT", "Phase Split");
addItem(FLOW_TYPE_TOTAL, "TOTAL", "Total Flow");
setDefault(FLOW_TYPE_PHASE_SPLIT);
} }
template<> template<>
@@ -412,7 +413,7 @@ public:
std::map<size_t, std::pair<size_t, size_t> > globCellIdxToIdxInSimWellBranch; std::map<size_t, std::pair<size_t, size_t> > globCellIdxToIdxInSimWellBranch;
const RimWellPath* wellPath = RimWellPlotTools::wellPathByWellPathNameOrSimWellName(wellPathName); const RimWellPath* wellPath = RimWellPlotTools::wellPathByWellPathNameOrSimWellName(wellPathName);
const RigSimWellData* simWell = wellPath != nullptr ? eclCase->eclipseCaseData()->findSimWellData(wellPath->associatedSimulationWell()) : nullptr; const RigSimWellData* simWell = wellPath != nullptr ? eclCase->eclipseCaseData()->findSimWellData(wellPath->associatedSimulationWellName()) : nullptr;
if (!simWell) return; if (!simWell) return;
@@ -594,7 +595,10 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
} }
curveGroupId++; curveGroupId++;
} }
m_wellLogPlot->loadDataAndUpdate(); m_wellLogPlot->loadDataAndUpdate();
m_wellLogPlot->updateDepthZoom();
plotTrack->updateXZoom();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -825,9 +825,9 @@ void RimWellRftPlot::calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>
{ {
wellNames.insert(wellPath->name()); wellNames.insert(wellPath->name());
if (!wellPath->associatedSimulationWell().isEmpty()) if (!wellPath->associatedSimulationWellName().isEmpty())
{ {
simWellsAssociatedWithWellPath.insert(wellPath->associatedSimulationWell()); simWellsAssociatedWithWellPath.insert(wellPath->associatedSimulationWellName());
} }
} }

View File

@@ -903,12 +903,12 @@ std::vector<const RigWellPath*> RimProject::simulationWellBranches(const QString
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimWellPath* RimProject::wellPathFromSimulationWell(const QString& simWellName, int branchIndex) RimWellPath* RimProject::wellPathFromSimWellName(const QString& simWellName, int branchIndex)
{ {
std::vector<RimWellPath*> paths; std::vector<RimWellPath*> paths;
for (RimWellPath* const path : allWellPaths()) for (RimWellPath* const path : allWellPaths())
{ {
if (QString::compare(path->associatedSimulationWell(), simWellName) == 0 && if (QString::compare(path->associatedSimulationWellName(), simWellName) == 0 &&
(branchIndex < 0 || path->associatedSimulationWellBranch() == branchIndex)) (branchIndex < 0 || path->associatedSimulationWellBranch() == branchIndex))
{ {
return path; return path;

View File

@@ -126,7 +126,7 @@ public:
std::vector<RimEclipseCase*> eclipseCases() const; std::vector<RimEclipseCase*> eclipseCases() const;
std::vector<QString> simulationWellNames() const; std::vector<QString> simulationWellNames() const;
std::vector<const RigWellPath*> simulationWellBranches(const QString& simWellName); std::vector<const RigWellPath*> simulationWellBranches(const QString& simWellName);
RimWellPath* wellPathFromSimulationWell(const QString& simWellName, int branchIndex = -1); RimWellPath* wellPathFromSimWellName(const QString& simWellName, int branchIndex = -1);
RimWellPath* wellPathByName(const QString& wellPathName) const; RimWellPath* wellPathByName(const QString& wellPathName) const;
std::vector<RimWellPath*> allWellPaths() const; std::vector<RimWellPath*> allWellPaths() const;

View File

@@ -477,7 +477,7 @@ RigEclipseWellLogExtractor* RimWellLogRftCurve::extractor()
RigEclipseWellLogExtractor* eclExtractor = nullptr; RigEclipseWellLogExtractor* eclExtractor = nullptr;
RimProject* proj = RiaApplication::instance()->project(); RimProject* proj = RiaApplication::instance()->project();
RimWellPath* wellPath = proj->wellPathFromSimulationWell(m_wellName()); RimWellPath* wellPath = proj->wellPathFromSimWellName(m_wellName());
eclExtractor = wellLogCollection->findOrCreateExtractor(wellPath, m_eclipseResultCase); eclExtractor = wellLogCollection->findOrCreateExtractor(wellPath, m_eclipseResultCase);
if (!eclExtractor) if (!eclExtractor)

View File

@@ -324,7 +324,7 @@ QList<caf::PdmOptionItemInfo> RimWellPath::calculateValueOptions(const caf::PdmF
{ {
if (wellPath->isAssociatedWithSimulationWell() && wellPath != this) if (wellPath->isAssociatedWithSimulationWell() && wellPath != this)
{ {
associatedSimWells.insert(wellPath->associatedSimulationWell()); associatedSimWells.insert(wellPath->associatedSimulationWellName());
} }
} }
@@ -687,7 +687,7 @@ RimWellPath* RimWellPath::fromFilePath(QString filePath)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
const QString RimWellPath::associatedSimulationWell() const const QString RimWellPath::associatedSimulationWellName() const
{ {
return m_simWellName; return m_simWellName;
} }

View File

@@ -118,8 +118,9 @@ public:
RiaEclipseUnitTools::UnitSystem unitSystem() const; RiaEclipseUnitTools::UnitSystem unitSystem() const;
static RimWellPath* fromFilePath(QString filePath); static RimWellPath* fromFilePath(QString filePath);
const QString associatedSimulationWell() const; const QString associatedSimulationWellName() const;
int associatedSimulationWellBranch() const; int associatedSimulationWellBranch() const;
bool tryAssociateWithSimulationWell(); bool tryAssociateWithSimulationWell();
bool isAssociatedWithSimulationWell() const; bool isAssociatedWithSimulationWell() const;
bool tryMatchName(QString wellPathName, bool tryMatchName(QString wellPathName,