KiCad PCB EDA Suite
|
A DSN data tree, usually coming from a DSN file. More...
#include <specctra.h>
Public Member Functions | |
SPECCTRA_DB () | |
virtual | ~SPECCTRA_DB () |
void | SetPCB (PCB *aPcb) |
Delete any existing PCB and replaces it with the given one. More... | |
PCB * | GetPCB () |
void | SetSESSION (SESSION *aSession) |
Delete any existing SESSION and replaces it with the given one. More... | |
SESSION * | GetSESSION () |
void | LoadPCB (const wxString &aFilename) |
A recursive descent parser for a SPECCTRA DSN "design" file. More... | |
void | LoadSESSION (const wxString &aFilename) |
A recursive descent parser for a SPECCTRA DSN "session" file. More... | |
void | ExportPCB (const wxString &aFilename, bool aNameChange=false) |
Write the internal PCB instance out as a SPECTRA DSN format file. More... | |
void | FromBOARD (BOARD *aBoard) |
Add the entire BOARD to the PCB but does not write it out. More... | |
void | FromSESSION (BOARD *aBoard) |
Add the entire #SESSION info to a BOARD but does not write it out. More... | |
void | ExportSESSION (const wxString &aFilename) |
Write the internal #SESSION instance out as a #SPECTRA DSN format file. More... | |
bool | BuiltBoardOutlines (BOARD *aBoard) |
Build the board outlines and store it in m_brd_outlines. More... | |
void | FlipFOOTPRINTs (BOARD *aBoard) |
Flip the footprints which are on the back side of the board to the front. More... | |
void | RevertFOOTPRINTs (BOARD *aBoard) |
Flip the footprints which were on the back side of the board back to the back. More... | |
Static Public Member Functions | |
static PCB * | MakePCB () |
Make a PCB with all the default ELEMs and parts on the heap. More... | |
Private Member Functions | |
void | buildLayerMaps (BOARD *aBoard) |
Create a few data translation structures for layer name and number mapping between the DSN::PCB structure and the KiCad BOARD structure. More... | |
int | findLayerName (const std::string &aLayerName) const |
Return the PCB layer index for a given layer name, within the specctra sessionfile. More... | |
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. More... | |
void | readTIME (time_t *time_stamp) |
Read a <time_stamp> which consists of 8 lexer tokens: "month date hour : minute : second year". More... | |
void | doPCB (PCB *growth) |
void | doPARSER (PARSER *growth) |
void | doRESOLUTION (UNIT_RES *growth) |
void | doUNIT (UNIT_RES *growth) |
void | doSTRUCTURE (STRUCTURE *growth) |
void | doSTRUCTURE_OUT (STRUCTURE_OUT *growth) |
void | doLAYER_NOISE_WEIGHT (LAYER_NOISE_WEIGHT *growth) |
void | doSPECCTRA_LAYER_PAIR (SPECCTRA_LAYER_PAIR *growth) |
void | doBOUNDARY (BOUNDARY *growth) |
void | doRECTANGLE (RECTANGLE *growth) |
void | doPATH (PATH *growth) |
void | doSTRINGPROP (STRINGPROP *growth) |
void | doTOKPROP (TOKPROP *growth) |
void | doVIA (VIA *growth) |
void | doCONTROL (CONTROL *growth) |
void | doLAYER (LAYER *growth) |
void | doRULE (RULE *growth) |
void | doKEEPOUT (KEEPOUT *growth) |
void | doCIRCLE (CIRCLE *growth) |
void | doQARC (QARC *growth) |
void | doWINDOW (WINDOW *growth) |
void | doCONNECT (CONNECT *growth) |
void | doREGION (REGION *growth) |
void | doCLASS_CLASS (CLASS_CLASS *growth) |
void | doLAYER_RULE (LAYER_RULE *growth) |
void | doCLASSES (CLASSES *growth) |
void | doGRID (GRID *growth) |
void | doPLACE (PLACE *growth) |
void | doCOMPONENT (COMPONENT *growth) |
void | doPLACEMENT (PLACEMENT *growth) |
void | doPROPERTIES (PROPERTIES *growth) |
void | doPADSTACK (PADSTACK *growth) |
void | doSHAPE (SHAPE *growth) |
void | doIMAGE (IMAGE *growth) |
void | doLIBRARY (LIBRARY *growth) |
void | doPIN (PIN *growth) |
void | doNET (NET *growth) |
void | doNETWORK (NETWORK *growth) |
void | doCLASS (CLASS *growth) |
void | doTOPOLOGY (TOPOLOGY *growth) |
void | doFROMTO (FROMTO *growth) |
void | doCOMP_ORDER (COMP_ORDER *growth) |
void | doWIRE (WIRE *growth) |
void | doWIRE_VIA (WIRE_VIA *growth) |
void | doWIRING (WIRING *growth) |
void | doSESSION (SESSION *growth) |
void | doANCESTOR (ANCESTOR *growth) |
void | doHISTORY (HISTORY *growth) |
void | doROUTE (ROUTE *growth) |
void | doWAS_IS (WAS_IS *growth) |
void | doNET_OUT (NET_OUT *growth) |
void | doSUPPLY_PIN (SUPPLY_PIN *growth) |
void | fillBOUNDARY (BOARD *aBoard, BOUNDARY *aBoundary) |
Make the board perimeter for the DSN file by filling the BOUNDARY element in the specctra element tree. More... | |
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. More... | |
PADSTACK * | makePADSTACK (BOARD *aBoard, PAD *aPad) |
Create a #PADSTACK which matches the given pad. More... | |
PADSTACK * | makeVia (int aCopperDiameter, int aDrillDiameter, int aTopLayer, int aBotLayer) |
Make a round through hole #PADSTACK using the given KiCad diameter in deci-mils. More... | |
PADSTACK * | makeVia (const ::PCB_VIA *aVia) |
Make any kind of #PADSTACK using the given KiCad #VIA. More... | |
void | deleteNETs () |
Delete all the NETs that may be in here. More... | |
void | exportNETCLASS (const std::shared_ptr< NETCLASS > &aNetClass, BOARD *aBoard) |
Export aNetClass to the DSN file. More... | |
PCB_TRACK * | makeTRACK (WIRE *wire, PATH *aPath, int aPointIndex, int aNetcode) |
Create a #TRACK form the #PATH and BOARD info. More... | |
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 #PADSTACK, #POINT, and netcode. More... | |
Private Attributes | |
PCB * | m_pcb |
SHAPE_POLY_SET | m_brd_outlines |
SESSION * | m_session |
wxString | m_filename |
std::string | m_quote_char |
bool | m_footprintsAreFlipped |
STRING_FORMATTER | m_sf |
STRINGS | m_layerIds |
indexed by PCB layer number More... | |
std::vector< int > | m_kicadLayer2pcb |
maps BOARD layer number to PCB layer numbers More... | |
std::vector< PCB_LAYER_ID > | m_pcbLayer2kicad |
maps PCB layer number to BOARD layer numbers More... | |
UNIT_RES * | m_routeResolution |
used during FromSESSION() only, memory for it is not owned here. More... | |
BOARD * | m_sessionBoard |
a copy to avoid passing as an argument, memory for it is not owned here. More... | |
PADSTACKSET | m_padstackset |
std::vector< NET * > | m_nets |
we don't want ownership here permanently, so we don't use boost::ptr_vector More... | |
int | m_top_via_layer |
specctra cu layers, 0 based index: More... | |
int | m_bot_via_layer |
Static Private Attributes | |
static const KEYWORD | keywords [] |
specctra DSN keywords More... | |
static const KICAD_T | scanPADs [] |
A DSN data tree, usually coming from a DSN file.
Is essentially a SPECCTRA_PARSER class.
Definition at line 3647 of file specctra.h.
|
inline |
Definition at line 3651 of file specctra.h.
References m_bot_via_layer, m_footprintsAreFlipped, m_pcb, m_quote_char, m_routeResolution, m_session, m_sessionBoard, and m_top_via_layer.
|
inlinevirtual |
Definition at line 3672 of file specctra.h.
References deleteNETs(), m_pcb, and m_session.
|
private |
Create a few data translation structures for layer name and number mapping between the DSN::PCB structure and the KiCad BOARD structure.
aBoard | The BOARD to create the maps for. |
Definition at line 76 of file specctra.cpp.
References B_Cu, F_Cu, FIRST_LAYER, BOARD::GetCopperLayerCount(), BOARD::GetLayerName(), m_kicadLayer2pcb, m_layerIds, m_pcbLayer2kicad, TO_UTF8, and ToLAYER_ID().
Referenced by FromBOARD(), and FromSESSION().
bool DSN::SPECCTRA_DB::BuiltBoardOutlines | ( | BOARD * | aBoard | ) |
Build the board outlines and store it in m_brd_outlines.
Because it calls GetBoardPolygonOutlines() it must be called before flipping footprints
Definition at line 232 of file specctra_export.cpp.
References BOARD::GetBoardPolygonOutlines(), and m_brd_outlines.
Referenced by ExportBoardToSpecctraFile().
|
inlineprivate |
Delete all the NETs that may be in here.
Definition at line 3945 of file specctra.h.
References m_nets.
Referenced by FromBOARD(), and ~SPECCTRA_DB().
|
private |
Definition at line 3275 of file specctra.cpp.
References DSN::ANCESTOR::comment, DSN::ANCESTOR::filename, readTIME(), and DSN::ANCESTOR::time_stamp.
Referenced by doHISTORY().
|
private |
Definition at line 1036 of file specctra.cpp.
References doPATH(), doRECTANGLE(), path, DSN::BOUNDARY::paths, RECTANGLE, and DSN::BOUNDARY::rectangle.
Referenced by doSTRUCTURE().
|
private |
Definition at line 1166 of file specctra.cpp.
References DSN::CIRCLE::diameter, DSN::CIRCLE::layer_id, DSN::CIRCLE::vertex, DSN::POINT::x, and DSN::POINT::y.
Referenced by doKEEPOUT(), doSHAPE(), doWINDOW(), and doWIRE().
|
private |
Definition at line 2697 of file specctra.cpp.
References DSN::CLASS::circuit, DSN::CLASS::class_id, doLAYER_RULE(), doRULE(), doTOPOLOGY(), DSN::CLASS::layer_rules, m_quote_char, DSN::CLASS::net_ids, RULE, DSN::CLASS::rules, and DSN::CLASS::topology.
Referenced by doNETWORK().
|
private |
Definition at line 1702 of file specctra.cpp.
References DSN::ELEM_HOLDER::Append(), DSN::CLASS_CLASS::classes, doCLASSES(), doLAYER_RULE(), doRULE(), RULE, and DSN::ELEM::Type().
Referenced by doREGION().
|
private |
Definition at line 1750 of file specctra.cpp.
References DSN::CLASSES::class_ids.
Referenced by doCLASS_CLASS().
|
private |
Definition at line 2856 of file specctra.cpp.
References DSN::COMP_ORDER::placement_ids.
Referenced by doNET(), and doTOPOLOGY().
|
private |
Definition at line 2011 of file specctra.cpp.
References doPLACE(), DSN::COMPONENT::image_id, PLACE, and DSN::COMPONENT::places.
Referenced by doPLACEMENT().
|
private |
Definition at line 942 of file specctra.cpp.
Referenced by doWIRE().
|
private |
Definition at line 1276 of file specctra.cpp.
References DSN::ELEM_HOLDER::Append(), doTOKPROP(), and DSN::CONTROL::via_at_smd.
Referenced by doSTRUCTURE().
|
private |
Definition at line 2874 of file specctra.cpp.
References doLAYER_RULE(), doRULE(), DSN::FROMTO::fromText, DSN::FROMTO::fromto_type, DSN::FROMTO::layer_rules, DSN::FROMTO::net_id, RULE, DSN::FROMTO::rules, and DSN::FROMTO::toText.
Referenced by doNET(), and doTOPOLOGY().
|
private |
Definition at line 1774 of file specctra.cpp.
References DSN::GRID::dimension, DSN::GRID::direction, DSN::GRID::grid_type, DSN::GRID::image_type, and DSN::GRID::offset.
Referenced by doSTRUCTURE().
|
private |
Definition at line 3314 of file specctra.cpp.
References DSN::HISTORY::ancestors, DSN::HISTORY::comments, doANCESTOR(), readTIME(), and DSN::HISTORY::time_stamp.
Referenced by doSESSION().
|
private |
Definition at line 2301 of file specctra.cpp.
References DSN::ELEM_HOLDER::Append(), doKEEPOUT(), doPIN(), doRULE(), doSHAPE(), doUNIT(), DSN::IMAGE::image_id, DSN::IMAGE::keepouts, PIN, pin, DSN::IMAGE::pins, DSN::IMAGE::place_rules, RULE, DSN::IMAGE::rules, DSN::IMAGE::side, and DSN::IMAGE::unit.
Referenced by doLIBRARY().
|
private |
Definition at line 843 of file specctra.cpp.
References CIRCLE, doCIRCLE(), doPATH(), doQARC(), doRECTANGLE(), doRULE(), doWINDOW(), KI_FALLTHROUGH, DSN::KEEPOUT::name, DSN::KEEPOUT::place_rules, RECTANGLE, RULE, DSN::KEEPOUT::rules, DSN::KEEPOUT::sequence_number, DSN::KEEPOUT::shape, and DSN::KEEPOUT::windows.
Referenced by doIMAGE(), and doSTRUCTURE().
|
private |
Definition at line 1349 of file specctra.cpp.
References DSN::LAYER::cost, DSN::LAYER::cost_type, DSN::LAYER::direction, doPROPERTIES(), doRULE(), DSN::LAYER::layer_type, DSN::LAYER::name, DSN::LAYER::properties, RULE, DSN::LAYER::rules, and DSN::LAYER::use_net.
Referenced by doSTRUCTURE(), and doSTRUCTURE_OUT().
|
private |
Definition at line 633 of file specctra.cpp.
References doSPECCTRA_LAYER_PAIR(), and DSN::LAYER_NOISE_WEIGHT::layer_pairs.
Referenced by doSTRUCTURE().
|
private |
Definition at line 1851 of file specctra.cpp.
References doRULE(), DSN::LAYER_RULE::layer_ids, RULE, and DSN::LAYER_RULE::rule.
Referenced by doCLASS(), doCLASS_CLASS(), doFROMTO(), and doNET().
|
private |
Definition at line 2454 of file specctra.cpp.
References DSN::LIBRARY::AddPadstack(), doIMAGE(), doPADSTACK(), doUNIT(), IMAGE, image, DSN::LIBRARY::images, and DSN::LIBRARY::unit.
|
private |
Definition at line 2510 of file specctra.cpp.
References DSN::NET::comp_order, DSN::PIN_REF::component_id, doCOMP_ORDER(), doFROMTO(), doLAYER_RULE(), doRULE(), empty(), DSN::NET::expose, DSN::NET::fromtos, DSN::NET::layer_rules, DSN::NET::load, DSN::NET::net_id, DSN::NET::net_number, DSN::NET::noexpose, DSN::PIN_REF::pin_id, DSN::NET::pins, DSN::NET::pins_type, readCOMPnPIN(), RULE, DSN::NET::rules, DSN::NET::source, DSN::NET::terminator, DSN::NET::type, and DSN::NET::unassigned.
Referenced by doNETWORK().
|
private |
Definition at line 3587 of file specctra.cpp.
References doRULE(), doSUPPLY_PIN(), doWIRE(), doWIRE_VIA(), DSN::NET_OUT::net_id, DSN::NET_OUT::net_number, RULE, DSN::NET_OUT::rules, DSN::NET_OUT::supply_pins, WIRE, DSN::NET_OUT::wire_vias, and DSN::NET_OUT::wires.
Referenced by doROUTE().
|
private |
Definition at line 2810 of file specctra.cpp.
References DSN::NETWORK::classes, doCLASS(), doNET(), NET, and DSN::NETWORK::nets.
Referenced by doPCB().
|
private |
Definition at line 2101 of file specctra.cpp.
References DSN::PADSTACK::absolute, DSN::ELEM_HOLDER::Append(), DSN::PADSTACK::attach, doRULE(), doSHAPE(), doUNIT(), DSN::PADSTACK::padstack_id, DSN::PADSTACK::rotate, RULE, DSN::PADSTACK::rules, DSN::PADSTACK::unit, and DSN::PADSTACK::via_id.
Referenced by doLIBRARY().
|
private |
Definition at line 412 of file specctra.cpp.
References DSN::PARSER::case_sensitive, DSN::PARSER::constants, DSN::PARSER::generated_by_freeroute, DSN::PARSER::host_cad, DSN::PARSER::host_version, m_quote_char, DSN::PARSER::routes_include_guides, DSN::PARSER::routes_include_image_conductor, DSN::PARSER::routes_include_testpoint, DSN::PARSER::space_in_quoted_tokens, DSN::PARSER::string_quote, and DSN::PARSER::via_rotate_first.
|
private |
Definition at line 1086 of file specctra.cpp.
References DSN::PATH::aperture_type, DSN::PATH::aperture_width, DSN::PATH::layer_id, DSN::PATH::points, DSN::POINT::x, and DSN::POINT::y.
Referenced by doBOUNDARY(), doKEEPOUT(), doREGION(), doSHAPE(), doWINDOW(), and doWIRE().
|
private |
Definition at line 297 of file specctra.cpp.
References doLIBRARY(), doNETWORK(), doPARSER(), doPLACEMENT(), doRESOLUTION(), doSTRUCTURE(), doUNIT(), doWIRING(), DSN::PCB::library, DSN::PCB::network, DSN::PCB::parser, DSN::PCB::pcbname, DSN::PCB::placement, DSN::PCB::resolution, DSN::PCB::structure, DSN::PCB::unit, and DSN::PCB::wiring.
Referenced by LoadPCB().
|
private |
Definition at line 2403 of file specctra.cpp.
References DSN::PIN::padstack_id, DSN::PIN::pin_id, DSN::PIN::SetRotation(), DSN::PIN::vertex, DSN::POINT::x, and DSN::POINT::y.
Referenced by doIMAGE().
|
private |
Definition at line 1876 of file specctra.cpp.
References DSN::PLACE::component_id, doPROPERTIES(), doREGION(), doRULE(), DSN::PLACE::lock_type, DSN::PLACE::logical_part, DSN::PLACE::mirror, DSN::PLACE::part_number, DSN::PLACE::place_rules, DSN::PLACE::properties, REGION, DSN::PLACE::region, RULE, DSN::PLACE::rules, DSN::PLACE::SetRotation(), DSN::PLACE::SetVertex(), DSN::PLACE::side, DSN::PLACE::status, DSN::POINT::x, and DSN::POINT::y.
Referenced by doCOMPONENT().
|
private |
Definition at line 2043 of file specctra.cpp.
References COMPONENT, DSN::PLACEMENT::components, doCOMPONENT(), doRESOLUTION(), doUNIT(), DSN::PLACEMENT::flip_style, and DSN::PLACEMENT::unit.
Referenced by doPCB(), and doSESSION().
|
private |
Definition at line 1326 of file specctra.cpp.
|
private |
Definition at line 1197 of file specctra.cpp.
References DSN::QARC::aperture_width, DSN::QARC::layer_id, DSN::QARC::vertex, DSN::POINT::x, and DSN::POINT::y.
Referenced by doKEEPOUT(), doSHAPE(), doWINDOW(), and doWIRE().
|
private |
Definition at line 1137 of file specctra.cpp.
References DSN::RECTANGLE::layer_id, DSN::RECTANGLE::point0, DSN::RECTANGLE::point1, DSN::POINT::x, and DSN::POINT::y.
Referenced by doBOUNDARY(), doKEEPOUT(), doREGION(), doSHAPE(), doWINDOW(), and doWIRE().
|
private |
Definition at line 1627 of file specctra.cpp.
References DSN::ELEM_HOLDER::Append(), doCLASS_CLASS(), doPATH(), doRECTANGLE(), doRULE(), doSTRINGPROP(), DSN::REGION::polygon, RECTANGLE, DSN::REGION::rectangle, DSN::REGION::region_id, RULE, and DSN::REGION::rules.
Referenced by doPLACE(), and doSTRUCTURE().
|
private |
Definition at line 567 of file specctra.cpp.
References DSN::UNIT_RES::units, and DSN::UNIT_RES::value.
Referenced by doPCB(), doPLACEMENT(), doROUTE(), doSTRUCTURE(), and doWIRING().
|
private |
Definition at line 3497 of file specctra.cpp.
References doLIBRARY(), doNET_OUT(), doPARSER(), doRESOLUTION(), doSTRUCTURE_OUT(), DSN::ROUTE::library, DSN::ROUTE::net_outs, DSN::ROUTE::parser, DSN::ROUTE::resolution, and DSN::ROUTE::structure_out.
Referenced by doSESSION().
|
private |
Definition at line 1489 of file specctra.cpp.
References m_quote_char, and DSN::RULE::rules.
Referenced by doCLASS(), doCLASS_CLASS(), doFROMTO(), doIMAGE(), doKEEPOUT(), doLAYER(), doLAYER_RULE(), doNET(), doNET_OUT(), doPADSTACK(), doPLACE(), doREGION(), doSTRUCTURE(), and doSTRUCTURE_OUT().
|
private |
Definition at line 3373 of file specctra.cpp.
References DSN::SESSION::base_design, doHISTORY(), doPLACEMENT(), doROUTE(), doSTRUCTURE(), doWAS_IS(), DSN::SESSION::history, DSN::SESSION::placement, DSN::SESSION::route, DSN::SESSION::session_id, DSN::SESSION::structure, and DSN::SESSION::was_is.
Referenced by LoadSESSION().
|
private |
Definition at line 2213 of file specctra.cpp.
References CIRCLE, DSN::SHAPE::connect, doCIRCLE(), doPATH(), doQARC(), doRECTANGLE(), doWINDOW(), KI_FALLTHROUGH, RECTANGLE, DSN::WINDOW::shape, and DSN::SHAPE::windows.
Referenced by doIMAGE(), and doPADSTACK().
|
private |
Definition at line 616 of file specctra.cpp.
References DSN::SPECCTRA_LAYER_PAIR::layer_id0, DSN::SPECCTRA_LAYER_PAIR::layer_id1, and DSN::SPECCTRA_LAYER_PAIR::layer_weight.
Referenced by doLAYER_NOISE_WEIGHT().
|
private |
Definition at line 1224 of file specctra.cpp.
References DSN::STRINGPROP::value.
Referenced by doREGION(), and doSTRUCTURE().
|
private |
Definition at line 653 of file specctra.cpp.
References DSN::ELEM_HOLDER::Append(), DSN::STRUCTURE::boundary, DSN::STRUCTURE::control, doBOUNDARY(), doCONTROL(), doGRID(), doKEEPOUT(), doLAYER(), doLAYER_NOISE_WEIGHT(), doREGION(), doRESOLUTION(), doRULE(), doSTRINGPROP(), doUNIT(), doVIA(), grid, DSN::STRUCTURE::grids, DSN::STRUCTURE::keepouts, DSN::STRUCTURE::layer_noise_weight, DSN::STRUCTURE::layers, DSN::STRUCTURE::place_boundary, DSN::STRUCTURE::place_rules, DSN::STRUCTURE::planes, REGION, DSN::STRUCTURE::regions, RULE, DSN::STRUCTURE::rules, DSN::STRUCTURE::unit, VIA, and DSN::STRUCTURE::via.
Referenced by doPCB(), and doSESSION().
|
private |
Definition at line 798 of file specctra.cpp.
References doLAYER(), doRULE(), DSN::STRUCTURE_OUT::layers, RULE, and DSN::STRUCTURE_OUT::rules.
Referenced by doROUTE().
|
private |
Definition at line 3659 of file specctra.cpp.
References DSN::PIN_REF::component_id, empty(), DSN::SUPPLY_PIN::net_id, DSN::PIN_REF::pin_id, DSN::SUPPLY_PIN::pin_refs, and readCOMPnPIN().
Referenced by doNET_OUT().
|
private |
Definition at line 1232 of file specctra.cpp.
References DSN::TOKPROP::value.
Referenced by doCONTROL().
|
private |
Definition at line 2658 of file specctra.cpp.
References DSN::TOPOLOGY::comp_orders, doCOMP_ORDER(), doFROMTO(), and DSN::TOPOLOGY::fromtos.
Referenced by doCLASS().
|
private |
Definition at line 595 of file specctra.cpp.
References DSN::UNIT_RES::units.
Referenced by doIMAGE(), doLIBRARY(), doPADSTACK(), doPCB(), doPLACEMENT(), doSTRUCTURE(), and doWIRING().
|
private |
Definition at line 1245 of file specctra.cpp.
References DSN::VIA::padstacks, and DSN::VIA::spares.
Referenced by doSTRUCTURE().
|
private |
Definition at line 3456 of file specctra.cpp.
References DSN::PIN_REF::component_id, empty(), DSN::PIN_PAIR::is, DSN::PIN_REF::pin_id, DSN::WAS_IS::pin_pairs, readCOMPnPIN(), and DSN::PIN_PAIR::was.
Referenced by doSESSION().
|
private |
Definition at line 977 of file specctra.cpp.
References CIRCLE, doCIRCLE(), doPATH(), doQARC(), doRECTANGLE(), KI_FALLTHROUGH, RECTANGLE, and DSN::WINDOW::shape.
Referenced by doKEEPOUT(), doSHAPE(), and doWIRE().
|
private |
Definition at line 2967 of file specctra.cpp.
References DSN::WIRE::attr, CIRCLE, DSN::WIRE::connect, doCIRCLE(), doCONNECT(), doPATH(), doQARC(), doRECTANGLE(), doWINDOW(), KI_FALLTHROUGH, DSN::WIRE::net_id, RECTANGLE, DSN::WIRE::shape, DSN::WIRE::shield, DSN::WIRE::supply, DSN::WIRE::turret, DSN::WIRE::windows, and DSN::WIRE::wire_type.
Referenced by doNET_OUT(), and doWIRING().
|
private |
Definition at line 3101 of file specctra.cpp.
References DSN::WIRE_VIA::attr, DSN::WIRE_VIA::contact_layers, DSN::WIRE_VIA::net_id, DSN::WIRE_VIA::padstack_id, DSN::WIRE_VIA::supply, DSN::WIRE_VIA::vertexes, DSN::WIRE_VIA::via_number, DSN::WIRE_VIA::via_type, DSN::WIRE_VIA::virtual_pin_name, DSN::POINT::x, and DSN::POINT::y.
Referenced by doNET_OUT(), and doWIRING().
|
private |
Definition at line 3216 of file specctra.cpp.
References doRESOLUTION(), doUNIT(), doWIRE(), doWIRE_VIA(), DSN::WIRING::unit, WIRE, DSN::WIRING::wire_vias, and DSN::WIRING::wires.
Referenced by doPCB().
|
private |
Export aNetClass to the DSN file.
Definition at line 1715 of file specctra_export.cpp.
References DSN::CLASS::circuit, DSN::CLASS::class_id, DSN::NETWORK::classes, NETCLASS::Default, BOARD::GetNetInfo(), m_bot_via_layer, m_pcb, m_top_via_layer, makeVia(), DSN::CLASS::net_ids, DSN::PCB::network, DSN::RULE::rules, DSN::CLASS::rules, safetyMargin, DSN::scale(), text, TO_UTF8, and via.
Referenced by FromBOARD().
void DSN::SPECCTRA_DB::ExportPCB | ( | const wxString & | aFilename, |
bool | aNameChange = false |
||
) |
Write the internal PCB instance out as a SPECTRA DSN format file.
aFilename | The file to save to. |
aNameChange | If true, causes the pcb's name to change to "aFilename" and also to to be changed in the output file. |
IO_ERROR,if | an i/o error occurs saving the file. |
Definition at line 3697 of file specctra.cpp.
References DSN::PCB::Format(), m_pcb, m_quote_char, DSN::PCB::pcbname, and TO_UTF8.
Referenced by ExportBoardToSpecctraFile().
void DSN::SPECCTRA_DB::ExportSESSION | ( | const wxString & | aFilename | ) |
Write the internal #SESSION instance out as a #SPECTRA DSN format file.
aFilename | The file to save to. |
Definition at line 3711 of file specctra.cpp.
References DSN::SESSION::Format(), m_quote_char, and m_session.
Make the board perimeter for the DSN file by filling the BOUNDARY element in the specctra element tree.
aBoard | The BOARD to get information from in order to make the BOUNDARY. |
aBoundary | The empty BOUNDARY to fill in. |
Definition at line 1030 of file specctra_export.cpp.
References DSN::PATH::AppendPoint(), SHAPE_LINE_CHAIN::CPoint(), SHAPE_POLY_SET::Hole(), SHAPE_POLY_SET::HoleCount(), DSN::STRUCTURE::keepouts, m_brd_outlines, m_pcb, DSN::mapPt(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), path, DSN::BOUNDARY::paths, SHAPE_LINE_CHAIN::PointCount(), DSN::PATH::SetLayerId(), DSN::KEEPOUT::SetShape(), DSN::PCB::structure, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by FromBOARD().
|
private |
Return the PCB layer index for a given layer name, within the specctra sessionfile.
Definition at line 125 of file specctra.cpp.
References m_layerIds.
Referenced by makeTRACK(), and makeVIA().
void DSN::SPECCTRA_DB::FlipFOOTPRINTs | ( | BOARD * | aBoard | ) |
Flip the footprints which are on the back side of the board to the front.
Definition at line 1790 of file specctra_export.cpp.
References B_Cu, BOARD::Footprints(), and m_footprintsAreFlipped.
Referenced by ExportBoardToSpecctraFile().
void DSN::SPECCTRA_DB::FromBOARD | ( | BOARD * | aBoard | ) |
Add the entire BOARD to the PCB but does not write it out.
Definition at line 1081 of file specctra_export.cpp.
References _, DSN::LIBRARY::AddPadstack(), DSN::KEEPOUT::AddWindow(), PNS::angle(), ANGLE_180, DSN::PATH::AppendPoint(), DSN::VIA::AppendVia(), DSN::LIBRARY::AppendVia(), B_Cu, NETINFO_LIST::begin(), buildLayerMaps(), DSN::PLACE::component_id, DSN::PIN_REF::component_id, deleteNETs(), empty(), NETINFO_LIST::end(), exportNETCLASS(), fillBOUNDARY(), BOARD::FindNet(), BOARD::Footprints(), Format(), BOARD::GetCopperLayerCount(), BOARD::GetDesignSettings(), BOARD::GetLayerType(), BOARD::GetNetInfo(), NETINFO_ITEM::GetNetname(), image, IsCopperLayer(), SHAPE_POLY_SET::ITERATOR_TEMPLATE< T >::IsEndContour(), DSN::STRUCTURE::keepouts, DSN::PATH::layer_id, DSN::LAYER::layer_type, DSN::STRUCTURE::layers, DSN::PCB::library, DSN::PLACEMENT::LookupCOMPONENT(), DSN::LIBRARY::LookupIMAGE(), DSN::LIBRARY::LookupVia(), LT_JUMPER, LT_MIXED, LT_POWER, LT_SIGNAL, m_bot_via_layer, m_kicadLayer2pcb, m_layerIds, m_nets, BOARD_DESIGN_SETTINGS::m_NetSettings, m_padstackset, m_pcb, m_pcbLayer2kicad, m_top_via_layer, makeIMAGE(), MakePCB(), makeVia(), DSN::mapPt(), name, DSN::KEEPOUT::name, DSN::LAYER::name, DSN::NET::net_id, DSN::WIRE::net_id, DSN::WIRE_VIA::net_id, DSN::NETWORK::nets, DSN::PCB::network, DSN::WIRE_VIA::padstack_id, DSN::PCB::parser, DSN::PLACE::part_number, path, PCB_VIA_T, pin, DSN::PIN_REF::pin_id, DSN::NET::pins, DSN::PCB::placement, DSN::COMPONENT::places, DSN::STRUCTURE::planes, DSN::LAYER::properties, registered, DSN::PCB::resolution, DSN::RULE::rules, DSN::STRUCTURE::rules, safetyMargin, DSN::scale(), DSN::STRUCTURE::SetBOUNDARY(), DSN::PLACE::SetRotation(), DSN::WINDOW::SetShape(), DSN::KEEPOUT::SetShape(), DSN::WIRE::SetShape(), DSN::PLACE::SetVertex(), DSN::PLACE::side, DSN::PARSER::space_in_quoted_tokens, DSN::PCB::structure, THROW_IO_ERROR, TO_UTF8, BOARD::Tracks(), UNDEFINED_LAYER, DSN::PCB::unit, DSN::UNIT_RES::units, DSN::UNIT_RES::value, DSN::WIRE_VIA::vertexes, via, DSN::STRUCTURE::via, DSN::WIRE_VIA::via_type, DSN::LIBRARY::vias, DSN::WIRE::wire_type, DSN::WIRING::wire_vias, DSN::WIRING::wires, DSN::PCB::wiring, and BOARD::Zones().
Referenced by ExportBoardToSpecctraFile().
void DSN::SPECCTRA_DB::FromSESSION | ( | BOARD * | aBoard | ) |
Add the entire #SESSION info to a BOARD but does not write it out.
The BOARD given to this function will have all its tracks and via's replaced, and all its components are subject to being moved.
aBoard | The BOARD to merge the #SESSION information into. |
Definition at line 337 of file specctra_import.cpp.
References _, BOARD::Add(), B_Cu, buildLayerMaps(), DSN::PLACE::component_id, DSN::PLACEMENT::components, DEGREES_T, BOARD::DeleteMARKERs(), F_Cu, BOARD::FindFootprintByReference(), BOARD::FindNet(), FOOTPRINT::Flip(), Format(), FROM_UTF8(), BOARD::GetDesignSettings(), FOOTPRINT::GetLayer(), NETINFO_ITEM::GetNetCode(), DSN::WIRE_VIA::GetPadstackId(), FOOTPRINT::GetPosition(), DSN::ELEM::GetUnits(), DSN::ROUTE::GetUnits(), DSN::PLACE::hasVertex, BOARD_ITEM::IsLocked(), library, DSN::ROUTE::library, locked, BOARD_DESIGN_SETTINGS::m_NetSettings, m_routeResolution, m_session, m_sessionBoard, makeTRACK(), makeVIA(), DSN::mapPt(), DSN::ROUTE::net_outs, path, DSN::SESSION::placement, DSN::PLACE::rotation, DSN::SESSION::route, FOOTPRINT::SetOrientation(), FOOTPRINT::SetPosition(), DSN::WIRE::shape, DSN::PLACE::side, THROW_IO_ERROR, BOARD::Tracks(), DSN::ELEM::Type(), DSN::PLACE::vertex, DSN::WIRE_VIA::vertexes, and via.
Referenced by PCB_EDIT_FRAME::ImportSpecctraSession().
|
inline |
|
inline |
void DSN::SPECCTRA_DB::LoadPCB | ( | const wxString & | aFilename | ) |
A recursive descent parser for a SPECCTRA DSN "design" file.
A design file is nearly a full description of a PCB (seems to be missing only the silkscreen stuff).
aFilename | The name of the dsn file to load. |
IO_ERROR | if there is a lexer or parser error. |
Definition at line 258 of file specctra.cpp.
void DSN::SPECCTRA_DB::LoadSESSION | ( | const wxString & | aFilename | ) |
A recursive descent parser for a SPECCTRA DSN "session" file.
A session file is a file that is fed back from the router to the layout tool (Pcbnew) and should be used to update a BOARD object with the new tracks, vias, and component locations.
aFilename | The name of the dsn file to load. |
IO_ERROR | if there is a lexer or parser error. |
Definition at line 277 of file specctra.cpp.
References doSESSION(), m_session, and SetSESSION().
Referenced by PCB_EDIT_FRAME::ImportSpecctraSession(), and main().
Allocates an I::MAGE on the heap and creates all the PINs according to the PADs in the FOOTPRINT.
Definition at line 599 of file specctra_export.cpp.
References SHAPE_POLY_SET::AddOutline(), DSN::KEEPOUT::AddWindow(), LSET::AllCuMask(), PNS::angle(), ANGLE_0, ANGLE_360, SHAPE_POLY_SET::Append(), DSN::PATH::AppendPoint(), ARC, ARC_HIGH_DEF, B_Cu, UTF8::c_str(), CIRCLE, SHAPE_LINE_CHAIN::Clear(), PCB_TYPE_COLLECTOR::Collect(), ConvertArcToPolyline(), SHAPE_LINE_CHAIN::CPoint(), ERROR_INSIDE, LIB_ID::Format(), EDA_SHAPE::GetArcAngle(), PCB_SHAPE::GetCenter(), FP_SHAPE::GetCenter0(), BOARD::GetCopperLayerCount(), COLLECTOR::GetCount(), EDA_SHAPE::GetEnd(), FP_SHAPE::GetEnd0(), FOOTPRINT::GetFPID(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), EDA_SHAPE::GetRadius(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), FP_SHAPE::GetStart0(), EDA_SHAPE::GetWidth(), image, SHAPE_POLY_SET::ITERATOR_TEMPLATE< T >::IsEndContour(), DSN::isRoundKeepout(), ZONE::IterateWithHoles(), DSN::PATH::layer_id, m_kicadLayer2pcb, m_layerIds, m_padstackset, m_pcb, makePADSTACK(), DSN::mapPt(), move, EDA_ANGLE::Normalize(), SHAPE_POLY_SET::Outline(), pad, DSN::PADSTACK::padstack_id, path, PCB_FP_SHAPE_T, PCB_PAD_T, pin, SHAPE_POLY_SET::PM_FAST, SHAPE_LINE_CHAIN::PointCount(), RECT, ZONE::Rotate(), DSN::scale(), SEGMENT, DSN::CIRCLE::SetDiameter(), DSN::CIRCLE::SetLayerId(), DSN::WINDOW::SetShape(), DSN::KEEPOUT::SetShape(), DSN::CIRCLE::SetVertex(), SHAPE_POLY_SET::Simplify(), DSN::PCB::structure, TO_UTF8, TransformCircleToPolygon(), VECTOR2< T >::x, VECTOR2< T >::y, and FOOTPRINT::Zones().
Referenced by FromBOARD().
Create a #PADSTACK which matches the given pad.
aBoard | The owner of the PAD's footprint. |
aPad | The PAD which needs to be made into a PADSTACK. |
Definition at line 238 of file specctra_export.cpp.
References std::abs(), LSET::AllCuMask(), ANGLE_0, DSN::ELEM_HOLDER::Append(), DSN::PATH::AppendPoint(), BuildConvexHull(), CHAMFERED_RECT, CIRCLE, SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), CUSTOM, ERROR_INSIDE, MD5_HASH::Format(), PAD::GetBoundingBox(), PAD::GetChamferPositions(), PAD::GetChamferRectRatio(), BOARD::GetCopperLayerCount(), PAD::GetDelta(), BOARD::GetDesignSettings(), SHAPE_POLY_SET::GetHash(), BOX2< Vec >::GetHeight(), PAD::GetLayerSet(), PAD::GetOffset(), PAD::GetRoundRectCornerRadius(), PAD::GetShape(), PAD::GetSize(), BOX2< Vec >::GetWidth(), PAD::IsOnLayer(), DSN::isRoundKeepout(), DSN::IU2um(), KiROUND(), m_layerIds, BOARD_DESIGN_SETTINGS::m_MaxError, m_pcbLayer2kicad, DSN::makePath(), DSN::mapPt(), MAX_CU_LAYERS, PAD::MergePrimitivesAsPolygon(), name, SHAPE_POLY_SET::Outline(), OVAL, path, SHAPE_LINE_CHAIN::PointCount(), RECT, ROUNDRECT, DSN::scale(), DSN::RECTANGLE::SetCorners(), DSN::CIRCLE::SetDiameter(), DSN::RECTANGLE::SetLayerId(), DSN::PATH::SetLayerId(), DSN::CIRCLE::SetLayerId(), DSN::PADSTACK::SetPadstackId(), DSN::WINDOW::SetShape(), DSN::CIRCLE::SetVertex(), TransformRoundChamferedRectToPolygon(), TRAPEZOID, VECTOR2< T >::x, DSN::POINT::x, VECTOR2< T >::y, and DSN::POINT::y.
Referenced by makeIMAGE().
|
static |
Make a PCB with all the default ELEMs and parts on the heap.
Definition at line 3722 of file specctra.cpp.
References DSN::STRUCTURE::boundary, DSN::PCB::library, DSN::PCB::network, DSN::PCB::parser, DSN::PCB::placement, DSN::PCB::resolution, RULE, DSN::STRUCTURE::rules, DSN::PCB::structure, DSN::PCB::unit, VIA, DSN::STRUCTURE::via, and DSN::PCB::wiring.
Referenced by FromBOARD().
|
private |
Create a #TRACK form the #PATH and BOARD info.
Definition at line 153 of file specctra_import.cpp.
References _, DSN::PATH::aperture_width, findLayerName(), Format(), FROM_UTF8(), DSN::PATH::layer_id, m_pcbLayer2kicad, m_routeResolution, m_sessionBoard, DSN::mapPt(), DSN::PATH::points, DSN::scale(), PCB_TRACK::SetEnd(), BOARD_ITEM::SetLayer(), BOARD_ITEM::SetLocked(), BOARD_CONNECTED_ITEM::SetNetCode(), PCB_TRACK::SetStart(), PCB_TRACK::SetWidth(), THROW_IO_ERROR, and DSN::WIRE::wire_type.
Referenced by FromSESSION().
Make any kind of #PADSTACK using the given KiCad #VIA.
aVia | The #VIA to build the padstack from. |
|
private |
Make a round through hole #PADSTACK using the given KiCad diameter in deci-mils.
aCopperDiameter | The diameter of the copper pad. |
aDrillDiameter | The drill diameter, used on re-import of the session file. |
aTopLayer | The DSN::PCB top most layer index. |
aBotLayer | The DSN::PCB bottom most layer index. |
Definition at line 980 of file specctra_export.cpp.
References DSN::ELEM_HOLDER::Append(), DSN::IU2um(), m_layerIds, name, DSN::scale(), DSN::CIRCLE::SetDiameter(), DSN::CIRCLE::SetLayerId(), DSN::PADSTACK::SetPadstackId(), and DSN::WINDOW::SetShape().
Referenced by exportNETCLASS(), and FromBOARD().
|
private |
Instantiate a KiCad #VIA on the heap and initializes it with internal values consistent with the given #PADSTACK, #POINT, and netcode.
Definition at line 183 of file specctra_import.cpp.
References _, B_Cu, BLIND_BURIED, DSN::CIRCLE::diameter, F_Cu, findLayerName(), Format(), FROM_UTF8(), BOARD::GetCopperLayerCount(), EDA_IU_SCALE::IU_PER_MM, DSN::CIRCLE::layer_id, DSN::ELEM_HOLDER::Length(), m_pcbLayer2kicad, m_routeResolution, m_sessionBoard, DSN::mapPt(), MICROVIA, DSN::PADSTACK::padstack_id, pcbIUScale, DSN::scale(), DSN::WINDOW::shape, THROUGH, THROW_IO_ERROR, DSN::ELEM::Type(), UNDEFINED_DRILL_DIAMETER, via, and DSN::WIRE_VIA::via_type.
Referenced by FromSESSION().
|
private |
Read a <pin_reference> and splits it into the two parts which are on either side of the hyphen.
This function is specialized because pin_reference may or may not be using double quotes. Both of these are legal: U2-14 or "U2"-"14". The lexer treats the first one as a single T_SYMBOL, so in that case we have to split it into two here.
The caller should have already read in the first token comprising the pin_reference and it will be tested through CurTok().
component_id | Where to put the text preceding the '-' hyphen. |
pid_id | Where to put the text which trails the '-'. |
IO_ERROR,if | the next token or two do no make up a pin_reference, or there is an error reading from the input stream. |
Definition at line 137 of file specctra.cpp.
Referenced by doNET(), doSUPPLY_PIN(), and doWAS_IS().
|
private |
Read a <time_stamp> which consists of 8 lexer tokens: "month date hour : minute : second year".
This function is specialized because time_stamps occur more than once in a session file. The caller should not have already read in the first token comprising the time stamp.
time_stamp | Where to put the parsed time value. |
IO_ERROR,if | the next token or 8 do no make up a time stamp, or there is an error reading from the input stream. |
Definition at line 179 of file specctra.cpp.
Referenced by doANCESTOR(), and doHISTORY().
void DSN::SPECCTRA_DB::RevertFOOTPRINTs | ( | BOARD * | aBoard | ) |
Flip the footprints which were on the back side of the board back to the back.
Definition at line 1810 of file specctra_export.cpp.
References BOARD::Footprints(), and m_footprintsAreFlipped.
Referenced by ExportBoardToSpecctraFile().
|
inline |
Delete any existing PCB and replaces it with the given one.
Definition at line 3688 of file specctra.h.
References m_pcb.
Referenced by ExportBoardToSpecctraFile(), and LoadPCB().
|
inline |
Delete any existing SESSION and replaces it with the given one.
Definition at line 3699 of file specctra.h.
References m_session.
Referenced by LoadSESSION().
|
staticprivate |
specctra DSN keywords
Definition at line 3977 of file specctra.h.
|
private |
Definition at line 4009 of file specctra.h.
Referenced by exportNETCLASS(), FromBOARD(), and SPECCTRA_DB().
|
private |
Definition at line 3980 of file specctra.h.
Referenced by BuiltBoardOutlines(), and fillBOUNDARY().
|
private |
Definition at line 3982 of file specctra.h.
|
private |
Definition at line 3985 of file specctra.h.
Referenced by FlipFOOTPRINTs(), RevertFOOTPRINTs(), and SPECCTRA_DB().
|
private |
maps BOARD layer number to PCB layer numbers
Definition at line 3991 of file specctra.h.
Referenced by buildLayerMaps(), FromBOARD(), and makeIMAGE().
|
private |
indexed by PCB layer number
Definition at line 3989 of file specctra.h.
Referenced by buildLayerMaps(), findLayerName(), FromBOARD(), makeIMAGE(), makePADSTACK(), and makeVia().
|
private |
we don't want ownership here permanently, so we don't use boost::ptr_vector
Definition at line 4005 of file specctra.h.
Referenced by deleteNETs(), and FromBOARD().
|
private |
Definition at line 4002 of file specctra.h.
Referenced by FromBOARD(), and makeIMAGE().
|
private |
Definition at line 3979 of file specctra.h.
Referenced by exportNETCLASS(), ExportPCB(), fillBOUNDARY(), FromBOARD(), GetPCB(), LoadPCB(), makeIMAGE(), SetPCB(), SPECCTRA_DB(), and ~SPECCTRA_DB().
|
private |
maps PCB layer number to BOARD layer numbers
Definition at line 3992 of file specctra.h.
Referenced by buildLayerMaps(), FromBOARD(), makePADSTACK(), makeTRACK(), and makeVIA().
|
private |
Definition at line 3983 of file specctra.h.
Referenced by doCLASS(), doPARSER(), doRULE(), ExportPCB(), ExportSESSION(), and SPECCTRA_DB().
|
private |
used during FromSESSION() only, memory for it is not owned here.
Definition at line 3995 of file specctra.h.
Referenced by FromSESSION(), makeTRACK(), makeVIA(), and SPECCTRA_DB().
|
private |
Definition at line 3981 of file specctra.h.
Referenced by ExportSESSION(), FromSESSION(), GetSESSION(), LoadSESSION(), SetSESSION(), SPECCTRA_DB(), and ~SPECCTRA_DB().
|
private |
a copy to avoid passing as an argument, memory for it is not owned here.
Definition at line 3998 of file specctra.h.
Referenced by FromSESSION(), makeTRACK(), makeVIA(), and SPECCTRA_DB().
|
private |
Definition at line 3987 of file specctra.h.
|
private |
specctra cu layers, 0 based index:
Definition at line 4008 of file specctra.h.
Referenced by exportNETCLASS(), FromBOARD(), and SPECCTRA_DB().
|
staticprivate |
Definition at line 4000 of file specctra.h.