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