mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use field auto values for summary plots
Use auto value concept in summary plot configuration. Default behavior is unchanged, but it is now possible to unlink a field to specify a custom value for this field. Other changes: * Add missing requirement for Svg in test application * Use calculator icon and rename panel text Use icon and relevant text to make it clear that the content in Calculator Data can be used for Grid Property Calculator and nothing else. * Add example with scoped enum and auto value * Use enum value starting av 10 to make sure enum values (not option item index) are working as expected
This commit is contained in:
@@ -120,6 +120,7 @@ RimSummaryTimeAxisProperties::RimSummaryTimeAxisProperties()
|
||||
m_timeFormat = RiaPreferences::current()->timeFormat();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_majorTickmarkCount, "MajorTickmarkCount", "Major Tickmark Count" );
|
||||
m_majorTickmarkCount.uiCapability()->enableAutoValueSupport( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_annotations, "Annotations", "" );
|
||||
m_annotations.uiCapability()->setUiTreeHidden( true );
|
||||
@@ -373,6 +374,24 @@ void RimSummaryTimeAxisProperties::setMajorTickmarkCount( LegendTickmarkCount co
|
||||
m_majorTickmarkCount = count;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryTimeAxisProperties::setAutoValueForMajorTickmarkCount( LegendTickmarkCount count )
|
||||
{
|
||||
auto enumValue = static_cast<std::underlying_type_t<LegendTickmarkCount>>( count );
|
||||
|
||||
m_majorTickmarkCount.uiCapability()->setAutoValue( enumValue );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryTimeAxisProperties::enableAutoValueForMajorTickmarkCount( bool enable )
|
||||
{
|
||||
m_majorTickmarkCount.uiCapability()->enableAutoValue( enable );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -616,10 +635,6 @@ 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