mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5326 Phase Distribution : Add Show cumulative phase plot
This commit is contained in:
@@ -10,6 +10,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFeatureImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicPlotProductionRateFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSelectViewUI.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicShowTotalAllocationDataFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicShowCumulativePhasePlotFeature.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -23,6 +24,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFeatureImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicPlotProductionRateFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSelectViewUI.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicShowTotalAllocationDataFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicShowCumulativePhasePlotFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2020 Equinor 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicShowCumulativePhasePlotFeature.h"
|
||||
|
||||
#include "RimFlowPlotCollection.h"
|
||||
#include "RimWellAllocationPlot.h"
|
||||
#include "RimWellDistributionPlotCollection.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicShowCumulativePhasePlotFeature, "RicShowCumulativePhasePlotFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicShowCumulativePhasePlotFeature::isCommandEnabled()
|
||||
{
|
||||
RimWellAllocationPlot* plot = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellAllocationPlot>();
|
||||
|
||||
return plot != nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowCumulativePhasePlotFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimWellAllocationPlot* plot = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellAllocationPlot>();
|
||||
|
||||
if ( !plot ) return;
|
||||
|
||||
RimFlowPlotCollection* flowPlotColl = nullptr;
|
||||
plot->firstAncestorOrThisOfType( flowPlotColl );
|
||||
|
||||
if ( !flowPlotColl ) return;
|
||||
|
||||
RimWellDistributionPlotCollection* wdp = flowPlotColl->wellDistributionPlotCollection();
|
||||
wdp->setData( plot->rimCase(), plot->wellName(), plot->timeStep() );
|
||||
wdp->setShowWindow( true );
|
||||
wdp->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowCumulativePhasePlotFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
// actionToSetup->setIcon(QIcon(":/new_icon16x16.png"));
|
||||
actionToSetup->setText( "Show Cumulative Phase Distribution Plot" );
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2020 Equinor 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicShowCumulativePhasePlotFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
Reference in New Issue
Block a user