mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8405 Source Stepping on multiple graphs
- add copy paste of plots into multi summary plot - improve data source stepping for multi plot - improve auto generated plot name, graph name and curve name Fixes by clang-format Improve readability
This commit is contained in:
@@ -230,16 +230,7 @@ RimMultiPlot* RicSummaryPlotBuilder::createAndAppendMultiPlot( const std::vector
|
||||
plotWindow->setAsPlotMdiWindow();
|
||||
plotCollection->addMultiPlot( plotWindow );
|
||||
|
||||
for ( auto plot : plots )
|
||||
{
|
||||
plotWindow->addPlot( plot );
|
||||
|
||||
plot->resolveReferencesRecursively();
|
||||
plot->revokeMdiWindowStatus();
|
||||
plot->setShowWindow( true );
|
||||
|
||||
plot->loadDataAndUpdate();
|
||||
}
|
||||
appendPlotsToMultiPlot( plotWindow, plots );
|
||||
|
||||
plotCollection->updateAllRequiredEditors();
|
||||
plotWindow->loadDataAndUpdate();
|
||||
@@ -249,6 +240,26 @@ RimMultiPlot* RicSummaryPlotBuilder::createAndAppendMultiPlot( const std::vector
|
||||
return plotWindow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotBuilder::appendPlotsToMultiPlot( RimMultiPlot* multiPlot, const std::vector<RimPlot*>& plots )
|
||||
{
|
||||
for ( auto plot : plots )
|
||||
{
|
||||
// Remove the currently window controller, as this will be managed by the multi plot
|
||||
// This must be done before adding the plot to the multi plot to ensure that the viewer widget is recreated
|
||||
plot->revokeMdiWindowStatus();
|
||||
|
||||
multiPlot->addPlot( plot );
|
||||
|
||||
plot->resolveReferencesRecursively();
|
||||
plot->setShowWindow( true );
|
||||
|
||||
plot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -61,6 +61,7 @@ public:
|
||||
|
||||
static std::vector<RimPlot*> duplicatePlots( const std::vector<RimPlot*>& plots );
|
||||
static RimMultiPlot* createAndAppendMultiPlot( const std::vector<RimPlot*>& plots );
|
||||
static void appendPlotsToMultiPlot( RimMultiPlot* multiPlot, const std::vector<RimPlot*>& plots );
|
||||
|
||||
static RimSummaryPlot* createPlot( const std::set<RifEclipseSummaryAddress>& addresses,
|
||||
const std::vector<RimSummaryCase*>& summaryCases,
|
||||
|
@@ -19,10 +19,14 @@
|
||||
#include "RicPasteSummaryPlotFeature.h"
|
||||
|
||||
#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
|
||||
#include "cafPdmDefaultObjectFactory.h"
|
||||
#include "cafPdmDocument.h"
|
||||
#include "cafPdmObjectGroup.h"
|
||||
@@ -39,8 +43,21 @@ CAF_CMD_SOURCE_INIT( RicPasteSummaryPlotFeature, "RicPasteSummaryPlotFeature" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicPasteSummaryPlotFeature::copyPlotAndAddToCollection( RimSummaryPlot* sourcePlot )
|
||||
{
|
||||
RimSummaryPlotCollection* plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlotCollection*>();
|
||||
auto multiPlot = caf::firstAncestorOfTypeFromSelectedObject<RimMultiPlot*>();
|
||||
if ( multiPlot )
|
||||
{
|
||||
auto plots = RicSummaryPlotBuilder::duplicatePlots( { sourcePlot } );
|
||||
RicSummaryPlotBuilder::appendPlotsToMultiPlot( multiPlot, plots );
|
||||
|
||||
multiPlot->loadDataAndUpdate();
|
||||
|
||||
// No main window has focus after paste operation, set focus to main plot window
|
||||
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
RimSummaryPlotCollection* plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlotCollection*>();
|
||||
if ( plotColl )
|
||||
{
|
||||
RimSummaryPlot* newSummaryPlot = dynamic_cast<RimSummaryPlot*>(
|
||||
@@ -72,6 +89,9 @@ bool RicPasteSummaryPlotFeature::isCommandEnabled()
|
||||
|
||||
if ( !destinationObject ) return false;
|
||||
|
||||
auto multiPlot = caf::firstAncestorOfTypeFromSelectedObject<RimMultiPlot*>();
|
||||
if ( multiPlot ) return true;
|
||||
|
||||
RimSummaryPlotCollection* plotColl = nullptr;
|
||||
destinationObject->firstAncestorOrThisOfType( plotColl );
|
||||
if ( !plotColl )
|
||||
|
@@ -1,5 +1,27 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimDataSourceSteppingTools.h"
|
||||
|
||||
#include "RiaSummaryCurveAnalyzer.h"
|
||||
|
||||
#include "cafPdmUiFieldHandle.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -47,3 +69,120 @@ void RimDataSourceSteppingTools::modifyCurrentIndex( caf::PdmValueField*
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& oldValue,
|
||||
const QVariant& newValue,
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||
RifEclipseSummaryAddress* adr )
|
||||
{
|
||||
if ( !adr ) return false;
|
||||
|
||||
if ( category == RifEclipseSummaryAddress::SUMMARY_REGION )
|
||||
{
|
||||
int oldInt = oldValue.toInt();
|
||||
int newInt = newValue.toInt();
|
||||
|
||||
if ( adr->regionNumber() == oldInt )
|
||||
{
|
||||
adr->setRegion( newInt );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_AQUIFER )
|
||||
{
|
||||
int oldInt = oldValue.toInt();
|
||||
int newInt = newValue.toInt();
|
||||
|
||||
if ( adr->aquiferNumber() == oldInt )
|
||||
{
|
||||
adr->setAquiferNumber( newInt );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP )
|
||||
{
|
||||
std::string oldString = oldValue.toString().toStdString();
|
||||
std::string newString = newValue.toString().toStdString();
|
||||
|
||||
if ( adr->wellGroupName() == oldString )
|
||||
{
|
||||
adr->setWellGroupName( newString );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL )
|
||||
{
|
||||
std::string oldString = oldValue.toString().toStdString();
|
||||
std::string newString = newValue.toString().toStdString();
|
||||
|
||||
if ( adr->wellName() == oldString )
|
||||
{
|
||||
adr->setWellName( newString );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_BLOCK ||
|
||||
category == RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION )
|
||||
{
|
||||
std::string oldString = oldValue.toString().toStdString();
|
||||
std::string newString = newValue.toString().toStdString();
|
||||
if ( adr->blockAsString() == oldString )
|
||||
{
|
||||
adr->setCellIjk( newString );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT )
|
||||
{
|
||||
int oldInt = oldValue.toInt();
|
||||
int newInt = newValue.toInt();
|
||||
if ( adr->wellSegmentNumber() == oldInt )
|
||||
{
|
||||
adr->setWellSegmentNumber( newInt );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimDataSourceSteppingTools::updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue,
|
||||
const QVariant& newValue,
|
||||
RifEclipseSummaryAddress* adr )
|
||||
{
|
||||
if ( !adr ) return false;
|
||||
|
||||
std::string oldString = oldValue.toString().toStdString();
|
||||
std::string newString = newValue.toString().toStdString();
|
||||
|
||||
if ( adr->quantityName() == oldString )
|
||||
{
|
||||
adr->setQuantityName( newString );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string correspondingOldString = RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName( oldString );
|
||||
std::string correspondingNewString = RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName( newString );
|
||||
|
||||
if ( adr->quantityName() == correspondingOldString )
|
||||
{
|
||||
adr->setQuantityName( correspondingNewString );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -18,8 +18,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "cafPdmUiItem.h"
|
||||
#include "cafPdmValueField.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -30,4 +32,13 @@ public:
|
||||
static void modifyCurrentIndex( caf::PdmValueField* valueField,
|
||||
const QList<caf::PdmOptionItemInfo>& options,
|
||||
int indexOffset );
|
||||
|
||||
static bool updateAddressIfMatching( const QVariant& oldValue,
|
||||
const QVariant& newValue,
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||
RifEclipseSummaryAddress* adr );
|
||||
|
||||
static bool updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue,
|
||||
const QVariant& newValue,
|
||||
RifEclipseSummaryAddress* adr );
|
||||
};
|
||||
|
@@ -38,6 +38,9 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotManager.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSummaryMultiPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSummaryDataSourceStepping.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSummaryNameHelper.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimMultipleSummaryPlotNameHelper.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -80,6 +83,9 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotManager.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSummaryMultiPlot.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSummaryDataSourceStepping.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSummaryNameHelper.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimMultipleSummaryPlotNameHelper.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
@@ -51,7 +51,7 @@ RimEnsembleCurveSetCollection::RimEnsembleCurveSetCollection()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_ySourceStepping, "YSourceStepping", "" );
|
||||
m_ySourceStepping = new RimSummaryPlotSourceStepping;
|
||||
m_ySourceStepping->setSourceSteppingType( RimSummaryPlotSourceStepping::Y_AXIS );
|
||||
m_ySourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS );
|
||||
m_ySourceStepping.uiCapability()->setUiTreeHidden( true );
|
||||
m_ySourceStepping.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_ySourceStepping.xmlCapability()->disableIO();
|
||||
@@ -317,9 +317,6 @@ void RimEnsembleCurveSetCollection::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSetCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup( "Data Source" );
|
||||
|
||||
m_ySourceStepping()->uiOrdering( uiConfigName, *group );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -0,0 +1,237 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimMultipleSummaryPlotNameHelper.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMultiSummaryPlotNameHelper::RimMultiSummaryPlotNameHelper( std::vector<const RimSummaryNameHelper*> nameHelpers )
|
||||
: m_nameHelpers( nameHelpers )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimMultiSummaryPlotNameHelper::plotTitle() const
|
||||
{
|
||||
if ( m_nameHelpers.size() == 1 ) return m_nameHelpers.front()->plotTitle();
|
||||
|
||||
if ( m_nameHelpers.size() == 2 )
|
||||
{
|
||||
auto first = m_nameHelpers[0];
|
||||
auto second = m_nameHelpers[1];
|
||||
|
||||
return first->aggregatedPlotTitle( *second );
|
||||
}
|
||||
|
||||
return "Plot Title";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimMultiSummaryPlotNameHelper::isPlotDisplayingSingleQuantity() const
|
||||
{
|
||||
int plotCountWithSingleQuantity = 0;
|
||||
for ( auto nameHelper : m_nameHelpers )
|
||||
{
|
||||
if ( nameHelper->isPlotDisplayingSingleQuantity() ) plotCountWithSingleQuantity++;
|
||||
}
|
||||
|
||||
if ( plotCountWithSingleQuantity == 1 ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimMultiSummaryPlotNameHelper::isWellNameInTitle() const
|
||||
{
|
||||
return std::any_of( m_nameHelpers.begin(), m_nameHelpers.end(), []( auto nameHelper ) {
|
||||
return nameHelper->isWellNameInTitle();
|
||||
} );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimMultiSummaryPlotNameHelper::isWellGroupNameInTitle() const
|
||||
{
|
||||
return std::any_of( m_nameHelpers.begin(), m_nameHelpers.end(), []( auto nameHelper ) {
|
||||
return nameHelper->isWellGroupNameInTitle();
|
||||
} );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimMultiSummaryPlotNameHelper::isRegionInTitle() const
|
||||
{
|
||||
return std::any_of( m_nameHelpers.begin(), m_nameHelpers.end(), []( auto nameHelper ) {
|
||||
return nameHelper->isRegionInTitle();
|
||||
} );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimMultiSummaryPlotNameHelper::isCaseInTitle() const
|
||||
{
|
||||
return std::any_of( m_nameHelpers.begin(), m_nameHelpers.end(), []( auto nameHelper ) {
|
||||
return nameHelper->isCaseInTitle();
|
||||
} );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimMultiSummaryPlotNameHelper::isBlockInTitle() const
|
||||
{
|
||||
return std::any_of( m_nameHelpers.begin(), m_nameHelpers.end(), []( auto nameHelper ) {
|
||||
return nameHelper->isBlockInTitle();
|
||||
} );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimMultiSummaryPlotNameHelper::isSegmentInTitle() const
|
||||
{
|
||||
return std::any_of( m_nameHelpers.begin(), m_nameHelpers.end(), []( auto nameHelper ) {
|
||||
return nameHelper->isSegmentInTitle();
|
||||
} );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimMultiSummaryPlotNameHelper::isCompletionInTitle() const
|
||||
{
|
||||
return std::any_of( m_nameHelpers.begin(), m_nameHelpers.end(), []( auto nameHelper ) {
|
||||
return nameHelper->isCompletionInTitle();
|
||||
} );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimMultiSummaryPlotNameHelper::caseName() const
|
||||
{
|
||||
for ( auto nameHelper : m_nameHelpers )
|
||||
{
|
||||
if ( nameHelper->isCaseInTitle() ) return nameHelper->caseName();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimMultiSummaryPlotNameHelper::titleQuantity() const
|
||||
{
|
||||
for ( auto nameHelper : m_nameHelpers )
|
||||
{
|
||||
if ( nameHelper->isPlotDisplayingSingleQuantity() ) return nameHelper->titleQuantity();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimMultiSummaryPlotNameHelper::titleWellName() const
|
||||
{
|
||||
for ( auto nameHelper : m_nameHelpers )
|
||||
{
|
||||
if ( nameHelper->isWellNameInTitle() ) return nameHelper->titleWellName();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimMultiSummaryPlotNameHelper::titleWellGroupName() const
|
||||
{
|
||||
for ( auto nameHelper : m_nameHelpers )
|
||||
{
|
||||
if ( nameHelper->isWellGroupNameInTitle() ) return nameHelper->titleWellGroupName();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimMultiSummaryPlotNameHelper::titleRegion() const
|
||||
{
|
||||
for ( auto nameHelper : m_nameHelpers )
|
||||
{
|
||||
if ( nameHelper->isRegionInTitle() ) return nameHelper->titleRegion();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimMultiSummaryPlotNameHelper::titleBlock() const
|
||||
{
|
||||
for ( auto nameHelper : m_nameHelpers )
|
||||
{
|
||||
if ( nameHelper->isBlockInTitle() ) return nameHelper->titleBlock();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimMultiSummaryPlotNameHelper::titleSegment() const
|
||||
{
|
||||
for ( auto nameHelper : m_nameHelpers )
|
||||
{
|
||||
if ( nameHelper->isSegmentInTitle() ) return nameHelper->titleSegment();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimMultiSummaryPlotNameHelper::titleCompletion() const
|
||||
{
|
||||
for ( auto nameHelper : m_nameHelpers )
|
||||
{
|
||||
if ( nameHelper->isCompletionInTitle() ) return nameHelper->titleCompletion();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
@@ -0,0 +1,54 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimSummaryNameHelper.h"
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RimMultiSummaryPlotNameHelper : public RimSummaryNameHelper
|
||||
{
|
||||
public:
|
||||
explicit RimMultiSummaryPlotNameHelper( std::vector<const RimSummaryNameHelper*> nameHelpers );
|
||||
|
||||
QString plotTitle() const override;
|
||||
|
||||
bool isPlotDisplayingSingleQuantity() const override;
|
||||
bool isWellNameInTitle() const override;
|
||||
bool isWellGroupNameInTitle() const override;
|
||||
bool isRegionInTitle() const override;
|
||||
bool isCaseInTitle() const override;
|
||||
bool isBlockInTitle() const override;
|
||||
bool isSegmentInTitle() const override;
|
||||
bool isCompletionInTitle() const override;
|
||||
|
||||
QString caseName() const override;
|
||||
|
||||
std::string titleQuantity() const override;
|
||||
std::string titleWellName() const override;
|
||||
std::string titleWellGroupName() const override;
|
||||
std::string titleRegion() const override;
|
||||
std::string titleBlock() const override;
|
||||
std::string titleSegment() const override;
|
||||
std::string titleCompletion() const override;
|
||||
|
||||
private:
|
||||
std::vector<const RimSummaryNameHelper*> m_nameHelpers;
|
||||
};
|
@@ -38,5 +38,5 @@ RimSummaryCrossPlot::RimSummaryCrossPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlotSourceStepping* RimSummaryCrossPlot::sourceSteppingObjectForKeyEventHandling() const
|
||||
{
|
||||
return summaryCurveCollection()->sourceSteppingObject( RimSummaryPlotSourceStepping::UNION_X_Y_AXIS );
|
||||
return summaryCurveCollection()->sourceSteppingObject( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS );
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
#include "RimMultipleSummaryPlotNameHelper.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
@@ -38,6 +39,7 @@
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryCurveAutoName.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimSummaryTimeAxisProperties.h"
|
||||
@@ -48,6 +50,7 @@
|
||||
#include "RiuSummaryVectorSelectionDialog.h"
|
||||
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmUiListEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
@@ -55,8 +58,6 @@
|
||||
#include "qwt_date.h"
|
||||
#include "qwt_plot.h"
|
||||
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimSummaryCurve, "SummaryCurve" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -502,11 +503,26 @@ QList<caf::PdmOptionItemInfo> RimSummaryCurve::calculateValueOptions( const caf:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryCurve::createCurveAutoName()
|
||||
{
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted( plot );
|
||||
std::vector<const RimSummaryNameHelper*> nameHelpers;
|
||||
{
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted( plot );
|
||||
auto nameHelper = plot->plotTitleHelper();
|
||||
|
||||
const RimSummaryPlotNameHelper* nameHelper = plot->activePlotTitleHelperAllCurves();
|
||||
QString curveName = m_curveNameConfig->curveNameY( m_yValuesSummaryAddress->address(), nameHelper );
|
||||
if ( nameHelper ) nameHelpers.push_back( nameHelper );
|
||||
}
|
||||
{
|
||||
RimSummaryMultiPlot* summaryMultiPlot = nullptr;
|
||||
firstAncestorOrThisOfType( summaryMultiPlot );
|
||||
if ( summaryMultiPlot )
|
||||
{
|
||||
auto nameHelper = summaryMultiPlot->nameHelper();
|
||||
if ( nameHelper ) nameHelpers.push_back( nameHelper );
|
||||
}
|
||||
}
|
||||
|
||||
RimMultiSummaryPlotNameHelper multiNameHelper( nameHelpers );
|
||||
QString curveName = m_curveNameConfig->curveNameY( m_yValuesSummaryAddress->address(), &multiNameHelper );
|
||||
if ( curveName.isEmpty() )
|
||||
{
|
||||
curveName = m_curveNameConfig->curveNameY( m_yValuesSummaryAddress->address(), nullptr );
|
||||
@@ -514,7 +530,7 @@ QString RimSummaryCurve::createCurveAutoName()
|
||||
|
||||
if ( isCrossPlotCurve() )
|
||||
{
|
||||
QString curveNameX = m_curveNameConfig->curveNameX( m_xValuesSummaryAddress->address(), nameHelper );
|
||||
QString curveNameX = m_curveNameConfig->curveNameX( m_xValuesSummaryAddress->address(), &multiNameHelper );
|
||||
if ( curveNameX.isEmpty() )
|
||||
{
|
||||
curveNameX = m_curveNameConfig->curveNameX( m_xValuesSummaryAddress->address(), nullptr );
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlotNameHelper.h"
|
||||
#include "RimSummaryNameHelper.h"
|
||||
|
||||
#include "SummaryPlotCommands/RicSummaryPlotEditorUi.h"
|
||||
|
||||
@@ -43,20 +43,20 @@ CAF_PDM_SOURCE_INIT( RimSummaryCurveAutoName, "SummaryCurveAutoName" );
|
||||
RimSummaryCurveAutoName::RimSummaryCurveAutoName()
|
||||
{
|
||||
// clang-format off
|
||||
CAF_PDM_InitObject("RimSummaryCurveAutoName", "", "", "");
|
||||
CAF_PDM_InitObject("RimSummaryCurveAutoName");
|
||||
|
||||
CAF_PDM_InitField(&m_longVectorName, "LongVectorName", false, "Long Vector Name", "", "", "");
|
||||
CAF_PDM_InitField(&m_vectorName, "VectorName", true, "Vector Name", "", "", "");
|
||||
CAF_PDM_InitField(&m_unit, "Unit", false, "Unit", "", "", "");
|
||||
CAF_PDM_InitField(&m_regionNumber, "RegionNumber", true, "Region Number", "", "", "");
|
||||
CAF_PDM_InitField(&m_wellGroupName, "WellGroupName", true, "Group Name", "", "", "");
|
||||
CAF_PDM_InitField(&m_wellName, "WellName", true, "Well Name", "", "", "");
|
||||
CAF_PDM_InitField(&m_wellSegmentNumber, "WellSegmentNumber", true, "Well Segment Number", "", "", "");
|
||||
CAF_PDM_InitField(&m_lgrName, "LgrName", true, "Lgr Name", "", "", "");
|
||||
CAF_PDM_InitField(&m_completion, "Completion", true, "I, J, K", "", "", "");
|
||||
CAF_PDM_InitField(&m_aquiferNumber, "Aquifer", true, "Aquifer Number", "", "", "");
|
||||
CAF_PDM_InitField( &m_longVectorName, "LongVectorName", false, "Long Vector Name");
|
||||
CAF_PDM_InitField( &m_vectorName, "VectorName", true, "Vector Name");
|
||||
CAF_PDM_InitField( &m_unit, "Unit", false, "Unit");
|
||||
CAF_PDM_InitField( &m_regionNumber, "RegionNumber", true, "Region Number");
|
||||
CAF_PDM_InitField( &m_wellGroupName, "WellGroupName", true, "Group Name");
|
||||
CAF_PDM_InitField( &m_wellName, "WellName", true, "Well Name");
|
||||
CAF_PDM_InitField(&m_wellSegmentNumber, "WellSegmentNumber", true, "Well Segment Number");
|
||||
CAF_PDM_InitField( &m_lgrName, "LgrName", true, "Lgr Name");
|
||||
CAF_PDM_InitField( &m_completion, "Completion", true, "I, J, K");
|
||||
CAF_PDM_InitField( &m_aquiferNumber, "Aquifer", true, "Aquifer Number");
|
||||
|
||||
CAF_PDM_InitField(&m_caseName, "CaseName", true, "Case/Ensemble Name", "", "", "");
|
||||
CAF_PDM_InitField(&m_caseName, "CaseName", true, "Case/Ensemble Name");
|
||||
|
||||
// clang-format on
|
||||
}
|
||||
@@ -65,7 +65,7 @@ RimSummaryCurveAutoName::RimSummaryCurveAutoName()
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryCurveAutoName::curveNameY( const RifEclipseSummaryAddress& summaryAddress,
|
||||
const RimSummaryPlotNameHelper* nameHelper ) const
|
||||
const RimSummaryNameHelper* nameHelper ) const
|
||||
{
|
||||
RimSummaryCurve* summaryCurve = nullptr;
|
||||
this->firstAncestorOrThisOfType( summaryCurve );
|
||||
@@ -100,7 +100,7 @@ QString RimSummaryCurveAutoName::curveNameY( const RifEclipseSummaryAddress& sum
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryCurveAutoName::curveNameX( const RifEclipseSummaryAddress& summaryAddress,
|
||||
const RimSummaryPlotNameHelper* nameHelper ) const
|
||||
const RimSummaryNameHelper* nameHelper ) const
|
||||
{
|
||||
RimSummaryCurve* summaryCurve = nullptr;
|
||||
this->firstAncestorOrThisOfType( summaryCurve );
|
||||
@@ -154,7 +154,7 @@ void RimSummaryCurveAutoName::applySettings( const RimSummaryCurveAutoName& othe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveAutoName::appendWellName( std::string& text,
|
||||
const RifEclipseSummaryAddress& summaryAddress,
|
||||
const RimSummaryPlotNameHelper* nameHelper ) const
|
||||
const RimSummaryNameHelper* nameHelper ) const
|
||||
{
|
||||
bool skipSubString = nameHelper && nameHelper->isWellNameInTitle();
|
||||
if ( skipSubString ) return;
|
||||
@@ -182,7 +182,7 @@ void RimSummaryCurveAutoName::appendLgrName( std::string& text, const RifEclipse
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryCurveAutoName::buildCurveName( const RifEclipseSummaryAddress& summaryAddress,
|
||||
const RimSummaryPlotNameHelper* nameHelper,
|
||||
const RimSummaryNameHelper* nameHelper,
|
||||
const std::string& unitText,
|
||||
const std::string& caseName ) const
|
||||
{
|
||||
@@ -251,7 +251,7 @@ QString RimSummaryCurveAutoName::buildCurveName( const RifEclipseSummaryAddress&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveAutoName::appendAddressDetails( std::string& text,
|
||||
const RifEclipseSummaryAddress& summaryAddress,
|
||||
const RimSummaryPlotNameHelper* nameHelper ) const
|
||||
const RimSummaryNameHelper* nameHelper ) const
|
||||
{
|
||||
switch ( summaryAddress.category() )
|
||||
{
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
class RifEclipseSummaryAddress;
|
||||
class RimSummaryPlotNameHelper;
|
||||
class RimSummaryNameHelper;
|
||||
|
||||
class RimSummaryCurveAutoName : public caf::PdmObject
|
||||
{
|
||||
@@ -31,8 +31,8 @@ class RimSummaryCurveAutoName : public caf::PdmObject
|
||||
public:
|
||||
RimSummaryCurveAutoName();
|
||||
|
||||
QString curveNameY( const RifEclipseSummaryAddress& summaryAddress, const RimSummaryPlotNameHelper* nameHelper ) const;
|
||||
QString curveNameX( const RifEclipseSummaryAddress& summaryAddress, const RimSummaryPlotNameHelper* nameHelper ) const;
|
||||
QString curveNameY( const RifEclipseSummaryAddress& summaryAddress, const RimSummaryNameHelper* nameHelper ) const;
|
||||
QString curveNameX( const RifEclipseSummaryAddress& summaryAddress, const RimSummaryNameHelper* nameHelper ) const;
|
||||
|
||||
void applySettings( const RimSummaryCurveAutoName& other );
|
||||
|
||||
@@ -44,14 +44,14 @@ private:
|
||||
|
||||
void appendAddressDetails( std::string& text,
|
||||
const RifEclipseSummaryAddress& summaryAddress,
|
||||
const RimSummaryPlotNameHelper* nameHelper ) const;
|
||||
const RimSummaryNameHelper* nameHelper ) const;
|
||||
void appendWellName( std::string& text,
|
||||
const RifEclipseSummaryAddress& summaryAddress,
|
||||
const RimSummaryPlotNameHelper* nameHelper ) const;
|
||||
const RimSummaryNameHelper* nameHelper ) const;
|
||||
void appendLgrName( std::string& text, const RifEclipseSummaryAddress& summaryAddress ) const;
|
||||
|
||||
QString buildCurveName( const RifEclipseSummaryAddress& summaryAddress,
|
||||
const RimSummaryPlotNameHelper* nameHelper,
|
||||
const RimSummaryNameHelper* nameHelper,
|
||||
const std::string& unitText,
|
||||
const std::string& caseName ) const;
|
||||
|
||||
|
@@ -65,21 +65,21 @@ RimSummaryCurveCollection::RimSummaryCurveCollection()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_ySourceStepping, "YSourceStepping", "" );
|
||||
m_ySourceStepping = new RimSummaryPlotSourceStepping;
|
||||
m_ySourceStepping->setSourceSteppingType( RimSummaryPlotSourceStepping::Y_AXIS );
|
||||
m_ySourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS );
|
||||
m_ySourceStepping.uiCapability()->setUiTreeHidden( true );
|
||||
m_ySourceStepping.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_ySourceStepping.xmlCapability()->disableIO();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_xSourceStepping, "XSourceStepping", "" );
|
||||
m_xSourceStepping = new RimSummaryPlotSourceStepping;
|
||||
m_xSourceStepping->setSourceSteppingType( RimSummaryPlotSourceStepping::X_AXIS );
|
||||
m_xSourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::X_AXIS );
|
||||
m_xSourceStepping.uiCapability()->setUiTreeHidden( true );
|
||||
m_xSourceStepping.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_xSourceStepping.xmlCapability()->disableIO();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_unionSourceStepping, "UnionSourceStepping", "" );
|
||||
m_unionSourceStepping = new RimSummaryPlotSourceStepping;
|
||||
m_unionSourceStepping->setSourceSteppingType( RimSummaryPlotSourceStepping::UNION_X_Y_AXIS );
|
||||
m_unionSourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS );
|
||||
m_unionSourceStepping.uiCapability()->setUiTreeHidden( true );
|
||||
m_unionSourceStepping.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_unionSourceStepping.xmlCapability()->disableIO();
|
||||
@@ -232,7 +232,7 @@ std::vector<RimSummaryCurve*> RimSummaryCurveCollection::curves() const
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*>
|
||||
RimSummaryCurveCollection::curvesForSourceStepping( RimSummaryPlotSourceStepping::SourceSteppingType steppingType ) const
|
||||
RimSummaryCurveCollection::curvesForSourceStepping( RimSummaryDataSourceStepping::Axis steppingType ) const
|
||||
{
|
||||
std::vector<RimSummaryCurve*> stepCurves;
|
||||
|
||||
@@ -247,11 +247,11 @@ std::vector<RimSummaryCurve*>
|
||||
|
||||
std::string quantity;
|
||||
|
||||
if ( steppingType == RimSummaryPlotSourceStepping::X_AXIS )
|
||||
if ( steppingType == RimSummaryDataSourceStepping::Axis::X_AXIS )
|
||||
{
|
||||
quantity = m_curveForSourceStepping->summaryAddressX().quantityName();
|
||||
}
|
||||
else if ( steppingType == RimSummaryPlotSourceStepping::Y_AXIS )
|
||||
else if ( steppingType == RimSummaryDataSourceStepping::Axis::Y_AXIS )
|
||||
{
|
||||
quantity = m_curveForSourceStepping->summaryAddressY().quantityName();
|
||||
}
|
||||
@@ -268,7 +268,7 @@ std::vector<RimSummaryCurve*>
|
||||
|
||||
for ( const auto& c : curves() )
|
||||
{
|
||||
if ( steppingType == RimSummaryPlotSourceStepping::X_AXIS )
|
||||
if ( steppingType == RimSummaryDataSourceStepping::Axis::X_AXIS )
|
||||
{
|
||||
if ( c->summaryCaseX() == m_curveForSourceStepping->summaryCaseX() &&
|
||||
c->summaryAddressX().quantityName() == candidateName )
|
||||
@@ -276,7 +276,7 @@ std::vector<RimSummaryCurve*>
|
||||
stepCurves.push_back( c );
|
||||
}
|
||||
}
|
||||
else if ( steppingType == RimSummaryPlotSourceStepping::Y_AXIS )
|
||||
else if ( steppingType == RimSummaryDataSourceStepping::Axis::Y_AXIS )
|
||||
{
|
||||
if ( c->summaryCaseY() == m_curveForSourceStepping->summaryCaseY() &&
|
||||
c->summaryAddressY().quantityName() == candidateName )
|
||||
@@ -411,17 +411,17 @@ RimSummaryCurve* RimSummaryCurveCollection::curveForSourceStepping() const
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlotSourceStepping*
|
||||
RimSummaryCurveCollection::sourceSteppingObject( RimSummaryPlotSourceStepping::SourceSteppingType sourceSteppingType ) const
|
||||
RimSummaryCurveCollection::sourceSteppingObject( RimSummaryDataSourceStepping::Axis sourceSteppingType ) const
|
||||
{
|
||||
if ( sourceSteppingType == RimSummaryPlotSourceStepping::X_AXIS )
|
||||
if ( sourceSteppingType == RimSummaryDataSourceStepping::Axis::X_AXIS )
|
||||
{
|
||||
return m_xSourceStepping();
|
||||
}
|
||||
else if ( sourceSteppingType == RimSummaryPlotSourceStepping::Y_AXIS )
|
||||
else if ( sourceSteppingType == RimSummaryDataSourceStepping::Axis::Y_AXIS )
|
||||
{
|
||||
return m_ySourceStepping();
|
||||
}
|
||||
if ( sourceSteppingType == RimSummaryPlotSourceStepping::UNION_X_Y_AXIS )
|
||||
if ( sourceSteppingType == RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS )
|
||||
{
|
||||
return m_unionSourceStepping();
|
||||
}
|
||||
@@ -491,35 +491,6 @@ void RimSummaryCurveCollection::onChildDeleted( caf::PdmChildArrayFieldHandle*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
RimSummaryCrossPlot* parentCrossPlot;
|
||||
firstAncestorOrThisOfType( parentCrossPlot );
|
||||
|
||||
if ( parentCrossPlot )
|
||||
{
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup( "Y Source Stepping" );
|
||||
|
||||
m_ySourceStepping()->uiOrdering( uiConfigName, *group );
|
||||
}
|
||||
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup( "X Source Stepping" );
|
||||
|
||||
m_xSourceStepping()->uiOrdering( uiConfigName, *group );
|
||||
}
|
||||
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup( "XY Union Source Stepping" );
|
||||
|
||||
m_unionSourceStepping()->uiOrdering( uiConfigName, *group );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup( "Data Source" );
|
||||
|
||||
m_ySourceStepping()->uiOrdering( uiConfigName, *group );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -53,12 +53,10 @@ public:
|
||||
void setCurveForSourceStepping( RimSummaryCurve* curve );
|
||||
RimSummaryCurve* curveForSourceStepping() const;
|
||||
|
||||
RimSummaryPlotSourceStepping*
|
||||
sourceSteppingObject( RimSummaryPlotSourceStepping::SourceSteppingType sourceSteppingType ) const;
|
||||
RimSummaryPlotSourceStepping* sourceSteppingObject( RimSummaryDataSourceStepping::Axis sourceSteppingType ) const;
|
||||
|
||||
std::vector<RimSummaryCurve*> curves() const;
|
||||
std::vector<RimSummaryCurve*>
|
||||
curvesForSourceStepping( RimSummaryPlotSourceStepping::SourceSteppingType steppingType ) const;
|
||||
std::vector<RimSummaryCurve*> curvesForSourceStepping( RimSummaryDataSourceStepping::Axis steppingType ) const;
|
||||
|
||||
void setCurveAsTopZWithinCategory( RimSummaryCurve* curve );
|
||||
|
||||
|
@@ -0,0 +1,19 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021- 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 "RimSummaryDataSourceStepping.h"
|
@@ -0,0 +1,41 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021- 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 <vector>
|
||||
|
||||
class RimSummaryCurve;
|
||||
class RimEnsembleCurveSet;
|
||||
|
||||
class RimSummaryDataSourceStepping
|
||||
{
|
||||
public:
|
||||
enum class Axis
|
||||
{
|
||||
Y_AXIS,
|
||||
X_AXIS,
|
||||
UNION_X_Y_AXIS
|
||||
};
|
||||
|
||||
public:
|
||||
virtual std::vector<RimSummaryDataSourceStepping::Axis> availableAxes() const = 0;
|
||||
virtual std::vector<RimSummaryCurve*> curvesForStepping( RimSummaryDataSourceStepping::Axis axis ) const = 0;
|
||||
virtual std::vector<RimSummaryCurve*> allCurves( RimSummaryDataSourceStepping::Axis axis ) const = 0;
|
||||
virtual std::vector<RimEnsembleCurveSet*> curveSets() const = 0;
|
||||
};
|
@@ -20,13 +20,18 @@
|
||||
|
||||
#include "RiaSummaryStringTools.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMultiPlotCollection.h"
|
||||
#include "RimMultipleSummaryPlotNameHelper.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotNameHelper.h"
|
||||
#include "RimSummaryPlotSourceStepping.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
#include "RiuSummaryVectorSelectionUi.h"
|
||||
@@ -41,7 +46,7 @@ CAF_PDM_SOURCE_INIT( RimSummaryMultiPlot, "MultiSummaryPlot" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryMultiPlot::RimSummaryMultiPlot()
|
||||
{
|
||||
CAF_PDM_InitObject( "Multi Summary Plot Plot", "", "", "" );
|
||||
CAF_PDM_InitObject( "Multi Summary Plot", "", "", "" );
|
||||
this->setDeletable( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_filterText, "FilterText", "Filter Text" );
|
||||
@@ -49,11 +54,24 @@ RimSummaryMultiPlot::RimSummaryMultiPlot()
|
||||
|
||||
CAF_PDM_InitField( &m_individualPlotPerVector, "IndividualPlotPerVector", false, "One plot per Vector" );
|
||||
CAF_PDM_InitField( &m_individualPlotPerDataSource, "IndividualPlotPerDataSource", false, "One plot per Data Source" );
|
||||
CAF_PDM_InitField( &m_autoPlotTitles, "AutoPlotTitles", false, "Auto Plot Titles" );
|
||||
CAF_PDM_InitField( &m_autoPlotTitlesOnSubPlots, "AutoPlotTitlesSubPlots", false, "Auto Plot Titles Sub Plots" );
|
||||
|
||||
CAF_PDM_InitField( &m_showMultiPlotInProjectTree, "ShowMultiPlotInProjectTree", false, "Show Multi Plot In Project Tree" );
|
||||
CAF_PDM_InitField( &m_showMultiPlotInProjectTree, "ShowMultiPlotInProjectTree", true, "Show Multi Plot In Project Tree" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_multiPlot, "MultiPlot", "Multi Plot" );
|
||||
m_multiPlot.uiCapability()->setUiTreeHidden( true );
|
||||
m_multiPlot = new RimMultiPlot;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_sourceStepping, "SourceStepping", "" );
|
||||
m_sourceStepping = new RimSummaryPlotSourceStepping;
|
||||
m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS );
|
||||
m_sourceStepping->setSourceSteppingObject( this );
|
||||
m_sourceStepping.uiCapability()->setUiTreeHidden( true );
|
||||
m_sourceStepping.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_sourceStepping.xmlCapability()->disableIO();
|
||||
|
||||
m_nameHelper = std::make_unique<RimSummaryPlotNameHelper>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -94,7 +112,7 @@ void RimSummaryMultiPlot::zoomAll()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryMultiPlot::description() const
|
||||
{
|
||||
return "RimMultiSummaryPlot Placeholder Text";
|
||||
return "RimSummaryMultiPlot Placeholder Text";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -134,6 +152,96 @@ RimSummaryMultiPlot* RimSummaryMultiPlot::createAndAppendMultiPlot( const std::v
|
||||
return plotWindow;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryDataSourceStepping::Axis> RimSummaryMultiPlot::availableAxes() const
|
||||
{
|
||||
return { RimSummaryDataSourceStepping::Axis::X_AXIS };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RimSummaryMultiPlot::curvesForStepping( RimSummaryDataSourceStepping::Axis axis ) const
|
||||
{
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
|
||||
for ( auto summaryPlot : summaryPlots() )
|
||||
{
|
||||
for ( auto curve : summaryPlot->curvesForStepping( axis ) )
|
||||
{
|
||||
curves.push_back( curve );
|
||||
}
|
||||
}
|
||||
|
||||
return curves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimEnsembleCurveSet*> RimSummaryMultiPlot::curveSets() const
|
||||
{
|
||||
std::vector<RimEnsembleCurveSet*> curveSets;
|
||||
|
||||
for ( auto summaryPlot : summaryPlots() )
|
||||
{
|
||||
for ( auto curveSet : summaryPlot->curveSets() )
|
||||
{
|
||||
curveSets.push_back( curveSet );
|
||||
}
|
||||
}
|
||||
|
||||
return curveSets;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RimSummaryMultiPlot::allCurves( RimSummaryDataSourceStepping::Axis axis ) const
|
||||
{
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
|
||||
for ( auto summaryPlot : summaryPlots() )
|
||||
{
|
||||
for ( auto curve : summaryPlot->allCurves( axis ) )
|
||||
{
|
||||
curves.push_back( curve );
|
||||
}
|
||||
}
|
||||
|
||||
return curves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlot::populateNameHelper( RimSummaryPlotNameHelper* nameHelper )
|
||||
{
|
||||
nameHelper->clear();
|
||||
|
||||
std::vector<RifEclipseSummaryAddress> addresses;
|
||||
std::vector<RimSummaryCase*> sumCases;
|
||||
std::vector<RimSummaryCaseCollection*> ensembleCases;
|
||||
|
||||
for ( RimSummaryCurve* curve : allCurves( RimSummaryDataSourceStepping::Axis::Y_AXIS ) )
|
||||
{
|
||||
addresses.push_back( curve->summaryAddressY() );
|
||||
sumCases.push_back( curve->summaryCaseY() );
|
||||
}
|
||||
|
||||
for ( auto curveSet : curveSets() )
|
||||
{
|
||||
addresses.push_back( curveSet->summaryAddress() );
|
||||
ensembleCases.push_back( curveSet->summaryCaseCollection() );
|
||||
}
|
||||
|
||||
nameHelper->appendAddresses( addresses );
|
||||
nameHelper->setSummaryCases( sumCases );
|
||||
nameHelper->setEnsembleCases( ensembleCases );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -157,6 +265,11 @@ void RimSummaryMultiPlot::onLoadDataAndUpdate()
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
|
||||
if ( m_autoPlotTitles )
|
||||
{
|
||||
updatePlotTitles();
|
||||
}
|
||||
|
||||
m_multiPlot->onLoadDataAndUpdate();
|
||||
}
|
||||
|
||||
@@ -186,10 +299,17 @@ void RimSummaryMultiPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
|
||||
uiOrdering.add( &m_filterText );
|
||||
uiOrdering.add( &m_individualPlotPerVector );
|
||||
uiOrdering.add( &m_individualPlotPerDataSource );
|
||||
uiOrdering.add( &m_autoPlotTitles );
|
||||
uiOrdering.add( &m_autoPlotTitlesOnSubPlots );
|
||||
|
||||
auto group = uiOrdering.addNewGroup( "Multi Plot Options" );
|
||||
m_multiPlot->uiOrderingForSummaryMultiPlot( *group );
|
||||
|
||||
{
|
||||
auto group = uiOrdering.addNewGroup( "Data Source" );
|
||||
m_sourceStepping()->uiOrdering( uiConfigName, *group );
|
||||
}
|
||||
|
||||
uiOrdering.add( &m_showMultiPlotInProjectTree );
|
||||
|
||||
uiOrdering.skipRemainingFields();
|
||||
@@ -219,6 +339,11 @@ void RimSummaryMultiPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
{
|
||||
updatePlots();
|
||||
}
|
||||
else if ( changedField == &m_autoPlotTitles || changedField == &m_autoPlotTitlesOnSubPlots )
|
||||
{
|
||||
onLoadDataAndUpdate();
|
||||
updateLayout();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -274,11 +399,8 @@ void RimSummaryMultiPlot::updatePlots()
|
||||
RiaSummaryStringTools::computeFilteredAddresses( addressFilters, allAddresses, includeDiffCurves );
|
||||
|
||||
{
|
||||
// Remove existing plots
|
||||
|
||||
m_multiPlot->deleteAllPlots();
|
||||
|
||||
// Add new plots
|
||||
RicSummaryPlotBuilder plotBuilder;
|
||||
plotBuilder.setAddresses( filteredAddresses );
|
||||
plotBuilder.setDataSources( matchingSummaryCases, matchingEnsembles );
|
||||
@@ -286,14 +408,7 @@ void RimSummaryMultiPlot::updatePlots()
|
||||
plotBuilder.setIndividualPlotPerDataSource( m_individualPlotPerDataSource );
|
||||
|
||||
auto plots = plotBuilder.createPlots();
|
||||
|
||||
std::vector<RimPlot*> plotsForMultiPlot;
|
||||
for ( auto p : plots )
|
||||
{
|
||||
plotsForMultiPlot.push_back( dynamic_cast<RimPlot*>( p ) );
|
||||
}
|
||||
|
||||
for ( auto plot : plotsForMultiPlot )
|
||||
for ( auto plot : plots )
|
||||
{
|
||||
this->addPlot( plot );
|
||||
|
||||
@@ -302,6 +417,56 @@ void RimSummaryMultiPlot::updatePlots()
|
||||
plot->setShowWindow( true );
|
||||
}
|
||||
|
||||
m_multiPlot->loadDataAndUpdate();
|
||||
onLoadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlot::updatePlotTitles()
|
||||
{
|
||||
populateNameHelper( m_nameHelper.get() );
|
||||
|
||||
auto title = m_nameHelper->plotTitle();
|
||||
m_multiPlot->setMultiPlotTitle( title );
|
||||
|
||||
if ( m_autoPlotTitlesOnSubPlots )
|
||||
{
|
||||
for ( auto plot : summaryPlots() )
|
||||
{
|
||||
auto subPlotNameHelper = plot->plotTitleHelper();
|
||||
|
||||
// Disable auto plot, as this is required to be able to include the information in the multi plot title
|
||||
plot->enableAutoPlotTitle( false );
|
||||
|
||||
auto plotName = subPlotNameHelper->aggregatedPlotTitle( *m_nameHelper.get() );
|
||||
plot->setDescription( plotName );
|
||||
plot->updatePlotTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimSummaryNameHelper* RimSummaryMultiPlot::nameHelper() const
|
||||
{
|
||||
return m_nameHelper.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryPlot*> RimSummaryMultiPlot::summaryPlots() const
|
||||
{
|
||||
std::vector<RimSummaryPlot*> typedPlots;
|
||||
|
||||
for ( auto plot : m_multiPlot->plots() )
|
||||
{
|
||||
auto summaryPlot = dynamic_cast<RimSummaryPlot*>( plot );
|
||||
if ( summaryPlot ) typedPlots.push_back( summaryPlot );
|
||||
}
|
||||
|
||||
return typedPlots;
|
||||
}
|
||||
|
@@ -19,18 +19,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "RimPlotWindow.h"
|
||||
#include "RimSummaryDataSourceStepping.h"
|
||||
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPtrArrayField.h"
|
||||
|
||||
class RimMultiPlot;
|
||||
class RimSummaryPlot;
|
||||
class RimSummaryPlotSourceStepping;
|
||||
class RimSummaryPlotNameHelper;
|
||||
class RimSummaryNameHelper;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimSummaryMultiPlot : public RimPlotWindow
|
||||
class RimSummaryMultiPlot : public RimPlotWindow, public RimSummaryDataSourceStepping
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
@@ -45,8 +50,16 @@ public:
|
||||
|
||||
void addPlot( RimPlot* plot );
|
||||
|
||||
void updatePlotTitles();
|
||||
const RimSummaryNameHelper* nameHelper() const;
|
||||
|
||||
static RimSummaryMultiPlot* createAndAppendMultiPlot( const std::vector<RimPlot*>& plots );
|
||||
|
||||
std::vector<RimSummaryDataSourceStepping::Axis> availableAxes() const override;
|
||||
std::vector<RimSummaryCurve*> curvesForStepping( RimSummaryDataSourceStepping::Axis axis ) const override;
|
||||
std::vector<RimEnsembleCurveSet*> curveSets() const override;
|
||||
std::vector<RimSummaryCurve*> allCurves( RimSummaryDataSourceStepping::Axis axis ) const override;
|
||||
|
||||
private:
|
||||
QWidget* createViewWidget( QWidget* mainWindowParent = nullptr ) override;
|
||||
void deleteViewWidget() override;
|
||||
@@ -65,12 +78,21 @@ private:
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
|
||||
|
||||
void updatePlots();
|
||||
void populateNameHelper( RimSummaryPlotNameHelper* nameHelper );
|
||||
|
||||
std::vector<RimSummaryPlot*> summaryPlots() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_filterText;
|
||||
caf::PdmField<bool> m_individualPlotPerVector;
|
||||
caf::PdmField<bool> m_individualPlotPerDataSource;
|
||||
caf::PdmField<bool> m_autoPlotTitles;
|
||||
caf::PdmField<bool> m_autoPlotTitlesOnSubPlots;
|
||||
|
||||
caf::PdmField<bool> m_showMultiPlotInProjectTree;
|
||||
caf::PdmChildField<RimMultiPlot*> m_multiPlot;
|
||||
|
||||
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_sourceStepping;
|
||||
|
||||
std::unique_ptr<RimSummaryPlotNameHelper> m_nameHelper;
|
||||
};
|
||||
|
@@ -0,0 +1,95 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022 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 "RimSummaryNameHelper.h"
|
||||
|
||||
#include "RiuSummaryQuantityNameInfoProvider.h"
|
||||
#include <QString>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryNameHelper::aggregatedPlotTitle( const RimSummaryNameHelper& other ) const
|
||||
{
|
||||
QString title;
|
||||
|
||||
auto titleCaseName = this->caseName();
|
||||
if ( !other.isCaseInTitle() && !titleCaseName.isEmpty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
|
||||
title += titleCaseName;
|
||||
}
|
||||
|
||||
auto wellName = this->titleWellName();
|
||||
if ( !other.isWellNameInTitle() && !wellName.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += QString::fromStdString( wellName );
|
||||
}
|
||||
|
||||
auto wellGroupName = this->titleWellGroupName();
|
||||
if ( !other.isWellGroupNameInTitle() && !wellGroupName.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += QString::fromStdString( wellGroupName );
|
||||
}
|
||||
|
||||
auto region = this->titleRegion();
|
||||
if ( !other.isRegionInTitle() && !region.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += "Region : " + QString::fromStdString( region );
|
||||
}
|
||||
|
||||
auto block = this->titleBlock();
|
||||
if ( !other.isBlockInTitle() && !block.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += "Block : " + QString::fromStdString( block );
|
||||
}
|
||||
|
||||
auto segment = this->titleSegment();
|
||||
if ( !other.isSegmentInTitle() && !segment.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += "Segment : " + QString::fromStdString( segment );
|
||||
}
|
||||
|
||||
auto completion = this->titleCompletion();
|
||||
if ( !other.isCompletionInTitle() && !completion.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += "Completion : " + QString::fromStdString( completion );
|
||||
}
|
||||
|
||||
auto quantity = this->titleQuantity();
|
||||
if ( !other.isPlotDisplayingSingleQuantity() && !quantity.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += QString::fromStdString(
|
||||
RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( quantity, true ) );
|
||||
}
|
||||
|
||||
if ( title.isEmpty() )
|
||||
{
|
||||
title = "Plot Title";
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022 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 <string>
|
||||
#include <vector>
|
||||
|
||||
class QString;
|
||||
|
||||
class RimSummaryCase;
|
||||
class RimSummaryCaseCollection;
|
||||
class RifEclipseSummaryAddress;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RimSummaryNameHelper
|
||||
{
|
||||
public:
|
||||
virtual QString plotTitle() const = 0;
|
||||
|
||||
QString aggregatedPlotTitle( const RimSummaryNameHelper& summaryMultiPlotNameHelper ) const;
|
||||
|
||||
virtual bool isPlotDisplayingSingleQuantity() const = 0;
|
||||
virtual bool isWellNameInTitle() const = 0;
|
||||
virtual bool isWellGroupNameInTitle() const = 0;
|
||||
virtual bool isRegionInTitle() const = 0;
|
||||
virtual bool isCaseInTitle() const = 0;
|
||||
virtual bool isBlockInTitle() const = 0;
|
||||
virtual bool isSegmentInTitle() const = 0;
|
||||
virtual bool isCompletionInTitle() const = 0;
|
||||
|
||||
virtual QString caseName() const = 0;
|
||||
|
||||
virtual std::string titleQuantity() const = 0;
|
||||
virtual std::string titleWellName() const = 0;
|
||||
virtual std::string titleWellGroupName() const = 0;
|
||||
virtual std::string titleRegion() const = 0;
|
||||
virtual std::string titleBlock() const = 0;
|
||||
virtual std::string titleSegment() const = 0;
|
||||
virtual std::string titleCompletion() const = 0;
|
||||
};
|
@@ -250,6 +250,14 @@ RimSummaryPlot::RimSummaryPlot()
|
||||
|
||||
m_nameHelperAllCurves.reset( new RimSummaryPlotNameHelper );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_sourceStepping, "SourceStepping", "" );
|
||||
m_sourceStepping = new RimSummaryPlotSourceStepping;
|
||||
m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS );
|
||||
m_sourceStepping->setSourceSteppingObject( this );
|
||||
m_sourceStepping.uiCapability()->setUiTreeHidden( true );
|
||||
m_sourceStepping.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_sourceStepping.xmlCapability()->disableIO();
|
||||
|
||||
setPlotInfoLabel( "Filters Active" );
|
||||
}
|
||||
|
||||
@@ -534,6 +542,47 @@ void RimSummaryPlot::moveCurvesToPlot( RimSummaryPlot* plot, const std::vector<R
|
||||
plot->updateStackedCurveData();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RimSummaryPlot::curvesForStepping( RimSummaryDataSourceStepping::Axis axis ) const
|
||||
{
|
||||
auto curveForStepping = summaryCurveCollection()->curveForSourceStepping();
|
||||
if ( curveForStepping )
|
||||
{
|
||||
return { curveForStepping };
|
||||
}
|
||||
|
||||
return summaryCurves();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimEnsembleCurveSet*> RimSummaryPlot::curveSets() const
|
||||
{
|
||||
return ensembleCurveSetCollection()->curveSets();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RimSummaryPlot::allCurves( RimSummaryDataSourceStepping::Axis axis ) const
|
||||
{
|
||||
return summaryCurves();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryDataSourceStepping::Axis> RimSummaryPlot::availableAxes() const
|
||||
{
|
||||
if ( m_isCrossPlot )
|
||||
return { RimSummaryDataSourceStepping::Axis::X_AXIS, RimSummaryDataSourceStepping::Axis::Y_AXIS };
|
||||
|
||||
return { RimSummaryDataSourceStepping::Axis::X_AXIS };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -607,23 +656,16 @@ std::vector<RimSummaryCurve*> RimSummaryPlot::visibleStackedSummaryCurvesForAxis
|
||||
return visibleStackedCurves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimEnsembleCurveSet*> RimSummaryPlot::curveSets() const
|
||||
{
|
||||
return ensembleCurveSetCollection()->curveSets();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updatePlotTitle()
|
||||
{
|
||||
updateNameHelperWithCurveData( m_nameHelperAllCurves.get() );
|
||||
m_nameHelperAllCurves->clear();
|
||||
|
||||
if ( m_useAutoPlotTitle )
|
||||
{
|
||||
updateNameHelperWithCurveData( m_nameHelperAllCurves.get() );
|
||||
m_description = m_nameHelperAllCurves->plotTitle();
|
||||
}
|
||||
|
||||
@@ -642,7 +684,7 @@ void RimSummaryPlot::updatePlotTitle()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimSummaryPlotNameHelper* RimSummaryPlot::activePlotTitleHelperAllCurves() const
|
||||
const RimSummaryNameHelper* RimSummaryPlot::activePlotTitleHelperAllCurves() const
|
||||
{
|
||||
if ( m_useAutoPlotTitle() )
|
||||
{
|
||||
@@ -652,6 +694,14 @@ const RimSummaryPlotNameHelper* RimSummaryPlot::activePlotTitleHelperAllCurves()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimSummaryNameHelper* RimSummaryPlot::plotTitleHelper() const
|
||||
{
|
||||
return m_nameHelperAllCurves.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1885,10 +1935,9 @@ void RimSummaryPlot::onPlotZoomed()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
if ( !m_isCrossPlot )
|
||||
{
|
||||
caf::PdmUiGroup* textCurveFilterGroup = uiOrdering.addNewGroup( "Text-Based Curve Creation" );
|
||||
m_textCurveSetEditor->uiOrdering( uiConfigName, *textCurveFilterGroup );
|
||||
auto group = uiOrdering.addNewGroup( "Data Source" );
|
||||
m_sourceStepping()->uiOrdering( uiConfigName, *group );
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* mainOptions = uiOrdering.addNewGroup( "General Plot Options" );
|
||||
@@ -2204,7 +2253,7 @@ RimSummaryPlotSourceStepping* RimSummaryPlot::sourceSteppingObjectForKeyEventHan
|
||||
}
|
||||
}
|
||||
|
||||
return summaryCurveCollection()->sourceSteppingObject( RimSummaryPlotSourceStepping::Y_AXIS );
|
||||
return summaryCurveCollection()->sourceSteppingObject( RimSummaryDataSourceStepping::Axis::Y_AXIS );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "RimPlot.h"
|
||||
#include "RimSummaryDataSourceStepping.h"
|
||||
|
||||
#include "qwt_plot_textlabel.h"
|
||||
|
||||
@@ -49,6 +50,7 @@ class RimSummaryTimeAxisProperties;
|
||||
class RimPlotAxisPropertiesInterface;
|
||||
class RimPlotAxisProperties;
|
||||
class RiuSummaryQwtPlot;
|
||||
class RimSummaryNameHelper;
|
||||
class RimSummaryPlotNameHelper;
|
||||
class RimPlotTemplateFileItem;
|
||||
class RimSummaryPlotFilterTextCurveSetEditor;
|
||||
@@ -64,7 +66,7 @@ class QKeyEvent;
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimSummaryPlot : public RimPlot
|
||||
class RimSummaryPlot : public RimPlot, public RimSummaryDataSourceStepping
|
||||
{
|
||||
Q_OBJECT;
|
||||
CAF_PDM_HEADER_INIT;
|
||||
@@ -131,13 +133,12 @@ public:
|
||||
void deleteAllSummaryCurves();
|
||||
RimSummaryCurveCollection* summaryCurveCollection() const;
|
||||
|
||||
std::vector<RimEnsembleCurveSet*> curveSets() const;
|
||||
|
||||
void updatePlotTitle();
|
||||
|
||||
const RimSummaryPlotNameHelper* activePlotTitleHelperAllCurves() const;
|
||||
void updateCurveNames();
|
||||
QString generatedPlotTitleFromAllCurves() const;
|
||||
const RimSummaryNameHelper* activePlotTitleHelperAllCurves() const;
|
||||
const RimSummaryNameHelper* plotTitleHelper() const;
|
||||
void updateCurveNames();
|
||||
QString generatedPlotTitleFromAllCurves() const;
|
||||
|
||||
void copyAxisPropertiesFromOther( const RimSummaryPlot& sourceSummaryPlot );
|
||||
|
||||
@@ -178,6 +179,11 @@ public:
|
||||
|
||||
static void moveCurvesToPlot( RimSummaryPlot* plot, const std::vector<RimSummaryCurve*> curves, int insertAtPosition );
|
||||
|
||||
std::vector<RimSummaryDataSourceStepping::Axis> availableAxes() const override;
|
||||
std::vector<RimSummaryCurve*> curvesForStepping( RimSummaryDataSourceStepping::Axis axis ) const override;
|
||||
std::vector<RimEnsembleCurveSet*> curveSets() const override;
|
||||
std::vector<RimSummaryCurve*> allCurves( RimSummaryDataSourceStepping::Axis axis ) const override;
|
||||
|
||||
public:
|
||||
// RimViewWindow overrides
|
||||
void deleteViewWidget() override;
|
||||
@@ -274,5 +280,6 @@ private:
|
||||
|
||||
bool m_isCrossPlot;
|
||||
|
||||
std::unique_ptr<RimSummaryPlotNameHelper> m_nameHelperAllCurves;
|
||||
std::unique_ptr<RimSummaryPlotNameHelper> m_nameHelperAllCurves;
|
||||
caf::PdmChildField<RimSummaryPlotSourceStepping*> m_sourceStepping;
|
||||
};
|
||||
|
@@ -181,16 +181,13 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const
|
||||
{
|
||||
std::map<std::string, std::set<std::string>> unitToQuantityNameMap;
|
||||
|
||||
// clang-format off
|
||||
auto addToUnitToQuantityMap =[&]( const std::string& unitText,
|
||||
const RifEclipseSummaryAddress& sumAddress )
|
||||
{
|
||||
auto addToUnitToQuantityMap = [&]( const std::string& unitText, const RifEclipseSummaryAddress& sumAddress ) {
|
||||
// remove any stats prefix from the quantity name
|
||||
size_t cutPos = sumAddress.quantityName().find(':');
|
||||
if (cutPos == std::string::npos) cutPos = -1;
|
||||
size_t cutPos = sumAddress.quantityName().find( ':' );
|
||||
if ( cutPos == std::string::npos ) cutPos = -1;
|
||||
|
||||
std::string quantityNameForDisplay;
|
||||
const std::string& quantityName = sumAddress.quantityName().substr(cutPos+1);
|
||||
const std::string& quantityName = sumAddress.quantityName().substr( cutPos + 1 );
|
||||
|
||||
if ( sumAddress.category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
{
|
||||
@@ -200,8 +197,12 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const
|
||||
{
|
||||
if ( m_axisProperties->showDescription() )
|
||||
{
|
||||
auto candidateName = quantityName;
|
||||
|
||||
if ( sumAddress.isHistoryQuantity() ) candidateName = quantityName.substr( 0, quantityName.size() - 1 );
|
||||
|
||||
quantityNameForDisplay =
|
||||
RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( quantityName );
|
||||
RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( candidateName );
|
||||
}
|
||||
|
||||
if ( m_axisProperties->showAcronym() )
|
||||
@@ -223,8 +224,6 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const
|
||||
unitToQuantityNameMap[unitText].insert( quantityNameForDisplay );
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
for ( RimSummaryCurve* rimCurve : m_summaryCurves )
|
||||
{
|
||||
RifEclipseSummaryAddress sumAddress;
|
||||
|
@@ -52,6 +52,12 @@
|
||||
#include "cafPdmUiTreeSelectionEditor.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
// Multi plot
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMultiPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimSummaryPlotManager, "RimSummaryPlotManager" );
|
||||
@@ -387,6 +393,17 @@ void RimSummaryPlotManager::createNewPlot()
|
||||
}
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendMultiPlot( plotsForMultiPlot );
|
||||
|
||||
{
|
||||
auto myCopyOfPlots = plotBuilder.createPlots();
|
||||
std::vector<RimPlot*> myRimPlots;
|
||||
for ( auto p : myCopyOfPlots )
|
||||
{
|
||||
p->loadDataAndUpdate();
|
||||
myRimPlots.push_back( dynamic_cast<RimPlot*>( p ) );
|
||||
}
|
||||
RimSummaryMultiPlot::createAndAppendMultiPlot( myRimPlots );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -93,63 +93,9 @@ void RimSummaryPlotNameHelper::setEnsembleCases( const std::vector<RimSummaryCas
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryPlotNameHelper::plotTitle() const
|
||||
{
|
||||
QString title;
|
||||
RimSummaryPlotNameHelper empty;
|
||||
|
||||
if ( !m_titleCaseName.isEmpty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += m_titleCaseName;
|
||||
}
|
||||
|
||||
if ( !m_titleWellName.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += QString::fromStdString( m_titleWellName );
|
||||
}
|
||||
|
||||
if ( !m_titleWellGroupName.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += QString::fromStdString( m_titleWellGroupName );
|
||||
}
|
||||
|
||||
if ( !m_titleRegion.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += "Region : " + QString::fromStdString( m_titleRegion );
|
||||
}
|
||||
|
||||
if ( !m_titleBlock.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += "Block : " + QString::fromStdString( m_titleBlock );
|
||||
}
|
||||
|
||||
if ( !m_titleSegment.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += "Segment : " + QString::fromStdString( m_titleSegment );
|
||||
}
|
||||
|
||||
if ( !m_titleCompletion.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += "Completion : " + QString::fromStdString( m_titleCompletion );
|
||||
}
|
||||
|
||||
if ( !m_titleQuantity.empty() )
|
||||
{
|
||||
if ( !title.isEmpty() ) title += ", ";
|
||||
title += QString::fromStdString(
|
||||
RiuSummaryQuantityNameInfoProvider::instance()->longNameFromQuantityName( m_titleQuantity, true ) );
|
||||
}
|
||||
|
||||
if ( title.isEmpty() )
|
||||
{
|
||||
title = "Composed Plot";
|
||||
}
|
||||
|
||||
return title;
|
||||
return aggregatedPlotTitle( empty );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -216,6 +162,70 @@ bool RimSummaryPlotNameHelper::isCompletionInTitle() const
|
||||
return !m_titleCompletion.empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryPlotNameHelper::caseName() const
|
||||
{
|
||||
return m_titleCaseName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimSummaryPlotNameHelper::titleQuantity() const
|
||||
{
|
||||
return m_titleQuantity;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimSummaryPlotNameHelper::titleWellName() const
|
||||
{
|
||||
return m_titleWellName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimSummaryPlotNameHelper::titleWellGroupName() const
|
||||
{
|
||||
return m_titleWellGroupName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimSummaryPlotNameHelper::titleRegion() const
|
||||
{
|
||||
return m_titleRegion;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimSummaryPlotNameHelper::titleBlock() const
|
||||
{
|
||||
return m_titleBlock;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimSummaryPlotNameHelper::titleSegment() const
|
||||
{
|
||||
return m_titleSegment;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RimSummaryPlotNameHelper::titleCompletion() const
|
||||
{
|
||||
return m_titleCompletion;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -18,8 +18,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaSummaryCurveAnalyzer.h"
|
||||
#include "RimSummaryNameHelper.h"
|
||||
|
||||
#include "RiaSummaryCurveAnalyzer.h"
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
@@ -36,7 +37,7 @@ class RimSummaryCaseCollection;
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RimSummaryPlotNameHelper
|
||||
class RimSummaryPlotNameHelper : public RimSummaryNameHelper
|
||||
{
|
||||
public:
|
||||
RimSummaryPlotNameHelper();
|
||||
@@ -47,16 +48,26 @@ public:
|
||||
void setSummaryCases( const std::vector<RimSummaryCase*>& summaryCases );
|
||||
void setEnsembleCases( const std::vector<RimSummaryCaseCollection*>& ensembleCases );
|
||||
|
||||
QString plotTitle() const;
|
||||
QString plotTitle() const override;
|
||||
|
||||
bool isPlotDisplayingSingleQuantity() const;
|
||||
bool isWellNameInTitle() const;
|
||||
bool isWellGroupNameInTitle() const;
|
||||
bool isRegionInTitle() const;
|
||||
bool isCaseInTitle() const;
|
||||
bool isBlockInTitle() const;
|
||||
bool isSegmentInTitle() const;
|
||||
bool isCompletionInTitle() const;
|
||||
bool isPlotDisplayingSingleQuantity() const override;
|
||||
bool isWellNameInTitle() const override;
|
||||
bool isWellGroupNameInTitle() const override;
|
||||
bool isRegionInTitle() const override;
|
||||
bool isCaseInTitle() const override;
|
||||
bool isBlockInTitle() const override;
|
||||
bool isSegmentInTitle() const override;
|
||||
bool isCompletionInTitle() const override;
|
||||
|
||||
QString caseName() const override;
|
||||
|
||||
std::string titleQuantity() const override;
|
||||
std::string titleWellName() const override;
|
||||
std::string titleWellGroupName() const override;
|
||||
std::string titleRegion() const override;
|
||||
std::string titleBlock() const override;
|
||||
std::string titleSegment() const override;
|
||||
std::string titleCompletion() const override;
|
||||
|
||||
private:
|
||||
void clearTitleSubStrings();
|
||||
|
@@ -23,8 +23,6 @@
|
||||
#include "RiaSummaryCurveAnalyzer.h"
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RimDataSourceSteppingTools.h"
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
@@ -34,6 +32,8 @@
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryDataSourceStepping.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
@@ -49,7 +49,7 @@ CAF_PDM_SOURCE_INIT( RimSummaryPlotSourceStepping, "RimSummaryCurveCollectionMod
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
|
||||
: m_sourceSteppingType( Y_AXIS )
|
||||
: m_sourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS )
|
||||
{
|
||||
CAF_PDM_InitObject( "Summary Curves Modifier" );
|
||||
|
||||
@@ -84,11 +84,19 @@ RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::setSourceSteppingType( SourceSteppingType sourceSteppingType )
|
||||
void RimSummaryPlotSourceStepping::setSourceSteppingType( RimSummaryDataSourceStepping::Axis sourceSteppingType )
|
||||
{
|
||||
m_sourceSteppingType = sourceSteppingType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotSourceStepping::setSourceSteppingObject( caf::PdmObject* sourceObject )
|
||||
{
|
||||
m_objectForSourceStepping = sourceObject;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -353,24 +361,19 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
const QVariant& newValue )
|
||||
{
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( curveCollection );
|
||||
if ( curveCollection )
|
||||
{
|
||||
curves = curveCollection->curves();
|
||||
}
|
||||
|
||||
RimEnsembleCurveSetCollection* ensembleCurveColl = nullptr;
|
||||
this->firstAncestorOrThisOfType( ensembleCurveColl );
|
||||
if ( dataSourceSteppingObject() ) curves = dataSourceSteppingObject()->allCurves( m_sourceSteppingType );
|
||||
|
||||
if ( changedField == &m_includeEnsembleCasesForCaseStepping )
|
||||
{
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( curveCollection );
|
||||
if ( curveCollection )
|
||||
{
|
||||
curveCollection->updateConnectedEditors();
|
||||
}
|
||||
|
||||
RimEnsembleCurveSetCollection* ensembleCurveColl = nullptr;
|
||||
this->firstAncestorOrThisOfType( ensembleCurveColl );
|
||||
if ( ensembleCurveColl )
|
||||
{
|
||||
ensembleCurveColl->updateConnectedEditors();
|
||||
@@ -422,12 +425,12 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
}
|
||||
else if ( changedField == &m_ensemble )
|
||||
{
|
||||
if ( m_ensemble() && ensembleCurveColl )
|
||||
if ( m_ensemble() && dataSourceSteppingObject() )
|
||||
{
|
||||
caf::PdmPointer<caf::PdmObjectHandle> variantHandle = oldValue.value<caf::PdmPointer<caf::PdmObjectHandle>>();
|
||||
RimSummaryCaseCollection* previousCollection = dynamic_cast<RimSummaryCaseCollection*>( variantHandle.p() );
|
||||
|
||||
for ( auto curveSet : ensembleCurveColl->curveSets() )
|
||||
for ( auto curveSet : dataSourceSteppingObject()->curveSets() )
|
||||
{
|
||||
if ( curveSet->summaryCaseCollection() == previousCollection )
|
||||
{
|
||||
@@ -450,24 +453,24 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
if ( isYAxisStepping() )
|
||||
{
|
||||
auto adr = curve->summaryAddressY();
|
||||
updateHistoryAndSummaryQuantityIfMatching( oldValue, newValue, &adr );
|
||||
RimDataSourceSteppingTools::updateHistoryAndSummaryQuantityIfMatching( oldValue, newValue, &adr );
|
||||
curve->setSummaryAddressY( adr );
|
||||
}
|
||||
|
||||
if ( isXAxisStepping() )
|
||||
{
|
||||
auto adr = curve->summaryAddressX();
|
||||
updateHistoryAndSummaryQuantityIfMatching( oldValue, newValue, &adr );
|
||||
RimDataSourceSteppingTools::updateHistoryAndSummaryQuantityIfMatching( oldValue, newValue, &adr );
|
||||
curve->setSummaryAddressX( adr );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ensembleCurveColl )
|
||||
if ( dataSourceSteppingObject() )
|
||||
{
|
||||
for ( auto curveSet : ensembleCurveColl->curveSets() )
|
||||
for ( auto curveSet : dataSourceSteppingObject()->curveSets() )
|
||||
{
|
||||
auto adr = curveSet->summaryAddress();
|
||||
updateHistoryAndSummaryQuantityIfMatching( oldValue, newValue, &adr );
|
||||
RimDataSourceSteppingTools::updateHistoryAndSummaryQuantityIfMatching( oldValue, newValue, &adr );
|
||||
curveSet->setSummaryAddress( adr );
|
||||
}
|
||||
}
|
||||
@@ -513,24 +516,24 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
if ( isYAxisStepping() )
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressY();
|
||||
updateAddressIfMatching( oldValue, newValue, summaryCategoryToModify, &adr );
|
||||
RimDataSourceSteppingTools::updateAddressIfMatching( oldValue, newValue, summaryCategoryToModify, &adr );
|
||||
curve->setSummaryAddressY( adr );
|
||||
}
|
||||
|
||||
if ( isXAxisStepping() )
|
||||
{
|
||||
RifEclipseSummaryAddress adr = curve->summaryAddressX();
|
||||
updateAddressIfMatching( oldValue, newValue, summaryCategoryToModify, &adr );
|
||||
RimDataSourceSteppingTools::updateAddressIfMatching( oldValue, newValue, summaryCategoryToModify, &adr );
|
||||
curve->setSummaryAddressX( adr );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ensembleCurveColl )
|
||||
if ( dataSourceSteppingObject() )
|
||||
{
|
||||
for ( auto curveSet : ensembleCurveColl->curveSets() )
|
||||
for ( auto curveSet : dataSourceSteppingObject()->curveSets() )
|
||||
{
|
||||
auto adr = curveSet->summaryAddress();
|
||||
updateAddressIfMatching( oldValue, newValue, summaryCategoryToModify, &adr );
|
||||
RimDataSourceSteppingTools::updateAddressIfMatching( oldValue, newValue, summaryCategoryToModify, &adr );
|
||||
curveSet->setSummaryAddress( adr );
|
||||
}
|
||||
}
|
||||
@@ -542,12 +545,22 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
if ( triggerLoadDataAndUpdate )
|
||||
{
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted( summaryPlot );
|
||||
this->firstAncestorOrThisOfType( summaryPlot );
|
||||
if ( summaryPlot )
|
||||
{
|
||||
summaryPlot->updatePlotTitle();
|
||||
summaryPlot->loadDataAndUpdate();
|
||||
summaryPlot->updateConnectedEditors();
|
||||
}
|
||||
|
||||
summaryPlot->updatePlotTitle();
|
||||
summaryPlot->loadDataAndUpdate();
|
||||
summaryPlot->updateConnectedEditors();
|
||||
RimSummaryMultiPlot* summaryMultiPlot = dynamic_cast<RimSummaryMultiPlot*>( m_objectForSourceStepping.p() );
|
||||
if ( summaryMultiPlot )
|
||||
{
|
||||
summaryMultiPlot->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
RimEnsembleCurveSetCollection* ensembleCurveColl = nullptr;
|
||||
this->firstAncestorOrThisOfType( ensembleCurveColl );
|
||||
if ( ensembleCurveColl )
|
||||
{
|
||||
ensembleCurveColl->updateConnectedEditors();
|
||||
@@ -558,6 +571,8 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
{
|
||||
// Trigger update of curve collection (and summary toolbar in main window), as the visibility of combo
|
||||
// boxes might have been changed due to the updates in this function
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( curveCollection );
|
||||
if ( curveCollection )
|
||||
{
|
||||
curveCollection->updateConnectedEditors();
|
||||
@@ -617,43 +632,35 @@ std::set<RifEclipseSummaryAddress> RimSummaryPlotSourceStepping::adressesForSour
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress> addressSet;
|
||||
|
||||
if ( dataSourceSteppingObject() )
|
||||
{
|
||||
RimEnsembleCurveSetCollection* ensembleCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( ensembleCollection );
|
||||
if ( ensembleCollection )
|
||||
for ( auto curveSet : dataSourceSteppingObject()->curveSets() )
|
||||
{
|
||||
auto curveSets = ensembleCollection->curveSetsForSourceStepping();
|
||||
for ( const RimEnsembleCurveSet* curveSet : curveSets )
|
||||
if ( curveSet && curveSet->summaryCaseCollection() )
|
||||
{
|
||||
if ( curveSet && curveSet->summaryCaseCollection() )
|
||||
{
|
||||
auto addresses = curveSet->summaryCaseCollection()->ensembleSummaryAddresses();
|
||||
addressSet.insert( addresses.begin(), addresses.end() );
|
||||
}
|
||||
auto addresses = curveSet->summaryCaseCollection()->ensembleSummaryAddresses();
|
||||
addressSet.insert( addresses.begin(), addresses.end() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( curveCollection );
|
||||
if ( curveCollection )
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
if ( dataSourceSteppingObject() )
|
||||
curves = dataSourceSteppingObject()->curvesForStepping( m_sourceSteppingType );
|
||||
|
||||
for ( auto curve : curves )
|
||||
{
|
||||
for ( auto curve : curveCollection->curvesForSourceStepping( m_sourceSteppingType ) )
|
||||
if ( !curve ) continue;
|
||||
|
||||
if ( isYAxisStepping() && curve->summaryCaseY() && curve->summaryCaseY()->summaryReader() )
|
||||
{
|
||||
if ( !curve ) continue;
|
||||
auto addresses = curve->summaryCaseY()->summaryReader()->allResultAddresses();
|
||||
addressSet.insert( addresses.begin(), addresses.end() );
|
||||
}
|
||||
|
||||
if ( isYAxisStepping() && curve->summaryCaseY() && curve->summaryCaseY()->summaryReader() )
|
||||
{
|
||||
auto addresses = curve->summaryCaseY()->summaryReader()->allResultAddresses();
|
||||
addressSet.insert( addresses.begin(), addresses.end() );
|
||||
}
|
||||
|
||||
if ( isXAxisStepping() && curve->summaryCaseX() && curve->summaryCaseX()->summaryReader() )
|
||||
{
|
||||
auto addresses = curve->summaryCaseX()->summaryReader()->allResultAddresses();
|
||||
addressSet.insert( addresses.begin(), addresses.end() );
|
||||
}
|
||||
if ( isXAxisStepping() && curve->summaryCaseX() && curve->summaryCaseX()->summaryReader() )
|
||||
{
|
||||
auto addresses = curve->summaryCaseX()->summaryReader()->allResultAddresses();
|
||||
addressSet.insert( addresses.begin(), addresses.end() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -668,32 +675,27 @@ std::set<RifEclipseSummaryAddress> RimSummaryPlotSourceStepping::addressesForCur
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress> addresses;
|
||||
|
||||
RimEnsembleCurveSetCollection* ensembleCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( ensembleCollection );
|
||||
if ( ensembleCollection )
|
||||
if ( dataSourceSteppingObject() )
|
||||
{
|
||||
auto curveSets = ensembleCollection->curveSetsForSourceStepping();
|
||||
for ( const RimEnsembleCurveSet* curveSet : curveSets )
|
||||
for ( auto curveSet : dataSourceSteppingObject()->curveSets() )
|
||||
{
|
||||
addresses.insert( curveSet->summaryAddress() );
|
||||
}
|
||||
}
|
||||
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( curveCollection );
|
||||
if ( curveCollection )
|
||||
{
|
||||
auto curves = curveCollection->curvesForSourceStepping( m_sourceSteppingType );
|
||||
for ( auto c : curves )
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
if ( dataSourceSteppingObject() )
|
||||
curves = dataSourceSteppingObject()->curvesForStepping( m_sourceSteppingType );
|
||||
|
||||
for ( auto curve : curves )
|
||||
{
|
||||
if ( isYAxisStepping() )
|
||||
{
|
||||
addresses.insert( c->summaryAddressY() );
|
||||
addresses.insert( curve->summaryAddressY() );
|
||||
}
|
||||
|
||||
if ( isXAxisStepping() )
|
||||
{
|
||||
addresses.insert( c->summaryAddressX() );
|
||||
addresses.insert( curve->summaryAddressX() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -708,12 +710,8 @@ std::set<RimSummaryCase*> RimSummaryPlotSourceStepping::summaryCasesCurveCollect
|
||||
{
|
||||
std::set<RimSummaryCase*> sumCases;
|
||||
|
||||
RimSummaryCurveCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( curveCollection );
|
||||
|
||||
if ( !curveCollection ) return sumCases;
|
||||
|
||||
auto curves = curveCollection->curvesForSourceStepping( m_sourceSteppingType );
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
if ( dataSourceSteppingObject() ) curves = dataSourceSteppingObject()->curvesForStepping( m_sourceSteppingType );
|
||||
for ( auto c : curves )
|
||||
{
|
||||
if ( isYAxisStepping() )
|
||||
@@ -900,20 +898,20 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::computeVisibleFi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RimSummaryCaseCollection*> RimSummaryPlotSourceStepping::ensembleCollection() const
|
||||
{
|
||||
std::set<RimSummaryCaseCollection*> sumCases;
|
||||
std::set<RimSummaryCaseCollection*> summaryCaseCollections;
|
||||
|
||||
RimEnsembleCurveSetCollection* curveCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( curveCollection );
|
||||
|
||||
if ( !curveCollection ) return sumCases;
|
||||
|
||||
auto curves = curveCollection->curveSets();
|
||||
for ( auto c : curves )
|
||||
if ( dataSourceSteppingObject() )
|
||||
{
|
||||
sumCases.insert( c->summaryCaseCollection() );
|
||||
for ( auto curveSet : dataSourceSteppingObject()->curveSets() )
|
||||
{
|
||||
if ( curveSet && curveSet->summaryCaseCollection() )
|
||||
{
|
||||
summaryCaseCollections.insert( curveSet->summaryCaseCollection() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sumCases;
|
||||
return summaryCaseCollections;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -921,9 +919,9 @@ std::set<RimSummaryCaseCollection*> RimSummaryPlotSourceStepping::ensembleCollec
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlotSourceStepping::isXAxisStepping() const
|
||||
{
|
||||
if ( m_sourceSteppingType == UNION_X_Y_AXIS ) return true;
|
||||
if ( m_sourceSteppingType == RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ) return true;
|
||||
|
||||
if ( m_sourceSteppingType == X_AXIS ) return true;
|
||||
if ( m_sourceSteppingType == RimSummaryDataSourceStepping::Axis::X_AXIS ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -933,31 +931,13 @@ bool RimSummaryPlotSourceStepping::isXAxisStepping() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlotSourceStepping::isYAxisStepping() const
|
||||
{
|
||||
if ( m_sourceSteppingType == UNION_X_Y_AXIS ) return true;
|
||||
if ( m_sourceSteppingType == RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ) return true;
|
||||
|
||||
if ( m_sourceSteppingType == Y_AXIS ) return true;
|
||||
if ( m_sourceSteppingType == RimSummaryDataSourceStepping::Axis::Y_AXIS ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaSummaryCurveAnalyzer* RimSummaryPlotSourceStepping::analyzerForReader( RifSummaryReaderInterface* reader )
|
||||
{
|
||||
if ( !reader ) return nullptr;
|
||||
|
||||
if ( m_curveAnalyzerForReader.first != reader )
|
||||
{
|
||||
RiaSummaryCurveAnalyzer analyzer;
|
||||
m_curveAnalyzerForReader = std::make_pair( reader, analyzer );
|
||||
}
|
||||
|
||||
m_curveAnalyzerForReader.second.appendAddresses( reader->allResultAddresses() );
|
||||
|
||||
return &m_curveAnalyzerForReader.second;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -968,123 +948,6 @@ void RimSummaryPlotSourceStepping::modifyCurrentIndex( caf::PdmValueField* value
|
||||
RimDataSourceSteppingTools::modifyCurrentIndex( valueField, options, indexOffset );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlotSourceStepping::updateAddressIfMatching( const QVariant& oldValue,
|
||||
const QVariant& newValue,
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||
RifEclipseSummaryAddress* adr )
|
||||
{
|
||||
if ( !adr ) return false;
|
||||
|
||||
if ( category == RifEclipseSummaryAddress::SUMMARY_REGION )
|
||||
{
|
||||
int oldInt = oldValue.toInt();
|
||||
int newInt = newValue.toInt();
|
||||
|
||||
if ( adr->regionNumber() == oldInt )
|
||||
{
|
||||
adr->setRegion( newInt );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_AQUIFER )
|
||||
{
|
||||
int oldInt = oldValue.toInt();
|
||||
int newInt = newValue.toInt();
|
||||
|
||||
if ( adr->aquiferNumber() == oldInt )
|
||||
{
|
||||
adr->setAquiferNumber( newInt );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP )
|
||||
{
|
||||
std::string oldString = oldValue.toString().toStdString();
|
||||
std::string newString = newValue.toString().toStdString();
|
||||
|
||||
if ( adr->wellGroupName() == oldString )
|
||||
{
|
||||
adr->setWellGroupName( newString );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL )
|
||||
{
|
||||
std::string oldString = oldValue.toString().toStdString();
|
||||
std::string newString = newValue.toString().toStdString();
|
||||
|
||||
if ( adr->wellName() == oldString )
|
||||
{
|
||||
adr->setWellName( newString );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_BLOCK ||
|
||||
category == RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION )
|
||||
{
|
||||
std::string oldString = oldValue.toString().toStdString();
|
||||
std::string newString = newValue.toString().toStdString();
|
||||
if ( adr->blockAsString() == oldString )
|
||||
{
|
||||
adr->setCellIjk( newString );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT )
|
||||
{
|
||||
int oldInt = oldValue.toInt();
|
||||
int newInt = newValue.toInt();
|
||||
if ( adr->wellSegmentNumber() == oldInt )
|
||||
{
|
||||
adr->setWellSegmentNumber( newInt );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlotSourceStepping::updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue,
|
||||
const QVariant& newValue,
|
||||
RifEclipseSummaryAddress* adr )
|
||||
{
|
||||
if ( !adr ) return false;
|
||||
|
||||
std::string oldString = oldValue.toString().toStdString();
|
||||
std::string newString = newValue.toString().toStdString();
|
||||
|
||||
if ( adr->quantityName() == oldString )
|
||||
{
|
||||
adr->setQuantityName( newString );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string correspondingOldString = RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName( oldString );
|
||||
std::string correspondingNewString = RiaSummaryCurveAnalyzer::correspondingHistorySummaryCurveName( newString );
|
||||
|
||||
if ( adr->quantityName() == correspondingOldString )
|
||||
{
|
||||
adr->setQuantityName( correspondingNewString );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1116,6 +979,14 @@ std::vector<RimSummaryCase*> RimSummaryPlotSourceStepping::summaryCasesForSource
|
||||
return cases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryDataSourceStepping* RimSummaryPlotSourceStepping::dataSourceSteppingObject() const
|
||||
{
|
||||
return dynamic_cast<RimSummaryDataSourceStepping*>( m_objectForSourceStepping.p() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -18,8 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaSummaryCurveAnalyzer.h"
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RimSummaryDataSourceStepping.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
@@ -34,6 +33,7 @@ class RimSummaryCase;
|
||||
class RimSummaryCurve;
|
||||
class RifSummaryReaderInterface;
|
||||
class RimSummaryCaseCollection;
|
||||
class RifEclipseSummaryAddress;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -42,18 +42,11 @@ class RimSummaryPlotSourceStepping : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum SourceSteppingType
|
||||
{
|
||||
Y_AXIS,
|
||||
X_AXIS,
|
||||
UNION_X_Y_AXIS
|
||||
};
|
||||
|
||||
public:
|
||||
RimSummaryPlotSourceStepping();
|
||||
|
||||
void setSourceSteppingType( SourceSteppingType sourceSteppingType );
|
||||
void setSourceSteppingType( RimSummaryDataSourceStepping::Axis sourceSteppingType );
|
||||
void setSourceSteppingObject( caf::PdmObject* sourceObject );
|
||||
|
||||
void applyNextCase();
|
||||
void applyPrevCase();
|
||||
@@ -91,22 +84,15 @@ private:
|
||||
bool isXAxisStepping() const;
|
||||
bool isYAxisStepping() const;
|
||||
|
||||
RiaSummaryCurveAnalyzer* analyzerForReader( RifSummaryReaderInterface* reader );
|
||||
|
||||
void modifyCurrentIndex( caf::PdmValueField* valueField, int indexOffset );
|
||||
|
||||
static bool updateAddressIfMatching( const QVariant& oldValue,
|
||||
const QVariant& newValue,
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||
RifEclipseSummaryAddress* adr );
|
||||
|
||||
static bool updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue,
|
||||
const QVariant& newValue,
|
||||
RifEclipseSummaryAddress* adr );
|
||||
|
||||
std::vector<RimSummaryCase*> summaryCasesForSourceStepping();
|
||||
|
||||
RimSummaryDataSourceStepping* dataSourceSteppingObject() const;
|
||||
|
||||
private:
|
||||
caf::PdmPointer<caf::PdmObject> m_objectForSourceStepping;
|
||||
|
||||
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
|
||||
caf::PdmPtrField<RimSummaryCaseCollection*> m_ensemble;
|
||||
|
||||
@@ -124,7 +110,5 @@ private:
|
||||
|
||||
caf::PdmField<bool> m_includeEnsembleCasesForCaseStepping;
|
||||
|
||||
SourceSteppingType m_sourceSteppingType;
|
||||
|
||||
std::pair<RifSummaryReaderInterface*, RiaSummaryCurveAnalyzer> m_curveAnalyzerForReader;
|
||||
RimSummaryDataSourceStepping::Axis m_sourceSteppingType;
|
||||
};
|
||||
|
Reference in New Issue
Block a user