ResInsight/ApplicationCode/Commands/FlowCommands/RicShowContributingWellsFromPlotFeature.cpp

70 lines
2.7 KiB
C++
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
// 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 02:13:33 -06:00
#include "RicShowContributingWellsFromPlotFeature.h"
#include "RiaApplication.h"
#include "RicShowContributingWellsFeatureImpl.h"
#include "RimEclipseResultCase.h"
#include "RimFlowDiagSolution.h"
#include "RimWellAllocationPlot.h"
#include <QAction>
2017-02-21 02:13:33 -06:00
CAF_CMD_SOURCE_INIT(RicShowContributingWellsFromPlotFeature, "RicShowContributingWellsFromPlotFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-02-21 02:13:33 -06:00
bool RicShowContributingWellsFromPlotFeature::isCommandEnabled()
{
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>(RiaApplication::instance()->activePlotWindow());
2017-03-16 02:22:09 -05:00
if (wellAllocationPlot) return true;
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-02-21 02:13:33 -06:00
void RicShowContributingWellsFromPlotFeature::onActionTriggered(bool isChecked)
{
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>(RiaApplication::instance()->activePlotWindow());
if (!wellAllocationPlot) return;
int timeStep = wellAllocationPlot->timeStep();
QString wellName = wellAllocationPlot->wellName();
RimEclipseResultCase* wellAllocationResultCase = wellAllocationPlot->rimCase();
2017-03-16 02:22:09 -05:00
RicShowContributingWellsFeatureImpl::maniuplateSelectedView(wellAllocationResultCase, wellName, timeStep);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-02-21 02:13:33 -06:00
void RicShowContributingWellsFromPlotFeature::setupActionLook(QAction* actionToSetup)
{
//actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
actionToSetup->setText("Show Contributing Wells");
}