From 876449b83d8e5a2a2d0100b29bf7f2d47737bd8f Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Thu, 8 Feb 2024 19:34:17 +0300 Subject: [PATCH] Set DP skew meanders max length to INT32_MAX instead of 100 mm. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16860 --- pcbnew/generators/pcb_tuning_pattern.cpp | 16 +--------------- pcbnew/router/pns_meander.h | 6 +++--- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/pcbnew/generators/pcb_tuning_pattern.cpp b/pcbnew/generators/pcb_tuning_pattern.cpp index e01f5d87ba..9ecb394544 100644 --- a/pcbnew/generators/pcb_tuning_pattern.cpp +++ b/pcbnew/generators/pcb_tuning_pattern.cpp @@ -66,9 +66,6 @@ #include -#define LENGTH_UNCONSTRAINED std::numeric_limits::max() - - enum LENGTH_TUNING_MODE { SINGLE, @@ -672,17 +669,6 @@ 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( LENGTH_UNCONSTRAINED ); - } - } pattern->SetFlags( IS_NEW ); @@ -1847,7 +1833,7 @@ std::vector PCB_TUNING_PATTERN::GetPreviewItems( GENERATOR_TOOL* aToo } else { - if( m_settings.m_targetLength.Opt() == LENGTH_UNCONSTRAINED ) + if( m_settings.m_targetLength.Opt() == PNS::MEANDER_SETTINGS::LENGTH_UNCONSTRAINED ) { statusItem->ClearMinMax(); } diff --git a/pcbnew/router/pns_meander.h b/pcbnew/router/pns_meander.h index 42db96cd8a..9a5b7b46c3 100644 --- a/pcbnew/router/pns_meander.h +++ b/pcbnew/router/pns_meander.h @@ -66,9 +66,9 @@ enum MEANDER_SIDE */ class MEANDER_SETTINGS { -#define DEFAULT_TOLERANCE 100000 - public: + static const long long int DEFAULT_TOLERANCE = 100000; + static const long long int LENGTH_UNCONSTRAINED = std::numeric_limits::max(); MEANDER_SETTINGS() { @@ -77,7 +77,7 @@ public: m_step = 50000; m_lenPadToDie = 0; m_spacing = 600000; - SetTargetLength( 100000000 ); + SetTargetLength( LENGTH_UNCONSTRAINED ); SetTargetSkew( 0 ); m_overrideCustomRules = false; m_cornerStyle = MEANDER_STYLE_ROUND;