mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4239 Show Well Allocation Plots: Add well name to suggested view name
This commit is contained in:
@@ -59,6 +59,14 @@ void RicSelectViewUI::setCase(RimEclipseResultCase* currentCase)
|
||||
m_currentCase = currentCase;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSelectViewUI::setNewViewName(const QString& name)
|
||||
{
|
||||
m_newViewName = name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
|
||||
void setView(RimEclipseView* currentView);
|
||||
void setCase(RimEclipseResultCase* currentCase);
|
||||
void setNewViewName(const QString& name);
|
||||
|
||||
RimEclipseView* selectedView() const;
|
||||
bool createNewView() const;
|
||||
|
||||
@@ -89,7 +89,7 @@ void RicShowContributingWellsFeature::onActionTriggered(bool isChecked)
|
||||
RimEclipseResultCase* eclipseResultCase = nullptr;
|
||||
well->firstAncestorOrThisOfTypeAsserted(eclipseResultCase);
|
||||
|
||||
RimEclipseView* modifiedView = RicShowContributingWellsFeatureImpl::maniuplateSelectedView(eclipseResultCase, well->name(), eclipseView->currentTimeStep());
|
||||
RimEclipseView* modifiedView = RicShowContributingWellsFeatureImpl::manipulateSelectedView(eclipseResultCase, well->name(), eclipseView->currentTimeStep());
|
||||
if (modifiedView)
|
||||
{
|
||||
modifiedView->createDisplayModelAndRedraw();
|
||||
|
||||
@@ -45,12 +45,12 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView* RicShowContributingWellsFeatureImpl::maniuplateSelectedView(RimEclipseResultCase* eclipseResultCase, QString wellName, int timeStep)
|
||||
RimEclipseView* RicShowContributingWellsFeatureImpl::manipulateSelectedView(RimEclipseResultCase* eclipseResultCase, QString wellName, int timeStep)
|
||||
{
|
||||
RimEclipseView* viewToManipulate = RicSelectOrCreateViewFeatureImpl::showViewSelection(eclipseResultCase, "lastUsedWellAllocationView", "Show Contributing Wells in View");
|
||||
|
||||
if (!viewToManipulate) return nullptr;
|
||||
RimEclipseView* viewToManipulate = RicSelectOrCreateViewFeatureImpl::showViewSelection(
|
||||
eclipseResultCase, "lastUsedWellAllocationView", "ContributingWells_" + wellName, "Show Contributing Wells in View");
|
||||
|
||||
if (!viewToManipulate) return nullptr;
|
||||
|
||||
RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells(viewToManipulate, wellName, timeStep);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class RimSimWellInView;
|
||||
class RicShowContributingWellsFeatureImpl
|
||||
{
|
||||
public:
|
||||
static RimEclipseView* maniuplateSelectedView(RimEclipseResultCase* wellAllocationResultCase, QString wellName, int timeStep);
|
||||
static RimEclipseView* manipulateSelectedView(RimEclipseResultCase* wellAllocationResultCase, QString wellName, int timeStep);
|
||||
|
||||
private:
|
||||
static void modifyViewToShowContributingWells(RimEclipseView* viewToModify, const QString& wellName, int timeStep);
|
||||
|
||||
@@ -56,7 +56,7 @@ void RicShowContributingWellsFromPlotFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
RimEclipseResultCase* wellAllocationResultCase = wellAllocationPlot->rimCase();
|
||||
|
||||
RicShowContributingWellsFeatureImpl::maniuplateSelectedView(wellAllocationResultCase, wellName, timeStep);
|
||||
RicShowContributingWellsFeatureImpl::manipulateSelectedView(wellAllocationResultCase, wellName, timeStep);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
RimEclipseView* RicSelectOrCreateViewFeatureImpl::showViewSelection(RimEclipseResultCase* resultCase, const QString& lastUsedViewKey, const QString& dialogTitle)
|
||||
RimEclipseView* RicSelectOrCreateViewFeatureImpl::showViewSelection(RimEclipseResultCase* resultCase,
|
||||
const QString& lastUsedViewKey,
|
||||
const QString& newViewName,
|
||||
const QString& dialogTitle)
|
||||
{
|
||||
RimEclipseView* defaultSelectedView = getDefaultSelectedView(resultCase, lastUsedViewKey);
|
||||
|
||||
RicSelectViewUI featureUi;
|
||||
featureUi.setNewViewName(newViewName);
|
||||
if (defaultSelectedView)
|
||||
{
|
||||
featureUi.setView(defaultSelectedView);
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -24,16 +24,17 @@ class RimEclipseView;
|
||||
class RimEclipseResultCase;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicSelectOrCreateViewFeatureImpl
|
||||
{
|
||||
public:
|
||||
static RimEclipseView* showViewSelection(RimEclipseResultCase* resultCase, const QString& lastUsedViewKey, const QString& dialogTitle);
|
||||
static void focusView(RimEclipseView* view);
|
||||
static RimEclipseView* showViewSelection(RimEclipseResultCase* resultCase,
|
||||
const QString& lastUsedViewKey,
|
||||
const QString& newViewName,
|
||||
const QString& dialogTitle);
|
||||
static void focusView(RimEclipseView* view);
|
||||
|
||||
private:
|
||||
static RimEclipseView* getDefaultSelectedView(RimEclipseResultCase* resultCase, const QString& lastUsedViewKey);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user