PNS: preserve auto-detected track width when changing via sizes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8046
This commit is contained in:
parent
99710aba48
commit
3c6b98a0d5
|
@ -463,6 +463,7 @@ bool PNS_KICAD_IFACE_BASE::ImportSizes( PNS::SIZES_SETTINGS& aSizes, PNS::ITEM*
|
||||||
}
|
}
|
||||||
|
|
||||||
aSizes.SetTrackWidth( trackWidth );
|
aSizes.SetTrackWidth( trackWidth );
|
||||||
|
aSizes.SetTrackWidthIsExplicit( !found );
|
||||||
|
|
||||||
int viaDiameter = bds.m_ViasMinSize;
|
int viaDiameter = bds.m_ViasMinSize;
|
||||||
int viaDrill = bds.m_MinThroughDrill;
|
int viaDrill = bds.m_MinThroughDrill;
|
||||||
|
|
|
@ -1543,8 +1543,16 @@ void LINE_PLACER::UpdateSizes( const SIZES_SETTINGS& aSizes )
|
||||||
|
|
||||||
if( !m_idle )
|
if( !m_idle )
|
||||||
{
|
{
|
||||||
m_head.SetWidth( m_sizes.TrackWidth() );
|
// If the track width was originally determined from the rules resolver ("use netclass
|
||||||
m_tail.SetWidth( m_sizes.TrackWidth() );
|
// width") or continuing from an existing track, we don't want to change the width unless
|
||||||
|
// the user is moving to an explicitly-specified value.
|
||||||
|
// NOTE: This doesn't quite correctly handle the case of moving *from* an explicit value
|
||||||
|
// *to* the "use netclass width" value, but that is more complicated to handle.
|
||||||
|
if( m_sizes.TrackWidthIsExplicit() )
|
||||||
|
{
|
||||||
|
m_head.SetWidth( m_sizes.TrackWidth() );
|
||||||
|
m_tail.SetWidth( m_sizes.TrackWidth() );
|
||||||
|
}
|
||||||
|
|
||||||
if( m_head.EndsWithVia() )
|
if( m_head.EndsWithVia() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,6 +40,7 @@ public:
|
||||||
SIZES_SETTINGS() :
|
SIZES_SETTINGS() :
|
||||||
m_minClearance( 0 ),
|
m_minClearance( 0 ),
|
||||||
m_trackWidth( 155000 ),
|
m_trackWidth( 155000 ),
|
||||||
|
m_trackWidthIsExplicit( true ),
|
||||||
m_viaType( VIATYPE::THROUGH ),
|
m_viaType( VIATYPE::THROUGH ),
|
||||||
m_viaDiameter( 600000 ),
|
m_viaDiameter( 600000 ),
|
||||||
m_viaDrill( 250000 ),
|
m_viaDrill( 250000 ),
|
||||||
|
@ -61,6 +62,9 @@ public:
|
||||||
int TrackWidth() const { return m_trackWidth; }
|
int TrackWidth() const { return m_trackWidth; }
|
||||||
void SetTrackWidth( int aWidth ) { m_trackWidth = aWidth; }
|
void SetTrackWidth( int aWidth ) { m_trackWidth = aWidth; }
|
||||||
|
|
||||||
|
bool TrackWidthIsExplicit() const { return m_trackWidthIsExplicit; }
|
||||||
|
void SetTrackWidthIsExplicit( bool aIsExplicit ) { m_trackWidthIsExplicit = aIsExplicit; }
|
||||||
|
|
||||||
int DiffPairWidth() const { return m_diffPairWidth; }
|
int DiffPairWidth() const { return m_diffPairWidth; }
|
||||||
int DiffPairGap() const { return m_diffPairGap; }
|
int DiffPairGap() const { return m_diffPairGap; }
|
||||||
|
|
||||||
|
@ -102,6 +106,7 @@ public:
|
||||||
private:
|
private:
|
||||||
int m_minClearance;
|
int m_minClearance;
|
||||||
int m_trackWidth;
|
int m_trackWidth;
|
||||||
|
bool m_trackWidthIsExplicit;
|
||||||
|
|
||||||
VIATYPE m_viaType;
|
VIATYPE m_viaType;
|
||||||
int m_viaDiameter;
|
int m_viaDiameter;
|
||||||
|
|
|
@ -1873,7 +1873,7 @@ int ROUTER_TOOL::onTrackViaSizeChanged( const TOOL_EVENT& aEvent )
|
||||||
PNS::SIZES_SETTINGS sizes( m_router->Sizes() );
|
PNS::SIZES_SETTINGS sizes( m_router->Sizes() );
|
||||||
|
|
||||||
if( !m_router->GetCurrentNets().empty() )
|
if( !m_router->GetCurrentNets().empty() )
|
||||||
m_iface->ImportSizes( sizes, nullptr, m_router->GetCurrentNets()[0] );
|
m_iface->ImportSizes( sizes, m_startItem, m_router->GetCurrentNets()[0] );
|
||||||
|
|
||||||
m_router->UpdateSizes( sizes );
|
m_router->UpdateSizes( sizes );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue