From 53d048921a5dc257af66685b4e53ced939cd5eb3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 8 Feb 2024 23:56:05 +0000 Subject: [PATCH] Fix merge conflicts. --- pcbnew/generators/pcb_tuning_pattern.cpp | 26 +++++++++--------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/pcbnew/generators/pcb_tuning_pattern.cpp b/pcbnew/generators/pcb_tuning_pattern.cpp index 145a46c617..0e47658196 100644 --- a/pcbnew/generators/pcb_tuning_pattern.cpp +++ b/pcbnew/generators/pcb_tuning_pattern.cpp @@ -407,21 +407,8 @@ public: m_settings.SetTargetLength( PNS::MEANDER_SETTINGS::LENGTH_UNCONSTRAINED ); } - std::optional GetTargetSkew() const - { - if( m_settings.m_targetLength.Opt() == PNS::MEANDER_SETTINGS::LENGTH_UNCONSTRAINED ) - return std::optional(); - else - return m_settings.m_targetSkew.Opt(); - } - - void SetTargetSkew( std::optional aValue ) - { - if( aValue.has_value() ) - m_settings.SetTargetSkew( aValue.value() ); - else - m_settings.SetTargetSkew( PNS::MEANDER_SETTINGS::LENGTH_UNCONSTRAINED ); - } + int GetTargetSkew() const { return m_settings.m_targetSkew.Opt(); } + void SetTargetSkew( int aValue ) { m_settings.SetTargetSkew( aValue ); } bool GetOverrideCustomRules() const { return m_settings.m_overrideCustomRules; } void SetOverrideCustomRules( bool aOverride ) { m_settings.m_overrideCustomRules = aOverride; } @@ -695,6 +682,13 @@ PCB_TUNING_PATTERN* PCB_TUNING_PATTERN::CreateNew( GENERATOR_TOOL* aTool, else pattern->m_settings.SetTargetLength( constraint.GetValue() ); } + else + { + if( aMode == DIFF_PAIR_SKEW ) + pattern->m_settings.SetTargetSkew( 0 ); + else + pattern->m_settings.SetTargetLength( PNS::MEANDER_SETTINGS::LENGTH_UNCONSTRAINED ); + } pattern->SetFlags( IS_NEW ); @@ -2406,7 +2400,7 @@ static struct PCB_TUNING_PATTERN_DESC .SetAvailableFunc( notIsSkew ); - propMgr.AddProperty( new PROPERTY>( + propMgr.AddProperty( new PROPERTY( _HKI( "Target Skew" ), &PCB_TUNING_PATTERN::SetTargetSkew, &PCB_TUNING_PATTERN::GetTargetSkew, PROPERTY_DISPLAY::PT_SIZE, ORIGIN_TRANSFORMS::ABS_X_COORD ),