2017-02-13 13:28:56 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// 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.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2017-02-21 09:13:33 +01:00
|
|
|
#include "RicShowContributingWellsFromPlotFeature.h"
|
2017-02-13 13:28:56 +01:00
|
|
|
|
|
|
|
|
#include "RiaApplication.h"
|
|
|
|
|
|
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
|
|
|
|
2017-02-21 09:13:33 +01:00
|
|
|
CAF_CMD_SOURCE_INIT(RicShowContributingWellsFromPlotFeature, "RicShowContributingWellsFromPlotFeature");
|
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
|
|
|
{
|
2017-03-31 15:10:39 +02:00
|
|
|
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>(RiaApplication::instance()->activePlotWindow());
|
|
|
|
|
|
2017-03-16 08:22:09 +01:00
|
|
|
if (wellAllocationPlot) return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
2017-02-13 13:28:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-02-21 09:13:33 +01:00
|
|
|
void RicShowContributingWellsFromPlotFeature::onActionTriggered(bool isChecked)
|
2017-02-13 13:28:56 +01:00
|
|
|
{
|
2017-03-31 15:10:39 +02:00
|
|
|
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>(RiaApplication::instance()->activePlotWindow());
|
|
|
|
|
|
2017-02-13 13:28:56 +01:00
|
|
|
if (!wellAllocationPlot) return;
|
|
|
|
|
|
2017-03-09 23:01:45 +01:00
|
|
|
int timeStep = wellAllocationPlot->timeStep();
|
|
|
|
|
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
|
|
|
|
2017-03-16 08:22:09 +01:00
|
|
|
RicShowContributingWellsFeatureImpl::maniuplateSelectedView(wellAllocationResultCase, wellName, timeStep);
|
2017-02-13 13:28:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-02-21 09:13:33 +01:00
|
|
|
void RicShowContributingWellsFromPlotFeature::setupActionLook(QAction* actionToSetup)
|
2017-02-13 13:28:56 +01:00
|
|
|
{
|
|
|
|
|
//actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
|
|
|
|
|
actionToSetup->setText("Show Contributing Wells");
|
|
|
|
|
}
|