diff --git a/ApplicationLibCode/Application/RiaPreferencesSystem.cpp b/ApplicationLibCode/Application/RiaPreferencesSystem.cpp index 37757cbdaf..65f1d9063d 100644 --- a/ApplicationLibCode/Application/RiaPreferencesSystem.cpp +++ b/ApplicationLibCode/Application/RiaPreferencesSystem.cpp @@ -231,6 +231,9 @@ RiaPreferencesSystem::EclipseTextFileReaderMode RiaPreferencesSystem::eclipseTex bool RiaPreferencesSystem::isLoggingActivatedForKeyword( const QString& keyword ) const { QStringList keywords = m_keywordsForLogging().split( ";" ); + + if ( keywords.contains( "enable-all" ) ) return true; + return keywords.contains( keyword ); } diff --git a/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp b/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp index 520c2e847d..d5f13c46cd 100644 --- a/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp @@ -20,6 +20,7 @@ #include "RiaEclipseFileNameTools.h" #include "RiaLogging.h" +#include "RiaPreferencesSystem.h" #include "RiaQDateTimeTools.h" #include "RiaResultNames.h" #include "RiaStdStringTools.h" @@ -744,9 +745,14 @@ void RifReaderOpmCommon::setupInitAndRestartAccess() { try { - RiaLogging::resetTimer( "Starting import of meta data from " + QString::fromStdString( m_restartFileName ) ); + const bool isLoggingEnabled = RiaPreferencesSystem::current()->isLoggingActivatedForKeyword( "RifReaderOpmCommon" ); + + if ( isLoggingEnabled ) + RiaLogging::resetTimer( "Starting import of meta data from " + QString::fromStdString( m_restartFileName ) ); + m_restartFile = std::make_unique( m_restartFileName ); - RiaLogging::logTimeElapsed( "Completed import of meta data" ); + + if ( isLoggingEnabled ) RiaLogging::logTimeElapsed( "Completed import of meta data" ); } catch ( ... ) { diff --git a/ApplicationLibCode/FileInterface/RifReaderOpmCommonActive.cpp b/ApplicationLibCode/FileInterface/RifReaderOpmCommonActive.cpp index a92f2af813..bfce5ede20 100644 --- a/ApplicationLibCode/FileInterface/RifReaderOpmCommonActive.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderOpmCommonActive.cpp @@ -19,6 +19,7 @@ #include "RifReaderOpmCommonActive.h" #include "RiaLogging.h" +#include "RiaPreferencesSystem.h" #include "RiaStdStringTools.h" #include "RifOpmRadialGridTools.h" @@ -159,9 +160,14 @@ bool RifReaderOpmCommonActive::importGrid( RigMainGrid* /* mainGrid*/, RigEclips // grid geometry { - RiaLogging::info( QString( "Loading %0 active of %1 total cells in main grid." ) - .arg( QString::fromStdString( RiaStdStringTools::formatThousandGrouping( opmGrid.totalActiveCells() ) ) ) - .arg( QString::fromStdString( RiaStdStringTools::formatThousandGrouping( opmGrid.totalNumberOfCells() ) ) ) ); + const bool isLoggingEnabled = RiaPreferencesSystem::current()->isLoggingActivatedForKeyword( "RifReaderOpmCommonActive" ); + + if ( isLoggingEnabled ) + { + RiaLogging::info( QString( "Loading %0 active of %1 total cells in main grid." ) + .arg( QString::fromStdString( RiaStdStringTools::formatThousandGrouping( opmGrid.totalActiveCells() ) ) ) + .arg( QString::fromStdString( RiaStdStringTools::formatThousandGrouping( opmGrid.totalNumberOfCells() ) ) ) ); + } auto task = progInfo.task( "Loading Active Cell Main Grid Geometry" ); transferActiveGeometry( opmGrid, opmGrid, activeGrid, activeGrid, eclipseCaseData ); @@ -172,11 +178,14 @@ bool RifReaderOpmCommonActive::importGrid( RigMainGrid* /* mainGrid*/, RigEclips for ( int lgrIdx = 0; lgrIdx < numLGRs; lgrIdx++ ) { - RiaLogging::info( - QString( "Loading %0 active of %1 total cells in LGR grid %2." ) - .arg( QString::fromStdString( RiaStdStringTools::formatThousandGrouping( lgrGrids[lgrIdx].totalActiveCells() ) ) ) - .arg( QString::fromStdString( RiaStdStringTools::formatThousandGrouping( lgrGrids[lgrIdx].totalNumberOfCells() ) ) ) - .arg( lgrIdx + 1 ) ); + if ( isLoggingEnabled ) + { + RiaLogging::info( + QString( "Loading %0 active of %1 total cells in LGR grid %2." ) + .arg( QString::fromStdString( RiaStdStringTools::formatThousandGrouping( lgrGrids[lgrIdx].totalActiveCells() ) ) ) + .arg( QString::fromStdString( RiaStdStringTools::formatThousandGrouping( lgrGrids[lgrIdx].totalNumberOfCells() ) ) ) + .arg( lgrIdx + 1 ) ); + } RigGridBase* parentGrid = hasParentInfo ? activeGrid->gridByName( lgr_parent_names[lgrIdx] ) : activeGrid; diff --git a/ApplicationLibCode/ProjectDataModel/ContourMap/RimContourMapProjection.cpp b/ApplicationLibCode/ProjectDataModel/ContourMap/RimContourMapProjection.cpp index daf76c1b71..2cb301d3cb 100644 --- a/ApplicationLibCode/ProjectDataModel/ContourMap/RimContourMapProjection.cpp +++ b/ApplicationLibCode/ProjectDataModel/ContourMap/RimContourMapProjection.cpp @@ -55,7 +55,6 @@ void RimContourMapProjection::ResultAggregation::setUp() addItem( RigContourMapCalculator::MEAN, "MEAN_VALUE", "Arithmetic Mean" ); addItem( RigContourMapCalculator::HARMONIC_MEAN, "HARM_VALUE", "Harmonic Mean" ); addItem( RigContourMapCalculator::GEOMETRIC_MEAN, "GEOM_VALUE", "Geometric Mean" ); - addItem( RigContourMapCalculator::VOLUME_SUM, "VOLUME_SUM", "Volume Weighted Sum" ); addItem( RigContourMapCalculator::SUM, "SUM", "Sum" ); addItem( RigContourMapCalculator::TOP_VALUE, "TOP_VALUE", "Top Value" ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index b4fefc9f71..0ad18a46c7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -813,6 +813,15 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi updateAllCurves(); + if ( auto multiPlot = firstAncestorOrThisOfType() ) + { + multiPlot->updatePlotTitles(); + } + else + { + plot->updatePlotTitle(); + } + updateTextInPlot = true; } else if ( changedField == &m_yValuesSummaryEnsemble ) @@ -1003,7 +1012,16 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi loadDataAndUpdate( true ); plot->updateAxes(); - plot->updatePlotTitle(); + + if ( auto multiPlot = firstAncestorOrThisOfType() ) + { + multiPlot->updatePlotTitles(); + } + else + { + plot->updatePlotTitle(); + } + plot->updateConnectedEditors(); RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow(); @@ -1103,15 +1121,13 @@ void RimEnsembleCurveSet::childFieldChangedByUi( const caf::PdmFieldHandle* chan // The recommended way to trigger update in a parent object is by using caf::Signal. Here we need to update two parent classes, and // they are multiple levels away. To avoid a long signal path that is hard to debug, we use firstAncestorOrThisOfType() - auto summaryPlot = firstAncestorOrThisOfType(); - if ( summaryPlot ) + if ( auto summaryPlot = firstAncestorOrThisOfType() ) { summaryPlot->updateAll(); summaryPlot->zoomAll(); } - auto multiPlot = firstAncestorOrThisOfType(); - if ( multiPlot ) + if ( auto multiPlot = firstAncestorOrThisOfType() ) { multiPlot->updatePlotTitles(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp index 6c170ce998..ebaebb93b0 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryMultiPlot.cpp @@ -66,6 +66,7 @@ #include "cafPdmUiPushButtonEditor.h" #include "cafPdmUiTreeOrdering.h" #include "cafPdmUiTreeSelectionEditor.h" +#include "cafSelectionManager.h" #include "qwt_scale_engine.h" @@ -1564,24 +1565,39 @@ void RimSummaryMultiPlot::onPlotAdditionOrRemoval() //-------------------------------------------------------------------------------------------------- void RimSummaryMultiPlot::appendSubPlotByStepping( int direction ) { - if ( summaryPlots().empty() ) return; + std::vector plotsForStepping; - // find matching plots - std::vector plots = m_sourceStepping->plotsMatchingStepSettings( summaryPlots() ); - if ( plots.empty() ) return; - - // duplicate them - auto newPlots = RiaSummaryPlotTools::duplicatePlots( plots ); - if ( newPlots.empty() ) return; - - for ( auto plot : newPlots ) + bool isMultiPlotSelected = ( caf::SelectionManager::instance()->selectedItemOfType() != nullptr ); + if ( isMultiPlotSelected ) { - RimSummaryPlot* newPlot = dynamic_cast( plot ); - if ( newPlot == nullptr ) continue; + duplicate(); - addPlot( newPlot ); - newPlot->resolveReferencesRecursively(); + // The duplicate operation selects duplicated plot by default. Select this as current item to continue stepping on this plot + RiuPlotMainWindowTools::selectAsCurrentItem( this ); + plotsForStepping = summaryPlots(); + } + else + { + std::vector plots = m_sourceStepping->plotsMatchingStepSettings( summaryPlots() ); + if ( !plots.empty() ) + { + auto newPlots = RiaSummaryPlotTools::duplicatePlots( plots ); + for ( auto plot : newPlots ) + { + if ( RimSummaryPlot* newPlot = dynamic_cast( plot ) ) + { + addPlot( newPlot ); + newPlot->resolveReferencesRecursively(); + + plotsForStepping.push_back( newPlot ); + } + } + } + } + + for ( auto newPlot : plotsForStepping ) + { if ( m_sourceStepping()->stepDimension() == RimSummaryDataSourceStepping::SourceSteppingDimension::SUMMARY_CASE ) { RimSummaryCase* newCase = m_sourceStepping()->stepCase( direction ); @@ -1622,7 +1638,11 @@ void RimSummaryMultiPlot::appendSubPlotByStepping( int direction ) loadDataAndUpdate(); updateConnectedEditors(); - RiuPlotMainWindowTools::selectAsCurrentItem( newPlots.back() ); + if ( !isMultiPlotSelected && !summaryPlots().empty() ) + { + // Select the last plot in the list as the current item to be able to append plots for the next object type (well, region, etc.) + RiuPlotMainWindowTools::selectAsCurrentItem( summaryPlots().back() ); + } updateSourceStepper(); RiuPlotMainWindowTools::refreshToolbars(); diff --git a/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapCalculator.cpp b/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapCalculator.cpp index 70b0a3dcd3..65918234a7 100644 --- a/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapCalculator.cpp +++ b/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapCalculator.cpp @@ -56,7 +56,6 @@ double RigContourMapCalculator::calculateValueInMapCell( const RigContourMapProj return calculateMaxValue( contourMapProjection, matchingCells, gridCellValues ); case MIN_VALUE: return calculateMinValue( contourMapProjection, matchingCells, gridCellValues ); - case VOLUME_SUM: case SUM: case OIL_COLUMN: case GAS_COLUMN: diff --git a/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapCalculator.h b/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapCalculator.h index c5b0256c53..eb3636b88c 100644 --- a/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapCalculator.h +++ b/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapCalculator.h @@ -46,7 +46,6 @@ public: HARMONIC_MEAN, MIN_VALUE, MAX_VALUE, - VOLUME_SUM, SUM, OIL_COLUMN, GAS_COLUMN,