From 36554e68d46a48d052ac4096931995eb34a047b6 Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Thu, 21 Feb 2008 06:04:32 +0000 Subject: [PATCH] on export, test via for netcode == 0 --- pcbnew/specctra.h | 19 ++++++++++++++----- pcbnew/specctra_export.cpp | 21 +++++++++++++++++---- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/pcbnew/specctra.h b/pcbnew/specctra.h index 81eba79858..8773ce69f7 100644 --- a/pcbnew/specctra.h +++ b/pcbnew/specctra.h @@ -2413,20 +2413,17 @@ public: * Class PIN_REF * corresponds to the <pin_reference> definition in the specctra dsn spec. */ -class PIN_REF : public ELEM +struct PIN_REF : public ELEM { - friend class SPECCTRA_DB; - std::string component_id; std::string pin_id; -public: - PIN_REF( ELEM* aParent ) : ELEM( T_pin, aParent ) { } + /** * Function FormatIt * is like Format() but is not virual and returns the number of characters @@ -2607,6 +2604,18 @@ public: delete comp_order; } + + int FindPIN_REF( const std::string& aComponent ) + { + for( unsigned i=0; iGetQuoteChar( net_id.c_str() ); diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index d453ca19c9..95d59021c2 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -1054,11 +1054,21 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) pcb->library->AddPadstack( padstack ); } + D(std::string component = "U1";) + // copy our SPECCTRA_DB::nets to the pcb->network for( unsigned n=1; npins.size() ) + if( net->pins.size() + +#if defined(DEBUG) + // experimenting with exporting a subset of all the nets + // and with incremental, iterative autorouting. + && net->FindPIN_REF( component ) >= 0 +#endif + + ) { // give ownership to pcb->network pcb->network->nets.push_back( net ); @@ -1149,7 +1159,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) wiring->wires.push_back( wire ); wire->net_id = netname; - wire->wire_type = T_normal; // @todo, this should be configurable + wire->wire_type = T_protect; // @todo, this should be configurable int kiLayer = track->GetLayer(); int pcbLayer = kicadLayer2pcb[kiLayer]; @@ -1181,6 +1191,10 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) SEGVIA* via = (SEGVIA*) items[i]; wxASSERT( via->Type() == TYPEVIA ); + int netcode = via->GetNet(); + if( netcode == 0 ) + continue; + PADSTACK* padstack = makeVia( via ); PADSTACK* registered = pcb->library->LookupVia( padstack ); if( padstack != registered ) @@ -1194,13 +1208,12 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) dsnVia->padstack_id = registered->padstack_id; dsnVia->vertexes.push_back( mapPt( via->GetPosition() ) ); - int netcode = via->GetNet(); EQUIPOT* equipot = aBoard->FindNet( netcode ); wxASSERT( equipot ); dsnVia->net_id = CONV_TO_UTF8( equipot->m_Netname ); - dsnVia->via_type = T_normal; // @todo, this should be configurable + dsnVia->via_type = T_protect; // @todo, this should be configurable } }