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();