Mark single table VFP plot as obsolete

Remove features to create obsoleted plot. Remove plot creation functions. Rename to RimVfpPlot_deprecated
This commit is contained in:
Magne Sjaastad committed 2024-06-18 11:49:22 +02:00
1 parent 82dea49ac6
commit ccda815bde
14 files changed
+123 -255

No files matched your search

@@ -38,7 +38,6 @@
#include "RimWellLogTrack.h"
#include "VerticalFlowPerformance/RimCustomVfpPlot.h"
#include "VerticalFlowPerformance/RimVfpPlot.h"
#include "RiuPlotMainWindow.h"
#include "RiuTextDialog.h"
@@ -194,7 +193,7 @@ bool RicShowPlotDataFeature::isCommandEnabled() const
for ( auto plot : selection )
{
if ( dynamic_cast<RimSummaryPlot*>( plot ) || dynamic_cast<RimWellLogPlot*>( plot ) || dynamic_cast<RimWellLogTrack*>( plot ) ||
dynamic_cast<RimGridCrossPlot*>( plot ) || dynamic_cast<RimVfpPlot*>( plot ) || dynamic_cast<RimCustomVfpPlot*>( plot ) ||
dynamic_cast<RimGridCrossPlot*>( plot ) || dynamic_cast<RimCustomVfpPlot*>( plot ) ||
dynamic_cast<RimWellAllocationOverTimePlot*>( plot ) || dynamic_cast<RimAnalysisPlot*>( plot ) ||
dynamic_cast<RimCorrelationMatrixPlot*>( plot ) || dynamic_cast<RimAbstractCorrelationPlot*>( plot ) ||
dynamic_cast<RimCorrelationReportPlot*>( plot ) )
@@ -95,7 +95,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCalculationExpressionsFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicImportWellLogCsvFileFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewViewForGridEnsembleFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomVfpPlotFeature.h
)
@@ -196,7 +195,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicImportWellLogCsvFileFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicImportWellLogOsduFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewViewForGridEnsembleFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomVfpPlotFeature.cpp
)
@@ -23,8 +23,8 @@
#include "RimMainPlotCollection.h"
#include "VerticalFlowPerformance/RimCustomVfpPlot.h"
#include "VerticalFlowPerformance/RimVfpDataCollection.h"
#include "VerticalFlowPerformance/RimVfpPlot.h"
#include "VerticalFlowPerformance/RimVfpPlotCollection.h"
#include "RiuFileDialogTools.h"
@@ -76,7 +76,7 @@ void RicImportVfpDataFeature::onActionTriggered( bool isChecked )
for ( const auto& fileName : fileNames )
{
auto vfpDataSource = vfpDataColl->appendTableDataObject( fileName );
auto firstPlot = vfpPlotColl->createAndAppendPlots( vfpDataSource );
auto firstPlot = vfpPlotColl->createAndAppendPlots( vfpDataSource, {} );
vfpDataColl->updateAllRequiredEditors();
RiuPlotMainWindowTools::onObjectAppended( firstPlot, firstPlot );
}
@@ -18,8 +18,6 @@
#include "RicNewCustomVfpPlotFeature.h"
#include "RicNewVfpPlotFeature.h"
#include "RimMainPlotCollection.h"
#include "VerticalFlowPerformance/RimCustomVfpPlot.h"
@@ -44,7 +42,7 @@ void RicNewCustomVfpPlotFeature::onActionTriggered( bool isChecked )
RimVfpPlotCollection* vfpPlotColl = RimMainPlotCollection::current()->vfpPlotCollection();
if ( !vfpPlotColl ) return;
auto selectedTables = RicNewVfpPlotFeature::selectedTables();
auto selectedTables = RicNewCustomVfpPlotFeature::selectedTables();
if ( selectedTables.empty() ) return;
auto mainDataSource = selectedTables.front();
@@ -61,6 +59,22 @@ void RicNewCustomVfpPlotFeature::onActionTriggered( bool isChecked )
//--------------------------------------------------------------------------------------------------
void RicNewCustomVfpPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Create Custom VFP Plot" );
actionToSetup->setText( "Create VFP Plot" );
actionToSetup->setIcon( QIcon( ":/VfpPlot.svg" ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimVfpTable*> RicNewCustomVfpPlotFeature::selectedTables()
{
auto tables = caf::selectedObjectsByTypeStrict<RimVfpTable*>();
auto selectedTableData = caf::selectedObjectsByTypeStrict<RimVfpTableData*>();
for ( auto tableData : selectedTableData )
{
auto tableDataSources = tableData->tableDataSources();
tables.insert( tables.end(), tableDataSources.begin(), tableDataSources.end() );
}
return tables;
}
@@ -20,6 +20,8 @@
#include "cafCmdFeature.h"
class RimVfpTable;
//==================================================================================================
///
//==================================================================================================
@@ -30,4 +32,6 @@ class RicNewCustomVfpPlotFeature : public caf::CmdFeature
private:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
static std::vector<RimVfpTable*> selectedTables();
};
@@ -1,75 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024 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 "RimMainPlotCollection.h"
#include "VerticalFlowPerformance/RimVfpDataCollection.h"
#include "VerticalFlowPerformance/RimVfpPlotCollection.h"
#include "VerticalFlowPerformance/RimVfpTable.h"
#include "VerticalFlowPerformance/RimVfpTableData.h"
#include "cafSelectionManagerTools.h"
#include "RiuPlotMainWindowTools.h"
#include <QAction>
CAF_CMD_SOURCE_INIT( RicNewVfpPlotFeature, "RicNewVfpPlotFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimVfpTable*> RicNewVfpPlotFeature::selectedTables()
{
auto tables = caf::selectedObjectsByTypeStrict<RimVfpTable*>();
auto selectedTableData = caf::selectedObjectsByTypeStrict<RimVfpTableData*>();
for ( auto tableData : selectedTableData )
{
auto tableDataSources = tableData->tableDataSources();
tables.insert( tables.end(), tableDataSources.begin(), tableDataSources.end() );
}
return tables;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewVfpPlotFeature::onActionTriggered( bool isChecked )
{
RimVfpPlotCollection* vfpPlotColl = RimMainPlotCollection::current()->vfpPlotCollection();
if ( !vfpPlotColl ) return;
for ( auto table : selectedTables() )
{
RimVfpPlot* firstPlot = vfpPlotColl->createAndAppendPlots( table );
vfpPlotColl->updateConnectedEditors();
RiuPlotMainWindowTools::onObjectAppended( firstPlot, firstPlot );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewVfpPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Create VFP Plot" );
actionToSetup->setIcon( QIcon( ":/VfpPlot.svg" ) );
}
@@ -1,38 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024 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 RimVfpTable;
//==================================================================================================
///
//==================================================================================================
class RicNewVfpPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
public:
static std::vector<RimVfpTable*> selectedTables();
private:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};