Missing fixes for the revision 5301.

This commit is contained in:
Maciej Suminski 2014-11-27 11:47:17 +01:00
parent 6c4808bd49
commit 0daa1fa67e
2 changed files with 5 additions and 4 deletions

View File

@ -38,8 +38,6 @@ BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype
BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED ), BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED ),
m_Subnet( 0 ), m_ZoneSubnet( 0 ) m_Subnet( 0 ), m_ZoneSubnet( 0 )
{ {
// The unconnected net is set only in case the item belongs to a BOARD
SetNetCode( NETINFO_LIST::UNCONNECTED );
} }
@ -52,12 +50,15 @@ BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem )
void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode ) void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode )
{ {
assert( aNetCode >= 0 );
BOARD* board = GetBoard(); BOARD* board = GetBoard();
if( board ) if( board )
m_netinfo = board->FindNet( aNetCode ); m_netinfo = board->FindNet( aNetCode );
else else
m_netinfo = &NETINFO_LIST::ORPHANED; m_netinfo = &NETINFO_LIST::ORPHANED;
assert( m_netinfo );
} }

View File

@ -698,7 +698,7 @@ void PNS_ROUTER::CommitRouting( PNS_NODE* aNode )
track->SetEnd( wxPoint( s.B.x, s.B.y ) ); track->SetEnd( wxPoint( s.B.x, s.B.y ) );
track->SetWidth( seg->Width() ); track->SetWidth( seg->Width() );
track->SetLayer( ToLAYER_ID( seg->Layers().Start() ) ); track->SetLayer( ToLAYER_ID( seg->Layers().Start() ) );
track->SetNetCode( seg->Net() ); track->SetNetCode( seg->Net() > 0 ? seg->Net() : 0 );
newBI = track; newBI = track;
break; break;
} }
@ -710,7 +710,7 @@ void PNS_ROUTER::CommitRouting( PNS_NODE* aNode )
via_board->SetPosition( wxPoint( via->Pos().x, via->Pos().y ) ); via_board->SetPosition( wxPoint( via->Pos().x, via->Pos().y ) );
via_board->SetWidth( via->Diameter() ); via_board->SetWidth( via->Diameter() );
via_board->SetDrill( via->Drill() ); via_board->SetDrill( via->Drill() );
via_board->SetNetCode( via->Net() ); via_board->SetNetCode( via->Net() > 0 ? seg->Net() : 0 );
via_board->SetViaType( via->ViaType() ); // MUST be before SetLayerPair() via_board->SetViaType( via->ViaType() ); // MUST be before SetLayerPair()
via_board->SetLayerPair( ToLAYER_ID( via->Layers().Start() ), via_board->SetLayerPair( ToLAYER_ID( via->Layers().Start() ),
ToLAYER_ID( via->Layers().End() ) ); ToLAYER_ID( via->Layers().End() ) );