ResInsight/ApplicationLibCode/Commands/FlowCommands/RicShowContributingWellsFromPlotFeature.cpp

72 lines
2.8 KiB
C++
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil ASA
2019-03-27 13:20:42 -05:00
//
// 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.
2019-03-27 13:20:42 -05:00
//
// 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.
2019-03-27 13:20:42 -05:00
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
2017-02-21 02:13:33 -06:00
#include "RicShowContributingWellsFromPlotFeature.h"
#include "RiaGuiApplication.h"
#include "RicShowContributingWellsFeatureImpl.h"
#include "RimEclipseResultCase.h"
#include "RimFlowDiagSolution.h"
#include "RimWellAllocationPlot.h"
#include <QAction>
CAF_CMD_SOURCE_INIT( RicShowContributingWellsFromPlotFeature, "RicShowContributingWellsFromPlotFeature" );
//--------------------------------------------------------------------------------------------------
2019-03-27 13:20:42 -05:00
///
//--------------------------------------------------------------------------------------------------
2017-02-21 02:13:33 -06:00
bool RicShowContributingWellsFromPlotFeature::isCommandEnabled()
{
RimWellAllocationPlot* wellAllocationPlot =
dynamic_cast<RimWellAllocationPlot*>( RiaGuiApplication::instance()->activePlotWindow() );
if ( wellAllocationPlot ) return true;
2019-03-27 13:20:42 -05:00
2017-03-16 02:22:09 -05:00
return false;
}
//--------------------------------------------------------------------------------------------------
2019-03-27 13:20:42 -05:00
///
//--------------------------------------------------------------------------------------------------
void RicShowContributingWellsFromPlotFeature::onActionTriggered( bool isChecked )
{
RimWellAllocationPlot* wellAllocationPlot =
dynamic_cast<RimWellAllocationPlot*>( RiaGuiApplication::instance()->activePlotWindow() );
if ( !wellAllocationPlot ) return;
2019-03-27 13:20:42 -05:00
int timeStep = wellAllocationPlot->timeStep();
QString wellName = wellAllocationPlot->wellName();
RimEclipseResultCase* wellAllocationResultCase = wellAllocationPlot->rimCase();
RicShowContributingWellsFeatureImpl::manipulateSelectedView( wellAllocationResultCase, wellName, timeStep );
}
//--------------------------------------------------------------------------------------------------
2019-03-27 13:20:42 -05:00
///
//--------------------------------------------------------------------------------------------------
void RicShowContributingWellsFromPlotFeature::setupActionLook( QAction* actionToSetup )
{
2019-03-27 13:20:42 -05:00
// actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
actionToSetup->setText( "Show Contributing Wells" );
}