mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merged in VFP-tables commit 874433680d65ec3ce2735c06f1212fb478e413b1.
This commit is contained in:
committed by
Magne Sjaastad
parent
d1fc39a51c
commit
6636a29882
@@ -92,6 +92,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicExportStimPlanModelToFileFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicStackSelectedCurvesFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicUnstackSelectedCurvesFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicThemeColorEditorFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.h
|
||||
)
|
||||
|
||||
|
||||
@@ -188,6 +189,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicExportStimPlanModelToFileFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicStackSelectedCurvesFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicUnstackSelectedCurvesFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicThemeColorEditorFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
79
ApplicationCode/Commands/RicNewVfpPlotFeature.cpp
Normal file
79
ApplicationCode/Commands/RicNewVfpPlotFeature.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RicNewVfpPlotFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimVfpPlot.h"
|
||||
#include "RimVfpPlotCollection.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
#include <vector>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicNewVfpPlotFeature, "RicNewVfpPlotFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewVfpPlotFeature::isCommandEnabled()
|
||||
{
|
||||
RimVfpPlotCollection* plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimVfpPlotCollection*>();
|
||||
return ( plotColl != nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewVfpPlotFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
RimVfpPlotCollection* vfpPlotColl = proj->mainPlotCollection()->vfpPlotCollection();
|
||||
if ( vfpPlotColl )
|
||||
{
|
||||
RimVfpPlot* vfpPlot = new RimVfpPlot();
|
||||
vfpPlotColl->addPlot( vfpPlot );
|
||||
vfpPlotColl->updateConnectedEditors();
|
||||
vfpPlot->loadDataAndUpdate();
|
||||
|
||||
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( vfpPlot );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewVfpPlotFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "New VFP Plot" );
|
||||
// TODO: add icon
|
||||
// actionToSetup->setIcon( QIcon( ":/VerticalFlowPerformancePlot16x16.png" ) );
|
||||
}
|
||||
36
ApplicationCode/Commands/RicNewVfpPlotFeature.h
Normal file
36
ApplicationCode/Commands/RicNewVfpPlotFeature.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 RicNewVfpPlotFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
private:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
static QString selectedWellName();
|
||||
};
|
||||
@@ -125,6 +125,7 @@
|
||||
#include "RimSurfaceCollection.h"
|
||||
#include "RimValveTemplate.h"
|
||||
#include "RimValveTemplateCollection.h"
|
||||
#include "RimVfpPlotCollection.h"
|
||||
#include "RimViewController.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimViewLinkerCollection.h"
|
||||
@@ -534,6 +535,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
{
|
||||
menuBuilder << "RicNewPltPlotFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimVfpPlotCollection*>( firstUiItem ) )
|
||||
{
|
||||
menuBuilder << "RicNewVfpPlotFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimSummaryPlotCollection*>( firstUiItem ) )
|
||||
{
|
||||
menuBuilder << "RicPasteSummaryPlotFeature";
|
||||
|
||||
Reference in New Issue
Block a user