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 void | PrefetchLib (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) |
If possible, prefetches the specified library (e.g. | |
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 |
wxDateTime | m_mod_time |
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 171 of file pcb_io_eagle.h.
|
private |
Definition at line 327 of file pcb_io_eagle.h.
|
private |
Definition at line 326 of file pcb_io_eagle.h.
PCB_IO_EAGLE::PCB_IO_EAGLE | ( | ) |
Definition at line 225 of file pcb_io_eagle.cpp.
References clear_cu_map(), DefaultLayerMappingCallback(), init(), and LAYER_MAPPABLE_PLUGIN::RegisterCallback().
PCB_IO_EAGLE::~PCB_IO_EAGLE | ( | ) |
Definition at line 243 of file pcb_io_eagle.cpp.
References deleteTemplates(), m_rules, and m_xpath.
|
virtualinherited |
Definition at line 131 of file io_base.cpp.
References _, PROGRESS_REPORTER::AdvancePhase(), PROGRESS_REPORTER::KeepRefreshing(), IO_BASE::m_progressReporter, and THROW_IO_ERROR.
Referenced by EAGLE_BASE::AdvanceProgressPhase().
|
private |
This PLUGIN only caches one footprint library, this determines which one.
Definition at line 3186 of file pcb_io_eagle.cpp.
References _, library, MapChildren(), fontconfig::FONTCONFIG::SetReporter(), and THROW_IO_ERROR.
|
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 251 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 269 of file pcb_io_eagle.cpp.
References CanReadLibrary().
|
overridevirtual |
Checks if this IO object can read the specified library file/directory.
If not overriden, extension check is used.
Reimplemented from IO_BASE.
Definition at line 260 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 3142 of file pcb_io_eagle.cpp.
References UTF8::c_str(), UTF8::empty(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), BOX2< Vec >::GetX(), and BOX2< Vec >::GetY().
Referenced by LoadBoard().
|
private |
Definition at line 275 of file pcb_io_eagle.cpp.
References text.
Referenced by CanReadBoard(), and CanReadLibrary().
|
private |
Definition at line 297 of file pcb_io_eagle.cpp.
References _, PROGRESS_REPORTER::KeepRefreshing(), m_doneCount, m_lastProgressCount, m_progressReporter, m_totalCount, PROGRESS_REPORTER::SetCurrentProgress(), and THROW_IO_ERROR.
Referenced by loadDesignRules(), and loadPlain().
|
private |
Definition at line 478 of file pcb_io_eagle.cpp.
References arrayDim(), and m_cu_map.
Referenced by 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, SCH_IO_KICAD_LEGACY, SCH_IO_KICAD_SEXPR, and PCB_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 2992 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, 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.
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 2940 of file pcb_io_eagle.cpp.
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, SCH_IO_KICAD_LEGACY, SCH_IO_KICAD_SEXPR, PCB_IO_GEDA, PCB_IO_KICAD_LEGACY, and PCB_IO_KICAD_SEXPR.
Definition at line 52 of file io_base.cpp.
References NOT_IMPLEMENTED.
|
private |
|
private |
Get Eagle layer number by its name.
Definition at line 3134 of file pcb_io_eagle.cpp.
References unknown.
|
private |
Get Eagle layer name by its number.
Definition at line 3126 of file pcb_io_eagle.cpp.
References unknown.
|
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 165 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 3273 of file pcb_io_eagle.cpp.
References 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 141 of file pcb_io.cpp.
References PCB_IO::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 3300 of file pcb_io_eagle.cpp.
References copy.
|
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 157 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 132 of file pcb_io.cpp.
References PCB_IO::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 448 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 106 of file io_base.h.
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 173 of file pcb_io.cpp.
References _, and IO_BASE::GetLibraryOptions().
|
inlineoverridevirtual |
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 161 of file pcb_io_eagle.h.
References getModificationTime().
|
private |
Determines the minimum copper layer stackup count that includes all mapped layers.
Definition at line 3318 of file pcb_io_eagle.cpp.
References B_Cu, F_Cu, and IsCopperLayer().
Referenced by LoadBoard().
|
staticprivate |
get a file's or dir's modification time.
Definition at line 3171 of file pcb_io_eagle.cpp.
Referenced by GetLibraryTimestamp().
|
inlineinherited |
Return a brief hard coded name for this IO interface.
Definition at line 75 of file io_base.h.
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 108 of file pcb_io.cpp.
References _, PCB_IO::FootprintEnumerate(), and PCB_IO::FootprintLoad().
|
private |
initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
Definition at line 459 of file pcb_io_eagle.cpp.
References XPATH::clear(), 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 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 166 of file pcb_io_eagle.h.
create a font size (fontz) from an eagle font size scalar and KiCad font thickness
Definition at line 317 of file pcb_io_eagle.cpp.
References ECOORD::ToPcbUnits().
Referenced by loadPlain().
|
private |
Convert an Eagle layer to a KiCad layer.
Definition at line 2985 of file pcb_io_eagle.cpp.
References UNDEFINED_LAYER.
Referenced by loadLayerDefs(), loadPlain(), and setKeepoutSettingsToZone().
|
inlineprivate |
Definition at line 201 of file pcb_io_eagle.h.
References ECOORD::ToPcbUnits().
Referenced by loadPlain().
|
inlineprivate |
Convert an Eagle distance to a KiCad distance.
Definition at line 200 of file pcb_io_eagle.h.
References ECOORD::ToPcbUnits().
Referenced by loadPlain().
|
private |
Definition at line 487 of file pcb_io_eagle.cpp.
References loadClasses(), loadDesignRules(), loadElements(), loadLayerDefs(), loadLibraries(), loadPlain(), loadSignals(), m_doneCount, m_progressReporter, m_totalCount, m_xpath, MapChildren(), mapEagleLayersToKicad(), XPATH::pop(), and XPATH::push().
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 325 of file pcb_io_eagle.cpp.
References _, centerBoard(), XPATH::Contents(), BOARD::GetDesignSettings(), WXLOG_REPORTER::GetInstance(), getMinimumCopperLayerCount(), NETCLASS::GetTrackWidth(), NETCLASS::GetViaDiameter(), NETCLASS::GetViaDrill(), init(), PROGRESS_REPORTER::KeepRefreshing(), KiROUND(), loadAllSections(), PCB_IO::m_board, m_customRules, BOARD::m_LegacyDesignSettingsLoaded, BOARD::m_LegacyNetclassesLoaded, 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, ERULES::mdWireWire, name, PROGRESS_REPORTER::Report(), BOARD::SetCopperLayerCount(), BOARD::SetFileName(), fontconfig::FONTCONFIG::SetReporter(), and THROW_IO_ERROR.
|
private |
Definition at line 2609 of file pcb_io_eagle.cpp.
References BOARD_DESIGN_SETTINGS::m_NetSettings, ECLASS::name, ECLASS::number, pcbIUScale, and EDA_UNIT_UTILS::UI::StringFromValue().
Referenced by loadAllSections().
|
private |
Definition at line 573 of file pcb_io_eagle.cpp.
References checkpoint(), m_rules, m_xpath, ERULES::parse(), XPATH::pop(), and XPATH::push().
Referenced by loadAllSections().
|
private |
Definition at line 1238 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), EATTR::BOTH, EATTR::display, FOOTPRINT::GetReference(), FOOTPRINT::GetValue(), EELEMENT::library, EELEMENT::library_urn, makeKey(), EATTR::name, EATTR::NAME, EELEMENT::name, name, ENET::netcode, EATTR::Off, EELEMENT::package, pad, FOOTPRINT::Pads(), FOOTPRINT::Reference(), FOOTPRINT::SetPosition(), FOOTPRINT::SetReference(), FOOTPRINT::SetValue(), EDA_TEXT::SetVisible(), EELEMENT::smashed, THROW_IO_ERROR, EATTR::value, EATTR::VALUE, EELEMENT::value, FOOTPRINT::Value(), EELEMENT::x, and EELEMENT::y.
Referenced by loadAllSections().
|
private |
Definition at line 584 of file pcb_io_eagle.cpp.
References ELAYER::active, B_Cu, F_Cu, kicad_layer(), LT_SIGNAL, PCB_IO::m_board, m_cu_map, m_eagleLayers, m_eagleLayersIds, ELAYER::name, ELAYER::number, PCB_LAYER_ID_COUNT, BOARD::SetCopperLayerCount(), BOARD::SetLayerName(), and BOARD::SetLayerType().
Referenced by loadAllSections().
|
private |
Definition at line 1215 of file pcb_io_eagle.cpp.
References library.
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 1144 of file pcb_io_eagle.cpp.
References _, m_xpath, makeKey(), MapChildren(), XPATH::push(), ReplaceIllegalFileNameChars(), and THROW_IO_ERROR.
|
private |
Definition at line 655 of file pcb_io_eagle.cpp.
References std::abs(), BOARD::Add(), ETEXT::align, ANGLE_0, ANGLE_360, ZONE::AppendCorner(), ARC_HIGH_DEF, ETEXT::BOTTOM_CENTER, ETEXT::BOTTOM_LEFT, ETEXT::BOTTOM_RIGHT, EAGLE_LAYER::BRESTRICT, ETEXT::CENTER, ETEXT::CENTER_LEFT, ETEXT::CENTER_RIGHT, checkpoint(), ConvertArcCenter(), EWIRE::curve, EROT::degrees, DEGREES_T, delta, DIMENSION_PRECISION, EDIMENSION::dimensionType, VECTOR2< T >::Distance(), FULL_CIRCLE, GetArcToSegmentCount(), PCB_TEXT::GetBoundingBox(), ZONE::GetDefaultHatchPitch(), BOARD::GetDesignSettings(), 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(), EWIRE::layer, ECIRCLE::layer, ERECT::layer, EDIMENSION::layer, ETEXT::layer, loadPolygon(), PCB_IO::m_board, m_hole_count, m_xpath, EROT::mirror, ZONE::NewHole(), packageHole(), PCB_DIM_ALIGNED_T, XPATH::pop(), XPATH::push(), ECIRCLE::radius, ETEXT::ratio, FOOTPRINT::Reference(), ERECT::rot, ETEXT::rot, ZONE::Rotate(), RotatePoint(), 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(), PCB_DIMENSION_BASE::SetStart(), EDA_SHAPE::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, 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, EWIRE::width, ECIRCLE::width, ECIRCLE::x, ETEXT::x, VECTOR2< T >::x, EWIRE::x1, ERECT::x1, EDIMENSION::x1, EWIRE::x2, ERECT::x2, EDIMENSION::x2, EDIMENSION::x3, ECIRCLE::y, ETEXT::y, VECTOR2< T >::y, EWIRE::y1, ERECT::y1, EDIMENSION::y1, EWIRE::y2, ERECT::y2, EDIMENSION::y2, and EDIMENSION::y3.
Referenced by loadAllSections().
|
private |
Load a copper or keepout polygon and adds it to the board.
Definition at line 1508 of file pcb_io_eagle.cpp.
References _, ANGLE_0, SHAPE_POLY_SET::Append(), ARC_HIGH_DEF, EAGLE_LAYER::BRESTRICT, ConvertArcCenter(), SHAPE_POLY_SET::COutline(), EPOLYGON::CUTOUT, DEG2RAD(), DEGREES_T, OPTIONAL_XML_ATTRIBUTE< T >::Get(), GetArcToSegmentCount(), EPOLYGON::HATCH, SHAPE_POLY_SET::Inflate(), EPOLYGON::isolate, EDA_IU_SCALE::IU_PER_MILS, EDA_IU_SCALE::IU_PER_MM, KiROUND(), EPOLYGON::layer, EPOLYGON::max_priority, SHAPE_POLY_SET::NewOutline(), EPOLYGON::orphans, SHAPE_POLY_SET::OutlineCount(), pcbIUScale, EPOLYGON::pour, EPOLYGON::rank, EPOLYGON::spacing, EPOLYGON::thermals, ECOORD::ToPcbUnits(), EAGLE_LAYER::TRESTRICT, UNDEFINED_LAYER, v1, v2, EAGLE_LAYER::VRESTRICT, EPOLYGON::width, VECTOR2< T >::x, VECTOR3< T >::x, VECTOR2< T >::y, VECTOR3< T >::y, and ZONE_THICKNESS_MIN_VALUE_MM.
Referenced by loadPlain().
|
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 2677 of file pcb_io_eagle.cpp.
References std::abs(), PADSTACK::ALL_LAYERS, B_Cu, CalcArcMid(), ConvertArcCenter(), EWIRE::curve, EVIA::diam, EVIA::drill, eagleClamp(), escapeName(), F_Cu, IsCopperLayer(), KiROUND(), EWIRE::layer, EVIA::layer_back_most, EVIA::layer_front_most, makeKey(), pad, PCB_TRACK::SetEnd(), BOARD_ITEM::SetLayer(), PCB_ARC::SetMid(), NETINFO_ITEM::SetNetClass(), BOARD_CONNECTED_ITEM::SetNetCode(), PCB_TRACK::SetPosition(), PCB_ARC::SetPosition(), PCB_TRACK::SetWidth(), ECOORD::ToPcbUnits(), NETINFO_LIST::UNCONNECTED, via, EWIRE::width, EVIA::x, VECTOR2< T >::x, EWIRE::x1, EWIRE::x2, EVIA::y, VECTOR2< T >::y, EWIRE::y1, and EWIRE::y2.
Referenced by loadAllSections().
|
private |
Create a FOOTPRINT from an Eagle package.
Definition at line 1834 of file pcb_io_eagle.cpp.
References convertDescription(), LIB_ID::Parse(), and UnescapeHTML().
|
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 2955 of file pcb_io_eagle.cpp.
References INPUT_LAYER_DESC::AutoMapLayer, ELAYER::name, INPUT_LAYER_DESC::Name, ELAYER::number, INPUT_LAYER_DESC::PermittedLayers, INPUT_LAYER_DESC::Required, and UNDEFINED_LAYER.
Referenced by loadAllSections().
|
private |
Definition at line 1665 of file pcb_io_eagle.cpp.
References EROT::degrees, DEGREES_T, FOOTPRINT::Flip(), FOOTPRINT::GetPosition(), EROT::mirror, FOOTPRINT::Reference(), EELEMENT::rot, FOOTPRINT::SetOrientation(), and FOOTPRINT::Value().
|
private |
Definition at line 1686 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, FOOTPRINT::GetOrientation(), EDA_TEXT::GetTextAngle(), EDA_TEXT::GetTextSize(), 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(), 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.
|
private |
Definition at line 2366 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), ANGLE_0, ANGLE_360, ZONE::AppendCorner(), ARC_HIGH_DEF, EAGLE_LAYER::BRESTRICT, Cmts_User, delta, FULL_CIRCLE, GetArcToSegmentCount(), ZONE::GetDefaultHatchPitch(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), ECIRCLE::layer, PCB_SHAPE::Move(), ZONE::NewHole(), ECIRCLE::radius, PCB_SHAPE::Rotate(), RotatePoint(), ZONE::SetBorderDisplayStyle(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFilled(), PCB_SHAPE::SetLayer(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), ECOORD::ToPcbUnits(), EAGLE_LAYER::TRESTRICT, UNDEFINED_LAYER, EAGLE_LAYER::VRESTRICT, ECIRCLE::width, ECIRCLE::x, and ECIRCLE::y.
|
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 2456 of file pcb_io_eagle.cpp.
References FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, LSET::AllCuMask(), B_Mask, EHOLE::drill, F_Mask, FOOTPRINT::GetPosition(), pad, FOOTPRINT::SetPosition(), ECOORD::ToPcbUnits(), ECOORD::value, EHOLE::x, and EHOLE::y.
Referenced by loadPlain().
|
private |
Definition at line 1956 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, LSET::AllCuMask(), ANGLE_0, B_Cu, B_Mask, EROT::degrees, DEGREES_T, EPAD::diameter, EPAD::drill, eagleClamp(), F_Cu, F_Mask, EPAD::first, FOOTPRINT::GetLayer(), KiROUND(), EPAD::LONG, EPAD::OCTAGON, EPAD::OFFSET, pad, RECT_CHAMFER_ALL, EPAD_COMMON::rot, EPAD::ROUND, EPAD::shape, EPAD::SQUARE, EPAD_COMMON::stop, ECOORD::ToPcbUnits(), EPAD::UNDEF, ECOORD::value, VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Definition at line 2261 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), SHAPE_POLY_SET::AddOutline(), ARC_HIGH_DEF, EAGLE_LAYER::BRESTRICT, ConvertArcCenter(), EPOLYGON::CUTOUT, DEG2RAD(), DEGREES_T, delta, GetArcToSegmentCount(), ZONE::GetDefaultHatchPitch(), FOOTPRINT::GetOrientation(), EDA_SHAPE::GetPolyShape(), FOOTPRINT::GetPosition(), SHAPE_POLY_SET::Inflate(), KiROUND(), EPOLYGON::layer, PCB_SHAPE::Move(), ZONE::Outline(), EPOLYGON::pour, PCB_SHAPE::Rotate(), ZONE::SetBorderDisplayStyle(), SHAPE_LINE_CHAIN::SetClosed(), EDA_SHAPE::SetFilled(), PCB_SHAPE::SetLayer(), EDA_SHAPE::SetPolyPoints(), PCB_SHAPE::SetStroke(), ECOORD::ToPcbUnits(), EAGLE_LAYER::TRESTRICT, UNDEFINED_LAYER, v1, v2, EAGLE_LAYER::VRESTRICT, EPOLYGON::width, VECTOR2< T >::x, VECTOR3< T >::x, VECTOR2< T >::y, and VECTOR3< T >::y.
|
private |
Definition at line 2192 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), ZONE::AppendCorner(), EAGLE_LAYER::BRESTRICT, EROT::degrees, DEGREES_T, PCB_SHAPE::GetCenter(), ZONE::GetDefaultHatchPitch(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), ERECT::layer, PCB_SHAPE::Move(), ERECT::rot, ZONE::Rotate(), PCB_SHAPE::Rotate(), ZONE::SetBorderDisplayStyle(), EDA_SHAPE::SetFilled(), 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.
|
private |
Handles common pad properties.
Definition at line 2496 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(), ESMD::layer, pad, EPAD_COMMON::rot, ESMD::roundness, EPAD_COMMON::stop, ECOORD::ToPcbUnits(), ECOORD::value, VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Definition at line 2068 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, 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(), 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, EROT::spin, ETEXT::text, ETEXT::TOP_CENTER, ETEXT::TOP_LEFT, ETEXT::TOP_RIGHT, ECOORD::ToPcbUnits(), UNDEFINED_LAYER, FOOTPRINT::Value(), ETEXT::x, and ETEXT::y.
|
private |
Definition at line 1883 of file pcb_io_eagle.cpp.
References _, FOOTPRINT::Add(), B_CrtYd, B_SilkS, ConvertArcCenter(), EWIRE::curve, DEFAULT_COURTYARD_WIDTH, DEFAULT_EDGE_WIDTH, DEFAULT_LINE_WIDTH, DEFAULT_SILK_LINE_WIDTH, DEGREES_T, Edge_Cuts, F_CrtYd, F_SilkS, BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetLineThickness(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), EWIRE::layer, EDA_IU_SCALE::mmToIU(), PCB_SHAPE::Move(), pcbIUScale, PCB_SHAPE::Rotate(), EDA_SHAPE::SetArcAngleAndEnd(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), ECOORD::ToPcbUnits(), UNDEFINED_LAYER, EWIRE::width, EWIRE::x1, EWIRE::x2, EWIRE::y1, and EWIRE::y2.
|
virtualinherited |
If possible, prefetches the specified library (e.g.
performing downloads). Does not parse. Threadsafe.
This is a no-op for libraries that cannot be prefetched. Plugins that cannot prefetch need not override this; a default no-op is provided.
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. |
IO_ERROR | if there is an error prefetching the library. |
Definition at line 103 of file pcb_io.cpp.
|
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 LAYER_MAPPABLE_PLUGIN::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_SOLIDWORKS::PCB_IO_SOLIDWORKS(), and PCB_IO_CADSTAR_ARCHIVE::RegisterCallback().
|
virtualinherited |
Definition at line 122 of file io_base.cpp.
References IO_BASE::m_reporter, and REPORTER::Report().
Referenced by SCH_IO_EAGLE::loadInstance(), SCH_IO_EAGLE::loadLibrary(), and EAGLE_BASE::Report().
|
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 122 of file pcb_io_eagle.cpp.
References LSET::AllCuMask(), B_Cu, EAGLE_LAYER::BRESTRICT, F_Cu, kicad_layer(), ZONE::SetDoNotAllowCopperPour(), ZONE::SetDoNotAllowFootprints(), ZONE::SetDoNotAllowPads(), ZONE::SetDoNotAllowTracks(), ZONE::SetDoNotAllowVias(), ZONE::SetIsRuleArea(), ZONE::SetLayer(), ZONE::SetLayerSet(), EAGLE_LAYER::TRESTRICT, and EAGLE_LAYER::VRESTRICT.
Referenced by loadPlain().
|
inlinevirtualinherited |
Set an optional progress reporter.
Reimplemented in SCH_IO_CADSTAR_ARCHIVE.
Definition at line 85 of file io_base.h.
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.
|
private |
Deletes the footprint templates list.
Definition at line 2572 of file pcb_io_eagle.cpp.
References PADSTACK::ALL_LAYERS, eagleClamp(), FOOTPRINT::GetOrientation(), BOARD_ITEM::GetParentFootprint(), FOOTPRINT::GetPosition(), PAD::GetSize(), 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.
|
protectedinherited |
The board BOARD being worked on, no ownership here.
Definition at line 342 of file pcb_io.h.
Referenced by PCB_IO_ALTIUM_DESIGNER::FootprintLoad(), PCB_IO_KICAD_SEXPR::formatBoardLayers(), init(), PCB_IO_KICAD_LEGACY::init(), PCB_IO_KICAD_SEXPR::init(), PCB_IO_KICAD_LEGACY::loadAllSections(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), PCB_IO_CADSTAR_ARCHIVE::LoadBoard(), LoadBoard(), PCB_IO_EASYEDA::LoadBoard(), PCB_IO_EASYEDAPRO::LoadBoard(), PCB_IO_FABMASTER::LoadBoard(), PCB_IO_KICAD_LEGACY::LoadBoard(), PCB_IO_PCAD::LoadBoard(), PCB_IO_KICAD_LEGACY::loadDIMENSION(), PCB_IO_KICAD_LEGACY::loadGENERAL(), loadLayerDefs(), LP_CACHE::LoadModules(), 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(), loadPlain(), PCB_IO_KICAD_LEGACY::loadSETUP(), PCB_IO_KICAD_LEGACY::loadSHEET(), PCB_IO_KICAD_LEGACY::loadTrackList(), PCB_IO_KICAD_LEGACY::loadZONE_CONTAINER(), CLIPBOARD_IO::SaveBoard(), PCB_IO_KICAD_SEXPR::SaveBoard(), CLIPBOARD_IO::SaveSelection(), and CLIPBOARD_IO::SetBoard().
|
private |
Definition at line 335 of file pcb_io_eagle.h.
|
private |
map eagle to KiCad, cu layers only.
Definition at line 329 of file pcb_io_eagle.h.
Referenced by clear_cu_map(), and loadLayerDefs().
|
private |
Definition at line 337 of file pcb_io_eagle.h.
Referenced by LoadBoard().
|
private |
Definition at line 354 of file pcb_io_eagle.h.
Referenced by checkpoint(), and loadAllSections().
|
private |
Eagle layer data stored by layer number.
Definition at line 330 of file pcb_io_eagle.h.
Referenced by loadLayerDefs().
|
private |
Eagle layer ids stored by layer name.
Definition at line 331 of file pcb_io_eagle.h.
Referenced by loadLayerDefs().
|
private |
generates unique footprint names from eagle "hole"s.
Definition at line 343 of file pcb_io_eagle.h.
Referenced by init(), and loadPlain().
|
private |
Definition at line 355 of file pcb_io_eagle.h.
Referenced by checkpoint().
|
private |
Map of Eagle layers to KiCad layers.
Eagle class number to KiCad netclass
Definition at line 332 of file pcb_io_eagle.h.
|
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_STUDIO::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), PCB_IO_CADSTAR_ARCHIVE::LoadBoard(), and LAYER_MAPPABLE_PLUGIN::RegisterCallback().
|
private |
Definition at line 363 of file pcb_io_eagle.h.
|
private |
smallest via annulus we find on Load(), in BIU.
Definition at line 361 of file pcb_io_eagle.h.
Referenced by init(), and LoadBoard().
|
private |
smallest diameter hole we find on Load(), in BIU.
Definition at line 359 of file pcb_io_eagle.h.
Referenced by init(), and LoadBoard().
|
private |
smallest trace we find on Load(), in BIU.
Definition at line 358 of file pcb_io_eagle.h.
Referenced by init(), and LoadBoard().
|
private |
smallest via we find on Load(), in BIU.
Definition at line 360 of file pcb_io_eagle.h.
Referenced by init(), and LoadBoard().
|
private |
Definition at line 364 of file pcb_io_eagle.h.
|
protectedinherited |
|
private |
|
private |
optional; may be nullptr
Definition at line 353 of file pcb_io_eagle.h.
Referenced by checkpoint(), loadAllSections(), and LoadBoard().
|
protectedinherited |
Properties passed via Save() or Load(), no ownership, may be NULL.
Definition at line 345 of file pcb_io.h.
Referenced by init(), PCB_IO_GEDA::init(), PCB_IO_KICAD_LEGACY::init(), PCB_IO_KICAD_SEXPR::init(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), PCB_IO_CADSTAR_ARCHIVE::LoadBoard(), PCB_IO_EASYEDA::LoadBoard(), PCB_IO_EASYEDAPRO::LoadBoard(), PCB_IO_FABMASTER::LoadBoard(), and PCB_IO_PCAD::LoadBoard().
|
protectedinherited |
Reporter to log errors/warnings to, may be nullptr.
Definition at line 218 of file io_base.h.
Referenced by SCH_IO_ALTIUM::AddLibTextBox(), SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), PCB_IO_ALTIUM_DESIGNER::FootprintLoad(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_LTSPICE::LoadSchematicFile(), SCH_IO_ALTIUM::ParseAltiumSch(), SCH_IO_ALTIUM::ParseArc(), SCH_IO_ALTIUM::ParseBezier(), SCH_IO_ALTIUM::ParseCircle(), SCH_IO_ALTIUM::ParseComponent(), SCH_IO_ALTIUM::ParseDesignator(), SCH_IO_ALTIUM::ParseEllipse(), SCH_IO_ALTIUM::ParseEllipticalArc(), SCH_IO_ALTIUM::ParseFileName(), SCH_IO_ALTIUM::ParseHarnessConnector(), SCH_IO_ALTIUM::ParseHarnessEntry(), SCH_IO_ALTIUM::ParseHarnessPort(), SCH_IO_ALTIUM::ParseHarnessType(), SCH_IO_ALTIUM::ParseImage(), SCH_IO_ALTIUM::ParseImplementation(), SCH_IO_ALTIUM::ParseLabel(), SCH_IO_ALTIUM::ParseLibFile(), SCH_IO_ALTIUM::ParseLine(), SCH_IO_ALTIUM::ParsePieChart(), SCH_IO_ALTIUM::ParsePin(), SCH_IO_ALTIUM::ParsePolygon(), SCH_IO_ALTIUM::ParsePolyline(), SCH_IO_ALTIUM::ParsePort(), SCH_IO_ALTIUM::ParsePowerPort(), SCH_IO_ALTIUM::ParseRecord(), SCH_IO_ALTIUM::ParseRectangle(), SCH_IO_ALTIUM::ParseRoundRectangle(), SCH_IO_ALTIUM::ParseSheetEntry(), SCH_IO_ALTIUM::ParseSheetName(), SCH_IO_ALTIUM::ParseSignalHarness(), SCH_IO_ALTIUM::ParseStorage(), PCB_IO_ALTIUM_DESIGNER::PCB_IO_ALTIUM_DESIGNER(), PCB_IO_SOLIDWORKS::PCB_IO_SOLIDWORKS(), IO_BASE::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(), and SCH_IO_CADSTAR_ARCHIVE::SetReporter().
|
private |
Eagle design rules.
Definition at line 339 of file pcb_io_eagle.h.
Referenced by init(), LoadBoard(), loadDesignRules(), 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 347 of file pcb_io_eagle.h.
Referenced by GetImportedCachedLibraryFootprints().
|
private |
for progress reporting
Definition at line 356 of file pcb_io_eagle.h.
Referenced by checkpoint(), and loadAllSections().
|
private |
keeps track of what we are working on within XML document during a Load().
Definition at line 340 of file pcb_io_eagle.h.
Referenced by init(), loadAllSections(), LoadBoard(), loadDesignRules(), loadLibrary(), loadPlain(), and ~PCB_IO_EAGLE().