Fix diff pair router checking of min clearance

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13720
This commit is contained in:
Jon Evans 2023-01-31 17:48:09 -05:00
parent 68eac74458
commit 48e4005111
3 changed files with 12 additions and 3 deletions

View File

@ -596,6 +596,7 @@ bool PNS_KICAD_IFACE_BASE::ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM*
if( aStartItem && m_startLayer < 0 ) if( aStartItem && m_startLayer < 0 )
m_startLayer = aStartItem->Layer(); m_startLayer = aStartItem->Layer();
aSizes.SetClearance( bds.m_MinClearance );
aSizes.SetMinClearance( bds.m_MinClearance ); aSizes.SetMinClearance( bds.m_MinClearance );
aSizes.SetClearanceSource( _( "board minimum clearance" ) ); aSizes.SetClearanceSource( _( "board minimum clearance" ) );
@ -604,7 +605,7 @@ bool PNS_KICAD_IFACE_BASE::ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM*
{ {
if( constraint.m_Value.Min() > bds.m_MinClearance ) if( constraint.m_Value.Min() > bds.m_MinClearance )
{ {
aSizes.SetMinClearance( constraint.m_Value.Min() ); aSizes.SetClearance( constraint.m_Value.Min() );
aSizes.SetClearanceSource( constraint.m_RuleName ); aSizes.SetClearanceSource( constraint.m_RuleName );
} }
} }

View File

@ -38,6 +38,7 @@ class SIZES_SETTINGS
{ {
public: public:
SIZES_SETTINGS() : SIZES_SETTINGS() :
m_clearance( 0 ),
m_minClearance( 0 ), m_minClearance( 0 ),
m_trackWidth( 155000 ), m_trackWidth( 155000 ),
m_trackWidthIsExplicit( true ), m_trackWidthIsExplicit( true ),
@ -56,6 +57,12 @@ public:
void ClearLayerPairs(); void ClearLayerPairs();
void AddLayerPair( int aL1, int aL2 ); void AddLayerPair( int aL1, int aL2 );
// The working clearance, from the current net to anything else (without knowing the net of the
// other object). Specific clearance to another object may be resolved differently.
int Clearance() const { return m_clearance; }
void SetClearance( int aClearance ) { m_clearance = aClearance; }
// The absolute minimum clearance from the board
int MinClearance() const { return m_minClearance; } int MinClearance() const { return m_minClearance; }
void SetMinClearance( int aClearance ) { m_minClearance = aClearance; } void SetMinClearance( int aClearance ) { m_minClearance = aClearance; }
@ -116,6 +123,7 @@ public:
void SetDiffPairGapSource( const wxString& aSource ) { m_diffPairGapSource = aSource; } void SetDiffPairGapSource( const wxString& aSource ) { m_diffPairGapSource = aSource; }
private: private:
int m_clearance;
int m_minClearance; int m_minClearance;
int m_trackWidth; int m_trackWidth;
bool m_trackWidthIsExplicit; bool m_trackWidthIsExplicit;

View File

@ -2546,7 +2546,7 @@ void ROUTER_TOOL::UpdateMessagePanel()
sizes.GetDiffPairWidthSource() ) ); sizes.GetDiffPairWidthSource() ) );
items.emplace_back( wxString::Format( _( "Min Clearance: %s" ), items.emplace_back( wxString::Format( _( "Min Clearance: %s" ),
FORMAT_VALUE( sizes.MinClearance() ) ), FORMAT_VALUE( sizes.Clearance() ) ),
wxString::Format( _( "(from %s)" ), wxString::Format( _( "(from %s)" ),
sizes.GetClearanceSource() ) ); sizes.GetClearanceSource() ) );
@ -2563,7 +2563,7 @@ void ROUTER_TOOL::UpdateMessagePanel()
sizes.GetWidthSource() ) ); sizes.GetWidthSource() ) );
items.emplace_back( wxString::Format( _( "Min Clearance: %s" ), items.emplace_back( wxString::Format( _( "Min Clearance: %s" ),
FORMAT_VALUE( sizes.MinClearance() ) ), FORMAT_VALUE( sizes.Clearance() ) ),
wxString::Format( _( "(from %s)" ), wxString::Format( _( "(from %s)" ),
sizes.GetClearanceSource() ) ); sizes.GetClearanceSource() ) );
} }