mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Performance: Slow performance for some plot and curve operations
* Performance: Cache registry value * Performance: Avoid recursive update Early return if values are identical updateConnectedEditors is handled by setValueFromUiEditor Avoid fieldChanged in analyzePlotsAndAdjustAppearanceSettings
This commit is contained in:
parent
d198dc8537
commit
3800246b79
@ -209,8 +209,14 @@ const char* RiaApplication::getVersionStringApp( bool includeCrtInfo )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaApplication::enableDevelopmentFeatures()
|
||||
{
|
||||
QString environmentVar = QProcessEnvironment::systemEnvironment().value( "RESINSIGHT_DEVEL", QString( "0" ) );
|
||||
return environmentVar.toInt() == 1;
|
||||
static int envValue = -999;
|
||||
if ( envValue == -999 )
|
||||
{
|
||||
QString environmentVar = QProcessEnvironment::systemEnvironment().value( "RESINSIGHT_DEVEL", QString( "0" ) );
|
||||
envValue = environmentVar.toInt();
|
||||
}
|
||||
|
||||
return envValue == 1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -648,11 +648,11 @@ void RimPlotAxisProperties::setMajorTickmarkCount( LegendTickmarkCount count )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisProperties::setAutoValueForMajorTickmarkCount( LegendTickmarkCount count )
|
||||
void RimPlotAxisProperties::setAutoValueForMajorTickmarkCount( LegendTickmarkCount count, bool notifyFieldChanged )
|
||||
{
|
||||
auto enumValue = static_cast<std::underlying_type_t<LegendTickmarkCount>>( count );
|
||||
|
||||
m_majorTickmarkCount.uiCapability()->setAutoValue( enumValue );
|
||||
m_majorTickmarkCount.uiCapability()->setAutoValue( enumValue, notifyFieldChanged );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
|
||||
LegendTickmarkCount majorTickmarkCount() const override;
|
||||
void setMajorTickmarkCount( LegendTickmarkCount count ) override;
|
||||
void setAutoValueForMajorTickmarkCount( LegendTickmarkCount count );
|
||||
void setAutoValueForMajorTickmarkCount( LegendTickmarkCount count, bool notifyFieldChanged );
|
||||
void enableAutoValueForMajorTickmarkCount( bool enable );
|
||||
|
||||
void enableAutoValueForAllFields( bool enable );
|
||||
|
@ -1269,6 +1269,8 @@ void RimSummaryMultiPlot::analyzePlotsAndAdjustAppearanceSettings()
|
||||
|
||||
bool canShowOneAxisTitlePerRow = analyzer.isSingleQuantityIgnoreHistory() && ( m_axisRangeAggregation() != AxisRangeAggregation::NONE );
|
||||
|
||||
const bool notifyFieldChanged = false;
|
||||
|
||||
for ( auto p : summaryPlots() )
|
||||
{
|
||||
auto timeAxisProp = p->timeAxisProperties();
|
||||
@ -1276,7 +1278,7 @@ void RimSummaryMultiPlot::analyzePlotsAndAdjustAppearanceSettings()
|
||||
auto tickMarkCount = ( columnCount() < 3 ) ? RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_DEFAULT
|
||||
: RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_FEW;
|
||||
|
||||
timeAxisProp->setAutoValueForMajorTickmarkCount( tickMarkCount );
|
||||
timeAxisProp->setAutoValueForMajorTickmarkCount( tickMarkCount, notifyFieldChanged );
|
||||
|
||||
for ( auto* axisProp : p->plotYAxes() )
|
||||
{
|
||||
@ -1285,7 +1287,7 @@ void RimSummaryMultiPlot::analyzePlotsAndAdjustAppearanceSettings()
|
||||
auto tickMarkCount = ( rowsPerPage() == 1 ) ? RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_DEFAULT
|
||||
: RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_FEW;
|
||||
|
||||
axisProp->setAutoValueForMajorTickmarkCount( tickMarkCount );
|
||||
axisProp->setAutoValueForMajorTickmarkCount( tickMarkCount, notifyFieldChanged );
|
||||
|
||||
axisProp->computeAndSetAutoValueForScaleFactor();
|
||||
|
||||
|
@ -1924,8 +1924,6 @@ void RimSummaryPlot::updateZoomFromParentPlot()
|
||||
|
||||
axisProperties->setVisibleRangeMax( axisMax );
|
||||
axisProperties->setVisibleRangeMin( axisMin );
|
||||
|
||||
axisProperties->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -553,11 +553,11 @@ void RimSummaryTimeAxisProperties::setMajorTickmarkCount( LegendTickmarkCount co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryTimeAxisProperties::setAutoValueForMajorTickmarkCount( LegendTickmarkCount count )
|
||||
void RimSummaryTimeAxisProperties::setAutoValueForMajorTickmarkCount( LegendTickmarkCount count, bool notifyFieldChanged )
|
||||
{
|
||||
auto enumValue = static_cast<std::underlying_type_t<LegendTickmarkCount>>( count );
|
||||
|
||||
m_majorTickmarkCount.uiCapability()->setAutoValue( enumValue );
|
||||
m_majorTickmarkCount.uiCapability()->setAutoValue( enumValue, notifyFieldChanged );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -135,7 +135,7 @@ public:
|
||||
|
||||
LegendTickmarkCount majorTickmarkCount() const override;
|
||||
void setMajorTickmarkCount( LegendTickmarkCount count ) override;
|
||||
void setAutoValueForMajorTickmarkCount( LegendTickmarkCount count );
|
||||
void setAutoValueForMajorTickmarkCount( LegendTickmarkCount count, bool notifyFieldChanged );
|
||||
void enableAutoValueForMajorTickmarkCount( bool enable );
|
||||
|
||||
const QString objectName() const override;
|
||||
|
@ -140,6 +140,8 @@ void PdmUiFieldHandle::enableAndSetAutoValue( const QVariant& autoValue )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiFieldHandle::setAutoValue( const QVariant& autoValue, bool notifyFieldChanged )
|
||||
{
|
||||
if ( m_autoValue == autoValue ) return;
|
||||
|
||||
m_autoValue = autoValue;
|
||||
|
||||
applyAutoValueAndUpdateEditors( notifyFieldChanged );
|
||||
@ -257,7 +259,6 @@ void PdmUiFieldHandle::applyAutoValueAndUpdateEditors( bool notifyFieldChanged )
|
||||
if ( m_useAutoValue && m_autoValue.isValid() )
|
||||
{
|
||||
setValueFromUiEditor( m_autoValue, notifyFieldChanged );
|
||||
updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user