diff --git a/ApplicationLibCode/Application/CMakeLists_files.cmake b/ApplicationLibCode/Application/CMakeLists_files.cmake index d32c5e561f..ed89dbc257 100644 --- a/ApplicationLibCode/Application/CMakeLists_files.cmake +++ b/ApplicationLibCode/Application/CMakeLists_files.cmake @@ -34,6 +34,7 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.h ${CMAKE_CURRENT_LIST_DIR}/RiaLasDefines.h ${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.h + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.h ) set(SOURCE_GROUP_SOURCE_FILES @@ -72,6 +73,7 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaSeismicDefines.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaLasDefines.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.cpp ) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) diff --git a/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp b/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp new file mode 100644 index 0000000000..aedcbf31b8 --- /dev/null +++ b/ApplicationLibCode/Application/RiaSummaryCurveAddress.cpp @@ -0,0 +1,53 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2023 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RiaSummaryCurveAddress.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaSummaryCurveAddress::RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressX, const RifEclipseSummaryAddress& summaryAddressY ) + : m_summaryAddressX( summaryAddressX ) + , m_summaryAddressY( summaryAddressY ) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaSummaryCurveAddress::RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressY ) + : m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() ) + , m_summaryAddressY( summaryAddressY ) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseSummaryAddress RiaSummaryCurveAddress::summaryAddressX() const +{ + return m_summaryAddressX; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseSummaryAddress RiaSummaryCurveAddress::summaryAddressY() const +{ + return m_summaryAddressY; +} diff --git a/ApplicationLibCode/Application/RiaSummaryCurveAddress.h b/ApplicationLibCode/Application/RiaSummaryCurveAddress.h new file mode 100644 index 0000000000..fd13a97e78 --- /dev/null +++ b/ApplicationLibCode/Application/RiaSummaryCurveAddress.h @@ -0,0 +1,40 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2023 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RifEclipseSummaryAddress.h" + +//================================================================================================== +/// +//================================================================================================== +class RiaSummaryCurveAddress +{ +public: + explicit RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressY ); + explicit RiaSummaryCurveAddress( const RifEclipseSummaryAddress& summaryAddressX, const RifEclipseSummaryAddress& summaryAddressY ); + + RifEclipseSummaryAddress summaryAddressX() const; + RifEclipseSummaryAddress summaryAddressY() const; + + auto operator<=>( const RiaSummaryCurveAddress& rhs ) const = default; + +private: + RifEclipseSummaryAddress m_summaryAddressX; + RifEclipseSummaryAddress m_summaryAddressY; +}; diff --git a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp index 4c15df4673..807335c7aa 100644 --- a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp +++ b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp @@ -17,8 +17,10 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RiaSummaryCurveDefinition.h" +#include "RiaStdStringTools.h" #include "RifSummaryReaderInterface.h" + #include "RimSummaryCase.h" #include "RimSummaryCaseCollection.h" @@ -29,6 +31,8 @@ //-------------------------------------------------------------------------------------------------- RiaSummaryCurveDefinition::RiaSummaryCurveDefinition() : m_summaryCase( nullptr ) + , m_summaryCaseX( nullptr ) + , m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() ) , m_ensemble( nullptr ) , m_isEnsembleCurve( false ) { @@ -42,6 +46,8 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase* bool isEnsembleCurve ) : m_summaryCase( summaryCase ) , m_summaryAddress( summaryAddress ) + , m_summaryCaseX( nullptr ) + , m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() ) , m_ensemble( nullptr ) , m_isEnsembleCurve( isEnsembleCurve ) { @@ -53,6 +59,8 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase* RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress ) : m_summaryCase( nullptr ) , m_summaryAddress( summaryAddress ) + , m_summaryCaseX( nullptr ) + , m_summaryAddressX( RifEclipseSummaryAddress::timeAddress() ) , m_ensemble( ensemble ) , m_isEnsembleCurve( true ) { @@ -98,6 +106,71 @@ void RiaSummaryCurveDefinition::setSummaryAddress( const RifEclipseSummaryAddres m_summaryAddress = address; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryCurveDefinition::setSummaryCaseX( RimSummaryCase* summaryCase ) +{ + m_summaryCaseX = summaryCase; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryCurveDefinition::setSummaryAddressX( const RifEclipseSummaryAddress& summaryAddress ) +{ + m_summaryAddressX = summaryAddress; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimSummaryCase* RiaSummaryCurveDefinition::summaryCaseX() const +{ + return m_summaryCaseX; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseSummaryAddress RiaSummaryCurveDefinition::summaryAddressX() const +{ + return m_summaryAddressX; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryCurveDefinition::setIdentifierText( SummaryCategory category, const std::string& name ) +{ + if ( RifEclipseSummaryAddress::isDependentOnWellName( category ) ) + { + m_summaryAddress.setWellName( name ); + m_summaryAddressX.setWellName( name ); + } + + int id = RiaStdStringTools::toInt( name ); + + switch ( category ) + { + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER: + m_summaryAddress.setAquiferNumber( id ); + m_summaryAddressX.setAquiferNumber( id ); + break; + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION: + m_summaryAddress.setRegion( id ); + m_summaryAddressX.setRegion( id ); + break; + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: + m_summaryAddress.setGroupName( name ); + m_summaryAddressX.setGroupName( name ); + break; + default: + break; + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h index 598b54803f..ccdfb82a12 100644 --- a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h +++ b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h @@ -19,6 +19,7 @@ #pragma once #include "RifEclipseSummaryAddress.h" +#include "RifEclipseSummaryAddressDefines.h" #include @@ -40,12 +41,21 @@ class RiaSummaryCurveDefinition explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& summaryAddress, bool isEnsembleCurve ); explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress ); + // Y Axis RimSummaryCase* summaryCase() const; const RifEclipseSummaryAddress& summaryAddress() const; RimSummaryCaseCollection* ensemble() const; bool isEnsembleCurve() const; void setSummaryAddress( const RifEclipseSummaryAddress& address ); + // X Axis + void setSummaryCaseX( RimSummaryCase* summaryCase ); + void setSummaryAddressX( const RifEclipseSummaryAddress& summaryAddress ); + RimSummaryCase* summaryCaseX() const; + RifEclipseSummaryAddress summaryAddressX() const; + + void setIdentifierText( SummaryCategory category, const std::string& name ); + bool operator<( const RiaSummaryCurveDefinition& other ) const; // TODO: Consider moving to a separate tools class @@ -59,6 +69,8 @@ class RiaSummaryCurveDefinition private: RimSummaryCase* m_summaryCase; RifEclipseSummaryAddress m_summaryAddress; + RimSummaryCase* m_summaryCaseX; + RifEclipseSummaryAddress m_summaryAddressX; RimSummaryCaseCollection* m_ensemble; bool m_isEnsembleCurve; }; diff --git a/ApplicationLibCode/Application/RiaSummaryDefines.cpp b/ApplicationLibCode/Application/RiaSummaryDefines.cpp index 7efa9c8293..ca10038193 100644 --- a/ApplicationLibCode/Application/RiaSummaryDefines.cpp +++ b/ApplicationLibCode/Application/RiaSummaryDefines.cpp @@ -17,6 +17,18 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RiaSummaryDefines.h" +#include "cafAppEnum.h" + +namespace caf +{ +template <> +void caf::AppEnum::setUp() +{ + addItem( RiaDefines::HorizontalAxisType::TIME, "TIME", "Time" ); + addItem( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR, "SUMMARY_VECTOR", "Summary Vector" ); + setDefault( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); +} +} // namespace caf //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationLibCode/Application/RiaSummaryDefines.h b/ApplicationLibCode/Application/RiaSummaryDefines.h index 1559fee019..3429c423a3 100644 --- a/ApplicationLibCode/Application/RiaSummaryDefines.h +++ b/ApplicationLibCode/Application/RiaSummaryDefines.h @@ -29,6 +29,12 @@ enum class FileType STIMPLAN_SUMMARY }; +enum class HorizontalAxisType +{ + TIME, + SUMMARY_VECTOR +}; + QString summaryField(); QString summaryAquifer(); QString summaryNetwork(); diff --git a/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.cpp b/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.cpp index 331a8837a5..33aeb9086b 100644 --- a/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.cpp +++ b/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.cpp @@ -55,9 +55,9 @@ void RiaOptionItemFactory::appendOptionItemsForEnsembleCurveSets( QList::uiText( summaryType ); + auto uiText = caf::AppEnum::uiText( summaryType ); // Use icons from https://github.com/equinor/webviz-subsurface-components @@ -65,55 +65,55 @@ caf::PdmOptionItemInfo RiaOptionItemFactory::optionItemFromSummaryType( RifEclip switch ( summaryType ) { - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID: iconText = ":/summary/components/images/invalid.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD: iconText = ":/summary/components/images/field.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER: iconText = ":/summary/components/images/aquifer.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK: iconText = ":/summary/components/images/network.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC: iconText = ":/summary/components/images/misc.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION: iconText = ":/summary/components/images/region.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION: iconText = ":/summary/components/images/region-region.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: iconText = ":/summary/components/images/group.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL: iconText = ":/summary/components/images/well.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION: iconText = ":/summary/components/images/well-completion.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR: iconText = ":/summary/components/images/well.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: iconText = ":/summary/components/images/well-completion.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT: iconText = ":/summary/components/images/segment.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK: iconText = ":/summary/components/images/block.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR: iconText = ":/summary/components/images/block.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED: iconText = ":/summary/components/images/others.svg"; break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS: break; } diff --git a/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.h b/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.h index 77a788aa80..4fdf552330 100644 --- a/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.h +++ b/ApplicationLibCode/Application/Tools/RiaOptionItemFactory.h @@ -31,5 +31,5 @@ class RiaOptionItemFactory public: static void appendOptionItemFromViewNameAndCaseName( Rim3dView* view, QList* optionItems ); static void appendOptionItemsForEnsembleCurveSets( QList* options ); - static caf::PdmOptionItemInfo optionItemFromSummaryType( RifEclipseSummaryAddressDefines::SummaryVarCategory summaryType ); + static caf::PdmOptionItemInfo optionItemFromSummaryType( RifEclipseSummaryAddressDefines::SummaryCategory summaryType ); }; diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp index d614b56956..664fea76df 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.cpp @@ -32,11 +32,13 @@ using namespace RifEclipseSummaryAddressDefines; /// //-------------------------------------------------------------------------------------------------- RiaSummaryAddressAnalyzer::RiaSummaryAddressAnalyzer() + : m_onlyCrossPlotCurves( false ) { } //-------------------------------------------------------------------------------------------------- /// +// //-------------------------------------------------------------------------------------------------- void RiaSummaryAddressAnalyzer::appendAddresses( const std::vector& allAddresses ) { @@ -57,6 +59,23 @@ void RiaSummaryAddressAnalyzer::appendAddresses( const std::set& addresses ) +{ + // RiaSummaryCurveAddress can be used to represent cross plot curves. Set the flag m_onlyCrossPlotCurves to true, and this will be set + // to false in analyzeSingleAddress if we detect a time curve + + m_onlyCrossPlotCurves = true; + + for ( const auto& adr : addresses ) + { + analyzeSingleAddress( adr.summaryAddressX() ); + analyzeSingleAddress( adr.summaryAddressY() ); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -100,6 +119,14 @@ bool RiaSummaryAddressAnalyzer::isSingleQuantityIgnoreHistory() const return false; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaSummaryAddressAnalyzer::onlyCrossPlotCurves() const +{ + return m_onlyCrossPlotCurves; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -110,6 +137,20 @@ std::string RiaSummaryAddressAnalyzer::quantityNameForTitle() const return *quantities().begin(); } + if ( quantities().size() == 2 && m_onlyCrossPlotCurves ) + { + // We have a cross plot with only one curve + + std::string title; + for ( const auto& quantity : quantities() ) + { + if ( !title.empty() ) title += " | "; + title += quantity; + } + + return title; + } + if ( quantities().size() == 2 && quantityNamesWithHistory().size() == 1 ) { return *quantityNamesWithHistory().begin(); @@ -205,7 +246,7 @@ std::set RiaSummaryAddressAnalyzer::aquifers() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::set RiaSummaryAddressAnalyzer::categories() const +std::set RiaSummaryAddressAnalyzer::categories() const { return keysInMap( m_categories ); } @@ -238,12 +279,12 @@ std::vector> RiaSummaryAddressAnalyzer::ad //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSummaryAddressDefines::SummaryVarCategory category, +std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSummaryAddressDefines::SummaryCategory category, const std::string& secondaryIdentifier ) const { std::vector identifierStrings; - if ( category == SummaryVarCategory::SUMMARY_REGION ) + if ( category == SummaryCategory::SUMMARY_REGION ) { auto keys = keysInMap( m_regionNumbers ); for ( const auto& key : keys ) @@ -251,7 +292,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::number( key ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_WELL ) + else if ( category == SummaryCategory::SUMMARY_WELL ) { auto keys = keysInMap( m_wellNames ); for ( const auto& key : keys ) @@ -259,7 +300,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::fromStdString( key ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_GROUP ) + else if ( category == SummaryCategory::SUMMARY_GROUP ) { auto keys = keysInMap( m_groupNames ); for ( const auto& key : keys ) @@ -267,7 +308,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::fromStdString( key ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_NETWORK ) + else if ( category == SummaryCategory::SUMMARY_NETWORK ) { auto keys = keysInMap( m_networkNames ); for ( const auto& key : keys ) @@ -275,7 +316,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::fromStdString( key ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_BLOCK ) + else if ( category == SummaryCategory::SUMMARY_BLOCK ) { auto keys = keysInMap( m_blocks ); for ( const auto& key : keys ) @@ -283,7 +324,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::fromStdString( key ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_WELL_SEGMENT ) + else if ( category == SummaryCategory::SUMMARY_WELL_SEGMENT ) { auto segmentNumbers = wellSegmentNumbers( secondaryIdentifier ); for ( const auto& segment : segmentNumbers ) @@ -291,7 +332,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::number( segment ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_WELL_COMPLETION ) + else if ( category == SummaryCategory::SUMMARY_WELL_COMPLETION ) { auto connections = wellCompletions( secondaryIdentifier ); for ( const auto& conn : connections ) @@ -299,7 +340,7 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma identifierStrings.push_back( QString::fromStdString( conn ) ); } } - else if ( category == SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( category == SummaryCategory::SUMMARY_AQUIFER ) { auto keys = keysInMap( m_aquifers ); for ( const auto& key : keys ) @@ -314,9 +355,8 @@ std::vector RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector - RiaSummaryAddressAnalyzer::addressesForCategory( const std::set& addresses, - RifEclipseSummaryAddressDefines::SummaryVarCategory category ) +std::vector RiaSummaryAddressAnalyzer::addressesForCategory( const std::set& addresses, + RifEclipseSummaryAddressDefines::SummaryCategory category ) { std::vector filteredAddresses; @@ -350,7 +390,7 @@ std::string RiaSummaryAddressAnalyzer::correspondingHistorySummaryCurveName( con //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::set RiaSummaryAddressAnalyzer::vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category ) +std::set RiaSummaryAddressAnalyzer::vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category ) { auto it = m_categories.find( category ); if ( it != m_categories.end() ) return it->second; @@ -430,6 +470,14 @@ void RiaSummaryAddressAnalyzer::computeQuantityNamesWithHistory() const //-------------------------------------------------------------------------------------------------- void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAddress& address ) { + if ( address.category() == SummaryCategory::SUMMARY_TIME ) + { + m_onlyCrossPlotCurves = false; + + // A time address has no other information than SummaryCategory::SUMMARY_TIME + return; + } + const std::string& wellName = address.wellName(); if ( !wellName.empty() ) @@ -457,32 +505,32 @@ void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAdd m_regionNumbers.insert( { address.regionNumber(), address } ); } - if ( address.category() == SummaryVarCategory::SUMMARY_WELL_COMPLETION ) + if ( address.category() == SummaryCategory::SUMMARY_WELL_COMPLETION ) { auto wellNameAndCompletion = std::make_pair( wellName, address.blockAsString() ); m_wellCompletions.insert( wellNameAndCompletion ); } - else if ( address.category() == SummaryVarCategory::SUMMARY_WELL_SEGMENT ) + else if ( address.category() == SummaryCategory::SUMMARY_WELL_SEGMENT ) { auto wellNameAndSegment = std::make_pair( wellName, address.wellSegmentNumber() ); m_wellSegmentNumbers.insert( wellNameAndSegment ); } - else if ( address.category() == SummaryVarCategory::SUMMARY_BLOCK ) + else if ( address.category() == SummaryCategory::SUMMARY_BLOCK ) { auto text = address.blockAsString(); m_blocks.insert( { text, address } ); } - else if ( address.category() == SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( address.category() == SummaryCategory::SUMMARY_AQUIFER ) { m_aquifers.insert( { address.aquiferNumber(), address } ); } - else if ( address.category() == SummaryVarCategory::SUMMARY_FIELD || address.category() == SummaryVarCategory::SUMMARY_MISC ) + else if ( address.category() == SummaryCategory::SUMMARY_FIELD || address.category() == SummaryCategory::SUMMARY_MISC ) { m_otherCategory.push_back( address ); } - if ( address.category() != SummaryVarCategory::SUMMARY_INVALID ) + if ( address.category() != SummaryCategory::SUMMARY_INVALID ) { if ( m_categories.count( address.category() ) == 0 ) { @@ -522,10 +570,10 @@ std::set RiaSummaryAddressAnalyzer::keysInMap( const std::multimap - RiaSummaryAddressAnalyzer::keysInMap( const std::map>& map ) +std::set + RiaSummaryAddressAnalyzer::keysInMap( const std::map>& map ) { - std::set keys; + std::set keys; for ( const auto& [key, value] : map ) { keys.insert( key ); diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h index dc6727cec2..3b8d088389 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h +++ b/ApplicationLibCode/Application/Tools/RiaSummaryAddressAnalyzer.h @@ -18,6 +18,7 @@ #pragma once +#include "RiaSummaryCurveAddress.h" #include "RifEclipseSummaryAddress.h" #include @@ -39,6 +40,7 @@ class RiaSummaryAddressAnalyzer void appendAddresses( const std::set& allAddresses ); void appendAddresses( const std::vector& allAddresses ); + void appendAddresses( const std::vector& addresses ); void clear(); @@ -48,6 +50,8 @@ class RiaSummaryAddressAnalyzer bool isSingleQuantityIgnoreHistory() const; + bool onlyCrossPlotCurves() const; + std::string quantityNameForTitle() const; std::set wellNames() const; @@ -60,18 +64,18 @@ class RiaSummaryAddressAnalyzer std::set blocks() const; std::set aquifers() const; - std::set categories() const; - std::vector> addressesGroupedByObject() const; + std::set categories() const; + std::vector> addressesGroupedByObject() const; - std::vector identifierTexts( RifEclipseSummaryAddressDefines::SummaryVarCategory category, - const std::string& secondaryIdentifier ) const; + std::vector identifierTexts( RifEclipseSummaryAddressDefines::SummaryCategory category, + const std::string& secondaryIdentifier ) const; - static std::vector addressesForCategory( const std::set& addresses, - RifEclipseSummaryAddressDefines::SummaryVarCategory category ); + static std::vector addressesForCategory( const std::set& addresses, + RifEclipseSummaryAddressDefines::SummaryCategory category ); static std::string correspondingHistorySummaryCurveName( const std::string& curveName ); - std::set vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category ); + std::set vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category ); private: void assignCategoryToQuantities() const; @@ -81,8 +85,8 @@ class RiaSummaryAddressAnalyzer static std::set keysInMap( const std::multimap& map ); static std::set keysInMap( const std::multimap& map ); - static std::set - keysInMap( const std::map>& map ); + static std::set + keysInMap( const std::map>& map ); static std::vector> valuesInMap( const std::multimap& map ); @@ -103,5 +107,7 @@ class RiaSummaryAddressAnalyzer std::multimap m_blocks; std::multimap m_aquifers; - std::map> m_categories; + std::map> m_categories; + + bool m_onlyCrossPlotCurves; }; diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp b/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp index dddd1fb349..61efb76450 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp +++ b/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp @@ -354,3 +354,26 @@ QList RiaSummaryTools::optionsForSummaryCases( const std return options; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryTools::copyCurveDataSources( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ) +{ + curve.setSummaryAddressX( otherCurve.summaryAddressX() ); + curve.setSummaryCaseX( otherCurve.summaryCaseX() ); + + curve.setSummaryAddressY( otherCurve.summaryAddressY() ); + curve.setSummaryCaseY( otherCurve.summaryCaseY() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryTools::copyCurveAxisData( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ) +{ + curve.setAxisTypeX( otherCurve.axisTypeX() ); + curve.setTopOrBottomAxisX( otherCurve.axisX() ); + + curve.setLeftOrRightAxisY( otherCurve.axisY() ); +} diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryTools.h b/ApplicationLibCode/Application/Tools/RiaSummaryTools.h index ebb46308a9..02571787cd 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryTools.h +++ b/ApplicationLibCode/Application/Tools/RiaSummaryTools.h @@ -36,6 +36,7 @@ class RimSummaryCaseCollection; class RimSummaryTable; class RimSummaryTableCollection; class RimObservedDataCollection; +class RimSummaryCurve; class RifEclipseSummaryAddress; @@ -88,4 +89,7 @@ class RiaSummaryTools static QList optionsForAllSummaryCases(); static QList optionsForSummaryCases( const std::vector& cases ); + + static void copyCurveDataSources( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ); + static void copyCurveAxisData( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ); }; diff --git a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp index ab05853947..80f0264f9f 100644 --- a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp +++ b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSaveMultiPlotTemplateFeature.cpp @@ -182,6 +182,28 @@ QString RicSaveMultiPlotTemplateFeature::createTextFromObject( RimSummaryMultiPl replaceStrings( sourceStrings, summaryFieldKeyword, RicSummaryPlotTemplateTools::placeholderTextForSummaryCase(), objectAsText ); } + { + std::set sourceStrings; + + const QString summaryFieldKeyword = RicSummaryPlotTemplateTools::summaryCaseXFieldKeyword(); + for ( const auto& curve : summaryPlot->allCurves( RimSummaryDataSourceStepping::Axis::Y_AXIS ) ) + { + if ( curve->axisTypeX() != RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) continue; + + auto fieldHandle = curve->findField( summaryFieldKeyword ); + if ( fieldHandle ) + { + auto reference = caf::PdmReferenceHelper::referenceFromFieldToObject( fieldHandle, curve->summaryCaseX() ); + + sourceStrings.insert( reference ); + } + + addresses.push_back( curve->summaryAddressX() ); + } + + replaceStrings( sourceStrings, summaryFieldKeyword, RicSummaryPlotTemplateTools::placeholderTextForSummaryCaseX(), objectAsText ); + } + { std::set ensembleReferenceStrings; @@ -219,7 +241,7 @@ QString RicSaveMultiPlotTemplateFeature::createTextFromObject( RimSummaryMultiPl } replaceStrings( sourceStrings, - dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ), + dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ), RicSummaryPlotTemplateTools::placeholderTextForWell(), objectAsText ); } @@ -233,7 +255,7 @@ QString RicSaveMultiPlotTemplateFeature::createTextFromObject( RimSummaryMultiPl } replaceStrings( sourceStrings, - dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ), + dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ), RicSummaryPlotTemplateTools::placeholderTextForGroup(), objectAsText ); } @@ -251,8 +273,8 @@ QString RicSaveMultiPlotTemplateFeature::createTextFromObject( RimSummaryMultiPl // Encode placeholder index. Use negative values below -1 to represent a placeholder index int index = -( i + 2 ); - QString fieldKeyword = dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ); - QString sourceString = QString( "<%1>%2" ).arg( fieldKeyword ).arg( regionNumbers[i] ); + QString fieldKeyword = dummy.keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ); + QString sourceString = QString( "<%1>%2" ).arg( fieldKeyword ).arg( regionNumbers[i] ); QString replacementTextWithIndex = QString( "<%1>%2" ).arg( fieldKeyword ).arg( index ); objectAsText.replace( sourceString, replacementTextWithIndex ); diff --git a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.cpp b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.cpp index a712c185bc..d1e042442a 100644 --- a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.cpp +++ b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.cpp @@ -250,13 +250,13 @@ void RicSummaryPlotTemplateTools::setValuesForPlaceholders( RimSummaryPlot* auto summaryCurves = summaryPlot->allCurves( RimSummaryDataSourceStepping::Axis::Y_AXIS ); for ( const auto& curve : summaryCurves ) { - auto fieldHandle = curve->findField( RicSummaryPlotTemplateTools::summaryCaseFieldKeyword() ); - if ( fieldHandle ) + auto summaryCaseHandle = curve->findField( RicSummaryPlotTemplateTools::summaryCaseFieldKeyword() ); + if ( summaryCaseHandle ) { bool conversionOk = false; const QString placeholderString = RicSummaryPlotTemplateTools::placeholderTextForSummaryCase(); - auto referenceString = fieldHandle->xmlCapability()->referenceString(); + auto referenceString = summaryCaseHandle->xmlCapability()->referenceString(); int indexValue = RicSummaryPlotTemplateTools::findValueForKeyword( placeholderString, referenceString, &conversionOk ); if ( conversionOk && indexValue >= 0 && indexValue < static_cast( selectedSummaryCases.size() ) ) @@ -266,12 +266,37 @@ void RicSummaryPlotTemplateTools::setValuesForPlaceholders( RimSummaryPlot* } } + auto summaryCaseXHandle = curve->findField( RicSummaryPlotTemplateTools::summaryCaseXFieldKeyword() ); + if ( summaryCaseXHandle ) + { + bool conversionOk = false; + const QString placeholderString = RicSummaryPlotTemplateTools::placeholderTextForSummaryCaseX(); + + auto referenceString = summaryCaseXHandle->xmlCapability()->referenceString(); + int indexValue = RicSummaryPlotTemplateTools::findValueForKeyword( placeholderString, referenceString, &conversionOk ); + + if ( conversionOk && indexValue >= 0 && indexValue < static_cast( selectedSummaryCases.size() ) ) + { + auto summaryCase = selectedSummaryCases[static_cast( indexValue )]; + curve->setSummaryCaseX( summaryCase ); + } + } + // Replace placeholders with object names from selection auto curveAdr = curve->summaryAddressY(); setPlaceholderWellName( &curveAdr, wellNames ); setPlaceholderGroupName( &curveAdr, groupNames ); setPlaceholderRegion( &curveAdr, regions ); curve->setSummaryAddressY( curveAdr ); + + if ( curve->axisTypeX() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) + { + auto curveAdr = curve->summaryAddressX(); + setPlaceholderWellName( &curveAdr, wellNames ); + setPlaceholderGroupName( &curveAdr, groupNames ); + setPlaceholderRegion( &curveAdr, regions ); + curve->setSummaryAddressX( curveAdr ); + } } for ( const auto& curveSet : summaryPlot->curveSets() ) @@ -493,6 +518,14 @@ QString RicSummaryPlotTemplateTools::summaryCaseFieldKeyword() return "SummaryCase"; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RicSummaryPlotTemplateTools::summaryCaseXFieldKeyword() +{ + return "SummaryCaseX"; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -509,6 +542,14 @@ QString RicSummaryPlotTemplateTools::placeholderTextForSummaryCase() return "__CASE_NAME__"; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RicSummaryPlotTemplateTools::placeholderTextForSummaryCaseX() +{ + return "__CASE_NAME_X__"; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.h b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.h index 57df90477b..1476d3859d 100644 --- a/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.h +++ b/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.h @@ -51,9 +51,11 @@ class RicSummaryPlotTemplateTools static std::vector selectDefaultPlotTemplates( std::vector currentSelection ); static QString summaryCaseFieldKeyword(); + static QString summaryCaseXFieldKeyword(); static QString summaryGroupFieldKeyword(); static QString placeholderTextForSummaryCase(); + static QString placeholderTextForSummaryCaseX(); static QString placeholderTextForSummaryGroup(); static QString placeholderTextForWell(); static QString placeholderTextForGroup(); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp index 10de3fc79d..3946d2d9fe 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp @@ -92,11 +92,7 @@ RimSummaryDeclineCurve* RicCreateDeclineCurvesFeature::createDeclineCurveAndAddT RimSummaryDeclineCurve* newCurve = new RimSummaryDeclineCurve(); CVF_ASSERT( newCurve ); - newCurve->setSummaryCaseX( sourceCurve->summaryCaseX() ); - newCurve->setSummaryAddressX( sourceCurve->summaryAddressX() ); - - newCurve->setSummaryCaseY( sourceCurve->summaryCaseY() ); - newCurve->setSummaryAddressY( sourceCurve->summaryAddressY() ); + RiaSummaryTools::copyCurveDataSources( *newCurve, *sourceCurve ); newCurve->setDeclineCurveType( declineCurveType ); @@ -105,6 +101,8 @@ RimSummaryDeclineCurve* RicCreateDeclineCurvesFeature::createDeclineCurveAndAddT summaryPlot->addCurveAndUpdate( newCurve ); + RiaSummaryTools::copyCurveAxisData( *newCurve, *sourceCurve ); + newCurve->updateDefaultValues(); newCurve->loadDataAndUpdate( true ); newCurve->updateConnectedEditors(); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp index 9ad8b0a9d5..f2387228c1 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp @@ -78,11 +78,7 @@ RimSummaryRegressionAnalysisCurve* RimSummaryRegressionAnalysisCurve* newCurve = new RimSummaryRegressionAnalysisCurve(); CVF_ASSERT( newCurve ); - newCurve->setSummaryCaseX( sourceCurve->summaryCaseX() ); - newCurve->setSummaryAddressX( sourceCurve->summaryAddressX() ); - - newCurve->setSummaryCaseY( sourceCurve->summaryCaseY() ); - newCurve->setSummaryAddressY( sourceCurve->summaryAddressY() ); + RiaSummaryTools::copyCurveDataSources( *newCurve, *sourceCurve ); newCurve->setColor( sourceCurve->color() ); newCurve->setSymbol( RiuPlotCurveSymbol::PointSymbolEnum::SYMBOL_RECT ); @@ -90,6 +86,8 @@ RimSummaryRegressionAnalysisCurve* summaryPlot->addCurveAndUpdate( newCurve ); + RiaSummaryTools::copyCurveAxisData( *newCurve, *sourceCurve ); + newCurve->updateDefaultValues(); newCurve->loadDataAndUpdate( true ); newCurve->updateConnectedEditors(); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewPlotAxisPropertiesFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewPlotAxisPropertiesFeature.cpp index 1e00a9f2b2..6ec4e5e413 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewPlotAxisPropertiesFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewPlotAxisPropertiesFeature.cpp @@ -49,7 +49,7 @@ void RicNewPlotAxisPropertiesFeature::onActionTriggered( bool isChecked ) if ( !summaryPlot ) return; RimPlotAxisProperties* newPlotAxisProperties = summaryPlot->addNewAxisProperties( RiaDefines::PlotAxis::PLOT_AXIS_LEFT, "New Axis" ); - summaryPlot->plotWidget()->ensureAxisIsCreated( newPlotAxisProperties->plotAxisType() ); + summaryPlot->plotWidget()->ensureAxisIsCreated( newPlotAxisProperties->plotAxis() ); newPlotAxisProperties->setNameForUnusedAxis(); summaryPlot->updateConnectedEditors(); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.cpp index 4f27eee0c3..dd16106175 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.cpp @@ -45,7 +45,7 @@ CAF_CMD_SOURCE_INIT( RicNewSummaryCrossPlotCurveFeature, "RicNewSummaryCrossPlot //-------------------------------------------------------------------------------------------------- bool RicNewSummaryCrossPlotCurveFeature::isCommandEnabled() const { - return ( selectedCrossPlot() ); + return ( selectedSummaryPlot() ); } //-------------------------------------------------------------------------------------------------- @@ -55,24 +55,29 @@ void RicNewSummaryCrossPlotCurveFeature::onActionTriggered( bool isChecked ) { RimProject* project = RimProject::current(); - RimSummaryCrossPlot* plot = selectedCrossPlot(); + auto plot = selectedSummaryPlot(); if ( plot ) { RimSummaryCurve* newCurve = new RimSummaryCurve(); cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable( plot->curveCount() ); newCurve->setColor( curveColor ); - plot->addCurveAndUpdate( newCurve ); - RimSummaryCase* defaultCase = nullptr; if ( project->activeOilField()->summaryCaseMainCollection()->summaryCaseCount() > 0 ) { defaultCase = project->activeOilField()->summaryCaseMainCollection()->summaryCase( 0 ); newCurve->setSummaryCaseY( defaultCase ); + newCurve->setSummaryAddressY( RifEclipseSummaryAddress::fieldAddress( "FOPT" ) ); - newCurve->loadDataAndUpdate( true ); + newCurve->setAxisTypeX( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); + newCurve->setSummaryCaseX( defaultCase ); + newCurve->setSummaryAddressX( RifEclipseSummaryAddress::fieldAddress( "FGOR" ) ); } + plot->addCurveAndUpdate( newCurve ); + + newCurve->loadDataAndUpdate( true ); + plot->updateConnectedEditors(); RiuPlotMainWindowTools::onObjectAppended( newCurve ); @@ -91,15 +96,8 @@ void RicNewSummaryCrossPlotCurveFeature::setupActionLook( QAction* actionToSetup //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimSummaryCrossPlot* RicNewSummaryCrossPlotCurveFeature::selectedCrossPlot() const +RimSummaryPlot* RicNewSummaryCrossPlotCurveFeature::selectedSummaryPlot() const { - RimSummaryCrossPlot* crossPlot = nullptr; - caf::PdmObject* selObj = dynamic_cast( caf::SelectionManager::instance()->selectedItem() ); - if ( selObj ) - { - crossPlot = RiaSummaryTools::parentCrossPlot( selObj ); - } - - return crossPlot; + return RiaSummaryTools::parentSummaryPlot( selObj ); } diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.h b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.h index c789c6286b..248b610c41 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.h +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryCrossPlotCurveFeature.h @@ -22,7 +22,7 @@ #include -class RimSummaryCrossPlot; +class RimSummaryPlot; //================================================================================================== /// @@ -37,5 +37,5 @@ class RicNewSummaryCrossPlotCurveFeature : public caf::CmdFeature void setupActionLook( QAction* actionToSetup ) override; private: - RimSummaryCrossPlot* selectedCrossPlot() const; + RimSummaryPlot* selectedSummaryPlot() const; }; diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryTableFeature.h b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryTableFeature.h index 8e4d13f873..1b681da39a 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryTableFeature.h +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryTableFeature.h @@ -37,8 +37,8 @@ class RicNewSummaryTableFeature : public caf::CmdFeature void setupActionLook( QAction* actionToSetup ) override; private: - const std::set m_enabledCategories = - { RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL, - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION, - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP }; + const std::set m_enabledCategories = + { RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL, + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION, + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP }; }; diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h b/ApplicationLibCode/Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h index 4afc7de5c7..2f6543135e 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h @@ -42,7 +42,7 @@ class AsciiDataParseOptions : useCustomDateTimeFormat( false ) , assumeNumericDataColumns( false ) , curveSymbolSkipDistance( 0.0f ) - , defaultCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + , defaultCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { } @@ -62,7 +62,7 @@ class AsciiDataParseOptions QDateTime startDateTime; bool assumeNumericDataColumns; - RifEclipseSummaryAddressDefines::SummaryVarCategory defaultCategory; + RifEclipseSummaryAddressDefines::SummaryCategory defaultCategory; RiuQwtPlotCurveDefines::LineStyleEnum curveLineStyle; RiuPlotCurveSymbol::PointSymbolEnum curveSymbol; diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp index 9c36b8a795..79993fc9f7 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp @@ -371,7 +371,7 @@ void RicSummaryPlotEditorUi::syncPreviewCurvesFromUiSelection() for ( const auto& curve : currentCurvesInPreviewPlot ) { - currentCurveDefs.insert( curve->curveDefinitionY() ); + currentCurveDefs.insert( curve->curveDefinition() ); } { @@ -385,7 +385,7 @@ void RicSummaryPlotEditorUi::syncPreviewCurvesFromUiSelection() for ( const auto& curve : currentCurvesInPreviewPlot ) { - RiaSummaryCurveDefinition curveDef = curve->curveDefinitionY(); + RiaSummaryCurveDefinition curveDef = curve->curveDefinition(); if ( deleteCurveDefs.count( curveDef ) > 0 ) curvesToDelete.insert( curve ); } } @@ -630,7 +630,7 @@ void RicSummaryPlotEditorUi::populateCurveCreator( const RimSummaryPlot& sourceS for ( const auto& curve : sourceSummaryPlot.summaryCurves() ) { - curveDefs.push_back( curve->curveDefinitionY() ); + curveDefs.push_back( curve->curveDefinition() ); // Copy curve object to the preview plot copyCurveAndAddToPlot( curve, m_previewPlot.get(), true ); diff --git a/ApplicationLibCode/FileInterface/RifCsvUserDataParser.cpp b/ApplicationLibCode/FileInterface/RifCsvUserDataParser.cpp index 2f88adbf68..000e1d3e45 100644 --- a/ApplicationLibCode/FileInterface/RifCsvUserDataParser.cpp +++ b/ApplicationLibCode/FileInterface/RifCsvUserDataParser.cpp @@ -419,9 +419,9 @@ bool RifCsvUserDataParser::parseColumnInfo( QTextStream* RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( colName.toStdString() ); // Create address of a give category if provided - if ( parseOptions.defaultCategory == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + if ( parseOptions.defaultCategory == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) addr = RifEclipseSummaryAddress::wellAddress( colName.toStdString(), nameFromData.toStdString() ); - else if ( parseOptions.defaultCategory == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD ) + else if ( parseOptions.defaultCategory == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD ) addr = RifEclipseSummaryAddress::fieldAddress( colName.toStdString() ); double scaleFactor = 1.0; diff --git a/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp b/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp index e346c71255..c6b5729aac 100644 --- a/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp +++ b/ApplicationLibCode/FileInterface/RifEclEclipseSummary.cpp @@ -107,21 +107,21 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu return RifEclipseSummaryAddress(); } - RifEclipseSummaryAddressDefines::SummaryVarCategory sumCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ); - std::string quantityName; - int regionNumber( -1 ); - int regionNumber2( -1 ); - std::string groupName; - std::string networkName; - std::string wellName; - int wellSegmentNumber( -1 ); - std::string lgrName; - int cellI( -1 ); - int cellJ( -1 ); - int cellK( -1 ); - int aquiferNumber( -1 ); - bool isErrorResult( false ); - int id( -1 ); + RifEclipseSummaryAddressDefines::SummaryCategory sumCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ); + std::string quantityName; + int regionNumber( -1 ); + int regionNumber2( -1 ); + std::string groupName; + std::string networkName; + std::string wellName; + int wellSegmentNumber( -1 ); + std::string lgrName; + int cellI( -1 ); + int cellJ( -1 ); + int cellK( -1 ); + int aquiferNumber( -1 ); + bool isErrorResult( false ); + int id( -1 ); quantityName = stringFromPointer( ertSumVarNode.get_keyword() ); @@ -129,36 +129,36 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu { case ECL_SMSPEC_AQUIFER_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER; aquiferNumber = ertSumVarNode.get_num(); } break; case ECL_SMSPEC_WELL_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL; wellName = stringFromPointer( ertSumVarNode.get_wgname() ); } break; case ECL_SMSPEC_REGION_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION; regionNumber = ertSumVarNode.get_num(); } break; case ECL_SMSPEC_FIELD_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD; } break; case ECL_SMSPEC_GROUP_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP; groupName = stringFromPointer( ertSumVarNode.get_wgname() ); } break; case ECL_SMSPEC_BLOCK_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK; auto ijk = ertSumVarNode.get_ijk(); cellI = ijk[0]; @@ -168,7 +168,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu break; case ECL_SMSPEC_COMPLETION_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION; wellName = stringFromPointer( ertSumVarNode.get_wgname() ); auto ijk = ertSumVarNode.get_ijk(); @@ -179,7 +179,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu break; case ECL_SMSPEC_LOCAL_BLOCK_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR; lgrName = stringFromPointer( ertSumVarNode.get_lgr_name() ); auto ijk = ertSumVarNode.get_lgr_ijk(); @@ -190,7 +190,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu break; case ECL_SMSPEC_LOCAL_COMPLETION_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR; wellName = stringFromPointer( ertSumVarNode.get_wgname() ); lgrName = stringFromPointer( ertSumVarNode.get_lgr_name() ); @@ -202,33 +202,33 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu break; case ECL_SMSPEC_LOCAL_WELL_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR; wellName = stringFromPointer( ertSumVarNode.get_wgname() ); lgrName = stringFromPointer( ertSumVarNode.get_lgr_name() ); } break; case ECL_SMSPEC_NETWORK_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK; } break; case ECL_SMSPEC_REGION_2_REGION_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION; regionNumber = ertSumVarNode.get_R1(); regionNumber2 = ertSumVarNode.get_R2(); } break; case ECL_SMSPEC_SEGMENT_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT; wellName = stringFromPointer( ertSumVarNode.get_wgname() ); wellSegmentNumber = ertSumVarNode.get_num(); } break; case ECL_SMSPEC_MISC_VAR: { - sumCategory = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC; + sumCategory = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC; } break; default: diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp index 3a5ee2b187..1921aeefce 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.cpp @@ -31,8 +31,8 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, std::map& identifiers ) - : m_variableCategory( category ) +RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryCategory category, std::map& identifiers ) + : m_category( category ) , m_number0( -1 ) , m_number1( -1 ) , m_number2( -1 ) @@ -42,48 +42,48 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, std::pair reg2regPair; switch ( category ) { - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: m_number0 = RiaStdStringTools::toInt16( identifiers[SummaryIdentifierType::INPUT_REGION_NUMBER] ); break; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: reg2regPair = regionToRegionPairFromUiText( identifiers[SummaryIdentifierType::INPUT_REGION_2_REGION] ); m_number0 = reg2regPair.first; m_number1 = reg2regPair.second; break; - case SummaryVarCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_GROUP: m_name = identifiers[SummaryIdentifierType::INPUT_GROUP_NAME]; break; - case SummaryVarCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_NETWORK: m_name = identifiers[SummaryIdentifierType::INPUT_NETWORK_NAME]; break; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: m_name = identifiers[SummaryIdentifierType::INPUT_WELL_NAME]; break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: m_name = identifiers[SummaryIdentifierType::INPUT_WELL_NAME]; setCellIjk( ijkTupleFromUiText( identifiers[SummaryIdentifierType::INPUT_CELL_IJK] ) ); break; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: m_lgrName = identifiers[SummaryIdentifierType::INPUT_LGR_NAME]; m_name = identifiers[SummaryIdentifierType::INPUT_WELL_NAME]; break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: m_lgrName = identifiers[SummaryIdentifierType::INPUT_LGR_NAME]; m_name = identifiers[SummaryIdentifierType::INPUT_WELL_NAME]; setCellIjk( ijkTupleFromUiText( identifiers[SummaryIdentifierType::INPUT_CELL_IJK] ) ); break; - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_WELL_SEGMENT: m_name = identifiers[SummaryIdentifierType::INPUT_WELL_NAME]; m_number0 = RiaStdStringTools::toInt( identifiers[SummaryIdentifierType::INPUT_SEGMENT_NUMBER] ); break; - case SummaryVarCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK: setCellIjk( ijkTupleFromUiText( identifiers[SummaryIdentifierType::INPUT_CELL_IJK] ) ); break; - case SummaryVarCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_BLOCK_LGR: m_lgrName = identifiers[SummaryIdentifierType::INPUT_LGR_NAME]; setCellIjk( ijkTupleFromUiText( identifiers[SummaryIdentifierType::INPUT_CELL_IJK] ) ); break; - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: m_number0 = RiaStdStringTools::toInt( identifiers[SummaryIdentifierType::INPUT_AQUIFER_NUMBER] ); break; } @@ -95,7 +95,7 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, +RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryCategory category, const std::string& vectorName, int regionNumber, int regionNumber2, @@ -110,7 +110,7 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, int aquiferNumber, bool isErrorResult, int id ) - : m_variableCategory( category ) + : m_category( category ) , m_vectorName( vectorName ) , m_lgrName( lgrName ) , m_number0( -1 ) @@ -121,44 +121,44 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, { switch ( category ) { - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: m_number0 = regionNumber; break; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: m_number0 = regionNumber; m_number1 = regionNumber2; break; - case SummaryVarCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_GROUP: m_name = groupName; break; - case SummaryVarCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_NETWORK: m_name = networkName; break; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: m_name = wellName; break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: m_name = wellName; setCellIjk( cellI, cellJ, cellK ); break; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: m_name = wellName; break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: m_name = wellName; setCellIjk( cellI, cellJ, cellK ); break; - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_WELL_SEGMENT: m_name = wellName; m_number0 = wellSegmentNumber; break; - case SummaryVarCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK: setCellIjk( cellI, cellJ, cellK ); break; - case SummaryVarCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_BLOCK_LGR: setCellIjk( cellI, cellJ, cellK ); break; - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: m_number0 = aquiferNumber; break; } @@ -168,7 +168,7 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category, /// //-------------------------------------------------------------------------------------------------- RifEclipseSummaryAddress::RifEclipseSummaryAddress() - : m_variableCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + : m_category( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) , m_number0( -1 ) , m_number1( -1 ) , m_number2( -1 ) @@ -200,7 +200,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromEclipseTextAddressParseEr auto address = fromTokens( tokens ); - if ( address.category() == SummaryVarCategory::SUMMARY_INVALID || address.category() == SummaryVarCategory::SUMMARY_IMPORTED ) + if ( address.category() == SummaryCategory::SUMMARY_INVALID || address.category() == SummaryCategory::SUMMARY_IMPORTED ) { // Address category not recognized, use incoming text string without error prefix as vector name auto text = RiaStdStringTools::joinStrings( tokens, ':' ); @@ -227,9 +227,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromEclipseTextAddress( const RifEclipseSummaryAddress RifEclipseSummaryAddress::fieldAddress( const std::string& vectorName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_FIELD; - addr.m_vectorName = vectorName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_FIELD; + addr.m_vectorName = vectorName; + addr.m_id = calculationId; return addr; } @@ -239,10 +239,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fieldAddress( const std::stri RifEclipseSummaryAddress RifEclipseSummaryAddress::aquiferAddress( const std::string& vectorName, int aquiferNumber, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_AQUIFER; - addr.m_vectorName = vectorName; - addr.m_number0 = aquiferNumber; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_AQUIFER; + addr.m_vectorName = vectorName; + addr.m_number0 = aquiferNumber; + addr.m_id = calculationId; return addr; } @@ -253,10 +253,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::networkAddress( const std::string& vectorName, const std::string& networkName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_NETWORK; - addr.m_vectorName = vectorName; - addr.m_name = networkName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_NETWORK; + addr.m_vectorName = vectorName; + addr.m_name = networkName; + addr.m_id = calculationId; return addr; } @@ -266,9 +266,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::miscAddress( const std::string& vectorName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_MISC; - addr.m_vectorName = vectorName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_MISC; + addr.m_vectorName = vectorName; + addr.m_id = calculationId; return addr; } @@ -278,10 +278,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::miscAddress( const std::strin RifEclipseSummaryAddress RifEclipseSummaryAddress::regionAddress( const std::string& vectorName, int regionNumber, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_REGION; - addr.m_vectorName = vectorName; - addr.m_number0 = regionNumber; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_REGION; + addr.m_vectorName = vectorName; + addr.m_number0 = regionNumber; + addr.m_id = calculationId; return addr; } @@ -292,11 +292,11 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::regionToRegionAddress( const std::string& vectorName, int regionNumber, int region2Number, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_REGION_2_REGION; - addr.m_vectorName = vectorName; - addr.m_number0 = regionNumber; - addr.m_number1 = region2Number; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_REGION_2_REGION; + addr.m_vectorName = vectorName; + addr.m_number0 = regionNumber; + addr.m_number1 = region2Number; + addr.m_id = calculationId; return addr; } @@ -306,10 +306,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::groupAddress( const std::string& vectorName, const std::string& groupName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_GROUP; - addr.m_vectorName = vectorName; - addr.m_name = groupName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_GROUP; + addr.m_vectorName = vectorName; + addr.m_name = groupName; + addr.m_id = calculationId; return addr; } @@ -319,10 +319,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::groupAddress( const std::stri RifEclipseSummaryAddress RifEclipseSummaryAddress::wellAddress( const std::string& vectorName, const std::string& wellName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_WELL; - addr.m_vectorName = vectorName; - addr.m_name = wellName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_WELL; + addr.m_vectorName = vectorName; + addr.m_name = wellName; + addr.m_id = calculationId; return addr; } @@ -333,9 +333,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellCompletionAddress( const std::string& vectorName, const std::string& wellName, int i, int j, int k, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_WELL_COMPLETION; - addr.m_vectorName = vectorName; - addr.m_name = wellName; + addr.m_category = SummaryCategory::SUMMARY_WELL_COMPLETION; + addr.m_vectorName = vectorName; + addr.m_name = wellName; addr.setCellIjk( i, j, k ); addr.m_id = calculationId; return addr; @@ -350,11 +350,11 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellLgrAddress( const std::st int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_WELL_LGR; - addr.m_vectorName = vectorName; - addr.m_lgrName = lgrName; - addr.m_name = wellName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_WELL_LGR; + addr.m_vectorName = vectorName; + addr.m_lgrName = lgrName; + addr.m_name = wellName; + addr.m_id = calculationId; return addr; } @@ -370,10 +370,10 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellCompletionLgrAddress( con int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR; - addr.m_vectorName = vectorName; - addr.m_lgrName = lgrName; - addr.m_name = wellName; + addr.m_category = SummaryCategory::SUMMARY_WELL_COMPLETION_LGR; + addr.m_vectorName = vectorName; + addr.m_lgrName = lgrName; + addr.m_name = wellName; addr.setCellIjk( i, j, k ); addr.m_id = calculationId; return addr; @@ -386,11 +386,11 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::wellSegmentAddress( const std::string& vectorName, const std::string& wellName, int segmentNumber, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_WELL_SEGMENT; - addr.m_vectorName = vectorName; - addr.m_name = wellName; - addr.m_number0 = segmentNumber; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_WELL_SEGMENT; + addr.m_vectorName = vectorName; + addr.m_name = wellName; + addr.m_number0 = segmentNumber; + addr.m_id = calculationId; return addr; } @@ -400,8 +400,8 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::blockAddress( const std::string& vectorName, int i, int j, int k, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_BLOCK; - addr.m_vectorName = vectorName; + addr.m_category = SummaryCategory::SUMMARY_BLOCK; + addr.m_vectorName = vectorName; addr.setCellIjk( i, j, k ); addr.m_id = calculationId; return addr; @@ -414,9 +414,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::blockLgrAddress( const std::string& vectorName, const std::string& lgrName, int i, int j, int k, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_BLOCK_LGR; - addr.m_vectorName = vectorName; - addr.m_lgrName = lgrName; + addr.m_category = SummaryCategory::SUMMARY_BLOCK_LGR; + addr.m_vectorName = vectorName; + addr.m_lgrName = lgrName; addr.setCellIjk( i, j, k ); addr.m_id = calculationId; return addr; @@ -428,9 +428,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress RifEclipseSummaryAddress::importedAddress( const std::string& vectorName, int calculationId ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_IMPORTED; - addr.m_vectorName = vectorName; - addr.m_id = calculationId; + addr.m_category = SummaryCategory::SUMMARY_IMPORTED; + addr.m_vectorName = vectorName; + addr.m_id = calculationId; return addr; } @@ -440,8 +440,18 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::importedAddress( const std::s RifEclipseSummaryAddress RifEclipseSummaryAddress::ensembleStatisticsAddress( const std::string& vectorName, const std::string& dataQuantityName ) { RifEclipseSummaryAddress addr; - addr.m_variableCategory = SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS; - addr.m_vectorName = vectorName + ":" + dataQuantityName; + addr.m_category = SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS; + addr.m_vectorName = vectorName + ":" + dataQuantityName; + return addr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseSummaryAddress RifEclipseSummaryAddress::timeAddress() +{ + RifEclipseSummaryAddress addr; + addr.m_category = SummaryCategory::SUMMARY_TIME; return addr; } @@ -471,19 +481,19 @@ std::string RifEclipseSummaryAddress::generateStringFromAddresses( const std::ve //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifEclipseSummaryAddress::isDependentOnWellName( SummaryVarCategory category ) +bool RifEclipseSummaryAddress::isDependentOnWellName( SummaryCategory category ) { - return ( category == SummaryVarCategory::SUMMARY_WELL || category == SummaryVarCategory::SUMMARY_WELL_COMPLETION || - category == SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR || category == SummaryVarCategory::SUMMARY_WELL_LGR || - category == SummaryVarCategory::SUMMARY_WELL_SEGMENT ); + return ( category == SummaryCategory::SUMMARY_WELL || category == SummaryCategory::SUMMARY_WELL_COMPLETION || + category == SummaryCategory::SUMMARY_WELL_COMPLETION_LGR || category == SummaryCategory::SUMMARY_WELL_LGR || + category == SummaryCategory::SUMMARY_WELL_SEGMENT ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddressDefines::SummaryVarCategory RifEclipseSummaryAddress::category() const +RifEclipseSummaryAddressDefines::SummaryCategory RifEclipseSummaryAddress::category() const { - return m_variableCategory; + return m_category; } //-------------------------------------------------------------------------------------------------- @@ -525,7 +535,7 @@ int RifEclipseSummaryAddress::regionNumber2() const //-------------------------------------------------------------------------------------------------- std::string RifEclipseSummaryAddress::groupName() const { - return ( m_variableCategory == SummaryVarCategory::SUMMARY_GROUP ) ? m_name : std::string(); + return ( m_category == SummaryCategory::SUMMARY_GROUP ) ? m_name : std::string(); } //-------------------------------------------------------------------------------------------------- @@ -533,7 +543,7 @@ std::string RifEclipseSummaryAddress::groupName() const //-------------------------------------------------------------------------------------------------- std::string RifEclipseSummaryAddress::networkName() const { - return ( m_variableCategory == SummaryVarCategory::SUMMARY_NETWORK ) ? m_name : std::string(); + return ( m_category == SummaryCategory::SUMMARY_NETWORK ) ? m_name : std::string(); } //-------------------------------------------------------------------------------------------------- @@ -541,7 +551,7 @@ std::string RifEclipseSummaryAddress::networkName() const //-------------------------------------------------------------------------------------------------- std::string RifEclipseSummaryAddress::wellName() const { - return isDependentOnWellName( m_variableCategory ) ? m_name : std::string(); + return isDependentOnWellName( m_category ) ? m_name : std::string(); } //-------------------------------------------------------------------------------------------------- @@ -641,45 +651,45 @@ std::string RifEclipseSummaryAddress::itemUiText() const switch ( category() ) { - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: { text += std::to_string( regionNumber() ); } break; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: { text += formatUiTextRegionToRegion(); } break; - case SummaryVarCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_GROUP: { text += groupName(); } break; - case SummaryVarCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_NETWORK: { text += networkName(); } break; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: { text += wellName(); } break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: { text += wellName(); text += ":" + blockAsString(); } break; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: { text += lgrName(); text += ":"; text += wellName(); } break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: { text += lgrName(); text += ":"; @@ -688,31 +698,31 @@ std::string RifEclipseSummaryAddress::itemUiText() const text += blockAsString(); } break; - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_WELL_SEGMENT: { text += wellName(); text += ":"; text += std::to_string( wellSegmentNumber() ); } break; - case SummaryVarCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK: { text += blockAsString(); } break; - case SummaryVarCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_BLOCK_LGR: { text += lgrName(); text += ":"; text += blockAsString(); } break; - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: { text += std::to_string( aquiferNumber() ); } break; - case SummaryVarCategory::SUMMARY_IMPORTED: + case SummaryCategory::SUMMARY_IMPORTED: { text += vectorName(); } @@ -778,39 +788,39 @@ bool RifEclipseSummaryAddress::isValid() const switch ( category() ) { - case SummaryVarCategory::SUMMARY_INVALID: + case SummaryCategory::SUMMARY_INVALID: return false; - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: if ( m_number0 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: if ( m_number0 == -1 ) return false; if ( m_number1 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_GROUP: if ( m_name.empty() ) return false; return true; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: if ( m_name.empty() ) return false; return true; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: if ( m_name.empty() ) return false; if ( m_number0 == -1 ) return false; if ( m_number1 == -1 ) return false; if ( m_number2 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: if ( m_lgrName.empty() ) return false; if ( m_name.empty() ) return false; return true; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: if ( m_lgrName.empty() ) return false; if ( m_name.empty() ) return false; if ( m_number0 == -1 ) return false; @@ -818,25 +828,25 @@ bool RifEclipseSummaryAddress::isValid() const if ( m_number2 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_WELL_SEGMENT: if ( m_name.empty() ) return false; if ( m_number0 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK: if ( m_number0 == -1 ) return false; if ( m_number1 == -1 ) return false; if ( m_number2 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_BLOCK_LGR: if ( m_lgrName.empty() ) return false; if ( m_number0 == -1 ) return false; if ( m_number1 == -1 ) return false; if ( m_number2 == -1 ) return false; return true; - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: if ( m_number0 == -1 ) return false; return true; } @@ -969,7 +979,7 @@ bool RifEclipseSummaryAddress::hasAccumulatedData() const if ( !isValidEclipseCategory() ) return false; QString quantityForInspection = QString::fromStdString( vectorName() ); - if ( category() == SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + if ( category() == SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) { // Remove statistics text prefix quantityForInspection = quantityForInspection.mid( quantityForInspection.indexOf( ":" ) + 1 ); @@ -1006,14 +1016,14 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector if ( tokens.size() > 1 ) token1 = tokens[1]; if ( tokens.size() > 2 ) token2 = tokens[2]; - SummaryVarCategory category = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( vectorName ); + SummaryCategory category = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( vectorName ); switch ( category ) { - case SummaryVarCategory::SUMMARY_FIELD: + case SummaryCategory::SUMMARY_FIELD: return fieldAddress( vectorName ); - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: if ( !token1.empty() ) { RiaStdStringTools::toInt( token1, intValue0 ); @@ -1021,15 +1031,15 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_NETWORK: return networkAddress( vectorName, token1 ); break; - case SummaryVarCategory::SUMMARY_MISC: + case SummaryCategory::SUMMARY_MISC: return miscAddress( vectorName ); break; - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: if ( !token1.empty() ) { RiaStdStringTools::toInt( token1, intValue0 ); @@ -1037,7 +1047,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: if ( !token1.empty() ) { auto regions = RiaStdStringTools::splitString( token1, '-' ); @@ -1051,15 +1061,15 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_GROUP: if ( !token1.empty() ) return groupAddress( vectorName, token1 ); break; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: if ( !token1.empty() ) return wellAddress( vectorName, token1 ); break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: if ( !token2.empty() ) { auto ijk = RiaStdStringTools::splitString( token2, ',' ); @@ -1074,11 +1084,11 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: if ( !token1.empty() && !token2.empty() ) return wellLgrAddress( vectorName, token1, token2 ); break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: if ( tokens.size() > 2 ) { const auto& token3 = tokens[3]; @@ -1094,7 +1104,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_WELL_SEGMENT: if ( !token2.empty() ) { @@ -1104,7 +1114,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK: if ( !token1.empty() ) { auto ijk = RiaStdStringTools::splitString( token1, ',' ); @@ -1119,7 +1129,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_BLOCK_LGR: if ( !token2.empty() ) { auto ijk = RiaStdStringTools::splitString( token2, ',' ); @@ -1134,8 +1144,8 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector } break; - case SummaryVarCategory::SUMMARY_IMPORTED: - case SummaryVarCategory::SUMMARY_INVALID: + case SummaryCategory::SUMMARY_IMPORTED: + case SummaryCategory::SUMMARY_INVALID: default: break; } @@ -1150,21 +1160,21 @@ bool RifEclipseSummaryAddress::isValidEclipseCategory() const { switch ( category() ) { - case SummaryVarCategory::SUMMARY_FIELD: - case SummaryVarCategory::SUMMARY_AQUIFER: - case SummaryVarCategory::SUMMARY_NETWORK: - case SummaryVarCategory::SUMMARY_MISC: - case SummaryVarCategory::SUMMARY_REGION: - case SummaryVarCategory::SUMMARY_REGION_2_REGION: - case SummaryVarCategory::SUMMARY_GROUP: - case SummaryVarCategory::SUMMARY_WELL: - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: - case SummaryVarCategory::SUMMARY_WELL_LGR: - case SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: - case SummaryVarCategory::SUMMARY_WELL_SEGMENT: - case SummaryVarCategory::SUMMARY_BLOCK: - case SummaryVarCategory::SUMMARY_BLOCK_LGR: - case SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS: + case SummaryCategory::SUMMARY_FIELD: + case SummaryCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_MISC: + case SummaryCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_GROUP: + case SummaryCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: + case SummaryCategory::SUMMARY_WELL_SEGMENT: + case SummaryCategory::SUMMARY_BLOCK: + case SummaryCategory::SUMMARY_BLOCK_LGR: + case SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS: return true; } return false; @@ -1241,6 +1251,14 @@ bool RifEclipseSummaryAddress::isCalculated() const return m_id != -1; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RifEclipseSummaryAddress::isTime() const +{ + return m_category == SummaryCategory::SUMMARY_TIME; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h index af064c79bd..8dddb06d52 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddress.h @@ -37,7 +37,7 @@ class RifEclipseSummaryAddress public: RifEclipseSummaryAddress(); - RifEclipseSummaryAddress( SummaryVarCategory category, + RifEclipseSummaryAddress( SummaryCategory category, const std::string& vectorName, int regionNumber, int regionNumber2, @@ -53,7 +53,7 @@ class RifEclipseSummaryAddress bool isErrorResult, int id ); - RifEclipseSummaryAddress( SummaryVarCategory category, std::map& identifiers ); + RifEclipseSummaryAddress( SummaryCategory category, std::map& identifiers ); // Static specialized creation methods @@ -89,16 +89,19 @@ class RifEclipseSummaryAddress static RifEclipseSummaryAddress importedAddress( const std::string& vectorName, int calculationId = -1 ); static RifEclipseSummaryAddress ensembleStatisticsAddress( const std::string& vectorName, const std::string& datavectorName ); + // Special address when time is used as x-axis + static RifEclipseSummaryAddress timeAddress(); + static std::string generateStringFromAddresses( const std::vector& addressVector, const std::string jointString = "; " ); - static bool isDependentOnWellName( RifEclipseSummaryAddressDefines::SummaryVarCategory category ); + static bool isDependentOnWellName( RifEclipseSummaryAddressDefines::SummaryCategory category ); // Access methods - SummaryVarCategory category() const; - std::string vectorName() const; - bool isHistoryVector() const; + SummaryCategory category() const; + std::string vectorName() const; + bool isHistoryVector() const; int regionNumber() const; int regionNumber2() const; @@ -147,6 +150,7 @@ class RifEclipseSummaryAddress auto operator<=>( const RifEclipseSummaryAddress& rhs ) const = default; bool isCalculated() const; + bool isTime() const; std::string formatUiTextRegionToRegion() const; static std::pair regionToRegionPairFromUiText( const std::string& s ); @@ -163,15 +167,15 @@ class RifEclipseSummaryAddress // The ordering the variables are defined in defines how the objects get sorted. Members defined first will be // evaluated first. This concept is used by <=> operator. - SummaryVarCategory m_variableCategory; - std::string m_vectorName; - std::string m_name; - std::string m_lgrName; - int m_number0; - int m_number1; - int m_number2; - bool m_isErrorResult; - int m_id; + SummaryCategory m_category; + std::string m_vectorName; + std::string m_name; + std::string m_lgrName; + int m_number0; + int m_number1; + int m_number2; + bool m_isErrorResult; + int m_id; }; QTextStream& operator<<( QTextStream& str, const RifEclipseSummaryAddress& sobj ); diff --git a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h index acea27c528..9a4772903a 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h +++ b/ApplicationLibCode/FileInterface/RifEclipseSummaryAddressDefines.h @@ -29,7 +29,7 @@ namespace RifEclipseSummaryAddressDefines { // Based on list in ecl_smspec.c and list of types taken from Eclipse Reference Manual ecl_rm_2011.1.pdf -enum class SummaryVarCategory +enum class SummaryCategory { SUMMARY_INVALID, SUMMARY_FIELD, @@ -47,7 +47,8 @@ enum class SummaryVarCategory SUMMARY_BLOCK, SUMMARY_BLOCK_LGR, SUMMARY_IMPORTED, - SUMMARY_ENSEMBLE_STATISTICS + SUMMARY_ENSEMBLE_STATISTICS, + SUMMARY_TIME // Used to represent time as along the x-axis }; enum class SummaryIdentifierType diff --git a/ApplicationLibCode/FileInterface/RifEclipseUserDataKeywordTools.cpp b/ApplicationLibCode/FileInterface/RifEclipseUserDataKeywordTools.cpp index d1c00e78fc..c9f43e425d 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseUserDataKeywordTools.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseUserDataKeywordTools.cpp @@ -166,10 +166,10 @@ bool RifEclipseUserDataKeywordTools::isYearX( const std::string& identifier ) RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( const std::string quantityName, const std::vector& columnHeaderText ) { - RifEclipseSummaryAddressDefines::SummaryVarCategory category = + RifEclipseSummaryAddressDefines::SummaryCategory category = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( quantityName ); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { return RifEclipseSummaryAddress::importedAddress( quantityName ); } @@ -190,9 +190,9 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con switch ( category ) { - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD: break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER: { if ( columnHeaderText.size() > 0 ) { @@ -200,11 +200,11 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con } break; } - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK: break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC: break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION: { if ( columnHeaderText.size() > 0 ) { @@ -212,9 +212,9 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con } break; } - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION: break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: { if ( columnHeaderText.size() > 0 ) { @@ -222,7 +222,7 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con } break; } - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL: { if ( columnHeaderText.size() > 0 ) { @@ -230,7 +230,7 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con } break; } - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION: { if ( columnHeaderText.size() > 1 ) { @@ -241,14 +241,14 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con break; } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR: if ( columnHeaderText.size() > 1 ) { wellName = columnHeaderText[0]; lgrName = columnHeaderText[1]; } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: if ( columnHeaderText.size() > 2 ) { wellName = columnHeaderText[0]; @@ -257,20 +257,20 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con RifEclipseUserDataKeywordTools::extractThreeInts( &cellI, &cellJ, &cellK, columnHeaderText[2] ); } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT: if ( columnHeaderText.size() > 1 ) { wellName = columnHeaderText[0]; wellSegmentNumber = RiaStdStringTools::toInt( columnHeaderText[1] ); } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK: if ( columnHeaderText.size() > 0 ) { RifEclipseUserDataKeywordTools::extractThreeInts( &cellI, &cellJ, &cellK, columnHeaderText[0] ); } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR: if ( columnHeaderText.size() > 1 ) { lgrName = columnHeaderText[0]; diff --git a/ApplicationLibCode/FileInterface/RifEnsembleStatisticsReader.cpp b/ApplicationLibCode/FileInterface/RifEnsembleStatisticsReader.cpp index 60bb0009e1..28dcf3ddbc 100644 --- a/ApplicationLibCode/FileInterface/RifEnsembleStatisticsReader.cpp +++ b/ApplicationLibCode/FileInterface/RifEnsembleStatisticsReader.cpp @@ -111,6 +111,6 @@ RiaDefines::EclipseUnitSystem RifEnsembleStatisticsReader::unitSystem() const //-------------------------------------------------------------------------------------------------- bool RifEnsembleStatisticsReader::validateAddress( const RifEclipseSummaryAddress& address ) const { - return address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS && + return address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS && !address.vectorName().empty(); } diff --git a/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp b/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp index c2e1e16046..3d1d2eccf3 100644 --- a/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderObservedData.cpp @@ -45,9 +45,9 @@ RifReaderObservedData::~RifReaderObservedData() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifReaderObservedData::open( const QString& headerFileName, - const QString& identifierName, - RifEclipseSummaryAddressDefines::SummaryVarCategory summaryCategory ) +bool RifReaderObservedData::open( const QString& headerFileName, + const QString& identifierName, + RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ) { AsciiDataParseOptions parseOptions; parseOptions.dateFormat = "yyyy-MM-dd"; @@ -154,9 +154,9 @@ std::vector RifReaderObservedData::timeSteps( const RifEclipseSummaryAdd //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddress RifReaderObservedData::address( const QString& vectorName, - const QString& identifierName, - RifEclipseSummaryAddressDefines::SummaryVarCategory summaryCategory ) +RifEclipseSummaryAddress RifReaderObservedData::address( const QString& vectorName, + const QString& identifierName, + RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ) { std::string stdVectorName = vectorName.toStdString(); int regionNumber( -1 ); @@ -175,13 +175,13 @@ RifEclipseSummaryAddress RifReaderObservedData::address( const QString& switch ( summaryCategory ) { - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: groupName = identifierName.toStdString(); break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL: wellName = identifierName.toStdString(); break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR: lgrName = identifierName.toStdString(); break; default: diff --git a/ApplicationLibCode/FileInterface/RifReaderObservedData.h b/ApplicationLibCode/FileInterface/RifReaderObservedData.h index 7606478ce1..e91f59c58a 100644 --- a/ApplicationLibCode/FileInterface/RifReaderObservedData.h +++ b/ApplicationLibCode/FileInterface/RifReaderObservedData.h @@ -41,7 +41,7 @@ class RifReaderObservedData : public RifSummaryReaderInterface RifReaderObservedData(); ~RifReaderObservedData() override; - bool open( const QString& headerFileName, const QString& identifierName, RifEclipseSummaryAddressDefines::SummaryVarCategory summaryCategory ); + bool open( const QString& headerFileName, const QString& identifierName, RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ); std::vector timeSteps( const RifEclipseSummaryAddress& resultAddress ) const override; @@ -52,9 +52,8 @@ class RifReaderObservedData : public RifSummaryReaderInterface RiaDefines::EclipseUnitSystem unitSystem() const override; private: - RifEclipseSummaryAddress address( const QString& vectorName, - const QString& identifierName, - RifEclipseSummaryAddressDefines::SummaryVarCategory summaryCategory ); + RifEclipseSummaryAddress + address( const QString& vectorName, const QString& identifierName, RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory ); private: std::unique_ptr m_asciiParser; diff --git a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp index 78e8d531ab..6c3393d59f 100644 --- a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp +++ b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp @@ -52,9 +52,9 @@ RifRevealCsvSectionSummaryReader::~RifRevealCsvSectionSummaryReader() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RifRevealCsvSectionSummaryReader::parse( const QString& text, - RifEclipseSummaryAddressDefines::SummaryVarCategory defaultCategory, - QString* errorText ) +bool RifRevealCsvSectionSummaryReader::parse( const QString& text, + RifEclipseSummaryAddressDefines::SummaryCategory defaultCategory, + QString* errorText ) { m_allResultAddresses.clear(); m_mapFromAddressToResultIndex.clear(); @@ -82,7 +82,7 @@ bool RifRevealCsvSectionSummaryReader::parse( const QString& { "1000Sm3/d", { "SM3/DAY", 1000.0 } }, { "MSm3", { "SM3", 1000000.0 } } }; - QString prefix = defaultCategory == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD ? "F" : "W"; + QString prefix = defaultCategory == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD ? "F" : "W"; std::map nameMapping = { { "WaterCut", prefix + "WCT" }, { "GOR", prefix + "GOR" }, { "BottomHolePressure", prefix + "BHP" }, { "CumLiquidInjected", prefix + "LIT" }, diff --git a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.h b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.h index 9c02db4902..c5be4fbf88 100644 --- a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.h +++ b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.h @@ -35,5 +35,5 @@ class RifRevealCsvSectionSummaryReader : public RifCsvSummaryReader RifRevealCsvSectionSummaryReader(); ~RifRevealCsvSectionSummaryReader() override; - bool parse( const QString& fileName, RifEclipseSummaryAddressDefines::SummaryVarCategory defaultCategory, QString* errorText = nullptr ); + bool parse( const QString& fileName, RifEclipseSummaryAddressDefines::SummaryCategory defaultCategory, QString* errorText = nullptr ); }; diff --git a/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp b/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp index 25f11b1c4c..596ef222a0 100644 --- a/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp +++ b/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp @@ -66,8 +66,8 @@ std::pair RifRevealCsvSummaryReader::parse( const QString& fileNa cvf::ref sectionReader = new RifRevealCsvSectionSummaryReader; // The first part is field data, and the rest is well data - auto defaultCategory = isFirst ? RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD - : RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL; + auto defaultCategory = isFirst ? RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD + : RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL; QString errorMessage; if ( !sectionReader->parse( p, defaultCategory, &errorMessage ) ) diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlotCollection.cpp index 912a497c23..b396b58870 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlotCollection.cpp @@ -201,7 +201,7 @@ void RimAnalysisPlotCollection::applySummaryCaseCollectionAndFieldAddressToPlot( { for ( auto address : allAddresses ) { - if ( address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD ) + if ( address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD ) { if ( quantityName.empty() || quantityName == address.vectorName() ) { diff --git a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp index 2ae1f7e921..a127e8c328 100644 --- a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp @@ -641,8 +641,8 @@ void RimGridCrossPlot::swapAxes() QString tmpName = xAxisProperties->objectName(); QString tmpTitle = xAxisProperties->axisTitleText(); - RiuPlotAxis tmpAxis = xAxisProperties->plotAxisType(); - xAxisProperties->setNameAndAxis( yAxisProperties->objectName(), yAxisProperties->axisTitleText(), yAxisProperties->plotAxisType().axis() ); + RiuPlotAxis tmpAxis = xAxisProperties->plotAxis(); + xAxisProperties->setNameAndAxis( yAxisProperties->objectName(), yAxisProperties->axisTitleText(), yAxisProperties->plotAxis().axis() ); yAxisProperties->setNameAndAxis( tmpName, tmpTitle, tmpAxis.axis() ); m_xAxisProperties.removeChild( xAxisProperties ); @@ -855,7 +855,7 @@ void RimGridCrossPlot::updateAxisInQwt( RiaDefines::PlotAxis axisType ) axisParameterString = yAxisParameterString(); } - RiuPlotAxis axis = axisProperties->plotAxisType(); + RiuPlotAxis axis = axisProperties->plotAxis(); if ( axisProperties->isActive() ) { m_plotWidget->enableAxis( axis, true ); diff --git a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp index 8f7fe30ed5..d95122ad4c 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.cpp @@ -74,14 +74,14 @@ void RimDataSourceSteppingTools::modifyCurrentIndex( caf::PdmValueField* //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& oldValue, - const QVariant& newValue, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, - RifEclipseSummaryAddress* adr ) +bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& oldValue, + const QVariant& newValue, + RifEclipseSummaryAddressDefines::SummaryCategory category, + RifEclipseSummaryAddress* adr ) { if ( !adr ) return false; - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) { int oldInt = oldValue.toInt(); int newInt = newValue.toInt(); @@ -93,7 +93,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER ) { int oldInt = oldValue.toInt(); int newInt = newValue.toInt(); @@ -105,7 +105,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) { std::string oldString = oldValue.toString().toStdString(); std::string newString = newValue.toString().toStdString(); @@ -117,7 +117,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) { std::string oldString = oldValue.toString().toStdString(); std::string newString = newValue.toString().toStdString(); @@ -129,7 +129,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { std::string oldString = oldValue.toString().toStdString(); std::string newString = newValue.toString().toStdString(); @@ -141,8 +141,8 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK || - category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK || + category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION ) { std::string oldString = oldValue.toString().toStdString(); std::string newString = newValue.toString().toStdString(); @@ -153,7 +153,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION ) { std::string oldString = oldValue.toString().toStdString(); std::string newString = newValue.toString().toStdString(); @@ -166,7 +166,7 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant& return true; } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT ) { int oldInt = oldValue.toInt(); int newInt = newValue.toInt(); diff --git a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h index f3e25459ec..79ee1ce209 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h +++ b/ApplicationLibCode/ProjectDataModel/RimDataSourceSteppingTools.h @@ -36,10 +36,10 @@ class RimDataSourceSteppingTools int indexOffset, bool notifyChange = true ); - static bool updateAddressIfMatching( const QVariant& oldValue, - const QVariant& newValue, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, - RifEclipseSummaryAddress* adr ); + static bool updateAddressIfMatching( const QVariant& oldValue, + const QVariant& newValue, + RifEclipseSummaryAddressDefines::SummaryCategory category, + RifEclipseSummaryAddress* adr ); static bool updateHistoryAndSummaryQuantityIfMatching( const QVariant& oldValue, const QVariant& newValue, RifEclipseSummaryAddress* adr ); diff --git a/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp index 92aa241fc4..4d1435b8e5 100644 --- a/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp @@ -697,7 +697,7 @@ QString RimGridTimeHistoryCurve::geometrySelectionText() const //-------------------------------------------------------------------------------------------------- void RimGridTimeHistoryCurve::updateQwtPlotAxis() { - if ( m_plotCurve ) updateAxisInPlot( yAxis() ); + if ( m_plotCurve ) updateYAxisInPlot( yAxis() ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp index e3999857f8..f66ceac04a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.cpp @@ -98,8 +98,8 @@ RimMainPlotCollection::RimMainPlotCollection() CAF_PDM_InitFieldNoDefault( &m_correlationPlotCollection, "CorrelationPlotCollection", "Correlation Plots" ); m_correlationPlotCollection.uiCapability()->setUiTreeHidden( true ); - CAF_PDM_InitFieldNoDefault( &m_summaryCrossPlotCollection, "SummaryCrossPlotCollection", "Summary Cross Plots" ); - m_summaryCrossPlotCollection.uiCapability()->setUiTreeHidden( true ); + CAF_PDM_InitFieldNoDefault( &m_summaryCrossPlotCollection_OBSOLETE, "SummaryCrossPlotCollection", "Summary Cross Plots" ); + m_summaryCrossPlotCollection_OBSOLETE.uiCapability()->setUiTreeHidden( true ); CAF_PDM_InitFieldNoDefault( &m_summaryTableCollection, "SummaryTableCollection", "Summary Tables" ); m_summaryTableCollection.uiCapability()->setUiTreeHidden( true ); @@ -129,20 +129,20 @@ RimMainPlotCollection::RimMainPlotCollection() m_ensembleFractureStatisticsPlotCollection.uiCapability()->setUiTreeHidden( true ); #endif - m_wellLogPlotCollection = new RimWellLogPlotCollection(); - m_rftPlotCollection = new RimRftPlotCollection(); - m_pltPlotCollection = new RimPltPlotCollection(); - m_summaryMultiPlotCollection = new RimSummaryMultiPlotCollection(); - m_summaryCrossPlotCollection = new RimSummaryCrossPlotCollection(); - m_summaryTableCollection = new RimSummaryTableCollection(); - m_flowPlotCollection = new RimFlowPlotCollection(); - m_gridCrossPlotCollection = new RimGridCrossPlotCollection; - m_saturationPressurePlotCollection = new RimSaturationPressurePlotCollection; - m_multiPlotCollection = new RimMultiPlotCollection; - m_analysisPlotCollection = new RimAnalysisPlotCollection; - m_correlationPlotCollection = new RimCorrelationPlotCollection; - m_stimPlanModelPlotCollection = new RimStimPlanModelPlotCollection; - m_vfpPlotCollection = new RimVfpPlotCollection(); + m_wellLogPlotCollection = new RimWellLogPlotCollection(); + m_rftPlotCollection = new RimRftPlotCollection(); + m_pltPlotCollection = new RimPltPlotCollection(); + m_summaryMultiPlotCollection = new RimSummaryMultiPlotCollection(); + m_summaryCrossPlotCollection_OBSOLETE = new RimSummaryCrossPlotCollection(); + m_summaryTableCollection = new RimSummaryTableCollection(); + m_flowPlotCollection = new RimFlowPlotCollection(); + m_gridCrossPlotCollection = new RimGridCrossPlotCollection; + m_saturationPressurePlotCollection = new RimSaturationPressurePlotCollection; + m_multiPlotCollection = new RimMultiPlotCollection; + m_analysisPlotCollection = new RimAnalysisPlotCollection; + m_correlationPlotCollection = new RimCorrelationPlotCollection; + m_stimPlanModelPlotCollection = new RimStimPlanModelPlotCollection; + m_vfpPlotCollection = new RimVfpPlotCollection(); #ifdef USE_QTCHARTS m_gridStatisticsPlotCollection = new RimGridStatisticsPlotCollection; m_ensembleFractureStatisticsPlotCollection = new RimEnsembleFractureStatisticsPlotCollection; @@ -242,7 +242,7 @@ RimSummaryMultiPlotCollection* RimMainPlotCollection::summaryMultiPlotCollection //-------------------------------------------------------------------------------------------------- RimSummaryCrossPlotCollection* RimMainPlotCollection::summaryCrossPlotCollection() const { - return m_summaryCrossPlotCollection(); + return m_summaryCrossPlotCollection_OBSOLETE(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h index 3dc02afb02..1ec6bccecd 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h +++ b/ApplicationLibCode/ProjectDataModel/RimMainPlotCollection.h @@ -112,7 +112,7 @@ class RimMainPlotCollection : public caf::PdmObject caf::PdmChildField m_rftPlotCollection; caf::PdmChildField m_pltPlotCollection; caf::PdmChildField m_summaryMultiPlotCollection; - caf::PdmChildField m_summaryCrossPlotCollection; + caf::PdmChildField m_summaryCrossPlotCollection_OBSOLETE; caf::PdmChildField m_summaryTableCollection; caf::PdmChildField m_analysisPlotCollection; caf::PdmChildField m_correlationPlotCollection; diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp index b4ec8e965b..f58c2ae03f 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.cpp @@ -145,12 +145,7 @@ void RimPlotAxisProperties::enableRangeSettings( bool enable ) //-------------------------------------------------------------------------------------------------- void RimPlotAxisProperties::setNameForUnusedAxis() { - QString name = "Unused "; - - if ( m_plotAxis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT ) - name += "Left"; - else if ( m_plotAxis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) - name += "Right"; + QString name = "Unused " + m_plotAxis().text(); m_objectName = name; } @@ -184,18 +179,6 @@ QList RimPlotAxisProperties::calculateValueOptions( cons { options = caf::FontTools::relativeSizeValueOptions( RiaPreferences::current()->defaultPlotFontSize() ); } - else if ( fieldNeedingOptions == &m_plotAxis ) - { - std::vector plotAxes = { RiaDefines::PlotAxis::PLOT_AXIS_LEFT, RiaDefines::PlotAxis::PLOT_AXIS_RIGHT }; - - for ( auto plotAxis : plotAxes ) - { - auto plotAxisEnum = caf::AppEnum( plotAxis ); - - QString uiText = plotAxisEnum.uiText(); - options.push_back( caf::PdmOptionItemInfo( uiText, plotAxisEnum.value() ) ); - } - } return options; } @@ -327,7 +310,7 @@ const QString RimPlotAxisProperties::axisTitleText() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RiuPlotAxis RimPlotAxisProperties::plotAxisType() const +RiuPlotAxis RimPlotAxisProperties::plotAxis() const { return RiuPlotAxis( m_plotAxis.value(), m_plotAxisIndex ); } @@ -712,7 +695,7 @@ void RimPlotAxisProperties::fieldChangedByUi( const caf::PdmFieldHandle* changed else if ( changedField == &m_plotAxis ) { RiuPlotAxis oldPlotAxis = RiuPlotAxis( (RiaDefines::PlotAxis)oldValue.toInt(), m_plotAxisIndex ); - axisPositionChanged.send( this, oldPlotAxis, plotAxisType() ); + axisPositionChanged.send( this, oldPlotAxis, plotAxis() ); } else { diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h index fb96a8a04d..dc9acacd7a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisProperties.h @@ -73,7 +73,7 @@ class RimPlotAxisProperties : public RimPlotAxisPropertiesInterface const QString objectName() const override; const QString axisTitleText() const override; - RiuPlotAxis plotAxisType() const override; + RiuPlotAxis plotAxis() const override; bool useAutoTitle() const; void setShowDescription( bool enable ); diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h b/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h index 2abbd3e1f1..e752348826 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotAxisPropertiesInterface.h @@ -56,7 +56,7 @@ class RimPlotAxisPropertiesInterface : public caf::PdmObject virtual std::vector annotations() const = 0; virtual void appendAnnotation( RimPlotAxisAnnotation* annotation ) = 0; virtual void removeAllAnnotations() = 0; - virtual RiuPlotAxis plotAxisType() const = 0; + virtual RiuPlotAxis plotAxis() const = 0; virtual double visibleRangeMin() const = 0; virtual double visibleRangeMax() const = 0; diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp index 74d25a588a..c2123a22ea 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp @@ -575,14 +575,6 @@ void RimPlotCurve::checkAndApplyDefaultFillColor() // } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimPlotCurve::isCrossPlotCurve() const -{ - return firstAncestorOrThisOfType() != nullptr; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -875,11 +867,19 @@ void RimPlotCurve::setSamplesFromXYErrorValues( const std::vector& xVa //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimPlotCurve::updateAxisInPlot( RiuPlotAxis plotAxis ) +void RimPlotCurve::updateYAxisInPlot( RiuPlotAxis plotAxis ) { if ( m_plotCurve ) m_plotCurve->setYAxis( plotAxis ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPlotCurve::updateXAxisInPlot( RiuPlotAxis plotAxis ) +{ + if ( m_plotCurve ) m_plotCurve->setXAxis( plotAxis ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h index 1e43dc311c..1b2ecf1a40 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h @@ -115,7 +115,6 @@ class RimPlotCurve : public caf::PdmObject void setErrorBarsVisible( bool isVisible ); virtual void updateCurveAppearance(); - bool isCrossPlotCurve() const; virtual void updateUiIconFromPlotSymbol(); virtual bool hasParentPlot() const; @@ -186,7 +185,8 @@ class RimPlotCurve : public caf::PdmObject virtual void clearErrorBars(); void checkAndApplyDefaultFillColor(); - virtual void updateAxisInPlot( RiuPlotAxis plotAxis ); + void updateYAxisInPlot( RiuPlotAxis plotAxis ); + void updateXAxisInPlot( RiuPlotAxis plotAxis ); void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; diff --git a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp index 24614fd606..35d100cc2b 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp @@ -516,7 +516,7 @@ QList RimSimWellInViewCollection::calculateValueOptions( auto addresses = summaryCase->summaryReader()->allResultAddresses(); for ( auto addr : addresses ) { - if ( addr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + if ( addr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { summaries.insert( addr.vectorName() ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp b/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp index ef95f556f1..2d89a6bf2b 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.cpp @@ -239,45 +239,45 @@ void RimSummaryCalculation::substituteVariables( std::vector RimSummaryCalculation::allAddressesFor /// //-------------------------------------------------------------------------------------------------- std::vector - RimSummaryCalculation::allAddressesForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category, - const std::set& allResultAddresses ) const + RimSummaryCalculation::allAddressesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category, + const std::set& allResultAddresses ) const { std::vector addresses; std::string name = shortName().toStdString(); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD ) + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD ) { addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::fieldAddress( name, m_id ) ) ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER ) { std::set uniqueNumbers; std::for_each( allResultAddresses.begin(), @@ -515,11 +515,11 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::aquiferAddress( name, num, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC ) { addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::miscAddress( name, m_id ) ) ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) { std::set uniqueNames; std::for_each( allResultAddresses.begin(), @@ -531,7 +531,7 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::networkAddress( name, networkName, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { std::set uniqueWellNames; std::for_each( allResultAddresses.begin(), @@ -543,7 +543,7 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::wellAddress( name, wellName, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) { std::set uniqueGroupNames; std::for_each( allResultAddresses.begin(), @@ -555,7 +555,7 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::groupAddress( name, groupName, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) { std::set uniqueRegionNumbers; std::for_each( allResultAddresses.begin(), @@ -567,7 +567,7 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::regionAddress( name, regionNumber, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION ) { std::set> uniqueRegionNumbers; std::for_each( allResultAddresses.begin(), @@ -580,7 +580,7 @@ std::vector addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::regionToRegionAddress( name, r1, r2, m_id ) ) ); } } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED ) { addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::importedAddress( name, m_id ) ) ); } @@ -595,40 +595,40 @@ RimSummaryCalculationAddress RimSummaryCalculation::singleAddressesForCategory( { std::string name = shortName().toStdString(); - RifEclipseSummaryAddressDefines::SummaryVarCategory category = address.category(); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD ) + RifEclipseSummaryAddressDefines::SummaryCategory category = address.category(); + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD ) { return RifEclipseSummaryAddress::fieldAddress( name, m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER ) { return RifEclipseSummaryAddress::aquiferAddress( name, address.aquiferNumber(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC ) { return RifEclipseSummaryAddress::miscAddress( name, m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) { return RifEclipseSummaryAddress::networkAddress( name, address.networkName(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { return RifEclipseSummaryAddress::wellAddress( name, address.wellName(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) { return RifEclipseSummaryAddress::groupAddress( name, address.groupName(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) { return RifEclipseSummaryAddress::regionAddress( name, address.regionNumber(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION ) { return RifEclipseSummaryAddress::regionToRegionAddress( name, address.regionNumber(), address.regionNumber2(), m_id ); } - else if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED ) + else if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED ) { return RifEclipseSummaryAddress::importedAddress( name, m_id ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.h b/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.h index aef1f33ebb..d4d55a7fff 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.h +++ b/ApplicationLibCode/ProjectDataModel/RimSummaryCalculation.h @@ -77,7 +77,7 @@ class RimSummaryCalculation : public RimUserDefinedCalculation static void substituteVariables( std::vector& vars, const RifEclipseSummaryAddress& address ); - std::vector allAddressesForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category, + std::vector allAddressesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category, const std::set& allResultAddresses ) const; RimSummaryCalculationAddress singleAddressesForCategory( const RifEclipseSummaryAddress& address ) const; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp index 650c74236a..80b811fdc7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimAsciiDataCurve.cpp @@ -197,7 +197,7 @@ void RimAsciiDataCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi //-------------------------------------------------------------------------------------------------- void RimAsciiDataCurve::updateQwtPlotAxis() { - if ( m_plotCurve ) updateAxisInPlot( yAxis() ); + if ( m_plotCurve ) updateYAxisInPlot( yAxis() ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index e5a8a1ff92..50f7d2f5d8 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -424,6 +424,14 @@ RifEclipseSummaryAddress RimEnsembleCurveSet::summaryAddress() const return m_yValuesSummaryAddress->address(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaSummaryCurveAddress RimEnsembleCurveSet::curveAddress() const +{ + return RiaSummaryCurveAddress( summaryAddress(), RifEclipseSummaryAddress::timeAddress() ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -449,7 +457,7 @@ void RimEnsembleCurveSet::deleteEnsembleCurves() for ( size_t c = 0; c < m_curves.size(); c++ ) { RimSummaryCurve* curve = m_curves[c]; - if ( curve->summaryAddressY().category() != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + if ( curve->summaryAddressY().category() != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) curvesIndexesToDelete.push_back( c ); } @@ -471,7 +479,7 @@ void RimEnsembleCurveSet::deleteStatisticsCurves() for ( size_t c = 0; c < m_curves.size(); c++ ) { RimSummaryCurve* curve = m_curves[c]; - if ( curve->summaryAddressY().category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + if ( curve->summaryAddressY().category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) curvesIndexesToDelete.push_back( c ); } @@ -583,7 +591,7 @@ void RimEnsembleCurveSet::updateAllCurves() RimSummaryCaseCollection* group = m_yValuesSummaryCaseCollection(); RimSummaryAddress* addr = m_yValuesSummaryAddress(); - if ( group && addr->address().category() != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + if ( group && addr->address().category() != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { std::vector allCases = group->allSummaryCases(); std::vector filteredCases = filterEnsembleCases( allCases ); @@ -1403,7 +1411,7 @@ std::vector RimEnsembleCurveSet::curveDefinitions() c std::vector curveDefs; for ( auto dataEntry : m_curves() ) { - curveDefs.push_back( dataEntry->curveDefinitionY() ); + curveDefs.push_back( dataEntry->curveDefinition() ); } return curveDefs; @@ -1669,7 +1677,7 @@ void RimEnsembleCurveSet::updateCurveColors() std::vector summaryCases; for ( auto& curve : m_curves ) { - if ( curve->summaryAddressY().category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + if ( curve->summaryAddressY().category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) continue; curvesToColor.push_back( curve ); @@ -1785,7 +1793,7 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vectoraddress().category() != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + if ( plot && addr->address().category() != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { if ( isCurvesVisible() ) { @@ -1856,7 +1864,7 @@ void RimEnsembleCurveSet::updateStatisticsCurves( const std::vectoraddress().category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + addr->address().category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) return; // Calculate @@ -2147,12 +2155,9 @@ QString RimEnsembleCurveSet::createAutoName() const { auto plot = firstAncestorOrThisOfTypeAsserted(); - QString curveSetName = - m_summaryAddressNameTools->curveNameY( m_yValuesSummaryAddress->address(), plot->plotTitleHelper(), plot->plotTitleHelper() ); - if ( curveSetName.isEmpty() ) - { - curveSetName = m_summaryAddressNameTools->curveNameY( m_yValuesSummaryAddress->address(), nullptr, nullptr ); - } + QString curveSetName = m_summaryAddressNameTools->curveName( RiaSummaryCurveAddress( m_yValuesSummaryAddress->address() ), + plot->plotTitleHelper(), + plot->plotTitleHelper() ); if ( curveSetName.isEmpty() ) { @@ -2211,7 +2216,7 @@ int statisticsCurveSymbolSize( RiuPlotCurveSymbol::PointSymbolEnum symbol ) RiuPlotAxis RimEnsembleCurveSet::axisY() const { if ( m_plotAxisProperties ) - return m_plotAxisProperties->plotAxisType(); + return m_plotAxisProperties->plotAxis(); else return RiuPlotAxis::defaultLeft(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h index c5a9072d35..75113758d5 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h @@ -24,6 +24,7 @@ #include "RiaDateTimeDefines.h" #include "RiaPlotDefines.h" +#include "RiaSummaryCurveAddress.h" #include "RimEnsembleCurveSetColorManager.h" #include "RimEnsembleCurveSetInterface.h" @@ -112,6 +113,7 @@ class RimEnsembleCurveSet : public caf::PdmObject, public RimEnsembleCurveSetInt void setSummaryAddress( RifEclipseSummaryAddress address ); void setSummaryAddressAndStatisticsFlag( RifEclipseSummaryAddress address ); RifEclipseSummaryAddress summaryAddress() const; + RiaSummaryCurveAddress curveAddress() const; std::vector curves() const; int ensembleId() const; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp index 7286fb86f6..81c11540f6 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.cpp @@ -49,12 +49,12 @@ QString RimMultiSummaryPlotNameHelper::plotTitle() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimMultiSummaryPlotNameHelper::isPlotDisplayingSingleVectorName() const +bool RimMultiSummaryPlotNameHelper::isPlotDisplayingSingleCurve() const { int plotCountWithSingleQuantity = 0; for ( auto nameHelper : m_nameHelpers ) { - if ( nameHelper->isPlotDisplayingSingleVectorName() ) plotCountWithSingleQuantity++; + if ( nameHelper->isPlotDisplayingSingleCurve() ) plotCountWithSingleQuantity++; } return plotCountWithSingleQuantity == 1; @@ -160,7 +160,7 @@ std::string RimMultiSummaryPlotNameHelper::titleVectorName() const { for ( auto nameHelper : m_nameHelpers ) { - if ( nameHelper->isPlotDisplayingSingleVectorName() ) return nameHelper->titleVectorName(); + if ( nameHelper->isPlotDisplayingSingleCurve() ) return nameHelper->titleVectorName(); } return ""; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h index 56d6ed9581..62039afd7c 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimMultipleSummaryPlotNameHelper.h @@ -30,7 +30,7 @@ class RimMultiSummaryPlotNameHelper : public RimSummaryNameHelper QString plotTitle() const override; - bool isPlotDisplayingSingleVectorName() const override; + bool isPlotDisplayingSingleCurve() const override; bool isWellNameInTitle() const override; bool isGroupNameInTitle() const override; bool isNetworkInTitle() const override; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.cpp index cbef91fef0..f744982437 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.cpp @@ -43,8 +43,8 @@ RimObservedSummaryData::RimObservedSummaryData() m_useCustomIdentifier.uiCapability()->setUiHidden( true ); CAF_PDM_InitField( &m_summaryCategory, "SummaryType", - caf::AppEnum( - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ), + caf::AppEnum( + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ), "Summary Type" ); m_summaryCategory.uiCapability()->setUiHidden( true ); CAF_PDM_InitFieldNoDefault( &m_identifierName, "IdentifierName", "Identifier Name" ); @@ -72,7 +72,7 @@ QString RimObservedSummaryData::identifierName() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddressDefines::SummaryVarCategory RimObservedSummaryData::summaryCategory() const +RifEclipseSummaryAddressDefines::SummaryCategory RimObservedSummaryData::summaryCategory() const { return m_summaryCategory(); } @@ -102,7 +102,7 @@ void RimObservedSummaryData::updateMetaData() //-------------------------------------------------------------------------------------------------- QString RimObservedSummaryData::customWellName() const { - if ( m_useCustomIdentifier() && m_summaryCategory() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + if ( m_useCustomIdentifier() && m_summaryCategory() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { return m_identifierName(); } @@ -119,11 +119,11 @@ QList RimObservedSummaryData::calculateValueOptions( con { QList options; - using AddressAppEnum = caf::AppEnum; - options.push_back( caf::PdmOptionItemInfo( AddressAppEnum::uiText( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ), - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) ); - options.push_back( caf::PdmOptionItemInfo( AddressAppEnum::uiText( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ), - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) ); + using AddressAppEnum = caf::AppEnum; + options.push_back( caf::PdmOptionItemInfo( AddressAppEnum::uiText( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ), + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) ); + options.push_back( caf::PdmOptionItemInfo( AddressAppEnum::uiText( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ), + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) ); return options; } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h b/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h index e1d729b84b..fc6b28603f 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimObservedSummaryData.h @@ -38,8 +38,8 @@ class RimObservedSummaryData : public RimSummaryCase QString caseName() const override; - QString identifierName() const; - RifEclipseSummaryAddressDefines::SummaryVarCategory summaryCategory() const; + QString identifierName() const; + RifEclipseSummaryAddressDefines::SummaryCategory summaryCategory() const; void updateMetaData(); @@ -51,9 +51,9 @@ class RimObservedSummaryData : public RimSummaryCase void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; private: - caf::PdmField> m_summaryCategory; - caf::PdmField m_identifierName; - caf::PdmField m_useCustomIdentifier; + caf::PdmField> m_summaryCategory; + caf::PdmField m_identifierName; + caf::PdmField m_useCustomIdentifier; caf::PdmField m_importedSummaryData; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.cpp index 504eed6723..cefc8e4678 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.cpp @@ -29,9 +29,9 @@ namespace caf { template <> -void caf::AppEnum::setUp() +void caf::AppEnum::setUp() { - using RifAdr = RifEclipseSummaryAddressDefines::SummaryVarCategory; + using RifAdr = RifEclipseSummaryAddressDefines::SummaryCategory; addItem( RifAdr::SUMMARY_FIELD, "SUMMARY_FIELD", RiaDefines::summaryField() ); addItem( RifAdr::SUMMARY_AQUIFER, "SUMMARY_AQUIFER", RiaDefines::summaryAquifer() ); @@ -82,7 +82,7 @@ RimSummaryAddress::RimSummaryAddress() CAF_PDM_InitField( &m_caseId, "CaseId", -1, "CaseId" ); CAF_PDM_InitField( &m_ensembleId, "EnsembleId", -1, "EnsembleId" ); - m_category = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID; + m_category = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID; m_regionNumber = -1; m_regionNumber2 = -1; m_wellSegmentNumber = -1; @@ -186,14 +186,14 @@ RiaDefines::PhaseType RimSummaryAddress::addressPhaseType() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RimSummaryAddress::keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category ) const +QString RimSummaryAddress::keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category ) const { // Return the keyword text for supported field replacement in plot templates - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) return m_wellName.keyword(); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) return m_groupName.keyword(); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) return m_regionNumber.keyword(); - if ( category == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) return m_networkName.keyword(); + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) return m_wellName.keyword(); + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) return m_groupName.keyword(); + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) return m_regionNumber.keyword(); + if ( category == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) return m_networkName.keyword(); return {}; } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.h index 7e506a13ce..20088ee191 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddress.h @@ -60,7 +60,7 @@ class RimSummaryAddress : public caf::PdmObject RiaDefines::PhaseType addressPhaseType() const; - QString keywordForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory category ) const; + QString keywordForCategory( RifEclipseSummaryAddressDefines::SummaryCategory category ) const; protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; @@ -68,7 +68,7 @@ class RimSummaryAddress : public caf::PdmObject QString iconResourceText() const; private: - caf::PdmField> m_category; + caf::PdmField> m_category; caf::PdmField m_vectorName; caf::PdmField m_regionNumber; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp index 1764d2ac6b..94db19360e 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressCollection.cpp @@ -212,27 +212,27 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddAddress( address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_AQUIFER: + case SummaryCategory::SUMMARY_AQUIFER: aquifer->addToSubfolder( QString::number( address.aquiferNumber() ), CollectionContentType::AQUIFER, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_NETWORK: + case SummaryCategory::SUMMARY_NETWORK: networks->addToSubfolder( QString::fromStdString( address.networkName() ), CollectionContentType::NETWORK, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_MISC: + case SummaryCategory::SUMMARY_MISC: misc->addAddress( address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_REGION: + case SummaryCategory::SUMMARY_REGION: regions->addToSubfolder( QString::number( address.regionNumber() ), CollectionContentType::REGION, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_REGION_2_REGION: + case SummaryCategory::SUMMARY_REGION_2_REGION: region2region->addToSubfolder( QString::fromStdString( address.itemUiText() ), CollectionContentType::REGION_2_REGION, address, @@ -240,15 +240,15 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddToSubfolder( QString::fromStdString( address.groupName() ), CollectionContentType::GROUP, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_WELL: + case SummaryCategory::SUMMARY_WELL: wells->addToSubfolder( QString::fromStdString( address.wellName() ), CollectionContentType::WELL, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case SummaryCategory::SUMMARY_WELL_COMPLETION: completion->addToSubfolderTree( { QString::fromStdString( address.wellName() ), QString::fromStdString( address.blockAsString() ) }, CollectionContentType::WELL_COMPLETION, @@ -257,7 +257,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddToSubfolderTree( { QString::fromStdString( address.wellName() ), QString::number( address.wellSegmentNumber() ) }, CollectionContentType::WELL_SEGMENT, address, @@ -265,11 +265,11 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddToSubfolder( QString::fromStdString( address.blockAsString() ), CollectionContentType::BLOCK, address, caseId, ensembleId ); break; - case SummaryVarCategory::SUMMARY_WELL_LGR: + case SummaryCategory::SUMMARY_WELL_LGR: lgrwell->addToSubfolderTree( { QString::fromStdString( address.lgrName() ), QString::fromStdString( address.wellName() ) }, CollectionContentType::WELL_LGR, address, @@ -277,7 +277,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddToSubfolderTree( { QString::fromStdString( address.lgrName() ), QString::fromStdString( address.wellName() ), QString::fromStdString( address.blockAsString() ) }, @@ -287,7 +287,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddToSubfolderTree( { QString::fromStdString( address.lgrName() ), QString::fromStdString( address.blockAsString() ) }, CollectionContentType::BLOCK_LGR, address, @@ -295,7 +295,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::setaddAddress( address, caseId, ensembleId ); break; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp index 6abeb75401..64af8dfc8d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp @@ -27,15 +27,7 @@ CAF_PDM_SOURCE_INIT( RimSummaryCrossPlot, "SummaryCrossPlot" ); /// //-------------------------------------------------------------------------------------------------- RimSummaryCrossPlot::RimSummaryCrossPlot() - : RimSummaryPlot( true ) + : RimSummaryPlot() { CAF_PDM_InitObject( "Summary Cross Plot", ":/SummaryXPlotLight16x16.png" ); } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimSummaryPlotSourceStepping* RimSummaryCrossPlot::sourceSteppingObjectForKeyEventHandling() const -{ - return summaryCurveCollection()->sourceSteppingObject( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); -} diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h index 480aaf0f39..3f1f456538 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h @@ -30,6 +30,4 @@ class RimSummaryCrossPlot : public RimSummaryPlot public: RimSummaryCrossPlot(); - - RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const override; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index ee58b359cc..127a082df7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -27,6 +27,7 @@ #include "RiaQDateTimeTools.h" #include "RiaResultNames.h" #include "RiaSummaryCurveDefinition.h" +#include "RiaSummaryDefines.h" #include "RiaSummaryTools.h" #include "RimEclipseResultCase.h" @@ -52,6 +53,7 @@ #include "RiuQwtPlotCurve.h" #include "RiuSummaryVectorSelectionDialog.h" +#include "cafAssert.h" #include "cafPdmUiComboBoxEditor.h" #include "cafPdmUiLineEditor.h" #include "cafPdmUiPushButtonEditor.h" @@ -86,9 +88,15 @@ RimSummaryCurve::RimSummaryCurve() m_yValuesSummaryAddress = new RimSummaryAddress; - CAF_PDM_InitFieldNoDefault( &m_resampling, "Resampling", "Resampling" ); + CAF_PDM_InitFieldNoDefault( &m_yValuesResampling, "Resampling", "Resampling" ); // X Values + + CAF_PDM_InitField( &m_xAxisType, + "HorizontalAxisType", + caf::AppEnum( RiaDefines::HorizontalAxisType::TIME ), + "Axis Type" ); + CAF_PDM_InitFieldNoDefault( &m_xValuesSummaryCase, "SummaryCaseX", "Case" ); m_xValuesSummaryCase.uiCapability()->setUiTreeChildrenHidden( true ); m_xValuesSummaryCase.uiCapability()->setAutoAddingOptionFromValue( false ); @@ -116,7 +124,8 @@ RimSummaryCurve::RimSummaryCurve() CAF_PDM_InitFieldNoDefault( &m_plotAxis_OBSOLETE, "PlotAxis", "Axis" ); m_plotAxis_OBSOLETE.xmlCapability()->setIOWritable( false ); - CAF_PDM_InitFieldNoDefault( &m_plotAxisProperties, "Axis", "Axis" ); + CAF_PDM_InitFieldNoDefault( &m_yPlotAxisProperties, "Axis", "Axis" ); + CAF_PDM_InitFieldNoDefault( &m_xPlotAxisProperties, "XAxis", "Axis" ); CAF_PDM_InitFieldNoDefault( &m_curveNameConfig, "SummaryCurveNameConfig", "SummaryCurveNameConfig" ); m_curveNameConfig.uiCapability()->setUiTreeHidden( true ); @@ -143,9 +152,24 @@ RimSummaryCurve::~RimSummaryCurve() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RiaSummaryCurveDefinition RimSummaryCurve::curveDefinitionY() const +RiaSummaryCurveDefinition RimSummaryCurve::curveDefinition() const +{ + RiaSummaryCurveDefinition curveDefinition( summaryCaseY(), summaryAddressY(), isEnsembleCurve() ); + if ( m_xAxisType() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) + { + curveDefinition.setSummaryCaseX( summaryCaseX() ); + curveDefinition.setSummaryAddressX( summaryAddressX() ); + } + + return curveDefinition; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaSummaryCurveAddress RimSummaryCurve::curveAddress() const { - return RiaSummaryCurveDefinition( summaryCaseY(), summaryAddressY(), isEnsembleCurve() ); + return RiaSummaryCurveAddress( summaryAddressX(), summaryAddressY() ); } //-------------------------------------------------------------------------------------------------- @@ -179,6 +203,8 @@ RimSummaryCase* RimSummaryCurve::summaryCaseY() const //-------------------------------------------------------------------------------------------------- RifEclipseSummaryAddress RimSummaryCurve::summaryAddressX() const { + if ( m_xAxisType == RiaDefines::HorizontalAxisType::TIME ) return RifEclipseSummaryAddress::timeAddress(); + return m_xValuesSummaryAddress->address(); } @@ -192,6 +218,28 @@ void RimSummaryCurve::setSummaryAddressX( const RifEclipseSummaryAddress& addres // TODO: Should interpolation be computed similar to RimSummaryCurve::setSummaryAddressY } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryCurve::setTopOrBottomAxisX( RiuPlotAxis plotAxis ) +{ + CAF_ASSERT( plotAxis.isHorizontal() ); + + RimSummaryPlot* plot = firstAncestorOrThisOfTypeAsserted(); + m_xPlotAxisProperties = plot->axisPropertiesForPlotAxis( plotAxis ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiuPlotAxis RimSummaryCurve::axisX() const +{ + if ( m_xPlotAxisProperties ) + return m_xPlotAxisProperties->plotAxis(); + else + return RiuPlotAxis::defaultBottom(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -279,16 +327,6 @@ std::vector RimSummaryCurve::valuesY() const return values; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSummaryCurve::applyCurveDefinitionY( const RiaSummaryCurveDefinition& curveDefinition ) -{ - setSummaryCaseY( curveDefinition.summaryCase() ); - setSummaryAddressY( curveDefinition.summaryAddress() ); - setIsEnsembleCurve( curveDefinition.isEnsembleCurve() ); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -398,9 +436,17 @@ void RimSummaryCurve::setOverrideCurveDataY( const std::vector& dateTime //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RiaSummaryCurveDefinition RimSummaryCurve::curveDefinitionX() const +void RimSummaryCurve::setAxisTypeX( RiaDefines::HorizontalAxisType axisType ) { - return RiaSummaryCurveDefinition( summaryCaseX(), summaryAddressX(), isEnsembleCurve() ); + m_xAxisType = axisType; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaDefines::HorizontalAxisType RimSummaryCurve::axisTypeX() const +{ + return m_xAxisType(); } //-------------------------------------------------------------------------------------------------- @@ -429,10 +475,12 @@ RimSummaryCase* RimSummaryCurve::summaryCaseX() const //-------------------------------------------------------------------------------------------------- void RimSummaryCurve::setLeftOrRightAxisY( RiuPlotAxis plotAxis ) { + CAF_ASSERT( plotAxis.isVertical() ); + m_plotAxis_OBSOLETE = plotAxis.axis(); - RimSummaryPlot* plot = firstAncestorOrThisOfTypeAsserted(); - m_plotAxisProperties = plot->axisPropertiesForPlotAxis( plotAxis ); + RimSummaryPlot* plot = firstAncestorOrThisOfTypeAsserted(); + m_yPlotAxisProperties = plot->axisPropertiesForPlotAxis( plotAxis ); } //-------------------------------------------------------------------------------------------------- @@ -440,8 +488,8 @@ void RimSummaryCurve::setLeftOrRightAxisY( RiuPlotAxis plotAxis ) //-------------------------------------------------------------------------------------------------- RiuPlotAxis RimSummaryCurve::axisY() const { - if ( m_plotAxisProperties ) - return m_plotAxisProperties->plotAxisType(); + if ( m_yPlotAxisProperties ) + return m_yPlotAxisProperties->plotAxis(); else return RiuPlotAxis::defaultLeft(); } @@ -499,18 +547,28 @@ QList RimSummaryCurve::calculateValueOptions( const caf: { appendOptionItemsForSummaryAddresses( &options, m_xValuesSummaryCase() ); } - else if ( fieldNeedingOptions == &m_plotAxisProperties ) + else if ( fieldNeedingOptions == &m_yPlotAxisProperties ) { auto plot = firstAncestorOrThisOfTypeAsserted(); for ( auto axis : plot->plotAxes() ) { + // TODO: Should we allow time axis to be used as Y axis? if ( dynamic_cast( axis ) ) { options.push_back( caf::PdmOptionItemInfo( axis->objectName(), axis ) ); } } } + else if ( fieldNeedingOptions == &m_xPlotAxisProperties ) + { + auto plot = firstAncestorOrThisOfTypeAsserted(); + + for ( auto axis : plot->plotAxes() ) + { + options.push_back( caf::PdmOptionItemInfo( axis->objectName(), axis ) ); + } + } return options; } @@ -540,26 +598,8 @@ QString RimSummaryCurve::createCurveAutoName() } RimMultiSummaryPlotNameHelper multiNameHelper( plotNameHelpers ); - QString curveName = m_curveNameConfig->curveNameY( m_yValuesSummaryAddress->address(), currentPlotNameHelper, &multiNameHelper ); - if ( curveName.isEmpty() ) - { - curveName = m_curveNameConfig->curveNameY( m_yValuesSummaryAddress->address(), nullptr, nullptr ); - } - - if ( isCrossPlotCurve() ) - { - QString curveNameX = m_curveNameConfig->curveNameX( m_xValuesSummaryAddress->address(), currentPlotNameHelper, &multiNameHelper ); - if ( curveNameX.isEmpty() ) - { - curveNameX = m_curveNameConfig->curveNameX( m_xValuesSummaryAddress->address(), nullptr, nullptr ); - } - - if ( !curveName.isEmpty() || !curveNameX.isEmpty() ) - { - curveName += " | " + curveNameX; - } - } + QString curveName = m_curveNameConfig->curveName( curveAddress(), currentPlotNameHelper, &multiNameHelper ); if ( curveName.isEmpty() ) { curveName = "Curve Name Placeholder"; @@ -601,7 +641,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) bool shouldPopulateViewWithEmptyData = false; - if ( isCrossPlotCurve() ) + if ( m_xAxisType == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) { auto curveValuesX = valuesX(); auto curveTimeStepsX = timeStepsX(); @@ -634,7 +674,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) else { std::vector curveTimeStepsY = timeStepsY(); - if ( curveTimeStepsY.size() > 0 && curveTimeStepsY.size() == curveValuesY.size() ) + if ( plot->timeAxisProperties() && curveTimeStepsY.size() > 0 && curveTimeStepsY.size() == curveValuesY.size() ) { if ( plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE ) { @@ -660,13 +700,13 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) } else { - if ( m_resampling() != RiaDefines::DateTimePeriod::NONE ) + if ( m_yValuesResampling() != RiaDefines::DateTimePeriod::NONE ) { auto [resampledTimeSteps, resampledValues] = RiaSummaryTools::resampledValuesForPeriod( m_yValuesSummaryAddress->address(), curveTimeStepsY, curveValuesY, - m_resampling() ); + m_yValuesResampling() ); if ( !resampledValues.empty() && !resampledTimeSteps.empty() ) { @@ -728,7 +768,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot ) updateTimeAnnotations(); } - if ( updateParentPlot ) updateAxisInPlot( axisY() ); + if ( updateParentPlot ) updatePlotAxis(); } //-------------------------------------------------------------------------------------------------- @@ -770,10 +810,10 @@ void RimSummaryCurve::initAfterRead() { RimStackablePlotCurve::initAfterRead(); - if ( m_plotAxisProperties.value() == nullptr ) + if ( m_yPlotAxisProperties.value() == nullptr ) { auto plot = firstAncestorOrThisOfType(); - if ( plot ) m_plotAxisProperties = plot->axisPropertiesForPlotAxis( RiuPlotAxis( m_plotAxis_OBSOLETE() ) ); + if ( plot ) m_yPlotAxisProperties = plot->axisPropertiesForPlotAxis( RiuPlotAxis( m_plotAxis_OBSOLETE() ) ); } if ( m_isEnsembleCurve().isPartiallyTrue() ) @@ -798,7 +838,7 @@ double RimSummaryCurve::computeCurveZValue() { zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_SINGLE_CURVE_OBSERVED ); } - else if ( sumAddr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + else if ( sumAddr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) { zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_ENSEMBLE_STAT_CURVE ); } @@ -842,28 +882,32 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering { RimPlotCurve::updateFieldUiState(); + bool isSummaryXHidden = ( m_xAxisType() != RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); + + m_xValuesSummaryCase.uiCapability()->setUiHidden( isSummaryXHidden ); + m_xValuesSummaryAddress.uiCapability()->setUiHidden( isSummaryXHidden ); + m_xValuesSummaryAddressUiField.uiCapability()->setUiHidden( isSummaryXHidden ); + m_xPushButtonSelectSummaryAddress.uiCapability()->setUiHidden( isSummaryXHidden ); + m_xPlotAxisProperties.uiCapability()->setUiHidden( isSummaryXHidden ); + { - QString curveDataGroupName = "Summary Vector"; - if ( isCrossPlotCurve() ) curveDataGroupName += " Y"; - caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword( curveDataGroupName, "Summary Vector Y" ); + QString curveDataGroupName = "Summary Vector"; + caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword( curveDataGroupName, "curveDataGroupName" ); curveDataGroup->add( &m_yValuesSummaryCase, { true, 3, 1 } ); curveDataGroup->add( &m_yValuesSummaryAddressUiField, { true, 2, 1 } ); curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, { false, 1, 0 } ); - curveDataGroup->add( &m_resampling, { true, 3, 1 } ); - curveDataGroup->add( &m_plotAxisProperties, { true, 3, 1 } ); - - if ( isCrossPlotCurve() ) - m_showErrorBars = false; - else - curveDataGroup->add( &m_showErrorBars ); + curveDataGroup->add( &m_yValuesResampling, { true, 3, 1 } ); + curveDataGroup->add( &m_yPlotAxisProperties, { true, 3, 1 } ); + curveDataGroup->add( &m_showErrorBars ); } - if ( isCrossPlotCurve() ) { - caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector X" ); + caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector X Axis" ); + curveDataGroup->add( &m_xAxisType, { true, 3, 1 } ); curveDataGroup->add( &m_xValuesSummaryCase, { true, 3, 1 } ); curveDataGroup->add( &m_xValuesSummaryAddressUiField, { true, 2, 1 } ); curveDataGroup->add( &m_xPushButtonSelectSummaryAddress, { false, 1, 0 } ); + curveDataGroup->add( &m_xPlotAxisProperties, { true, 3, 1 } ); } caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" ); @@ -882,7 +926,7 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering m_curveNameConfig->uiOrdering( uiConfigName, *nameGroup ); } - uiOrdering.skipRemainingFields(); // For now. + uiOrdering.skipRemainingFields(); } //-------------------------------------------------------------------------------------------------- @@ -917,7 +961,7 @@ void RimSummaryCurve::appendOptionItemsForSummaryAddresses( QListtimeAxisProperties(); + } + else if ( m_xAxisType() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) + { + if ( !m_xValuesSummaryCase() ) + { + m_xValuesSummaryCase = m_yValuesSummaryCase(); + m_xValuesSummaryAddress->setAddress( m_yValuesSummaryAddress()->address() ); + } + + plot->findOrAssignPlotAxisX( this ); + } + plot->updateAxes(); + plot->updatePlotTitle(); + loadAndUpdate = true; + } else if ( &m_showCurve == changedField ) { plot->updateAxes(); @@ -1079,9 +1144,15 @@ void RimSummaryCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow(); mainPlotWindow->updateMultiPlotToolBar(); } - else if ( changedField == &m_plotAxisProperties ) + else if ( changedField == &m_yPlotAxisProperties ) + { + updateYAxisInPlot( axisY() ); + plot->updateAxes(); + dataChanged.send(); + } + else if ( changedField == &m_xPlotAxisProperties ) { - updateAxisInPlot( axisY() ); + updateXAxisInPlot( axisX() ); plot->updateAxes(); dataChanged.send(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h index aa307204ca..aaa9ed95b9 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h @@ -26,6 +26,8 @@ #include "RiaDateTimeDefines.h" #include "RiaDefines.h" +#include "RiaSummaryCurveAddress.h" +#include "RiaSummaryDefines.h" #include "RifEclipseSummaryAddressQMetaType.h" #include "RimStackablePlotCurve.h" @@ -52,14 +54,15 @@ class RimSummaryCurve : public RimStackablePlotCurve RimSummaryCurve(); ~RimSummaryCurve() override; + RiaSummaryCurveDefinition curveDefinition() const; + RiaSummaryCurveAddress curveAddress() const; + // Y Axis functions - RiaSummaryCurveDefinition curveDefinitionY() const; RimSummaryCase* summaryCaseY() const; RifEclipseSummaryAddress summaryAddressY() const; std::string unitNameY() const; virtual std::vector valuesY() const; - void applyCurveDefinitionY( const RiaSummaryCurveDefinition& curveDefinition ); void setSummaryCaseY( RimSummaryCase* sumCase ); void setSummaryAddressYAndApplyInterpolation( const RifEclipseSummaryAddress& address ); void setSummaryAddressY( const RifEclipseSummaryAddress& address ); @@ -74,14 +77,17 @@ class RimSummaryCurve : public RimStackablePlotCurve void setOverrideCurveDataY( const std::vector& xValues, const std::vector& yValues ); // X Axis functions - RiaSummaryCurveDefinition curveDefinitionX() const; - RimSummaryCase* summaryCaseX() const; - RifEclipseSummaryAddress summaryAddressX() const; - std::string unitNameX() const; - virtual std::vector valuesX() const; - - void setSummaryCaseX( RimSummaryCase* sumCase ); - void setSummaryAddressX( const RifEclipseSummaryAddress& address ); + void setAxisTypeX( RiaDefines::HorizontalAxisType axisType ); + RiaDefines::HorizontalAxisType axisTypeX() const; + RimSummaryCase* summaryCaseX() const; + RifEclipseSummaryAddress summaryAddressX() const; + std::string unitNameX() const; + virtual std::vector valuesX() const; + + void setSummaryCaseX( RimSummaryCase* sumCase ); + void setSummaryAddressX( const RifEclipseSummaryAddress& address ); + void setTopOrBottomAxisX( RiuPlotAxis plotAxis ); + RiuPlotAxis axisX() const; // Other bool isEnsembleCurve() const; @@ -133,23 +139,25 @@ class RimSummaryCurve : public RimStackablePlotCurve private: // Y values - caf::PdmPtrField m_yValuesSummaryCase; - caf::PdmChildField m_yValuesSummaryAddress; - caf::PdmField m_yValuesSummaryAddressUiField; - caf::PdmField m_yPushButtonSelectSummaryAddress; - - caf::PdmField m_resampling; + caf::PdmPtrField m_yValuesSummaryCase; + caf::PdmChildField m_yValuesSummaryAddress; + caf::PdmField m_yValuesSummaryAddressUiField; + caf::PdmField m_yPushButtonSelectSummaryAddress; + caf::PdmPtrField m_yPlotAxisProperties; + caf::PdmField m_yValuesResampling; // X values - caf::PdmPtrField m_xValuesSummaryCase; - caf::PdmChildField m_xValuesSummaryAddress; - caf::PdmField m_xValuesSummaryAddressUiField; - caf::PdmField m_xPushButtonSelectSummaryAddress; - + caf::PdmField> m_xAxisType; + caf::PdmPtrField m_xValuesSummaryCase; + caf::PdmChildField m_xValuesSummaryAddress; + caf::PdmField m_xValuesSummaryAddressUiField; + caf::PdmField m_xPushButtonSelectSummaryAddress; + caf::PdmPtrField m_xPlotAxisProperties; + + // Other fields caf::PdmField m_isEnsembleCurve; caf::PdmChildField m_curveNameConfig; caf::PdmField> m_plotAxis_OBSOLETE; - caf::PdmPtrField m_plotAxisProperties; caf::PdmField m_isTopZWithinCategory; }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp index 4626889739..44a5fd975a 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp @@ -696,7 +696,7 @@ std::set RimSummaryCurveAppearanceCalculator::getAllSummaryWellName for ( auto& address : allAddresses ) { - if ( address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + if ( address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { summaryWellNames.insert( address.wellName() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp index 8ba2f79f51..efd0dd1d30 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.cpp @@ -65,6 +65,39 @@ RimSummaryCurveAutoName::RimSummaryCurveAutoName() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimSummaryCurveAutoName::curveName( const RiaSummaryCurveAddress& summaryCurveAddress, + const RimSummaryNameHelper* currentNameHelper, + const RimSummaryNameHelper* plotNameHelper ) const +{ + QString name; + + { + auto nameForY = curveNameY( summaryCurveAddress.summaryAddressY(), currentNameHelper, plotNameHelper ); + if ( nameForY.isEmpty() ) + { + nameForY = curveNameY( summaryCurveAddress.summaryAddressY(), nullptr, nullptr ); + } + + name += nameForY; + } + + if ( summaryCurveAddress.summaryAddressX().category() != SummaryCategory::SUMMARY_TIME ) + { + auto nameForX = curveNameX( summaryCurveAddress.summaryAddressX(), currentNameHelper, plotNameHelper ); + if ( nameForX.isEmpty() ) + { + nameForX = curveNameX( summaryCurveAddress.summaryAddressX(), nullptr, nullptr ); + } + + if ( nameForX != name ) name += " | " + nameForX; + } + + return name; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -193,7 +226,7 @@ QString RimSummaryCurveAutoName::buildCurveName( const RifEclipseSummaryAddress& if ( m_vectorName || m_longVectorName ) { - bool skipSubString = currentNameHelper && currentNameHelper->vectorNames().size() == 1; + bool skipSubString = currentNameHelper && currentNameHelper->isPlotDisplayingSingleCurve(); if ( !skipSubString ) { if ( m_longVectorName() ) @@ -215,7 +248,7 @@ QString RimSummaryCurveAutoName::buildCurveName( const RifEclipseSummaryAddress& } } - if ( summaryAddress.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) + if ( summaryAddress.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) { text = summaryAddress.vectorName(); } @@ -265,7 +298,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& { switch ( summaryAddress.category() ) { - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER: { if ( m_aquiferNumber ) { @@ -274,7 +307,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION: { if ( m_regionNumber ) { @@ -287,7 +320,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION: { if ( m_regionNumber ) { @@ -297,7 +330,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP: { if ( m_groupName ) { @@ -310,7 +343,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK: { bool skipSubString = nameHelper && nameHelper->isNetworkInTitle(); if ( !skipSubString ) @@ -320,12 +353,12 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL: { appendWellName( text, summaryAddress, nameHelper ); } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION: { appendWellName( text, summaryAddress, nameHelper ); @@ -341,13 +374,13 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR: { appendLgrName( text, summaryAddress ); appendWellName( text, summaryAddress, nameHelper ); } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR: { appendLgrName( text, summaryAddress ); appendWellName( text, summaryAddress, nameHelper ); @@ -364,7 +397,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT: { appendWellName( text, summaryAddress, nameHelper ); @@ -379,7 +412,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK: { if ( m_completion ) { @@ -393,7 +426,7 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string& } } break; - case RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR: + case RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR: { appendLgrName( text, summaryAddress ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h index baaacc7c31..65bb77609e 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveAutoName.h @@ -31,18 +31,21 @@ class RimSummaryCurveAutoName : public caf::PdmObject public: RimSummaryCurveAutoName(); + QString curveName( const RiaSummaryCurveAddress& summaryCurveAddress, + const RimSummaryNameHelper* currentNameHelper, + const RimSummaryNameHelper* plotNameHelper ) const; + + void applySettings( const RimSummaryCurveAutoName& other ); + +private: QString curveNameY( const RifEclipseSummaryAddress& summaryAddress, const RimSummaryNameHelper* currentNameHelper, const RimSummaryNameHelper* plotNameHelper ) const; + QString curveNameX( const RifEclipseSummaryAddress& summaryAddress, const RimSummaryNameHelper* currentNameHelper, const RimSummaryNameHelper* plotNameHelper ) const; - void applySettings( const RimSummaryCurveAutoName& other ); - -private: - friend class RimSummaryCurve; - void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp index 987066a04b..28e11db03d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp @@ -447,6 +447,21 @@ RimSummaryPlotSourceStepping* RimSummaryCurveCollection::sourceSteppingObject( R return nullptr; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::set RimSummaryCurveCollection::horizontalAxisTypes() const +{ + std::set axisTypes; + + for ( const auto& curve : m_curves ) + { + axisTypes.insert( curve->axisTypeX() ); + } + + return axisTypes; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h index a8956dcd5d..7203a7d7df 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h @@ -18,6 +18,7 @@ #pragma once +#include "RiaSummaryDefines.h" #include "RimSummaryPlotSourceStepping.h" #include "cafPdmChildArrayField.h" @@ -54,8 +55,9 @@ class RimSummaryCurveCollection : public caf::PdmObject RimSummaryPlotSourceStepping* sourceSteppingObject( RimSummaryDataSourceStepping::Axis sourceSteppingType ) const; - std::vector curves() const; - std::vector curvesForSourceStepping( RimSummaryDataSourceStepping::Axis steppingType ) const; + std::set horizontalAxisTypes() const; + std::vector curves() const; + std::vector curvesForSourceStepping( RimSummaryDataSourceStepping::Axis steppingType ) const; void setCurveAsTopZWithinCategory( RimSummaryCurve* curve ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurvesData.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurvesData.cpp index 7726cfee0b..76b2ff488e 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurvesData.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurvesData.cpp @@ -198,9 +198,9 @@ void RimSummaryCurvesData::populateSummaryCurvesData( std::vectorsummaryCaseY()->displayCaseName(); QString ensembleName; - if ( curve->curveDefinitionY().ensemble() ) + if ( curve->curveDefinition().ensemble() ) { - ensembleName = curve->curveDefinitionY().ensemble()->name(); + ensembleName = curve->curveDefinition().ensemble()->name(); } CurveData curveData = { curve->curveExportDescription( {} ), curve->summaryAddressY(), curve->valuesY() }; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp index aad1d86a3d..d3c5ceab67 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp @@ -374,19 +374,19 @@ void RimSummaryMultiPlot::populateNameHelper( RimSummaryPlotNameHelper* nameHelp { nameHelper->clear(); - std::vector addresses; + std::vector addresses; std::vector sumCases; std::vector ensembleCases; for ( RimSummaryCurve* curve : allCurves( RimSummaryDataSourceStepping::Axis::Y_AXIS ) ) { - addresses.push_back( curve->summaryAddressY() ); + addresses.push_back( curve->curveAddress() ); sumCases.push_back( curve->summaryCaseY() ); } for ( auto curveSet : curveSets() ) { - addresses.push_back( curveSet->summaryAddress() ); + addresses.push_back( curveSet->curveAddress() ); ensembleCases.push_back( curveSet->summaryCaseCollection() ); } @@ -1084,7 +1084,7 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() { for ( auto curve : plot->summaryCurves() ) { - if ( curve->axisY() == axis->plotAxisType() ) + if ( curve->axisY() == axis->plotAxis() ) { std::vector summaryCases = summaryCasesForCurve( curve, m_axisRangeAggregation() ); std::vector addresses = addressesForCurve( curve, m_axisRangeAggregation() ); @@ -1093,14 +1093,14 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() auto [minimum, maximum] = findMinMaxForAddressesInSummaryCases( addresses, summaryCases, onlyPositiveValues ); - if ( axisRanges.count( axis->plotAxisType() ) == 0 ) + if ( axisRanges.count( axis->plotAxis() ) == 0 ) { - axisRanges[axis->plotAxisType()] = std::make_pair( minimum, maximum ); + axisRanges[axis->plotAxis()] = std::make_pair( minimum, maximum ); } else { - auto& [currentMin, currentMax] = axisRanges[axis->plotAxisType()]; - axisRanges[axis->plotAxisType()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); + auto& [currentMin, currentMax] = axisRanges[axis->plotAxis()]; + axisRanges[axis->plotAxis()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); } } } @@ -1109,7 +1109,7 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() { if ( !curveSet->summaryCaseCollection() ) continue; - if ( curveSet->axisY() == axis->plotAxisType() ) + if ( curveSet->axisY() == axis->plotAxis() ) { double minimum( std::numeric_limits::infinity() ); double maximum( -std::numeric_limits::infinity() ); @@ -1132,14 +1132,14 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() } } - if ( axisRanges.count( axis->plotAxisType() ) == 0 ) + if ( axisRanges.count( axis->plotAxis() ) == 0 ) { - axisRanges[axis->plotAxisType()] = std::make_pair( minimum, maximum ); + axisRanges[axis->plotAxis()] = std::make_pair( minimum, maximum ); } else { - auto& [currentMin, currentMax] = axisRanges[axis->plotAxisType()]; - axisRanges[axis->plotAxisType()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); + auto& [currentMin, currentMax] = axisRanges[axis->plotAxis()]; + axisRanges[axis->plotAxis()] = std::make_pair( std::min( currentMin, minimum ), std::max( currentMax, maximum ) ); } } } @@ -1148,8 +1148,8 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange() // set all plots to use the global min/max values for each category for ( auto axis : plot->plotYAxes() ) { - auto [minVal, maxVal] = axisRanges[axis->plotAxisType()]; - if ( RiaDefines::isVertical( axis->plotAxisType().axis() ) && !std::isinf( minVal ) && !std::isinf( maxVal ) ) + auto [minVal, maxVal] = axisRanges[axis->plotAxis()]; + if ( RiaDefines::isVertical( axis->plotAxis().axis() ) && !std::isinf( minVal ) && !std::isinf( maxVal ) ) { axis->setAutoZoom( false ); @@ -1273,12 +1273,13 @@ void RimSummaryMultiPlot::analyzePlotsAndAdjustAppearanceSettings() for ( auto p : summaryPlots() ) { - auto timeAxisProp = p->timeAxisProperties(); - - auto tickMarkCount = ( columnCount() < 3 ) ? RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_DEFAULT - : RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_FEW; + if ( auto timeAxisProp = p->timeAxisProperties() ) + { + auto tickMarkCount = ( columnCount() < 3 ) ? RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_DEFAULT + : RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_FEW; - timeAxisProp->setAutoValueForMajorTickmarkCount( tickMarkCount, notifyFieldChanged ); + timeAxisProp->setAutoValueForMajorTickmarkCount( tickMarkCount, notifyFieldChanged ); + } for ( auto* axisProp : p->plotYAxes() ) { diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h index b21d58416f..5759db3e6f 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryNameHelper.h @@ -38,15 +38,15 @@ class RimSummaryNameHelper QString aggregatedPlotTitle( const RimSummaryNameHelper& summaryMultiPlotNameHelper ) const; - virtual bool isPlotDisplayingSingleVectorName() const = 0; - virtual bool isWellNameInTitle() const = 0; - virtual bool isGroupNameInTitle() const = 0; - virtual bool isNetworkInTitle() 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 bool isPlotDisplayingSingleCurve() const = 0; + virtual bool isWellNameInTitle() const = 0; + virtual bool isGroupNameInTitle() const = 0; + virtual bool isNetworkInTitle() 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 std::set vectorNames() const = 0; virtual QString caseName() const = 0; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index a05c865b53..8ebb95e088 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -30,9 +30,11 @@ #include "RiaStdStringTools.h" #include "RiaSummaryAddressAnalyzer.h" #include "RiaSummaryCurveDefinition.h" +#include "RiaSummaryDefines.h" #include "RiaSummaryTools.h" #include "RiaTimeHistoryCurveResampler.h" +#include "RifEclipseSummaryAddressDefines.h" #include "RifReaderEclipseSummary.h" #include "RicfCommandObject.h" @@ -118,9 +120,8 @@ struct RimSummaryPlot::CurveInfo //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimSummaryPlot::RimSummaryPlot( bool isCrossPlot ) +RimSummaryPlot::RimSummaryPlot() : RimPlot() - , m_isCrossPlot( isCrossPlot ) , curvesChanged( this ) , axisChanged( this ) , plotZoomedByUser( this ) @@ -156,19 +157,6 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot ) CAF_PDM_InitFieldNoDefault( &m_axisPropertiesArray, "AxisProperties", "Axes", ":/Axes16x16.png" ); - if ( m_isCrossPlot ) - { - addNewAxisProperties( RiuPlotAxis::defaultBottom(), "Bottom" ); - } - else - { - auto* timeAxisProperties = new RimSummaryTimeAxisProperties; - timeAxisProperties->settingsChanged.connect( this, &RimSummaryPlot::timeAxisSettingsChanged ); - timeAxisProperties->requestLoadDataAndUpdate.connect( this, &RimSummaryPlot::timeAxisSettingsChangedReloadRequired ); - - m_axisPropertiesArray.push_back( timeAxisProperties ); - } - auto leftAxis = addNewAxisProperties( RiuPlotAxis::defaultLeft(), "Left" ); leftAxis->setAlwaysRequired( true ); @@ -179,14 +167,6 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot ) CAF_PDM_InitFieldNoDefault( &m_sourceStepping, "SourceStepping", "" ); m_sourceStepping = new RimSummaryPlotSourceStepping; - if ( m_isCrossPlot ) - { - m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); - } - else - { - m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS ); - } m_sourceStepping->setSourceSteppingObject( this ); m_sourceStepping.uiCapability()->setUiTreeHidden( true ); @@ -220,6 +200,8 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot ) m_timeAxisProperties_OBSOLETE.uiCapability()->setUiTreeHidden( true ); m_timeAxisProperties_OBSOLETE.xmlCapability()->setIOWritable( false ); m_timeAxisProperties_OBSOLETE = new RimSummaryTimeAxisProperties; + + ensureRequiredAxisObjectsForCurves(); } //-------------------------------------------------------------------------------------------------- @@ -258,14 +240,9 @@ void RimSummaryPlot::updateAxes() m_summaryPlot->updateAnnotationObjects( leftYAxisProperties ); } - if ( m_isCrossPlot ) - { - updateNumericalAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); - } - else - { - updateTimeAxis( timeAxisProperties() ); - } + updateNumericalAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); + updateNumericalAxis( RiaDefines::PlotAxis::PLOT_AXIS_TOP ); + updateTimeAxis( timeAxisProperties() ); updateZoomInParentPlot(); } @@ -501,7 +478,12 @@ std::vector RimSummaryPlot::allCurves( RimSummaryDataSourceSte //-------------------------------------------------------------------------------------------------- std::vector RimSummaryPlot::availableAxes() const { - if ( m_isCrossPlot ) return { RimSummaryDataSourceStepping::Axis::X_AXIS, RimSummaryDataSourceStepping::Axis::Y_AXIS }; + auto axisTypes = m_summaryCurveCollection->horizontalAxisTypes(); + + if ( axisTypes.contains( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) ) + { + return { RimSummaryDataSourceStepping::Axis::X_AXIS, RimSummaryDataSourceStepping::Axis::Y_AXIS }; + } return { RimSummaryDataSourceStepping::Axis::X_AXIS }; } @@ -643,7 +625,7 @@ void RimSummaryPlot::copyAxisPropertiesFromOther( const RimSummaryPlot& sourceSu { QString data = ap->writeObjectToXmlString(); - auto axisProperty = axisPropertiesForPlotAxis( ap->plotAxisType() ); + auto axisProperty = axisPropertiesForPlotAxis( ap->plotAxis() ); if ( axisProperty ) { axisProperty->readObjectFromXmlString( data, caf::PdmDefaultObjectFactory::instance() ); @@ -658,11 +640,11 @@ void RimSummaryPlot::copyAxisPropertiesFromOther( RiaDefines::PlotAxis plotAxisT { for ( auto ap : sourceSummaryPlot.plotAxes() ) { - if ( ap->plotAxisType().axis() != plotAxisType ) continue; + if ( ap->plotAxis().axis() != plotAxisType ) continue; QString data = ap->writeObjectToXmlString(); - axisPropertiesForPlotAxis( ap->plotAxisType() )->readObjectFromXmlString( data, caf::PdmDefaultObjectFactory::instance() ); + axisPropertiesForPlotAxis( ap->plotAxis() )->readObjectFromXmlString( data, caf::PdmDefaultObjectFactory::instance() ); } } @@ -908,54 +890,57 @@ void RimSummaryPlot::updateNumericalAxis( RiaDefines::PlotAxis plotAxis ) for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) { - RiuPlotAxis riuPlotAxis = axisProperties->plotAxisType(); + RiuPlotAxis riuPlotAxis = axisProperties->plotAxis(); if ( riuPlotAxis.axis() == plotAxis ) { + bool isBottom = plotAxis == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM; + bool isTop = plotAxis == RiaDefines::PlotAxis::PLOT_AXIS_TOP; + auto* axisProps = dynamic_cast( axisProperties ); - if ( axisProps ) + if ( !axisProps ) continue; + + if ( axisProperties->isActive() && hasVisibleCurvesForAxis( riuPlotAxis ) ) { - if ( axisProperties->isActive() && hasVisibleCurvesForAxis( riuPlotAxis ) ) - { - plotWidget()->enableAxis( riuPlotAxis, true ); - } - else - { - plotWidget()->enableAxis( riuPlotAxis, false ); - } + plotWidget()->enableAxis( riuPlotAxis, true ); + } + else + { + plotWidget()->enableAxis( riuPlotAxis, false ); + } + + if ( !hasVisibleCurvesForAxis( riuPlotAxis ) ) + { + axisProps->setNameForUnusedAxis(); + } + else + { + std::set timeHistoryQuantities; - if ( !hasVisibleCurvesForAxis( riuPlotAxis ) ) + for ( auto c : visibleTimeHistoryCurvesForAxis( riuPlotAxis ) ) { - axisProps->setNameForUnusedAxis(); + timeHistoryQuantities.insert( c->quantityName() ); } - else - { - std::set timeHistoryQuantities; - - for ( auto c : visibleTimeHistoryCurvesForAxis( riuPlotAxis ) ) - { - timeHistoryQuantities.insert( c->quantityName() ); - } - std::vector curveDefs; - for ( auto summaryCurve : summaryCurves() ) + std::vector curveDefs; + for ( auto summaryCurve : summaryCurves() ) + { + if ( summaryCurve->axisY() == riuPlotAxis || summaryCurve->axisX() == riuPlotAxis ) { - if ( summaryCurve->axisY() != riuPlotAxis ) continue; - - curveDefs.push_back( summaryCurve->curveDefinitionY() ); + curveDefs.push_back( summaryCurve->curveDefinition() ); } + } - for ( auto curveSet : ensembleCurveSetCollection()->curveSets() ) - { - if ( curveSet->axisY() != riuPlotAxis ) continue; + for ( auto curveSet : ensembleCurveSetCollection()->curveSets() ) + { + if ( curveSet->axisY() != riuPlotAxis ) continue; - RiaSummaryCurveDefinition def( curveSet->summaryCaseCollection(), curveSet->summaryAddress() ); - curveDefs.push_back( def ); - } + RiaSummaryCurveDefinition def( curveSet->summaryCaseCollection(), curveSet->summaryAddress() ); + curveDefs.push_back( def ); + } - RimSummaryPlotAxisFormatter calc( axisProps, {}, curveDefs, visibleAsciiDataCurvesForAxis( riuPlotAxis ), timeHistoryQuantities ); + RimSummaryPlotAxisFormatter calc( axisProps, {}, curveDefs, visibleAsciiDataCurvesForAxis( riuPlotAxis ), timeHistoryQuantities ); - calc.applyAxisPropertiesToPlot( plotWidget() ); - } + calc.applyAxisPropertiesToPlot( plotWidget() ); } plotWidget()->enableAxisNumberLabels( riuPlotAxis, axisProps->showNumbers() ); @@ -972,11 +957,18 @@ void RimSummaryPlot::updateNumericalAxis( RiaDefines::PlotAxis plotAxis ) //-------------------------------------------------------------------------------------------------- void RimSummaryPlot::updateTimeAxis( RimSummaryTimeAxisProperties* timeAxisProperties ) { - if ( !plotWidget() ) return; + if ( !plotWidget() || !timeAxisProperties ) return; - if ( !timeAxisProperties->isActive() ) + bool anyTimeHistoryCurvePresent = false; { - plotWidget()->enableAxis( RiuPlotAxis::defaultBottom(), false ); + if ( !visibleTimeHistoryCurvesForAxis( RimSummaryPlot::plotAxisForTime() ).empty() ) anyTimeHistoryCurvePresent = true; + if ( !visibleAsciiDataCurvesForAxis( RimSummaryPlot::plotAxisForTime() ).empty() ) anyTimeHistoryCurvePresent = true; + if ( !visibleSummaryCurvesForAxis( RimSummaryPlot::plotAxisForTime() ).empty() ) anyTimeHistoryCurvePresent = true; + } + + if ( !anyTimeHistoryCurvePresent || !timeAxisProperties->isActive() ) + { + plotWidget()->enableAxis( RimSummaryPlot::plotAxisForTime(), false ); return; } @@ -996,7 +988,7 @@ void RimSummaryPlot::updateTimeAxis( RimSummaryTimeAxisProperties* timeAxisPrope m_summaryPlot->useTimeBasedTimeAxis(); } - plotWidget()->enableAxis( RiuPlotAxis::defaultBottom(), true ); + plotWidget()->enableAxis( RimSummaryPlot::plotAxisForTime(), true ); { Qt::AlignmentFlag alignment = Qt::AlignCenter; @@ -1005,20 +997,20 @@ void RimSummaryPlot::updateTimeAxis( RimSummaryTimeAxisProperties* timeAxisPrope alignment = Qt::AlignRight; } - plotWidget()->setAxisFontsAndAlignment( RiuPlotAxis::defaultBottom(), + plotWidget()->setAxisFontsAndAlignment( RimSummaryPlot::plotAxisForTime(), timeAxisProperties->titleFontSize(), timeAxisProperties->valuesFontSize(), true, alignment ); - plotWidget()->setAxisTitleText( RiuPlotAxis::defaultBottom(), timeAxisProperties->title() ); - plotWidget()->setAxisTitleEnabled( RiuPlotAxis::defaultBottom(), timeAxisProperties->showTitle ); + plotWidget()->setAxisTitleText( RimSummaryPlot::plotAxisForTime(), timeAxisProperties->title() ); + plotWidget()->setAxisTitleEnabled( RimSummaryPlot::plotAxisForTime(), timeAxisProperties->showTitle ); if ( timeAxisProperties->tickmarkType() == RimSummaryTimeAxisProperties::TickmarkType::TICKMARK_COUNT ) { RimSummaryTimeAxisProperties::LegendTickmarkCount tickmarkCountEnum = timeAxisProperties->majorTickmarkCount(); int maxTickmarkCount = RimPlotAxisPropertiesInterface::tickmarkCountFromEnum( tickmarkCountEnum ); - plotWidget()->setAxisMaxMajor( RiuPlotAxis::defaultBottom(), maxTickmarkCount ); + plotWidget()->setAxisMaxMajor( RimSummaryPlot::plotAxisForTime(), maxTickmarkCount ); } else if ( timeAxisProperties->tickmarkType() == RimSummaryTimeAxisProperties::TickmarkType::TICKMARK_CUSTOM ) { @@ -1054,7 +1046,7 @@ void RimSummaryPlot::updateZoomForNumericalAxis( RimPlotAxisProperties* axisProp { if ( !axisProperties ) return; - const auto plotAxis = axisProperties->plotAxisType(); + const auto plotAxis = axisProperties->plotAxis(); if ( axisProperties->isAutoZoom() ) { if ( axisProperties->isLogarithmicScaleEnabled() ) @@ -1086,16 +1078,16 @@ void RimSummaryPlot::updateZoomForNumericalAxis( RimPlotAxisProperties* axisProp std::swap( min, max ); } - plotWidget()->setAxisScale( axisProperties->plotAxisType(), min, max ); + plotWidget()->setAxisScale( axisProperties->plotAxis(), min, max ); } else if ( ( plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) && isOnlyWaterCutCurvesVisible( plotAxis ) ) { - plotWidget()->setAxisScale( axisProperties->plotAxisType(), 0.0, 1.0 ); + plotWidget()->setAxisScale( axisProperties->plotAxis(), 0.0, 1.0 ); } else { - plotWidget()->setAxisAutoScale( axisProperties->plotAxisType(), true ); + plotWidget()->setAxisAutoScale( axisProperties->plotAxis(), true ); } } else @@ -1103,10 +1095,10 @@ void RimSummaryPlot::updateZoomForNumericalAxis( RimPlotAxisProperties* axisProp double min = axisProperties->visibleRangeMin(); double max = axisProperties->visibleRangeMax(); if ( axisProperties->isAxisInverted() ) std::swap( min, max ); - plotWidget()->setAxisScale( axisProperties->plotAxisType(), min, max ); + plotWidget()->setAxisScale( axisProperties->plotAxis(), min, max ); } - plotWidget()->setAxisInverted( axisProperties->plotAxisType(), axisProperties->isAxisInverted() ); + plotWidget()->setAxisInverted( axisProperties->plotAxis(), axisProperties->isAxisInverted() ); } //-------------------------------------------------------------------------------------------------- @@ -1118,13 +1110,13 @@ void RimSummaryPlot::updateZoomForTimeAxis( RimSummaryTimeAxisProperties* timeAx if ( timeAxisProperties->isAutoZoom() ) { - plotWidget()->setAxisAutoScale( timeAxisProperties->plotAxisType(), true ); + plotWidget()->setAxisAutoScale( timeAxisProperties->plotAxis(), true ); } else { double min = timeAxisProperties->visibleRangeMin(); double max = timeAxisProperties->visibleRangeMax(); - plotWidget()->setAxisScale( timeAxisProperties->plotAxisType(), min, max ); + plotWidget()->setAxisScale( timeAxisProperties->plotAxis(), min, max ); } } @@ -1135,10 +1127,10 @@ void RimSummaryPlot::createAndSetCustomTimeAxisTickmarks( RimSummaryTimeAxisProp { if ( !timeAxisProperties || !plotWidget() ) return; - const auto [minValue, maxValue] = plotWidget()->axisRange( RiuPlotAxis::defaultBottom() ); + const auto [minValue, maxValue] = plotWidget()->axisRange( RimSummaryPlot::plotAxisForTime() ); const auto tickmarkList = timeAxisProperties->createTickmarkList( QwtDate::toDateTime( minValue ), QwtDate::toDateTime( maxValue ) ); - plotWidget()->setMajorTicksList( RiuPlotAxis::defaultBottom(), tickmarkList, minValue, maxValue ); + plotWidget()->setMajorTicksList( RimSummaryPlot::plotAxisForTime(), tickmarkList, minValue, maxValue ); } //-------------------------------------------------------------------------------------------------- @@ -1155,7 +1147,7 @@ void RimSummaryPlot::overrideTimeAxisSettingsIfTooManyCustomTickmarks( RimSummar // Prevent too large number of ticks by overriding time axis interval and step to // prevent large number of tickmarks by accident. - const auto [minValue, maxValue] = plotWidget()->axisRange( RiuPlotAxis::defaultBottom() ); + const auto [minValue, maxValue] = plotWidget()->axisRange( RimSummaryPlot::plotAxisForTime() ); const double ticksInterval = timeAxisProperties->getTickmarkIntervalDouble(); const uint numTicks = static_cast( std::ceil( ( maxValue - minValue ) / ticksInterval ) ); if ( numTicks > MAX_NUM_TICKS ) @@ -1198,54 +1190,108 @@ bool RimSummaryPlot::isOnlyWaterCutCurvesVisible( RiuPlotAxis plotAxis ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryPlot::scheduleReplotIfVisible() +RiuPlotAxis RimSummaryPlot::plotAxisForTime() { - if ( showWindow() && plotWidget() ) plotWidget()->scheduleReplot(); + return RiuPlotAxis::defaultBottom(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RimSummaryPlot::visibleSummaryCurvesForAxis( RiuPlotAxis plotAxis ) const +void RimSummaryPlot::ensureRequiredAxisObjectsForCurves() { - std::vector curves; + // Always make sure time axis properties are present + if ( !timeAxisProperties() ) + { + auto* axisProperties = new RimSummaryTimeAxisProperties; + axisProperties->settingsChanged.connect( this, &RimSummaryPlot::timeAxisSettingsChanged ); + axisProperties->requestLoadDataAndUpdate.connect( this, &RimSummaryPlot::timeAxisSettingsChangedReloadRequired ); - if ( plotAxis.axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + m_axisPropertiesArray.push_back( axisProperties ); + } + + auto axisTypes = m_summaryCurveCollection->horizontalAxisTypes(); + if ( axisTypes.contains( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) ) + { + m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); + } + else + { + m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::findOrAssignPlotAxisX( RimSummaryCurve* curve ) +{ + for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) { - if ( m_summaryCurveCollection && m_summaryCurveCollection->isCurvesVisible() ) + if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) { - for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() ) + auto propertyAxis = dynamic_cast( axisProperties ); + if ( propertyAxis ) { - if ( curve->isChecked() ) - { - curves.push_back( curve ); - } + curve->setTopOrBottomAxisX( propertyAxis->plotAxis() ); + + return; } } } - else + + if ( curve->summaryCaseX() != nullptr && plotWidget() && plotWidget()->isMultiAxisSupported() ) { - if ( m_summaryCurveCollection && m_summaryCurveCollection->isCurvesVisible() ) + QString axisObjectName = "New Axis"; + if ( !curve->summaryAddressX().uiText().empty() ) axisObjectName = QString::fromStdString( curve->summaryAddressX().uiText() ); + + RiuPlotAxis newPlotAxis = plotWidget()->createNextPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); + addNewAxisProperties( newPlotAxis, axisObjectName ); + if ( plotWidget() ) { - for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() ) + plotWidget()->ensureAxisIsCreated( newPlotAxis ); + } + + updateAxes(); + curve->setTopOrBottomAxisX( newPlotAxis ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::scheduleReplotIfVisible() +{ + if ( showWindow() && plotWidget() ) plotWidget()->scheduleReplot(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimSummaryPlot::visibleSummaryCurvesForAxis( RiuPlotAxis plotAxis ) const +{ + std::vector curves; + + if ( m_summaryCurveCollection && m_summaryCurveCollection->isCurvesVisible() ) + { + for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() ) + { + if ( curve->isChecked() && ( curve->axisY() == plotAxis || curve->axisX() == plotAxis ) ) { - if ( curve->isChecked() && curve->axisY() == plotAxis ) - { - curves.push_back( curve ); - } + curves.push_back( curve ); } } + } - if ( m_ensembleCurveSetCollection && m_ensembleCurveSetCollection->isCurveSetsVisible() ) + if ( m_ensembleCurveSetCollection && m_ensembleCurveSetCollection->isCurveSetsVisible() ) + { + for ( RimEnsembleCurveSet* curveSet : m_ensembleCurveSetCollection->curveSets() ) { - for ( RimEnsembleCurveSet* curveSet : m_ensembleCurveSetCollection->curveSets() ) + for ( RimSummaryCurve* curve : curveSet->curves() ) { - for ( RimSummaryCurve* curve : curveSet->curves() ) + if ( curve->isChecked() && ( curve->axisY() == plotAxis || curve->axisX() == plotAxis ) ) { - if ( curve->isChecked() && curve->axisY() == plotAxis ) - { - curves.push_back( curve ); - } + curves.push_back( curve ); } } } @@ -1284,7 +1330,7 @@ RimPlotAxisPropertiesInterface* RimSummaryPlot::axisPropertiesForPlotAxis( RiuPl { for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) { - if ( axisProperties->plotAxisType() == plotAxis ) return axisProperties; + if ( axisProperties->plotAxis() == plotAxis ) return axisProperties; } return nullptr; @@ -1349,6 +1395,7 @@ void RimSummaryPlot::updateCaseNameHasChanged() RimTimeAxisAnnotation* RimSummaryPlot::addTimeAnnotation( time_t time ) { RimSummaryTimeAxisProperties* axisProps = timeAxisProperties(); + CAF_ASSERT( axisProps ); auto* annotation = new RimTimeAxisAnnotation; annotation->setTime( time ); @@ -1364,6 +1411,7 @@ RimTimeAxisAnnotation* RimSummaryPlot::addTimeAnnotation( time_t time ) RimTimeAxisAnnotation* RimSummaryPlot::addTimeRangeAnnotation( time_t startTime, time_t endTime ) { RimSummaryTimeAxisProperties* axisProps = timeAxisProperties(); + CAF_ASSERT( axisProps ); auto* annotation = new RimTimeAxisAnnotation; annotation->setTimeRange( startTime, endTime ); @@ -1379,7 +1427,7 @@ RimTimeAxisAnnotation* RimSummaryPlot::addTimeRangeAnnotation( time_t startTime, void RimSummaryPlot::removeAllTimeAnnotations() { RimSummaryTimeAxisProperties* axisProps = timeAxisProperties(); - axisProps->removeAllAnnotations(); + if ( axisProps ) axisProps->removeAllAnnotations(); } //-------------------------------------------------------------------------------------------------- @@ -1388,6 +1436,8 @@ void RimSummaryPlot::removeAllTimeAnnotations() void RimSummaryPlot::removeTimeAnnotation( RimTimeAxisAnnotation* annotation ) { RimSummaryTimeAxisProperties* axisProps = timeAxisProperties(); + CAF_ASSERT( axisProps ); + axisProps->removeAnnotation( annotation ); } @@ -1708,10 +1758,10 @@ bool RimSummaryPlot::updateStackedCurveDataForRelevantAxes() bool anyStackedCurvesPresent = false; for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) { - if ( axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || - axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) + if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || + axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) { - anyStackedCurvesPresent |= updateStackedCurveDataForAxis( axisProperties->plotAxisType() ); + anyStackedCurvesPresent |= updateStackedCurveDataForAxis( axisProperties->plotAxis() ); } } @@ -1816,12 +1866,9 @@ void RimSummaryPlot::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin uiTreeOrdering.add( curve ); } - if ( !m_isCrossPlot ) + for ( auto& curveSet : m_ensembleCurveSetCollection->curveSets() ) { - for ( auto& curveSet : m_ensembleCurveSetCollection->curveSets() ) - { - uiTreeOrdering.add( curveSet ); - } + uiTreeOrdering.add( curveSet ); } if ( !isPlotEditor ) @@ -1913,7 +1960,7 @@ void RimSummaryPlot::updateZoomFromParentPlot() { if ( !axisProperties ) continue; - auto [axisMin, axisMax] = plotWidget()->axisRange( axisProperties->plotAxisType() ); + auto [axisMin, axisMax] = plotWidget()->axisRange( axisProperties->plotAxis() ); if ( axisProperties->isAxisInverted() ) std::swap( axisMin, axisMax ); if ( auto propertyAxis = dynamic_cast( axisProperties ) ) @@ -2049,7 +2096,7 @@ void RimSummaryPlot::timeAxisSettingsChanged( const caf::SignalEmitter* emitter if ( !timeAxisProps->isAutoZoom() && plotWidget() ) { // If not auto zoom - the new date and time ranges must be set and axes updated - plotWidget()->setAxisScale( RiuPlotAxis::defaultBottom(), timeAxisProps->visibleRangeMin(), timeAxisProps->visibleRangeMax() ); + plotWidget()->setAxisScale( RimSummaryPlot::plotAxisForTime(), timeAxisProps->visibleRangeMin(), timeAxisProps->visibleRangeMax() ); plotWidget()->updateAxes(); } @@ -2220,26 +2267,30 @@ bool RimSummaryPlot::autoPlotTitle() const //-------------------------------------------------------------------------------------------------- RimSummaryPlot::CurveInfo RimSummaryPlot::handleSummaryCaseDrop( RimSummaryCase* summaryCase ) { - int newCurves = 0; - std::vector curves; - - std::map> dataVectorMap; + std::map, std::set> dataVectorMap; for ( auto& curve : summaryCurves() ) { - const auto addr = curve->summaryAddressY(); - dataVectorMap[addr].insert( curve->summaryCaseY() ); + const auto addr = curve->summaryAddressY(); + const auto addrX = curve->summaryAddressX(); + + // NB! This concept is used to make it possible to avoid adding curves for a case that is already present + // To be complete, the summaryCaseX() should also be checked, but this is not done for now + dataVectorMap[std::make_pair( addr, addrX )].insert( curve->summaryCaseY() ); } - for ( const auto& [addr, cases] : dataVectorMap ) + std::vector curves; + + for ( const auto& [addressPair, cases] : dataVectorMap ) { if ( cases.count( summaryCase ) > 0 ) continue; - curves.push_back( addNewCurveY( addr, summaryCase ) ); - newCurves++; + const auto& [addrY, addrX] = addressPair; + + curves.push_back( addNewCurve( addrY, summaryCase, addrX, summaryCase ) ); } - return { newCurves, curves, {} }; + return { .curveCount = static_cast( curves.size() ), .curves = curves, .curveSets = {} }; } //-------------------------------------------------------------------------------------------------- @@ -2291,68 +2342,55 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar { for ( auto& curve : summaryCurves() ) { - sourceCurveDefs.push_back( curve->curveDefinitionY() ); + sourceCurveDefs.push_back( curve->curveDefinition() ); } - } - if ( ensembleCase ) - { - auto curveSets = m_ensembleCurveSetCollection->curveSets(); - for ( auto curveSet : curveSets ) + if ( ensembleCase ) { - sourceCurveDefs.push_back( RiaSummaryCurveDefinition( ensembleCase, curveSet->summaryAddress() ) ); + auto curveSets = m_ensembleCurveSetCollection->curveSets(); + for ( auto curveSet : curveSets ) + { + sourceCurveDefs.push_back( RiaSummaryCurveDefinition( ensembleCase, curveSet->summaryAddress() ) ); + } } } for ( auto& curveDef : sourceCurveDefs ) { - auto newCurveDef = curveDef; - auto curveAdr = newCurveDef.summaryAddress(); + auto newCurveDef = curveDef; + const auto curveAdr = newCurveDef.summaryAddress(); + std::string objectIdentifierString; - if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) && + if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL ) ) { objectIdentifierString = curveAdr.wellName(); - curveAdr.setWellName( droppedName ); - newCurveDef.setSummaryAddress( curveAdr ); } - else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) && + else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::GROUP ) ) { objectIdentifierString = curveAdr.groupName(); - curveAdr.setGroupName( droppedName ); - newCurveDef.setSummaryAddress( curveAdr ); } - else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK ) && + else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::NETWORK ) ) { objectIdentifierString = curveAdr.networkName(); - curveAdr.setNetworkName( droppedName ); - newCurveDef.setSummaryAddress( curveAdr ); } - else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) && + else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::REGION ) ) { objectIdentifierString = std::to_string( curveAdr.regionNumber() ); - - int droppedRegion = std::stoi( droppedName ); - - curveAdr.setRegion( droppedRegion ); - newCurveDef.setSummaryAddress( curveAdr ); } - else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT ) && + else if ( ( curveAdr.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT ) && ( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL_SEGMENT ) ) { objectIdentifierString = std::to_string( curveAdr.wellSegmentNumber() ); - - int droppedWellSegmentNumber = std::stoi( droppedName ); - - curveAdr.setWellSegmentNumber( droppedWellSegmentNumber ); - newCurveDef.setSummaryAddress( curveAdr ); } if ( !objectIdentifierString.empty() ) { + newCurveDef.setIdentifierText( curveAdr.category(), droppedName ); + newCurveDefsWithObjectNames[newCurveDef].insert( objectIdentifierString ); const auto& addr = curveDef.summaryAddress(); if ( !addr.isHistoryVector() && RiaPreferencesSummary::current()->appendHistoryVectors() ) @@ -2385,7 +2423,16 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar { if ( curveDef.summaryCase()->summaryReader() && curveDef.summaryCase()->summaryReader()->hasAddress( curveDef.summaryAddress() ) ) { - curves.push_back( addNewCurveY( curveDef.summaryAddress(), curveDef.summaryCase() ) ); + auto curve = + addNewCurve( curveDef.summaryAddress(), curveDef.summaryCase(), curveDef.summaryAddressX(), curveDef.summaryCaseX() ); + curves.push_back( curve ); + if ( curveDef.summaryCaseX() ) + { + curve->setAxisTypeX( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); + curve->setSummaryCaseX( curveDef.summaryCaseX() ); + curve->setSummaryAddressX( curveDef.summaryAddressX() ); + findOrAssignPlotAxisX( curve ); + } newCurves++; } } @@ -2470,7 +2517,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleSummaryAddressDrop( RimSummaryAd if ( !skipAddress ) { - curves.push_back( addNewCurveY( droppedAddress, summaryCase ) ); + curves.push_back( addNewCurve( droppedAddress, summaryCase, RifEclipseSummaryAddress::timeAddress(), nullptr ) ); newCurves++; } } @@ -2523,6 +2570,7 @@ void RimSummaryPlot::handleDroppedObjects( const std::vectorsetSummaryCaseY( summaryCase ); newCurve->setSummaryAddressYAndApplyInterpolation( address ); + + // This address is RifEclipseSummaryAddress::time() if the curve is a time plot. Otherwise it is the address of the summary vector used + // for the x-axis + if ( addressX.category() != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_TIME ) + { + newCurve->setAxisTypeX( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ); + newCurve->setSummaryAddressX( addressX ); + newCurve->setSummaryCaseX( summaryCaseX ); + } + addCurveNoUpdate( newCurve ); return newCurve; @@ -2672,7 +2733,7 @@ RiuPlotWidget* RimSummaryPlot::doCreatePlotViewWidget( QWidget* mainWindowParent for ( const auto& axisProperties : m_axisPropertiesArray ) { - plotWidget()->ensureAxisIsCreated( axisProperties->plotAxisType() ); + plotWidget()->ensureAxisIsCreated( axisProperties->plotAxis() ); } for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves ) @@ -2743,11 +2804,8 @@ void RimSummaryPlot::initAfterRead() copyAxis( RiuPlotAxis::defaultLeft(), m_leftYAxisProperties_OBSOLETE.v() ); copyAxis( RiuPlotAxis::defaultRight(), m_rightYAxisProperties_OBSOLETE.v() ); - - if ( m_isCrossPlot ) - copyAxis( RiuPlotAxis::defaultBottom(), m_bottomAxisProperties_OBSOLETE.v() ); - else - copyAxis( RiuPlotAxis::defaultBottom(), m_timeAxisProperties_OBSOLETE.v() ); + copyAxis( RiuPlotAxis::defaultBottomForSummaryVectors(), m_bottomAxisProperties_OBSOLETE.v() ); + copyAxis( RiuPlotAxis::defaultBottom(), m_timeAxisProperties_OBSOLETE.v() ); } for ( const auto& axisProperties : m_axisPropertiesArray ) @@ -2781,7 +2839,7 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na if ( !nameHelper ) return; nameHelper->clear(); - std::vector addresses; + std::vector addresses; std::vector sumCases; std::vector ensembleCases; @@ -2791,21 +2849,21 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na { if ( curve->summaryAddressY().isCalculated() ) { - RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( curve->summaryAddressY().id(), sumCases, addresses ); + std::vector calcAddresses; + RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( curve->summaryAddressY().id(), sumCases, calcAddresses ); + for ( const auto& adr : calcAddresses ) + { + addresses.push_back( RiaSummaryCurveAddress( adr ) ); + } } else { - addresses.push_back( curve->summaryAddressY() ); + addresses.push_back( curve->curveAddress() ); sumCases.push_back( curve->summaryCaseY() ); if ( curve->summaryCaseX() ) { sumCases.push_back( curve->summaryCaseX() ); - - if ( curve->summaryAddressX().category() != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) - { - addresses.push_back( curve->summaryAddressX() ); - } } } } @@ -2813,7 +2871,7 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na for ( auto curveSet : m_ensembleCurveSetCollection->curveSets() ) { - addresses.push_back( curveSet->summaryAddress() ); + addresses.push_back( curveSet->curveAddress() ); ensembleCases.push_back( curveSet->summaryCaseCollection() ); } @@ -2970,6 +3028,13 @@ void RimSummaryPlot::onPlotItemSelected( std::shared_ptr plotItem, //-------------------------------------------------------------------------------------------------- RimSummaryPlotSourceStepping* RimSummaryPlot::sourceSteppingObjectForKeyEventHandling() const { + auto axisTypes = m_summaryCurveCollection->horizontalAxisTypes(); + + if ( axisTypes.contains( RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) ) + { + return summaryCurveCollection()->sourceSteppingObject( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); + } + return m_sourceStepping; } @@ -2980,8 +3045,7 @@ void RimSummaryPlot::setAutoScaleXEnabled( bool enabled ) { for ( const auto& ap : m_axisPropertiesArray ) { - if ( ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_TOP || - ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_TOP || ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) { ap->setAutoZoom( enabled ); } @@ -2995,8 +3059,7 @@ void RimSummaryPlot::setAutoScaleYEnabled( bool enabled ) { for ( const auto& ap : m_axisPropertiesArray ) { - if ( ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || - ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) + if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) { ap->setAutoZoom( enabled ); } @@ -3043,7 +3106,10 @@ std::vector RimSummaryPlot::plotYAxes() const for ( const auto& ap : m_axisPropertiesArray ) { auto plotAxisProp = dynamic_cast( ap.p() ); - if ( plotAxisProp ) axisProps.push_back( plotAxisProp ); + if ( plotAxisProp && plotAxisProp->plotAxis().isVertical() ) + { + axisProps.push_back( plotAxisProp ); + } } return axisProps; @@ -3053,6 +3119,15 @@ std::vector RimSummaryPlot::plotYAxes() const /// //-------------------------------------------------------------------------------------------------- void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) +{ + assignXPlotAxis( destinationCurve ); + assignYPlotAxis( destinationCurve ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::assignYPlotAxis( RimSummaryCurve* curve ) { enum class AxisAssignmentStrategy { @@ -3065,14 +3140,14 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) auto strategy = AxisAssignmentStrategy::USE_MATCHING_UNIT; - auto destinationUnit = RiaStdStringTools::toUpper( destinationCurve->unitNameY() ); + auto destinationUnit = RiaStdStringTools::toUpper( curve->unitNameY() ); if ( destinationUnit.empty() ) strategy = AxisAssignmentStrategy::USE_MATCHING_VECTOR; - auto anyCurveWithUnitText = [this, destinationCurve] + auto anyCurveWithUnitText = [this, curve] { for ( auto c : summaryCurves() ) { - if ( c == destinationCurve ) continue; + if ( c == curve ) continue; if ( !c->unitNameY().empty() ) return true; } @@ -3088,11 +3163,11 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) for ( auto c : summaryCurves() ) { - if ( c == destinationCurve ) continue; + if ( c == curve ) continue; - if ( c->summaryAddressY().vectorName() == destinationCurve->summaryAddressY().vectorName() ) + if ( c->summaryAddressY().vectorName() == curve->summaryAddressY().vectorName() ) { - destinationCurve->setLeftOrRightAxisY( c->axisY() ); + curve->setLeftOrRightAxisY( c->axisY() ); return; } } @@ -3104,7 +3179,7 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) for ( auto c : summaryCurves() ) { - if ( c == destinationCurve ) continue; + if ( c == curve ) continue; if ( c->axisY() == RiuPlotAxis::defaultLeft() ) isLeftUsed = true; if ( c->axisY() == RiuPlotAxis::defaultRight() ) isRightUsed = true; @@ -3115,10 +3190,10 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) { for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) { - if ( axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || - axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) + if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || + axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) { - destinationCurve->setLeftOrRightAxisY( c->axisY() ); + curve->setLeftOrRightAxisY( c->axisY() ); return; } @@ -3128,13 +3203,13 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) if ( !isLeftUsed ) { - destinationCurve->setLeftOrRightAxisY( RiuPlotAxis::defaultLeft() ); + curve->setLeftOrRightAxisY( RiuPlotAxis::defaultLeft() ); return; } if ( !isRightUsed ) { - destinationCurve->setLeftOrRightAxisY( RiuPlotAxis::defaultRight() ); + curve->setLeftOrRightAxisY( RiuPlotAxis::defaultRight() ); return; } @@ -3149,9 +3224,9 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) size_t axisCountRight = 0; for ( const auto& ap : m_axisPropertiesArray ) { - if ( ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT ) + if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT ) axisCountLeft++; - else if ( ap->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) + else if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ) axisCountRight++; } @@ -3170,14 +3245,148 @@ void RimSummaryPlot::assignPlotAxis( RimSummaryCurve* destinationCurve ) if ( plotWidget() && plotWidget()->isMultiAxisSupported() ) { QString axisObjectName = "New Axis"; - if ( !destinationCurve->summaryAddressY().uiText().empty() ) - axisObjectName = QString::fromStdString( destinationCurve->summaryAddressY().uiText() ); + if ( !curve->summaryAddressY().uiText().empty() ) axisObjectName = QString::fromStdString( curve->summaryAddressY().uiText() ); newPlotAxis = plotWidget()->createNextPlotAxis( plotAxisType ); addNewAxisProperties( newPlotAxis, axisObjectName ); } - destinationCurve->setLeftOrRightAxisY( newPlotAxis ); + curve->setLeftOrRightAxisY( newPlotAxis ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::assignXPlotAxis( RimSummaryCurve* curve ) +{ + RiuPlotAxis newPlotAxis = RimSummaryPlot::plotAxisForTime(); + + if ( curve->axisTypeX() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR ) + { + enum class AxisAssignmentStrategy + { + ALL_TOP, + ALL_BOTTOM, + ALTERNATING, + USE_MATCHING_UNIT, + USE_MATCHING_VECTOR + }; + + auto strategy = AxisAssignmentStrategy::USE_MATCHING_UNIT; + + auto destinationUnit = RiaStdStringTools::toUpper( curve->unitNameX() ); + if ( destinationUnit.empty() ) strategy = AxisAssignmentStrategy::USE_MATCHING_VECTOR; + + auto anyCurveWithUnitText = [this, curve] + { + for ( auto c : summaryCurves() ) + { + if ( c == curve ) continue; + + if ( !c->unitNameX().empty() ) return true; + } + + return false; + }; + + if ( !anyCurveWithUnitText() ) strategy = AxisAssignmentStrategy::USE_MATCHING_VECTOR; + + if ( strategy == AxisAssignmentStrategy::USE_MATCHING_VECTOR ) + { + // Special handling if curve unit is matching. Try to match on summary vector name to avoid creation of new axis + + for ( auto c : summaryCurves() ) + { + if ( c == curve ) continue; + + if ( c->summaryAddressX().vectorName() == curve->summaryAddressX().vectorName() ) + { + curve->setTopOrBottomAxisX( c->axisX() ); + return; + } + } + } + else if ( strategy == AxisAssignmentStrategy::USE_MATCHING_UNIT ) + { + bool isTopUsed = false; + bool isBottomUsed = false; + + for ( auto c : summaryCurves() ) + { + if ( c == curve ) continue; + + if ( c->axisX() == RiuPlotAxis::defaultTop() ) isTopUsed = true; + if ( c->axisX() == RiuPlotAxis::defaultBottomForSummaryVectors() ) isBottomUsed = true; + + auto currentUnit = RiaStdStringTools::toUpper( c->unitNameX() ); + + if ( currentUnit == destinationUnit ) + { + for ( RimPlotAxisPropertiesInterface* axisProperties : m_axisPropertiesArray ) + { + if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_TOP || + axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + { + curve->setTopOrBottomAxisX( c->axisX() ); + + return; + } + } + } + } + + if ( !isTopUsed ) + { + curve->setTopOrBottomAxisX( RiuPlotAxis::defaultTop() ); + return; + } + + if ( !isBottomUsed ) + { + curve->setTopOrBottomAxisX( RiuPlotAxis::defaultBottomForSummaryVectors() ); + return; + } + + strategy = AxisAssignmentStrategy::ALTERNATING; + } + + RiaDefines::PlotAxis plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_TOP; + + if ( strategy == AxisAssignmentStrategy::ALTERNATING ) + { + size_t axisCountTop = 0; + size_t axisCountBot = 0; + for ( const auto& ap : m_axisPropertiesArray ) + { + if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_TOP ) + axisCountTop++; + else if ( ap->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + axisCountBot++; + } + + if ( axisCountTop > axisCountBot ) plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM; + } + else if ( strategy == AxisAssignmentStrategy::ALL_TOP ) + { + plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_TOP; + } + else if ( strategy == AxisAssignmentStrategy::ALL_BOTTOM ) + { + plotAxisType = RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM; + } + + RiuPlotAxis newPlotAxis = RiuPlotAxis::defaultBottomForSummaryVectors(); + if ( plotWidget() && plotWidget()->isMultiAxisSupported() ) + { + QString axisObjectName = "New Axis"; + if ( !curve->summaryAddressX().uiText().empty() ) axisObjectName = QString::fromStdString( curve->summaryAddressX().uiText() ); + + newPlotAxis = plotWidget()->createNextPlotAxis( plotAxisType ); + addNewAxisProperties( newPlotAxis, axisObjectName ); + } + } + + curve->setTopOrBottomAxisX( newPlotAxis ); } //-------------------------------------------------------------------------------------------------- @@ -3206,7 +3415,7 @@ void RimSummaryPlot::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::set usedPlotAxis; for ( const auto& axisProperties : m_axisPropertiesArray ) { - usedPlotAxis.insert( axisProperties->plotAxisType() ); + usedPlotAxis.insert( axisProperties->plotAxis() ); } plotWidget()->pruneAxes( usedPlotAxis ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h index e20f8a184f..007e127362 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -86,7 +86,7 @@ class RimSummaryPlot : public RimPlot, public RimSummaryDataSourceStepping caf::Signal autoTitleChanged; public: - RimSummaryPlot( bool isCrossPlot = false ); + RimSummaryPlot(); ~RimSummaryPlot() override; void setDescription( const QString& description ); @@ -175,7 +175,7 @@ class RimSummaryPlot : public RimPlot, public RimSummaryDataSourceStepping void setNormalizationEnabled( bool enable ); bool isNormalizationEnabled(); - virtual RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const; + RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const; void setAutoScaleXEnabled( bool enabled ) override; void setAutoScaleYEnabled( bool enabled ) override; @@ -205,8 +205,8 @@ class RimSummaryPlot : public RimPlot, public RimSummaryDataSourceStepping std::vector plotYAxes() const; RimPlotAxisPropertiesInterface* axisPropertiesForPlotAxis( RiuPlotAxis plotAxis ) const; - - RimPlotAxisProperties* addNewAxisProperties( RiaDefines::PlotAxis, const QString& name ); + RimPlotAxisProperties* addNewAxisProperties( RiaDefines::PlotAxis, const QString& name ); + void findOrAssignPlotAxisX( RimSummaryCurve* curve ); std::vector visibleCurvesForLegend() override; @@ -296,9 +296,15 @@ private slots: void timeAxisSettingsChanged( const caf::SignalEmitter* emitter ); void timeAxisSettingsChangedReloadRequired( const caf::SignalEmitter* emitter ); + void ensureRequiredAxisObjectsForCurves(); void assignPlotAxis( RimSummaryCurve* curve ); + void assignYPlotAxis( RimSummaryCurve* curve ); + void assignXPlotAxis( RimSummaryCurve* curve ); - RimSummaryCurve* addNewCurveY( const RifEclipseSummaryAddress& address, RimSummaryCase* summaryCase ); + RimSummaryCurve* addNewCurve( const RifEclipseSummaryAddress& address, + RimSummaryCase* summaryCase, + const RifEclipseSummaryAddress& addressX, + RimSummaryCase* summaryCaseX ); RimEnsembleCurveSet* addNewEnsembleCurveY( const RifEclipseSummaryAddress& address, RimSummaryCaseCollection* ensemble ); void updateStackedCurveData(); @@ -314,6 +320,8 @@ private slots: bool isOnlyWaterCutCurvesVisible( RiuPlotAxis plotAxis ); + static RiuPlotAxis plotAxisForTime(); + private: #ifdef USE_QTCHARTS caf::PdmField m_useQtChartsPlot; @@ -341,8 +349,6 @@ private slots: std::unique_ptr m_summaryPlot; std::unique_ptr m_plotInfoLabel; - bool m_isCrossPlot; - std::unique_ptr m_nameHelperAllCurves; caf::PdmChildField m_sourceStepping; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp index 6f0ec0f1a1..3ed729108b 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotAxisFormatter.cpp @@ -119,7 +119,7 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuPlotWidget* plot { if ( !plotWidget ) return; - RiuPlotAxis axis = m_axisProperties->plotAxisType(); + RiuPlotAxis axis = m_axisProperties->plotAxis(); { QString axisTitle = m_axisProperties->customTitle(); if ( m_axisProperties->useAutoTitle() ) axisTitle = autoAxisTitle(); @@ -131,7 +131,7 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuPlotWidget* plot } QString objectName = createAxisObjectName(); - m_axisProperties->setNameAndAxis( objectName, axisTitle, axis.axis(), axis.index() ); + m_axisProperties->setNameAndAxis( objectName + axisTitle, axisTitle, axis.axis(), axis.index() ); plotWidget->setAxisTitleText( axis, axisTitle ); bool titleBold = false; @@ -254,33 +254,25 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const RifEclipseSummaryAddress sumAddress; std::string unitText; - if ( m_axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( m_axisProperties->plotAxis().isHorizontal() ) { sumAddress = rimCurve->summaryAddressX(); unitText = rimCurve->unitNameX(); } - else if ( rimCurve->axisY() == m_axisProperties->plotAxisType() ) + else if ( rimCurve->axisY() == m_axisProperties->plotAxis() ) { sumAddress = rimCurve->summaryAddressY(); unitText = rimCurve->unitNameY(); } - else - { - continue; - } addToUnitToQuantityMap( unitText, sumAddress ); } for ( const RiaSummaryCurveDefinition& curveDef : m_curveDefinitions ) { - const RifEclipseSummaryAddress& sumAddress = curveDef.summaryAddress(); - std::string unitText; - if ( curveDef.summaryCase() && curveDef.summaryCase()->summaryReader() ) - { - unitText = curveDef.summaryCase()->summaryReader()->unitName( sumAddress ); - } - else if ( curveDef.ensemble() ) + std::string unitText; + RifEclipseSummaryAddress sumAddress = curveDef.summaryAddress(); + if ( curveDef.ensemble() ) { std::vector sumCases = curveDef.ensemble()->allSummaryCases(); if ( !sumCases.empty() && sumCases[0] && sumCases[0]->summaryReader() ) @@ -288,6 +280,20 @@ QString RimSummaryPlotAxisFormatter::autoAxisTitle() const unitText = sumCases[0]->summaryReader()->unitName( sumAddress ); } } + else + { + RimSummaryCase* sumCase = curveDef.summaryCase(); + if ( m_axisProperties->plotAxis().isHorizontal() ) + { + sumCase = curveDef.summaryCaseX(); + sumAddress = curveDef.summaryAddressX(); + } + + if ( sumCase && sumCase->summaryReader() ) + { + unitText = sumCase->summaryReader()->unitName( sumAddress ); + } + } addToUnitToQuantityMap( unitText, sumAddress ); } @@ -368,29 +374,26 @@ QString RimSummaryPlotAxisFormatter::createAxisObjectName() const for ( RimSummaryCurve* rimCurve : m_summaryCurves ) { - RifEclipseSummaryAddress sumAddress; - - if ( m_axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( rimCurve->axisY() == m_axisProperties->plotAxis() ) { - sumAddress = rimCurve->summaryAddressX(); + addVectorNames( rimCurve->summaryAddressY() ); } - else if ( rimCurve->axisY() == m_axisProperties->plotAxisType() ) - { - sumAddress = rimCurve->summaryAddressY(); - } - else + else if ( rimCurve->axisX() == m_axisProperties->plotAxis() ) { - continue; + addVectorNames( rimCurve->summaryAddressX() ); } - - addVectorNames( sumAddress ); } for ( const RiaSummaryCurveDefinition& curveDef : m_curveDefinitions ) { - const RifEclipseSummaryAddress& sumAddress = curveDef.summaryAddress(); - - addVectorNames( sumAddress ); + if ( m_axisProperties->plotAxis().isVertical() ) + { + addVectorNames( curveDef.summaryAddress() ); + } + else + { + addVectorNames( curveDef.summaryAddressX() ); + } } QString assembledAxisObjectName; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp index bd32597303..48e4aab140 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.cpp @@ -48,7 +48,7 @@ void RimSummaryPlotNameHelper::clear() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryPlotNameHelper::appendAddresses( const std::vector& addresses ) +void RimSummaryPlotNameHelper::appendAddresses( const std::vector& addresses ) { m_analyzer->appendAddresses( addresses ); @@ -102,8 +102,14 @@ QString RimSummaryPlotNameHelper::plotTitle() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimSummaryPlotNameHelper::isPlotDisplayingSingleVectorName() const +bool RimSummaryPlotNameHelper::isPlotDisplayingSingleCurve() const { + if ( m_analyzer->quantities().size() == 2 && m_analyzer->onlyCrossPlotCurves() ) + { + // We have cross plot curves, and two quantities. This means that we have one curve. + return true; + } + if ( m_analyzer->quantities().size() == 2 ) { std::vector strings; @@ -113,6 +119,7 @@ bool RimSummaryPlotNameHelper::isPlotDisplayingSingleVectorName() const auto first = RimObjectiveFunctionTools::nativeQuantityName( strings[0] ); auto second = RimObjectiveFunctionTools::nativeQuantityName( strings[1] ); + // We have two quantities, one summary vector and one corresponding history vector. if ( first == second ) return true; } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h index a872dc046c..953614120a 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotNameHelper.h @@ -44,13 +44,13 @@ class RimSummaryPlotNameHelper : public RimSummaryNameHelper void clear(); - void appendAddresses( const std::vector& addresses ); + void appendAddresses( const std::vector& addresses ); void setSummaryCases( const std::vector& summaryCases ); void setEnsembleCases( const std::vector& ensembleCases ); QString plotTitle() const override; - bool isPlotDisplayingSingleVectorName() const override; + bool isPlotDisplayingSingleCurve() const override; bool isWellNameInTitle() const override; bool isGroupNameInTitle() const override; bool isNetworkInTitle() const override; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp index 860d61a151..47a20b25f4 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlotSourceStepping.cpp @@ -255,47 +255,47 @@ QList RimSummaryPlotSourceStepping::calculateValueOption } else { - SummaryVarCategory category = SummaryVarCategory::SUMMARY_INVALID; - std::string secondaryIdentifier; + SummaryCategory category = SummaryCategory::SUMMARY_INVALID; + std::string secondaryIdentifier; if ( fieldNeedingOptions == &m_wellName ) { - category = SummaryVarCategory::SUMMARY_WELL; + category = SummaryCategory::SUMMARY_WELL; } else if ( fieldNeedingOptions == &m_region ) { - category = SummaryVarCategory::SUMMARY_REGION; + category = SummaryCategory::SUMMARY_REGION; } else if ( fieldNeedingOptions == &m_groupName ) { - category = SummaryVarCategory::SUMMARY_GROUP; + category = SummaryCategory::SUMMARY_GROUP; } else if ( fieldNeedingOptions == &m_networkName ) { - category = SummaryVarCategory::SUMMARY_NETWORK; + category = SummaryCategory::SUMMARY_NETWORK; } else if ( fieldNeedingOptions == &m_cellBlock ) { - category = SummaryVarCategory::SUMMARY_BLOCK; + category = SummaryCategory::SUMMARY_BLOCK; } else if ( fieldNeedingOptions == &m_wellSegment ) { secondaryIdentifier = m_wellName().toStdString(); - category = SummaryVarCategory::SUMMARY_WELL_SEGMENT; + category = SummaryCategory::SUMMARY_WELL_SEGMENT; } else if ( fieldNeedingOptions == &m_completion ) { secondaryIdentifier = m_wellName().toStdString(); - category = SummaryVarCategory::SUMMARY_WELL_COMPLETION; + category = SummaryCategory::SUMMARY_WELL_COMPLETION; } else if ( fieldNeedingOptions == &m_aquifer ) { - category = SummaryVarCategory::SUMMARY_AQUIFER; + category = SummaryCategory::SUMMARY_AQUIFER; } std::vector identifierTexts; - if ( category != SummaryVarCategory::SUMMARY_INVALID ) + if ( category != SummaryCategory::SUMMARY_INVALID ) { identifierTexts = analyzer->identifierTexts( category, secondaryIdentifier ); } @@ -445,41 +445,41 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle* if ( changedField != &m_vectorName ) { - SummaryVarCategory summaryCategoryToModify = SummaryVarCategory::SUMMARY_INVALID; + SummaryCategory summaryCategoryToModify = SummaryCategory::SUMMARY_INVALID; if ( changedField == &m_wellName ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_WELL; + summaryCategoryToModify = SummaryCategory::SUMMARY_WELL; } else if ( changedField == &m_region ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_REGION; + summaryCategoryToModify = SummaryCategory::SUMMARY_REGION; } else if ( changedField == &m_groupName ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_GROUP; + summaryCategoryToModify = SummaryCategory::SUMMARY_GROUP; } else if ( changedField == &m_networkName ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_NETWORK; + summaryCategoryToModify = SummaryCategory::SUMMARY_NETWORK; } else if ( changedField == &m_cellBlock ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_BLOCK; + summaryCategoryToModify = SummaryCategory::SUMMARY_BLOCK; } else if ( changedField == &m_wellSegment ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_WELL_SEGMENT; + summaryCategoryToModify = SummaryCategory::SUMMARY_WELL_SEGMENT; } else if ( changedField == &m_completion ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_WELL_COMPLETION; + summaryCategoryToModify = SummaryCategory::SUMMARY_WELL_COMPLETION; } else if ( changedField == &m_aquifer ) { - summaryCategoryToModify = SummaryVarCategory::SUMMARY_AQUIFER; + summaryCategoryToModify = SummaryCategory::SUMMARY_AQUIFER; } - if ( summaryCategoryToModify != SummaryVarCategory::SUMMARY_INVALID ) + if ( summaryCategoryToModify != SummaryCategory::SUMMARY_INVALID ) { for ( auto curve : curves ) { @@ -745,7 +745,7 @@ std::vector RimSummaryPlotSourceStepping::activeFieldsForD RiaSummaryAddressAnalyzer analyzer; analyzer.appendAddresses( addressesForCurvesInPlot() ); - SummaryVarCategory category = SummaryVarCategory::SUMMARY_INVALID; + SummaryCategory category = SummaryCategory::SUMMARY_INVALID; if ( !analyzer.categories().empty() ) { @@ -766,12 +766,12 @@ std::vector RimSummaryPlotSourceStepping::activeFieldsForD if ( allCategoriesAreDependingOnWellName ) { - category = SummaryVarCategory::SUMMARY_WELL; + category = SummaryCategory::SUMMARY_WELL; } } } - if ( category != SummaryVarCategory::SUMMARY_INVALID ) + if ( category != SummaryCategory::SUMMARY_INVALID ) { if ( analyzer.wellNames().size() == 1 ) { @@ -1020,7 +1020,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu { case RimSummaryDataSourceStepping::SourceSteppingDimension::WELL: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_WELL, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_WELL, "" ); auto searchString = QString::fromStdString( addr.wellName() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setWellName( ( *found ).toStdString() ); @@ -1029,7 +1029,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu case RimSummaryDataSourceStepping::SourceSteppingDimension::GROUP: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_GROUP, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_GROUP, "" ); auto searchString = QString::fromStdString( addr.groupName() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setGroupName( ( *found ).toStdString() ); @@ -1038,7 +1038,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu case RimSummaryDataSourceStepping::SourceSteppingDimension::NETWORK: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_NETWORK, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_NETWORK, "" ); auto searchString = QString::fromStdString( addr.networkName() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setNetworkName( ( *found ).toStdString() ); @@ -1047,7 +1047,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu case RimSummaryDataSourceStepping::SourceSteppingDimension::REGION: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_REGION, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_REGION, "" ); auto searchString = QString::number( addr.regionNumber() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setRegion( ( *found ).toInt() ); @@ -1072,7 +1072,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu case RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_BLOCK, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_BLOCK, "" ); auto searchString = QString::fromStdString( addr.blockAsString() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setCellIjk( ( *found ).toStdString() ); @@ -1081,7 +1081,7 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu case RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER: { - auto ids = analyzer.identifierTexts( SummaryVarCategory::SUMMARY_AQUIFER, "" ); + auto ids = analyzer.identifierTexts( SummaryCategory::SUMMARY_AQUIFER, "" ); auto searchString = QString::number( addr.aquiferNumber() ); auto found = getIdIterator( ids, searchString ); if ( found != ids.end() ) addr.setAquiferNumber( ( *found ).toInt() ); @@ -1190,7 +1190,7 @@ void RimSummaryPlotSourceStepping::setStep( QString stepIdentifier ) //-------------------------------------------------------------------------------------------------- std::map RimSummaryPlotSourceStepping::optionsForQuantity( std::set addresses ) { - SummaryVarCategory category = SummaryVarCategory::SUMMARY_FIELD; + SummaryCategory category = SummaryCategory::SUMMARY_FIELD; auto visibleCurveAddresses = addressesForCurvesInPlot(); if ( !visibleCurveAddresses.empty() ) @@ -1223,7 +1223,7 @@ std::map RimSummaryPlotSourceStepping::optionsForQuantity( std //-------------------------------------------------------------------------------------------------- std::map RimSummaryPlotSourceStepping::optionsForQuantity( RiaSummaryAddressAnalyzer* analyzser ) { - SummaryVarCategory category = SummaryVarCategory::SUMMARY_FIELD; + SummaryCategory category = SummaryCategory::SUMMARY_FIELD; auto visibleCurveAddresses = addressesForCurvesInPlot(); if ( !visibleCurveAddresses.empty() ) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp index 4bb8e1b751..ab71646ba1 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.cpp @@ -74,7 +74,7 @@ RimSummaryTable::RimSummaryTable() m_vector.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() ); CAF_PDM_InitFieldNoDefault( &m_category, "Categories", "Category" ); m_category.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() ); - m_category = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL; + m_category = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL; CAF_PDM_InitFieldNoDefault( &m_resamplingSelection, "ResamplingSelection", "Date Resampling" ); m_resamplingSelection.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() ); @@ -128,7 +128,7 @@ void RimSummaryTable::setDefaultCaseAndCategoryAndVectorName() { const auto summaryCases = getToplevelSummaryCases(); m_case = nullptr; - m_category = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL; + m_category = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL; m_vector = ""; m_tableName = createTableName(); @@ -150,9 +150,9 @@ void RimSummaryTable::setDefaultCaseAndCategoryAndVectorName() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryTable::setFromCaseAndCategoryAndVectorName( RimSummaryCase* summaryCase, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, - const QString& vectorName ) +void RimSummaryTable::setFromCaseAndCategoryAndVectorName( RimSummaryCase* summaryCase, + RifEclipseSummaryAddressDefines::SummaryCategory category, + const QString& vectorName ) { m_case = summaryCase; m_category = category; @@ -354,15 +354,15 @@ QList RimSummaryTable::calculateValueOptions( const caf: } else if ( fieldNeedingOptions == &m_category ) { - options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ), - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) ); - options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ), - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) ); - options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ), - RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) ); + options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ), + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) ); + options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ), + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) ); + options.push_back( caf::PdmOptionItemInfo( caf::AppEnum::uiText( + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ), + RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) ); } else if ( fieldNeedingOptions == &m_vector && m_case ) { @@ -603,7 +603,7 @@ QString RimSummaryTable::dateFormatString() const /// //-------------------------------------------------------------------------------------------------- std::set RimSummaryTable::getSummaryAddressesFromReader( const RifSummaryReaderInterface* summaryReader, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, + RifEclipseSummaryAddressDefines::SummaryCategory category, const QString& vector ) const { if ( !summaryReader ) return {}; @@ -622,13 +622,13 @@ std::set RimSummaryTable::getSummaryAddressesFromReade //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::set RimSummaryTable::getCategoryVectorFromSummaryReader( const RifSummaryReaderInterface* summaryReader, - RifEclipseSummaryAddressDefines::SummaryVarCategory category ) const +std::set RimSummaryTable::getCategoryVectorFromSummaryReader( const RifSummaryReaderInterface* summaryReader, + RifEclipseSummaryAddressDefines::SummaryCategory category ) const { if ( !summaryReader ) return {}; - if ( category != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL && - category != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP && - category != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) + if ( category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL && + category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP && + category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) { return {}; } @@ -649,15 +649,15 @@ std::set RimSummaryTable::getCategoryVectorFromSummaryReader( const Rif //-------------------------------------------------------------------------------------------------- QString RimSummaryTable::getCategoryNameFromAddress( const RifEclipseSummaryAddress& address ) const { - if ( address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ) + if ( address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ) { return QString::fromStdString( address.wellName() ); } - else if ( address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ) + else if ( address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ) { return QString::fromStdString( address.groupName() ); } - else if ( address.category() == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION ) + else if ( address.category() == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION ) { return QString( "Region %1" ).arg( address.regionNumber() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h index e007b33de0..9b7db25081 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h @@ -59,9 +59,9 @@ class RimSummaryTable : public RimPlotWindow ~RimSummaryTable() override; void setDefaultCaseAndCategoryAndVectorName(); - void setFromCaseAndCategoryAndVectorName( RimSummaryCase* summaryCase, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, - const QString& vectorName ); + void setFromCaseAndCategoryAndVectorName( RimSummaryCase* summaryCase, + RifEclipseSummaryAddressDefines::SummaryCategory category, + const QString& vectorName ); void setDescription( const QString& description ); QString description() const override; @@ -98,11 +98,11 @@ class RimSummaryTable : public RimPlotWindow std::pair createLegendMinMaxValues( const double maxTableValue ) const; QString dateFormatString() const; - std::set getSummaryAddressesFromReader( const RifSummaryReaderInterface* summaryReader, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, - const QString& vector ) const; - std::set getCategoryVectorFromSummaryReader( const RifSummaryReaderInterface* summaryReader, - RifEclipseSummaryAddressDefines::SummaryVarCategory category ) const; + std::set getSummaryAddressesFromReader( const RifSummaryReaderInterface* summaryReader, + RifEclipseSummaryAddressDefines::SummaryCategory category, + const QString& vector ) const; + std::set getCategoryVectorFromSummaryReader( const RifSummaryReaderInterface* summaryReader, + RifEclipseSummaryAddressDefines::SummaryCategory category ) const; QString getCategoryNameFromAddress( const RifEclipseSummaryAddress& address ) const; std::vector getToplevelSummaryCases() const; @@ -115,10 +115,10 @@ class RimSummaryTable : public RimPlotWindow caf::PdmField m_isAutomaticName; caf::PdmPtrField m_case; - caf::PdmField> m_category; - caf::PdmField m_vector; - caf::PdmField> m_resamplingSelection; - caf::PdmField m_thresholdValue; + caf::PdmField> m_category; + caf::PdmField m_vector; + caf::PdmField> m_resamplingSelection; + caf::PdmField m_thresholdValue; caf::PdmField> m_excludedRowsUiField; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp index 14301b6cc3..88b3e16926 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.cpp @@ -128,10 +128,9 @@ RimSummaryTable* RimSummaryTableCollection::createDefaultSummaryTable() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimSummaryTable* - RimSummaryTableCollection::createSummaryTableFromCategoryAndVectorName( RimSummaryCase* summaryCase, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, - const QString& vectorName ) +RimSummaryTable* RimSummaryTableCollection::createSummaryTableFromCategoryAndVectorName( RimSummaryCase* summaryCase, + RifEclipseSummaryAddressDefines::SummaryCategory category, + const QString& vectorName ) { RimSummaryTable* table = new RimSummaryTable(); table->setFromCaseAndCategoryAndVectorName( summaryCase, category, vectorName ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h index ef108d235e..eaaca4f85d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableCollection.h @@ -51,9 +51,9 @@ class RimSummaryTableCollection : public caf::PdmObject, public RimPlotCollectio void removeTable( RimSummaryTable* table ); RimSummaryTable* createDefaultSummaryTable(); - RimSummaryTable* createSummaryTableFromCategoryAndVectorName( RimSummaryCase* summaryCase, - RifEclipseSummaryAddressDefines::SummaryVarCategory category, - const QString& vectorName ); + RimSummaryTable* createSummaryTableFromCategoryAndVectorName( RimSummaryCase* summaryCase, + RifEclipseSummaryAddressDefines::SummaryCategory category, + const QString& vectorName ); private: caf::PdmChildArrayField m_summaryTables; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp index f95b5b97aa..0ea047dce7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp @@ -164,7 +164,7 @@ RimPlotAxisPropertiesInterface::AxisTitlePositionType RimSummaryTimeAxisProperti //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RiuPlotAxis RimSummaryTimeAxisProperties::plotAxisType() const +RiuPlotAxis RimSummaryTimeAxisProperties::plotAxis() const { return RiuPlotAxis::defaultBottom(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h index d6976c031e..c8268f5026 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h @@ -85,7 +85,7 @@ class RimSummaryTimeAxisProperties : public RimPlotAxisPropertiesInterface caf::PdmField title; caf::PdmField showTitle; - RiuPlotAxis plotAxisType() const override; + RiuPlotAxis plotAxis() const override; AxisTitlePositionType titlePosition() const override; int titleFontSize() const override; int valuesFontSize() const override; diff --git a/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp b/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp index 3cea9ad2ad..d1f5f055ab 100644 --- a/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp +++ b/ApplicationLibCode/UnitTests/ObservedDataParser-Test.cpp @@ -991,7 +991,7 @@ TEST( RifKeywordBasedRsmspecParserTest, TestAddressCreation ) RifEclipseSummaryAddress address = RifEclipseUserDataKeywordTools::makeAndFillAddress( quantityName, headerColumn ); EXPECT_TRUE( address.isValid() ); - EXPECT_EQ( address.category(), RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR ); + EXPECT_EQ( address.category(), RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR ); EXPECT_EQ( address.uiText(), "LCABC:lgrName:wellName:12,14,16" ); } diff --git a/ApplicationLibCode/UnitTests/RiaSummaryAddressAnalyzer-Test.cpp b/ApplicationLibCode/UnitTests/RiaSummaryAddressAnalyzer-Test.cpp index 8a7c601673..fd18dac23c 100644 --- a/ApplicationLibCode/UnitTests/RiaSummaryAddressAnalyzer-Test.cpp +++ b/ApplicationLibCode/UnitTests/RiaSummaryAddressAnalyzer-Test.cpp @@ -168,6 +168,6 @@ TEST( RiaSummaryAddressAnalyzer, QuantitiesPerCategory ) auto categories = analyzer.categories(); EXPECT_EQ( 2u, categories.size() ); - auto vectorNamesForWells = analyzer.vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ); + auto vectorNamesForWells = analyzer.vectorNamesForCategory( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ); EXPECT_EQ( 3u, vectorNamesForWells.size() ); } diff --git a/ApplicationLibCode/UnitTests/RifEclipseSummaryAddress-Test.cpp b/ApplicationLibCode/UnitTests/RifEclipseSummaryAddress-Test.cpp index c2a7d79dda..3d493779ae 100644 --- a/ApplicationLibCode/UnitTests/RifEclipseSummaryAddress-Test.cpp +++ b/ApplicationLibCode/UnitTests/RifEclipseSummaryAddress-Test.cpp @@ -18,7 +18,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Field ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD, addr.category() ); EXPECT_EQ( "FOPT", addr.vectorName() ); EXPECT_FALSE( addr.isErrorResult() ); } @@ -30,7 +30,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Aquifer ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER, addr.category() ); EXPECT_EQ( "AAQR", addr.vectorName() ); EXPECT_EQ( 456, addr.aquiferNumber() ); EXPECT_FALSE( addr.isErrorResult() ); @@ -43,7 +43,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Network ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK, addr.category() ); EXPECT_EQ( "NETW", addr.vectorName() ); EXPECT_FALSE( addr.isErrorResult() ); } @@ -55,7 +55,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Network_name ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK, addr.category() ); EXPECT_EQ( "NETW", addr.vectorName() ); EXPECT_EQ( "MYNAME", addr.networkName() ); EXPECT_FALSE( addr.isErrorResult() ); @@ -68,7 +68,7 @@ TEST( RifEclipseSummaryAddressTest, DISABLED_TestEclipseAddressParsing_Misc ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC, addr.category() ); EXPECT_EQ( "CPU", addr.vectorName() ); EXPECT_FALSE( addr.isErrorResult() ); } @@ -80,7 +80,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Region ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION, addr.category() ); EXPECT_EQ( "RPR", addr.vectorName() ); EXPECT_EQ( 7081, addr.regionNumber() ); EXPECT_FALSE( addr.isErrorResult() ); @@ -93,7 +93,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_RegionToRegion ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION, addr.category() ); EXPECT_EQ( "ROFR", addr.vectorName() ); EXPECT_EQ( 7081, addr.regionNumber() ); EXPECT_EQ( 8001, addr.regionNumber2() ); @@ -107,7 +107,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_WellGroup ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP, addr.category() ); EXPECT_EQ( "GOPR", addr.vectorName() ); EXPECT_EQ( "WELLS1", addr.groupName() ); EXPECT_FALSE( addr.isErrorResult() ); @@ -120,7 +120,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Well ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL, addr.category() ); EXPECT_EQ( "WOPR", addr.vectorName() ); EXPECT_EQ( "B-2H", addr.wellName() ); EXPECT_FALSE( addr.isErrorResult() ); @@ -133,7 +133,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_WellCompletion ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION, addr.category() ); EXPECT_EQ( "COFRL", addr.vectorName() ); EXPECT_EQ( "B-1H", addr.wellName() ); EXPECT_EQ( 15, addr.cellI() ); @@ -149,7 +149,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_WellLgr ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR, addr.category() ); EXPECT_EQ( "LWABC", addr.vectorName() ); EXPECT_EQ( "LGRNA", addr.lgrName() ); EXPECT_EQ( "B-10H", addr.wellName() ); @@ -163,7 +163,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_WellCompletionLgr RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR, addr.category() ); EXPECT_EQ( "LCGAS", addr.vectorName() ); EXPECT_EQ( "LGR1", addr.lgrName() ); EXPECT_EQ( "B-1H", addr.wellName() ); @@ -180,7 +180,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_WellSegment ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT, addr.category() ); EXPECT_EQ( "SOFR", addr.vectorName() ); EXPECT_EQ( "B-5H", addr.wellName() ); EXPECT_EQ( 32, addr.wellSegmentNumber() ); @@ -194,7 +194,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Block ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK, addr.category() ); EXPECT_EQ( "BPR", addr.vectorName() ); EXPECT_EQ( 123, addr.cellI() ); EXPECT_EQ( 122, addr.cellJ() ); @@ -209,7 +209,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_BlockLgr ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR, addr.category() ); EXPECT_EQ( "LBABC", addr.vectorName() ); EXPECT_EQ( "LGRN", addr.lgrName() ); EXPECT_EQ( 45, addr.cellI() ); @@ -225,7 +225,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Imported ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED, addr.category() ); EXPECT_EQ( "FAULT (Imp)", addr.vectorName() ); EXPECT_FALSE( addr.isErrorResult() ); } @@ -237,7 +237,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_ErrorResult1 ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER, addr.category() ); EXPECT_EQ( "AAQR", addr.vectorName() ); EXPECT_EQ( 456, addr.aquiferNumber() ); EXPECT_TRUE( addr.isErrorResult() ); @@ -250,7 +250,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_ErrorResult2 ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR, addr.category() ); EXPECT_EQ( "LCGAS", addr.vectorName() ); EXPECT_EQ( "LGR1", addr.lgrName() ); EXPECT_EQ( "B-1H", addr.wellName() ); @@ -267,14 +267,14 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_ErrorResult3 ) RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_IMPORTED, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_IMPORTED, addr.category() ); EXPECT_EQ( "FAULT (Imp)", addr.vectorName() ); EXPECT_TRUE( addr.isErrorResult() ); } TEST( RifEclipseSummaryAddressTest, TestEclipseAddressIjkParsing ) { - RifEclipseSummaryAddressDefines::SummaryVarCategory cat = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION; + RifEclipseSummaryAddressDefines::SummaryCategory cat = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION; std::map identifiers( { { RifEclipseSummaryAddressDefines::SummaryIdentifierType::INPUT_WELL_NAME, "1-BH" }, { RifEclipseSummaryAddressDefines::SummaryIdentifierType::INPUT_CELL_IJK, "6, 7, 8" }, @@ -284,7 +284,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressIjkParsing ) RifEclipseSummaryAddress addr( cat, identifiers ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION, addr.category() ); EXPECT_EQ( "WOPR", addr.vectorName() ); EXPECT_EQ( "1-BH", addr.wellName() ); EXPECT_EQ( 6, addr.cellI() ); @@ -295,7 +295,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressIjkParsing ) TEST( RifEclipseSummaryAddressTest, TestEclipseAddressRegToRegParsing ) { - RifEclipseSummaryAddressDefines::SummaryVarCategory cat = RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION; + RifEclipseSummaryAddressDefines::SummaryCategory cat = RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION; std::map identifiers( { { RifEclipseSummaryAddressDefines::SummaryIdentifierType::INPUT_REGION_2_REGION, "123 - 456" }, { RifEclipseSummaryAddressDefines::SummaryIdentifierType::INPUT_VECTOR_NAME, "ROFR" }, @@ -304,7 +304,7 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressRegToRegParsing ) RifEclipseSummaryAddress addr( cat, identifiers ); EXPECT_TRUE( addr.isValid() ); - EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION, addr.category() ); + EXPECT_EQ( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION, addr.category() ); EXPECT_EQ( "ROFR", addr.vectorName() ); EXPECT_EQ( 123, addr.regionNumber() ); EXPECT_EQ( 456, addr.regionNumber2() ); diff --git a/ApplicationLibCode/UnitTests/RifRevealCsvSectionSummaryReader-Test.cpp b/ApplicationLibCode/UnitTests/RifRevealCsvSectionSummaryReader-Test.cpp index 5917f81e31..0675d6be73 100644 --- a/ApplicationLibCode/UnitTests/RifRevealCsvSectionSummaryReader-Test.cpp +++ b/ApplicationLibCode/UnitTests/RifRevealCsvSectionSummaryReader-Test.cpp @@ -27,7 +27,7 @@ TEST( RifRevealCsvSectionSummaryReaderTest, ExpectedText ) QString errorMessage; RifRevealCsvSectionSummaryReader reader; - bool isOk = reader.parse( fileContents, RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL, &errorMessage ); + bool isOk = reader.parse( fileContents, RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL, &errorMessage ); ASSERT_TRUE( isOk ); EXPECT_TRUE( errorMessage.isEmpty() ); @@ -46,6 +46,6 @@ TEST( RifRevealCsvSectionSummaryReaderTest, EmptyText ) QString fileContents = ""; QString errorMessage; - bool isOk = reader.parse( fileContents, RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_MISC, &errorMessage ); + bool isOk = reader.parse( fileContents, RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_MISC, &errorMessage ); ASSERT_FALSE( isOk ); } diff --git a/ApplicationLibCode/UnitTests/RiuSummaryVectorDescriptionMap-Test.cpp b/ApplicationLibCode/UnitTests/RiuSummaryVectorDescriptionMap-Test.cpp index 1900c40b08..4519c861f4 100644 --- a/ApplicationLibCode/UnitTests/RiuSummaryVectorDescriptionMap-Test.cpp +++ b/ApplicationLibCode/UnitTests/RiuSummaryVectorDescriptionMap-Test.cpp @@ -11,7 +11,7 @@ TEST( RiuSummaryQuantityNameInfoProvider, TestInit ) { std::string s( "SRSFC" ); auto cat = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( s ); - EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT ); + EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT ); auto longName = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromVectorName( s ); EXPECT_TRUE( longName == "Reach brine concentration" ); @@ -27,7 +27,7 @@ TEST( RiuSummaryQuantityNameInfoProvider, TestInit ) { std::string s( "does not exist" ); auto cat = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( s ); - EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ); + EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ); auto longName = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromVectorName( s ); @@ -57,7 +57,7 @@ TEST( RiuSummaryQuantityNameInfoProvider, TestCustomNaming ) { std::string s( "SRSFCABC" ); auto cat = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( s ); - EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT ); + EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT ); auto longName = RiuSummaryQuantityNameInfoProvider::instance()->longNameFromVectorName( s ); EXPECT_TRUE( longName == "Reach brine concentration" ); @@ -79,13 +79,13 @@ TEST( RiuSummaryQuantityNameInfoProvider, Test6x ) { std::string s( "GLIT" ); auto cat = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( s ); - EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_GROUP ); + EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_GROUP ); } { std::string s( "WSBVPROP" ); auto cat = RiuSummaryQuantityNameInfoProvider::instance()->identifyCategory( s ); - EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL ); + EXPECT_TRUE( cat == RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL ); } } diff --git a/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp b/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp index 47d7569c73..23531e3f2a 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp +++ b/ApplicationLibCode/UserInterface/RiuPlotAxis.cpp @@ -84,6 +84,15 @@ RiuPlotAxis RiuPlotAxis::defaultBottom() return RiuPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiuPlotAxis RiuPlotAxis::defaultBottomForSummaryVectors() +{ + // Time axis is using index 0, so we need to use index 1 for the bottom axis + return RiuPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM, 1 ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -92,6 +101,22 @@ RiaDefines::PlotAxis RiuPlotAxis::axis() const return m_axis; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiuPlotAxis::isHorizontal() const +{ + return m_axis == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM || m_axis == RiaDefines::PlotAxis::PLOT_AXIS_TOP; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiuPlotAxis::isVertical() const +{ + return m_axis == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || m_axis == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/UserInterface/RiuPlotAxis.h b/ApplicationLibCode/UserInterface/RiuPlotAxis.h index d3a1460350..5588847d54 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotAxis.h +++ b/ApplicationLibCode/UserInterface/RiuPlotAxis.h @@ -32,9 +32,13 @@ class RiuPlotAxis static RiuPlotAxis defaultRight(); static RiuPlotAxis defaultTop(); static RiuPlotAxis defaultBottom(); + static RiuPlotAxis defaultBottomForSummaryVectors(); RiaDefines::PlotAxis axis() const; + bool isHorizontal() const; + bool isVertical() const; + int index() const; bool operator<( const RiuPlotAxis& rhs ) const; diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp index c0d90f0c91..d80a1e58f9 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp @@ -349,7 +349,8 @@ void RiuQwtPlotWidget::setAxisRange( RiuPlotAxis axis, double min, double max ) //-------------------------------------------------------------------------------------------------- void RiuQwtPlotWidget::setAxisInverted( RiuPlotAxis axis, bool isInverted ) { - m_plot->axisScaleEngine( toQwtPlotAxis( axis ) )->setAttribute( QwtScaleEngine::Inverted, isInverted ); + auto scaleEngine = m_plot->axisScaleEngine( toQwtPlotAxis( axis ) ); + if ( scaleEngine ) scaleEngine->setAttribute( QwtScaleEngine::Inverted, isInverted ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp index 61798c0194..5badea1ea1 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.cpp @@ -64,36 +64,36 @@ RiuSummaryQuantityNameInfoProvider* RiuSummaryQuantityNameInfoProvider::instance //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddressDefines::SummaryVarCategory RiuSummaryQuantityNameInfoProvider::identifyCategory( const std::string& vectorName ) +RifEclipseSummaryAddressDefines::SummaryCategory RiuSummaryQuantityNameInfoProvider::identifyCategory( const std::string& vectorName ) { // Try to an exact match on the vector name first in the vector table. bool exactMatch = true; auto exactCategory = categoryFromVectorName( vectorName, exactMatch ); - if ( exactCategory != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) return exactCategory; + if ( exactCategory != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) return exactCategory; - if ( vectorName.size() < 3 || vectorName.size() > 8 ) return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID; + if ( vectorName.size() < 3 || vectorName.size() > 8 ) return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID; // Try to match the base vector name with more heuristics auto strippedQuantityName = RifEclipseSummaryAddress::baseVectorName( vectorName ); // First, try to lookup vector in vector table auto category = categoryFromVectorName( strippedQuantityName ); - if ( category != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) return category; + if ( category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) return category; switch ( strippedQuantityName[0] ) { case 'A': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_AQUIFER; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_AQUIFER; case 'B': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK; case 'F': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_FIELD; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_FIELD; case 'N': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_NETWORK; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_NETWORK; case 'S': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_SEGMENT; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_SEGMENT; case 'W': - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL; default: break; } @@ -101,26 +101,26 @@ RifEclipseSummaryAddressDefines::SummaryVarCategory RiuSummaryQuantityNameInfoPr if ( strippedQuantityName[0] == 'R' ) { if ( ParseHelpers::is_region_to_region( strippedQuantityName ) ) - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION_2_REGION; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION_2_REGION; - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_REGION; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_REGION; } // Then check LGR categories std::string firstTwoLetters = strippedQuantityName.substr( 0, 2 ); - if ( firstTwoLetters == "LB" ) return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_BLOCK_LGR; - if ( firstTwoLetters == "LC" ) return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR; - if ( firstTwoLetters == "LW" ) return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_WELL_LGR; + if ( firstTwoLetters == "LB" ) return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_BLOCK_LGR; + if ( firstTwoLetters == "LC" ) return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_COMPLETION_LGR; + if ( firstTwoLetters == "LW" ) return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_WELL_LGR; - return RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID; + return RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseSummaryAddressDefines::SummaryVarCategory - RiuSummaryQuantityNameInfoProvider::categoryFromVectorName( const std::string& vectorName, bool exactMatch ) const +RifEclipseSummaryAddressDefines::SummaryCategory RiuSummaryQuantityNameInfoProvider::categoryFromVectorName( const std::string& vectorName, + bool exactMatch ) const { auto info = quantityInfo( vectorName, exactMatch ); @@ -185,8 +185,8 @@ RiuSummaryQuantityNameInfoProvider::RiuSummaryQuantityInfo RiuSummaryQuantityNam std::string RiuSummaryQuantityNameInfoProvider::longNameFromVectorName( const std::string& vectorName, bool returnVectorNameIfNotFound ) const { auto info = quantityInfo( vectorName ); - return info.category != RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID || !returnVectorNameIfNotFound ? info.longName - : vectorName; + return info.category != RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID || !returnVectorNameIfNotFound ? info.longName + : vectorName; } //-------------------------------------------------------------------------------------------------- @@ -212,7 +212,7 @@ RiuSummaryQuantityNameInfoProvider::RiuSummaryQuantityNameInfoProvider() std::unordered_map RiuSummaryQuantityNameInfoProvider::createInfoForEclipseKeywords() { - using A = RifEclipseSummaryAddressDefines::SummaryVarCategory; + using A = RifEclipseSummaryAddressDefines::SummaryCategory; std::unordered_map info; @@ -2142,7 +2142,7 @@ std::unordered_map RiuSummaryQuantityNameInfoProvider::createInfoFor6xKeywords() { - using A = RifEclipseSummaryAddressDefines::SummaryVarCategory; + using A = RifEclipseSummaryAddressDefines::SummaryCategory; std::unordered_map info; diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h index fd491d8c65..843caaba13 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h +++ b/ApplicationLibCode/UserInterface/RiuSummaryQuantityNameInfoProvider.h @@ -31,7 +31,7 @@ class RiuSummaryQuantityNameInfoProvider public: static RiuSummaryQuantityNameInfoProvider* instance(); - RifEclipseSummaryAddressDefines::SummaryVarCategory identifyCategory( const std::string& vectorName ); + RifEclipseSummaryAddressDefines::SummaryCategory identifyCategory( const std::string& vectorName ); std::string longNameFromVectorName( const std::string& vectorName, bool returnVectorNameIfNotFound = false ) const; @@ -40,24 +40,24 @@ class RiuSummaryQuantityNameInfoProvider { public: RiuSummaryQuantityInfo() - : category( RifEclipseSummaryAddressDefines::SummaryVarCategory::SUMMARY_INVALID ) + : category( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID ) { } - RiuSummaryQuantityInfo( RifEclipseSummaryAddressDefines::SummaryVarCategory category, const std::string& longName ) + RiuSummaryQuantityInfo( RifEclipseSummaryAddressDefines::SummaryCategory category, const std::string& longName ) : category( category ) , longName( longName ) { } - RifEclipseSummaryAddressDefines::SummaryVarCategory category; - std::string longName; + RifEclipseSummaryAddressDefines::SummaryCategory category; + std::string longName; }; private: RiuSummaryQuantityNameInfoProvider(); - RiuSummaryQuantityInfo quantityInfo( const std::string& vectorName, bool exactMatch = false ) const; - RifEclipseSummaryAddressDefines::SummaryVarCategory categoryFromVectorName( const std::string& vectorName, bool exactMatch = false ) const; + RiuSummaryQuantityInfo quantityInfo( const std::string& vectorName, bool exactMatch = false ) const; + RifEclipseSummaryAddressDefines::SummaryCategory categoryFromVectorName( const std::string& vectorName, bool exactMatch = false ) const; static std::unordered_map createInfoForEclipseKeywords(); static std::unordered_map createInfoFor6xKeywords(); diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp b/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp index 282c3ec29b..dfea11f16c 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp @@ -143,7 +143,7 @@ void RiuSummaryQwtPlot::useTimeBasedTimeAxis() void RiuSummaryQwtPlot::updateAnnotationObjects( RimPlotAxisPropertiesInterface* axisProperties ) { RiaDefines::Orientation orientation = RiaDefines::Orientation::HORIZONTAL; - if ( axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) + if ( axisProperties->plotAxis().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM ) { orientation = RiaDefines::Orientation::VERTICAL; } diff --git a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp index 6f83dc11f8..0365eaefff 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp @@ -96,67 +96,67 @@ SummaryIdentifierAndField::~SummaryIdentifierAndField() //-------------------------------------------------------------------------------------------------- RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() : m_identifierFieldsMap( { - { SummaryVarCategory::SUMMARY_FIELD, + { SummaryCategory::SUMMARY_FIELD, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_AQUIFER, + { SummaryCategory::SUMMARY_AQUIFER, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_AQUIFER_NUMBER ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_NETWORK, + { SummaryCategory::SUMMARY_NETWORK, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_NETWORK_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_MISC, + { SummaryCategory::SUMMARY_MISC, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_REGION, + { SummaryCategory::SUMMARY_REGION, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_REGION_NUMBER ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_REGION_2_REGION, + { SummaryCategory::SUMMARY_REGION_2_REGION, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_REGION_2_REGION ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_GROUP, + { SummaryCategory::SUMMARY_GROUP, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_GROUP_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_WELL, + { SummaryCategory::SUMMARY_WELL, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_WELL_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_WELL_COMPLETION, + { SummaryCategory::SUMMARY_WELL_COMPLETION, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_WELL_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_CELL_IJK ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR, + { SummaryCategory::SUMMARY_WELL_COMPLETION_LGR, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_LGR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_WELL_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_CELL_IJK ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_WELL_LGR, + { SummaryCategory::SUMMARY_WELL_LGR, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_LGR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_WELL_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_WELL_SEGMENT, + { SummaryCategory::SUMMARY_WELL_SEGMENT, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_WELL_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_SEGMENT_NUMBER ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_BLOCK, + { SummaryCategory::SUMMARY_BLOCK, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_CELL_IJK ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_BLOCK_LGR, + { SummaryCategory::SUMMARY_BLOCK_LGR, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_LGR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_CELL_IJK ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, - { SummaryVarCategory::SUMMARY_IMPORTED, + { SummaryCategory::SUMMARY_IMPORTED, { new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_VECTOR_NAME ), new SummaryIdentifierAndField( SummaryIdentifierType::INPUT_ID ) } }, @@ -169,114 +169,102 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() CAF_PDM_InitFieldNoDefault( &m_currentSummaryCategory, "CurrentSummaryCategory", "Current Summary Category" ); CAF_PDM_InitFieldNoDefault( &m_selectedSummaryCategories, "SelectedSummaryCategories", "Summary Categories" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_FIELD][0]->pdmField(), "FieldVectors", "Field vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_FIELD][1]->pdmField(), - "FieldCalculationIds", - "Calculation Ids" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_FIELD][0]->pdmField(), "FieldVectors", "Field vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_FIELD][1]->pdmField(), "FieldCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_AQUIFER][0]->pdmField(), "Aquifers", "Aquifers" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_AQUIFER][1]->pdmField(), "AquiferVectors", "Aquifer Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_AQUIFER][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][0]->pdmField(), "Aquifers", "Aquifers" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][1]->pdmField(), "AquiferVectors", "Aquifer Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][2]->pdmField(), "AquifierCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_NETWORK][0]->pdmField(), "NetworkNames", "Networks" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_NETWORK][1]->pdmField(), "NetworkVectors", "Network Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_NETWORK][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_NETWORK][0]->pdmField(), "NetworkNames", "Networks" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_NETWORK][1]->pdmField(), "NetworkVectors", "Network Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_NETWORK][2]->pdmField(), "NetworkCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_MISC][0]->pdmField(), "MiscVectors", "Misc Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_MISC][1]->pdmField(), "MiscCalculationIds", "Calculation Ids" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_MISC][0]->pdmField(), "MiscVectors", "Misc Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_MISC][1]->pdmField(), "MiscCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION][0]->pdmField(), "Regions", "Regions" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION][1]->pdmField(), "RegionsVectors", "Regions Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION][2]->pdmField(), - "RegionCalculationIds", - "Calculation Ids" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][0]->pdmField(), "Regions", "Regions" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][1]->pdmField(), "RegionsVectors", "Regions Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][2]->pdmField(), "RegionCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION_2_REGION][0]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][0]->pdmField(), "Region2RegionRegions", "Regions" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION_2_REGION][1]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][1]->pdmField(), "Region2RegionVectors", "Region2s Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION_2_REGION][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][2]->pdmField(), "Region2RegionCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_GROUP][0]->pdmField(), "WellGroupWellGroupNames", "Groups" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_GROUP][1]->pdmField(), - "WellGroupVectors", - "Well Group Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_GROUP][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][0]->pdmField(), "WellGroupWellGroupNames", "Groups" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][1]->pdmField(), "WellGroupVectors", "Well Group Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][2]->pdmField(), "WellGroupCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL][0]->pdmField(), "WellWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL][1]->pdmField(), "WellVectors", "Well Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL][2]->pdmField(), "WellCalculationIds", "Calculation Ids" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL][0]->pdmField(), "WellWellName", "Wells" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL][1]->pdmField(), "WellVectors", "Well Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL][2]->pdmField(), "WellCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][0]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][0]->pdmField(), "WellCompletionWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][1]->pdmField(), - "WellCompletionIjk", - "Cell IJK" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][1]->pdmField(), "WellCompletionIjk", "Cell IJK" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][2]->pdmField(), "WellCompletionVectors", "Well Completion Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][3]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][3]->pdmField(), "WellCompletionCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][0]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][0]->pdmField(), "WellCompletionLgrLgrName", "LGR Names" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][1]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][1]->pdmField(), "WellCompletionLgrWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][2]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][2]->pdmField(), "WellCompletionLgrIjk", "Cell IJK" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][3]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][3]->pdmField(), "WellCompletionLgrVectors", "Well Completion Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][4]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][4]->pdmField(), "WellCompletionLgrCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][0]->pdmField(), "WellLgrLgrName", "LGR Names" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][1]->pdmField(), "WellLgrWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][2]->pdmField(), "WellLgrVectors", "Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][3]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][0]->pdmField(), "WellLgrLgrName", "LGR Names" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][1]->pdmField(), "WellLgrWellName", "Wells" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][2]->pdmField(), "WellLgrVectors", "Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][3]->pdmField(), "WellLgrCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][0]->pdmField(), "WellSegmentWellName", "Wells" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][1]->pdmField(), "WellSegmentNumber", "Segments" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][2]->pdmField(), "WellSegmentVectors", "Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][3]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][0]->pdmField(), "WellSegmentWellName", "Wells" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][1]->pdmField(), "WellSegmentNumber", "Segments" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][2]->pdmField(), "WellSegmentVectors", "Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][3]->pdmField(), "WellSegmentCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK][0]->pdmField(), "BlockIjk", "Cell IJK" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK][1]->pdmField(), "BlockVectors", "Block Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK][2]->pdmField(), - "BlockCalculationIds", - "Calculation Ids" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][0]->pdmField(), "BlockIjk", "Cell IJK" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][1]->pdmField(), "BlockVectors", "Block Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][2]->pdmField(), "BlockCalculationIds", "Calculation Ids" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][0]->pdmField(), "BlockLgrLgrName", "LGR Names" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][1]->pdmField(), "BlockLgrIjk", "Cell IJK" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][2]->pdmField(), "BlockLgrVectors", "Block Vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][3]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][0]->pdmField(), "BlockLgrLgrName", "LGR Names" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][1]->pdmField(), "BlockLgrIjk", "Cell IJK" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][2]->pdmField(), "BlockLgrVectors", "Block Vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][3]->pdmField(), "BlockLgrCalculationIds", "CalculationIds" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_IMPORTED][0]->pdmField(), - "ImportedVectors", - "Imported vectors" ); - CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_IMPORTED][1]->pdmField(), + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_IMPORTED][0]->pdmField(), "ImportedVectors", "Imported vectors" ); + CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[SummaryCategory::SUMMARY_IMPORTED][1]->pdmField(), "ImportedCalculationIds", "Calculation Ids" ); @@ -648,7 +636,7 @@ void RiuSummaryVectorSelectionUi::setSelectedCurveDefinitions( const std::vector { resetAllFields(); - std::set categories; + std::set categories; for ( const auto& curveDef : curveDefinitions ) { if ( !( curveDef.summaryCase() || curveDef.isEnsembleCurve() ) ) continue; @@ -658,14 +646,14 @@ void RiuSummaryVectorSelectionUi::setSelectedCurveDefinitions( const std::vector RifEclipseSummaryAddress summaryAddress = curveDef.summaryAddress(); // Ignore ensemble statistics curves - if ( summaryAddress.category() == SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS ) continue; + if ( summaryAddress.category() == SummaryCategory::SUMMARY_ENSEMBLE_STATISTICS ) continue; // Select summary category if not already selected auto& selectedCategories = m_selectedSummaryCategories(); if ( std::find( selectedCategories.begin(), selectedCategories.end(), summaryAddress.category() ) == selectedCategories.end() ) { - if ( summaryAddress.category() != SummaryVarCategory::SUMMARY_INVALID ) + if ( summaryAddress.category() != SummaryCategory::SUMMARY_INVALID ) { m_selectedSummaryCategories.v().push_back( summaryAddress.category() ); } @@ -730,7 +718,7 @@ void RiuSummaryVectorSelectionUi::setSelectedCurveDefinitions( const std::vector if ( !categories.empty() ) { - SummaryVarCategory cat = *( categories.begin() ); + SummaryCategory cat = *( categories.begin() ); m_currentSummaryCategory.setValue( cat ); } @@ -745,8 +733,8 @@ void RiuSummaryVectorSelectionUi::fieldChangedByUi( const caf::PdmFieldHandle* c { if ( changedField != &m_selectedSources && changedField != &m_selectedSummaryCategories && changedField != &m_currentSummaryCategory ) { - SummaryVarCategory currentCategory = m_currentSummaryCategory(); - if ( currentCategory != SummaryVarCategory::SUMMARY_INVALID ) + SummaryCategory currentCategory = m_currentSummaryCategory(); + if ( currentCategory != SummaryCategory::SUMMARY_INVALID ) { // When a summary vector is selected, make sure the summary category for the summary vector is in the // selection Note that we use the size of the variant to avoid this operation when an item in unchecked @@ -846,137 +834,137 @@ void RiuSummaryVectorSelectionUi::defineUiOrdering( QString uiConfigName, caf::P caf::PdmField>* summaryiesField = nullptr; - SummaryVarCategory sumCategory = m_currentSummaryCategory(); - if ( sumCategory == SummaryVarCategory::SUMMARY_INVALID ) + SummaryCategory sumCategory = m_currentSummaryCategory(); + if ( sumCategory == SummaryCategory::SUMMARY_INVALID ) { - sumCategory = SummaryVarCategory::SUMMARY_FIELD; + sumCategory = SummaryCategory::SUMMARY_FIELD; } - if ( sumCategory == SummaryVarCategory::SUMMARY_FIELD ) + if ( sumCategory == SummaryCategory::SUMMARY_FIELD ) { - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_FIELD][0]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_FIELD][0]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_AQUIFER ) + else if ( sumCategory == SummaryCategory::SUMMARY_AQUIFER ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryAquifer() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_AQUIFER][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_AQUIFER][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_AQUIFER][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_NETWORK ) + else if ( sumCategory == SummaryCategory::SUMMARY_NETWORK ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryNetwork() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_NETWORK][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_NETWORK][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_NETWORK][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_NETWORK][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_MISC ) + else if ( sumCategory == SummaryCategory::SUMMARY_MISC ) { - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_MISC][0]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_MISC][0]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_REGION ) + else if ( sumCategory == SummaryCategory::SUMMARY_REGION ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryRegion() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_REGION_2_REGION ) + else if ( sumCategory == SummaryCategory::SUMMARY_REGION_2_REGION ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( "Regions" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION_2_REGION][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_REGION_2_REGION][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_REGION_2_REGION][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_GROUP ) + else if ( sumCategory == SummaryCategory::SUMMARY_GROUP ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryWellGroup() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_GROUP][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_GROUP][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_GROUP][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_WELL ) + else if ( sumCategory == SummaryCategory::SUMMARY_WELL ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryWell() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_WELL_COMPLETION ) + else if ( sumCategory == SummaryCategory::SUMMARY_WELL_COMPLETION ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryCompletion() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][0]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][1]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][1]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION][2]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION][2]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR ) + else if ( sumCategory == SummaryCategory::SUMMARY_WELL_COMPLETION_LGR ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryLgrCompletion() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][0]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][1]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][2]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][1]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][2]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR][3]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_COMPLETION_LGR][3]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_WELL_LGR ) + else if ( sumCategory == SummaryCategory::SUMMARY_WELL_LGR ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryLgrWell() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][0]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][1]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][1]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_LGR][2]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_LGR][2]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_WELL_SEGMENT ) + else if ( sumCategory == SummaryCategory::SUMMARY_WELL_SEGMENT ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryWellSegment() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][0]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][1]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][1]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_WELL_SEGMENT][2]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_WELL_SEGMENT][2]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_BLOCK ) + else if ( sumCategory == SummaryCategory::SUMMARY_BLOCK ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryBlock() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][0]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK][1]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK][1]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_BLOCK_LGR ) + else if ( sumCategory == SummaryCategory::SUMMARY_BLOCK_LGR ) { { caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryLgrBlock() + "s" ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][0]->pdmField() ); - myGroup->add( m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][1]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][0]->pdmField() ); + myGroup->add( m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][1]->pdmField() ); } - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_BLOCK_LGR][2]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_BLOCK_LGR][2]->pdmField(); } - else if ( sumCategory == SummaryVarCategory::SUMMARY_IMPORTED ) + else if ( sumCategory == SummaryCategory::SUMMARY_IMPORTED ) { - summaryiesField = m_identifierFieldsMap[SummaryVarCategory::SUMMARY_IMPORTED][0]->pdmField(); + summaryiesField = m_identifierFieldsMap[SummaryCategory::SUMMARY_IMPORTED][0]->pdmField(); } caf::PdmUiGroup* summariesGroup = uiOrdering.addNewGroupWithKeyword( "Summaries", RiuSummaryCurveDefinitionKeywords::summaries() ); @@ -1220,7 +1208,7 @@ std::set RiuSummaryVectorSelectionUi::buildAddressList std::set addressSet; for ( const auto& category : m_selectedSummaryCategories() ) { - if ( m_identifierFieldsMap.at( category ).size() == 0 || category == SummaryVarCategory::SUMMARY_INVALID ) continue; + if ( m_identifierFieldsMap.at( category ).size() == 0 || category == SummaryCategory::SUMMARY_INVALID ) continue; const auto& identifierAndFieldList = m_identifierFieldsMap.at( category ); std::vector> selectionStack; @@ -1233,7 +1221,7 @@ std::set RiuSummaryVectorSelectionUi::buildAddressList /// //-------------------------------------------------------------------------------------------------- void RiuSummaryVectorSelectionUi::buildAddressListForCategoryRecursively( - SummaryVarCategory category, + SummaryCategory category, std::vector::const_iterator identifierAndFieldItr, std::vector>& identifierPath, std::set& addressSet ) const @@ -1314,7 +1302,7 @@ void RiuSummaryVectorSelectionUi::defineEditorAttribute( const caf::PdmFieldHand void RiuSummaryVectorSelectionUi::resetAllFields() { m_selectedSources.clearWithoutDelete(); - m_selectedSummaryCategories = std::vector>(); + m_selectedSummaryCategories = std::vector>(); // clear all state in fields for ( auto& identifierAndFieldList : m_identifierFieldsMap ) @@ -1370,28 +1358,28 @@ void RiuSummaryVectorSelectionUi::appendOptionItemsForSources( QList& options ) const { - std::vector sortedCategoriesForUi; - - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_FIELD ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_AQUIFER ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_NETWORK ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_MISC ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_REGION ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_REGION_2_REGION ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_GROUP ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_WELL ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_WELL_COMPLETION ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_BLOCK ); + std::vector sortedCategoriesForUi; + + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_FIELD ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_AQUIFER ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_NETWORK ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_MISC ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_REGION ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_REGION_2_REGION ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_GROUP ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_WELL ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_WELL_COMPLETION ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_BLOCK ); if ( !m_hideCalculationIncompatibleCategories ) { - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_WELL_SEGMENT ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_WELL_LGR ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_WELL_COMPLETION_LGR ); - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_BLOCK_LGR ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_WELL_SEGMENT ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_WELL_LGR ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_WELL_COMPLETION_LGR ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_BLOCK_LGR ); } - sortedCategoriesForUi.push_back( SummaryVarCategory::SUMMARY_IMPORTED ); + sortedCategoriesForUi.push_back( SummaryCategory::SUMMARY_IMPORTED ); // NB SUMMARY_ENSEMBLE_STATISTICS is intentionally excluded // categoriesForUiDisplay.push_back(SummaryVarCategory::SUMMARY_ENSEMBLE_STATISTICS); diff --git a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h index f6c6932cbf..744228101e 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h +++ b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.h @@ -95,7 +95,7 @@ class RiuSummaryVectorSelectionUi : public caf::PdmObject const std::vector& identifierAndFieldList ) const; std::set buildAddressListFromSelections() const; - void buildAddressListForCategoryRecursively( RifEclipseSummaryAddressDefines::SummaryVarCategory category, + void buildAddressListForCategoryRecursively( RifEclipseSummaryAddressDefines::SummaryCategory category, std::vector::const_iterator identifierAndFieldItr, std::vector>& identifierPath, std::set& addressSet ) const; @@ -113,10 +113,10 @@ class RiuSummaryVectorSelectionUi : public caf::PdmObject private: caf::PdmPtrArrayField m_selectedSources; - caf::PdmField>> m_selectedSummaryCategories; - caf::PdmField> m_currentSummaryCategory; + caf::PdmField>> m_selectedSummaryCategories; + caf::PdmField> m_currentSummaryCategory; - std::map> m_identifierFieldsMap; + std::map> m_identifierFieldsMap; bool m_multiSelectionMode;