30#include <boost/ptr_container/ptr_vector.hpp> 
   33#include <boost/ptr_container/ptr_set.hpp> 
   35#include <specctra_import_export/specctra_lexer.h> 
  121        return x==other.
x && 
y==other.
y;
 
 
  126        return !( *
this == other );
 
 
  167        out->
Print( nestLevel, 
" %.6g %.6g", 
x, 
y );
 
 
 
  191        out->
Print( nestLevel, 
"(%s%s%s %s%s%s)\n",
 
  192                   quoteName,  
name.c_str(), quoteName,
 
  193                   quoteValue, 
value.c_str(), quoteValue );
 
 
 
  217    const char* 
Name() 
const;
 
  274        return sf.GetString();
 
 
 
  298        ELEM( aType, aParent )
 
 
  329        kids.push_back( aElem );
 
 
  334        ELEM_ARRAY::auto_type ret = 
kids.replace( aIndex, aElem );
 
  335        return ret.release();
 
 
  340        ELEM_ARRAY::auto_type ret = 
kids.release( 
kids.begin() + aIndex );
 
  341        return ret.release();
 
 
 
  418        ELEM( aType, aParent )
 
 
 
  448        ELEM( T_rect, aParent )
 
 
  471        const char* newline = nestLevel ? 
"\n" : 
"";
 
  475        out->
