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
2024-06-18 09:28:16 +02:00
parent 82dea49ac6
commit ccda815bde
14 changed files with 123 additions and 255 deletions

View File

@@ -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 ) )

View File

@@ -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
)

View File

@@ -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 );
}

View File

@@ -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;
}

View File

@@ -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();
};

View File

@@ -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" ) );
}

View File

@@ -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;
};

View File

@@ -1,6 +1,6 @@
set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimVfpDefines.h
${CMAKE_CURRENT_LIST_DIR}/RimVfpPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimVfpPlot_deprecated.h
${CMAKE_CURRENT_LIST_DIR}/RimCustomVfpPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimVfpPlotCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimVfpTableData.h
@@ -10,7 +10,7 @@ set(SOURCE_GROUP_HEADER_FILES
set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimVfpDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RimVfpPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimVfpPlot_deprecated.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCustomVfpPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimVfpPlotCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimVfpTableData.cpp

View File

@@ -32,33 +32,10 @@ RimVfpPlotCollection::RimVfpPlotCollection()
{
CAF_PDM_InitObject( "VFP Plots", ":/VfpPlotCollection.svg" );
CAF_PDM_InitFieldNoDefault( &m_vfpPlots, "VfpPlots", "Vertical Flow Performance Plots" );
CAF_PDM_InitFieldNoDefault( &m_vfpPlots_deprecated, "VfpPlots", "Vertical Flow Performance Plots" );
CAF_PDM_InitFieldNoDefault( &m_customVfpPlots, "CustomVfpPlots", "Vertical Flow Performance Plots" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimVfpPlot* RimVfpPlotCollection::createAndAppendPlots( RimVfpTable* tableData )
{
if ( !tableData ) return nullptr;
tableData->ensureDataIsImported();
RimVfpPlot* firstPlot = nullptr;
auto vfpPlot = new RimVfpPlot();
vfpPlot->setDataSource( tableData );
vfpPlot->initializeObject();
addPlot( vfpPlot );
vfpPlot->loadDataAndUpdate();
firstPlot = vfpPlot;
return firstPlot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -68,6 +45,7 @@ RimCustomVfpPlot* RimVfpPlotCollection::createAndAppendPlots( RimVfpTable* mainD
vfpPlot->selectDataSource( mainDataSource, tableData );
vfpPlot->initializeObject();
vfpPlot->initializeSelection();
vfpPlot->createDefaultColors();
m_customVfpPlots.push_back( vfpPlot );
@@ -79,41 +57,25 @@ RimCustomVfpPlot* RimVfpPlotCollection::createAndAppendPlots( RimVfpTable* mainD
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlotCollection::addPlot( RimVfpPlot* newPlot )
void RimVfpPlotCollection::addPlot( RimVfpPlot_deprecated* newPlot )
{
m_vfpPlots.push_back( newPlot );
m_vfpPlots_deprecated.push_back( newPlot );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlotCollection::insertPlot( RimVfpPlot* vfpPlot, size_t index )
void RimVfpPlotCollection::insertPlot( RimVfpPlot_deprecated* vfpPlot, size_t index )
{
m_vfpPlots.insert( index, vfpPlot );
m_vfpPlots_deprecated.insert( index, vfpPlot );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimVfpPlot*> RimVfpPlotCollection::plots() const
std::vector<RimVfpPlot_deprecated*> RimVfpPlotCollection::plots() const
{
return m_vfpPlots.childrenByType();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimVfpPlot* RimVfpPlotCollection::plotForTableNumber( int tableNumber ) const
{
for ( auto plot : plots() )
{
if ( plot->tableNumber() == tableNumber )
{
return plot;
}
}
return nullptr;
return m_vfpPlots_deprecated.childrenByType();
}
//--------------------------------------------------------------------------------------------------
@@ -121,15 +83,15 @@ RimVfpPlot* RimVfpPlotCollection::plotForTableNumber( int tableNumber ) const
//--------------------------------------------------------------------------------------------------
size_t RimVfpPlotCollection::plotCount() const
{
return m_vfpPlots.size();
return m_vfpPlots_deprecated.size() + m_customVfpPlots.size();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlotCollection::removePlot( RimVfpPlot* vfpPlot )
void RimVfpPlotCollection::removePlot( RimVfpPlot_deprecated* vfpPlot )
{
m_vfpPlots.removeChild( vfpPlot );
m_vfpPlots_deprecated.removeChild( vfpPlot );
updateAllRequiredEditors();
}
@@ -138,7 +100,7 @@ void RimVfpPlotCollection::removePlot( RimVfpPlot* vfpPlot )
//--------------------------------------------------------------------------------------------------
void RimVfpPlotCollection::deleteAllPlots()
{
m_vfpPlots.deleteChildren();
m_vfpPlots_deprecated.deleteChildren();
m_customVfpPlots.deleteChildren();
}

View File

@@ -18,7 +18,7 @@
#pragma once
#include "RimAbstractPlotCollection.h"
#include "RimVfpPlot.h"
#include "RimVfpPlot_deprecated.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmObject.h"
@@ -29,34 +29,36 @@ class RimCustomVfpPlot;
///
///
//==================================================================================================
class RimVfpPlotCollection : public caf::PdmObject, public RimTypedPlotCollection<RimVfpPlot>
class RimVfpPlotCollection : public caf::PdmObject, public RimTypedPlotCollection<RimVfpPlot_deprecated>
{
CAF_PDM_HEADER_INIT;
public:
RimVfpPlotCollection();
RimVfpPlot* createAndAppendPlots( RimVfpTable* tableData );
RimVfpPlot* plotForTableNumber( int tableNumber ) const;
RimCustomVfpPlot* createAndAppendPlots( RimVfpTable* mainDataSource, std::vector<RimVfpTable*> tableData );
void addPlot( RimVfpPlot* newPlot ) override;
std::vector<RimVfpPlot*> plots() const override;
size_t plotCount() const final;
void insertPlot( RimVfpPlot* vfpPlot, size_t index ) final;
void removePlot( RimVfpPlot* vfpPlot ) final;
void deleteAllPlots() override;
static void addImportItems( caf::CmdFeatureMenuBuilder& menuBuilder );
private:
void addPlot( RimVfpPlot_deprecated* newPlot ) override;
std::vector<RimVfpPlot_deprecated*> plots() const override;
size_t plotCount() const final;
void insertPlot( RimVfpPlot_deprecated* vfpPlot, size_t index ) final;
void removePlot( RimVfpPlot_deprecated* vfpPlot ) final;
void deleteAllPlots() override;
void loadDataAndUpdateAllPlots() override;
void onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& updatedObjects ) override;
void appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const override;
private:
caf::PdmChildArrayField<RimVfpPlot*> m_vfpPlots;
caf::PdmChildArrayField<RimCustomVfpPlot*> m_customVfpPlots;
// To be removed in a future release.
// RimVfpPlotCollection can derive from RimTypedPlotCollection<RimCustomVfpPlot>
// Consider renaming RimCustomVfpPlot to RimVfpPlot
caf::PdmChildArrayField<RimVfpPlot_deprecated*> m_vfpPlots_deprecated;
};

View File

@@ -16,7 +16,7 @@
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimVfpPlot.h"
#include "RimVfpPlot_deprecated.h"
#include "RiaColorTables.h"
#include "RiaColorTools.h"
@@ -57,12 +57,12 @@
//
//==================================================================================================
CAF_PDM_SOURCE_INIT( RimVfpPlot, "VfpPlot" );
CAF_PDM_SOURCE_INIT( RimVfpPlot_deprecated, "VfpPlot" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimVfpPlot::RimVfpPlot()
RimVfpPlot_deprecated::RimVfpPlot_deprecated()
{
// TODO: add icon
CAF_PDM_InitObject( "VFP Plot", ":/VfpPlot.svg" );
@@ -146,7 +146,7 @@ RimVfpPlot::RimVfpPlot()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimVfpPlot::~RimVfpPlot()
RimVfpPlot_deprecated::~RimVfpPlot_deprecated()
{
removeMdiWindowFromMdiArea();
deleteViewWidget();
@@ -155,7 +155,7 @@ RimVfpPlot::~RimVfpPlot()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::setDataSource( RimVfpTable* vfpTableData )
void RimVfpPlot_deprecated::setDataSource( RimVfpTable* vfpTableData )
{
m_vfpTable = vfpTableData;
}
@@ -163,7 +163,7 @@ void RimVfpPlot::setDataSource( RimVfpTable* vfpTableData )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::setTableNumber( int tableNumber )
void RimVfpPlot_deprecated::setTableNumber( int tableNumber )
{
m_tableNumber = tableNumber;
}
@@ -171,7 +171,7 @@ void RimVfpPlot::setTableNumber( int tableNumber )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::initializeObject()
void RimVfpPlot_deprecated::initializeObject()
{
if ( !vfpTables() ) return;
@@ -197,7 +197,7 @@ void RimVfpPlot::initializeObject()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuPlotWidget* RimVfpPlot::plotWidget()
RiuPlotWidget* RimVfpPlot_deprecated::plotWidget()
{
return m_plotWidget;
}
@@ -205,7 +205,7 @@ RiuPlotWidget* RimVfpPlot::plotWidget()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimVfpPlot::isCurveHighlightSupported() const
bool RimVfpPlot_deprecated::isCurveHighlightSupported() const
{
return true;
}
@@ -213,7 +213,7 @@ bool RimVfpPlot::isCurveHighlightSupported() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::setAutoScaleXEnabled( bool enabled )
void RimVfpPlot_deprecated::setAutoScaleXEnabled( bool enabled )
{
m_xAxisProperties->setAutoZoom( enabled );
}
@@ -221,7 +221,7 @@ void RimVfpPlot::setAutoScaleXEnabled( bool enabled )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::setAutoScaleYEnabled( bool enabled )
void RimVfpPlot_deprecated::setAutoScaleYEnabled( bool enabled )
{
m_yAxisProperties->setAutoZoom( enabled );
}
@@ -229,7 +229,7 @@ void RimVfpPlot::setAutoScaleYEnabled( bool enabled )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::updateAxes()
void RimVfpPlot_deprecated::updateAxes()
{
if ( !m_plotWidget ) return;
@@ -243,7 +243,7 @@ void RimVfpPlot::updateAxes()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::updateLegend()
void RimVfpPlot_deprecated::updateLegend()
{
if ( !m_plotWidget )
{
@@ -270,7 +270,7 @@ void RimVfpPlot::updateLegend()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimVfpPlot::asciiDataForPlotExport() const
QString RimVfpPlot_deprecated::asciiDataForPlotExport() const
{
if ( !vfpTables() ) return {};
@@ -306,7 +306,7 @@ QString RimVfpPlot::asciiDataForPlotExport() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::reattachAllCurves()
void RimVfpPlot_deprecated::reattachAllCurves()
{
for ( auto curve : m_plotCurves() )
{
@@ -320,7 +320,7 @@ void RimVfpPlot::reattachAllCurves()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::detachAllCurves()
void RimVfpPlot_deprecated::detachAllCurves()
{
for ( auto curve : m_plotCurves() )
{
@@ -331,7 +331,7 @@ void RimVfpPlot::detachAllCurves()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimVfpPlot::description() const
QString RimVfpPlot_deprecated::description() const
{
return uiName();
}
@@ -339,7 +339,7 @@ QString RimVfpPlot::description() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QWidget* RimVfpPlot::viewWidget()
QWidget* RimVfpPlot_deprecated::viewWidget()
{
return m_plotWidget;
}
@@ -347,7 +347,7 @@ QWidget* RimVfpPlot::viewWidget()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QImage RimVfpPlot::snapshotWindowContent()
QImage RimVfpPlot_deprecated::snapshotWindowContent()
{
QImage image;
@@ -363,7 +363,7 @@ QImage RimVfpPlot::snapshotWindowContent()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::zoomAll()
void RimVfpPlot_deprecated::zoomAll()
{
setAutoScaleXEnabled( true );
setAutoScaleYEnabled( true );
@@ -374,7 +374,7 @@ void RimVfpPlot::zoomAll()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::setDataIsImportedExternally( bool dataIsImportedExternally )
void RimVfpPlot_deprecated::setDataIsImportedExternally( bool dataIsImportedExternally )
{
m_dataIsImportedExternally = dataIsImportedExternally;
}
@@ -382,7 +382,7 @@ void RimVfpPlot::setDataIsImportedExternally( bool dataIsImportedExternally )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimVfpPlot::tableNumber() const
int RimVfpPlot_deprecated::tableNumber() const
{
return m_tableNumber();
}
@@ -390,7 +390,7 @@ int RimVfpPlot::tableNumber() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& updatedObjects )
void RimVfpPlot_deprecated::onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& updatedObjects )
{
detachAllCurves();
reattachAllCurves();
@@ -401,7 +401,7 @@ void RimVfpPlot::onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArray, s
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuPlotWidget* RimVfpPlot::doCreatePlotViewWidget( QWidget* mainWindowParent )
RiuPlotWidget* RimVfpPlot_deprecated::doCreatePlotViewWidget( QWidget* mainWindowParent )
{
// It seems we risk being called multiple times
if ( m_plotWidget ) return m_plotWidget;
@@ -443,7 +443,7 @@ RiuPlotWidget* RimVfpPlot::doCreatePlotViewWidget( QWidget* mainWindowParent )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::deleteViewWidget()
void RimVfpPlot_deprecated::deleteViewWidget()
{
if ( m_plotWidget )
{
@@ -456,7 +456,7 @@ void RimVfpPlot::deleteViewWidget()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::onLoadDataAndUpdate()
void RimVfpPlot_deprecated::onLoadDataAndUpdate()
{
if ( isMdiWindow() )
{
@@ -506,7 +506,7 @@ void RimVfpPlot::onLoadDataAndUpdate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::populatePlotWidgetWithPlotData( RiuPlotWidget* plotWidget, const VfpPlotData& plotData )
void RimVfpPlot_deprecated::populatePlotWidgetWithPlotData( RiuPlotWidget* plotWidget, const VfpPlotData& plotData )
{
plotWidget->setAxisScale( RiuPlotAxis::defaultBottom(), 0, 1 );
plotWidget->setAxisScale( RiuPlotAxis::defaultLeft(), 0, 1 );
@@ -553,14 +553,14 @@ void RimVfpPlot::populatePlotWidgetWithPlotData( RiuPlotWidget* plotWidget, cons
curve->plotCurve()->setSamplesFromXValuesAndYValues( plotData.xData( idx ), plotData.yData( idx ), useLogarithmicScale );
}
curve->updateCurveAppearance();
curve->appearanceChanged.connect( this, &RimVfpPlot::curveAppearanceChanged );
curve->appearanceChanged.connect( this, &RimVfpPlot_deprecated::curveAppearanceChanged );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimVfpPlot::axisTitle( RimVfpDefines::ProductionVariableType variableType, RimVfpDefines::FlowingPhaseType flowingPhase )
QString RimVfpPlot_deprecated::axisTitle( RimVfpDefines::ProductionVariableType variableType, RimVfpDefines::FlowingPhaseType flowingPhase )
{
QString title;
@@ -581,16 +581,16 @@ QString RimVfpPlot::axisTitle( RimVfpDefines::ProductionVariableType variableTyp
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::connectAxisSignals( RimPlotAxisProperties* axis )
void RimVfpPlot_deprecated::connectAxisSignals( RimPlotAxisProperties* axis )
{
axis->settingsChanged.connect( this, &RimVfpPlot::axisSettingsChanged );
axis->logarithmicChanged.connect( this, &RimVfpPlot::axisLogarithmicChanged );
axis->settingsChanged.connect( this, &RimVfpPlot_deprecated::axisSettingsChanged );
axis->logarithmicChanged.connect( this, &RimVfpPlot_deprecated::axisLogarithmicChanged );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::axisSettingsChanged( const caf::SignalEmitter* emitter )
void RimVfpPlot_deprecated::axisSettingsChanged( const caf::SignalEmitter* emitter )
{
updateAxes();
}
@@ -598,7 +598,7 @@ void RimVfpPlot::axisSettingsChanged( const caf::SignalEmitter* emitter )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::axisLogarithmicChanged( const caf::SignalEmitter* emitter, bool isLogarithmic )
void RimVfpPlot_deprecated::axisLogarithmicChanged( const caf::SignalEmitter* emitter, bool isLogarithmic )
{
// Currently not supported
}
@@ -606,7 +606,7 @@ void RimVfpPlot::axisLogarithmicChanged( const caf::SignalEmitter* emitter, bool
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::updatePlotWidgetFromAxisRanges()
void RimVfpPlot_deprecated::updatePlotWidgetFromAxisRanges()
{
if ( m_plotWidget )
{
@@ -625,7 +625,7 @@ void RimVfpPlot::updatePlotWidgetFromAxisRanges()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::updateAxisRangesFromPlotWidget()
void RimVfpPlot_deprecated::updateAxisRangesFromPlotWidget()
{
RimPlotAxisTools::updateVisibleRangesFromPlotWidget( m_xAxisProperties(), RiuPlotAxis::defaultBottom(), m_plotWidget );
RimPlotAxisTools::updateVisibleRangesFromPlotWidget( m_yAxisProperties(), RiuPlotAxis::defaultLeft(), m_plotWidget );
@@ -634,7 +634,7 @@ void RimVfpPlot::updateAxisRangesFromPlotWidget()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::onPlotZoomed()
void RimVfpPlot_deprecated::onPlotZoomed()
{
setAutoScaleXEnabled( false );
setAutoScaleYEnabled( false );
@@ -644,7 +644,7 @@ void RimVfpPlot::onPlotZoomed()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::curveAppearanceChanged( const caf::SignalEmitter* emitter )
void RimVfpPlot_deprecated::curveAppearanceChanged( const caf::SignalEmitter* emitter )
{
scheduleReplot();
}
@@ -652,7 +652,7 @@ void RimVfpPlot::curveAppearanceChanged( const caf::SignalEmitter* emitter )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::initializeFromInitData( const VfpTableInitialData& table )
void RimVfpPlot_deprecated::initializeFromInitData( const VfpTableInitialData& table )
{
m_tableType = table.isProductionTable ? RimVfpDefines::TableType::PRODUCTION : RimVfpDefines::TableType::INJECTION;
m_tableNumber = table.tableNumber;
@@ -665,7 +665,7 @@ void RimVfpPlot::initializeFromInitData( const VfpTableInitialData& table )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimVfpTableData* RimVfpPlot::vfpTableData() const
RimVfpTableData* RimVfpPlot_deprecated::vfpTableData() const
{
if ( m_vfpTable ) return m_vfpTable->dataSource();
@@ -675,7 +675,7 @@ RimVfpTableData* RimVfpPlot::vfpTableData() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigVfpTables* RimVfpPlot::vfpTables() const
const RigVfpTables* RimVfpPlot_deprecated::vfpTables() const
{
if ( vfpTableData() )
{
@@ -689,7 +689,7 @@ const RigVfpTables* RimVfpPlot::vfpTables() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimVfpPlot::convertToDisplayUnit( double value, RimVfpDefines::ProductionVariableType variableType )
double RimVfpPlot_deprecated::convertToDisplayUnit( double value, RimVfpDefines::ProductionVariableType variableType )
{
if ( variableType == RimVfpDefines::ProductionVariableType::THP )
{
@@ -708,7 +708,7 @@ double RimVfpPlot::convertToDisplayUnit( double value, RimVfpDefines::Production
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::convertToDisplayUnit( std::vector<double>& values, RimVfpDefines::ProductionVariableType variableType )
void RimVfpPlot_deprecated::convertToDisplayUnit( std::vector<double>& values, RimVfpDefines::ProductionVariableType variableType )
{
for ( double& value : values )
value = convertToDisplayUnit( value, variableType );
@@ -717,7 +717,7 @@ void RimVfpPlot::convertToDisplayUnit( std::vector<double>& values, RimVfpDefine
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimVfpPlot::getDisplayUnitWithBracket( RimVfpDefines::ProductionVariableType variableType )
QString RimVfpPlot_deprecated::getDisplayUnitWithBracket( RimVfpDefines::ProductionVariableType variableType )
{
QString unit = getDisplayUnit( variableType );
if ( !unit.isEmpty() ) return QString( "[%1]" ).arg( unit );
@@ -728,7 +728,7 @@ QString RimVfpPlot::getDisplayUnitWithBracket( RimVfpDefines::ProductionVariable
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimVfpPlot::getDisplayUnit( RimVfpDefines::ProductionVariableType variableType )
QString RimVfpPlot_deprecated::getDisplayUnit( RimVfpDefines::ProductionVariableType variableType )
{
if ( variableType == RimVfpDefines::ProductionVariableType::THP ) return "Bar";
@@ -741,7 +741,7 @@ QString RimVfpPlot::getDisplayUnit( RimVfpDefines::ProductionVariableType variab
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
void RimVfpPlot_deprecated::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_vfpTable );
@@ -780,7 +780,7 @@ void RimVfpPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiO
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::setFixedVariableUiEditability( caf::PdmField<int>& field, RimVfpDefines::ProductionVariableType variableType )
void RimVfpPlot_deprecated::setFixedVariableUiEditability( caf::PdmField<int>& field, RimVfpDefines::ProductionVariableType variableType )
{
field.uiCapability()->setUiReadOnly( variableType == m_primaryVariable.v() || variableType == m_familyVariable.v() );
}
@@ -788,7 +788,7 @@ void RimVfpPlot::setFixedVariableUiEditability( caf::PdmField<int>& field, RimVf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimVfpPlot::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
QList<caf::PdmOptionItemInfo> RimVfpPlot_deprecated::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options = RimPlot::calculateValueOptions( fieldNeedingOptions );
@@ -832,7 +832,8 @@ QList<caf::PdmOptionItemInfo> RimVfpPlot::calculateValueOptions( const caf::PdmF
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::calculateTableValueOptions( RimVfpDefines::ProductionVariableType variableType, QList<caf::PdmOptionItemInfo>& options )
void RimVfpPlot_deprecated::calculateTableValueOptions( RimVfpDefines::ProductionVariableType variableType,
QList<caf::PdmOptionItemInfo>& options )
{
if ( vfpTables() )
{
@@ -850,7 +851,7 @@ void RimVfpPlot::calculateTableValueOptions( RimVfpDefines::ProductionVariableTy
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
void RimVfpPlot_deprecated::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
RimPlot::fieldChangedByUi( changedField, oldValue, newValue );
@@ -866,7 +867,7 @@ void RimVfpPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, cons
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::initAfterRead()
void RimVfpPlot_deprecated::initAfterRead()
{
auto filePath = m_filePath_OBSOLETE.v().path();
if ( filePath.isEmpty() ) return;
@@ -885,7 +886,7 @@ void RimVfpPlot::initAfterRead()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::updatePlotTitle( const QString& plotTitle )
void RimVfpPlot_deprecated::updatePlotTitle( const QString& plotTitle )
{
m_plotTitle = plotTitle;
@@ -900,12 +901,12 @@ void RimVfpPlot::updatePlotTitle( const QString& plotTitle )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimVfpPlot::generatePlotTitle( const QString& wellName,
int tableNumber,
RimVfpDefines::TableType tableType,
RimVfpDefines::InterpolatedVariableType interpolatedVariable,
RimVfpDefines::ProductionVariableType primaryVariable,
RimVfpDefines::ProductionVariableType familyVariable )
QString RimVfpPlot_deprecated::generatePlotTitle( const QString& wellName,
int tableNumber,
RimVfpDefines::TableType tableType,
RimVfpDefines::InterpolatedVariableType interpolatedVariable,
RimVfpDefines::ProductionVariableType primaryVariable,
RimVfpDefines::ProductionVariableType familyVariable )
{
QString tableTypeText = caf::AppEnum<RimVfpDefines::TableType>::uiText( tableType );
QString interpolatedVariableText = caf::AppEnum<RimVfpDefines::InterpolatedVariableType>::uiText( interpolatedVariable );
@@ -919,7 +920,7 @@ QString RimVfpPlot::generatePlotTitle( const QString& w
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimVfpPlot::userDescriptionField()
caf::PdmFieldHandle* RimVfpPlot_deprecated::userDescriptionField()
{
return &m_plotTitle;
}
@@ -927,7 +928,7 @@ caf::PdmFieldHandle* RimVfpPlot::userDescriptionField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimVfpPlot::scheduleReplot()
void RimVfpPlot_deprecated::scheduleReplot()
{
if ( m_plotWidget )
{
@@ -938,7 +939,7 @@ void RimVfpPlot::scheduleReplot()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
VfpTableSelection RimVfpPlot::tableSelection() const
VfpTableSelection RimVfpPlot_deprecated::tableSelection() const
{
return { m_flowRateIdx(), m_thpIdx(), m_articifialLiftQuantityIdx(), m_waterCutIdx(), m_gasLiquidRatioIdx() };
}

View File

@@ -43,16 +43,19 @@ class VFPProdTable;
} // namespace Opm
//--------------------------------------------------------------------------------------------------
/// Vertical Flow Performance Plot
/// DEPRECATED: Vertical Flow Performance Plot
/// This class is deprecated and will be removed in a future release.
/// Use RimCustomVfpPlot instead.
//--------------------------------------------------------------------------------------------------
class RimVfpPlot : public RimPlot
class RimVfpPlot_deprecated : public RimPlot
{
CAF_PDM_HEADER_INIT;
public:
RimVfpPlot();
~RimVfpPlot() override;
RimVfpPlot_deprecated();
~RimVfpPlot_deprecated() override;
private:
void setDataSource( RimVfpTable* vfpTableData );
void setTableNumber( int tableNumber );
void initializeObject();

View File

@@ -141,6 +141,5 @@ void RimVfpTable::updateObjectName()
//--------------------------------------------------------------------------------------------------
void RimVfpTable::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const
{
menuBuilder << "RicNewVfpPlotFeature";
menuBuilder << "RicNewCustomVfpPlotFeature";
}

View File

@@ -148,6 +148,5 @@ void RimVfpTableData::updateObjectName()
//--------------------------------------------------------------------------------------------------
void RimVfpTableData::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const
{
menuBuilder << "RicNewVfpPlotFeature";
menuBuilder << "RicNewCustomVfpPlotFeature";
}