From 9c708c61775a6a5c91f7d409b0946b755a554801 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 18 Sep 2018 10:58:12 +0100 Subject: [PATCH] Use DP netclass values when custom or predefined are not selected. Fixes: lp:1780670 * https://bugs.launchpad.net/kicad/+bug/1780670 --- include/board_design_settings.h | 9 +++++++++ pcbnew/router/pns_sizes_settings.cpp | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/board_design_settings.h b/include/board_design_settings.h index db08a16cfe..ce3946c9a4 100644 --- a/include/board_design_settings.h +++ b/include/board_design_settings.h @@ -298,6 +298,15 @@ public: return ( m_viaSizeIndex == 0 && !m_useCustomTrackVia ); } + /** + * Function UseNetClassDiffPair + * returns true if netclass values should be used to obtain appropriate diff pair dimensions. + */ + inline bool UseNetClassDiffPair() const + { + return ( m_diffPairIndex == 0 && !m_useCustomDiffPair ); + } + /** * Function SetCurrentNetClass * Must be called after a netclass selection (or after a netclass parameter change diff --git a/pcbnew/router/pns_sizes_settings.cpp b/pcbnew/router/pns_sizes_settings.cpp index 257299ae53..18ead5f729 100644 --- a/pcbnew/router/pns_sizes_settings.cpp +++ b/pcbnew/router/pns_sizes_settings.cpp @@ -124,7 +124,13 @@ void SIZES_SETTINGS::Init( BOARD* aBoard, ITEM* aStartItem, int aNet ) m_viaDrill = bds.GetCurrentViaDrill(); } - if( bds.UseCustomDiffPairDimensions() ) + if( bds.UseNetClassDiffPair() && netClass != NULL ) + { + m_diffPairWidth = netClass->GetDiffPairWidth(); + m_diffPairGap = netClass->GetDiffPairGap(); + m_diffPairViaGap = netClass->GetDiffPairViaGap(); + } + else if( bds.UseCustomDiffPairDimensions() ) { m_diffPairWidth = bds.GetCustomDiffPairWidth(); m_diffPairGap = bds.GetCustomDiffPairGap();