Print( nestLevel, 
"(%s %s%s%s %.6g %.6g %.6g %.6g)%s",
 
 
 
  501        ELEM( aType, aParent )
 
 
  519            out->
Print( 0, 
"\n" );
 
  522            for( STRINGS::const_iterator i = 
m_rules.begin();  i != 
m_rules.end(); ++i )
 
  523                out->
Print( nestLevel+1, 
"%s\n", i->c_str() );
 
  525            out->
Print( nestLevel, 
")" );
 
  528        if( nestLevel || !singleLine )
 
  529            out->
Print( 0, 
"\n" );
 
 
 
  544        ELEM( T_layer_rule, aParent )
 
 
  561            out->
Print( 0, 
" %s%s%s", quote, i->c_str(), quote );
 
  564        out->
Print( 0 , 
"\n" );
 
  567            m_rule->Format( out, nestLevel+1 );
 
  569        out->
Print( nestLevel, 
")\n" );
 
 
 
  592        ELEM( aType, aParent )
 
 
  600        points.push_back( aPoint );
 
 
  617        const char* newline = nestLevel ? 
"\n" : 
"";
 
  621        const int RIGHTMARGIN = 70;
 
  622        int perLine = out->
Print( nestLevel, 
"(%s %s%s%s %.6g",
 
  627        int wrapNest = std::max( nestLevel+1, 6 );
 
  629        for( 
unsigned i = 0; i < 
points.size(); ++i )
 
  631            if( perLine > RIGHTMARGIN )
 
  633                out->
Print( 0, 
"\n" );
 
  634                perLine = out->
Print( wrapNest, 
"%s", 
"" );
 
  638                perLine += out->
Print( 0, 
"  " );
 
  646            out->
Print( 0, 
"(aperture_type square)" );
 
  649        out->
Print( 0, 
")%s", newline );
 
 
 
  662typedef boost::ptr_vector<PATH> 
PATHS;
 
  670        ELEM( aType, aParent )
 
 
  687            aBuffer.push_back( 
rectangle->GetOrigin().x );
 
  688            aBuffer.push_back( 
rectangle->GetOrigin().y );
 
  690            aBuffer.push_back( 
rectangle->GetOrigin().x );
 
  691            aBuffer.push_back( 
rectangle->GetEnd().y );
 
  693            aBuffer.push_back( 
rectangle->GetEnd().x );
 
  694            aBuffer.push_back( 
rectangle->GetEnd().y );
 
  696            aBuffer.push_back( 
rectangle->GetEnd().x );
 
  697            aBuffer.push_back( 
rectangle->GetOrigin().y );
 
  701            for( PATHS::iterator i=
paths.begin();  i!=
paths.end();  ++i )
 
  703                POINTS& plist = i->GetPoints();
 
  705                for( 
unsigned jj = 0; jj < plist.size(); jj++ )
 
  707                    aBuffer.push_back( plist[jj].x );
 
  708                    aBuffer.push_back( plist[jj].y );
 
 
  717        out->
Print( nestLevel, 
"(%s\n", 
Name() );
 
  723            for( PATHS::iterator i = 
paths.begin(); i != 
paths.end(); ++i )
 
  724                i->Format( out, nestLevel+1 );
 
  727        out->
Print( nestLevel, 
")\n" );
 
 
 
  743        ELEM( T_circle, aParent )
 
 
  750        const char* newline = nestLevel ? 
"\n" : 
"";
 
  753        out->
Print( nestLevel, 
"(%s %s%s%s %.6g", 
Name(), quote, 
layer_id.c_str(), quote,
 
  759            out->
Print( 0, 
")%s", newline );
 
 
 
  791        ELEM( T_qarc, aParent )
 
 
  798        const char* newline = nestLevel ? 
"\n" : 
"";
 
  801        out->
Print( nestLevel, 
"(%s %s%s%s %.6g", 
Name(), quote, 
layer_id.c_str(), quote,
 
  804        for( 
int i=0;  i<3;  ++i )
 
  807        out->
Print( 0, 
")%s", newline );
 
 
  820        vertex[0].FixNegativeZero();
 
 
  828        vertex[1].FixNegativeZero();
 
 
  836        vertex[2].FixNegativeZero();
 
 
 
  853        ELEM( aType, aParent )
 
 
  870            wxASSERT( aShape->
Type()==T_rect
 
  871                        || aShape->
Type()==T_circle
 
  872                        || aShape->
Type()==T_qarc
 
  873                        || aShape->
Type()==T_path
 
  874                        || aShape->
Type()==T_polygon);
 
 
  885            shape->Format( out, 0 );
 
  887        out->
Print( 0, 
")\n" );
 
 
 
  919        ELEM( aType, aParent )
 
 
  942            wxASSERT( aShape->
Type()==T_rect
 
  943                            || aShape->
Type()==T_circle
 
  944                            || aShape->
Type()==T_qarc
 
  945                            || aShape->
Type()==T_path
 
  946                            || aShape->
Type()==T_polygon);
 
 
  960        const char* newline = 
"\n";
 
  967            out->
Print( 0, 
" %s%s%s", quote, 
m_name.c_str(), quote );
 
  973            out->
Print( 0, 
" \"\"" );   
 
  982            out->
Print( 0, 
" " );
 
  988            out->
Print( 0, 
"%s", newline );
 
  990            m_rules->Format( out, nestLevel+1 );
 
  995            out->
Print( 0, 
"%s", newline );
 
 1002            out->
Print( 0, 
"%s", newline );
 
 1006                i->Format( out, nestLevel+1 );
 
 1008            out->
Print( nestLevel, 
")\n" );
 
 1012            out->
Print( 0, 
")\n" );
 
 
 
 1048        ELEM( T_via, aParent )
 
 
 1059        const int RIGHTMARGIN = 80;
 
 1060        int perLine = out->
Print( nestLevel, 
"(%s", 
Name() );
 
 1064            if( perLine > RIGHTMARGIN )
 
 1066                out->
Print( 0, 
"\n" );
 
 1067                perLine = out->
Print( nestLevel+1, 
"%s", 
"");
 
 1071            perLine += out->
Print( 0, 
" %s%s%s", quote, i->c_str(), quote );
 
 1076            out->
Print( 0, 
"\n" );
 
 1078            perLine = out->
Print( nestLevel+1, 
"(spare" );
 
 1082                if( perLine > RIGHTMARGIN )
 
 1084                    out->
Print( 0, 
"\n" );
 
 1085                    perLine = out->
Print( nestLevel+2, 
"%s", 
"");
 
 1089                perLine += out->
Print( 0, 
" %s%s%s", quote, i->c_str(), quote );
 
 1092            out->
Print( 0, 
")" );
 
 1095        out->
Print( 0, 
")\n" );
 
 
 
 1110        ELEM( T_classes, aParent )
 
 
 1119            out->
Print( nestLevel, 
"%s%s%s\n", quote, i->c_str(), quote );
 
 
 
 1152            classes->Format( out, nestLevel );
 
 
 
 1183        out->
Print( nestLevel, 
"(%s\n", 
Name() );
 
 1185        out->
Print( nestLevel+1, 
"(via_at_smd %s", 
via_at_smd ? 
"on" : 
"off" );
 
 1190        out->
Print( 0, 
")\n" );
 
 1192        for( 
int i = 0; i < 
Length(); ++i )
 
 1195        out->
Print( nestLevel, 
")\n" );
 
 
 
 1210        ELEM( T_layer, aParent )
 
 
 1229        out->
Print( nestLevel, 
"(%s %s%s%s\n", 
Name(), quote, 
name.c_str(), quote );
 
 1235            out->
Print( nestLevel+1, 
"(property\n" );
 
 1239                i->Format( out, nestLevel+2 );
 
 1241            out->
Print( nestLevel+1, 
")\n" );
 
 1248            rules->Format( out, nestLevel+1 );
 
 1254                out->
Print( nestLevel+1, 
"(cost %d", -
cost );
 
 1261            out->
Print( 0, 
")\n" );
 
 1266            out->
Print( nestLevel+1, 
"(use_net" );
 
 1268            for( STRINGS::const_iterator i = 
use_net.begin(); i != 
use_net.end(); ++i )
 
 1271                out->
Print( 0, 
" %s%s%s",  quote, i->c_str(), quote );
 
 1274            out->
Print( 0, 
")\n" );
 
 1277        out->
Print( nestLevel, 
")\n" );
 
 
 
 1303        ELEM( T_layer_pair, aParent )
 
 
 1313        out->
Print( nestLevel, 
"(%s %s%s%s %s%s%s %.6g)\n", 
Name(), quote0, 
layer_id0.c_str(),
 
 
 
 1338        ELEM( T_layer_noise_weight, aParent )
 
 
 1344        out->
Print( nestLevel, 
"(%s\n", 
Name() );
 
 1347            i->Format( out, nestLevel+1 );
 
 1349        out->
Print( nestLevel, 
")\n" );
 
 
 
 1380        ELEM( aType, aParent )
 
 
 
 1407        ELEM( aType, aParent )
 
 
 1415        out->
Print( nestLevel, 
"(%s %s%s%s)\n",
 
 1417                               quote, 
value.c_str(), quote );
 
 
 
 1462            m_rules->Format( out, nestLevel );
 
 
 
 1487        ELEM( T_grid, aParent )
 
 
 1514        out->
Print( 0, 
")\n");
 
 
 
 1532        ELEM( T_structure_out, aParent )
 
 
 1545            i->Format( out, nestLevel );
 
 1548            m_rules->Format( out, nestLevel );
 
 
 
 1608            m_unit->Format( out, nestLevel );
 
 1611            i->Format( out, nestLevel );
 
 1623            i->Format( out, nestLevel );
 
 1626            i->Format( out, nestLevel );
 
 1629            i->Format( out, nestLevel );
 
 1632            m_via->Format( out, nestLevel );
 
 1637        for( 
int i=0; i<
Length();  ++i )
 
 1643            m_rules->Format( out, nestLevel );
 
 1649            i->Format( out, nestLevel );
 
 
 
 1696        ELEM( T_place, aParent )
 
 
 
 1776        ELEM( T_component, aParent )
 
 
 1799        out->
Print( nestLevel, 
")\n" );
 
 
 1805            i->Format( out, nestLevel );
 
 
 
 1824        ELEM( T_placement, aParent )
 
 
 1847            if( 0 == 
m_components[i].GetImageId().compare( imageName ) )
 
 
 1860            m_unit->Format( out, nestLevel );
 
 1864            out->
Print( nestLevel, 
"(place_control (flip_style %s))\n",
 
 1869            i->Format( out, nestLevel );
 
 
 
 1917        out->
Print( nestLevel, 
"(%s ", 
Name() );
 
 1920            shape->Format( out, 0 );
 
 1927            out->
Print( 0, 
"\n" );
 
 1930                i->Format( out, nestLevel+1 );
 
 1932            out->
Print( nestLevel, 
")\n" );
 
 1936            out->
Print( 0, 
")\n" );
 
 
 
 1962        ELEM( T_pin, aParent )
 
 
 1985            out->
Print( nestLevel, 
"(pin %s%s%s (rotate %.6g)", quote, 
m_padstack_id.c_str(), quote,
 
 
 
 2006typedef boost::ptr_vector<PIN>  
PINS;
 
 2050        const char* quote = out->
GetQuoteChar( imageId.c_str() );
 
 2052        out->
Print( nestLevel, 
"(%s %s%s%s", 
Name(), quote, imageId.c_str(), quote );
 
 2056        out->
Print( nestLevel, 
")\n" );
 
 
 2065        out->
Print( 0, 
"\n");
 
 2068            m_unit->Format( out, nestLevel );
 
 2073        for( PINS::iterator i=
m_pins.begin();  i!=
m_pins.end();  ++i )
 
 2074            i->Format( out, nestLevel );
 
 2077            m_rules->Format( out, nestLevel );
 
 2083            i->Format( out, nestLevel );
 
 
 
 2172        out->
Print( nestLevel, 
")\n" );
 
 
 2179            m_unit->Format( out, nestLevel );
 
 2184        out->
Print( nestLevel, 
"%s", 
"" );
 
 2190            out->
Print( 0, 
"(attach off)" );
 
 2196            out->
Print( 0, 
"(attach on (use_via %s%s%s))", quote, 
m_via_id.c_str(), quote );
 
 2205        out->
Print( 0, 
"\n" );
 
 2208            m_rules->Format( out, nestLevel );
 
 
 
 2260        ELEM( aType, aParent )
 
 
 2352        for( 
unsigned i = 0; i < 
m_vias.size(); ++i )
 
 
 2367        m_vias.push_back( aVia );
 
 
 2406        for( 
unsigned i = 0; i < 
m_padstacks.size(); ++i )
 
 
 2420            m_unit->Format( out, nestLevel );
 
 2423            i->Format( out, nestLevel );
 
 2426            i->Format( out, nestLevel );
 
 2428        for( PADSTACKS::iterator i = 
m_vias.begin(); i != 
m_vias.end(); ++i )
 
 2429            i->Format( out, nestLevel );
 
 
 
 2457        ELEM( T_pin, aParent )
 
 
 2471        const char* newline = nestLevel ? 
"\n" : 
"";
 
 2476        return out->
Print( nestLevel, 
"%s%s%s-%s%s%s%s", cquote, 
component_id.c_str(), cquote,
 
 2477                                      pquote, 
pin_id.c_str(), pquote, newline );
 
 
 
 2491        ELEM( T_fromto, aParent )
 
 
 2504        out->
Print( nestLevel, 
"(%s %s %s ",
 
 2513            out->
Print( 0, 
"(net %s%s%s)",  quote, 
m_net_id.c_str(), quote );
 
 2516        bool singleLine = 
true;
 
 2520            out->
Print( 0, 
"\n" );
 
 2525            m_rules->Format( out, nestLevel+1 );
 
 2533            i->Format( out, nestLevel+1 );
 
 2535        out->
Print( singleLine ? 0 : nestLevel, 
")" );
 
 2537        if( nestLevel || !singleLine )
 
 2538            out->
Print( 0, 
"\n" );
 
 
 
 2564        ELEM( T_comp_order, aParent )
 
 
 2575            out->
Print( 0, 
" %s%s%s", quote, i->c_str(), quote );
 
 2578        out->
Print( 0, 
")" );
 
 2581            out->
Print( 0, 
"\n" );
 
 
 
 2599        ELEM( T_net, aParent )
 
 
 2620        for( 
unsigned i = 0; i < 
m_pins.size(); ++i )
 
 2622            if( aComponent.compare( 
m_pins[i].component_id ) == 0 )
 
 
 2632        const char* space = 
" ";
 
 2638            out->
Print( 0, 
"%s(unassigned)", space );
 
 2648        out->
Print( 0, 
"\n" );
 
 2652            const int RIGHTMARGIN = 80;
 
 2655            for( PIN_REFS::iterator i = 
m_pins.begin(); i != 
m_pins.end(); ++i )
 
 2657                if( perLine > RIGHTMARGIN )
 
 2659                    out->
Print( 0, 
"\n");
 
 2660                    perLine = out->
Print( nestLevel+2, 
"%s", 
"" );
 
 2664                    perLine += out->
Print( 0, 
" " );
 
 2667                perLine += i->FormatIt( out, 0 );
 
 2670            out->
Print( 0, 
")\n" );
 
 2680            m_rules->Format( out, nestLevel+1 );
 
 2683            i->Format( out, nestLevel+1 );
 
 2686            i->Format( out, nestLevel+1 );
 
 2688        out->
Print( nestLevel, 
")\n" );
 
 
 
 2720typedef boost::ptr_vector<NET>  
NETS;
 
 2727        ELEM( T_topology, aParent )
 
 
 2734            i->Format( out, nestLevel );
 
 2737            i->Format( out, nestLevel );
 
 
 
 2756        ELEM( T_class, aParent )
 
 
 2772        int perLine = out->
Print( nestLevel, 
"(%s %s%s%s", 
Name(), quote, 
m_class_id.c_str(), quote );
 
 2774        const int RIGHTMARGIN = 72;
 
 2778            const char* space = 
" ";
 
 2780            if( perLine > RIGHTMARGIN )
 
 2782                out->
Print( 0, 
"\n" );
 
 2783                perLine = out->
Print( nestLevel+1, 
"%s", 
"" );
 
 2792            perLine += out->
Print( 0, 
"%s%s%s%s", space, quote, i->c_str(), quote );
 
 2795        bool newLine = 
false;
 
 2799            out->
Print( 0, 
"\n" );
 
 2805            out->
Print( nestLevel+1, 
"(circuit\n" );
 
 2808                out->
Print( nestLevel + 2, 
"%s\n", i->c_str() );
 
 2810            out->
Print( nestLevel+1, 
")\n" );
 
 2814            m_rules->Format( out, nestLevel+1 );
 
 2817            i->Format( out, nestLevel + 1 );
 
 2822        out->
Print( newLine ? nestLevel : 0, 
")\n" );
 
 
 
 2849        ELEM( T_network, aParent )
 
 
 2855        for( NETS::iterator i = 
m_nets.begin(); i != 
m_nets.end(); ++i )
 
 2856            i->Format( out, nestLevel );
 
 2859            i->Format( out, nestLevel );
 
 
 
 2876        ELEM( T_connect, aParent ) {}
 
 
 
 2887        ELEM( T_wire, aParent )
 
 
 2911            wxASSERT(aShape->
Type()==T_rect || aShape->
Type()==T_circle
 
 2912                     || aShape->
Type()==T_qarc || aShape->
Type()==T_path
 
 2913                     || aShape->
Type()==T_polygon);
 
 
 2921        out->
Print( nestLevel, 
"(%s ", 
Name() );
 
 2929            out->
Print( 0, 
"(net %s%s%s)", quote, 
m_net_id.c_str(), quote );
 
 2944            out->
Print( 0, 
"(shield %s%s%s)", quote, 
m_shield.c_str(), quote );
 
 2949            out->
Print( 0, 
"\n" );
 
 2952                i->Format( out, nestLevel + 1 );
 
 2959            out->
Print( 0, 
"(supply)" );
 
 2961        out->
Print( 0, 
")\n" );
 
 
 
 2996        ELEM( T_via, aParent )
 
 
 3013        const int RIGHTMARGIN = 80;
 
 3019            if( perLine > RIGHTMARGIN )
 
 3021                out->
Print( 0, 
"\n" );
 
 3022                perLine = out->
Print( nestLevel+1, 
"%s", 
"" );
 
 3026                perLine += out->
Print( 0, 
"  " );
 
 3029            perLine += out->
Print( 0, 
"%.6g %.6g", i->x, i->y );
 
 3033            out->
Print( 0, 
" " );
 
 3037            if( perLine > RIGHTMARGIN )
 
 3039                out->
Print( 0, 
"\n" );
 
 3040                perLine = out->
Print( nestLevel+1, 
"%s", 
"" );
 
 3044            perLine += out->
Print( 0, 
"(net %s%s%s)", quote, 
m_net_id.c_str(), quote );
 
 3049            if( perLine > RIGHTMARGIN )
 
 3051                out->
Print( 0, 
"\n" );
 
 3052                perLine = out->
Print( nestLevel+1, 
"%s", 
"" );
 
 3060            if( perLine > RIGHTMARGIN )
 
 3062                out->
Print( 0, 
"\n" );
 
 3063                perLine = out->
Print( nestLevel+1, 
"%s", 
"" );
 
 3071            if( perLine > RIGHTMARGIN )
 
 3073                out->
Print( 0, 
"\n" );
 
 3074                perLine = out->
Print( nestLevel+1, 
"%s", 
"" );
 
 3077            if( 
m_attr == T_virtual_pin )
 
 3080                perLine += out->
Print( 0, 
"(attr virtual_pin %s%s%s)", quote,
 
 3091            if( perLine > RIGHTMARGIN )
 
 3093                out->
Print( 0, 
"\n" );
 
 3094                perLine = out->
Print( nestLevel+1, 
"%s", 
"" );
 
 3097            perLine += out->
Print( 0, 
"(supply)" );
 
 3102            out->
Print( 0, 
"\n" );
 
 3103            out->
Print( nestLevel+1, 
"(contact\n" );
 
 3108                out->
Print( nestLevel+2, 
"%s%s%s\n", quote, i->c_str(), quote );
 
 3111            out->
Print( nestLevel+1, 
"))\n" );
 
 3115            out->
Print( 0, 
")\n" );
 
 
 
 3143        ELEM( T_wiring, aParent )
 
 
 3156            unit->Format( out, nestLevel );
 
 3158        for( WIRES::iterator i = 
wires.begin(); i != 
wires.end(); ++i )
 
 3159            i->Format( out, nestLevel );
 
 3162            i->Format( out, nestLevel );
 
 
 
 3186        ELEM( T_pcb, aParent )
 
 
 3217            m_parser->Format( out, nestLevel+1 );
 
 3223            m_unit->Format( out, nestLevel+1 );
 
 3238            m_wiring->Format( out, nestLevel+1 );
 
 3240        out->
Print( nestLevel, 
")\n" );
 
 
 
 3273        ELEM( T_ancestor, aParent )
 
 
 3284        strftime( temp, 
sizeof(temp), 
"%b %d %H : %M : %S %Y", tmp );
 
 3288        out->
Print( nestLevel, 
"(%s \"%s\" (created_time %s)\n", 
Name(), 
filename.c_str(), temp );
 
 3293            out->
Print( nestLevel+1, 
"(comment %s%s%s)\n", quote, 
comment.c_str(), quote );
 
 3296        out->
Print( nestLevel, 
")\n" );
 
 
 
 3314        ELEM( T_history, aParent )
 
 
 3322            i->Format( out, nestLevel );
 
 3328        strftime( temp, 
sizeof( temp ), 
"%b %d %H : %M : %S %Y", tmp );
 
 3331        out->
Print( nestLevel, 
"(self (created_time %s)\n", temp );
 
 3336            out->
Print( nestLevel+1, 
"(comment %s%s%s)\n", quote, i->c_str(), quote );
 
 3339        out->
Print( nestLevel, 
")\n" );
 
 
 
 3358        ELEM( T_supply_pin, aParent )
 
 
 3364        bool singleLine = 
pin_refs.size() <= 1;
 
 3369            out->
Print( 0, 
"%s", 
" " );
 
 3370            pin_refs.begin()->Format( out, 0 );
 
 3375                i->FormatIt( out, nestLevel + 1 );
 
 3380            const char* newline = singleLine ? 
"" : 
"\n";
 
 3383            out->
Print( singleLine ? 0 : nestLevel+1, 
" (net %s%s%s)%s",
 
 3384                        quote, 
net_id.c_str(), quote, newline );
 
 3387        out->
Print( singleLine ? 0 : nestLevel, 
")\n");
 
 
 
 3407        ELEM( T_net_out, aParent )
 
 
 3423        out->
Print( nestLevel, 
"(net %s%s%s\n", quote, 
net_id.c_str(), quote );
 
 3429            rules->Format( out, nestLevel+1 );
 
 3431        for( WIRES::iterator i = 
wires.begin(); i != 
wires.end(); ++i )
 
 3432            i->Format( out, nestLevel + 1 );
 
 3435            i->Format( out, nestLevel + 1 );
 
 3438            i->Format( out, nestLevel + 1 );
 
 3440        out->
Print( nestLevel, 
")\n" );
 
 
 
 3461        ELEM( T_route, aParent )
 
 
 3492            parser->Format( out, nestLevel );
 
 3498            library->Format( out, nestLevel );
 
 3502            out->
Print( nestLevel, 
"(network_out\n" );
 
 3505                i->Format( out, nestLevel + 1 );
 
 3507            out->
Print( nestLevel, 
")\n" );
 
 
 
 3552        ELEM( T_was_is, aParent )
 
 
 3560            out->
Print( nestLevel, 
"(pins " );
 
 3561            i->was.Format( out, 0 );
 
 3562            out->
Print( 0, 
" " );
 
 3563            i->is.Format( out, 0 );
 
 3564            out->
Print( 0, 
")\n" );
 
 
 
 3582        ELEM( T_session, aParent )
 
 
 3608            history->Format( out, nestLevel+1 );
 
 3617            was_is->Format( out, nestLevel+1 );
 
 3620            route->Format( out, nestLevel+1 );
 
 3622        out->
Print( nestLevel, 
")\n" );
 
 
 
 3659        wxASSERT( !iOwnReaders );
 
 3666        SetSpecctraMode( 
true );
 
 
 3719    void LoadPCB( 
const wxString& aFilename );
 
 3741    void ExportPCB( 
const wxString& aFilename,  
bool aNameChange=
false );
 
 3824    void readCOMPnPIN( std::string* component_id, std::string* pid_id );
 
 3837    void readTIME( time_t* time_stamp );
 
 3935                       int aTopLayer, 
int aBotLayer );
 
 3950        for( 
unsigned n = 0; n < 
m_nets.size(); ++n )
 
 
 3980                      int aViaDrillDefault );
 
 
Information pertinent to a Pcbnew printed circuit board.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
BOUNDARY(ELEM *aParent, DSN_T aType=T_boundary)
 
void GetCorners(std::vector< double > &aBuffer)
GetCorners fills aBuffer with a list of coordinates (x,y) of corners.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void SetLayerId(const std::string &aLayerId)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void SetVertex(const POINT &aVertex)
 
void SetDiameter(double aDiameter)
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
CLASS_CLASS(ELEM *aParent, DSN_T aType)
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
The <class_descriptor> in the specctra spec.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
STRINGS m_circuit
circuit descriptor list
 
LAYER_RULES m_layer_rules
 
Implement a <component_descriptor> in the specctra dsn spec.
 
const std::string & GetImageId() const
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void SetImageId(const std::string &aImageId)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Compare two objects of this type and returns <0, 0, or >0.
 
The <component_order_descriptor>.
 
COMP_ORDER(ELEM *aParent)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
COPPER_PLANE(ELEM *aParent)
 
int FindElem(DSN_T aType, int instanceNum=0)
Find a particular instance number of a given type of ELEM.
 
ELEM_HOLDER(DSN_T aType, ELEM *aParent=nullptr)
 
ELEM * operator[](int aIndex) const
 
virtual void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
ELEM * Replace(int aIndex, ELEM *aElem)
 
void Insert(int aIndex, ELEM *aElem)
 
ELEM_ARRAY kids
ELEM pointers.
 
ELEM * Remove(int aIndex)
 
ELEM * At(int aIndex) const
 
boost::ptr_vector< ELEM > ELEM_ARRAY
 
int Length() const
Return the number of ELEMs in this holder.
 
A base class for any DSN element class.
 
std::string makeHash()
Return a string which uniquely represents this ELEM among other ELEMs of the same derived class as "t...
 
const char * Name() const
 
virtual void Format(OUTPUTFORMATTER *out, int nestLevel)
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
ELEM(DSN_T aType, ELEM *aParent=nullptr)
 
void SetParent(ELEM *aParent)
 
virtual UNIT_RES * GetUnits() const
Return the units for this section.
 
virtual void FormatContents(OUTPUTFORMATTER *out, int nestLevel)
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
static STRING_FORMATTER sf
 
LAYER_RULES m_layer_rules
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
DSN_T m_grid_type
T_via | T_wire | T_via_keepout | T_place | T_snap.
 
DSN_T m_direction
T_x | T_y | -1 for both.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
std::string m_hash
a hash string used by Compare(), not Format()ed/exported.
 
static int Compare(IMAGE *lhs, IMAGE *rhs)
Compare two objects of this type and returns <0, 0, or >0.
 
UNIT_RES * GetUnits() const override
Return the units for this section.
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
int m_duplicated
no. times this image_id is duplicated
 
Used for <keepout_descriptor> and <plane_descriptor>.
 
void AddWindow(WINDOW *aWindow)
 
KEEPOUT(ELEM *aParent, DSN_T aType)
Require a DSN_T because this class is used for T_place_keepout, T_via_keepout, T_wire_keepout,...
 
void SetShape(ELEM *aShape)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
LAYER_NOISE_WEIGHT(ELEM *aParent)
 
SPECCTRA_LAYER_PAIRS layer_pairs
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
LAYER_RULE(ELEM *aParent)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
DSN_T layer_type
one of: T_signal, T_power, T_mixed, T_jumper
 
int cost_type
T_length | T_way.
 
int direction
[forbidden | high | medium | low | free | <positive_integer> | -1]
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
A <library_descriptor> in the specctra dsn specification.
 
PADSTACK * LookupVia(PADSTACK *aVia)
Add the via only if one exactly like it does not already exist in the padstack container.
 
PADSTACK * FindPADSTACK(const std::string &aPadstackId)
Search the padstack container by name.
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void AppendVia(PADSTACK *aVia)
Add aVia to the internal via container.
 
int FindIMAGE(IMAGE *aImage)
Search this LIBRARY for an image which matches the argument.
 
PADSTACKS m_padstacks
all except vias, which are in 'vias'
 
UNIT_RES * GetUnits() const override
Return the units for this section.
 
IMAGE * LookupIMAGE(IMAGE *aImage)
Add the image only if one exactly like it does not already exist in the image container.
 
void AppendPADSTACK(PADSTACK *aPadstack)
Add the padstack to the padstack container.
 
LIBRARY(ELEM *aParent, DSN_T aType=T_library)
 
void AddPadstack(PADSTACK *aPadstack)
 
void AppendIMAGE(IMAGE *aImage)
Add the image to the image list.
 
int FindVia(PADSTACK *aVia)
Search this LIBRARY for a via which matches the argument.
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
A <net_out_descriptor> of the specctra dsn spec.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
A <net_descriptor> in the DSN spec.
 
int FindPIN_REF(const std::string &aComponent)
 
LAYER_RULES m_layer_rules
 
DSN_T m_type
T_fix | T_normal.
 
DSN_T m_supply
T_power | T_ground.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
COMP_ORDER * m_comp_order
 
DSN_T m_pins_type
T_pins | T_order, type of field 'pins' below.
 
Hold either a via or a pad definition.
 
const std::string & GetPadstackId()
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
std::string m_hash
a hash string used by Compare(), not Format()ed/exported.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
PADSTACK()
Cannot take ELEM* aParent because PADSTACKSET confuses this with a copy constructor and causes havoc.
 
std::string m_padstack_id
 
void SetPadstackId(const char *aPadstackId)
 
static int Compare(PADSTACK *lhs, PADSTACK *rhs)
Compare two objects of this type and returns <0, 0, or >0.
 
UNIT_RES * GetUnits() const override
Return the units for this section.
 
A configuration record per the SPECCTRA DSN file spec.
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
bool routes_include_image_conductor
 
bool routes_include_guides
 
bool wires_include_testpoint
 
STRINGS constants
This holds pairs of strings, one pair for each constant definition.
 
bool routes_include_testpoint
 
bool generated_by_freeroute
 
bool space_in_quoted_tokens
 
Support both the <path_descriptor> and the <polygon_descriptor> per the specctra dsn spec.
 
PATH(ELEM *aParent, DSN_T aType=T_path)
 
void SetLayerId(const std::string &aLayerId)
 
void SetAperture(double aWidth)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void AppendPoint(const POINT &aPoint)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
PCB(ELEM *aParent=nullptr)
 
UNIT_RES * GetUnits() const override
Return the units for this section.
 
void SetVertex(const POINT &aPoint)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
int m_kiNetCode
KiCad netcode.
 
void SetRotation(double aRotation)
 
std::string m_padstack_id
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
UNIT_RES * GetUnits() const override
Return the units for this section.
 
COMPONENT * LookupCOMPONENT(const std::string &imageName)
Look up a COMPONENT by name.
 
Implement a <placement_reference> in the specctra dsn spec.
 
void SetVertex(const POINT &aVertex)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void SetRotation(double aRotation)
 
std::string m_logical_part
 
std::string m_part_number
 
std::string m_component_id
reference designator
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void SetStart(const POINT &aStart)
 
void SetLayerId(std::string &aLayerId)
 
void SetCenter(const POINT &aCenter)
 
void SetEnd(const POINT &aEnd)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void SetLayerId(std::string &aLayerId)
 
void SetCorners(const POINT &aPoint0, const POINT &aPoint1)
 
POINT point0
one of two opposite corners
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
STRUCTURE_OUT * structure_out
 
UNIT_RES * GetUnits() const override
Return the units for this section.
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
A <rule_descriptor> in the specctra dsn spec.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
RULE(ELEM *aParent, DSN_T aType)
 
STRINGS m_rules
rules are saved in std::string form.
 
A <session_file_descriptor> in the specctra dsn spec.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
SESSION(ELEM *aParent=nullptr)
 
A "(shape ..)" element in the specctra dsn spec.
 
SHAPE(ELEM *aParent, DSN_T aType=T_shape)
Takes a DSN_T aType of T_outline.
 
void SetConnect(DSN_T aConnect)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
PADSTACK * makeVia(const ::PCB_VIA *aVia)
Make any kind of PADSTACK using the given KiCad VIA.
 
void doUNIT(UNIT_RES *growth)
 
int m_top_via_layer
specctra cu layers, 0 based index:
 
void doCOMPONENT(COMPONENT *growth)
 
IMAGE * makeIMAGE(BOARD *aBoard, FOOTPRINT *aFootprint)
Allocates an I#MAGE on the heap and creates all the PINs according to the PADs in the FOOTPRINT.
 
void doWAS_IS(WAS_IS *growth)
 
void doPLACEMENT(PLACEMENT *growth)
 
void doNET_OUT(NET_OUT *growth)
 
void buildLayerMaps(BOARD *aBoard)
Create a few data translation structures for layer name and number mapping between the DSN::PCB struc...
 
PCB_TRACK * makeTRACK(WIRE *wire, PATH *aPath, int aPointIndex, int aNetcode)
Create a TRACK form the PATH and BOARD info.
 
void doCLASS(CLASS *growth)
 
void SetSESSION(SESSION *aSession)
Delete any existing SESSION and replaces it with the given one.
 
void doSTRUCTURE_OUT(STRUCTURE_OUT *growth)
 
std::map< int, PCB_LAYER_ID > m_pcbLayer2kicad
maps PCB layer number to BOARD layer numbers
 
void doCIRCLE(CIRCLE *growth)
 
void doANCESTOR(ANCESTOR *growth)
 
void doLAYER_NOISE_WEIGHT(LAYER_NOISE_WEIGHT *growth)
 
void ExportPCB(const wxString &aFilename, bool aNameChange=false)
Write the internal PCB instance out as a SPECTRA DSN format file.
 
void doCLASS_CLASS(CLASS_CLASS *growth)
 
void doSESSION(SESSION *growth)
 
void doWINDOW(WINDOW *growth)
 
UNIT_RES * m_routeResolution
used during FromSESSION() only, memory for it is not owned here.
 
SHAPE_POLY_SET m_brd_outlines
 
void doSHAPE(SHAPE *growth)
 
BOARD * m_sessionBoard
a copy to avoid passing as an argument, memory for it is not owned here.
 
void FlipFOOTPRINTs(BOARD *aBoard)
Flip the footprints which are on the back side of the board to the front.
 
void doQARC(QARC *growth)
 
void doRESOLUTION(UNIT_RES *growth)
 
void LoadPCB(const wxString &aFilename)
A recursive descent parser for a SPECCTRA DSN "design" file.
 
void doSTRINGPROP(STRINGPROP *growth)
 
STRINGS m_layerIds
indexed by PCB layer number
 
void doBOUNDARY(BOUNDARY *growth)
 
void doSPECCTRA_LAYER_PAIR(SPECCTRA_LAYER_PAIR *growth)
 
bool m_footprintsAreFlipped
 
void doRECTANGLE(RECTANGLE *growth)
 
void deleteNETs()
Delete all the NETs that may be in here.
 
void doREGION(REGION *growth)
 
void fillBOUNDARY(BOARD *aBoard, BOUNDARY *aBoundary)
Make the board perimeter for the DSN file by filling the BOUNDARY element in the specctra element tre...
 
void ExportSESSION(const wxString &aFilename)
Write the internal SESSION instance out as a #SPECTRA DSN format file.
 
void doWIRE(WIRE *growth)
 
static const KICAD_T scanPADs[]
 
PADSTACK * makePADSTACK(BOARD *aBoard, PAD *aPad)
Create a PADSTACK which matches the given pad.
 
void SetPCB(PCB *aPcb)
Delete any existing PCB and replaces it with the given one.
 
void doTOKPROP(TOKPROP *growth)
 
void doIMAGE(IMAGE *growth)
 
void doCONNECT(CONNECT *growth)
 
void doCOMP_ORDER(COMP_ORDER *growth)
 
static PCB * MakePCB()
Make a PCB with all the default ELEMs and parts on the heap.
 
void doTOPOLOGY(TOPOLOGY *growth)
 
void doKEEPOUT(KEEPOUT *growth)
 
void doRULE(RULE *growth)
 
void doPATH(PATH *growth)
 
void doSUPPLY_PIN(SUPPLY_PIN *growth)
 
void doLAYER(LAYER *growth)
 
bool BuiltBoardOutlines(BOARD *aBoard)
Build the board outlines and store it in m_brd_outlines.
 
void LoadSESSION(const wxString &aFilename)
A recursive descent parser for a SPECCTRA DSN "session" file.
 
void doLIBRARY(LIBRARY *growth)
 
void exportNETCLASS(const NETCLASS *aNetClass, const BOARD *aBoard)
Export aNetClass to the DSN file.
 
PADSTACK * makeVia(int aCopperDiameter, int aDrillDiameter, int aTopLayer, int aBotLayer)
Make a round through hole PADSTACK using the given KiCad diameter in deci-mils.
 
std::map< PCB_LAYER_ID, int > m_kicadLayer2pcb
maps BOARD layer number to PCB layer numbers
 
std::vector< NET * > m_nets
we don't want ownership here permanently, so we don't use boost::ptr_vector
 
void doFROMTO(FROMTO *growth)
 
void doPLACE(PLACE *growth)
 
PADSTACKSET m_padstackset
 
void doGRID(GRID *growth)
 
void doLAYER_RULE(LAYER_RULE *growth)
 
void FromSESSION(BOARD *aBoard)
Add the entire SESSION info to a BOARD but does not write it out.
 
void doWIRE_VIA(WIRE_VIA *growth)
 
void doCLASSES(CLASSES *growth)
 
void readCOMPnPIN(std::string *component_id, std::string *pid_id)
Read a <pin_reference> and splits it into the two parts which are on either side of the hyphen.
 
PCB_VIA * makeVIA(WIRE_VIA *aVia, PADSTACK *aPadstack, const POINT &aPoint, int aNetCode, int aViaDrillDefault)
Instantiate a KiCad VIA on the heap and initializes it with internal values consistent with the given...
 
PCB_ARC * makeARC(WIRE *wire, QARC *aQarc, int aNetcode)
Create an ARC form the PATH and BOARD info.
 
void FromBOARD(BOARD *aBoard)
Add the entire BOARD to the PCB but does not write it out.
 
void doPARSER(PARSER *growth)
 
void doNETWORK(NETWORK *growth)
 
void RevertFOOTPRINTs(BOARD *aBoard)
Flip the footprints which were on the back side of the board back to the back.
 
void doSTRUCTURE(STRUCTURE *growth)
 
int findLayerName(const std::string &aLayerName) const
Return the PCB layer index for a given layer name, within the specctra sessionfile.
 
void doROUTE(ROUTE *growth)
 
void readTIME(time_t *time_stamp)
Read a <time_stamp> which consists of 8 lexer tokens: "month date hour : minute : second year".
 
void doPADSTACK(PADSTACK *growth)
 
void doWIRING(WIRING *growth)
 
static const KEYWORD keywords[]
specctra DSN keywords
 
void doHISTORY(HISTORY *growth)
 
void doCONTROL(CONTROL *growth)
 
void doPROPERTIES(PROPERTIES *growth)
 
SPECCTRA_LAYER_PAIR(ELEM *aParent)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
A container for a single property whose value is a string.
 
STRINGPROP(ELEM *aParent, DSN_T aType)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
STRUCTURE_OUT(ELEM *aParent)
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
UNIT_RES * GetUnits() const override
Return the units for this section.
 
boost::ptr_vector< GRID > GRIDS
 
LAYER_NOISE_WEIGHT * m_layer_noise_weight
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void SetBOUNDARY(BOUNDARY *aBoundary)
 
BOUNDARY * m_place_boundary
 
void SetPlaceBOUNDARY(BOUNDARY *aBoundary)
 
boost::ptr_vector< REGION > REGIONS
 
A <supply_pin_descriptor> in the specctra dsn spec.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
SUPPLY_PIN(ELEM *aParent)
 
A container for a single property whose value is another DSN_T token.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
TOKPROP(ELEM *aParent, DSN_T aType)
 
COMP_ORDERS m_comp_orders
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
A holder for either a T_unit or T_resolution object which are usually mutually exclusive in the dsn g...
 
UNIT_RES(ELEM *aParent, DSN_T aType)
 
static UNIT_RES Default
A static instance which holds the default units of T_inch and 2540000.
 
DSN_T GetEngUnits() const
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
A <via_descriptor> in the specctra dsn spec.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void AppendVia(const char *aViaName)
 
A <was_is_descriptor> in the specctra dsn spec.
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
WINDOW(ELEM *aParent, DSN_T aType=T_window)
 
void SetShape(ELEM *aShape)
 
A <wire_via_descriptor> in the specctra dsn spec.
 
std::string m_padstack_id
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
std::string m_virtual_pin_name
 
const std::string & GetPadstackId()
 
A <wire_shape_descriptor> in the specctra dsn spec.
 
void SetShape(ELEM *aShape)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
A <wiring_descriptor> in the specctra dsn spec.
 
void FormatContents(OUTPUTFORMATTER *out, int nestLevel) override
Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
UNIT_RES * GetUnits() const override
Return the units for this section.
 
A collection of nets and the parameters used to route or test these nets.
 
Represent a set of closed polygons.
 
This source file implements export and import capabilities to the specctra dsn file format.
 
boost::ptr_vector< KEEPOUT > KEEPOUTS
 
std::vector< std::string > STRINGS
 
boost::ptr_vector< NET_OUT > NET_OUTS
 
boost::ptr_vector< PATH > PATHS
 
boost::ptr_vector< WINDOW > WINDOWS
 
boost::ptr_vector< CLASS > CLASSLIST
 
std::vector< PIN_REF > PIN_REFS
 
boost::ptr_vector< PIN > PINS
 
boost::ptr_vector< COMP_ORDER > COMP_ORDERS
 
std::vector< PIN_PAIR > PIN_PAIRS
 
bool operator<(const PADSTACK &lhs, const PADSTACK &rhs)
Used by the PADSTACKSET boost::ptr_set below.
 
const char * GetTokenText(T aTok)
The DSN namespace and returns the C string representing a SPECCTRA_DB::keyword.
 
boost::ptr_vector< WIRE > WIRES
 
boost::ptr_vector< SUPPLY_PIN > SUPPLY_PINS
 
std::vector< PROPERTY > PROPERTIES
 
boost::ptr_vector< PADSTACK > PADSTACKS
 
std::vector< POINT > POINTS
 
void ExportBoardToSpecctraFile(BOARD *aBoard, const wxString &aFullFilename)
Helper method to export board to DSN file.
 
boost::ptr_vector< PLACE > PLACES
 
boost::ptr_vector< IMAGE > IMAGES
 
boost::ptr_vector< LAYER > LAYERS
 
boost::ptr_vector< FROMTO > FROMTOS
 
boost::ptr_vector< ANCESTOR > ANCESTORS
 
boost::ptr_vector< WIRE_VIA > WIRE_VIAS
 
boost::ptr_vector< COPPER_PLANE > COPPER_PLANES
 
boost::ptr_vector< SPECCTRA_LAYER_PAIR > SPECCTRA_LAYER_PAIRS
 
boost::ptr_vector< COMPONENT > COMPONENTS
 
bool ImportSpecctraSession(BOARD *aBoard, const wxString &fullFileName)
Helper method to import SES file to a board.
 
boost::ptr_vector< NET > NETS
 
boost::ptr_vector< LAYER_RULE > LAYER_RULES
 
boost::ptr_set< PADSTACK > PADSTACKSET
 
PIN_PAIR(ELEM *aParent=nullptr)
 
A <pin_reference> definition in the specctra dsn spec.
 
int FormatIt(OUTPUTFORMATTER *out, int nestLevel)
Like Format() but is not virtual.
 
A point in the SPECCTRA DSN coordinate system.
 
POINT & operator=(const POINT &other)
 
void FixNegativeZero()
Change negative zero to positive zero in the IEEE floating point storage format.
 
bool operator!=(const POINT &other) const
 
bool operator==(const POINT &other) const
 
void Format(OUTPUTFORMATTER *out, int nestLevel) const
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
POINT(double aX, double aY)
 
POINT & operator+=(const POINT &other)
 
void Format(OUTPUTFORMATTER *out, int nestLevel) const
Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
Hold a keyword string and its unique integer token.
 
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.