37#include <wx/xml/xml.h>
44typedef std::vector<ZONE*>
ZONES;
82 void parse( wxXmlNode* aRules, std::function<
void()> aCheckpoint );
142 void FootprintEnumerate( wxArrayString& aFootprintNames,
const wxString& aLibraryPath,
143 bool aBestEfforts,
const PROPERTIES* aProperties =
nullptr)
override;
146 bool aKeepUUID =
false,
147 const PROPERTIES* aProperties =
nullptr )
override;
177 const std::vector<INPUT_LAYER_DESC>& aInputLayerDescriptionVector );
211 void cacheLib(
const wxString& aLibraryPath );
235 void loadLibrary( wxXmlNode* aLib,
const wxString* aLibName );
248 const EATTR* aValueAttr );
251 const EATTR* aAttr );
284 typedef ELAYERS::const_iterator
EITER;
Information pertinent to a Pcbnew printed circuit board.
Works with Eagle 6.x XML board files and footprints to implement the Pcbnew PLUGIN API or a portion o...
void cacheLib(const wxString &aLibraryPath)
This PLUGIN only caches one footprint library, this determines which one.
void FootprintLibOptions(PROPERTIES *aProperties) const override
Append supported PLUGIN options to aListToAppenTo along with internationalized descriptions.
int m_hole_count
generates unique footprint names from eagle "hole"s.
void mapEagleLayersToKicad()
Generate mapping between Eagle na KiCad layers.
FOOTPRINT * makeFootprint(wxXmlNode *aPackage, const wxString &aPkgName)
Create a FOOTPRINT from an Eagle package.
XPATH * m_xpath
keeps track of what we are working on within XML document during a Load().
void loadPlain(wxXmlNode *aPlain)
FOOTPRINT * FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const PROPERTIES *aProperties=nullptr) override
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PL...
void packageCircle(FOOTPRINT *aFootprint, wxXmlNode *aTree) const
void orientFPText(FOOTPRINT *aFootprint, const EELEMENT &e, FP_TEXT *aFPText, const EATTR *aAttr)
PCB_LAYER_ID kicad_layer(int aLayer) const
Convert an Eagle layer to a KiCad layer.
void packageSMD(FOOTPRINT *aFootprint, wxXmlNode *aTree) const
Handles common pad properties.
static wxDateTime getModificationTime(const wxString &aPath)
get a file's or dir's modification time.
unsigned m_totalCount
for progress reporting
ERULES * m_rules
Eagle design rules.
FOOTPRINT_MAP m_templates
is part of a FOOTPRINT factory that operates using copy construction.
void packagePolygon(FOOTPRINT *aFootprint, wxXmlNode *aTree) const
BOARD * Load(const wxString &aFileName, BOARD *aAppendToMe, const PROPERTIES *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 ...
int m_min_annulus
smallest via annulus we find on Load(), in BIU.
void loadAllSections(wxXmlNode *aDocument)
void orientFootprintAndText(FOOTPRINT *aFootprint, const EELEMENT &e, const EATTR *aNameAttr, const EATTR *aValueAttr)
std::map< wxString, PCB_LAYER_ID > DefaultLayerMappingCallback(const std::vector< INPUT_LAYER_DESC > &aInputLayerDescriptionVector)
Return the automapped layers.
std::vector< ELAYER > ELAYERS
std::tuple< PCB_LAYER_ID, LSET, bool > defaultKicadLayer(int aEagleLayer) const
Get default KiCad layer corresponding to an Eagle layer of the board, a set of sensible layer mapping...
const PROPERTIES * m_props
passed via Save() or Load(), no ownership, may be NULL.
void loadLibrary(wxXmlNode *aLib, const wxString *aLibName)
Load the Eagle "library" XML element, which can occur either under a "libraries" element (if a *....
wxSize kicad_fontz(const ECOORD &d, int aTextThickness) const
create a font size (fontz) from an eagle font size scalar and KiCad font thickness
void init(const PROPERTIES *aProperties)
initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
long long GetLibraryTimestamp(const wxString &aLibraryPath) const override
Generate a timestamp representing all the files in the library (including the library directory).
int kicad_x(const ECOORD &x) const
NET_MAP m_pads_to_nets
net list
void loadLibraries(wxXmlNode *aLibs)
const wxString GetFileExtension() const override
Returns the file extension for the PLUGIN.
std::vector< FOOTPRINT * > GetImportedCachedLibraryFootprints() override
Return a container with the cached library footprints generated in the last call to Load.
const wxString & eagle_layer_name(int aLayer) const
Get Eagle layer name by its number.
void packageText(FOOTPRINT *aFootprint, wxXmlNode *aTree) const
int m_min_trace
smallest trace we find on Load(), in BIU.
int kicad_y(const ECOORD &y) const
Convert an Eagle distance to a KiCad distance.
void packageHole(FOOTPRINT *aFootprint, wxXmlNode *aTree, bool aCenter) const
int m_cu_map[17]
map eagle to KiCad, cu layers only.
std::map< wxString, NETCLASSPTR > m_classMap
Eagle class number to KiCad netclass.
void loadLayerDefs(wxXmlNode *aLayers)
int m_min_via
smallest via we find on Load(), in BIU.
unsigned m_lastProgressCount
void centerBoard()
move the BOARD into the center of the page
void packagePad(FOOTPRINT *aFootprint, wxXmlNode *aTree)
ZONE * loadPolygon(wxXmlNode *aPolyNode)
Load a copper or keepout polygon and adds it to the board.
void transferPad(const EPAD_COMMON &aEaglePad, PAD *aPad) const
Deletes the footprint templates list.
bool IsFootprintLibWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
void loadDesignRules(wxXmlNode *aDesignRules)
std::map< wxString, PCB_LAYER_ID > m_layer_map
Map of Eagle layers to KiCad layers.
void loadSignals(wxXmlNode *aSignals)
void packageWire(FOOTPRINT *aFootprint, wxXmlNode *aTree) const
PROGRESS_REPORTER * m_progressReporter
optional; may be nullptr
std::map< int, ELAYER > m_eagleLayers
Eagle layer data stored by layer number.
ELAYERS::const_iterator EITER
const wxString PluginName() const override
Return a brief hard coded name for this PLUGIN.
std::map< wxString, int > m_eagleLayersIds
Eagle layer ids stored by layer name.
void packageRectangle(FOOTPRINT *aFootprint, wxXmlNode *aTree) const
void loadClasses(wxXmlNode *aClasses)
int eagle_layer_id(const wxString &aLayerName) const
Get Eagle layer number by its name.
BOARD * m_board
which BOARD is being worked on, no ownership here
void loadElements(wxXmlNode *aElements)
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const PROPERTIES *aProperties=nullptr) override
Return a list of footprint names contained within the library at aLibraryPath.
int m_min_hole
smallest diameter hole we find on Load(), in BIU.
Plugin class for import plugins that support remappable layers.
A base class that BOARD loading and saving plugins should derive from.
A progress reporter interface for use in multi-threaded environments.
Container for project specific data.
A name/value tuple with unique names and optional values.
Keep track of what we are working on within a PTREE.
Handle a list of polygons defining a copper zone.
std::unordered_map< NET_NAME_CODE_CACHE_KEY, std::vector< CONNECTION_SUBGRAPH * > > NET_MAP
Associates a NET_CODE_NAME with all the subgraphs in that net.
std::map< wxString, FOOTPRINT * > FOOTPRINT_MAP
std::vector< ZONE * > ZONES
NET_MAP::const_iterator NET_MAP_CITER
std::map< wxString, FOOTPRINT * > FOOTPRINT_MAP
std::map< wxString, ENET > NET_MAP
PCB_LAYER_ID
A quick note on layer IDs:
Parse an Eagle "attribute" XML element.
Structure holding common properties for through-hole and SMD pads.
subset of eagle.drawing.board.designrules in the XML document
int psBottom
Shape of the bottom pads.
double mvStopFrame
solderpaste mask, expressed as percentage of the smaller pad/via dimension
double srRoundness
corner rounding ratio for SMD pads (percentage)
double rlMinViaOuter
minimum copper annulus on via
int mlMaxCreamFrame
solder paste mask, maximum size (Eagle mils, here nanometers)
int mlMinCreamFrame
solder paste mask, minimum size (Eagle mils, here nanometers)
int psTop
Shape of the top pads.
double rlMaxViaOuter
maximum copper annulus on via
void parse(wxXmlNode *aRules, std::function< void()> aCheckpoint)
percent over 100%.
double mdWireWire
wire to wire spacing I presume.
double rvPadTop
top pad size as percent of drill size
double rvViaOuter
copper annulus is this percent of via hole
double rlMinPadTop
minimum copper annulus on through hole pads
int psElongationOffset
the offset of the hole within the "long" pad.
int mlMinStopFrame
solder mask, minimum size (Eagle mils, here nanometers)
int srMinRoundness
corner rounding radius, maximum size (Eagle mils, here nanometers)
int mlMaxStopFrame
solder mask, maximum size (Eagle mils, here nanometers)
double rlMaxPadTop
maximum copper annulus on through hole pads
int psFirst
Shape of the first pads.