Ensure NC nets are not connected in board
Even when a pin connects to multiple pads, placing an NC indicator on the pin type or the connected net means that all pads for that pin should be independent and not ratsnest with each other We accomplish this by assigning a unique id "unconnected-(REFDES-PAD#_#)" to each pad with the pintype "no_connect". The pad numbers and uniquely incremented per footprint based on UUID ordering Fixes https://gitlab.com/kicad/code/kicad/-/issues/15692
This commit is contained in:
parent
a3bc3e138b
commit
4cd26ab6bc
|
@ -556,7 +556,14 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( FOOTPRINT* aFootprint
|
|||
bool changed = false;
|
||||
|
||||
// At this point, the component footprint is updated. Now update the nets.
|
||||
for( PAD* pad : aFootprint->Pads() )
|
||||
PADS pads = aFootprint->Pads();
|
||||
std::set<wxString> padNetnames;
|
||||
|
||||
std::sort( pads.begin(), pads.end(), []( PAD* a, PAD* b ) {
|
||||
return a->m_Uuid < b->m_Uuid;
|
||||
} );
|
||||
|
||||
for( PAD* pad : pads )
|
||||
{
|
||||
const COMPONENT_NET& net = aNewComponent->GetNet( pad->GetNumber() );
|
||||
|
||||
|
@ -637,7 +644,20 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( FOOTPRINT* aFootprint
|
|||
}
|
||||
else // New footprint pad has a net.
|
||||
{
|
||||
const wxString& netName = net.GetNetName();
|
||||
wxString netName = net.GetNetName();
|
||||
|
||||
if( pad->IsNoConnectPad() )
|
||||
{
|
||||
netName = wxString::Format( wxT( "unconnected-(%s-Pad%s)" ),
|
||||
aFootprint->GetReference(), pad->GetNumber() );
|
||||
|
||||
for( int jj = 0; !padNetnames.insert( netName ).second; jj++ )
|
||||
{
|
||||
netName = wxString::Format( wxT( "unconnected-(%s-Pad%s_%d)" ),
|
||||
aFootprint->GetReference(), pad->GetNumber(), jj );
|
||||
}
|
||||
}
|
||||
|
||||
NETINFO_ITEM* netinfo = m_board->FindNet( netName );
|
||||
|
||||
if( netinfo && !m_isDryRun )
|
||||
|
|
|
@ -180,8 +180,7 @@ bool PAD::SharesNetTieGroup( const PAD* aOther ) const
|
|||
|
||||
bool PAD::IsNoConnectPad() const
|
||||
{
|
||||
return GetShortNetname().StartsWith( wxT( "unconnected-(" ) )
|
||||
&& ( m_pinType == wxT( "no_connect" ) || m_pinType.EndsWith( wxT( "+no_connect" ) ) );
|
||||
return m_pinType.Contains( wxT( "no_connect" ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue