25 #ifndef _SCH_EAGLE_PLUGIN_H_ 26 #define _SCH_EAGLE_PLUGIN_H_ 28 #include <wx/xml/xml.h> 36 #include <boost/ptr_container/ptr_map.hpp> 53 class SCH_EAGLE_PLUGIN_CACHE;
70 std::unordered_map<wxString, wxString>
package;
87 const wxString
GetName()
const override;
99 const PROPERTIES* aProperties =
nullptr )
override;
101 bool CheckHeader(
const wxString& aFileName )
override;
108 void loadSheet( wxXmlNode* aSheetNode,
int sheetcount );
111 void countNets( wxXmlNode* aSchematicNode );
124 const std::vector<SEG>& aLines )
const;
126 void loadSegments( wxXmlNode* aSegmentsNode,
const wxString& aNetName,
127 const wxString& aNetClass );
132 void loadFrame( wxXmlNode* aFrameNode, std::vector<SCH_LINE*>& aLines );
134 bool loadSymbol( wxXmlNode* aSymbolNode, std::unique_ptr<LIB_PART>& aPart,
135 EDEVICE* aDevice,
int aGateNumber,
const wxString& aGateName );
148 void loadFrame( wxXmlNode* aFrameNode, std::vector<LIB_ITEM*>& aLines );
262 #endif // _SCH_EAGLE_PLUGIN_H_ SCH_SHEET * m_currentSheet
The current sheet of the schematic being loaded.
EAGLE_MISSING_CMP(const SCH_COMPONENT *aComponent=nullptr)
Link to the parent component.
Instances are attached to a symbol or sheet and provide a place for the component's value,...
std::pair< VECTOR2I, const SEG * > findNearestLinePoint(const wxPoint &aPoint, const std::vector< SEG > &aLines) const
const wxString GetLibraryFileExtension() const override
Return the library file extension for the SCH_PLUGIN object.
std::unordered_map< wxString, wxXmlNode * > SymbolNodes
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
void loadSchematic(wxXmlNode *aSchematicNode)
EAGLE_LIBRARY * loadLibrary(wxXmlNode *aLibraryNode, EAGLE_LIBRARY *aEagleLib)
Holds all the data relating to one schematic.
SCH_LINE * loadWire(wxXmlNode *aWireNode)
Define a symbol library graphical text item.
std::unordered_map< wxString, wxString > package
bool checkConnections(const SCH_COMPONENT *aComponent, const LIB_PIN *aPin) const
std::map< wxString, int > m_netCounts
Field object used in symbol libraries.
void SetReporter(REPORTER *aReporter) override
Set an optional reporter for warnings/errors.
int GetModifyHash() const override
Return the modification hash from the library cache.
A SCH_PLUGIN derivation for loading 6.x+ Eagle schematic files.
std::vector< VECTOR2I > m_wireIntersections
Wires and labels of a single connection (segment in Eagle nomenclature)
A pure virtual class used to derive REPORTER objects from.
SCH_TEXT * loadPlainText(wxXmlNode *aSchText)
A name/value tuple with unique names and optional values.
LIB_RECTANGLE * loadSymbolRectangle(std::unique_ptr< LIB_PART > &aPart, wxXmlNode *aRectNode, int aGateNumber)
std::map< wxString, EAGLE_MISSING_CMP > m_missingCmps
wxString m_libName
Library name to save symbols.
The base class for drawable items used by schematic library components.
SCH_SHEET * Load(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const PROPERTIES *aProperties=nullptr) override
Load information from some input file format that this SCH_PLUGIN implementation knows about,...
Base class for a bus or wire entry.
SCH_JUNCTION * loadJunction(wxXmlNode *aJunction)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
bool netHasPowerDriver(SCH_LINE *aLine, const wxString &aNetName) const
LIB_PIN * loadPin(std::unique_ptr< LIB_PART > &aPart, wxXmlNode *, EPIN *epin, int aGateNumber)
static wxString fixSymbolName(const wxString &aName)
Fix invalid characters in Eagle symbol names.
SCH_LAYER_ID kiCadLayer(int aEagleLayer)
Return the matching layer or return LAYER_NOTES.
Base class that schematic file and library loading and saving plugins should derive from.
bool CheckHeader(const wxString &aFileName) override
Return true if the first line in aFileName begins with the expected header.
std::map< wxString, EAGLE_LIBRARY > m_eagleLibs
struct EAGLE_LIBRARY EAGLE_LIBRARY
LIB_CIRCLE * loadSymbolCircle(std::unique_ptr< LIB_PART > &aPart, wxXmlNode *aCircleNode, int aGateNumber)
void addImplicitConnections(SCH_COMPONENT *aComponent, SCH_SCREEN *aScreen, bool aUpdateSet)
Create net labels to emulate implicit connections in Eagle.
boost::ptr_map< wxString, EPART > EPART_LIST
SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi
Plugin to create the KiCad symbol library.
SCH_TEXT * loadLabel(wxXmlNode *aLabelNode, const wxString &aNetName)
bool loadSymbol(wxXmlNode *aSymbolNode, std::unique_ptr< LIB_PART > &aPart, EDEVICE *aDevice, int aGateNumber, const wxString &aGateName)
Define a library symbol object.
void loadSegments(wxXmlNode *aSegmentsNode, const wxString &aNetName, const wxString &aNetClass)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
wxFileName getLibFileName()
Checks if there are other wires or pins at the position of the tested pin.
wxString m_version
Eagle file version.
void loadFrame(wxXmlNode *aFrameNode, std::vector< SCH_LINE * > &aLines)
SCH_LAYER_ID
Eeschema drawing layers.
SCH_SHEET * m_rootSheet
The root sheet of the schematic being loaded.
LIB_ITEM * loadSymbolWire(std::unique_ptr< LIB_PART > &aPart, wxXmlNode *aWireNode, int aGateNumber)
Object to handle a bitmap image that can be inserted in a schematic.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void addBusEntries()
This function finds best way to place a bus entry symbol for when an Eagle wire segment ends on an Ea...
std::unordered_map< wxString, int > GateUnit
void loadLayerDefs(wxXmlNode *aLayers)
void loadInstance(wxXmlNode *aInstanceNode)
Helper object to release a SCH_PLUGIN in the context of a potential thrown exception through its dest...
const SCH_COMPONENT * cmp
std::map< int, SCH_LAYER_ID > m_layerMap
Wire intersection points, used for quick checks whether placing a net label in a particular place wou...
std::vector< SEG_DESC > m_segments
Nets as defined in the <nets> sections of an Eagle schematic file.
void loadFieldAttributes(LIB_FIELD *aField, const LIB_TEXT *aText) const
Move net labels that are detached from any wire to the nearest wire.
void loadTextAttributes(EDA_TEXT *aText, const ETEXT &aAttribs) const
void loadDrawing(wxXmlNode *aDrawingNode)
wxString translateEagleBusName(const wxString &aEagleName) const
Translate an Eagle-style bus name into one that is KiCad-compatible.
Segment description base class to describe items which have 2 end points (track, wire,...
std::map< wxString, std::unique_ptr< EPART > > EPART_MAP
Translates Eagle special characters to their counterparts in KiCad.
REPORTER * m_reporter
Reporter for warnings/errors.
const wxString GetName() const override
Return a brief hard coded name for this SCH_PLUGIN.
void moveLabels(SCH_ITEM *aWire, const wxPoint &aNewEndPoint)
Move any labels on the wire to the new end point of the wire.
std::map< int, bool > units
SCHEMATIC * m_schematic
Passed to Load(), the schematic object being loaded.
LIB_TEXT * loadSymbolText(std::unique_ptr< LIB_PART > &aPart, wxXmlNode *aLibText, int aGateNumber)
struct SCH_EAGLE_PLUGIN::SEG_DESC_STRUCT SEG_DESC
Segments representing wires for intersection checking.
std::unique_ptr< PROPERTIES > m_properties
Library plugin properties.
void countNets(wxXmlNode *aSchematicNode)
const wxString GetFileExtension() const override
Return the file extension for the SCH_PLUGIN.
void loadSheet(wxXmlNode *aSheetNode, int sheetcount)
boost::ptr_map< wxString, LIB_PART > KiCadSymbols
const SEG * LabelAttached(const SCH_TEXT *aLabel) const
< Test if a particular label is attached to any of the stored segments
Object used to load, save, search, and otherwise manipulate symbol library files.
Base class for any item which can be embedded within the SCHEMATIC container class,...
std::vector< SCH_TEXT * > labels
LIB_POLYLINE * loadSymbolPolyLine(std::unique_ptr< LIB_PART > &aPart, wxXmlNode *aPolygonNode, int aGateNumber)
std::map< wxPoint, std::set< const EDA_ITEM * > > m_connPoints
std::map< wxString, ENET > m_nets
Positions of pins and wire endings mapped to its parent.