Commit 3017b617 authored by Maciej Suminski's avatar Maciej Suminski

Added NETINFO_LIST::UNCONNECTED constant.

parent 78732f13
......@@ -1529,7 +1529,7 @@ int BOARD::SetAreasNetCodesFromNetNames( void )
{
if( !GetArea( ii )->IsOnCopperLayer() )
{
GetArea( ii )->SetNet( 0 );
GetArea( ii )->SetNet( NETINFO_LIST::UNCONNECTED );
continue;
}
......@@ -2546,7 +2546,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
}
if( !aNetlist.IsDryRun() )
pad->SetNet( 0 );
pad->SetNet( NETINFO_LIST::UNCONNECTED );
}
}
else // Footprint pad has a net.
......@@ -2649,7 +2649,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
aReporter->Report( msg );
}
previouspad->SetNet( 0 );
previouspad->SetNet( NETINFO_LIST::UNCONNECTED );
}
netname = pad->GetNetname();
count = 1;
......@@ -2662,7 +2662,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
// Examine last pad
if( pad && count == 1 )
pad->SetNet( 0 );
pad->SetNet( NETINFO_LIST::UNCONNECTED );
}
// Last step: Some tests:
......
......@@ -199,6 +199,9 @@ public:
return NULL;
}
///> Constant that holds the unconnected net number
static const int UNCONNECTED;
#if defined(DEBUG)
void Show() const;
#endif
......
......@@ -162,3 +162,6 @@ void NETINFO_LIST::buildPadsFullList()
m_Parent->m_Status_Pcb = LISTE_PAD_OK;
}
const int NETINFO_LIST::UNCONNECTED = 0;
......@@ -690,7 +690,7 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode,
if( aDC->LogicalToDeviceXRel( m_Width ) < MIN_TEXT_SIZE )
return;
if( GetNet() == 0 )
if( GetNet() == NETINFO_LIST::UNCONNECTED )
return;
NETINFO_ITEM* net = ( (BOARD*) GetParent() )->FindNet( GetNet() );
......@@ -952,7 +952,7 @@ void SEGVIA::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode,
}
// Display the short netname:
if( GetNet() == 0 )
if( GetNet() == NETINFO_LIST::UNCONNECTED )
return;
if( DisplayOpt.DisplayNetNamesMode == 0 || DisplayOpt.DisplayNetNamesMode == 1 )
......
......@@ -842,7 +842,7 @@ void PCB_BASE_FRAME::RecalculateAllTracksNetcode()
curr_track->end = NULL;
curr_track->SetState( BUSY | IN_EDIT | BEGIN_ONPAD | END_ONPAD, false );
curr_track->SetZoneSubNet( 0 );
curr_track->SetNet( 0 ); // net code = 0 means not connected
curr_track->SetNet( NETINFO_LIST::UNCONNECTED );
}
// If no pad, reset pointers and netcode, and do nothing else
......
......@@ -1493,7 +1493,7 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics )
zone->SetTimeStamp( timeStamp( gr->second ) );
zone->SetLayer( layer );
zone->SetNet( 0 );
zone->SetNet( NETINFO_LIST::UNCONNECTED );
CPolyLine::HATCH_STYLE outline_hatch = CPolyLine::DIAGONAL_EDGE;
......@@ -2550,7 +2550,7 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals )
// KiCad does not support an unconnected zone with its own non-zero netcode,
// but only when assigned netcode = 0 w/o a name...
for( ZONES::iterator it = zones.begin(); it != zones.end(); ++it )
(*it)->SetNet( 0 );
(*it)->SetNet( NETINFO_LIST::UNCONNECTED );
// therefore omit this signal/net.
}
......
......@@ -2421,7 +2421,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
// Ensure keepout does not have a net
// (which have no sense for a keepout zone)
if( zc->GetIsKeepout() )
zc->SetNet( 0 );
zc->SetNet( NETINFO_LIST::UNCONNECTED );
// should always occur, but who knows, a zone without two corners
// is no zone at all, it's a spot?
......@@ -2431,7 +2431,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
if( !zc->IsOnCopperLayer() )
{
zc->SetFillMode( 0 );
zc->SetNet( 0 );
zc->SetNet( NETINFO_LIST::UNCONNECTED );
}
// Hatch here, after outlines corners are read
......
......@@ -141,7 +141,7 @@ void PCB_BASE_FRAME::AddPad( MODULE* aModule, bool draw )
// Update the pad properties.
Import_Pad_Settings( pad, false );
pad->SetNet( 0 );
pad->SetNet( NETINFO_LIST::UNCONNECTED );
pad->SetPosition( GetCrossHairPosition() );
......
......@@ -2687,7 +2687,7 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR )
if( !zone->IsOnCopperLayer() )
{
zone->SetFillMode( 0 );
zone->SetNet( 0 );
zone->SetNet( NETINFO_LIST::UNCONNECTED );
}
// Set hatch here, after outlines corners are read
......@@ -2699,7 +2699,7 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR )
// Ensure keepout does not have a net (which have no sense for a keepout zone)
if( zone->GetIsKeepout() )
zone->SetNet( 0 );
zone->SetNet( NETINFO_LIST::UNCONNECTED );
return zone.release();
}
......
......@@ -540,7 +540,7 @@ void PCB_BASE_FRAME::build_ratsnest_module( MODULE* aModule )
// collect active pads of the module:
for( pad_ref = aModule->Pads(); pad_ref != NULL; pad_ref = pad_ref->Next() )
{
if( pad_ref->GetNet() == 0 )
if( pad_ref->GetNet() == NETINFO_LIST::UNCONNECTED )
continue;
localPadList.push_back( pad_ref );
......
......@@ -455,7 +455,7 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aOldModule,
// Update pad netnames ( when possible)
for( D_PAD* pad = aNewModule->Pads(); pad != NULL; pad = pad->Next() )
{
pad->SetNet( 0 );
pad->SetNet( NETINFO_LIST::UNCONNECTED );
D_PAD* old_pad = aOldModule->Pads();
for( ; old_pad != NULL; old_pad = old_pad->Next() )
......
......@@ -577,7 +577,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
zoneInfo.SetIsKeepout( true );
// Netcode and netname are irrelevant,
// so ensure they are cleared
zone->SetNet( 0 );
zone->SetNet( NETINFO_LIST::UNCONNECTED );
edited = InvokeKeepoutAreaEditor( this, &zoneInfo );
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment