#4239 Show Well Allocation Plots: Add well name to suggested view name

This commit is contained in:
Magne Sjaastad
2019-03-27 19:19:19 +01:00
parent 50aac466e6
commit d0a23252ab
9 changed files with 33 additions and 18 deletions

View File

@@ -59,6 +59,14 @@ void RicSelectViewUI::setCase(RimEclipseResultCase* currentCase)
m_currentCase = currentCase;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSelectViewUI::setNewViewName(const QString& name)
{
m_newViewName = name;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -37,6 +37,7 @@ public:
void setView(RimEclipseView* currentView);
void setCase(RimEclipseResultCase* currentCase);
void setNewViewName(const QString& name);
RimEclipseView* selectedView() const;
bool createNewView() const;

View File

@@ -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();

View File

@@ -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);

View File

@@ -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);

View File

@@ -56,7 +56,7 @@ void RicShowContributingWellsFromPlotFeature::onActionTriggered(bool isChecked)
RimEclipseResultCase* wellAllocationResultCase = wellAllocationPlot->rimCase();
RicShowContributingWellsFeatureImpl::maniuplateSelectedView(wellAllocationResultCase, wellName, timeStep);
RicShowContributingWellsFeatureImpl::manipulateSelectedView(wellAllocationResultCase, wellName, timeStep);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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);

View File

@@ -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);
};