mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 05:53:25 -06:00
#1174 Added Show contributing wells from 3D view
This commit is contained in:
parent
91a962ab21
commit
b2ec4e055f
@ -8,12 +8,14 @@ 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}RicShowContributingWellsFromPlotFeature.h
|
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFromPlotFeature.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeature.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}RicShowContributingWellsFromPlotFeature.cpp
|
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFromPlotFeature.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeature.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
@ -16,28 +16,18 @@
|
|||||||
//
|
//
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RicShowWellAllocationPlotFeature.h"
|
#include "RicShowContributingWellsFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "cafCmdFeatureManager.h"
|
||||||
|
|
||||||
#include "RimEclipseWell.h"
|
|
||||||
#include "RimFlowPlotCollection.h"
|
|
||||||
#include "RimMainPlotCollection.h"
|
|
||||||
#include "RimProject.h"
|
|
||||||
#include "RimWellAllocationPlot.h"
|
|
||||||
|
|
||||||
#include "RiuMainPlotWindow.h"
|
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicShowWellAllocationPlotFeature, "RicShowWellAllocationPlotFeature");
|
CAF_CMD_SOURCE_INIT(RicShowContributingWellsFeature, "RicShowContributingWellsFeature");
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicShowWellAllocationPlotFeature::isCommandEnabled()
|
bool RicShowContributingWellsFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -45,27 +35,21 @@ bool RicShowWellAllocationPlotFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicShowWellAllocationPlotFeature::onActionTriggered(bool isChecked)
|
void RicShowContributingWellsFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
std::vector<RimEclipseWell*> collection;
|
// First, shot the well allocation plot
|
||||||
caf::SelectionManager::instance()->objectsByType(&collection);
|
// Then, use the feature to show contributing wells as this is based on the previous feature
|
||||||
|
|
||||||
if (collection.size() > 0)
|
std::vector<std::string> commandIds;
|
||||||
{
|
commandIds.push_back("RicShowWellAllocationPlotFeature");
|
||||||
RimEclipseWell* eclWell = collection[0];
|
commandIds.push_back("RicShowContributingWellsFromPlotFeature");
|
||||||
|
|
||||||
if (RiaApplication::instance()->project())
|
for (auto commandId : commandIds)
|
||||||
{
|
{
|
||||||
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
|
auto* feature = caf::CmdFeatureManager::instance()->getCommandFeature(commandId);
|
||||||
if (flowPlotColl)
|
if (feature)
|
||||||
{
|
{
|
||||||
flowPlotColl->defaultPlot()->setFromSimulationWell(eclWell);
|
feature->actionTriggered(false);
|
||||||
flowPlotColl->defaultPlot()->updateConnectedEditors();
|
|
||||||
|
|
||||||
// Make sure the summary plot window is created and visible
|
|
||||||
RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
|
||||||
plotwindow->selectAsCurrentItem(flowPlotColl->defaultPlot());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,8 +57,8 @@ void RicShowWellAllocationPlotFeature::onActionTriggered(bool isChecked)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicShowWellAllocationPlotFeature::setupActionLook(QAction* actionToSetup)
|
void RicShowContributingWellsFeature::setupActionLook(QAction* actionToSetup)
|
||||||
{
|
{
|
||||||
actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
|
actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
|
||||||
actionToSetup->setText("Show Well Allocation Plot");
|
actionToSetup->setText("Show Contributing Wells");
|
||||||
}
|
}
|
@ -20,13 +20,11 @@
|
|||||||
|
|
||||||
#include "cafCmdFeature.h"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
class RimEclipseWell;
|
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RicShowWellAllocationPlotFeature : public caf::CmdFeature
|
class RicShowContributingWellsFeature : public caf::CmdFeature
|
||||||
{
|
{
|
||||||
CAF_CMD_HEADER_INIT;
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
@ -309,6 +309,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
|||||||
|
|
||||||
commandIds << "RicNewSimWellIntersectionFeature";
|
commandIds << "RicNewSimWellIntersectionFeature";
|
||||||
commandIds << "RicShowWellAllocationPlotFeature";
|
commandIds << "RicShowWellAllocationPlotFeature";
|
||||||
|
commandIds << "RicShowContributingWellsFeature";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user