more amazing free software

This commit is contained in:
dickelbeck 2008-02-03 21:46:12 +00:00
parent 227fa1e26e
commit d4562043a2
3 changed files with 71 additions and 27 deletions

View File

@ -8,23 +8,14 @@ email address.
2008-Feb-3 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Feb-3 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+pcbnew +pcbnew
specctra_export.cpp was not exporting the nets correctly. beautification * specctra_export.cpp was not exporting the nets correctly, now fixed.
of a few modules. * Had a problem with an isolated pad modification on a single module instance
in the context of several unmodified instances of same module, now fixed.
* Fixed oval pads to make freerouting.net happy.
2008-Feb-1 UPDATE Dick Hollenbeck <dick@softplc.com> See: http://www.freerouting.net/usren/viewtopic.php?f=3&t=317#p408
================================================================================ Done with specctra export for now, will think about adding controls (by dialog)
+pcbnew: on the export later.
SPECCTRA export now exports pads with offset OK, exports oval pads OK, * Beautification of a few modules.
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> 2008-Jan-31 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>

View File

@ -1943,10 +1943,11 @@ public:
} }
}; };
class LIBRARY;
class IMAGE : public ELEM_HOLDER class IMAGE : public ELEM_HOLDER
{ {
friend class SPECCTRA_DB; friend class SPECCTRA_DB;
friend class LIBRARY;
std::string hash; ///< a hash string used by Compare(), not Format()ed/exported. std::string hash; ///< a hash string used by Compare(), not Format()ed/exported.
@ -1967,6 +1968,8 @@ class IMAGE : public ELEM_HOLDER
KEEPOUTS keepouts; KEEPOUTS keepouts;
int duplicated; ///< no. times this image_id is duplicated
public: public:
IMAGE( ELEM* aParent ) : IMAGE( ELEM* aParent ) :
@ -1976,6 +1979,7 @@ public:
unit = 0; unit = 0;
rules = 0; rules = 0;
place_rules = 0; place_rules = 0;
duplicated = 0;
} }
~IMAGE() ~IMAGE()
{ {
@ -1990,12 +1994,30 @@ public:
*/ */
static int Compare( IMAGE* lhs, IMAGE* rhs ); static int Compare( IMAGE* lhs, IMAGE* rhs );
std::string GetImageId()
{
if( duplicated )
{
char buf[32];
std::string ret = image_id;
ret += "::";
sprintf( buf, "%d", duplicated );
ret += buf;
return ret;
}
return image_id;
}
void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )
{ {
const char* quote = out->GetQuoteChar( image_id.c_str() ); std::string imageId = GetImageId();
const char* quote = out->GetQuoteChar( imageId.c_str() );
out->Print( nestLevel, "(%s %s%s%s", LEXER::GetTokenText( Type() ), out->Print( nestLevel, "(%s %s%s%s", LEXER::GetTokenText( Type() ),
quote, image_id.c_str(), quote ); quote, imageId.c_str(), quote );
FormatContents( out, nestLevel+1 ); FormatContents( out, nestLevel+1 );
@ -2205,11 +2227,22 @@ public:
*/ */
int FindIMAGE( IMAGE* aImage ) int FindIMAGE( IMAGE* aImage )
{ {
for( unsigned i=0; i<images.size(); ++i ) unsigned i;
for( i=0; i<images.size(); ++i )
{ {
if( 0 == IMAGE::Compare( aImage, &images[i] ) ) if( 0 == IMAGE::Compare( aImage, &images[i] ) )
return (int) i; return (int) i;
} }
// There is no match to the IMAGE contents, but now generate a unique
// name for it.
int dups = 1;
for( i=0; i<images.size(); ++i )
{
if( 0 == aImage->image_id.compare( images[i].image_id ) )
aImage->duplicated = dups++;
}
return -1; return -1;
} }

View File

@ -230,7 +230,7 @@ static void swapEnds( POINT_PAIRS& aList )
} }
} }
#if 1 && defined(DEBUG) #if 0 && defined(DEBUG)
printf( "swapEnds():\n" ); printf( "swapEnds():\n" );
for( unsigned i=0; i<sorted.size(); ++i ) for( unsigned i=0; i<sorted.size(); ++i )
{ {
@ -317,6 +317,7 @@ static PATH* makePath( const POINT& aStart, const POINT& aEnd, const std::string
} }
/*
static QARC* makeArc( const POINT& aStart, const POINT& aEnd, static QARC* makeArc( const POINT& aStart, const POINT& aEnd,
const POINT& aCenter, const std::string& aLayerName ) const POINT& aCenter, const std::string& aLayerName )
{ {
@ -328,6 +329,7 @@ static QARC* makeArc( const POINT& aStart, const POINT& aEnd,
qarc->SetLayerId( aLayerName.c_str() ); qarc->SetLayerId( aLayerName.c_str() );
return qarc; return qarc;
} }
*/
IMAGE* SPECCTRA_DB::makeIMAGE( MODULE* aModule ) IMAGE* SPECCTRA_DB::makeIMAGE( MODULE* aModule )
@ -582,10 +584,10 @@ void SPECCTRA_DB::makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads )
{ {
if( doLayer[layer] ) if( doLayer[layer] )
{ {
// each oval is 2 lines and 4 (quarter circle) qarcs
SHAPE* shape; SHAPE* shape;
PATH* path; PATH* path;
#if 0
// each oval is 2 lines and 4 (quarter circle) qarcs
QARC* qarc; QARC* qarc;
shape = new SHAPE( padstack ); shape = new SHAPE( padstack );
@ -639,6 +641,14 @@ void SPECCTRA_DB::makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads )
POINT( -dr, 0.0 ), // aCenter POINT( -dr, 0.0 ), // aCenter
layerName ); layerName );
shape->SetShape( qarc ); shape->SetShape( qarc );
#else
// see http://www.freerouting.net/usren/viewtopic.php?f=3&t=317#p408
shape = new SHAPE( padstack );
padstack->Append( shape );
path = makePath( POINT(-dr, 0.0), POINT(dr, 0.0), layerName );
shape->SetShape( path );
path->aperture_width = 2.0 * radius;
#endif
++coppers; ++coppers;
} }
@ -654,10 +664,10 @@ void SPECCTRA_DB::makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads )
{ {
if( doLayer[layer] ) if( doLayer[layer] )
{ {
// each oval is 2 lines and 2 qarcs
SHAPE* shape; SHAPE* shape;
PATH* path; PATH* path;
#if 0
// each oval is 2 lines and 2 qarcs
QARC* qarc; QARC* qarc;
shape = new SHAPE( padstack ); shape = new SHAPE( padstack );
@ -711,6 +721,14 @@ void SPECCTRA_DB::makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads )
POINT( 0.0, -dr ), // aCenter POINT( 0.0, -dr ), // aCenter
layerName ); layerName );
shape->SetShape( qarc ); shape->SetShape( qarc );
#else
// see http://www.freerouting.net/usren/viewtopic.php?f=3&t=317#p408
shape = new SHAPE( padstack );
padstack->Append( shape );
path = makePath( POINT(0.0, -dr), POINT(0.0, dr), layerName );
shape->SetShape( path );
path->aperture_width = 2.0 * radius;
#endif
++coppers; ++coppers;
} }
@ -1061,7 +1079,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
// and made it different from what is in the PCBNEW library. Need to test // and made it different from what is in the PCBNEW library. Need to test
// each image for uniqueness, not just based on name as is done here: // each image for uniqueness, not just based on name as is done here:
COMPONENT* comp = pcb->placement->LookupCOMPONENT( registered->image_id ); COMPONENT* comp = pcb->placement->LookupCOMPONENT( registered->GetImageId() );
PLACE* place = new PLACE( comp ); PLACE* place = new PLACE( comp );
comp->places.push_back( place ); comp->places.push_back( place );
@ -1130,6 +1148,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
} }
} }
#if 1 // do existing wires and vias
//-----<create the wires from tracks>----------------------------------- //-----<create the wires from tracks>-----------------------------------
{ {
@ -1236,6 +1255,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
} }
} }
#endif // do existing wires and vias
//-----<via_descriptor>------------------------------------------------- //-----<via_descriptor>-------------------------------------------------
{ {