2017-02-13 06:28:56 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-03-27 13:20:42 -05:00
|
|
|
//
|
2017-02-13 06:28:56 -06: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
|
|
|
//
|
2017-02-13 06:28:56 -06: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>
|
2017-02-13 06:28:56 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-02-21 02:13:33 -06:00
|
|
|
#include "RicShowContributingWellsFromPlotFeature.h"
|
2017-02-13 06:28:56 -06:00
|
|
|
|
2019-05-06 03:36:05 -05:00
|
|
|
#include "RiaGuiApplication.h"
|
2017-02-13 06:28:56 -06:00
|
|
|
|
2017-03-09 16:01:45 -06:00
|
|
|
#include "RicShowContributingWellsFeatureImpl.h"
|
|
|
|
|
|
|
|
#include "RimEclipseResultCase.h"
|
|
|
|
#include "RimFlowDiagSolution.h"
|
2017-02-13 06:28:56 -06:00
|
|
|
#include "RimWellAllocationPlot.h"
|
|
|
|
|
2017-03-09 16:01:45 -06:00
|
|
|
#include <QAction>
|
2017-02-13 06:28:56 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_CMD_SOURCE_INIT( RicShowContributingWellsFromPlotFeature, "RicShowContributingWellsFromPlotFeature" );
|
2017-02-13 06:28:56 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-03-27 13:20:42 -05:00
|
|
|
///
|
2017-02-13 06:28:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-06-26 07:28:46 -05:00
|
|
|
bool RicShowContributingWellsFromPlotFeature::isCommandEnabled() const
|
2017-02-13 06:28:56 -06:00
|
|
|
{
|
2023-02-26 03:48:40 -06:00
|
|
|
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>( RiaGuiApplication::instance()->activePlotWindow() );
|
2017-03-31 08:10:39 -05:00
|
|
|
|
2023-06-26 06:12:41 -05:00
|
|
|
return wellAllocationPlot != nullptr;
|
2017-02-13 06:28:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-03-27 13:20:42 -05:00
|
|
|
///
|
2017-02-13 06:28:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicShowContributingWellsFromPlotFeature::onActionTriggered( bool isChecked )
|
2017-02-13 06:28:56 -06:00
|
|
|
{
|
2023-02-26 03:48:40 -06:00
|
|
|
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>( RiaGuiApplication::instance()->activePlotWindow() );
|
2017-03-31 08:10:39 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !wellAllocationPlot ) return;
|
2017-02-13 06:28:56 -06:00
|
|
|
|
2019-03-27 13:20:42 -05:00
|
|
|
int timeStep = wellAllocationPlot->timeStep();
|
2017-03-09 16:01:45 -06:00
|
|
|
QString wellName = wellAllocationPlot->wellName();
|
2017-03-02 09:10:18 -06:00
|
|
|
|
2017-04-27 02:51:31 -05:00
|
|
|
RimEclipseResultCase* wellAllocationResultCase = wellAllocationPlot->rimCase();
|
2017-03-10 03:27:36 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RicShowContributingWellsFeatureImpl::manipulateSelectedView( wellAllocationResultCase, wellName, timeStep );
|
2017-02-13 06:28:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-03-27 13:20:42 -05:00
|
|
|
///
|
2017-02-13 06:28:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicShowContributingWellsFromPlotFeature::setupActionLook( QAction* actionToSetup )
|
2017-02-13 06:28:56 -06:00
|
|
|
{
|
2019-03-27 13:20:42 -05:00
|
|
|
// actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
|
2019-09-06 03:40:57 -05:00
|
|
|
actionToSetup->setText( "Show Contributing Wells" );
|
2017-02-13 06:28:56 -06:00
|
|
|
}
|