KiCad PCB EDA Suite
|
This source file implements export and import capabilities to the specctra dsn file format. More...
Classes | |
class | ANCESTOR |
class | BOUNDARY |
class | CIRCLE |
class | CLASS |
The <class_descriptor> in the specctra spec. More... | |
class | CLASS_CLASS |
class | CLASSES |
class | COMP_ORDER |
The <component_order_descriptor>. More... | |
class | COMPONENT |
Implement a <component_descriptor> in the specctra dsn spec. More... | |
class | CONNECT |
class | CONTROL |
class | COPPER_PLANE |
A <plane_descriptor> in the specctra dsn spec. More... | |
class | ELEM |
A base class for any DSN element class. More... | |
class | ELEM_HOLDER |
A holder for any DSN class. More... | |
class | FROMTO |
class | GRID |
class | HISTORY |
class | IMAGE |
class | KEEPOUT |
Used for <keepout_descriptor> and <plane_descriptor>. More... | |
class | LAYER |
class | LAYER_NOISE_WEIGHT |
class | LAYER_RULE |
class | LIBRARY |
A <library_descriptor> in the specctra dsn specification. More... | |
class | NET |
A <net_descriptor> in the DSN spec. More... | |
class | NET_OUT |
A <net_out_descriptor> of the specctra dsn spec. More... | |
class | NETWORK |
class | PADSTACK |
Hold either a via or a pad definition. More... | |
class | PARSER |
A configuration record per the SPECCTRA DSN file spec. More... | |
class | PATH |
Support both the <path_descriptor> and the <polygon_descriptor> per the specctra dsn spec. More... | |
class | PCB |
class | PIN |
struct | PIN_PAIR |
Used within the WAS_IS class below to hold a pair of PIN_REFs and corresponds to the (pins was is) construct within the specctra dsn spec. More... | |
struct | PIN_REF |
A <pin_reference> definition in the specctra dsn spec. More... | |
class | PLACE |
Implement a <placement_reference> in the specctra dsn spec. More... | |
class | PLACEMENT |
struct | POINT |
A point in the SPECCTRA DSN coordinate system. More... | |
struct | PROPERTY |
class | QARC |
class | RECTANGLE |
class | REGION |
class | ROUTE |
class | RULE |
A <rule_descriptor> in the specctra dsn spec. More... | |
class | SESSION |
A <session_file_descriptor> in the specctra dsn spec. More... | |
class | SHAPE |
A "(shape ..)" element in the specctra dsn spec. More... | |
class | SPECCTRA_DB |
A DSN data tree, usually coming from a DSN file. More... | |
class | SPECCTRA_LAYER_PAIR |
class | STRINGPROP |
A container for a single property whose value is a string. More... | |
class | STRUCTURE |
class | STRUCTURE_OUT |
class | SUPPLY_PIN |
A <supply_pin_descriptor> in the specctra dsn spec. More... | |
class | TOKPROP |
A container for a single property whose value is another DSN_T token. More... | |
class | TOPOLOGY |
class | UNIT_RES |
A holder for either a T_unit or T_resolution object which are usually mutually exclusive in the dsn grammar, except within the T_pcb level. More... | |
class | VIA |
A <via_descriptor> in the specctra dsn spec. More... | |
class | WAS_IS |
A <was_is_descriptor> in the specctra dsn spec. More... | |
class | WINDOW |
class | WIRE |
A <wire_shape_descriptor> in the specctra dsn spec. More... | |
class | WIRE_VIA |
A <wire_via_descriptor> in the specctra dsn spec. More... | |
class | WIRING |
A <wiring_descriptor> in the specctra dsn spec. More... | |
Typedefs | |
typedef std::vector< std::string > | STRINGS |
typedef std::vector< POINT > | POINTS |
typedef std::vector< PROPERTY > | PROPERTIES |
typedef boost::ptr_vector< LAYER_RULE > | LAYER_RULES |
typedef boost::ptr_vector< PATH > | PATHS |
typedef boost::ptr_vector< WINDOW > | WINDOWS |
typedef boost::ptr_vector< KEEPOUT > | KEEPOUTS |
typedef boost::ptr_vector< LAYER > | LAYERS |
typedef boost::ptr_vector< SPECCTRA_LAYER_PAIR > | SPECCTRA_LAYER_PAIRS |
typedef boost::ptr_vector< COPPER_PLANE > | COPPER_PLANES |
typedef boost::ptr_vector< PLACE > | PLACES |
typedef boost::ptr_vector< COMPONENT > | COMPONENTS |
typedef boost::ptr_vector< PIN > | PINS |
typedef boost::ptr_vector< IMAGE > | IMAGES |
typedef boost::ptr_vector< PADSTACK > | PADSTACKS |
typedef std::vector< PIN_REF > | PIN_REFS |
typedef boost::ptr_vector< FROMTO > | FROMTOS |
typedef boost::ptr_vector< COMP_ORDER > | COMP_ORDERS |
typedef boost::ptr_vector< NET > | NETS |
typedef boost::ptr_vector< CLASS > | CLASSLIST |
typedef boost::ptr_vector< WIRE > | WIRES |
typedef boost::ptr_vector< WIRE_VIA > | WIRE_VIAS |
typedef boost::ptr_vector< ANCESTOR > | ANCESTORS |
typedef boost::ptr_vector< SUPPLY_PIN > | SUPPLY_PINS |
typedef boost::ptr_vector< NET_OUT > | NET_OUTS |
typedef std::vector< PIN_PAIR > | PIN_PAIRS |
typedef boost::ptr_set< PADSTACK > | PADSTACKSET |
typedef std::map< wxString, int > | PINMAP |
data type used to ensure unique-ness of pin names, holding (wxString and int) | |
typedef std::set< std::string > | STRINGSET |
typedef std::pair< STRINGSET::iterator, bool > | STRINGSET_PAIR |
Functions | |
const char * | GetTokenText (T aTok) |
The DSN namespace and returns the C string representing a SPECCTRA_DB::keyword. | |
void | ExportBoardToSpecctraFile (BOARD *aBoard, const wxString &aFullFilename) |
Helper method to export board to DSN file. | |
bool | operator< (const PADSTACK &lhs, const PADSTACK &rhs) |
Used by the PADSTACKSET boost::ptr_set below. | |
bool | ImportSpecctraSession (BOARD *aBoard, const wxString &fullFileName) |
Helper method to import SES file to a board. | |
static double | scale (int kicadDist) |
Convert a distance from Pcbnew internal units to the reported Specctra DSN units in floating point format. | |
static double | IU2um (int kicadDist) |
static double | mapX (int x) |
static double | mapY (int y) |
static POINT | mapPt (const VECTOR2I &pt) |
Convert a KiCad point into a DSN file point. | |
static POINT | mapPt (const VECTOR2I &pt, FOOTPRINT *aFootprint) |
static bool | isRoundKeepout (PAD *aPad) |
Decide if the pad is a copper-less through hole which needs to be made into a round keepout. | |
static PATH * | makePath (const POINT &aStart, const POINT &aEnd, const std::string &aLayerName) |
Create a PATH element with a single straight line, a pair of vertices. | |
static int | scale (double distance, UNIT_RES *aResolution) |
Function scale converts a session file distance to KiCad units of deci-mils. | |
static VECTOR2I | mapPt (const POINT &aPoint, UNIT_RES *aResolution) |
Function mapPt translates a point from the Specctra Session format coordinate system to the KiCad coordinate system. | |
This source file implements export and import capabilities to the specctra dsn file format.
The grammar for that file format is documented fairly well. There are classes for each major type of descriptor in the spec.
Since there are so many classes in here, it may be helpful to generate the Doxygen directory:
$ cd <kicadSourceRoot> $ doxygen
Then you can view the html documentation in the <kicadSourceRoot>/doxygen directory. The main class in this file is SPECCTRA_DB and its main functions are LoadPCB(), LoadSESSION(), and ExportPCB().
Wide use is made of boost::ptr_vector<> and std::vector<> template classes. If the contained object is small, then std::vector tends to be used. If the contained object is large, variable size, or would require writing an assignment operator() or copy constructor, then boost::ptr_vector cannot be beat.
typedef boost::ptr_vector<ANCESTOR> DSN::ANCESTORS |
Definition at line 3297 of file specctra.h.
typedef boost::ptr_vector<CLASS> DSN::CLASSLIST |
Definition at line 2832 of file specctra.h.
typedef boost::ptr_vector<COMP_ORDER> DSN::COMP_ORDERS |
Definition at line 2584 of file specctra.h.
typedef boost::ptr_vector<COMPONENT> DSN::COMPONENTS |
Definition at line 1811 of file specctra.h.
typedef boost::ptr_vector<COPPER_PLANE> DSN::COPPER_PLANES |
Definition at line 1362 of file specctra.h.
typedef boost::ptr_vector<FROMTO> DSN::FROMTOS |
Definition at line 2548 of file specctra.h.
typedef boost::ptr_vector<IMAGE> DSN::IMAGES |
Definition at line 2113 of file specctra.h.
typedef boost::ptr_vector<KEEPOUT> DSN::KEEPOUTS |
Definition at line 1031 of file specctra.h.
typedef boost::ptr_vector<LAYER_RULE> DSN::LAYER_RULES |
Definition at line 574 of file specctra.h.
typedef boost::ptr_vector<LAYER> DSN::LAYERS |
Definition at line 1290 of file specctra.h.
typedef boost::ptr_vector<NET_OUT> DSN::NET_OUTS |
Definition at line 3444 of file specctra.h.
Definition at line 2714 of file specctra.h.
typedef boost::ptr_vector<PADSTACK> DSN::PADSTACKS |
Definition at line 2232 of file specctra.h.
typedef boost::ptr_set<PADSTACK> DSN::PADSTACKSET |
Definition at line 3634 of file specctra.h.
typedef boost::ptr_vector<PATH> DSN::PATHS |
Definition at line 656 of file specctra.h.
typedef std::vector<PIN_PAIR> DSN::PIN_PAIRS |
Definition at line 3532 of file specctra.h.
typedef std::vector<PIN_REF> DSN::PIN_REFS |
Definition at line 2478 of file specctra.h.
typedef std::map<wxString, int> DSN::PINMAP |
data type used to ensure unique-ness of pin names, holding (wxString and int)
Definition at line 601 of file specctra_export.cpp.
Definition at line 2000 of file specctra.h.
typedef boost::ptr_vector<PLACE> DSN::PLACES |
Definition at line 1760 of file specctra.h.
typedef std::vector<POINT> DSN::POINTS |
Definition at line 166 of file specctra.h.
typedef std::vector<PROPERTY> DSN::PROPERTIES |
Definition at line 191 of file specctra.h.
typedef boost::ptr_vector<SPECCTRA_LAYER_PAIR> DSN::SPECCTRA_LAYER_PAIRS |
Definition at line 1320 of file specctra.h.
typedef std::vector<std::string> DSN::STRINGS |
Definition at line 165 of file specctra.h.
typedef std::set<std::string> DSN::STRINGSET |
Definition at line 1084 of file specctra_export.cpp.
typedef std::pair<STRINGSET::iterator, bool> DSN::STRINGSET_PAIR |
Definition at line 1085 of file specctra_export.cpp.
typedef boost::ptr_vector<SUPPLY_PIN> DSN::SUPPLY_PINS |
Definition at line 3387 of file specctra.h.
typedef boost::ptr_vector<WINDOW> DSN::WINDOWS |
Definition at line 898 of file specctra.h.
typedef boost::ptr_vector<WIRE_VIA> DSN::WIRE_VIAS |
Definition at line 3123 of file specctra.h.
typedef boost::ptr_vector<WIRE> DSN::WIRES |
Definition at line 2976 of file specctra.h.
void DSN::ExportBoardToSpecctraFile | ( | BOARD * | aBoard, |
const wxString & | aFullFilename | ||
) |
Helper method to export board to DSN file.
aBoard | board object |
aFullFilename | specctra file name |
Definition at line 109 of file specctra_export.cpp.
References _, DSN::SPECCTRA_DB::BuiltBoardOutlines(), DSN::SPECCTRA_DB::ExportPCB(), DSN::SPECCTRA_DB::FlipFOOTPRINTs(), DSN::SPECCTRA_DB::FromBOARD(), DSN::SPECCTRA_DB::MakePCB(), DSN::SPECCTRA_DB::RevertFOOTPRINTs(), DSN::SPECCTRA_DB::SetPCB(), and BOARD::SynchronizeNetsAndNetClasses().
Referenced by ExportSpecctraDSN(), and PCB_EDIT_FRAME::ExportSpecctraFile().
const char * DSN::GetTokenText | ( | T | aTok | ) |
The DSN namespace and returns the C string representing a SPECCTRA_DB::keyword.
We needed a non-instance function to get at the SPECCTRA_DB::keyword[] and class SPECCTRA_DB is not defined yet.
Definition at line 70 of file specctra.cpp.
Referenced by DSN::UNIT_RES::Format(), DSN::LAYER::Format(), DSN::TOKPROP::Format(), DSN::GRID::Format(), DSN::PLACE::Format(), DSN::SHAPE::Format(), DSN::FROMTO::Format(), DSN::NET::Format(), DSN::WIRE::Format(), DSN::WIRE_VIA::Format(), DSN::PLACEMENT::FormatContents(), DSN::IMAGE::FormatContents(), and DSN::PADSTACK::FormatContents().
bool DSN::ImportSpecctraSession | ( | BOARD * | aBoard, |
const wxString & | fullFileName | ||
) |
Helper method to import SES file to a board.
aBoard | board object |
aFullFilename | specctra file name |
Definition at line 539 of file specctra_import.cpp.
References BOARD::BuildConnectivity(), DSN::SPECCTRA_DB::FromSESSION(), BOARD::GetConnectivity(), and DSN::SPECCTRA_DB::LoadSESSION().
Referenced by ImportSpecctraSES(), and PCB_EDIT_FRAME::ImportSpecctraSession().
|
static |
Decide if the pad is a copper-less through hole which needs to be made into a round keepout.
Definition at line 204 of file specctra_export.cpp.
References PADSTACK::ALL_LAYERS, LSET::AllCuMask(), PAD::GetDrillSize(), PAD::GetLayerSet(), PAD::GetShape(), PAD::GetSize(), and VECTOR2< T >::x.
Referenced by DSN::SPECCTRA_DB::makeIMAGE(), and DSN::SPECCTRA_DB::makePADSTACK().
|
inlinestatic |
Definition at line 158 of file specctra_export.cpp.
References EDA_IU_SCALE::IU_PER_MM, and pcbIUScale.
Referenced by DSN::SPECCTRA_DB::makePADSTACK(), and DSN::SPECCTRA_DB::makeVia().
|
static |
Create a PATH element with a single straight line, a pair of vertices.
Definition at line 223 of file specctra_export.cpp.
References path.
Referenced by DSN::SPECCTRA_DB::makePADSTACK().
Function mapPt translates a point from the Specctra Session format coordinate system to the KiCad coordinate system.
aPoint | The session point to translate |
aResolution | - The amount to scale the point. |
Definition at line 136 of file specctra_import.cpp.
References scale, DSN::POINT::x, and DSN::POINT::y.
Convert a KiCad point into a DSN file point.
Kicad's BOARD coordinates are in nanometers (called Internal Units or IU) and we are exporting in units of mils, so we have to scale them.
Definition at line 182 of file specctra_export.cpp.
References DSN::POINT::FixNegativeZero(), mapX(), mapY(), VECTOR2< T >::x, DSN::POINT::x, VECTOR2< T >::y, and DSN::POINT::y.
Referenced by DSN::SPECCTRA_DB::fillBOUNDARY(), DSN::SPECCTRA_DB::FromBOARD(), DSN::SPECCTRA_DB::FromSESSION(), DSN::SPECCTRA_DB::makeIMAGE(), DSN::SPECCTRA_DB::makePADSTACK(), DSN::SPECCTRA_DB::makeTRACK(), DSN::SPECCTRA_DB::makeVIA(), and mapPt().
Definition at line 193 of file specctra_export.cpp.
References FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), mapPt(), and RotatePoint().
|
inlinestatic |
|
inlinestatic |
Used by the PADSTACKSET boost::ptr_set below.
Definition at line 2238 of file specctra.h.
References DSN::PADSTACK::Compare().
|
static |
Function scale converts a session file distance to KiCad units of deci-mils.
distance | The session file length to convert. |
aResolution | The session UNIT_RES which holds the engineering unit specifier |
Definition at line 109 of file specctra_import.cpp.
References distance(), DSN::UNIT_RES::GetEngUnits(), DSN::UNIT_RES::GetValue(), and KiROUND().
|
inlinestatic |
Convert a distance from Pcbnew internal units to the reported Specctra DSN units in floating point format.
Convert integer internal units to float um
Definition at line 150 of file specctra_export.cpp.
References EDA_IU_SCALE::IU_PER_MM, and pcbIUScale.