From c3c34f8158a431b27175cb8d51eedc87691e3620 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 23 Feb 2026 09:08:06 -0800 Subject: [PATCH] pcbnew: default tuning tool to time domain when netclass has a tuning profile When a netclass has an assigned tuning profile but no explicit DRC length constraint rule, the tuning tool was always starting in length (space domain) mode. This occurred because CreateNew() and EditStart() only detected time domain mode by querying LENGTH_CONSTRAINT via the DRC engine, but the tuning profile only injects TRACK_WIDTH_CONSTRAINT into the DRC rule set, never LENGTH_CONSTRAINT. Fix by checking HasTuningProfile() on the effective netclass when no explicit length constraint is found. Apply to both SINGLE and DIFF_PAIR modes in CreateNew() and EditStart(). --- pcbnew/generators/pcb_tuning_pattern.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pcbnew/generators/pcb_tuning_pattern.cpp b/pcbnew/generators/pcb_tuning_pattern.cpp index 7b81c2c950..cd49d6e320 100644 --- a/pcbnew/generators/pcb_tuning_pattern.cpp +++ b/pcbnew/generators/pcb_tuning_pattern.cpp @@ -459,6 +459,10 @@ PCB_TUNING_PATTERN* PCB_TUNING_PATTERN::CreateNew( GENERATOR_TOOL* aTool, pattern->m_settings.m_isTimeDomain = false; } } + else if( aStartItem->GetEffectiveNetClass()->HasTuningProfile() ) + { + pattern->m_settings.m_isTimeDomain = true; + } } else { @@ -574,6 +578,11 @@ void PCB_TUNING_PATTERN::EditStart( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_ m_settings.m_isTimeDomain = constraint.m_IsTimeDomain; aTool->GetManager()->PostEvent( EVENTS::SelectedItemsModified ); } + else if( track->GetEffectiveNetClass()->HasTuningProfile() ) + { + m_settings.m_isTimeDomain = true; + aTool->GetManager()->PostEvent( EVENTS::SelectedItemsModified ); + } } else { @@ -606,6 +615,11 @@ void PCB_TUNING_PATTERN::EditStart( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_ m_settings.m_isTimeDomain = constraint.m_IsTimeDomain; aTool->GetManager()->PostEvent( EVENTS::SelectedItemsModified ); } + else if( track->GetEffectiveNetClass()->HasTuningProfile() ) + { + m_settings.m_isTimeDomain = true; + aTool->GetManager()->PostEvent( EVENTS::SelectedItemsModified ); + } } else {