Use DP netclass values when custom or predefined are not selected.

Fixes: lp:1780670
* https://bugs.launchpad.net/kicad/+bug/1780670
This commit is contained in:
Jeff Young 2018-09-18 10:58:12 +01:00
parent 8999f4604f
commit 9c708c6177
2 changed files with 16 additions and 1 deletions

View File

@ -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

View File

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