![]() |
KiCad PCB EDA Suite
|
A SCH_PLUGIN derivation for loading 6.x+ Eagle schematic files. More...
#include <sch_eagle_plugin.h>
Classes | |
struct | EAGLE_MISSING_CMP |
struct | SEG_DESC |
Segments representing wires for intersection checking. More... | |
Public Member Functions | |
SCH_EAGLE_PLUGIN () | |
~SCH_EAGLE_PLUGIN () | |
const wxString | GetName () const override |
Return a brief hard coded name for this SCH_PLUGIN. More... | |
void | SetReporter (REPORTER *aReporter) override |
Set an optional reporter for warnings/errors. More... | |
void | SetProgressReporter (PROGRESS_REPORTER *aReporter) override |
Set an optional progress reporter. More... | |
const wxString | GetFileExtension () const override |
Return the file extension for the SCH_PLUGIN. More... | |
const wxString | GetLibraryFileExtension () const override |
Return the library file extension for the SCH_PLUGIN object. More... | |
int | GetModifyHash () const override |
Return the modification hash from the library cache. More... | |
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, into either a new SCH_SHEET or an existing one. More... | |
bool | CheckHeader (const wxString &aFileName) override |
Return true if the first line in aFileName begins with the expected header. More... | |
virtual void | SaveLibrary (const wxString &aFileName, const PROPERTIES *aProperties=nullptr) |
virtual void | Save (const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const PROPERTIES *aProperties=nullptr) |
Write aSchematic to a storage file in a format that this SCH_PLUGIN implementation knows about, or it can be used to write a portion of aSchematic to a special kind of export file. More... | |
virtual void | EnumerateSymbolLib (wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) |
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath. More... | |
virtual void | EnumerateSymbolLib (std::vector< LIB_SYMBOL * > &aSymbolList, const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) |
Populate a list of LIB_SYMBOL aliases contained within the library aLibraryPath. More... | |
virtual LIB_SYMBOL * | LoadSymbol (const wxString &aLibraryPath, const wxString &aPartName, const PROPERTIES *aProperties=nullptr) |
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this SCH_PLUGIN knows about. More... | |
virtual void | SaveSymbol (const wxString &aLibraryPath, const LIB_SYMBOL *aSymbol, const PROPERTIES *aProperties=nullptr) |
Write aSymbol to an existing library located at aLibraryPath. More... | |
virtual void | DeleteSymbol (const wxString &aLibraryPath, const wxString &aSymbolName, const PROPERTIES *aProperties=nullptr) |
Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath. More... | |
virtual void | CreateSymbolLib (const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) |
Create a new empty symbol library at aLibraryPath. More... | |
virtual bool | DeleteSymbolLib (const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) |
Delete an existing symbol library and returns true if successful, 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 bool | IsSymbolLibWritable (const wxString &aLibraryPath) |
Return true if the library at aLibraryPath is writable. More... | |
virtual void | SymbolLibOptions (PROPERTIES *aListToAppendTo) const |
Append supported SCH_PLUGIN options to aListToAppenTo along with internationalized descriptions. More... | |
virtual const wxString & | GetError () const |
Return an error string to the caller. More... | |
Private Member Functions | |
void | checkpoint () |
void | loadDrawing (wxXmlNode *aDrawingNode) |
void | loadLayerDefs (wxXmlNode *aLayers) |
void | loadSchematic (wxXmlNode *aSchematicNode) |
void | loadSheet (wxXmlNode *aSheetNode, int sheetcount) |
void | loadInstance (wxXmlNode *aInstanceNode) |
EAGLE_LIBRARY * | loadLibrary (wxXmlNode *aLibraryNode, EAGLE_LIBRARY *aEagleLib) |
void | countNets (wxXmlNode *aSchematicNode) |
void | moveLabels (SCH_LINE *aWire, const wxPoint &aNewEndPoint) |
Move any labels on the wire to the new end point of the wire. More... | |
void | addBusEntries () |
This function finds best way to place a bus entry symbol for when an Eagle wire segment ends on an Eagle bus segment. More... | |
SCH_LAYER_ID | kiCadLayer (int aEagleLayer) |
Return the matching layer or return LAYER_NOTES. More... | |
std::pair< VECTOR2I, const SEG * > | findNearestLinePoint (const wxPoint &aPoint, const std::vector< SEG > &aLines) const |
void | loadSegments (wxXmlNode *aSegmentsNode, const wxString &aNetName, const wxString &aNetClass) |
SCH_LINE * | loadWire (wxXmlNode *aWireNode) |
SCH_TEXT * | loadLabel (wxXmlNode *aLabelNode, const wxString &aNetName) |
SCH_JUNCTION * | loadJunction (wxXmlNode *aJunction) |
SCH_TEXT * | loadPlainText (wxXmlNode *aSchText) |
void | loadFrame (wxXmlNode *aFrameNode, std::vector< SCH_LINE * > &aLines) |
bool | loadSymbol (wxXmlNode *aSymbolNode, std::unique_ptr< LIB_SYMBOL > &aSymbol, EDEVICE *aDevice, int aGateNumber, const wxString &aGateName) |
LIB_SHAPE * | loadSymbolCircle (std::unique_ptr< LIB_SYMBOL > &aSymbol, wxXmlNode *aCircleNode, int aGateNumber) |
LIB_SHAPE * | loadSymbolRectangle (std::unique_ptr< LIB_SYMBOL > &aSymbol, wxXmlNode *aRectNode, int aGateNumber) |
LIB_SHAPE * | loadSymbolPolyLine (std::unique_ptr< LIB_SYMBOL > &aSymbol, wxXmlNode *aPolygonNode, int aGateNumber) |
LIB_ITEM * | loadSymbolWire (std::unique_ptr< LIB_SYMBOL > &aSymbol, wxXmlNode *aWireNode, int aGateNumber) |
LIB_PIN * | loadPin (std::unique_ptr< LIB_SYMBOL > &aSymbol, wxXmlNode *, EPIN *epin, int aGateNumber) |
LIB_TEXT * | loadSymbolText (std::unique_ptr< LIB_SYMBOL > &aSymbol, wxXmlNode *aLibText, int aGateNumber) |
void | loadFrame (wxXmlNode *aFrameNode, std::vector< LIB_ITEM * > &aLines) |
void | loadTextAttributes (EDA_TEXT *aText, const ETEXT &aAttribs) const |
void | loadFieldAttributes (LIB_FIELD *aField, const LIB_TEXT *aText) const |
Move net labels that are detached from any wire to the nearest wire. More... | |
void | adjustNetLabels () |
wxString | translateEagleBusName (const wxString &aEagleName) const |
Translate an Eagle-style bus name into one that is KiCad-compatible. More... | |
wxString | getLibName () |
wxFileName | getLibFileName () |
Checks if there are other wires or pins at the position of the tested pin. More... | |
bool | checkConnections (const SCH_SYMBOL *aSymbol, const LIB_PIN *aPin) const |
void | addImplicitConnections (SCH_SYMBOL *aSymbol, SCH_SCREEN *aScreen, bool aUpdateSet) |
Create net labels to emulate implicit connections in Eagle. More... | |
bool | netHasPowerDriver (SCH_LINE *aLine, const wxString &aNetName) const |
Private Attributes | |
REPORTER * | m_reporter |
Reporter for warnings/errors. More... | |
std::map< wxString, EAGLE_MISSING_CMP > | m_missingCmps |
SCH_SHEET * | m_rootSheet |
The root sheet of the schematic being loaded. More... | |
SCH_SHEET * | m_currentSheet |
The current sheet of the schematic being loaded. More... | |
wxString | m_version |
Eagle file version. More... | |
wxFileName | m_filename |
wxString | m_libName |
Library name to save symbols. More... | |
SCHEMATIC * | m_schematic |
Passed to Load(), the schematic object being loaded. More... | |
EPART_MAP | m_partlist |
std::map< wxString, EAGLE_LIBRARY > | m_eagleLibs |
SCH_PLUGIN::SCH_PLUGIN_RELEASER | m_pi |
PI to create KiCad symbol library. More... | |
std::unique_ptr< PROPERTIES > | m_properties |
Library plugin properties. More... | |
PROGRESS_REPORTER * | m_progressReporter |
optional; may be nullptr More... | |
unsigned | m_doneCount |
unsigned | m_lastProgressCount |
unsigned | m_totalCount |
for progress reporting More... | |
std::map< wxString, int > | m_netCounts |
std::map< int, SCH_LAYER_ID > | m_layerMap |
std::map< wxString, wxString > | m_powerPorts |
map from symbol reference to global label equivalent More... | |
std::vector< VECTOR2I > | m_wireIntersections |
Wires and labels of a single connection (segment in Eagle nomenclature) More... | |
std::vector< SEG_DESC > | m_segments |
Nets as defined in the <nets> sections of an Eagle schematic file. More... | |
std::map< wxString, ENET > | m_nets |
Positions of pins and wire endings mapped to its parent. More... | |
std::map< wxPoint, std::set< const EDA_ITEM * > > | m_connPoints |
A SCH_PLUGIN derivation for loading 6.x+ Eagle schematic files.
As with all SCH_PLUGINs there is no UI dependencies i.e. windowing calls allowed.
Definition at line 80 of file sch_eagle_plugin.h.
SCH_EAGLE_PLUGIN::SCH_EAGLE_PLUGIN | ( | ) |
Definition at line 353 of file sch_eagle_plugin.cpp.
References WXLOG_REPORTER::GetInstance(), m_currentSheet, m_reporter, m_rootSheet, and m_schematic.
SCH_EAGLE_PLUGIN::~SCH_EAGLE_PLUGIN | ( | ) |
Definition at line 367 of file sch_eagle_plugin.cpp.
|
private |
This function finds best way to place a bus entry symbol for when an Eagle wire segment ends on an Eagle bus segment.
Definition at line 2373 of file sch_eagle_plugin.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), DEFAULT_SCH_ENTRY_SIZE, ERCE_BUS_ENTRY_NEEDED, SCH_SHEET::GetScreen(), IS_NEW, SCH_LINE::IsBus(), SCH_LINE::IsWire(), SCH_SCREEN::Items(), m_currentSheet, moveLabels(), EE_RTREE::OfType(), SCH_LINE_T, EDA_ITEM::SetFlags(), and TestSegmentHit().
Referenced by loadSheet().
|
private |
Create net labels to emulate implicit connections in Eagle.
Each named power input pin creates an implicit connection in Eagle. To emulate this behavior one needs to attach global net labels to the mentioned pins. This is is also expected for the units that are not instantiated in the schematics, therefore such units need to be stored in order to create them at later stage.
aSymbol | is the symbol to process. |
aScreen | is the screen where net labels should be added. |
aUpdateSet | decides whether the missing units data should be updated. |
Definition at line 2949 of file sch_eagle_plugin.cpp.
References SCH_SCREEN::Append(), LABEL_SPIN_STYLE::BOTTOM, checkConnections(), SCH_EAGLE_PLUGIN::EAGLE_MISSING_CMP::cmp, extractNetName(), SCH_SYMBOL::GetField(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPinPhysicalPosition(), EDA_TEXT::GetText(), SCH_SYMBOL::GetUnit(), LABEL_SPIN_STYLE::LEFT, m_missingCmps, pin, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, PT_POWER_IN, REFERENCE_FIELD, LABEL_SPIN_STYLE::RIGHT, SCH_GLOBALLABEL::SetLabelSpinStyle(), SCH_TEXT::SetPosition(), EDA_TEXT::SetText(), EDA_TEXT::SetTextSize(), SCH_EAGLE_PLUGIN::EAGLE_MISSING_CMP::units, and LABEL_SPIN_STYLE::UP.
Referenced by loadSchematic(), and loadSheet().
|
private |
Definition at line 2263 of file sch_eagle_plugin.cpp.
References findNearestLinePoint(), SCH_TEXT::GetPosition(), m_segments, m_wireIntersections, move, VECTOR2< T >::Resize(), and SCH_TEXT::SetPosition().
Referenced by loadSheet().
|
private |
Definition at line 2935 of file sch_eagle_plugin.cpp.
References SCH_SYMBOL::GetPinPhysicalPosition(), and m_connPoints.
Referenced by addImplicitConnections().
|
overridevirtual |
Return true if the first line in aFileName begins with the expected header.
aFileName | is the name of the file to use as input |
Reimplemented from SCH_PLUGIN.
Definition at line 2338 of file sch_eagle_plugin.cpp.
|
private |
Definition at line 396 of file sch_eagle_plugin.cpp.
References PROGRESS_REPORTER::KeepRefreshing(), m_doneCount, m_lastProgressCount, m_progressReporter, m_totalCount, PROGRESS_REPORTER::SetCurrentProgress(), and THROW_IO_ERROR.
Referenced by loadLibrary(), loadSchematic(), and loadSheet().
|
private |
Definition at line 552 of file sch_eagle_plugin.cpp.
References getChildrenNodes(), m_netCounts, and MapChildren().
Referenced by loadSchematic().
|
virtualinherited |
Create a new empty symbol library at aLibraryPath.
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 SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 110 of file sch_plugin.cpp.
References not_implemented().
|
virtualinherited |
Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several symbols. |
aSymbolName | is the name of a LIB_SYMBOL associated with it's root LIB_SYMBOL object 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 alias or the library or deleting it. |
Reimplemented in SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 102 of file sch_plugin.cpp.
References not_implemented().
Referenced by SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer().
|
virtualinherited |
Delete an existing symbol library and returns true if successful, 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 symbols. |
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 SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 117 of file sch_plugin.cpp.
References not_implemented().
|
virtualinherited |
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.
aSymbolNameList | is an array to populate with the LIB_SYMBOL names associated with the library. |
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing one or more LIB_SYMBOL objects. |
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 the library cannot be found, the part library cannot be loaded. |
Reimplemented in SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 67 of file sch_plugin.cpp.
References not_implemented().
|
virtualinherited |
Populate a list of LIB_SYMBOL aliases contained within the library aLibraryPath.
aSymbolList | is an array to populate with the LIB_SYMBOL pointers associated with the library. |
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing one or more LIB_SYMBOL objects. |
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 the library cannot be found, the part library cannot be loaded. |
Reimplemented in SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 76 of file sch_plugin.cpp.
References not_implemented().
|
private |
Definition at line 1232 of file sch_eagle_plugin.cpp.
References VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by adjustNetLabels().
|
virtualinherited |
Return an error string to the caller.
This is useful for schematic loaders that can load partial schematics where throwing an exception would be problematic such as the KiCad legacy plugin.
Reimplemented in SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 177 of file sch_plugin.cpp.
References not_implemented().
Referenced by TEST_SCH_SHEET_LIST_FIXTURE::loadSchematic(), and TEST_NETLISTS_FIXTURE::loadSchematic().
|
overridevirtual |
Return the file extension for the SCH_PLUGIN.
Implements SCH_PLUGIN.
Definition at line 378 of file sch_eagle_plugin.cpp.
|
private |
Checks if there are other wires or pins at the position of the tested pin.
Definition at line 156 of file sch_eagle_plugin.cpp.
References KiCadSymbolLibFileExtension.
Referenced by Load(), loadInstance(), loadLibrary(), and loadSchematic().
|
private |
Definition at line 132 of file sch_eagle_plugin.cpp.
References LIB_ID::FixIllegalChars().
Referenced by Load(), and loadInstance().
|
overridevirtual |
Return the library file extension for the SCH_PLUGIN object.
Implements SCH_PLUGIN.
Definition at line 384 of file sch_eagle_plugin.cpp.
|
overridevirtual |
Return the modification hash from the library cache.
Implements SCH_PLUGIN.
Definition at line 390 of file sch_eagle_plugin.cpp.
|
overridevirtual |
Return a brief hard coded name for this SCH_PLUGIN.
Implements SCH_PLUGIN.
Definition at line 372 of file sch_eagle_plugin.cpp.
|
virtualinherited |
Return true if the library at aLibraryPath is writable.
(Often system libraries are read only because of where they are installed.)
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several symbols. |
IO_ERROR | if no library at aLibraryPath exists. |
Reimplemented in SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 125 of file sch_plugin.cpp.
References not_implemented().
|
private |
Return the matching layer or return LAYER_NOTES.
Definition at line 215 of file sch_eagle_plugin.cpp.
References LAYER_NOTES.
Referenced by loadWire().
|
overridevirtual |
Load information from some input file format that this SCH_PLUGIN implementation knows about, into either a new SCH_SHEET or an existing one.
This may be used to load an entire new SCH_SHEET, 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. |
aKiway | is the KIWAY object used to access the symbol libraries loaded by the project. |
aAppendToMe | is an existing SCH_SHEET 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. |
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 SCH_PLUGIN.
Definition at line 416 of file sch_eagle_plugin.cpp.
References _, PROJECT::ELEM_SYMBOL_LIB_TABLE, SYMBOL_LIB_TABLE::Format(), Format(), getLibFileName(), getLibName(), PROJECT::GetProjectPath(), SCH_SHEET::GetScreen(), SYMBOL_LIB_TABLE::GetSymbolLibTableFileName(), LIB_TABLE::HasLibrary(), LIB_TABLE::InsertRow(), SCHEMATIC::IsValid(), PROGRESS_REPORTER::KeepRefreshing(), KiCadSchematicFileExtension, loadDrawing(), m_filename, m_pi, m_progressReporter, m_properties, m_rootSheet, m_schematic, m_version, MapChildren(), SCHEMATIC::Prj(), SCH_LEGACY_PLUGIN::PropBuffering, PROGRESS_REPORTER::Report(), SCHEMATIC::Root(), SCH_PLUGIN::SCH_PLUGIN_RELEASER::set(), PROJECT::SetElem(), SCH_SCREEN::SetFileName(), SCH_SHEET::SetFileName(), SCHEMATIC::SetRoot(), SCH_SHEET::SetScreen(), THROW_IO_ERROR, and SCH_SCREENS::UpdateSymbolLinks().
|
private |
Definition at line 525 of file sch_eagle_plugin.cpp.
References loadLayerDefs(), loadSchematic(), and MapChildren().
Referenced by Load().
|
private |
Move net labels that are detached from any wire to the nearest wire.
Definition at line 2251 of file sch_eagle_plugin.cpp.
References EDA_TEXT::GetHorizJustify(), LIB_TEXT::GetPosition(), EDA_TEXT::GetTextAngle(), EDA_TEXT::GetTextSize(), EDA_TEXT::GetVertJustify(), EDA_TEXT::IsBold(), EDA_TEXT::SetBold(), EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetTextPos(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetVertJustify(), and EDA_TEXT::SetVisible().
Referenced by loadSymbol().
|
private |
Definition at line 989 of file sch_eagle_plugin.cpp.
References SCH_LINE::SetEndPoint(), SCH_LINE::SetLineStyle(), SCH_LINE::SetStartPoint(), SOLID, ECOORD::ToSchUnits(), EFRAME::x1, EFRAME::x2, EFRAME::y1, and EFRAME::y2.
Referenced by loadSheet(), and loadSymbol().
|
private |
Definition at line 2020 of file sch_eagle_plugin.cpp.
References LIB_SHAPE::AddPoint(), EFRAME::border_bottom, EFRAME::border_left, EFRAME::border_right, EFRAME::border_top, EFRAME::columns, KiROUND(), POLY, EFRAME::rows, LIB_ITEM::SetPosition(), EDA_TEXT::SetText(), EDA_TEXT::SetTextSize(), ECOORD::ToSchUnits(), EFRAME::x1, EFRAME::x2, EFRAME::y1, and EFRAME::y2.
|
private |
Definition at line 1278 of file sch_eagle_plugin.cpp.
References _, EATTR::align, SCH_SCREEN::Append(), EPART::attribute, ETEXT::BOTTOM_LEFT, CTX_LIBID, EROT::degrees, EPART::device, EPART::deviceset, EATTR::display, eagleToKicadAlignment(), EscapeString(), FOOTPRINT_FIELD, Format(), EINSTANCE::gate, OPTIONAL_XML_ATTRIBUTE< T >::Get(), getLibFileName(), getLibName(), PROJECT::GetProjectName(), SCH_SHEET::GetScreen(), kiCadComponentRotation(), EPART::library, SYMBOL_LIB_TABLE::LoadSymbol(), SCH_SHEET::LocatePathOfScreen(), m_connPoints, m_currentSheet, m_eagleLibs, m_partlist, m_pi, m_powerPorts, m_properties, m_reporter, m_rootSheet, m_schematic, EROT::mirror, EATTR::name, EATTR::NAME, EATTR::Off, EAGLE_LIBRARY::package, EINSTANCE::part, SCH_SHEET_PATH::PathAsString(), pin, SCHEMATIC::Prj(), REFERENCE_FIELD, REPORTER::Report(), EATTR::rot, EINSTANCE::rot, RPT_SEVERITY_ERROR, SCH_FIELD::SetName(), SCH_FIELD::SetPosition(), EDA_TEXT::SetText(), EDA_TEXT::SetVisible(), EINSTANCE::smashed, EROT::spin, ECOORD::ToSchUnits(), UnescapeString(), EPART::value, VALUE_FIELD, EPART::variant, EATTR::x, EINSTANCE::x, EATTR::y, and EINSTANCE::y.
Referenced by loadSheet().
|
private |
Definition at line 1182 of file sch_eagle_plugin.cpp.
References ECOORD::ToSchUnits(), EJUNCTION::x, and EJUNCTION::y.
Referenced by loadSegments().
|
private |
Definition at line 1195 of file sch_eagle_plugin.cpp.
References EROT::degrees, escapeName(), KiROUND(), m_netCounts, EROT::mirror, ELABEL::netname, LABEL_SPIN_STYLE::RIGHT, ELABEL::rot, ELABEL::size, ECOORD::ToSchUnits(), ELABEL::x, and ELABEL::y.
Referenced by loadSegments().
|
private |
Layers in KiCad schematics are not actually layers, but abstract groups mainly used to decide item colors.
<layers> <layer number="90" name="Modules" color="5" fill="1" visible="yes" active="yes"> <layer number="91" name="Nets" color="2" fill="1" visible="yes" active="yes"> <layer number="92" name="Busses" color="1" fill="1" visible="yes" active="yes"> <layer number="93" name="Pins" color="2" fill="1" visible="no" active="yes"> <layer number="94" name="Symbols" color="4" fill="1" visible="yes" active="yes"> <layer number="95" name="Names" color="7" fill="1" visible="yes" active="yes"> <layer number="96" name="Values" color="7" fill="1" visible="yes" active="yes"> <layer number="97" name="Info" color="7" fill="1" visible="yes" active="yes"> <layer number="98" name="Guide" color="6" fill="1" visible="yes" active="yes"> </layers>
Definition at line 164 of file sch_eagle_plugin.cpp.
References LAYER_BUS, LAYER_NOTES, and LAYER_WIRE.
Referenced by loadDrawing().
|
private |
Definition at line 1513 of file sch_eagle_plugin.cpp.
References checkpoint(), countChildren(), CTX_LIBID, EscapeString(), EAGLE_LIBRARY::GateUnit, OPTIONAL_XML_ATTRIBUTE< T >::Get(), getChildrenNodes(), getLibFileName(), PROJECT::GetProjectName(), EAGLE_LIBRARY::KiCadSymbols, loadSymbol(), m_pi, m_properties, m_schematic, MapChildren(), name, EGATE::name, EDEVICE::name, EDEVICE_SET::name, EAGLE_LIBRARY::package, EDEVICE::package, EDEVICE_SET::prefix, SCHEMATIC::Prj(), REFERENCE_FIELD, EDA_TEXT::SetText(), EDA_TEXT::SetVisible(), EGATE::symbol, and EAGLE_LIBRARY::SymbolNodes.
Referenced by loadSchematic().
|
private |
Definition at line 1918 of file sch_eagle_plugin.cpp.
References CLOCK, EROT::degrees, Format(), EPIN::function, OPTIONAL_XML_ATTRIBUTE< T >::Get(), INVERTED, INVERTED_CLOCK, EPIN::length, EPIN::name, pin, EPIN::rot, ECOORD::ToSchUnits(), EPIN::visible, EPIN::x, and EPIN::y.
Referenced by loadSymbol().
|
private |
Definition at line 2197 of file sch_eagle_plugin.cpp.
References escapeName(), loadTextAttributes(), ECOORD::ToSchUnits(), ETEXT::x, and ETEXT::y.
Referenced by loadSheet().
|
private |
Definition at line 586 of file sch_eagle_plugin.cpp.
References addImplicitConnections(), SCH_SHEET::AddInstance(), SCH_SCREEN::Append(), checkpoint(), countChildren(), countNets(), SCH_ITEM::Duplicate(), Format(), EDA_RECT::GetBottom(), getChildrenNodes(), SCH_SYMBOL::GetField(), EDA_RECT::GetHeight(), EDA_RECT::GetLeft(), getLibFileName(), SCH_SCREEN::GetPageSettings(), SCH_SHEET::GetScreen(), getSheetBbox(), EDA_TEXT::GetText(), EDA_RECT::GetWidth(), EDA_RECT::GetY(), loadLibrary(), loadSheet(), SCH_SHEET::LocatePathOfScreen(), m_currentSheet, m_doneCount, m_eagleLibs, m_missingCmps, m_partlist, m_pi, m_progressReporter, m_rootSheet, m_schematic, m_totalCount, MapChildren(), EAGLE_LIBRARY::name, SCH_SHEET_PATH::Path(), SCH_SHEET_PATH::push_back(), REFERENCE_FIELD, and SCH_SHEET::SetPageNumber().
Referenced by loadDrawing().
|
private |
Definition at line 1024 of file sch_eagle_plugin.cpp.
References SCH_SCREEN::Append(), countChildren(), CTX_NETNAME, escapeName(), EscapeString(), SCH_LINE::GetEndPoint(), SCH_SHEET::GetScreen(), SCH_LINE::GetStartPoint(), EDA_TEXT::GetText(), SEG::Intersect(), SCH_EAGLE_PLUGIN::SEG_DESC::labels, LABEL_SPIN_STYLE::LEFT, loadJunction(), loadLabel(), loadWire(), m_currentSheet, m_netCounts, m_powerPorts, m_segments, m_wireIntersections, MapChildren(), pin, LABEL_SPIN_STYLE::RIGHT, and SCH_EAGLE_PLUGIN::SEG_DESC::segs.
Referenced by loadSheet().
|
private |
Definition at line 804 of file sch_eagle_plugin.cpp.
References addBusEntries(), addImplicitConnections(), adjustNetLabels(), SCH_SCREEN::Append(), SCH_SHEET::AutoplaceFields(), EE_RTREE::begin(), EDA_RECT::Centre(), checkpoint(), EE_RTREE::end(), Format(), getChildrenNodes(), SCH_SHEET::GetFields(), SCH_SCREEN::GetPageSettings(), SCH_SHEET::GetScreen(), getSheetBbox(), EDA_RECT::GetSize(), SCH_SCREEN::Items(), KiCadSchematicFileExtension, loadFrame(), loadInstance(), loadPlainText(), loadSegments(), loadWire(), m_connPoints, m_currentSheet, m_filename, MapChildren(), EE_RTREE::OfType(), ReplaceIllegalFileNameChars(), SCH_SYMBOL_T, SCH_SCREEN::SetFileName(), PAGE_INFO::SetHeightMils(), SCH_SCREEN::SetPageSettings(), EDA_TEXT::SetText(), PAGE_INFO::SetWidthMils(), SHEETFILENAME, SHEETNAME, translateEagleBusName(), and SCH_SCREEN::Update().
Referenced by loadSchematic().
|
private |
Definition at line 1623 of file sch_eagle_plugin.cpp.
References EDEVICE::connects, EPIN::direction, escapeName(), Format(), ECONNECT::gate, loadFieldAttributes(), loadFrame(), loadPin(), loadSymbolCircle(), loadSymbolPolyLine(), loadSymbolRectangle(), loadSymbolText(), loadSymbolWire(), ECONNECT::pad, pin, ECONNECT::pin, pinDirectionsMap, PT_BIDI, REFERENCE_FIELD, LIB_PIN::SetNumber(), and VALUE_FIELD.
Referenced by loadLibrary().
|
virtualinherited |
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this SCH_PLUGIN knows about.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several symbols. |
aPartName | is the name of the LIB_SYMBOL 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. |
IO_ERROR | if the library cannot be found or read. No exception is thrown in the case where aAliasName cannot be found. |
Reimplemented in SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 85 of file sch_plugin.cpp.
References not_implemented().
Referenced by SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer().
|
private |
Definition at line 1773 of file sch_eagle_plugin.cpp.
References CIRCLE, ECIRCLE::radius, EDA_SHAPE::SetEnd(), LIB_SHAPE::SetPosition(), LIB_ITEM::SetUnit(), EDA_SHAPE::SetWidth(), ECOORD::ToSchUnits(), ECIRCLE::width, ECIRCLE::x, and ECIRCLE::y.
Referenced by loadSymbol().
|
private |
Definition at line 1891 of file sch_eagle_plugin.cpp.
References LIB_SHAPE::AddPoint(), FILLED_SHAPE, POLY, EDA_SHAPE::SetFillMode(), LIB_ITEM::SetUnit(), ECOORD::ToSchUnits(), EVERTEX::x, and EVERTEX::y.
Referenced by loadSymbol().
|
private |
Definition at line 1790 of file sch_eagle_plugin.cpp.
References EROT::degrees, FILLED_SHAPE, LIB_SHAPE::GetCenter(), EDA_SHAPE::GetEnd(), LIB_SHAPE::GetPosition(), RECT, ERECT::rot, RotatePoint(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFillMode(), LIB_SHAPE::SetPosition(), LIB_ITEM::SetUnit(), ECOORD::ToSchUnits(), ERECT::x1, ERECT::x2, ERECT::y1, and ERECT::y2.
Referenced by loadSymbol().
|
private |
Definition at line 1995 of file sch_eagle_plugin.cpp.
References loadTextAttributes(), and text.
Referenced by loadSymbol().
|
private |
Definition at line 1821 of file sch_eagle_plugin.cpp.
References LIB_SHAPE::AddPoint(), ARC, CalcArcMid(), ConvertArcCenter(), EWIRE::curve, FILLED_SHAPE, POLY, EDA_SHAPE::SetArcGeometry(), EDA_SHAPE::SetFillMode(), LIB_ITEM::SetUnit(), EDA_SHAPE::SetWidth(), ECOORD::ToSchUnits(), EWIRE::width, EWIRE::x1, EWIRE::x2, EWIRE::y1, and EWIRE::y2.
Referenced by loadSymbol().
|
private |
Definition at line 2229 of file sch_eagle_plugin.cpp.
References ETEXT::align, ETEXT::BOTTOM_LEFT, OPTIONAL_XML_ATTRIBUTE< T >::CGet(), ETEXT::ConvertSize(), EROT::degrees, eagleToKicadAlignment(), GetPenSizeForBold(), EDA_TEXT::GetTextWidth(), EROT::mirror, ETEXT::ratio, ETEXT::rot, EDA_TEXT::SetBold(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetTextThickness(), and EROT::spin.
Referenced by loadPlainText(), and loadSymbolText().
|
private |
Definition at line 1157 of file sch_eagle_plugin.cpp.
References kiCadLayer(), EWIRE::layer, m_connPoints, ECOORD::ToSchUnits(), EWIRE::x1, EWIRE::x2, EWIRE::y1, and EWIRE::y2.
Referenced by loadSegments(), and loadSheet().
|
private |
Move any labels on the wire to the new end point of the wire.
Definition at line 2357 of file sch_eagle_plugin.cpp.
References SCH_LINE::GetBoundingBox(), SCH_LINE::GetEndPoint(), SCH_SHEET::GetScreen(), SCH_LINE::GetStartPoint(), SCH_SCREEN::Items(), m_currentSheet, EE_RTREE::Overlapping(), SCH_GLOBAL_LABEL_T, SCH_LABEL_T, and TestSegmentHit().
Referenced by addBusEntries().
|
private |
|
virtualinherited |
Write aSchematic to a storage file in a format that this SCH_PLUGIN implementation knows about, or it can be used to write a portion of aSchematic to a special kind of export file.
aFileName | is the name of a file to save to on disk. |
aSheet | is the class SCH_SHEET in memory document tree from which to extract information when writing to aFileName. The caller continues to own the SCHEMATIC, and the plugin should refrain from modifying the SCHEMATIC if possible. |
aSchematic | is the SCHEMATIC object used to access any schematic-wide or project information needed to save the document. |
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. Set the #PropSaveCurrentSheetOnly property to only save the current sheet. Otherwise, all hierarchical sheets are saved. |
IO_ERROR | if there is a problem saving or exporting. |
Reimplemented in SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 59 of file sch_plugin.cpp.
References not_implemented().
|
virtualinherited |
Reimplemented in SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 45 of file sch_plugin.cpp.
References not_implemented().
|
virtualinherited |
Write aSymbol to an existing library located at aLibraryPath.
If a LIB_SYMBOL by the same name already exists or there are any conflicting alias names, the new LIB_SYMBOL will silently overwrite any existing aliases and/or part because libraries cannot have duplicate alias names. It is the responsibility of the caller to check the library for conflicts before saving.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several symbols. |
aSymbol | is what to store in the library. The library is refreshed and the caller must update any LIB_SYMBOL pointers that may have changed. |
aProperties | is an associative array that can be used to tell the saver how to save the symbol, 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 SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 94 of file sch_plugin.cpp.
References not_implemented().
Referenced by SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer().
|
inlineoverridevirtual |
Set an optional progress reporter.
Reimplemented from SCH_PLUGIN.
Definition at line 90 of file sch_eagle_plugin.h.
References m_progressReporter.
|
inlineoverridevirtual |
Set an optional reporter for warnings/errors.
Reimplemented from SCH_PLUGIN.
Definition at line 88 of file sch_eagle_plugin.h.
References m_reporter.
|
virtualinherited |
Append supported SCH_PLUGIN options to aListToAppenTo along with internationalized descriptions.
Options are typically appended so that a derived SCH_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 Symbol*() functions in all derived SCH_PLUGINs.) Note that since aListToAppendTo is a PROPERTIES object, all options will be unique and last guy wins.
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 SCH_PLUGIN, which has been avoided to date. |
Definition at line 133 of file sch_plugin.cpp.
References _.
|
private |
Translate an Eagle-style bus name into one that is KiCad-compatible.
For vector buses such as A[7..0] this has no impact. For group buses, we translate from Eagle-style to KiCad-style.
aEagleName | is the name of the bus from the Eagle schematic |
Definition at line 3038 of file sch_eagle_plugin.cpp.
References NET_SETTINGS::ParseBusVector().
Referenced by loadSheet().
|
private |
Definition at line 261 of file sch_eagle_plugin.h.
Referenced by checkConnections(), loadInstance(), loadSheet(), and loadWire().
|
private |
The current sheet of the schematic being loaded.
Definition at line 218 of file sch_eagle_plugin.h.
Referenced by addBusEntries(), loadInstance(), loadSchematic(), loadSegments(), loadSheet(), moveLabels(), and SCH_EAGLE_PLUGIN().
|
private |
Definition at line 231 of file sch_eagle_plugin.h.
Referenced by checkpoint(), and loadSchematic().
|
private |
Definition at line 225 of file sch_eagle_plugin.h.
Referenced by loadInstance(), and loadSchematic().
|
private |
Definition at line 220 of file sch_eagle_plugin.h.
Referenced by Load(), and loadSheet().
|
private |
Definition at line 232 of file sch_eagle_plugin.h.
Referenced by checkpoint().
|
private |
Definition at line 236 of file sch_eagle_plugin.h.
|
private |
Library name to save symbols.
Definition at line 221 of file sch_eagle_plugin.h.
|
private |
Definition at line 215 of file sch_eagle_plugin.h.
Referenced by addImplicitConnections(), and loadSchematic().
|
private |
Definition at line 235 of file sch_eagle_plugin.h.
Referenced by countNets(), loadLabel(), and loadSegments().
|
private |
Positions of pins and wire endings mapped to its parent.
Definition at line 258 of file sch_eagle_plugin.h.
|
private |
Definition at line 224 of file sch_eagle_plugin.h.
Referenced by loadInstance(), and loadSchematic().
|
private |
PI to create KiCad symbol library.
Definition at line 227 of file sch_eagle_plugin.h.
Referenced by Load(), loadInstance(), loadLibrary(), and loadSchematic().
|
private |
map from symbol reference to global label equivalent
Wire intersection points, used for quick checks whether placing a net label in a particular place would short two nets.
Definition at line 237 of file sch_eagle_plugin.h.
Referenced by loadInstance(), and loadSegments().
|
private |
optional; may be nullptr
Definition at line 230 of file sch_eagle_plugin.h.
Referenced by checkpoint(), Load(), loadSchematic(), and SetProgressReporter().
|
private |
Library plugin properties.
Definition at line 228 of file sch_eagle_plugin.h.
Referenced by Load(), loadInstance(), and loadLibrary().
|
private |
Reporter for warnings/errors.
Map references to missing symbol units data
Definition at line 212 of file sch_eagle_plugin.h.
Referenced by loadInstance(), SCH_EAGLE_PLUGIN(), and SetReporter().
|
private |
The root sheet of the schematic being loaded.
Definition at line 217 of file sch_eagle_plugin.h.
Referenced by Load(), loadInstance(), loadSchematic(), and SCH_EAGLE_PLUGIN().
|
private |
Passed to Load(), the schematic object being loaded.
Definition at line 222 of file sch_eagle_plugin.h.
Referenced by Load(), loadInstance(), loadLibrary(), loadSchematic(), and SCH_EAGLE_PLUGIN().
|
private |
Nets as defined in the <nets> sections of an Eagle schematic file.
Definition at line 255 of file sch_eagle_plugin.h.
Referenced by adjustNetLabels(), and loadSegments().
|
private |
for progress reporting
Definition at line 233 of file sch_eagle_plugin.h.
Referenced by checkpoint(), and loadSchematic().
|
private |
|
private |
Wires and labels of a single connection (segment in Eagle nomenclature)
Definition at line 242 of file sch_eagle_plugin.h.
Referenced by adjustNetLabels(), and loadSegments().