KiCad PCB EDA Suite
|
Works with Eagle 6.x XML board files and footprints to implement the Pcbnew #PLUGIN API or a portion of it. More...
#include <pcb_io_eagle.h>
Public Types | |
typedef int | BIU |
Public Member Functions | |
const IO_BASE::IO_FILE_DESC | GetBoardFileDesc () const override |
Returns board file description for the PCB_IO. | |
const IO_BASE::IO_FILE_DESC | GetLibraryDesc () const override |
Get the descriptor for the library container that this IO plugin operates on. | |
bool | CanReadBoard (const wxString &aFileName) const override |
Checks if this PCB_IO can read the specified board file. | |
bool | CanReadLibrary (const wxString &aFileName) const override |
Checks if this IO object can read the specified library file/directory. | |
bool | CanReadFootprint (const wxString &aFileName) const override |
Checks if this PCB_IO can read a footprint from specified file or directory. | |
BOARD * | LoadBoard (const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr) override |
Load information from some input file format that this PCB_IO implementation knows about into either a new BOARD or an existing one. | |
std::vector< FOOTPRINT * > | GetImportedCachedLibraryFootprints () override |
Return a container with the cached library footprints generated in the last call to Load. | |
void | FootprintEnumerate (wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
Return a list of footprint names contained within the library at aLibraryPath. | |
FOOTPRINT * | FootprintLoad (const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PCB_IO knows about. | |
long long | GetLibraryTimestamp (const wxString &aLibraryPath) const override |
Generate a timestamp representing all the files in the library (including the library directory). | |
bool | IsLibraryWritable (const wxString &aLibraryPath) override |
Return true if the library at aLibraryPath is writable. | |
PCB_IO_EAGLE () | |
~PCB_IO_EAGLE () | |
std::map< wxString, PCB_LAYER_ID > | DefaultLayerMappingCallback (const std::vector< INPUT_LAYER_DESC > &aInputLayerDescriptionVector) |
Return the automapped layers. | |
virtual void | SetQueryUserCallback (std::function< bool(wxString aTitle, int aIcon, wxString aMessage, wxString aAction)> aCallback) |
Registers a KIDIALOG callback for collecting info from the user. | |
virtual void | SaveBoard (const wxString &aFileName, BOARD *aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) |
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be used to write a portion of aBoard to a special kind of export file. | |
virtual FOOTPRINT * | ImportFootprint (const wxString &aFootprintPath, wxString &aFootprintNameOut, const std::map< std::string, UTF8 > *aProperties=nullptr) |
Load a single footprint from aFootprintPath and put its name in aFootprintNameOut. | |
virtual const FOOTPRINT * | GetEnumeratedFootprint (const wxString &aLibraryPath, const wxString &aFootprintName, const std::map< std::string, UTF8 > *aProperties=nullptr) |
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management. | |
virtual bool | FootprintExists (const wxString &aLibraryPath, const wxString &aFootprintName, const std::map< std::string, UTF8 > *aProperties=nullptr) |
Check for the existence of a footprint. | |
virtual void | FootprintSave (const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const std::map< std::string, UTF8 > *aProperties=nullptr) |
Write aFootprint to an existing library located at aLibraryPath. | |
virtual void | FootprintDelete (const wxString &aLibraryPath, const wxString &aFootprintName, const std::map< std::string, UTF8 > *aProperties=nullptr) |
Delete aFootprintName from the library at aLibraryPath. | |
virtual void | GetLibraryOptions (std::map< std::string, UTF8 > *aListToAppendTo) const override |
Append supported PLUGIN options to aListToAppenTo along with internationalized descriptions. | |
const wxString & | GetName () const |
Return a brief hard coded name for this IO interface. | |
virtual void | SetReporter (REPORTER *aReporter) |
Set an optional reporter for warnings/errors. | |
virtual void | SetProgressReporter (PROGRESS_REPORTER *aReporter) |
Set an optional progress reporter. | |
virtual const IO_FILE_DESC | GetLibraryFileDesc () const |
Get the descriptor for the individual library elements that this IO plugin operates on. | |
virtual void | CreateLibrary (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) |
Create a new empty library at aLibraryPath empty. | |
virtual bool | DeleteLibrary (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) |
Delete an existing library and returns true, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason. | |
virtual void | Report (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) |
virtual void | AdvanceProgressPhase () |
virtual void | RegisterCallback (LAYER_MAPPING_HANDLER aLayerMappingHandler) |
Register a different handler to be called when mapping of input layers to KiCad layers occurs. | |
Protected Attributes | |
BOARD * | m_board |
The board BOARD being worked on, no ownership here. | |
const std::map< std::string, UTF8 > * | m_props |
Properties passed via Save() or Load(), no ownership, may be NULL. | |
wxString | m_name |
Name of the IO loader. | |
REPORTER * | m_reporter |
Reporter to log errors/warnings to, may be nullptr. | |
LAYER_MAPPING_HANDLER | m_layer_mapping_handler |
Callback to get layer mapping. | |
Private Types | |
typedef std::vector< ELAYER > | ELAYERS |
typedef ELAYERS::const_iterator | EITER |
Private Member Functions | |
void | init (const std::map< std::string, UTF8 > *aProperties) |
initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed. | |
bool | checkHeader (const wxString &aFileName) const |
void | checkpoint () |
void | clear_cu_map () |
int | kicad_y (const ECOORD &y) const |
Convert an Eagle distance to a KiCad distance. | |
int | kicad_x (const ECOORD &x) const |
VECTOR2I | kicad_fontsize (const ECOORD &d, int aTextThickness) const |
create a font size (fontz) from an eagle font size scalar and KiCad font thickness | |
void | mapEagleLayersToKicad (bool aIsLibraryCache=false) |
Generate mapping between Eagle and KiCad layers. | |
PCB_LAYER_ID | kicad_layer (int aLayer) const |
Convert an Eagle layer to a KiCad layer. | |
std::tuple< PCB_LAYER_ID, LSET, bool > | defaultKicadLayer (int aEagleLayer, bool aIsLibraryCache=false) const |
Get the default KiCad layer corresponding to an Eagle layer of the board, a set of sensible layer mapping options and required flag. | |
const wxString & | eagle_layer_name (int aLayer) const |
Get Eagle layer name by its number. | |
int | eagle_layer_id (const wxString &aLayerName) const |
Get Eagle layer number by its name. | |
void | setKeepoutSettingsToZone (ZONE *aZone, int aLayer) const |
void | cacheLib (const wxString &aLibraryPath) |
This PLUGIN only caches one footprint library, this determines which one. | |
int | getMinimumCopperLayerCount () const |
Determines the minimum copper layer stackup count that includes all mapped layers. | |
void | loadAllSections (wxXmlNode *aDocument) |
void | loadDesignRules (wxXmlNode *aDesignRules) |
void | loadLayerDefs (wxXmlNode *aLayers) |
void | loadPlain (wxXmlNode *aPlain) |
void | loadClasses (wxXmlNode *aClasses) |
void | loadSignals (wxXmlNode *aSignals) |
void | loadLibrary (wxXmlNode *aLib, const wxString *aLibName) |
Load the Eagle "library" XML element, which can occur either under a "libraries" element (if a *.brd file) or under a "drawing" element if a *.lbr file. | |
void | loadLibraries (wxXmlNode *aLibs) |
void | loadElements (wxXmlNode *aElements) |
ZONE * | loadPolygon (wxXmlNode *aPolyNode) |
Load a copper or keepout polygon and adds it to the board. | |
void | orientFootprintAndText (FOOTPRINT *aFootprint, const EELEMENT &e, const EATTR *aNameAttr, const EATTR *aValueAttr) |
void | orientFPText (FOOTPRINT *aFootprint, const EELEMENT &e, PCB_TEXT *aFPText, const EATTR *aAttr) |
void | centerBoard () |
move the BOARD into the center of the page | |
FOOTPRINT * | makeFootprint (wxXmlNode *aPackage, const wxString &aPkgName) |
Create a FOOTPRINT from an Eagle package. | |
void | packageWire (FOOTPRINT *aFootprint, wxXmlNode *aTree) const |
void | packagePad (FOOTPRINT *aFootprint, wxXmlNode *aTree) |
void | packageText (FOOTPRINT *aFootprint, wxXmlNode *aTree) const |
void | packageRectangle (FOOTPRINT *aFootprint, wxXmlNode *aTree) const |
void | packagePolygon (FOOTPRINT *aFootprint, wxXmlNode *aTree) const |
void | packageCircle (FOOTPRINT *aFootprint, wxXmlNode *aTree) const |
void | packageHole (FOOTPRINT *aFootprint, wxXmlNode *aTree, bool aCenter) const |
void | packageSMD (FOOTPRINT *aFootprint, wxXmlNode *aTree) const |
Handles common pad properties. | |
void | transferPad (const EPAD_COMMON &aEaglePad, PAD *aPad) const |
Deletes the footprint templates list. | |
void | deleteTemplates () |
Static Private Member Functions | |
static wxDateTime | getModificationTime (const wxString &aPath) |
get a file's or dir's modification time. | |
Private Attributes | |
int | m_cu_map [17] |
map eagle to KiCad, cu layers only. | |
std::map< int, ELAYER > | m_eagleLayers |
Eagle layer data stored by layer number. | |
std::map< wxString, int > | m_eagleLayersIds |
Eagle layer ids stored by layer name. | |
std::map< wxString, PCB_LAYER_ID > | m_layer_map |
Map of Eagle layers to KiCad layers. | |
std::map< wxString, std::shared_ptr< NETCLASS > > | m_classMap |
wxString | m_customRules |
ERULES * | m_rules |
Eagle design rules. | |
XPATH * | m_xpath |
keeps track of what we are working on within XML document during a Load(). | |
int | m_hole_count |
generates unique footprint names from eagle "hole"s. | |
NET_MAP | m_pads_to_nets |
net list | |
std::map< wxString, FOOTPRINT * > | m_templates |
is part of a FOOTPRINT factory that operates using copy construction. | |
PROGRESS_REPORTER * | m_progressReporter |
optional; may be nullptr | |
unsigned | m_doneCount |
unsigned | m_lastProgressCount |
unsigned | m_totalCount |
for progress reporting | |
int | m_min_trace |
smallest trace we find on Load(), in BIU. | |
int | m_min_hole |
smallest diameter hole we find on Load(), in BIU. | |
int | m_min_via |
smallest via we find on Load(), in BIU. | |
int | m_min_annulus |
smallest via annulus we find on Load(), in BIU. | |
wxString | m_lib_path |
long long | m_timestamp |
Works with Eagle 6.x XML board files and footprints to implement the Pcbnew #PLUGIN API or a portion of it.
Definition at line 132 of file pcb_io_eagle.h.
typedef int PCB_IO_EAGLE::BIU |
Definition at line 168 of file pcb_io_eagle.h.
|
private |
Definition at line 324 of file pcb_io_eagle.h.
|
private |
Definition at line 323 of file pcb_io_eagle.h.
PCB_IO_EAGLE::PCB_IO_EAGLE | ( | ) |
Definition at line 224 of file pcb_io_eagle.cpp.
References clear_cu_map(), DefaultLayerMappingCallback(), init(), m_doneCount, m_lastProgressCount, m_progressReporter, m_rules, m_timestamp, m_totalCount, m_xpath, PCB_IO::PCB_IO(), and LAYER_MAPPABLE_PLUGIN::RegisterCallback().
PCB_IO_EAGLE::~PCB_IO_EAGLE | ( | ) |
Definition at line 242 of file pcb_io_eagle.cpp.
References deleteTemplates(), m_rules, and m_xpath.
|
virtualinherited |
Definition at line 133 of file io_base.cpp.
References _, m_progressReporter, and THROW_IO_ERROR.
|
private |
This PLUGIN only caches one footprint library, this determines which one.
Definition at line 3187 of file pcb_io_eagle.cpp.
References _, clear_cu_map(), deleteTemplates(), GetLibraryTimestamp(), library, loadLayerDefs(), loadLibrary(), m_lib_path, m_timestamp, m_xpath, MapChildren(), mapEagleLayersToKicad(), fontconfig::FONTCONFIG::SetReporter(), and THROW_IO_ERROR.
Referenced by FootprintEnumerate(), and FootprintLoad().
|
overridevirtual |
Checks if this PCB_IO can read the specified board file.
If not overriden, extension check is used.
Reimplemented from PCB_IO.
Definition at line 250 of file pcb_io_eagle.cpp.
References PCB_IO::CanReadBoard(), and checkHeader().
|
overridevirtual |
Checks if this PCB_IO can read a footprint from specified file or directory.
If not overriden, extension check is used.
Reimplemented from PCB_IO.
Definition at line 268 of file pcb_io_eagle.cpp.
References CanReadLibrary().
|
overridevirtual |
Checks if this IO object can read the specified library file/directory.
If not overridden, extension check is used.
Reimplemented from IO_BASE.
Definition at line 259 of file pcb_io_eagle.cpp.
References IO_BASE::CanReadLibrary(), and checkHeader().
Referenced by CanReadFootprint().
|
private |
move the BOARD into the center of the page
Definition at line 3143 of file pcb_io_eagle.cpp.
References UTF8::c_str(), UTF8::empty(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), PCB_IO::m_board, and PCB_IO::m_props.
Referenced by LoadBoard().
|
private |
Definition at line 274 of file pcb_io_eagle.cpp.
References text.
Referenced by CanReadBoard(), and CanReadLibrary().
|
private |
Definition at line 296 of file pcb_io_eagle.cpp.
References _, m_doneCount, m_lastProgressCount, m_progressReporter, m_totalCount, and THROW_IO_ERROR.
Referenced by loadClasses(), loadDesignRules(), loadElements(), loadLibrary(), loadPlain(), and loadSignals().
|
private |
Definition at line 483 of file pcb_io_eagle.cpp.
References arrayDim(), and m_cu_map.
Referenced by cacheLib(), and PCB_IO_EAGLE().
|
virtualinherited |
Create a new empty library at aLibraryPath empty.
It is an error to attempt to create an existing library or to attempt to create on a "read only" location.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several elements. |
aProperties | is an associative array that can be used to tell the library create function anything special, because it can take any number of additional named tuning arguments that the IO is known to support. The caller continues to own this object (IO may not delete it), and IOs should expect it to be optionally NULL. |
IO_ERROR | if there is a problem finding the library, or creating it. |
Reimplemented in DESIGN_BLOCK_IO, PCB_IO_KICAD_SEXPR, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 46 of file io_base.cpp.
References NOT_IMPLEMENTED.
|
private |
Get the default KiCad layer corresponding to an Eagle layer of the board, a set of sensible layer mapping options and required flag.
aEagleLayer | is the Eagle layer to map. |
aIsLibraryCache | is a flag to indicate if the mapping is for board or footprint library cache objects. |
Definition at line 2993 of file pcb_io_eagle.cpp.
References arrayDim(), B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, EAGLE_LAYER::BCREAM, EAGLE_LAYER::BDOCU, EAGLE_LAYER::BFINISH, EAGLE_LAYER::BGLUE, EAGLE_LAYER::BKEEPOUT, EAGLE_LAYER::BNAMES, EAGLE_LAYER::BPLACE, EAGLE_LAYER::BSTOP, EAGLE_LAYER::BTEST, EAGLE_LAYER::BVALUES, Cmts_User, EAGLE_LAYER::DIMENSION, EAGLE_LAYER::DOCUMENT, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, EAGLE_LAYER::HOLES, m_cu_map, EAGLE_LAYER::MILLING, EAGLE_LAYER::REFERENCELC, EAGLE_LAYER::REFERENCELS, BASE_SET::set(), EAGLE_LAYER::TCREAM, EAGLE_LAYER::TDOCU, EAGLE_LAYER::TFINISH, EAGLE_LAYER::TGLUE, EAGLE_LAYER::TKEEPOUT, EAGLE_LAYER::TNAMES, EAGLE_LAYER::TPLACE, EAGLE_LAYER::TSTOP, EAGLE_LAYER::TTEST, EAGLE_LAYER::TVALUES, UNDEFINED_LAYER, EAGLE_LAYER::UNROUTED, UNSELECTED_LAYER, EAGLE_LAYER::USERLAYER1, and EAGLE_LAYER::USERLAYER2.
Referenced by DefaultLayerMappingCallback(), and mapEagleLayersToKicad().
std::map< wxString, PCB_LAYER_ID > PCB_IO_EAGLE::DefaultLayerMappingCallback | ( | const std::vector< INPUT_LAYER_DESC > & | aInputLayerDescriptionVector | ) |
Return the automapped layers.
The callback needs to have the context of the current board so it can correctly determine copper layer mapping. Thus, it is not static and is expected to be bind to an instance of PCB_IO_EAGLE.
aInputLayerDescriptionVector |
Definition at line 2941 of file pcb_io_eagle.cpp.
References defaultKicadLayer(), and eagle_layer_id().
Referenced by PCB_IO_EAGLE().
|
virtualinherited |
Delete an existing library and returns true, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason.
aLibraryPath | is a locator for the "library", usually a directory or file which will contain several elements. |
aProperties | is an associative array that can be used to tell the library delete implementation function anything special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem deleting an existing library. |
Reimplemented in DESIGN_BLOCK_IO, PCB_IO_GEDA, PCB_IO_KICAD_LEGACY, PCB_IO_KICAD_SEXPR, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 53 of file io_base.cpp.
References NOT_IMPLEMENTED.
|
private |
Definition at line 2598 of file pcb_io_eagle.cpp.
References m_templates, and name.
Referenced by cacheLib(), and ~PCB_IO_EAGLE().
|
private |
Get Eagle layer number by its name.
Definition at line 3135 of file pcb_io_eagle.cpp.
References m_eagleLayersIds, and unknown.
Referenced by DefaultLayerMappingCallback().
|
private |
Get Eagle layer name by its number.
Definition at line 3127 of file pcb_io_eagle.cpp.
References m_eagleLayers, and unknown.
Referenced by kicad_layer(), loadPolygon(), packageCircle(), packagePolygon(), packageRectangle(), packageText(), and packageWire().
|
virtualinherited |
Delete aFootprintName from the library at aLibraryPath.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aFootprintName | is the name of a footprint to delete from the specified library. |
aProperties | is an associative array that can be used to tell the library delete function anything special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem finding the footprint or the library, or deleting it. |
Reimplemented in PCB_IO_GEDA, and PCB_IO_KICAD_SEXPR.
Definition at line 160 of file pcb_io.cpp.
References NOT_IMPLEMENTED.
|
overridevirtual |
Return a list of footprint names contained within the library at aLibraryPath.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aProperties | is an associative array that can be used to tell the plugin anything needed about how to perform with respect to aLibraryPath. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
aFootprintNames | is the array of available footprint names inside a library. |
aBestEfforts | if true, don't throw on errors, just return an empty list. |
IO_ERROR | if the library cannot be found, or footprint cannot be loaded. |
Reimplemented from PCB_IO.
Definition at line 3267 of file pcb_io_eagle.cpp.
References cacheLib(), init(), m_templates, name, THROW_IO_ERROR, and IO_ERROR::What().
|
virtualinherited |
Check for the existence of a footprint.
Reimplemented in PCB_IO_CADSTAR_ARCHIVE, and PCB_IO_KICAD_SEXPR.
Definition at line 136 of file pcb_io.cpp.
References FootprintLoad().
|
overridevirtual |
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PCB_IO knows about.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aFootprintName | is the name of the footprint to load. |
aProperties | is an associative array that can be used to tell the loader implementation to do something special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
aKeepUUID | = true to keep initial items UUID, false to set new UUID normally true if loaded in the footprint editor, false if loaded in the board editor. Make sense only in kicad_plugin |
IO_ERROR | if the library cannot be found or read. No exception is thrown in the case where aFootprintName cannot be found. |
Reimplemented from PCB_IO.
Definition at line 3294 of file pcb_io_eagle.cpp.
References cacheLib(), copy, IGNORE_PARENT_GROUP, init(), and m_templates.
|
virtualinherited |
Write aFootprint to an existing library located at aLibraryPath.
If a footprint by the same name already exists, it is replaced.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aFootprint | is what to store in the library. The caller continues to own the footprint after this call. |
aProperties | is an associative array that can be used to tell the saver how to save the footprint, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem saving. |
Reimplemented in PCB_IO_KICAD_SEXPR.
Definition at line 152 of file pcb_io.cpp.
References NOT_IMPLEMENTED.
|
inlineoverridevirtual |
Returns board file description for the PCB_IO.
Reimplemented from PCB_IO.
Definition at line 135 of file pcb_io_eagle.h.
References _HKI.
|
virtualinherited |
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
Reimplemented in PCB_IO_KICAD_SEXPR.
Definition at line 127 of file pcb_io.cpp.
References FootprintLoad().
|
overridevirtual |
Return a container with the cached library footprints generated in the last call to Load.
This function is intended to be used ONLY by the non-KiCad board importers for the purpose of obtaining the footprint library of the design and creating a project-specific library.
Reimplemented from PCB_IO.
Definition at line 453 of file pcb_io_eagle.cpp.
References m_templates, and name.
|
inlineoverridevirtual |
Get the descriptor for the library container that this IO plugin operates on.
Implements IO_BASE.
Definition at line 140 of file pcb_io_eagle.h.
References _HKI.
|
inlinevirtualinherited |
Get the descriptor for the individual library elements that this IO plugin operates on.
For libraries where all the elements are in a single container (e.g. all elements in a single file), then this will return the descriptor from IO_BASE::GetLibraryDesc().
Reimplemented in PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO, PCB_IO_GEDA, and PCB_IO_KICAD_SEXPR.
Definition at line 112 of file io_base.h.
References GetLibraryDesc().
Referenced by PCB_IO::CanReadFootprint().
|
overridevirtualinherited |
Append supported PLUGIN options to aListToAppenTo along with internationalized descriptions.
Options are typically appended so that a derived #PLUGIN can call its base class function by the same name first, thus inheriting options declared there. Some base class options could pertain to all Footprint*() functions in all derived PLUGINs.
aListToAppendTo | holds a tuple of
In the future perhaps aListToAppendTo evolves to something capable of also holding a wxValidator for the cells in said dialog: http://forums.wxwidgets.org/viewtopic.php?t=23277&p=104180. This would require a 3 column list, and introducing wx GUI knowledge to PLUGIN, which has been avoided to date. |
Reimplemented from IO_BASE.
Definition at line 168 of file pcb_io.cpp.
References _, and IO_BASE::GetLibraryOptions().
|
overridevirtual |
Generate a timestamp representing all the files in the library (including the library directory).
Timestamps should not be considered ordered, they either match or they don't.
Implements PCB_IO.
Definition at line 3172 of file pcb_io_eagle.cpp.
Referenced by cacheLib().
|
private |
Determines the minimum copper layer stackup count that includes all mapped layers.
Definition at line 3311 of file pcb_io_eagle.cpp.
References B_Cu, CopperLayerToOrdinal(), F_Cu, IsCopperLayer(), and m_layer_map.
Referenced by LoadBoard().
|
staticprivate |
get a file's or dir's modification time.
|
inlineinherited |
Return a brief hard coded name for this IO interface.
Definition at line 79 of file io_base.h.
References m_name.
Referenced by SCH_IO_ALTIUM::ParseLibFile().
|
virtualinherited |
Load a single footprint from aFootprintPath and put its name in aFootprintNameOut.
If this is a footprint library, the first footprint should be loaded. The default implementation uses FootprintEnumerate and FootprintLoad to load first footprint.
aLibraryPath | is a path of the footprint file. |
aFootprintNameOut | is the name output of the loaded footprint. |
aProperties | is an associative array that can be used to tell the loader implementation to do something special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if the footprint cannot be found or read. |
Reimplemented in PCB_IO_GEDA, and PCB_IO_KICAD_SEXPR.
Definition at line 103 of file pcb_io.cpp.
References _, FootprintEnumerate(), and FootprintLoad().
|
private |
initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
Definition at line 464 of file pcb_io_eagle.cpp.
References PCB_IO::m_board, m_hole_count, m_min_annulus, m_min_hole, m_min_trace, m_min_via, m_pads_to_nets, PCB_IO::m_props, m_rules, and m_xpath.
Referenced by FootprintEnumerate(), FootprintLoad(), LoadBoard(), and PCB_IO_EAGLE().
|
inlineoverridevirtual |
Return true if the library at aLibraryPath is writable.
The system libraries are typically read only because of where they are installed..
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
IO_ERROR | if no library at aLibraryPath exists. |
Reimplemented from IO_BASE.
Definition at line 163 of file pcb_io_eagle.h.
create a font size (fontz) from an eagle font size scalar and KiCad font thickness
Definition at line 315 of file pcb_io_eagle.cpp.
References ECOORD::ToPcbUnits().
Referenced by loadPlain(), orientFPText(), and packageText().
|
private |
Convert an Eagle layer to a KiCad layer.
Definition at line 2986 of file pcb_io_eagle.cpp.
References eagle_layer_name(), m_layer_map, result, and UNDEFINED_LAYER.
Referenced by loadLayerDefs(), loadPlain(), loadPolygon(), loadSignals(), makeFootprint(), packageCircle(), packagePolygon(), packageRectangle(), packageSMD(), packageText(), packageWire(), and setKeepoutSettingsToZone().
|
inlineprivate |
Definition at line 198 of file pcb_io_eagle.h.
References ECOORD::ToPcbUnits().
Referenced by loadElements(), loadPlain(), loadPolygon(), loadSignals(), orientFPText(), packageCircle(), packageHole(), packagePolygon(), packageRectangle(), packageText(), packageWire(), and transferPad().
|
inlineprivate |
Convert an Eagle distance to a KiCad distance.
Definition at line 197 of file pcb_io_eagle.h.
References ECOORD::ToPcbUnits().
Referenced by loadElements(), loadPlain(), loadPolygon(), loadSignals(), orientFPText(), packageCircle(), packageHole(), packagePolygon(), packageRectangle(), packageText(), packageWire(), and transferPad().
|
private |
Definition at line 492 of file pcb_io_eagle.cpp.
References loadClasses(), loadDesignRules(), loadElements(), loadLayerDefs(), loadLibraries(), loadPlain(), loadSignals(), m_doneCount, m_progressReporter, m_totalCount, m_xpath, MapChildren(), and mapEagleLayersToKicad().
Referenced by LoadBoard().
|
overridevirtual |
Load information from some input file format that this PCB_IO implementation knows about into either a new BOARD or an existing one.
This may be used to load an entire new BOARD, or to augment an existing one if aAppendToMe is not NULL.
aFileName | is the name of the file to use as input and may be foreign in nature or native in nature. |
aAppendToMe | is an existing BOARD to append to, but if NULL then this means "do not append, rather load anew". |
aProperties | is an associative array that can be used to tell the loader how to load the file, because it can take any number of additional named arguments that the plugin is known to support. These are tuning parameters for the import or load. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
aProject | is the optional PROJECT object primarily used by third party importers. |
IO_ERROR | if there is a problem loading, and its contents should say what went wrong, using line number and character offsets of the input file if possible. |
Reimplemented from PCB_IO.
Definition at line 323 of file pcb_io_eagle.cpp.
References _, BOARD, centerBoard(), WXLOG_REPORTER::GetInstance(), getMinimumCopperLayerCount(), NETCLASS::GetTrackWidth(), NETCLASS::GetViaDiameter(), NETCLASS::GetViaDrill(), init(), KiROUND(), loadAllSections(), PCB_IO::m_board, m_customRules, m_layer_map, m_min_annulus, m_min_hole, m_min_trace, m_min_via, BOARD_DESIGN_SETTINGS::m_MinClearance, BOARD_DESIGN_SETTINGS::m_MinThroughDrill, BOARD_DESIGN_SETTINGS::m_NetSettings, m_progressReporter, m_rules, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, BOARD_DESIGN_SETTINGS::m_ViasMinAnnularWidth, BOARD_DESIGN_SETTINGS::m_ViasMinSize, m_xpath, name, BASE_SET::set(), fontconfig::FONTCONFIG::SetReporter(), and THROW_IO_ERROR.
|
private |
Definition at line 2610 of file pcb_io_eagle.cpp.
References checkpoint(), NET_SETTINGS::GetDefaultNetclass(), PCB_IO::m_board, m_classMap, m_customRules, BOARD_DESIGN_SETTINGS::m_NetSettings, m_xpath, MM, ECLASS::name, ECLASS::number, pcbIUScale, NET_SETTINGS::SetNetclass(), and EDA_UNIT_UTILS::UI::StringFromValue().
Referenced by loadAllSections().
|
private |
Definition at line 579 of file pcb_io_eagle.cpp.
References checkpoint(), m_rules, and m_xpath.
Referenced by loadAllSections().
|
private |
Definition at line 1248 of file pcb_io_eagle.cpp.
References _, APPEND, EURN::assetId, EATTR::BOTH, checkpoint(), EATTR::display, FOOTPRINT::GetReference(), FOOTPRINT::GetValue(), IGNORE_PARENT_GROUP, kicad_x(), kicad_y(), EELEMENT::library, EELEMENT::library_urn, PCB_IO::m_board, m_pads_to_nets, m_templates, m_xpath, makeKey(), EATTR::NAME, EATTR::name, EELEMENT::name, name, ENET::netcode, EATTR::Off, orientFootprintAndText(), EELEMENT::package, pad, FOOTPRINT::Pads(), FOOTPRINT::Reference(), FOOTPRINT::SetPosition(), FOOTPRINT::SetReference(), FOOTPRINT::SetValue(), EDA_TEXT::SetVisible(), EELEMENT::smashed, THROW_IO_ERROR, EATTR::VALUE, FOOTPRINT::Value(), EATTR::value, EELEMENT::value, EELEMENT::x, and EELEMENT::y.
Referenced by loadAllSections().
|
private |
Definition at line 594 of file pcb_io_eagle.cpp.
References ELAYER::active, B_Cu, BoardLayerFromLegacyId(), F_Cu, kicad_layer(), LT_SIGNAL, PCB_IO::m_board, m_cu_map, m_eagleLayers, m_eagleLayersIds, ELAYER::name, ELAYER::number, and PCB_LAYER_ID_COUNT.
Referenced by cacheLib(), and loadAllSections().
|
private |
Definition at line 1225 of file pcb_io_eagle.cpp.
References library, loadLibrary(), and m_xpath.
Referenced by loadAllSections().
|
private |
Load the Eagle "library" XML element, which can occur either under a "libraries" element (if a *.brd file) or under a "drawing" element if a *.lbr file.
aLib | is the portion of the loaded XML document tree that is the "library" element. |
aLibName | is a pointer to the library name or NULL. If NULL this means we are loading a *.lbr not a *.brd file and the key used in m_templates is to exclude the library name. |
Definition at line 1156 of file pcb_io_eagle.cpp.
References _, checkpoint(), m_lib_path, m_templates, m_xpath, makeFootprint(), makeKey(), MapChildren(), ReplaceIllegalFileNameChars(), and THROW_IO_ERROR.
Referenced by cacheLib(), and loadLibraries().
|
private |
Definition at line 665 of file pcb_io_eagle.cpp.
References std::abs(), ETEXT::align, ANGLE_0, ANGLE_360, APPEND, ZONE::AppendCorner(), ARC, ARC_HIGH_DEF, ETEXT::BOTTOM_CENTER, ETEXT::BOTTOM_LEFT, ETEXT::BOTTOM_RIGHT, EAGLE_LAYER::BRESTRICT, ETEXT::CENTER, center, ETEXT::CENTER_LEFT, ETEXT::CENTER_RIGHT, checkpoint(), CIRCLE, ConvertArcCenter(), EWIRE::curve, EROT::degrees, DEGREES_T, delta, DIAGONAL_EDGE, DIMENSION_PRECISION, EDIMENSION::dimensionType, VECTOR2< T >::Distance(), end, FOOTPRINT, FULL_CIRCLE, GetArcToSegmentCount(), PCB_TEXT::GetBoundingBox(), ZONE::GetDefaultHatchPitch(), BOX2< Vec >::GetHeight(), EDA_TEXT::GetHorizJustify(), BOARD_DESIGN_SETTINGS::GetLineThickness(), BOARD_DESIGN_SETTINGS::GetTextSize(), EDA_TEXT::GetVertJustify(), BOX2< Vec >::GetWidth(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_TOP, interpretText(), EDA_TEXT::IsMirrored(), kicad_fontsize(), kicad_layer(), kicad_x(), kicad_y(), KiROUND(), ECIRCLE::layer, EDIMENSION::layer, ERECT::layer, ETEXT::layer, EWIRE::layer, loadPolygon(), PCB_IO::m_board, m_hole_count, m_xpath, EROT::mirror, MM, ZONE::NewHole(), packageHole(), PCB_DIM_ALIGNED_T, ECIRCLE::radius, radius, ETEXT::ratio, FOOTPRINT::Reference(), ERECT::rot, ETEXT::rot, ZONE::Rotate(), RotatePoint(), SEGMENT, EDA_SHAPE::SetArcAngleAndEnd(), ZONE::SetBorderDisplayStyle(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), PCB_DIMENSION_BASE::SetEnd(), EDA_SHAPE::SetFilled(), FOOTPRINT::SetFPID(), PCB_DIM_ALIGNED::SetHeight(), EDA_TEXT::SetHorizJustify(), setKeepoutSettingsToZone(), EDA_TEXT::SetKeepUpright(), BOARD_ITEM::SetLayer(), PCB_SHAPE::SetLayer(), ZONE::SetLayer(), PCB_DIMENSION_BASE::SetLineThickness(), EDA_TEXT::SetMirrored(), BOARD_CONNECTED_ITEM::SetNetCode(), PCB_DIMENSION_BASE::SetOverrideText(), PCB_DIMENSION_BASE::SetPrecision(), FOOTPRINT::SetReference(), EDA_SHAPE::SetShape(), EDA_SHAPE::SetStart(), PCB_DIMENSION_BASE::SetStart(), PCB_SHAPE::SetStroke(), EDA_TEXT::SetText(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetTextPos(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetTextThickness(), PCB_DIMENSION_BASE::SetUnits(), EDA_TEXT::SetVertJustify(), EDA_TEXT::SetVisible(), ETEXT::size, SOLID, EROT::spin, ETEXT::text, EDIMENSION::textsize, ETEXT::TOP_CENTER, ETEXT::TOP_LEFT, ETEXT::TOP_RIGHT, ECOORD::ToPcbUnits(), EAGLE_LAYER::TRESTRICT, NETINFO_LIST::UNCONNECTED, UNDEFINED_LAYER, EAGLE_LAYER::VRESTRICT, ECIRCLE::width, EWIRE::width, ECIRCLE::x, ETEXT::x, VECTOR2< T >::x, EDIMENSION::x1, ERECT::x1, EWIRE::x1, EDIMENSION::x2, ERECT::x2, EWIRE::x2, EDIMENSION::x3, ECIRCLE::y, ETEXT::y, VECTOR2< T >::y, EDIMENSION::y1, ERECT::y1, EWIRE::y1, EDIMENSION::y2, ERECT::y2, EWIRE::y2, and EDIMENSION::y3.
Referenced by loadAllSections().
|
private |
Load a copper or keepout polygon and adds it to the board.
Definition at line 1515 of file pcb_io_eagle.cpp.
References _, ALLOW_ACUTE_CORNERS, ALWAYS, ANGLE_0, APPEND, SHAPE_POLY_SET::Append(), ARC_HIGH_DEF, EAGLE_LAYER::BRESTRICT, center, ConvertArcCenter(), SHAPE_POLY_SET::COutline(), DEG2RAD(), DEGREES_T, eagle_layer_name(), EPOLYGON::ECUTOUT, EPOLYGON::EHATCH, FULL, OPTIONAL_XML_ATTRIBUTE< T >::Get(), GetArcToSegmentCount(), HATCH_PATTERN, SHAPE_POLY_SET::Inflate(), EPOLYGON::isolate, kicad_layer(), kicad_x(), kicad_y(), KiROUND(), EPOLYGON::layer, PCB_IO::m_board, EPOLYGON::max_priority, NEVER, SHAPE_POLY_SET::NewOutline(), NO_HATCH, EPOLYGON::orphans, SHAPE_POLY_SET::OutlineCount(), pcbIUScale, EPOLYGON::pour, radius, EPOLYGON::rank, setKeepoutSettingsToZone(), EPOLYGON::spacing, THERMAL, EPOLYGON::thermals, ECOORD::ToPcbUnits(), EAGLE_LAYER::TRESTRICT, UNDEFINED_LAYER, v1, v2, EAGLE_LAYER::VRESTRICT, EPOLYGON::width, and ZONE_THICKNESS_MIN_VALUE_MM.
Referenced by loadPlain(), and loadSignals().
|
private |
This is, at best, a guess. Eagle doesn't seem to differentiate between blind/buried vias that only go one layer and micro vias so the user will need to clean up a bit
Definition at line 2678 of file pcb_io_eagle.cpp.
References std::abs(), PADSTACK::ALL_LAYERS, B_Cu, BLIND_BURIED, CalcArcMid(), center, checkpoint(), ConvertArcCenter(), EWIRE::curve, EVIA::diam, EVIA::drill, eagleClamp(), end, escapeName(), F_Cu, IsCopperLayer(), kicad_layer(), kicad_x(), kicad_y(), KiROUND(), EWIRE::layer, EVIA::layer_back_most, EVIA::layer_front_most, loadPolygon(), PCB_IO::m_board, m_classMap, m_min_annulus, m_min_hole, m_min_trace, m_min_via, BOARD_DESIGN_SETTINGS::m_NetSettings, m_pads_to_nets, m_rules, m_xpath, makeKey(), MICROVIA, pad, radius, PCB_TRACK::SetEnd(), BOARD_ITEM::SetLayer(), PCB_ARC::SetMid(), NETINFO_ITEM::SetNetClass(), NET_SETTINGS::SetNetclassPatternAssignment(), BOARD_CONNECTED_ITEM::SetNetCode(), PCB_ARC::SetPosition(), PCB_TRACK::SetPosition(), PCB_TRACK::SetWidth(), THROUGH, ECOORD::ToPcbUnits(), NETINFO_LIST::UNCONNECTED, via, EWIRE::width, EVIA::x, EWIRE::x1, EWIRE::x2, EVIA::y, EWIRE::y1, and EWIRE::y2.
Referenced by loadAllSections().
|
private |
Create a FOOTPRINT from an Eagle package.
Definition at line 1851 of file pcb_io_eagle.cpp.
References convertDescription(), kicad_layer(), PCB_IO::m_board, packageCircle(), packageHole(), packagePad(), packagePolygon(), packageRectangle(), packageSMD(), packageText(), packageWire(), LIB_ID::Parse(), and UnescapeHTML().
Referenced by loadLibrary().
|
private |
Generate mapping between Eagle and KiCad layers.
aIsLibraryCache | is the flag to indicate when mapping the footprint library cache layers rather than the board layers. |
Definition at line 2956 of file pcb_io_eagle.cpp.
References INPUT_LAYER_DESC::AutoMapLayer, defaultKicadLayer(), m_eagleLayers, m_layer_map, LAYER_MAPPABLE_PLUGIN::m_layer_mapping_handler, m_progressReporter, INPUT_LAYER_DESC::Name, ELAYER::name, ELAYER::number, INPUT_LAYER_DESC::PermittedLayers, INPUT_LAYER_DESC::Required, and UNDEFINED_LAYER.
Referenced by cacheLib(), and loadAllSections().
|
private |
Definition at line 1666 of file pcb_io_eagle.cpp.
References EROT::degrees, DEGREES_T, FOOTPRINT::Flip(), FOOTPRINT::GetPosition(), EROT::mirror, orientFPText(), FOOTPRINT::Reference(), EELEMENT::rot, FOOTPRINT::SetOrientation(), TOP_BOTTOM, and FOOTPRINT::Value().
Referenced by loadElements().
|
private |
Definition at line 1687 of file pcb_io_eagle.cpp.
References std::abs(), EATTR::align, EDA_ANGLE::AsDegrees(), ETEXT::BOTTOM_CENTER, ETEXT::BOTTOM_LEFT, ETEXT::BOTTOM_RIGHT, ETEXT::CENTER, ETEXT::CENTER_LEFT, ETEXT::CENTER_RIGHT, EROT::degrees, DEGREES_T, EDA_TEXT::GetHorizJustify(), FOOTPRINT::GetOrientation(), EDA_TEXT::GetTextAngle(), EDA_TEXT::GetTextSize(), EDA_TEXT::GetVertJustify(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_TOP, EDA_TEXT::IsMirrored(), kicad_fontsize(), kicad_x(), kicad_y(), KiROUND(), EROT::mirror, EATTR::ratio, EATTR::rot, EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetMirrored(), EDA_TEXT::SetText(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetTextPos(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetTextThickness(), EDA_TEXT::SetVertJustify(), sign(), EATTR::size, EROT::spin, ETEXT::TOP_CENTER, ETEXT::TOP_LEFT, ETEXT::TOP_RIGHT, EATTR::value, EATTR::x, EATTR::y, and VECTOR2< T >::y.
Referenced by orientFootprintAndText().
|
private |
Definition at line 2368 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), ANGLE_0, ANGLE_360, APPEND, ZONE::AppendCorner(), ARC_HIGH_DEF, EAGLE_LAYER::BRESTRICT, center, CIRCLE, Cmts_User, delta, DIAGONAL_EDGE, eagle_layer_name(), FULL_CIRCLE, GetArcToSegmentCount(), ZONE::GetDefaultHatchPitch(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), kicad_layer(), kicad_x(), kicad_y(), ECIRCLE::layer, PCB_SHAPE::Move(), ZONE::NewHole(), ECIRCLE::radius, radius, PCB_SHAPE::Rotate(), RotatePoint(), ZONE::SetBorderDisplayStyle(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFilled(), setKeepoutSettingsToZone(), PCB_SHAPE::SetLayer(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), SOLID, ECOORD::ToPcbUnits(), EAGLE_LAYER::TRESTRICT, UNDEFINED_LAYER, EAGLE_LAYER::VRESTRICT, ECIRCLE::width, ECIRCLE::x, and ECIRCLE::y.
Referenced by makeFootprint().
|
private |
aFootprint | The KiCad footprint to which to assign the hole. |
aTree | The Eagle XML node that is of type "hole". |
aCenter | If true, center the hole in the footprint and offset the footprint position. |
Definition at line 2458 of file pcb_io_eagle.cpp.
References FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, LSET::AllCuMask(), B_Mask, CIRCLE, EHOLE::drill, F_Mask, FOOTPRINT::GetPosition(), kicad_x(), kicad_y(), NPTH, PAD, pad, FOOTPRINT::SetPosition(), ECOORD::ToPcbUnits(), ECOORD::value, EHOLE::x, and EHOLE::y.
Referenced by loadPlain(), and makeFootprint().
|
private |
Definition at line 1973 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, LSET::AllCuMask(), ANGLE_0, B_Cu, B_Mask, CHAMFERED_RECT, CIRCLE, EROT::degrees, DEGREES_T, EPAD::diameter, EPAD::drill, eagleClamp(), F_Cu, F_Mask, EPAD::first, FOOTPRINT::GetLayer(), KiROUND(), EPAD::LONG, PCB_IO::m_board, m_lib_path, m_min_hole, m_rules, EPAD::OCTAGON, EPAD::OFFSET, OVAL, pad, RECT_CHAMFER_ALL, RECTANGLE, EPAD_COMMON::rot, EPAD::ROUND, EPAD::shape, EPAD::SQUARE, EPAD_COMMON::stop, ECOORD::ToPcbUnits(), transferPad(), EPAD::UNDEF, ECOORD::value, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by makeFootprint().
|
private |
Definition at line 2265 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), SHAPE_POLY_SET::AddOutline(), ALLOW_ACUTE_CORNERS, APPEND, ARC_HIGH_DEF, EAGLE_LAYER::BRESTRICT, center, ConvertArcCenter(), DEG2RAD(), DEGREES_T, delta, DIAGONAL_EDGE, eagle_layer_name(), EPOLYGON::ECUTOUT, GetArcToSegmentCount(), ZONE::GetDefaultHatchPitch(), FOOTPRINT::GetOrientation(), EDA_SHAPE::GetPolyShape(), FOOTPRINT::GetPosition(), SHAPE_POLY_SET::Inflate(), kicad_layer(), kicad_x(), kicad_y(), KiROUND(), EPOLYGON::layer, PCB_SHAPE::Move(), ZONE::Outline(), POLY, EPOLYGON::pour, radius, PCB_SHAPE::Rotate(), ZONE::SetBorderDisplayStyle(), SHAPE_LINE_CHAIN::SetClosed(), EDA_SHAPE::SetFilled(), setKeepoutSettingsToZone(), PCB_SHAPE::SetLayer(), EDA_SHAPE::SetPolyPoints(), PCB_SHAPE::SetStroke(), ECOORD::ToPcbUnits(), EAGLE_LAYER::TRESTRICT, UNDEFINED_LAYER, v1, v2, EAGLE_LAYER::VRESTRICT, and EPOLYGON::width.
Referenced by makeFootprint().
|
private |
Definition at line 2196 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), APPEND, ZONE::AppendCorner(), EAGLE_LAYER::BRESTRICT, center, EROT::degrees, DEGREES_T, DIAGONAL_EDGE, eagle_layer_name(), end, PCB_SHAPE::GetCenter(), ZONE::GetDefaultHatchPitch(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), kicad_layer(), kicad_x(), kicad_y(), ERECT::layer, PCB_SHAPE::Move(), POLY, ERECT::rot, PCB_SHAPE::Rotate(), ZONE::Rotate(), ZONE::SetBorderDisplayStyle(), EDA_SHAPE::SetFilled(), setKeepoutSettingsToZone(), PCB_SHAPE::SetLayer(), EDA_SHAPE::SetPolyPoints(), PCB_SHAPE::SetStroke(), EAGLE_LAYER::TRESTRICT, UNDEFINED_LAYER, EAGLE_LAYER::VRESTRICT, ERECT::x1, ERECT::x2, ERECT::y1, and ERECT::y2.
Referenced by makeFootprint().
|
private |
Handles common pad properties.
Definition at line 2498 of file pcb_io_eagle.cpp.
References FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, ANGLE_0, B_Cu, B_Mask, B_Paste, ESMD::cream, EROT::degrees, DEGREES_T, ESMD::dx, ESMD::dy, eagleClamp(), F_Cu, F_Mask, F_Paste, IsCopperLayer(), kicad_layer(), ESMD::layer, m_rules, PAD, pad, RECTANGLE, EPAD_COMMON::rot, ESMD::roundness, ROUNDRECT, SMD, EPAD_COMMON::stop, ECOORD::ToPcbUnits(), transferPad(), ECOORD::value, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by makeFootprint().
|
private |
Definition at line 2085 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), ETEXT::align, ETEXT::BOTTOM_CENTER, ETEXT::BOTTOM_LEFT, ETEXT::BOTTOM_RIGHT, ETEXT::CENTER, ETEXT::CENTER_LEFT, ETEXT::CENTER_RIGHT, EROT::degrees, DEGREES_T, eagle_layer_name(), FOOTPRINT::GetFPID(), LIB_ID::GetLibItemName(), FOOTPRINT::GetReference(), FOOTPRINT::GetValue(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_TOP, interpretText(), kicad_fontsize(), kicad_layer(), kicad_x(), kicad_y(), KiROUND(), ETEXT::layer, EROT::mirror, ETEXT::ratio, FOOTPRINT::Reference(), ETEXT::rot, EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetKeepUpright(), BOARD_ITEM::SetLayer(), EDA_TEXT::SetMirrored(), PCB_TEXT::SetPosition(), EDA_TEXT::SetText(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetTextThickness(), EDA_TEXT::SetVertJustify(), sign(), ETEXT::size, ETEXT::text, ETEXT::TOP_CENTER, ETEXT::TOP_LEFT, ETEXT::TOP_RIGHT, ECOORD::ToPcbUnits(), UNDEFINED_LAYER, FOOTPRINT::Value(), ETEXT::x, and ETEXT::y.
Referenced by makeFootprint().
|
private |
Definition at line 1900 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), ARC, B_CrtYd, B_SilkS, center, ConvertArcCenter(), EWIRE::curve, DEFAULT_COURTYARD_WIDTH, DEFAULT_EDGE_WIDTH, DEFAULT_LINE_WIDTH, DEFAULT_SILK_LINE_WIDTH, DEGREES_T, eagle_layer_name(), Edge_Cuts, end, F_CrtYd, F_SilkS, BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetLineThickness(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), kicad_layer(), kicad_x(), kicad_y(), EWIRE::layer, PCB_SHAPE::Move(), pcbIUScale, PCB_SHAPE::Rotate(), SEGMENT, EDA_SHAPE::SetArcAngleAndEnd(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), SOLID, ECOORD::ToPcbUnits(), UNDEFINED_LAYER, EWIRE::width, EWIRE::x1, EWIRE::x2, EWIRE::y1, and EWIRE::y2.
Referenced by makeFootprint().
|
inlinevirtualinherited |
Register a different handler to be called when mapping of input layers to KiCad layers occurs.
The function is marked as virtual, so the plugins can implement extra logic (e.g., enable warnings or checks)
aLayerMappingHandler |
Reimplemented in PCB_IO_CADSTAR_ARCHIVE.
Definition at line 74 of file plugin_common_layer_mapping.h.
References m_layer_mapping_handler.
Referenced by PCB_IO_ALTIUM_CIRCUIT_MAKER::PCB_IO_ALTIUM_CIRCUIT_MAKER(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::PCB_IO_ALTIUM_CIRCUIT_STUDIO(), PCB_IO_ALTIUM_DESIGNER::PCB_IO_ALTIUM_DESIGNER(), PCB_IO_CADSTAR_ARCHIVE::PCB_IO_CADSTAR_ARCHIVE(), PCB_IO_EAGLE::PCB_IO_EAGLE(), PCB_IO_SOLIDWORKS::PCB_IO_SOLIDWORKS(), and PCB_IO_CADSTAR_ARCHIVE::RegisterCallback().
|
virtualinherited |
Definition at line 124 of file io_base.cpp.
References m_reporter.
Referenced by PCB_IO_IPC2581::addShape(), PCB_IO_IPC2581::generateBOMSection(), PCB_IO_IPC2581::generateComponents(), PCB_IO_IPC2581::generateLayerSetDrill(), PCB_IO_IPC2581::generateLayerSetNet(), PCB_IO_IPC2581::generateProfile(), SCH_IO_EAGLE::loadInstance(), SCH_IO_EAGLE::loadLibrary(), and PCB_IO_IPC2581::SaveBoard().
|
virtualinherited |
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be used to write a portion of aBoard to a special kind of export file.
aFileName | is the name of a file to save to on disk. |
aBoard | is the class BOARD in memory document tree from which to extract information when writing to aFileName. The caller continues to own the BOARD, and the plugin should refrain from modifying the BOARD if possible. |
aProperties | is an associative array that can be used to tell the saver how to save the file, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it) and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem saving or exporting. |
Reimplemented in CLIPBOARD_IO, PCB_IO_IPC2581, PCB_IO_KICAD_SEXPR, and PCB_IO_ODBPP.
Definition at line 87 of file pcb_io.cpp.
References NOT_IMPLEMENTED.
|
private |
Definition at line 121 of file pcb_io_eagle.cpp.
References LSET::AllCuMask(), B_Cu, EAGLE_LAYER::BRESTRICT, F_Cu, kicad_layer(), ZONE::SetDoNotAllowFootprints(), ZONE::SetDoNotAllowPads(), ZONE::SetDoNotAllowTracks(), ZONE::SetDoNotAllowVias(), ZONE::SetDoNotAllowZoneFills(), ZONE::SetIsRuleArea(), ZONE::SetLayer(), ZONE::SetLayerSet(), EAGLE_LAYER::TRESTRICT, and EAGLE_LAYER::VRESTRICT.
Referenced by loadPlain(), loadPolygon(), packageCircle(), packagePolygon(), and packageRectangle().
|
inlinevirtualinherited |
Set an optional progress reporter.
Reimplemented in SCH_IO_CADSTAR_ARCHIVE.
Definition at line 89 of file io_base.h.
References m_progressReporter.
Referenced by PCB_CONTROL::AppendBoard().
|
inlinevirtualinherited |
Registers a KIDIALOG callback for collecting info from the user.
Definition at line 97 of file pcb_io.h.
Referenced by PCB_CONTROL::AppendBoard().
|
inlinevirtualinherited |
Set an optional reporter for warnings/errors.
Reimplemented in SCH_IO_CADSTAR_ARCHIVE.
Definition at line 84 of file io_base.h.
References m_reporter.
|
private |
Deletes the footprint templates list.
Definition at line 2574 of file pcb_io_eagle.cpp.
References PADSTACK::ALL_LAYERS, eagleClamp(), FULL, FOOTPRINT::GetOrientation(), BOARD_ITEM::GetParentFootprint(), FOOTPRINT::GetPosition(), PAD::GetSize(), kicad_x(), kicad_y(), m_rules, EPAD_COMMON::name, RotatePoint(), PAD::SetLocalSolderMaskMargin(), PAD::SetLocalZoneConnection(), PAD::SetNumber(), PAD::SetPosition(), EPAD_COMMON::thermals, EPAD_COMMON::x, VECTOR2< T >::x, EPAD_COMMON::y, and VECTOR2< T >::y.
Referenced by packagePad(), and packageSMD().
|
protectedinherited |
The board BOARD being worked on, no ownership here.
Definition at line 324 of file pcb_io.h.
Referenced by PCB_IO_EAGLE::centerBoard(), PCB_IO_ALTIUM_DESIGNER::FootprintLoad(), PCB_IO_KICAD_SEXPR::formatBoardLayers(), PCB_IO_KICAD_SEXPR::formatLayers(), PCB_IO_ALTIUM_DESIGNER::GetImportedCachedLibraryFootprints(), PCB_IO_EAGLE::init(), PCB_IO_KICAD_LEGACY::init(), PCB_IO_KICAD_SEXPR::init(), PCB_IO_KICAD_LEGACY::loadAllSections(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_CADSTAR_ARCHIVE::LoadBoard(), PCB_IO_EAGLE::LoadBoard(), PCB_IO_EASYEDA::LoadBoard(), PCB_IO_EASYEDAPRO::LoadBoard(), PCB_IO_FABMASTER::LoadBoard(), PCB_IO_KICAD_LEGACY::LoadBoard(), PCB_IO_PCAD::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), PCB_IO_EAGLE::loadClasses(), PCB_IO_KICAD_LEGACY::loadDIMENSION(), PCB_IO_EAGLE::loadElements(), PCB_IO_KICAD_LEGACY::loadGENERAL(), PCB_IO_EAGLE::loadLayerDefs(), PCB_IO_KICAD_LEGACY::loadNETCLASS(), PCB_IO_KICAD_LEGACY::loadNETINFO_ITEM(), PCB_IO_KICAD_LEGACY::loadPAD(), PCB_IO_KICAD_LEGACY::loadPCB_LINE(), PCB_IO_KICAD_LEGACY::loadPCB_TARGET(), PCB_IO_KICAD_LEGACY::loadPCB_TEXT(), PCB_IO_EAGLE::loadPlain(), PCB_IO_EAGLE::loadPolygon(), PCB_IO_KICAD_LEGACY::loadSETUP(), PCB_IO_KICAD_LEGACY::loadSHEET(), PCB_IO_EAGLE::loadSignals(), PCB_IO_KICAD_LEGACY::loadTrackList(), PCB_IO_KICAD_LEGACY::loadZONE_CONTAINER(), PCB_IO_EAGLE::makeFootprint(), PCB_IO_EAGLE::packagePad(), PCB_IO(), CLIPBOARD_IO::SaveBoard(), PCB_IO_KICAD_SEXPR::SaveBoard(), CLIPBOARD_IO::SaveSelection(), and CLIPBOARD_IO::SetBoard().
|
private |
Definition at line 332 of file pcb_io_eagle.h.
Referenced by loadClasses(), and loadSignals().
|
private |
map eagle to KiCad, cu layers only.
Definition at line 326 of file pcb_io_eagle.h.
Referenced by clear_cu_map(), defaultKicadLayer(), and loadLayerDefs().
|
private |
Definition at line 334 of file pcb_io_eagle.h.
Referenced by LoadBoard(), and loadClasses().
|
private |
Definition at line 351 of file pcb_io_eagle.h.
Referenced by checkpoint(), loadAllSections(), and PCB_IO_EAGLE().
|
private |
Eagle layer data stored by layer number.
Definition at line 327 of file pcb_io_eagle.h.
Referenced by eagle_layer_name(), loadLayerDefs(), and mapEagleLayersToKicad().
|
private |
Eagle layer ids stored by layer name.
Definition at line 328 of file pcb_io_eagle.h.
Referenced by eagle_layer_id(), and loadLayerDefs().
|
private |
generates unique footprint names from eagle "hole"s.
Definition at line 340 of file pcb_io_eagle.h.
Referenced by init(), and loadPlain().
|
private |
Definition at line 352 of file pcb_io_eagle.h.
Referenced by checkpoint(), and PCB_IO_EAGLE().
|
private |
Map of Eagle layers to KiCad layers.
Eagle class number to KiCad netclass
Definition at line 329 of file pcb_io_eagle.h.
Referenced by getMinimumCopperLayerCount(), kicad_layer(), LoadBoard(), and mapEagleLayersToKicad().
|
protectedinherited |
Callback to get layer mapping.
Definition at line 81 of file plugin_common_layer_mapping.h.
Referenced by PCB_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), PCB_IO_ALTIUM_DESIGNER::FootprintLoad(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_CADSTAR_ARCHIVE::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), PCB_IO_EAGLE::mapEagleLayersToKicad(), and RegisterCallback().
|
private |
Definition at line 360 of file pcb_io_eagle.h.
Referenced by cacheLib(), loadLibrary(), and packagePad().
|
private |
smallest via annulus we find on Load(), in BIU.
Definition at line 358 of file pcb_io_eagle.h.
Referenced by init(), LoadBoard(), and loadSignals().
|
private |
smallest diameter hole we find on Load(), in BIU.
Definition at line 356 of file pcb_io_eagle.h.
Referenced by init(), LoadBoard(), loadSignals(), and packagePad().
|
private |
smallest trace we find on Load(), in BIU.
Definition at line 355 of file pcb_io_eagle.h.
Referenced by init(), LoadBoard(), and loadSignals().
|
private |
smallest via we find on Load(), in BIU.
Definition at line 357 of file pcb_io_eagle.h.
Referenced by init(), LoadBoard(), and loadSignals().
|
protectedinherited |
Name of the IO loader.
Definition at line 217 of file io_base.h.
Referenced by PCB_IO_IPC2581::generateBOMSection(), GetName(), and IO_BASE().
|
private |
net list
Definition at line 342 of file pcb_io_eagle.h.
Referenced by init(), loadElements(), and loadSignals().
|
private |
optional; may be nullptr
Definition at line 350 of file pcb_io_eagle.h.
Referenced by checkpoint(), loadAllSections(), LoadBoard(), mapEagleLayersToKicad(), and PCB_IO_EAGLE().
|
protectedinherited |
Properties passed via Save() or Load(), no ownership, may be NULL.
Definition at line 327 of file pcb_io.h.
Referenced by PCB_IO_EAGLE::centerBoard(), PCB_IO_EAGLE::init(), PCB_IO_GEDA::init(), PCB_IO_KICAD_LEGACY::init(), PCB_IO_KICAD_SEXPR::init(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_CADSTAR_ARCHIVE::LoadBoard(), PCB_IO_EASYEDA::LoadBoard(), PCB_IO_EASYEDAPRO::LoadBoard(), PCB_IO_FABMASTER::LoadBoard(), PCB_IO_PCAD::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), and PCB_IO().
|
protectedinherited |
Reporter to log errors/warnings to, may be nullptr.
Definition at line 220 of file io_base.h.
Referenced by SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), PCB_IO_ALTIUM_DESIGNER::FootprintLoad(), IO_BASE(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), SCH_IO_ALTIUM::LoadSchematicFile(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_LTSPICE::LoadSchematicFile(), SCH_IO_ALTIUM::ParsePowerPort(), PCB_IO_ALTIUM_DESIGNER::PCB_IO_ALTIUM_DESIGNER(), PCB_IO_SOLIDWORKS::PCB_IO_SOLIDWORKS(), Report(), SCH_IO_ALTIUM::SCH_IO_ALTIUM(), SCH_IO_CADSTAR_ARCHIVE::SCH_IO_CADSTAR_ARCHIVE(), SCH_IO_EAGLE::SCH_IO_EAGLE(), SCH_IO_EASYEDA::SCH_IO_EASYEDA(), SCH_IO_EASYEDAPRO::SCH_IO_EASYEDAPRO(), SCH_IO_LTSPICE::SCH_IO_LTSPICE(), SetReporter(), and SCH_IO_CADSTAR_ARCHIVE::SetReporter().
|
private |
Eagle design rules.
Definition at line 336 of file pcb_io_eagle.h.
Referenced by init(), LoadBoard(), loadDesignRules(), loadSignals(), packagePad(), packageSMD(), PCB_IO_EAGLE(), transferPad(), and ~PCB_IO_EAGLE().
|
private |
is part of a FOOTPRINT factory that operates using copy construction.
lookup key is either libname.packagename or simply packagename if FootprintLoad() or FootprintEnumberate()
Definition at line 344 of file pcb_io_eagle.h.
Referenced by deleteTemplates(), FootprintEnumerate(), FootprintLoad(), GetImportedCachedLibraryFootprints(), loadElements(), and loadLibrary().
|
private |
Definition at line 361 of file pcb_io_eagle.h.
Referenced by cacheLib(), and PCB_IO_EAGLE().
|
private |
for progress reporting
Definition at line 353 of file pcb_io_eagle.h.
Referenced by checkpoint(), loadAllSections(), and PCB_IO_EAGLE().
|
private |
keeps track of what we are working on within XML document during a Load().
Definition at line 337 of file pcb_io_eagle.h.
Referenced by cacheLib(), init(), loadAllSections(), LoadBoard(), loadClasses(), loadDesignRules(), loadElements(), loadLibraries(), loadLibrary(), loadPlain(), loadSignals(), PCB_IO_EAGLE(), and ~PCB_IO_EAGLE().