mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 22:27:55 -05:00
#12327 Small adjustments
* Remove unused volume sum * Hide more log messages by default * Allow stepping on top level plot * Fix update of main plot title
This commit is contained in:
1 parent
fa9066de06
commit
3715667e30
8 files changed
+84
-33
No files matched your search
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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<EclIO::ERst>( m_restartFileName );
|
||||
RiaLogging::logTimeElapsed( "Completed import of meta data" );
|
||||
|
||||
if ( isLoggingEnabled ) RiaLogging::logTimeElapsed( "Completed import of meta data" );
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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" );
|
||||
|
||||
@@ -813,6 +813,15 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
|
||||
updateAllCurves();
|
||||
|
||||
if ( auto multiPlot = firstAncestorOrThisOfType<RimSummaryMultiPlot>() )
|
||||
{
|
||||
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<RimSummaryMultiPlot>() )
|
||||
{
|
||||
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<RimSummaryPlot>();
|
||||
if ( summaryPlot )
|
||||
if ( auto summaryPlot = firstAncestorOrThisOfType<RimSummaryPlot>() )
|
||||
{
|
||||
summaryPlot->updateAll();
|
||||
summaryPlot->zoomAll();
|
||||
}
|
||||
|
||||
auto multiPlot = firstAncestorOrThisOfType<RimSummaryMultiPlot>();
|
||||
if ( multiPlot )
|
||||
if ( auto multiPlot = firstAncestorOrThisOfType<RimSummaryMultiPlot>() )
|
||||
{
|
||||
multiPlot->updatePlotTitles();
|
||||
}
|
||||
|
||||
@@ -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<RimSummaryPlot*> plotsForStepping;
|
||||
|
||||
// find matching plots
|
||||
std::vector<RimPlot*> 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<RimSummaryMultiPlot>() != nullptr );
|
||||
if ( isMultiPlotSelected )
|
||||
{
|
||||
RimSummaryPlot* newPlot = dynamic_cast<RimSummaryPlot*>( 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<RimPlot*> plots = m_sourceStepping->plotsMatchingStepSettings( summaryPlots() );
|
||||
if ( !plots.empty() )
|
||||
{
|
||||
auto newPlots = RiaSummaryPlotTools::duplicatePlots( plots );
|
||||
for ( auto plot : newPlots )
|
||||
{
|
||||
if ( RimSummaryPlot* newPlot = dynamic_cast<RimSummaryPlot*>( 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();
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -46,7 +46,6 @@ public:
|
||||
HARMONIC_MEAN,
|
||||
MIN_VALUE,
|
||||
MAX_VALUE,
|
||||
VOLUME_SUM,
|
||||
SUM,
|
||||
OIL_COLUMN,
|
||||
GAS_COLUMN,
|
||||
|
||||
Reference in new issue
Block a user