mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7572 Preferences : Move more into summary settings file
This commit is contained in:
@@ -394,7 +394,9 @@ void RimSummaryCaseMainCollection::loadSummaryCaseData( std::vector<RimSummaryCa
|
||||
std::vector<RimFileSummaryCase*> fileSummaryCases;
|
||||
std::vector<RimSummaryCase*> otherSummaryCases;
|
||||
|
||||
if ( RiaApplication::instance()->preferences()->useMultipleThreadsWhenReadingSummaryData() )
|
||||
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();
|
||||
|
||||
if ( prefs->useMultipleThreadsWhenLoadingSummaryData() )
|
||||
{
|
||||
for ( auto c : summaryCases )
|
||||
{
|
||||
@@ -416,13 +418,11 @@ void RimSummaryCaseMainCollection::loadSummaryCaseData( std::vector<RimSummaryCa
|
||||
|
||||
if ( !fileSummaryCases.empty() )
|
||||
{
|
||||
auto prefSummary = RiaPreferences::current()->summaryPreferences();
|
||||
|
||||
int threadCount = 1;
|
||||
#ifdef USE_OPENMP
|
||||
if ( prefSummary->summaryDataReader() != RiaPreferencesSummary::SummaryReaderMode::HDF5_OPM_COMMON )
|
||||
if ( prefs->summaryDataReader() != RiaPreferencesSummary::SummaryReaderMode::HDF5_OPM_COMMON )
|
||||
{
|
||||
threadCount = prefSummary->createH5SummaryDataThreadCount();
|
||||
threadCount = prefs->createH5SummaryDataThreadCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -461,12 +461,12 @@ void RimSummaryCaseMainCollection::loadFileSummaryCaseData( std::vector<RimFileS
|
||||
// RimSummaryCase, as it is difficult to make sure all variants of the leaf classes are thread safe.
|
||||
// Only open the summary file reader in parallel loop to reduce risk of multi threading issues
|
||||
|
||||
RiaPreferencesSummary* prefSummary = RiaPreferences::current()->summaryPreferences();
|
||||
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();
|
||||
|
||||
#ifdef USE_HDF5
|
||||
{
|
||||
if ( prefSummary->summaryDataReader() == RiaPreferencesSummary::SummaryReaderMode::HDF5_OPM_COMMON &&
|
||||
prefSummary->createH5SummaryDataFiles() )
|
||||
if ( prefs->summaryDataReader() == RiaPreferencesSummary::SummaryReaderMode::HDF5_OPM_COMMON &&
|
||||
prefs->createH5SummaryDataFiles() )
|
||||
{
|
||||
std::vector<std::string> headerFileNames;
|
||||
std::vector<std::string> h5FileNames;
|
||||
@@ -496,8 +496,7 @@ void RimSummaryCaseMainCollection::loadFileSummaryCaseData( std::vector<RimFileS
|
||||
RiaThreadSafeLogger threadSafeLogger;
|
||||
|
||||
// The HDF5 reader requires a special configuration to be thread safe. Disable threading for HDF reader creation.
|
||||
bool canUseMultipleTreads =
|
||||
( prefSummary->summaryDataReader() != RiaPreferencesSummary::SummaryReaderMode::HDF5_OPM_COMMON );
|
||||
bool canUseMultipleTreads = ( prefs->summaryDataReader() != RiaPreferencesSummary::SummaryReaderMode::HDF5_OPM_COMMON );
|
||||
|
||||
#pragma omp parallel for schedule( dynamic ) if ( canUseMultipleTreads )
|
||||
for ( int cIdx = 0; cIdx < static_cast<int>( fileSummaryCases.size() ); ++cIdx )
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "RiaCurveMerger.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "RiaResultNames.h"
|
||||
#include "RiaStatisticsTools.h"
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
@@ -980,23 +980,24 @@ void RimSummaryCurve::setCurveAppearanceFromCaseType()
|
||||
|
||||
if ( m_yValuesSummaryAddress && m_yValuesSummaryAddress->address().isHistoryQuantity() )
|
||||
{
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();
|
||||
|
||||
if ( prefs->defaultSummaryHistoryCurveStyle() == RiaPreferences::SummaryHistoryCurveStyleMode::SYMBOLS )
|
||||
if ( prefs->defaultSummaryHistoryCurveStyle() == RiaPreferencesSummary::SummaryHistoryCurveStyleMode::SYMBOLS )
|
||||
{
|
||||
m_symbolEdgeColor = m_curveColor;
|
||||
|
||||
setSymbol( RiuQwtSymbol::SYMBOL_XCROSS );
|
||||
setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_NONE );
|
||||
}
|
||||
else if ( prefs->defaultSummaryHistoryCurveStyle() == RiaPreferences::SummaryHistoryCurveStyleMode::SYMBOLS_AND_LINES )
|
||||
else if ( prefs->defaultSummaryHistoryCurveStyle() ==
|
||||
RiaPreferencesSummary::SummaryHistoryCurveStyleMode::SYMBOLS_AND_LINES )
|
||||
{
|
||||
m_symbolEdgeColor = m_curveColor;
|
||||
|
||||
setSymbol( RiuQwtSymbol::SYMBOL_XCROSS );
|
||||
setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID );
|
||||
}
|
||||
else if ( prefs->defaultSummaryHistoryCurveStyle() == RiaPreferences::SummaryHistoryCurveStyleMode::LINES )
|
||||
else if ( prefs->defaultSummaryHistoryCurveStyle() == RiaPreferencesSummary::SummaryHistoryCurveStyleMode::LINES )
|
||||
{
|
||||
setSymbol( RiuQwtSymbol::SYMBOL_NONE );
|
||||
setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID );
|
||||
|
||||
Reference in New Issue
Block a user