mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#9011 Disable input controls controlled by automation
Disable fields controlled by automation and append label text with (overridden)
This commit is contained in:
@@ -196,6 +196,10 @@ void RimSummaryMultiPlot::insertPlot( RimPlot* plot, size_t index )
|
||||
{
|
||||
sumPlot->axisChanged.connect( this, &RimSummaryMultiPlot::onSubPlotAxisChanged );
|
||||
sumPlot->curvesChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
|
||||
|
||||
bool isMinMaxOverridden = m_axisRangeAggregation() != AxisRangeAggregation::NONE;
|
||||
setOverriddenFlagsForPlot( sumPlot, isMinMaxOverridden, m_autoAdjustAppearance() );
|
||||
|
||||
RimMultiPlot::insertPlot( plot, index );
|
||||
}
|
||||
|
||||
@@ -426,6 +430,8 @@ void RimSummaryMultiPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
else if ( changedField == &m_linkSubPlotAxes || changedField == &m_axisRangeAggregation )
|
||||
{
|
||||
syncAxisRanges();
|
||||
|
||||
setOverriddenFlag();
|
||||
}
|
||||
else if ( changedField == &m_hidePlotsWithValuesBelow )
|
||||
{
|
||||
@@ -464,6 +470,7 @@ void RimSummaryMultiPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
else if ( changedField == &m_autoAdjustAppearance )
|
||||
{
|
||||
checkAndApplyAutoAppearance();
|
||||
setOverriddenFlag();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -766,6 +773,8 @@ void RimSummaryMultiPlot::setDefaultRangeAggregationSteppingDimension()
|
||||
|
||||
m_axisRangeAggregation = rangeAggregation;
|
||||
m_sourceStepping->setStepDimension( stepDimension );
|
||||
|
||||
setOverriddenFlag();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1045,6 +1054,36 @@ void RimSummaryMultiPlot::updatePlotVisibility()
|
||||
if ( !m_viewer.isNull() ) m_viewer->scheduleUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlot::setOverriddenFlag()
|
||||
{
|
||||
bool isMinMaxOverridden = m_axisRangeAggregation() != AxisRangeAggregation::NONE;
|
||||
for ( auto p : summaryPlots() )
|
||||
{
|
||||
setOverriddenFlagsForPlot( p, isMinMaxOverridden, m_autoAdjustAppearance() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryMultiPlot::setOverriddenFlagsForPlot( RimSummaryPlot* summaryPlot,
|
||||
bool isMinMaxOverridden,
|
||||
bool isAppearanceOverridden )
|
||||
{
|
||||
for ( auto plotAxis : summaryPlot->plotAxes() )
|
||||
{
|
||||
plotAxis->setAppearanceOverridden( isAppearanceOverridden );
|
||||
auto plotAxProp = dynamic_cast<RimPlotAxisProperties*>( plotAxis );
|
||||
if ( plotAxProp )
|
||||
{
|
||||
plotAxProp->setMinMaxOverridden( isMinMaxOverridden );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -128,6 +128,8 @@ private:
|
||||
void updateSourceStepper();
|
||||
|
||||
void updatePlotVisibility();
|
||||
void setOverriddenFlag();
|
||||
void setOverriddenFlagsForPlot( RimSummaryPlot* summaryPlot, bool isMinMaxOverridden, bool isAppearanceOverridden );
|
||||
|
||||
void duplicate();
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuPlotWidget* plot
|
||||
|
||||
RiuPlotAxis axis = m_axisProperties->plotAxisType();
|
||||
{
|
||||
QString axisTitle = m_axisProperties->customTitle;
|
||||
QString axisTitle = m_axisProperties->customTitle();
|
||||
if ( m_axisProperties->useAutoTitle() ) axisTitle = autoAxisTitle();
|
||||
|
||||
Qt::AlignmentFlag titleAlignment = Qt::AlignCenter;
|
||||
@@ -148,7 +148,7 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuPlotWidget* plot
|
||||
{
|
||||
auto qwtAxisId = qwtPlotWidget->toQwtPlotAxis( axis );
|
||||
|
||||
if ( m_axisProperties->numberFormat == RimPlotAxisProperties::NUMBER_FORMAT_AUTO &&
|
||||
if ( m_axisProperties->numberFormat() == RimPlotAxisProperties::NUMBER_FORMAT_AUTO &&
|
||||
m_axisProperties->scaleFactor() == 1.0 )
|
||||
{
|
||||
// Default to Qwt's own scale draw to avoid changing too much for default values
|
||||
@@ -158,7 +158,7 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuPlotWidget* plot
|
||||
{
|
||||
qwtPlotWidget->qwtPlot()->setAxisScaleDraw( qwtAxisId,
|
||||
new SummaryScaleDraw( m_axisProperties->scaleFactor(),
|
||||
m_axisProperties->numberOfDecimals(),
|
||||
m_axisProperties->decimalCount(),
|
||||
m_axisProperties->numberFormat() ) );
|
||||
}
|
||||
}
|
||||
@@ -178,7 +178,7 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuPlotWidget* plot
|
||||
};
|
||||
|
||||
auto formatType = mapToRiaNumberFormatType( m_axisProperties->numberFormat() );
|
||||
QString format = RiaNumberFormat::sprintfFormat( formatType, m_axisProperties->numberOfDecimals() );
|
||||
QString format = RiaNumberFormat::sprintfFormat( formatType, m_axisProperties->decimalCount() );
|
||||
qtChartsPlotWidget->setAxisFormat( axis, format );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "RimSummaryTimeAxisProperties.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaFieldHandleTools.h"
|
||||
#include "RiaFontCache.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
@@ -591,6 +592,10 @@ void RimSummaryTimeAxisProperties::defineUiOrdering( QString uiConfigName, caf::
|
||||
timeGroup->add( &m_valuesFontSize );
|
||||
timeGroup->add( &m_majorTickmarkCount );
|
||||
|
||||
// Auto Appearance is defined in RimSummaryMultiPlot::analyzePlotsAndAdjustAppearanceSettings()
|
||||
QString autoAppearanceToolTip = "Controlled by Auto Adjust Appearance";
|
||||
RiaFieldhandleTools::updateOverrideStateAndLabel( &m_majorTickmarkCount, isAppearanceOverridden(), autoAppearanceToolTip );
|
||||
|
||||
if ( m_timeMode() == DATE )
|
||||
{
|
||||
caf::PdmUiGroup* advancedGroup = timeGroup->addNewGroup( "Date/Time Label Format" );
|
||||
|
||||
Reference in New Issue
Block a user