#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 committed 2017-11-17 15:35:07 +01:00
1 parent 8c95975054
commit 5731acb319
10 files changed
+30 -21

No files matched your search

@@ -65,7 +65,7 @@ bool RicNewPltPlotFeature::isCommandEnabled()
RimProject* proj = RiaApplication::instance()->project();
QString simWellName = simWell->name();
RimWellPath* wellPath = proj->wellPathFromSimulationWell(simWellName);
RimWellPath* wellPath = proj->wellPathFromSimWellName(simWellName);
enable = wellPath != nullptr;
}
return enable;
@@ -81,22 +81,26 @@ void RicNewPltPlotFeature::onActionTriggered(bool isChecked)
RimPltPlotCollection* pltPlotColl = proj->mainPlotCollection()->pltPlotCollection();
if (pltPlotColl)
{
QString wellName;
QString wellPathName;
RimWellPath* wellPath = nullptr;
RimSimWellInView* eclipseWell = nullptr;
if ((wellPath = caf::firstAncestorOfTypeFromSelectedObject<RimWellPath*>()) != nullptr)
{
wellName = wellPath->name();
wellPathName = wellPath->name();
}
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();
pltPlot->setCurrentWellName(wellName);
pltPlot->setCurrentWellName(wellPathName);
RimWellLogTrack* plotTrack = new RimWellLogTrack();
pltPlot->wellLogPlot()->addTrack(plotTrack);
@@ -253,7 +253,7 @@ std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingPressure(co
for (auto wellPath : wellPaths)
{
if (simWellName == wellPath->associatedSimulationWell())
if (simWellName == wellPath->associatedSimulationWellName())
{
const std::vector<RimWellLogFile*> files = wellPath->wellLogFiles();
@@ -582,7 +582,7 @@ RimWellPath* RimWellPlotTools::wellPathByWellPathNameOrSimWellName(const QString
RimProject* proj = RiaApplication::instance()->project();
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)
{
RimWellPath* wellPath = wellPathByWellPathNameOrSimWellName(wellPathNameOrSimWellName);
return wellPath != nullptr ? wellPath->associatedSimulationWell() : wellPathNameOrSimWellName;
return wellPath != nullptr ? wellPath->associatedSimulationWellName() : wellPathNameOrSimWellName;
}
//--------------------------------------------------------------------------------------------------
@@ -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 };
//==================================================================================================
@@ -76,8 +76,9 @@ namespace caf
template<>
void caf::AppEnum< FlowType>::setUp()
{
addItem(FLOW_TYPE_TOTAL, "TOTAL", "Total Flow");
addItem(FLOW_TYPE_PHASE_SPLIT, "PHASE_SPLIT", "Phase Split");
addItem(FLOW_TYPE_TOTAL, "TOTAL", "Total Flow");
setDefault(FLOW_TYPE_PHASE_SPLIT);
}
template<>
@@ -412,7 +413,7 @@ public:
std::map<size_t, std::pair<size_t, size_t> > globCellIdxToIdxInSimWellBranch;
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;
@@ -594,7 +595,10 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
}
curveGroupId++;
}
m_wellLogPlot->loadDataAndUpdate();
m_wellLogPlot->updateDepthZoom();
plotTrack->updateXZoom();
}
//--------------------------------------------------------------------------------------------------
@@ -825,9 +825,9 @@ void RimWellRftPlot::calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>
{
wellNames.insert(wellPath->name());
if (!wellPath->associatedSimulationWell().isEmpty())
if (!wellPath->associatedSimulationWellName().isEmpty())
{
simWellsAssociatedWithWellPath.insert(wellPath->associatedSimulationWell());
simWellsAssociatedWithWellPath.insert(wellPath->associatedSimulationWellName());
}
}
@@ -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;
for (RimWellPath* const path : allWellPaths())
{
if (QString::compare(path->associatedSimulationWell(), simWellName) == 0 &&
if (QString::compare(path->associatedSimulationWellName(), simWellName) == 0 &&
(branchIndex < 0 || path->associatedSimulationWellBranch() == branchIndex))
{
return path;
@@ -126,7 +126,7 @@ public:
std::vector<RimEclipseCase*> eclipseCases() const;
std::vector<QString> simulationWellNames() const;
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;
std::vector<RimWellPath*> allWellPaths() const;
@@ -477,7 +477,7 @@ RigEclipseWellLogExtractor* RimWellLogRftCurve::extractor()
RigEclipseWellLogExtractor* eclExtractor = nullptr;
RimProject* proj = RiaApplication::instance()->project();
RimWellPath* wellPath = proj->wellPathFromSimulationWell(m_wellName());
RimWellPath* wellPath = proj->wellPathFromSimWellName(m_wellName());
eclExtractor = wellLogCollection->findOrCreateExtractor(wellPath, m_eclipseResultCase);
if (!eclExtractor)
@@ -324,7 +324,7 @@ QList<caf::PdmOptionItemInfo> RimWellPath::calculateValueOptions(const caf::PdmF
{
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;
}
@@ -118,8 +118,9 @@ public:
RiaEclipseUnitTools::UnitSystem unitSystem() const;
static RimWellPath* fromFilePath(QString filePath);
const QString associatedSimulationWell() const;
const QString associatedSimulationWellName() const;
int associatedSimulationWellBranch() const;
bool tryAssociateWithSimulationWell();
bool isAssociatedWithSimulationWell() const;
bool tryMatchName(QString wellPathName,