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,13 +45,13 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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");
|
||||
RimEclipseView* viewToManipulate = RicSelectOrCreateViewFeatureImpl::showViewSelection(
|
||||
eclipseResultCase, "lastUsedWellAllocationView", "ContributingWells_" + wellName, "Show Contributing Wells in View");
|
||||
|
||||
if (!viewToManipulate) return nullptr;
|
||||
|
||||
|
||||
RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells(viewToManipulate, wellName, timeStep);
|
||||
|
||||
auto* feature = caf::CmdFeatureManager::instance()->getCommandFeature("RicShowMainWindowFeature");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -29,11 +29,12 @@ class RimEclipseResultCase;
|
||||
class RicSelectOrCreateViewFeatureImpl
|
||||
{
|
||||
public:
|
||||
static RimEclipseView* showViewSelection(RimEclipseResultCase* resultCase, const QString& lastUsedViewKey, const QString& dialogTitle);
|
||||
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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -457,7 +457,8 @@ void RimFlowCharacteristicsPlot::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
{
|
||||
if (m_cellFilter() != RigFlowDiagResults::CELLS_ACTIVE)
|
||||
{
|
||||
RimEclipseView* view = RicSelectOrCreateViewFeatureImpl::showViewSelection(m_case, "FlowCharacteristicsLastUsedView", "Show Region in View");
|
||||
RimEclipseView* view = RicSelectOrCreateViewFeatureImpl::showViewSelection(
|
||||
m_case, "FlowCharacteristicsLastUsedView", "RegionView", "Show Region in View");
|
||||
|
||||
if (view != nullptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user