Commit 227fa1e2 authored by dickelbeck's avatar dickelbeck

fixed specctra_export's net handling

parent 431a85e0
......@@ -5,43 +5,50 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Feb-3 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
specctra_export.cpp was not exporting the nets correctly. beautification
of a few modules.
2008-Feb-1 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew:
SPECCTRA export now exports pads with offset OK, exports oval pads OK,
and tries to do less with pcb edges that are not a connected set of lines,
putting the burden back on the PCBNEW user to have clean perimeter lines.
Discovered that freerouter does not support oval pads yet, asked
for enhancement. Discovered a small problem if you modify a PAD in
the MODULE editor but do not replicate that change throughout all module
instances in the board. Is on my @todo list. Otherwise it is getting pretty
good now. Most boards load into freerouter, except mine, which if exported
with part numbers, hangs the freerouter! I may be away for a few days doing
billable work, after which I will begin the 2 imports, *.dsn and *.ses.
SPECCTRA export now exports pads with offset OK, exports oval pads OK,
and tries to do less with pcb edges that are not a connected set of lines,
putting the burden back on the PCBNEW user to have clean perimeter lines.
Discovered that freerouter does not support oval pads yet, asked
for enhancement. Discovered a small problem if you modify a PAD in
the MODULE editor but do not replicate that change throughout all module
instances in the board. Is on my @todo list. Otherwise it is getting pretty
good now. Most boards load into freerouter, except mine, which if exported
with part numbers, hangs the freerouter! I may be away for a few days doing
billable work, after which I will begin the 2 imports, *.dsn and *.ses.
2008-Jan-31 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
remove the old EDGEZONE class.
A ZONE_CONTAINER class is used instead to handle the creation of a new zone outline
remove the old EDGEZONE class.
A ZONE_CONTAINER class is used instead to handle the creation of a new zone outline
2008-Jan-29 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew:
SPECCTRA export does most items now, except existing tracks. Soon will
need testing.
SPECCTRA export does most items now, except existing tracks. Soon will
need testing.
2008-Jan-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
- Better criteria to find starting poind in zone filling: the filling alg. uses
pads, vias and track ends to find where start the filling.
- Added a tool + option in popup menu in track mode (select track width):
when creating a track, if activated: if we starts on an existing track,
the new track takes the width of the existing track
- Better criteria to find starting poind in zone filling: the filling alg. uses
pads, vias and track ends to find where start the filling.
- Added a tool + option in popup menu in track mode (select track width):
when creating a track, if activated: if we starts on an existing track,
the new track takes the width of the existing track
2008-Jan-27 UPDATE Dick Hollenbeck <dick@softplc.com>
......
......@@ -3563,12 +3563,16 @@ int STRINGFORMATTER::Print( int nestLevel, const char* fmt, ... ) throw( IOError
void STRINGFORMATTER::StripUseless()
{
for( std::string::iterator i=mystring.begin(); i!=mystring.end(); )
std::string copy = mystring;
mystring.clear();
for( std::string::iterator i=copy.begin(); i!=copy.end(); ++i )
{
if( isspace( *i ) || *i==')' || *i=='(' || *i=='"' )
mystring.erase(i);
else
++i;
if( !isspace( *i ) && *i!=')' && *i!='(' && *i!='"' )
{
mystring += *i;
}
}
}
......
......@@ -3469,6 +3469,8 @@ class SPECCTRA_DB : public OUTPUTFORMATTER
/// maps PCB layer number to BOARD layer numbers
std::vector<int> pcbLayer2kicad;
static const KICAD_T scanPADs[];
/**
......
......@@ -121,6 +121,9 @@ struct POINT_PAIR
typedef std::vector<POINT_PAIR> POINT_PAIRS;
const KICAD_T SPECCTRA_DB::scanPADs[] = { TYPEPAD, EOT };
static inline void swap( POINT_PAIR& pair )
{
POINT temp = pair.start;
......@@ -332,7 +335,6 @@ IMAGE* SPECCTRA_DB::makeIMAGE( MODULE* aModule )
PADSTACKS& padstacks = pcb->library->padstacks;
TYPE_COLLECTOR pads;
static const KICAD_T scanPADs[] = { TYPEPAD, EOT };
// get all the MODULE's pads.
pads.Collect( aModule, scanPADs );
......@@ -772,6 +774,9 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
POINT_PAIRS ppairs;
POINT_PAIR pair;
static const KICAD_T scanMODULEs[] = { TYPEMODULE, EOT };
if( !pcb )
pcb = SPECCTRA_DB::MakePCB();
......@@ -1021,7 +1026,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
//-----<build the initial padstack list>--------------------------------
{
TYPE_COLLECTOR pads;
static const KICAD_T scanPADs[] = { TYPEPAD, EOT };
// get all the D_PADs into 'pads'.
pads.Collect( aBoard, scanPADs );
......@@ -1037,7 +1041,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
//-----<build the images and components>---------------------------------
{
static const KICAD_T scanMODULEs[] = { TYPEMODULE, EOT };
items.Collect( aBoard, scanMODULEs );
for( int m=0; m<items.GetCount(); ++m )
......@@ -1077,16 +1080,21 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
//-----<create the nets>------------------------------------------------
{
NETWORK* network = pcb->network;
NETWORK* network = pcb->network;
TYPE_COLLECTOR nets;
TYPE_COLLECTOR pads;
static const KICAD_T scanNETs[] = { PCB_EQUIPOT_STRUCT_TYPE, EOT };
items.Collect( aBoard, scanNETs );
nets.Collect( aBoard, scanNETs );
items.Collect( aBoard, scanMODULEs );
PIN_REF emptypin(0);
for( int i=0; i<items.GetCount(); ++i )
for( int n=0; n<nets.GetCount(); ++n )
{
EQUIPOT* kinet = (EQUIPOT*) items[i];
EQUIPOT* kinet = (EQUIPOT*) nets[n];
if( kinet->GetNet() == 0 )
continue;
......@@ -1096,21 +1104,28 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
net->net_id = CONV_TO_UTF8( kinet->m_Netname );
net->net_number = kinet->GetNet();
D_PAD** ppad = kinet->m_PadzoneStart;
for( ; ppad < kinet->m_PadzoneEnd; ++ppad )
for( int m=0; m<items.GetCount(); ++m )
{
D_PAD* pad = *ppad;
MODULE* module = (MODULE*) items[m];
wxASSERT( pad->Type() == TYPEPAD );
// push on an empty one, then fill it via 'pin_ref'
net->pins.push_back( emptypin );
PIN_REF* pin_ref = &net->pins.back();
pads.Collect( module, scanPADs );
pin_ref->SetParent( net );
pin_ref->component_id = CONV_TO_UTF8( ((MODULE*)pad->m_Parent)->GetReference() );;
pin_ref->pin_id = CONV_TO_UTF8( pad->ReturnStringPadName() );
for( int p=0; p<pads.GetCount(); ++p )
{
D_PAD* pad = (D_PAD*) pads[p];
if( pad->GetNet() == kinet->GetNet() )
{
// push on an empty one, then fill it via 'pin_ref'
net->pins.push_back( emptypin );
PIN_REF* pin_ref = &net->pins.back();
pin_ref->SetParent( net );
pin_ref->component_id = CONV_TO_UTF8( module->GetReference() );
pin_ref->pin_id = CONV_TO_UTF8( pad->ReturnStringPadName() );
}
}
}
}
}
......
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