diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ccdae7f98a..da5e7f4e7e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,7 @@ email address. ================================================================================ ++pcbnew added "cutout" from a ZONE_CONTAINER capability to the SPECCTRA export. + added "netless zone" support to SPECCTRA export. 2009-Feb-6 Jean-Pierre Charras diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index d6915a07d8..0677b4cfe0 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -1026,6 +1026,8 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) //------------------------------------- { + int netlessZones = 0; + static const KICAD_T scanZONEs[] = { TYPE_ZONE_CONTAINER, EOT }; items.Collect( aBoard, scanZONEs ); @@ -1041,6 +1043,24 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) plane->name = CONV_TO_UTF8( item->m_Netname ); + if( plane->name.size() == 0 ) + { + char name[32]; + + // This is one of those no connection zones, netcode=0, and it has no name. + // Create a unique, bogus netname. + NET* no_net = new NET( pcb->network ); + + sprintf( name, "@:no_net_%d", netlessZones++ ); + no_net->net_id = name; + + // add the bogus net name to network->nets. + pcb->network->nets.push_back( no_net ); + + // use the bogus net name in the netless zone. + plane->name = no_net->net_id; + } + mainPolygon->layer_id = layerIds[ kicadLayer2pcb[ item->GetLayer() ] ]; int count = item->m_Poly->corner.size();