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 <eagle_plugin.h>
Public Types | |
typedef int | BIU |
Public Member Functions | |
const wxString | PluginName () const override |
Return a brief hard coded name for this PLUGIN. More... | |
BOARD * | Load (const wxString &aFileName, BOARD *aAppendToMe, const STRING_UTF8_MAP *aProperties=nullptr, PROJECT *aProject=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) override |
Load information from some input file format that this PLUGIN implementation knows about into either a new BOARD or an existing one. More... | |
std::vector< FOOTPRINT * > | GetImportedCachedLibraryFootprints () override |
Return a container with the cached library footprints generated in the last call to Load. More... | |
const wxString | GetFileExtension () const override |
Returns the file extension for the PLUGIN. More... | |
void | FootprintEnumerate (wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const STRING_UTF8_MAP *aProperties=nullptr) override |
Return a list of footprint names contained within the library at aLibraryPath. More... | |
FOOTPRINT * | FootprintLoad (const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const STRING_UTF8_MAP *aProperties=nullptr) override |
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PLUGIN knows about. More... | |
long long | GetLibraryTimestamp (const wxString &aLibraryPath) const override |
Generate a timestamp representing all the files in the library (including the library directory). More... | |
bool | IsFootprintLibWritable (const wxString &aLibraryPath) override |
Return true if the library at aLibraryPath is writable. More... | |
void | FootprintLibOptions (STRING_UTF8_MAP *aProperties) const override |
Append supported PLUGIN options to aListToAppenTo along with internationalized descriptions. More... | |
EAGLE_PLUGIN () | |
~EAGLE_PLUGIN () | |
std::map< wxString, PCB_LAYER_ID > | DefaultLayerMappingCallback (const std::vector< INPUT_LAYER_DESC > &aInputLayerDescriptionVector) |
Return the automapped layers. More... | |
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. More... | |
virtual void | Save (const wxString &aFileName, BOARD *aBoard, const STRING_UTF8_MAP *aProperties=nullptr) |
Write aBoard to a storage file in a format that this PLUGIN implementation knows about or it can be used to write a portion of aBoard to a special kind of export file. More... | |
virtual void | PrefetchLib (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) |
If possible, prefetches the specified library (e.g. More... | |
virtual const FOOTPRINT * | GetEnumeratedFootprint (const wxString &aLibraryPath, const wxString &aFootprintName, const STRING_UTF8_MAP *aProperties=nullptr) |
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management. More... | |
virtual bool | FootprintExists (const wxString &aLibraryPath, const wxString &aFootprintName, const STRING_UTF8_MAP *aProperties=nullptr) |
Check for the existence of a footprint. More... | |
virtual void | FootprintSave (const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const STRING_UTF8_MAP *aProperties=nullptr) |
Write aFootprint to an existing library located at aLibraryPath. More... | |
virtual void | FootprintDelete (const wxString &aLibraryPath, const wxString &aFootprintName, const STRING_UTF8_MAP *aProperties=nullptr) |
Delete aFootprintName from the library at aLibraryPath. More... | |
virtual void | FootprintLibCreate (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) |
Create a new empty footprint library at aLibraryPath empty. More... | |
virtual bool | FootprintLibDelete (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) |
Delete an existing footprint 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. More... | |
virtual void | RegisterLayerMappingCallback (LAYER_MAPPING_HANDLER aLayerMappingHandler) |
Register a different handler to be called when mapping of input layers to KiCad layers occurs. More... | |
Protected Attributes | |
LAYER_MAPPING_HANDLER | m_layer_mapping_handler |
Callback to get layer mapping. More... | |
Private Types | |
typedef std::vector< ELAYER > | ELAYERS |
typedef ELAYERS::const_iterator | EITER |
Private Member Functions | |
void | init (const STRING_UTF8_MAP *aProperties) |
initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed. More... | |
void | checkpoint () |
void | clear_cu_map () |
int | kicad_y (const ECOORD &y) const |
Convert an Eagle distance to a KiCad distance. More... | |
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 More... | |
void | mapEagleLayersToKicad (bool aIsLibraryCache=false) |
Generate mapping between Eagle and KiCad layers. More... | |
PCB_LAYER_ID | kicad_layer (int aLayer) const |
Convert an Eagle layer to a KiCad layer. More... | |
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. More... | |
const wxString & | eagle_layer_name (int aLayer) const |
Get Eagle layer name by its number. More... | |
int | eagle_layer_id (const wxString &aLayerName) const |
Get Eagle layer number by its name. More... | |
void | setKeepoutSettingsToZone (ZONE *aZone, int aLayer) const |
void | cacheLib (const wxString &aLibraryPath) |
This PLUGIN only caches one footprint library, this determines which one. More... | |
int | getMinimumCopperLayerCount () const |
Determines the minimum copper layer stackup count that includes all mapped layers. More... | |
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. More... | |
void | loadLibraries (wxXmlNode *aLibs) |
void | loadElements (wxXmlNode *aElements) |
ZONE * | loadPolygon (wxXmlNode *aPolyNode) |
Load a copper or keepout polygon and adds it to the board. More... | |
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 More... | |
FOOTPRINT * | makeFootprint (wxXmlNode *aPackage, const wxString &aPkgName) |
Create a FOOTPRINT from an Eagle package. More... | |
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. More... | |
void | transferPad (const EPAD_COMMON &aEaglePad, PAD *aPad) const |
Deletes the footprint templates list. More... | |
void | deleteTemplates () |
Static Private Member Functions | |
static wxDateTime | getModificationTime (const wxString &aPath) |
get a file's or dir's modification time. More... | |
Private Attributes | |
int | m_cu_map [17] |
map eagle to KiCad, cu layers only. More... | |
std::map< int, ELAYER > | m_eagleLayers |
Eagle layer data stored by layer number. More... | |
std::map< wxString, int > | m_eagleLayersIds |
Eagle layer ids stored by layer name. More... | |
std::map< wxString, PCB_LAYER_ID > | m_layer_map |
Map of Eagle layers to KiCad layers. More... | |
std::map< wxString, std::shared_ptr< NETCLASS > > | m_classMap |
wxString | m_customRules |
ERULES * | m_rules |
Eagle design rules. More... | |
XPATH * | m_xpath |
keeps track of what we are working on within XML document during a Load(). More... | |
int | m_hole_count |
generates unique footprint names from eagle "hole"s. More... | |
NET_MAP | m_pads_to_nets |
net list More... | |
std::map< wxString, FOOTPRINT * > | m_templates |
is part of a FOOTPRINT factory that operates using copy construction. More... | |
const STRING_UTF8_MAP * | m_props |
passed via Save() or Load(), no ownership, may be NULL. More... | |
BOARD * | m_board |
which BOARD is being worked on, no ownership here More... | |
PROGRESS_REPORTER * | m_progressReporter |
optional; may be nullptr More... | |
unsigned | m_doneCount |
unsigned | m_lastProgressCount |
unsigned | m_totalCount |
for progress reporting More... | |
int | m_min_trace |
smallest trace we find on Load(), in BIU. More... | |
int | m_min_hole |
smallest diameter hole we find on Load(), in BIU. More... | |
int | m_min_via |
smallest via we find on Load(), in BIU. More... | |
int | m_min_annulus |
smallest via annulus we find on Load(), in BIU. More... | |
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 129 of file eagle_plugin.h.
typedef int EAGLE_PLUGIN::BIU |
Definition at line 161 of file eagle_plugin.h.
|
private |
Definition at line 315 of file eagle_plugin.h.
|
private |
Definition at line 314 of file eagle_plugin.h.
EAGLE_PLUGIN::EAGLE_PLUGIN | ( | ) |
Definition at line 220 of file eagle_plugin.cpp.
References clear_cu_map(), DefaultLayerMappingCallback(), init(), and LAYER_REMAPPABLE_PLUGIN::RegisterLayerMappingCallback().
EAGLE_PLUGIN::~EAGLE_PLUGIN | ( | ) |
Definition at line 238 of file eagle_plugin.cpp.
References deleteTemplates(), m_rules, and m_xpath.
|
private |
This PLUGIN only caches one footprint library, this determines which one.
Definition at line 3065 of file eagle_plugin.cpp.
References _, library, MapChildren(), and THROW_IO_ERROR.
|
private |
move the BOARD into the center of the page
Definition at line 3026 of file eagle_plugin.cpp.
References UTF8::c_str(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), BOX2< Vec >::GetX(), and BOX2< Vec >::GetY().
Referenced by Load().
|
private |
Definition at line 258 of file eagle_plugin.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 439 of file eagle_plugin.cpp.
References arrayDim(), and m_cu_map.
Referenced by EAGLE_PLUGIN().
|
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 2876 of file eagle_plugin.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, 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 > EAGLE_PLUGIN::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 EAGLE_PLUGIN.
aInputLayerDescriptionVector |
Definition at line 2824 of file eagle_plugin.cpp.
Referenced by EAGLE_PLUGIN().
|
private |
|
private |
Get Eagle layer number by its name.
Definition at line 3018 of file eagle_plugin.cpp.
References unknown.
|
private |
Get Eagle layer name by its number.
Definition at line 3010 of file eagle_plugin.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 GPCB_PLUGIN, and PCB_PLUGIN.
Definition at line 103 of file plugin.cpp.
References NOT_IMPLEMENTED.
Referenced by FP_LIB_TABLE::FootprintDelete().
|
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 PLUGIN.
Definition at line 3149 of file eagle_plugin.cpp.
References name, THROW_IO_ERROR, and IO_ERROR::What().
|
virtualinherited |
Check for the existence of a footprint.
Reimplemented in CADSTAR_PCB_ARCHIVE_PLUGIN, and PCB_PLUGIN.
Definition at line 79 of file plugin.cpp.
References PLUGIN::FootprintLoad().
Referenced by FP_LIB_TABLE::FootprintExists().
|
virtualinherited |
Create a new empty footprint 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 footprints. |
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 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 library, or creating it. |
Reimplemented in PCB_PLUGIN.
Definition at line 111 of file plugin.cpp.
References NOT_IMPLEMENTED.
Referenced by PCB_BASE_EDIT_FRAME::createNewLibrary(), and FP_LIB_TABLE::FootprintLibCreate().
|
virtualinherited |
Delete an existing footprint 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 footprints. |
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 GPCB_PLUGIN, PCB_PLUGIN, and LEGACY_PLUGIN.
Definition at line 118 of file plugin.cpp.
References NOT_IMPLEMENTED.
Referenced by PCB_BASE_EDIT_FRAME::createNewLibrary(), and FP_LIB_TABLE::FootprintLibDelete().
|
overridevirtual |
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 PLUGIN.
Definition at line 3194 of file eagle_plugin.cpp.
References PLUGIN::FootprintLibOptions().
|
overridevirtual |
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PLUGIN 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 PLUGIN.
Definition at line 3176 of file eagle_plugin.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_PLUGIN.
Definition at line 95 of file plugin.cpp.
References NOT_IMPLEMENTED.
Referenced by PCB_EDIT_FRAME::ExportFootprintsToLibrary(), FP_LIB_TABLE::FootprintSave(), PCB_EDIT_FRAME::OpenProjectFiles(), and FOOTPRINT_EDIT_FRAME::SaveLibraryAs().
|
virtualinherited |
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
Reimplemented in CADSTAR_PCB_ARCHIVE_PLUGIN, GPCB_PLUGIN, and PCB_PLUGIN.
Definition at line 70 of file plugin.cpp.
References PLUGIN::FootprintLoad().
Referenced by FP_LIB_TABLE::GetEnumeratedFootprint(), and FOOTPRINT_EDIT_FRAME::SaveLibraryAs().
|
overridevirtual |
Returns the file extension for the PLUGIN.
Implements PLUGIN.
Definition at line 252 of file eagle_plugin.cpp.
|
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 PLUGIN.
Definition at line 409 of file eagle_plugin.cpp.
References m_templates, and name.
|
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 PLUGIN.
Definition at line 149 of file eagle_plugin.h.
References getModificationTime().
|
private |
Determines the minimum copper layer stackup count that includes all mapped layers.
Definition at line 3199 of file eagle_plugin.cpp.
References B_Cu, F_Cu, and IsCopperLayer().
Referenced by Load().
|
staticprivate |
get a file's or dir's modification time.
Definition at line 3050 of file eagle_plugin.cpp.
Referenced by GetLibraryTimestamp().
|
private |
initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
Definition at line 420 of file eagle_plugin.cpp.
References XPATH::clear(), m_board, m_hole_count, m_min_annulus, m_min_hole, m_min_trace, m_min_via, m_pads_to_nets, m_props, m_rules, and m_xpath.
Referenced by EAGLE_PLUGIN(), and Load().
|
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 PLUGIN.
Definition at line 154 of file eagle_plugin.h.
create a font size (fontz) from an eagle font size scalar and KiCad font thickness
Definition at line 278 of file eagle_plugin.cpp.
References ECOORD::ToPcbUnits().
Referenced by loadPlain().
|
private |
Convert an Eagle layer to a KiCad layer.
Definition at line 2869 of file eagle_plugin.cpp.
References UNDEFINED_LAYER.
Referenced by loadLayerDefs(), loadPlain(), and setKeepoutSettingsToZone().
|
inlineprivate |
Definition at line 189 of file eagle_plugin.h.
References ECOORD::ToPcbUnits().
Referenced by loadPlain().
|
inlineprivate |
Convert an Eagle distance to a KiCad distance.
Definition at line 188 of file eagle_plugin.h.
References ECOORD::ToPcbUnits().
Referenced by loadPlain().
|
overridevirtual |
Load information from some input file format that this PLUGIN 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. |
aProgressReporter | an optional progress reporter |
aLineCount | a line count (necessary if a progress reporter is supplied) |
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 PLUGIN.
Definition at line 286 of file eagle_plugin.cpp.
References _, centerBoard(), XPATH::Contents(), BOARD::GetDesignSettings(), getMinimumCopperLayerCount(), NETCLASS::GetTrackWidth(), NETCLASS::GetViaDiameter(), NETCLASS::GetViaDrill(), init(), PROGRESS_REPORTER::KeepRefreshing(), KiROUND(), loadAllSections(), 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(), and THROW_IO_ERROR.
|
private |
Definition at line 448 of file eagle_plugin.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 Load().
|
private |
Definition at line 2487 of file eagle_plugin.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 534 of file eagle_plugin.cpp.
References checkpoint(), m_rules, m_xpath, ERULES::parse(), XPATH::pop(), and XPATH::push().
Referenced by loadAllSections().
|
private |
Definition at line 1141 of file eagle_plugin.cpp.
References _, FOOTPRINT::Add(), EATTR::BOTH, EATTR::display, FOOTPRINT::GetReference(), FOOTPRINT::GetValue(), EELEMENT::library, makeKey(), name, EATTR::name, EATTR::NAME, EELEMENT::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 545 of file eagle_plugin.cpp.
References ELAYER::active, B_Cu, F_Cu, kicad_layer(), LT_SIGNAL, 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 1118 of file eagle_plugin.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 1060 of file eagle_plugin.cpp.
References _, m_xpath, makeKey(), MapChildren(), XPATH::push(), ReplaceIllegalFileNameChars(), and THROW_IO_ERROR.
|
private |
Definition at line 616 of file eagle_plugin.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, FULL_CIRCLE, GetArcToSegmentCount(), ZONE::GetDefaultHatchPitch(), BOARD::GetDesignSettings(), GetLineLength(), BOARD_DESIGN_SETTINGS::GetLineThickness(), ZONE::GetPosition(), BOARD_DESIGN_SETTINGS::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, interpretText(), IsCopperLayer(), kicad_fontsize(), kicad_layer(), kicad_x(), kicad_y(), KiROUND(), EWIRE::layer, ECIRCLE::layer, ERECT::layer, EDIMENSION::layer, ETEXT::layer, loadPolygon(), 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(), PCB_DIM_ALIGNED::SetHeight(), EDA_TEXT::SetHorizJustify(), setKeepoutSettingsToZone(), BOARD_ITEM::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(), sign(), 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 1403 of file eagle_plugin.cpp.
References _, ZONE::AddPolygon(), SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS, ANGLE_0, SHAPE_POLY_SET::Append(), ARC_HIGH_DEF, EAGLE_LAYER::BRESTRICT, ConvertArcCenter(), SHAPE_POLY_SET::COutline(), EPOLYGON::CUTOUT, DEG2RAD(), DEGREES_T, SHAPE_POLY_SET::Fracture(), OPTIONAL_XML_ATTRIBUTE< T >::Get(), GetArcToSegmentCount(), EPOLYGON::HATCH, SHAPE_POLY_SET::Inflate(), IsCopperLayer(), 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, pcbIUScale, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, EPOLYGON::pour, EPOLYGON::rank, ZONE::SetAssignedPriority(), ZONE::SetDoNotAllowCopperPour(), ZONE::SetDoNotAllowFootprints(), ZONE::SetDoNotAllowPads(), ZONE::SetDoNotAllowTracks(), ZONE::SetDoNotAllowVias(), ZONE::SetFillMode(), ZONE::SetHatchGap(), ZONE::SetHatchOrientation(), ZONE::SetHatchStyle(), ZONE::SetHatchThickness(), ZONE::SetIslandRemovalMode(), ZONE::SetIsRuleArea(), ZONE::SetLayer(), ZONE::SetLocalClearance(), ZONE::SetMinThickness(), ZONE::SetPadConnection(), ZONE::SetThermalReliefGap(), ZONE::SetThermalReliefSpokeWidth(), 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 2551 of file eagle_plugin.cpp.
References ARC_HIGH_DEF, B_Cu, ConvertArcCenter(), CTX_NETCLASS, EWIRE::curve, DEG2RAD(), DEGREES_T, EVIA::diam, EVIA::drill, eagleClamp(), escapeName(), F_Cu, GetArcToSegmentCount(), IsCopperLayer(), KiROUND(), EWIRE::layer, EVIA::layer_back_most, EVIA::layer_front_most, makeKey(), pad, PCB_TRACK::SetEnd(), BOARD_ITEM::SetLayer(), NETINFO_ITEM::SetNetClass(), BOARD_CONNECTED_ITEM::SetNetCode(), PCB_TRACK::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 1723 of file eagle_plugin.cpp.
References LIB_ID::Parse().
|
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 2839 of file eagle_plugin.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 1554 of file eagle_plugin.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 1575 of file eagle_plugin.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 2243 of file eagle_plugin.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(), BOARD_ITEM::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 2333 of file eagle_plugin.cpp.
References FOOTPRINT::Add(), 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 1842 of file eagle_plugin.cpp.
References _, FOOTPRINT::Add(), LSET::AllCuMask(), 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 2138 of file eagle_plugin.cpp.
References _, FOOTPRINT::Add(), SHAPE_POLY_SET::AddOutline(), SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS, 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(), BOARD_ITEM::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 2069 of file eagle_plugin.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(), BOARD_ITEM::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 2375 of file eagle_plugin.cpp.
References FOOTPRINT::Add(), 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 1946 of file eagle_plugin.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(), 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, PCB_TEXT::TEXT_is_DIVERS, ETEXT::TOP_CENTER, ETEXT::TOP_LEFT, ETEXT::TOP_RIGHT, ECOORD::ToPcbUnits(), UNDEFINED_LAYER, FOOTPRINT::Value(), ETEXT::x, and ETEXT::y.
|
private |
Definition at line 1769 of file eagle_plugin.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(), BOARD_ITEM::SetLayer(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), ECOORD::ToPcbUnits(), UNDEFINED_LAYER, EWIRE::width, EWIRE::x1, EWIRE::x2, EWIRE::y1, and EWIRE::y2.
|
overridevirtual |
Return a brief hard coded name for this PLUGIN.
Implements PLUGIN.
Definition at line 246 of file eagle_plugin.cpp.
|
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 65 of file plugin.cpp.
Referenced by FP_LIB_TABLE::PrefetchLib().
|
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 CADSTAR_PCB_ARCHIVE_PLUGIN.
Definition at line 73 of file plugin_common_layer_mapping.h.
References LAYER_REMAPPABLE_PLUGIN::m_layer_mapping_handler.
Referenced by CADSTAR_PCB_ARCHIVE_PLUGIN::CADSTAR_PCB_ARCHIVE_PLUGIN(), EAGLE_PLUGIN(), PCB_EDIT_FRAME::OpenProjectFiles(), and CADSTAR_PCB_ARCHIVE_PLUGIN::RegisterLayerMappingCallback().
|
virtualinherited |
Write aBoard to a storage file in a format that this PLUGIN 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, and PCB_PLUGIN.
Definition at line 50 of file plugin.cpp.
References NOT_IMPLEMENTED.
Referenced by IO_MGR::Save(), PCB_EDIT_FRAME::SavePcbCopy(), and PCB_EDIT_FRAME::SavePcbFile().
|
private |
Definition at line 117 of file eagle_plugin.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 |
Registers a KIDIALOG callback for collecting info from the user.
Definition at line 285 of file io_mgr.h.
Referenced by PCB_CONTROL::AppendBoard(), and PCB_EDIT_FRAME::OpenProjectFiles().
|
private |
Deletes the footprint templates list.
Definition at line 2450 of file eagle_plugin.cpp.
References eagleClamp(), FOOTPRINT::GetOrientation(), PAD::GetParent(), FOOTPRINT::GetPosition(), PAD::GetSize(), EPAD_COMMON::name, RotatePoint(), PAD::SetLocalSolderMaskMargin(), PAD::SetNumber(), PAD::SetPosition(), PAD::SetZoneConnection(), EPAD_COMMON::thermals, EPAD_COMMON::x, VECTOR2< T >::x, EPAD_COMMON::y, and VECTOR2< T >::y.
|
private |
which BOARD is being worked on, no ownership here
Definition at line 342 of file eagle_plugin.h.
Referenced by init(), Load(), loadLayerDefs(), and loadPlain().
|
private |
Definition at line 323 of file eagle_plugin.h.
|
private |
map eagle to KiCad, cu layers only.
Definition at line 317 of file eagle_plugin.h.
Referenced by clear_cu_map(), and loadLayerDefs().
|
private |
Definition at line 325 of file eagle_plugin.h.
Referenced by Load().
|
private |
Definition at line 345 of file eagle_plugin.h.
Referenced by checkpoint(), and loadAllSections().
|
private |
Eagle layer data stored by layer number.
Definition at line 318 of file eagle_plugin.h.
Referenced by loadLayerDefs().
|
private |
Eagle layer ids stored by layer name.
Definition at line 319 of file eagle_plugin.h.
Referenced by loadLayerDefs().
|
private |
generates unique footprint names from eagle "hole"s.
Definition at line 331 of file eagle_plugin.h.
Referenced by init(), and loadPlain().
|
private |
Definition at line 346 of file eagle_plugin.h.
Referenced by checkpoint().
|
private |
Map of Eagle layers to KiCad layers.
Eagle class number to KiCad netclass
Definition at line 320 of file eagle_plugin.h.
|
protectedinherited |
Callback to get layer mapping.
Definition at line 80 of file plugin_common_layer_mapping.h.
Referenced by CADSTAR_PCB_ARCHIVE_PLUGIN::ensureLoadedLibrary(), CADSTAR_PCB_ARCHIVE_PLUGIN::Load(), and LAYER_REMAPPABLE_PLUGIN::RegisterLayerMappingCallback().
|
private |
Definition at line 354 of file eagle_plugin.h.
|
private |
smallest via annulus we find on Load(), in BIU.
Definition at line 352 of file eagle_plugin.h.
|
private |
smallest diameter hole we find on Load(), in BIU.
Definition at line 350 of file eagle_plugin.h.
|
private |
smallest trace we find on Load(), in BIU.
Definition at line 349 of file eagle_plugin.h.
|
private |
smallest via we find on Load(), in BIU.
Definition at line 351 of file eagle_plugin.h.
|
private |
Definition at line 355 of file eagle_plugin.h.
|
private |
|
private |
optional; may be nullptr
Definition at line 344 of file eagle_plugin.h.
Referenced by checkpoint(), Load(), and loadAllSections().
|
private |
passed via Save() or Load(), no ownership, may be NULL.
Definition at line 341 of file eagle_plugin.h.
Referenced by init().
|
private |
Eagle design rules.
Definition at line 327 of file eagle_plugin.h.
Referenced by init(), Load(), loadDesignRules(), and ~EAGLE_PLUGIN().
|
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 335 of file eagle_plugin.h.
Referenced by GetImportedCachedLibraryFootprints().
|
private |
for progress reporting
Definition at line 347 of file eagle_plugin.h.
Referenced by checkpoint(), and loadAllSections().
|
private |
keeps track of what we are working on within XML document during a Load().
Definition at line 328 of file eagle_plugin.h.
Referenced by init(), Load(), loadAllSections(), loadDesignRules(), loadLibrary(), loadPlain(), and ~EAGLE_PLUGIN().