mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1174 Rename
This commit is contained in:
@@ -7,13 +7,13 @@ endif()
|
|||||||
set (SOURCE_GROUP_HEADER_FILES
|
set (SOURCE_GROUP_HEADER_FILES
|
||||||
${CEE_CURRENT_LIST_DIR}RicShowWellAllocationPlotFeature.h
|
${CEE_CURRENT_LIST_DIR}RicShowWellAllocationPlotFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicAddStoredWellAllocationPlotFeature.h
|
${CEE_CURRENT_LIST_DIR}RicAddStoredWellAllocationPlotFeature.h
|
||||||
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeature.h
|
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFromPlotFeature.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
${CEE_CURRENT_LIST_DIR}RicShowWellAllocationPlotFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicShowWellAllocationPlotFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicAddStoredWellAllocationPlotFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicAddStoredWellAllocationPlotFeature.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFromPlotFeature.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
//
|
//
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RicShowContributingWellsFeature.h"
|
#include "RicShowContributingWellsFromPlotFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
@@ -33,12 +33,12 @@
|
|||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicShowContributingWellsFeature, "RicShowContributingWellsFeature");
|
CAF_CMD_SOURCE_INIT(RicShowContributingWellsFromPlotFeature, "RicShowContributingWellsFromPlotFeature");
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicShowContributingWellsFeature::isCommandEnabled()
|
bool RicShowContributingWellsFromPlotFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
RimWellAllocationPlot* wellAllocationPlot = RiaApplication::instance()->activeWellAllocationPlot();
|
RimWellAllocationPlot* wellAllocationPlot = RiaApplication::instance()->activeWellAllocationPlot();
|
||||||
if (!wellAllocationPlot) return false;
|
if (!wellAllocationPlot) return false;
|
||||||
@@ -52,7 +52,7 @@ bool RicShowContributingWellsFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicShowContributingWellsFeature::onActionTriggered(bool isChecked)
|
void RicShowContributingWellsFromPlotFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
RimWellAllocationPlot* wellAllocationPlot = RiaApplication::instance()->activeWellAllocationPlot();
|
RimWellAllocationPlot* wellAllocationPlot = RiaApplication::instance()->activeWellAllocationPlot();
|
||||||
if (!wellAllocationPlot) return;
|
if (!wellAllocationPlot) return;
|
||||||
@@ -110,7 +110,7 @@ void RicShowContributingWellsFeature::onActionTriggered(bool isChecked)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicShowContributingWellsFeature::setupActionLook(QAction* actionToSetup)
|
void RicShowContributingWellsFromPlotFeature::setupActionLook(QAction* actionToSetup)
|
||||||
{
|
{
|
||||||
//actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
|
//actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
|
||||||
actionToSetup->setText("Show Contributing Wells");
|
actionToSetup->setText("Show Contributing Wells");
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicShowContributingWellsFeature : public caf::CmdFeature
|
class RicShowContributingWellsFromPlotFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RicShowWellAllocationPlotFeature.h"
|
||||||
|
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include "RimEclipseWell.h"
|
||||||
|
#include "RimFlowPlotCollection.h"
|
||||||
|
#include "RimMainPlotCollection.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimWellAllocationPlot.h"
|
||||||
|
|
||||||
|
#include "RiuMainPlotWindow.h"
|
||||||
|
|
||||||
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT(RicShowWellAllocationPlotFeature, "RicShowWellAllocationPlotFeature");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicShowWellAllocationPlotFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicShowWellAllocationPlotFeature::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
std::vector<RimEclipseWell*> collection;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&collection);
|
||||||
|
|
||||||
|
if (collection.size() > 0)
|
||||||
|
{
|
||||||
|
RimEclipseWell* eclWell = collection[0];
|
||||||
|
|
||||||
|
if (RiaApplication::instance()->project())
|
||||||
|
{
|
||||||
|
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
|
||||||
|
if (flowPlotColl)
|
||||||
|
{
|
||||||
|
flowPlotColl->defaultPlot()->setFromSimulationWell(eclWell);
|
||||||
|
flowPlotColl->defaultPlot()->updateConnectedEditors();
|
||||||
|
|
||||||
|
// Make sure the summary plot window is created and visible
|
||||||
|
RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
||||||
|
plotwindow->selectAsCurrentItem(flowPlotColl->defaultPlot());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicShowWellAllocationPlotFeature::setupActionLook(QAction* actionToSetup)
|
||||||
|
{
|
||||||
|
actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
|
||||||
|
actionToSetup->setText("Show Well Allocation Plot");
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
|
class RimEclipseWell;
|
||||||
|
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicShowWellAllocationPlotFeature : public caf::CmdFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Overrides
|
||||||
|
virtual bool isCommandEnabled() override;
|
||||||
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
|
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ void RiuWellAllocationPlot::contextMenuEvent(QContextMenuEvent* event)
|
|||||||
QMenu menu;
|
QMenu menu;
|
||||||
QStringList commandIds;
|
QStringList commandIds;
|
||||||
|
|
||||||
commandIds << "RicShowContributingWellsFeature";
|
commandIds << "RicShowContributingWellsFromPlotFeature";
|
||||||
|
|
||||||
RimContextCommandBuilder::appendCommandsToMenu(commandIds, &menu);
|
RimContextCommandBuilder::appendCommandsToMenu(commandIds, &menu);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user