|
KiCad PCB EDA Suite
|
A SCH_IO derivation for loading gEDA/gschem schematic files (.sch). More...
#include <sch_io_geda.h>
Classes | |
| struct | BUS_SEGMENT |
| Parsed bus segment in KiCad coordinates with gEDA ripper direction. More... | |
| struct | DEFERRED_SHEET |
| Deferred hierarchical sheet loads. More... | |
| struct | GEDA_ATTR |
| Parsed attribute from a gEDA T line inside a { } block. More... | |
| struct | NET_ATTR_RECORD |
| Components with net= attributes that need post-processing. More... | |
| struct | PENDING_COMPONENT |
| Pending component waiting for symbol resolution. More... | |
| struct | SYM_CACHE_ENTRY |
| Entry in the symbol library search cache. More... | |
Public Member Functions | |
| SCH_IO_GEDA () | |
| ~SCH_IO_GEDA () override | |
| const IO_BASE::IO_FILE_DESC | GetSchematicFileDesc () const override |
| Returns schematic file description for the SCH_IO. | |
| const IO_BASE::IO_FILE_DESC | GetLibraryDesc () const override |
| Get the descriptor for the library container that this IO plugin operates on. | |
| bool | CanReadSchematicFile (const wxString &aFileName) const override |
| Checks if this SCH_IO can read the specified schematic file. | |
| int | GetModifyHash () const override |
| Return the modification hash from the library cache. | |
| SCH_SHEET * | LoadSchematicFile (const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
| Load information from some input file format that this SCH_IO implementation knows about, into either a new SCH_SHEET or an existing one. | |
| bool | IsLibraryWritable (const wxString &aLibraryPath) override |
| Return true if the library at aLibraryPath is writable. | |
| virtual void | SaveLibrary (const wxString &aFileName, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| virtual void | SaveSchematicFile (const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Write aSchematic to a storage file in a format that this SCH_IO implementation knows about, or it can be used to write a portion of aSchematic to a special kind of export file. | |
| virtual void | EnumerateSymbolLib (wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath. | |
| virtual void | EnumerateSymbolLib (std::vector< LIB_SYMBOL * > &aSymbolList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Populate a list of LIB_SYMBOL aliases contained within the library aLibraryPath. | |
| virtual LIB_SYMBOL * | LoadSymbol (const wxString &aLibraryPath, const wxString &aPartName, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this SCH_IO knows about. | |
| virtual void | SaveSymbol (const wxString &aLibraryPath, const LIB_SYMBOL *aSymbol, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Write aSymbol to an existing library located at aLibraryPath. | |
| virtual void | DeleteSymbol (const wxString &aLibraryPath, const wxString &aSymbolName, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath. | |
| virtual void | GetLibraryOptions (std::map< std::string, UTF8 > *aListToAppendTo) const override |
| Append supported SCH_IO options to aListToAppenTo along with internationalized descriptions. | |
| virtual bool | SupportsSubLibraries () const |
| virtual void | GetSubLibraryNames (std::vector< wxString > &aNames) |
| Retrieves a list of sub-libraries in this library. | |
| virtual wxString | GetSubLibraryDescription (const wxString &aName) |
| Gets a description of a sublibrary. | |
| virtual void | GetAvailableSymbolFields (std::vector< wxString > &aNames) |
| Retrieves a list of (custom) field names that are present on symbols in this library. | |
| virtual void | GetDefaultSymbolFields (std::vector< wxString > &aNames) |
| Retrieves a list of (custom) field names that should be shown by default for this library in the symbol chooser. | |
| virtual const wxString & | GetError () const |
| Return an error string to the caller. | |
| virtual void | SetLibraryManagerAdapter (SYMBOL_LIBRARY_ADAPTER *aAdapter) |
| Some library plugins need to interface with other loaded libraries. | |
| const wxString & | GetName () const |
| Return a brief hard coded name for this IO interface. | |
| virtual bool | IsPCB_IO () const |
| Work-around for lack of dynamic_cast across compile units on Mac. | |
| virtual void | SetReporter (REPORTER *aReporter) |
| Set an optional reporter for warnings/errors. | |
| virtual void | SetProgressReporter (PROGRESS_REPORTER *aReporter) |
| Set an optional progress reporter. | |
| virtual const IO_FILE_DESC | GetLibraryFileDesc () const |
| Get the descriptor for the individual library elements that this IO plugin operates on. | |
| virtual bool | CanReadLibrary (const wxString &aFileName) const |
| Checks if this IO object can read the specified library file/directory. | |
| virtual void | CreateLibrary (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Create a new empty library at aLibraryPath empty. | |
| virtual bool | DeleteLibrary (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Delete an existing library and returns true, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason. | |
| virtual bool | SupportsConfigurationDialog () const |
| virtual DIALOG_SHIM * | CreateConfigurationDialog (wxWindow *aParent) |
| virtual void | Report (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) |
| virtual void | AdvanceProgressPhase () |
Static Public Member Functions | |
| static const std::map< wxString, wxString > & | getBuiltinSymbols () |
| Return the map of built-in gEDA symbol definitions (symbol name -> .sym content). | |
Protected Attributes | |
| wxString | m_name |
| Name of the IO loader. | |
| REPORTER * | m_reporter |
| Reporter to log errors/warnings to, may be nullptr. | |
| PROGRESS_REPORTER * | m_progressReporter |
| Progress reporter to track the progress of the operation, may be nullptr. | |
Private Member Functions | |
| int | toKiCadDist (int aMils) const |
| Convert a gEDA distance in mils to KiCad IU. | |
| VECTOR2I | toKiCad (int aGedaX, int aGedaY) const |
| Apply the Y-flip and scale to transform gEDA coords to KiCad. | |
| bool | parseVersionLine (const wxString &aLine) |
| Parse the "v YYYYMMDD N" version line and validate. | |
| std::vector< GEDA_ATTR > | parseAttributes (wxTextFile &aFile, size_t &aLineIdx) |
| Read a { } attribute block starting after the '{' line. | |
| wxString | findAttr (const std::vector< GEDA_ATTR > &aAttrs, const wxString &aName) const |
| Find an attribute by name, returns empty string if not found. | |
| const GEDA_ATTR * | findAttrStruct (const std::vector< GEDA_ATTR > &aAttrs, const wxString &aName) const |
| Find a GEDA_ATTR struct by name, returns nullptr if not found. | |
| std::vector< GEDA_ATTR > | maybeParseAttributes (wxTextFile &aFile, size_t &aLineIdx) |
| Check for and consume a { } attribute block at the current line position. | |
| void | parseComponent (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parseNet (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parseBus (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parseText (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parseLine (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parseBox (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parseCircle (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parseArc (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parsePath (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parsePicture (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parsePin (const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx) |
| void | parseEmbeddedComponent (wxTextFile &aFile, size_t &aLineIdx) |
| void | initSymbolLibrary () |
| Ensure the symbol library hash is built by scanning gEDA library dirs. | |
| void | scanSymbolDir (const wxString &aDir, int aDepth=0) |
| Recursively scan a directory for .sym files and populate m_symLibrary. | |
| void | parseRcFileForLibraries (const wxString &aPath, const wxString &aBaseDir) |
| Parse an RC file (gafrc or gschemrc) for component-library directives. | |
| std::unique_ptr< LIB_SYMBOL > | loadSymbolFile (const wxString &aPath, wxString *aSymversion=nullptr, wxString *aNetAttr=nullptr) |
| Load a .sym file and return a LIB_SYMBOL. | |
| void | parseSymbolObjects (wxTextFile &aFile, size_t &aLineIdx, LIB_SYMBOL &aSymbol, size_t aEndLine) |
| Parse objects from a .sym file or [] block into a LIB_SYMBOL. | |
| void | addSymbolPin (LIB_SYMBOL &aSymbol, int aX1, int aY1, int aX2, int aY2, int aWhichEnd, const std::vector< GEDA_ATTR > &aAttrs) |
| Create a pin on a LIB_SYMBOL from gEDA P line data and its attributes. | |
| void | addSymbolGraphic (LIB_SYMBOL &aSymbol, const wxString &aLine, wxTextFile &aFile, size_t &aLineIdx, wxChar aType) |
| Add a graphical item (line/box/circle/arc/path) to a LIB_SYMBOL. | |
| void | flushPendingComponent () |
| Instantiate the pending component: look up or load the symbol, create SCH_SYMBOL, apply transforms and attributes, and emit to screen. | |
| void | importHierarchicalSheet (const wxString &aSourceFile) |
| Import a gEDA hierarchical sub-schematic as a KiCad SCH_SHEET. | |
| LIB_SYMBOL * | getOrLoadSymbol (const wxString &aBasename) |
| Get or load a cached symbol by gEDA basename. | |
| std::unique_ptr< LIB_SYMBOL > | loadBuiltinSymbol (const wxString &aBasename) |
| Try loading a symbol from the built-in standard library embedded in the importer. | |
| std::unique_ptr< LIB_SYMBOL > | createFallbackSymbol (const wxString &aBasename) |
| Create a fallback rectangular symbol when the .sym file is not found. | |
| int | toKiCadOrientation (int aAngle, int aMirror) const |
| Map gEDA angle (0/90/180/270) + mirror to KiCad symbol orientation. | |
| wxString | getLibName () const |
| Derive the KiCad import library name from the schematic file. | |
| void | trackEndpoint (int aGedaX, int aGedaY) |
| Track a point as a net or pin endpoint for junction detection. | |
| void | postProcess () |
| Run the full post-processing pipeline after parsing is complete: | |
| void | processNetAttributes () |
| For each component with net= attributes, create global labels at pin positions. | |
| void | addJunctions () |
| Place junctions where 3+ net/pin endpoints coincide. | |
| void | addBusEntries () |
| Create SCH_BUS_WIRE_ENTRY objects where net endpoints touch bus segments. | |
| void | loadDeferredSheets () |
| Load sub-schematics for any SCH_SHEET objects created during parsing. | |
| void | fitPageToContent () |
| Enlarge the page if needed and center all content on the sheet. | |
Static Private Member Functions | |
| static LINE_STYLE | toLineStyle (int aDashStyle) |
| Map gEDA dashstyle (0-4) to KiCad LINE_STYLE. | |
| static FILL_T | toFillType (int aFillType) |
| Map gEDA filltype (0-4) to KiCad FILL_T. | |
Private Attributes | |
| SCH_SCREEN * | m_screen |
| SCH_SHEET * | m_rootSheet |
| SCHEMATIC * | m_schematic |
| wxFileName | m_filename |
| int | m_maxY |
| The maximum Y coordinate seen during parsing (gEDA coords, before flip). | |
| long | m_releaseVersion |
| gEDA file version fields from the "v YYYYMMDD N" header line. | |
| long | m_fileFormatVersion |
| std::unique_ptr< PENDING_COMPONENT > | m_pendingComp |
| Pending component awaiting symbol resolution. | |
| std::map< wxString, SYM_CACHE_ENTRY > | m_symLibrary |
| Symbol library cache: gEDA basename -> cache entry. | |
| bool | m_symLibraryInitialized |
| std::map< wxString, std::unique_ptr< LIB_SYMBOL > > | m_libSymbols |
| Loaded symbols for this import session, keyed by basename. | |
| int | m_powerCounter |
| Sequential counter for auto-generated #PWR references. | |
| std::map< std::pair< int, int >, int > | m_netEndpoints |
| Net endpoint positions in raw gEDA coordinates for junction detection. | |
| std::vector< NET_ATTR_RECORD > | m_netAttrRecords |
| std::vector< BUS_SEGMENT > | m_busSegments |
| std::vector< DEFERRED_SHEET > | m_deferredSheets |
| std::set< wxString > | m_importStack |
| Set of fully-resolved file paths currently in the import call stack, used to detect and prevent circular hierarchy references. | |
| const std::map< std::string, UTF8 > * | m_properties |
| Properties passed from the import framework (search paths, etc.) | |
Static Private Attributes | |
| static constexpr int | MILS_TO_IU = 254 |
| gEDA coordinates are mils with Y-up. | |
A SCH_IO derivation for loading gEDA/gschem schematic files (.sch).
gEDA schematics are ASCII text files with a simple line-oriented format. Each object type is identified by the first character of its definition line: C=component, N=net, U=bus, P=pin, T=text, L=line, B=box, V=circle, A=arc, H=path, G=picture, {=attributes, [=embedded component.
Symbol loading follows the sch-rnd model: .sym files are discovered by scanning standard gEDA library directories and loaded on first reference. Embedded symbols (defined inline via [] blocks) are also supported.
Definition at line 73 of file sch_io_geda.h.
| SCH_IO_GEDA::SCH_IO_GEDA | ( | ) |
Definition at line 1470 of file sch_io_geda.cpp.
References WXLOG_REPORTER::GetInstance(), m_fileFormatVersion, m_maxY, m_powerCounter, m_properties, m_releaseVersion, IO_BASE::m_reporter, m_rootSheet, m_schematic, m_screen, m_symLibraryInitialized, and SCH_IO::SCH_IO().
Referenced by loadDeferredSheets(), and LoadSchematicFile().
|
overridedefault |
|
private |
Create SCH_BUS_WIRE_ENTRY objects where net endpoints touch bus segments.
Definition at line 4301 of file sch_io_geda.cpp.
References DEFAULT_SCH_ENTRY_SIZE, SCH_LINE::GetEndPoint(), SCH_ITEM::GetLayer(), SCH_LINE::GetStartPoint(), LAYER_WIRE, m_busSegments, m_screen, SCH_LINE_T, schIUScale, sign(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by postProcess().
|
private |
Place junctions where 3+ net/pin endpoints coincide.
Definition at line 4223 of file sch_io_geda.cpp.
References SCH_LINE::GetEndPoint(), SCH_ITEM::GetLayer(), SCH_LINE::GetStartPoint(), LAYER_WIRE, m_netEndpoints, m_screen, SCH_LINE_T, toKiCad(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by postProcess().
|
private |
Add a graphical item (line/box/circle/arc/path) to a LIB_SYMBOL.
Definition at line 3143 of file sch_io_geda.cpp.
References LIB_SYMBOL::AddDrawItem(), SCH_SHAPE::AddPoint(), ARC, ARC_LOW_DEF_MM, BEZIER, center, CIRCLE, circle(), DEFAULT, DEG2RAD(), end, KiROUND(), LAYER_DEVICE, maybeParseAttributes(), NO_FILL, POLY, radius, EDA_SHAPE::RebuildBezierToSegmentsPointsList(), RECTANGLE, schIUScale, EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), SCH_SHAPE::SetFilled(), EDA_SHAPE::SetFillMode(), EDA_SHAPE::SetStart(), SCH_SHAPE::SetStroke(), toFillType(), toKiCadDist(), and toLineStyle().
Referenced by loadSymbolFile(), and parseEmbeddedComponent().
|
private |
Create a pin on a LIB_SYMBOL from gEDA P line data and its attributes.
Definition at line 3058 of file sch_io_geda.cpp.
References LIB_SYMBOL::AddDrawItem(), findAttr(), KiROUND(), pin, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, PT_BIDI, PT_INPUT, PT_OPENCOLLECTOR, PT_OPENEMITTER, PT_OUTPUT, PT_PASSIVE, PT_POWER_IN, PT_TRISTATE, and toKiCadDist().
Referenced by loadSymbolFile(), and parseEmbeddedComponent().
|
virtualinherited |
Definition at line 133 of file io_base.cpp.
References _, m_progressReporter, and THROW_IO_ERROR.
|
virtualinherited |
Checks if this IO object can read the specified library file/directory.
If not overridden, extension check is used.
Reimplemented in PCB_IO_ALLEGRO, PCB_IO_ALTIUM_DESIGNER, PCB_IO_CADSTAR_ARCHIVE, PCB_IO_EAGLE, PCB_IO_EASYEDA, PCB_IO_IPC2581, PCB_IO_ODBPP, SCH_IO_ALTIUM, SCH_IO_CADSTAR_ARCHIVE, SCH_IO_EAGLE, SCH_IO_EASYEDA, SCH_IO_KICAD_LEGACY, SCH_IO_KICAD_SEXPR, and SCH_IO_PADS.
Definition at line 71 of file io_base.cpp.
References GetLibraryDesc(), IO_BASE::IO_FILE_DESC::m_ExtensionsInDir, IO_BASE::IO_FILE_DESC::m_FileExtensions, and IO_BASE::IO_FILE_DESC::m_IsFile.
Referenced by PCB_IO_ALLEGRO::CanReadLibrary(), PCB_IO_ALTIUM_DESIGNER::CanReadLibrary(), PCB_IO_CADSTAR_ARCHIVE::CanReadLibrary(), PCB_IO_EAGLE::CanReadLibrary(), SCH_IO_ALTIUM::CanReadLibrary(), SCH_IO_CADSTAR_ARCHIVE::CanReadLibrary(), SCH_IO_EAGLE::CanReadLibrary(), SCH_IO_KICAD_LEGACY::CanReadLibrary(), SCH_IO_KICAD_SEXPR::CanReadLibrary(), and SCH_IO_PADS::CanReadLibrary().
|
overridevirtual |
Checks if this SCH_IO can read the specified schematic file.
If not overriden, extension check is used.
Reimplemented from SCH_IO.
Definition at line 1493 of file sch_io_geda.cpp.
|
inlinevirtualinherited |
Reimplemented in SCH_IO_DATABASE.
|
private |
Create a fallback rectangular symbol when the .sym file is not found.
Definition at line 3659 of file sch_io_geda.cpp.
References DEFAULT, DEFAULT_SYMBOL_SIZE_MILS, LAYER_DEVICE, RECTANGLE, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetStart(), SCH_SHAPE::SetStroke(), and toKiCadDist().
Referenced by getOrLoadSymbol().
|
virtualinherited |
Create a new empty library at aLibraryPath empty.
It is an error to attempt to create an existing library or to attempt to create on a "read only" location.
| aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several elements. |
| aProperties | is an associative array that can be used to tell the library create function anything special, because it can take any number of additional named tuning arguments that the IO is known to support. The caller continues to own this object (IO may not delete it), and IOs should expect it to be optionally NULL. |
| IO_ERROR | if there is a problem finding the library, or creating it. |
Reimplemented in DESIGN_BLOCK_IO, PCB_IO_KICAD_SEXPR, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 46 of file io_base.cpp.
References NOT_IMPLEMENTED.
Referenced by LIBRARY_MANAGER_ADAPTER::CreateLibrary().
|
virtualinherited |
Delete an existing library and returns true, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason.
| aLibraryPath | is a locator for the "library", usually a directory or file which will contain several elements. |
| aProperties | is an associative array that can be used to tell the library delete implementation function anything special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
| IO_ERROR | if there is a problem deleting an existing library. |
Reimplemented in DESIGN_BLOCK_IO, PCB_IO_GEDA, PCB_IO_KICAD_LEGACY, PCB_IO_KICAD_SEXPR, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 53 of file io_base.cpp.
References NOT_IMPLEMENTED.
Referenced by LIBRARY_MANAGER_ADAPTER::DeleteLibrary().
|
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_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 116 of file sch_io.cpp.
References NOT_IMPLEMENTED.
Referenced by LIB_BUFFER::SaveBuffer().
|
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_IO_ALTIUM, SCH_IO_CADSTAR_ARCHIVE, SCH_IO_DATABASE, SCH_IO_EAGLE, SCH_IO_EASYEDA, SCH_IO_EASYEDAPRO, SCH_IO_HTTP_LIB, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 91 of file sch_io.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_IO_ALTIUM, SCH_IO_CADSTAR_ARCHIVE, SCH_IO_DATABASE, SCH_IO_EAGLE, SCH_IO_EASYEDA, SCH_IO_EASYEDAPRO, SCH_IO_HTTP_LIB, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 82 of file sch_io.cpp.
References NOT_IMPLEMENTED.
Referenced by SYMBOL_LIBRARY_ADAPTER::enumerateLibrary(), SYMBOL_LIBRARY_ADAPTER::GetSymbolNames(), SYMBOL_LIBRARY_ADAPTER::GetSymbols(), and SYMBOL_LIBRARY_ADAPTER::LoadOne().
|
private |
Find an attribute by name, returns empty string if not found.
Definition at line 1664 of file sch_io_geda.cpp.
Referenced by addSymbolPin(), flushPendingComponent(), importHierarchicalSheet(), parseNet(), and parsePin().
|
private |
Find a GEDA_ATTR struct by name, returns nullptr if not found.
Definition at line 1677 of file sch_io_geda.cpp.
Referenced by flushPendingComponent().
|
private |
Enlarge the page if needed and center all content on the sheet.
Definition at line 4457 of file sch_io_geda.cpp.
References BOX2< Vec >::Centre(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetSize(), PAGE_INFO::GetSizeIU(), BOX2< Vec >::GetWidth(), m_screen, BOX2< Vec >::Merge(), schIUScale, PAGE_INFO::SetHeightMils(), PAGE_INFO::SetWidthMils(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by LoadSchematicFile().
|
private |
Instantiate the pending component: look up or load the symbol, create SCH_SYMBOL, apply transforms and attributes, and emit to screen.
Definition at line 3682 of file sch_io_geda.cpp.
References _, DATASHEET, DESCRIPTION, findAttr(), findAttrStruct(), getLibName(), LIB_SYMBOL::GetName(), getOrLoadSymbol(), LIB_SYMBOL::GetPins(), LIB_SYMBOL::GetReferenceField(), LIB_SYMBOL::GetValueField(), importHierarchicalSheet(), m_libSymbols, m_maxY, m_netAttrRecords, m_pendingComp, m_powerCounter, IO_BASE::m_reporter, m_schematic, m_screen, m_symLibrary, MILS_TO_IU, SCH_IO_GEDA::GEDA_ATTR::name, SCH_IO_GEDA::NET_ATTR_RECORD::netname, pin, SCH_IO_GEDA::NET_ATTR_RECORD::pinnumber, PT_POWER_IN, REFERENCE, RPT_SEVERITY_WARNING, LIB_SYMBOL::SetGlobalPower(), SCH_FIELD::SetPosition(), SYMBOL::SetShowPinNames(), SYMBOL::SetShowPinNumbers(), SCH_FIELD::SetText(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetVisible(), SCH_IO_GEDA::GEDA_ATTR::size, SCH_IO_GEDA::NET_ATTR_RECORD::symbol, toKiCad(), toKiCadDist(), toKiCadOrientation(), trackEndpoint(), USER, VALUE, SCH_IO_GEDA::GEDA_ATTR::value, SCH_IO_GEDA::GEDA_ATTR::visible, SCH_IO_GEDA::GEDA_ATTR::x, VECTOR2< T >::x, SCH_IO_GEDA::GEDA_ATTR::y, and VECTOR2< T >::y.
Referenced by parseComponent(), and postProcess().
|
inlinevirtualinherited |
Retrieves a list of (custom) field names that are present on symbols in this library.
The plugin is responsible for guaranteeing that this list contains the set of unique custom field names present on any symbols contained in the library.
The required KiCad fields are not included in this list.
| aNames | will be filled with any custom fields present in this library. |
Reimplemented in SCH_IO_CADSTAR_ARCHIVE, SCH_IO_DATABASE, SCH_IO_HTTP_LIB, and SCH_IO_KICAD_SEXPR.
Definition at line 326 of file sch_io.h.
Referenced by SYMBOL_LIBRARY_ADAPTER::GetAvailableExtraFields(), and GetDefaultSymbolFields().
|
static |
Return the map of built-in gEDA symbol definitions (symbol name -> .sym content).
Definition at line 135 of file sch_io_geda.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), getOrLoadSymbol(), and loadBuiltinSymbol().
|
inlinevirtualinherited |
Retrieves a list of (custom) field names that should be shown by default for this library in the symbol chooser.
This list should be a subset of the result returned by GetAvailableSymbolFields().
The preference for which fields to hide and show for a given library is stored on a per-library basis in a user's preferences (or in the project local settings for a project- local library). The set of fields returned by GetDefaultSymbolFields() will be used if this preference is missing.
| aNames | will be filled with the custom field names that should be shown by default |
Reimplemented in SCH_IO_DATABASE, SCH_IO_HTTP_LIB, and SCH_IO_KICAD_SEXPR.
Definition at line 340 of file sch_io.h.
References GetAvailableSymbolFields().
|
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_IO_HTTP_LIB, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 139 of file sch_io.cpp.
References NOT_IMPLEMENTED.
|
private |
Derive the KiCad import library name from the schematic file.
Definition at line 1756 of file sch_io_geda.cpp.
References LIB_ID::FixIllegalChars(), m_filename, m_schematic, and UTF8::wx_str().
Referenced by flushPendingComponent().
|
inlineoverridevirtual |
Get the descriptor for the library container that this IO plugin operates on.
Implements IO_BASE.
Definition at line 84 of file sch_io_geda.h.
|
inlinevirtualinherited |
Get the descriptor for the individual library elements that this IO plugin operates on.
For libraries where all the elements are in a single container (e.g. all elements in a single file), then this will return the descriptor from IO_BASE::GetLibraryDesc().
Reimplemented in PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO, PCB_IO_GEDA, and PCB_IO_KICAD_SEXPR.
Definition at line 117 of file io_base.h.
References GetLibraryDesc().
Referenced by PCB_IO::CanReadFootprint().
|
overridevirtualinherited |
Append supported SCH_IO options to aListToAppenTo along with internationalized descriptions.
Options are typically appended so that a derived SCH_IO 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_IOs.) 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_IO, which has been avoided to date. |
Reimplemented from IO_BASE.
Reimplemented in SCH_IO_CADSTAR_ARCHIVE.
Definition at line 124 of file sch_io.cpp.
References IO_BASE::GetLibraryOptions().
|
inlineoverridevirtual |
Return the modification hash from the library cache.
Implements SCH_IO.
Definition at line 91 of file sch_io_geda.h.
|
inlineinherited |
Return a brief hard coded name for this IO interface.
Definition at line 79 of file io_base.h.
References m_name.
Referenced by SCH_IO_ALTIUM::ParseLibFile().
|
private |
Get or load a cached symbol by gEDA basename.
Definition at line 3550 of file sch_io_geda.cpp.
References _, createFallbackSymbol(), editDistance(), getBuiltinSymbols(), initSymbolLibrary(), loadBuiltinSymbol(), loadSymbolFile(), m_libSymbols, IO_BASE::m_reporter, m_symLibrary, and name.
Referenced by flushPendingComponent().
|
inlineoverridevirtual |
Returns schematic file description for the SCH_IO.
Reimplemented from SCH_IO.
Definition at line 79 of file sch_io_geda.h.
References _HKI.
|
inlinevirtualinherited |
Gets a description of a sublibrary.
Has no effect if SupportsSubLibraries() returns false.
| aName | contains the name of the sublibrary for which the description is retrieved |
Reimplemented in SCH_IO_HTTP_LIB.
Definition at line 315 of file sch_io.h.
Referenced by SYMBOL_LIBRARY_ADAPTER::GetSubLibraries().
|
inlinevirtualinherited |
Retrieves a list of sub-libraries in this library.
Some types of symbol library support sub-libraries, which are a single-level organizational hierarchy that is implementation-defined per plugin. Most of KiCad ignores sub-libraries and treats the hierarchy between library and symbol as flat, but the sub-libraries are used for sorting and grouping symbols in the symbol chooser.
Has no effect if SupportsSubLibraries() returns false.
| aNames | will be filled with a list of sub-libraries within this symbol library |
Reimplemented in SCH_IO_DATABASE, and SCH_IO_HTTP_LIB.
Definition at line 304 of file sch_io.h.
Referenced by SYMBOL_LIBRARY_ADAPTER::GetSubLibraries().
|
private |
Import a gEDA hierarchical sub-schematic as a KiCad SCH_SHEET.
Called when a component has a source= attribute.
Definition at line 4073 of file sch_io_geda.cpp.
References _, findAttr(), m_deferredSheets, m_filename, m_importStack, m_pendingComp, IO_BASE::m_reporter, m_rootSheet, m_screen, RPT_SEVERITY_WARNING, schIUScale, SHEET_FILENAME, SHEET_NAME, and toKiCad().
Referenced by flushPendingComponent().
|
private |
Ensure the symbol library hash is built by scanning gEDA library dirs.
Definition at line 2639 of file sch_io_geda.cpp.
References m_filename, m_properties, m_symLibraryInitialized, parseRcFileForLibraries(), and scanSymbolDir().
Referenced by getOrLoadSymbol().
|
inlineoverridevirtual |
Return true if the library at aLibraryPath is writable.
The system libraries are typically read only because of where they are installed..
| aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
| IO_ERROR | if no library at aLibraryPath exists. |
Reimplemented from IO_BASE.
Definition at line 97 of file sch_io_geda.h.
|
inlinevirtualinherited |
Work-around for lack of dynamic_cast across compile units on Mac.
Reimplemented in PCB_IO.
Definition at line 84 of file io_base.h.
Referenced by FOOTPRINT_LIBRARY_ADAPTER::pcbplugin().
|
private |
Try loading a symbol from the built-in standard library embedded in the importer.
Definition at line 3503 of file sch_io_geda.cpp.
References getBuiltinSymbols(), loadSymbolFile(), m_symLibrary, SCH_IO_GEDA::SYM_CACHE_ENTRY::netAttr, and result.
Referenced by getOrLoadSymbol().
|
private |
Load sub-schematics for any SCH_SHEET objects created during parsing.
Definition at line 4405 of file sch_io_geda.cpp.
References _, LoadSchematicFile(), m_deferredSheets, m_filename, m_importStack, m_properties, IO_BASE::m_reporter, m_schematic, m_symLibrary, m_symLibraryInitialized, name, SCH_IO_GEDA::SYM_CACHE_ENTRY::path, RPT_SEVERITY_WARNING, SCH_IO_GEDA(), SCH_SCREEN::SetFileName(), SCH_SHEET::SetScreen(), and IO_ERROR::What().
Referenced by postProcess().
|
overridevirtual |
Load information from some input file format that this SCH_IO 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_IO.
Definition at line 4506 of file sch_io_geda.cpp.
References _, copy, fitPageToContent(), SCH_SCREEN::GetUuid(), SCHEMATIC::IsValid(), LoadSchematicFile(), m_busSegments, m_deferredSheets, m_fileFormatVersion, m_filename, m_libSymbols, m_maxY, m_netAttrRecords, m_netEndpoints, m_pendingComp, m_powerCounter, m_properties, m_releaseVersion, IO_BASE::m_reporter, m_rootSheet, m_schematic, m_screen, m_symLibrary, m_symLibraryInitialized, name, parseArc(), parseBox(), parseBus(), parseCircle(), parseComponent(), parseEmbeddedComponent(), parseLine(), parseNet(), parsePath(), parsePicture(), parsePin(), parseText(), parseVersionLine(), postProcess(), radius, RPT_SEVERITY_WARNING, SCH_IO_GEDA(), schIUScale, SCH_SCREEN::SetFileName(), SCH_SHEET::SetScreen(), SCHEMATIC::SetTopLevelSheets(), SHEET_FILENAME, SHEET_NAME, THROW_IO_ERROR, top(), and IO_ERROR::What().
Referenced by loadDeferredSheets(), and LoadSchematicFile().
|
virtualinherited |
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this SCH_IO 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_IO_ALTIUM, SCH_IO_CADSTAR_ARCHIVE, SCH_IO_DATABASE, SCH_IO_EAGLE, SCH_IO_EASYEDA, SCH_IO_EASYEDAPRO, SCH_IO_HTTP_LIB, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 100 of file sch_io.cpp.
References NOT_IMPLEMENTED.
Referenced by SYMBOL_LIBRARY_ADAPTER::LoadSymbol(), and LIB_BUFFER::SaveBuffer().
|
private |
Load a .sym file and return a LIB_SYMBOL.
Parses the symbol format which is the same as schematic format but contains P/L/A/V/B/T/H objects within a symbol context. If aSymversion is non-null, the symbol's symversion attribute (if present) is written to it. If aNetAttr is non-null, the symbol's net= attribute (if present) is written to it.
Definition at line 2930 of file sch_io_geda.cpp.
References addSymbolGraphic(), addSymbolPin(), and maybeParseAttributes().
Referenced by getOrLoadSymbol(), and loadBuiltinSymbol().
|
private |
Check for and consume a { } attribute block at the current line position.
Definition at line 1690 of file sch_io_geda.cpp.
References parseAttributes().
Referenced by addSymbolGraphic(), loadSymbolFile(), parseArc(), parseBox(), parseBus(), parseCircle(), parseComponent(), parseEmbeddedComponent(), parseLine(), parseNet(), parsePath(), parsePin(), and parseText().
|
private |
Definition at line 2305 of file sch_io_geda.cpp.
References ARC, center, DEG2RAD(), KiROUND(), LAYER_NOTES, m_releaseVersion, m_screen, maybeParseAttributes(), radius, toKiCad(), toKiCadDist(), and toLineStyle().
Referenced by LoadSchematicFile().
|
private |
Read a { } attribute block starting after the '{' line.
Definition at line 1581 of file sch_io_geda.cpp.
References SCH_IO_GEDA::GEDA_ATTR::align, SCH_IO_GEDA::GEDA_ATTR::angle, SCH_IO_GEDA::GEDA_ATTR::name, SCH_IO_GEDA::GEDA_ATTR::showNV, SCH_IO_GEDA::GEDA_ATTR::size, SCH_IO_GEDA::GEDA_ATTR::value, SCH_IO_GEDA::GEDA_ATTR::visible, SCH_IO_GEDA::GEDA_ATTR::x, and SCH_IO_GEDA::GEDA_ATTR::y.
Referenced by maybeParseAttributes().
|
private |
Definition at line 2199 of file sch_io_geda.cpp.
References LAYER_NOTES, m_releaseVersion, m_screen, maybeParseAttributes(), NO_FILL, RECTANGLE, toFillType(), toKiCad(), toKiCadDist(), and toLineStyle().
Referenced by LoadSchematicFile().
|
private |
Definition at line 1853 of file sch_io_geda.cpp.
References end, LAYER_BUS, m_busSegments, m_releaseVersion, m_screen, maybeParseAttributes(), and toKiCad().
Referenced by LoadSchematicFile().
|
private |
Definition at line 2253 of file sch_io_geda.cpp.
References center, CIRCLE, circle(), LAYER_NOTES, m_releaseVersion, m_screen, maybeParseAttributes(), NO_FILL, radius, toFillType(), toKiCad(), toKiCadDist(), and toLineStyle().
Referenced by LoadSchematicFile().
|
private |
Definition at line 1779 of file sch_io_geda.cpp.
References flushPendingComponent(), m_pendingComp, and maybeParseAttributes().
Referenced by LoadSchematicFile().
|
private |
Definition at line 1932 of file sch_io_geda.cpp.
References addSymbolGraphic(), addSymbolPin(), m_pendingComp, and maybeParseAttributes().
Referenced by LoadSchematicFile().
|
private |
Definition at line 2163 of file sch_io_geda.cpp.
References end, LAYER_NOTES, m_releaseVersion, m_screen, maybeParseAttributes(), toKiCad(), toKiCadDist(), and toLineStyle().
Referenced by LoadSchematicFile().
|
private |
Definition at line 1817 of file sch_io_geda.cpp.
References end, findAttr(), GEDA_DEFAULT_TEXT_SIZE_MILS, LAYER_WIRE, m_screen, maybeParseAttributes(), toKiCad(), toKiCadDist(), and trackEndpoint().
Referenced by LoadSchematicFile().
|
private |
Definition at line 2358 of file sch_io_geda.cpp.
References ARC_LOW_DEF_MM, BEZIER, LAYER_NOTES, m_screen, maybeParseAttributes(), schIUScale, toKiCad(), toKiCadDist(), and toLineStyle().
Referenced by LoadSchematicFile().
|
private |
Definition at line 2537 of file sch_io_geda.cpp.
References center, REFERENCE_IMAGE::GetSize(), m_filename, m_maxY, m_screen, REFERENCE_IMAGE::ReadImageFile(), REFERENCE_IMAGE::SetImageScale(), toKiCad(), toKiCadDist(), and VECTOR2< T >::x.
Referenced by LoadSchematicFile().
|
private |
Definition at line 1885 of file sch_io_geda.cpp.
References end, findAttr(), GEDA_DEFAULT_TEXT_SIZE_MILS, LAYER_WIRE, m_releaseVersion, m_screen, maybeParseAttributes(), toKiCad(), toKiCadDist(), and trackEndpoint().
Referenced by LoadSchematicFile().
|
private |
Parse an RC file (gafrc or gschemrc) for component-library directives.
Definition at line 2877 of file sch_io_geda.cpp.
References scanSymbolDir().
Referenced by initSymbolLibrary().
|
private |
Parse objects from a .sym file or [] block into a LIB_SYMBOL.
|
private |
Definition at line 2045 of file sch_io_geda.cpp.
References ANGLE_180, ANGLE_270, ANGLE_90, convertOverbars(), 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, m_fileFormatVersion, m_releaseVersion, m_screen, maybeParseAttributes(), name, text, toKiCad(), and toKiCadDist().
Referenced by LoadSchematicFile().
|
private |
Parse the "v YYYYMMDD N" version line and validate.
Definition at line 1549 of file sch_io_geda.cpp.
References m_fileFormatVersion, and m_releaseVersion.
Referenced by LoadSchematicFile().
|
private |
Run the full post-processing pipeline after parsing is complete:
Definition at line 4154 of file sch_io_geda.cpp.
References addBusEntries(), addJunctions(), flushPendingComponent(), loadDeferredSheets(), and processNetAttributes().
Referenced by LoadSchematicFile().
|
private |
For each component with net= attributes, create global labels at pin positions.
Definition at line 4164 of file sch_io_geda.cpp.
References std::abs(), SPIN_STYLE::BOTTOM, GEDA_DEFAULT_TEXT_SIZE_MILS, LIB_SYMBOL::GetPins(), SPIN_STYLE::LEFT, m_netAttrRecords, m_screen, pin, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, SPIN_STYLE::RIGHT, toKiCadDist(), SPIN_STYLE::UP, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by postProcess().
|
virtualinherited |
Definition at line 124 of file io_base.cpp.
References m_reporter.
Referenced by PCB_IO_IPC2581::addShape(), PCB_IO_IPC2581::generateBOMSection(), PCB_IO_IPC2581::generateComponents(), PCB_IO_IPC2581::generateLayerSetDrill(), PCB_IO_IPC2581::generateLayerSetNet(), PCB_IO_IPC2581::generateProfile(), SCH_IO_EAGLE::loadInstance(), SCH_IO_EAGLE::loadLibrary(), and PCB_IO_IPC2581::SaveBoard().
|
virtualinherited |
Reimplemented in SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 61 of file sch_io.cpp.
References NOT_IMPLEMENTED.
|
virtualinherited |
Write aSchematic to a storage file in a format that this SCH_IO 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_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 74 of file sch_io.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_IO_HTTP_LIB, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 108 of file sch_io.cpp.
References NOT_IMPLEMENTED.
Referenced by LIB_BUFFER::SaveBuffer().
|
private |
Recursively scan a directory for .sym files and populate m_symLibrary.
Definition at line 2844 of file sch_io_geda.cpp.
References m_symLibrary, SCH_IO_GEDA::SYM_CACHE_ENTRY::path, and scanSymbolDir().
Referenced by initSymbolLibrary(), parseRcFileForLibraries(), and scanSymbolDir().
|
inlinevirtualinherited |
Some library plugins need to interface with other loaded libraries.
To do this, they receive a reference to the project-specific manager adapter.
Reimplemented in SCH_IO_DATABASE, and SCH_IO_HTTP_LIB.
|
inlinevirtualinherited |
Set an optional progress reporter.
Reimplemented in SCH_IO_CADSTAR_ARCHIVE.
Definition at line 94 of file io_base.h.
References m_progressReporter.
Referenced by PCB_CONTROL::AppendBoard().
|
inlinevirtualinherited |
Set an optional reporter for warnings/errors.
Reimplemented in SCH_IO_CADSTAR_ARCHIVE.
Definition at line 89 of file io_base.h.
References m_reporter.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and KI_TEST::LoadBoardWithCapture().
|
inlinevirtualinherited |
Reimplemented in SCH_IO_DATABASE.
|
inlinevirtualinherited |
Reimplemented in SCH_IO_DATABASE, and SCH_IO_HTTP_LIB.
Definition at line 290 of file sch_io.h.
Referenced by SYMBOL_LIBRARY_ADAPTER::SupportsSubLibraries().
|
staticprivate |
Map gEDA filltype (0-4) to KiCad FILL_T.
Definition at line 1720 of file sch_io_geda.cpp.
References CROSS_HATCH, FILLED_SHAPE, HATCH, and NO_FILL.
Referenced by addSymbolGraphic(), parseBox(), and parseCircle().
|
private |
Apply the Y-flip and scale to transform gEDA coords to KiCad.
Call only after m_maxY has been computed in the post-processing pass.
Definition at line 1539 of file sch_io_geda.cpp.
References m_maxY, and toKiCadDist().
Referenced by addJunctions(), flushPendingComponent(), importHierarchicalSheet(), parseArc(), parseBox(), parseBus(), parseCircle(), parseLine(), parseNet(), parsePath(), parsePicture(), parsePin(), and parseText().
|
private |
Convert a gEDA distance in mils to KiCad IU.
Definition at line 1533 of file sch_io_geda.cpp.
References MILS_TO_IU.
Referenced by addSymbolGraphic(), addSymbolPin(), createFallbackSymbol(), flushPendingComponent(), parseArc(), parseBox(), parseCircle(), parseLine(), parseNet(), parsePath(), parsePicture(), parsePin(), parseText(), processNetAttributes(), and toKiCad().
|
private |
Map gEDA angle (0/90/180/270) + mirror to KiCad symbol orientation.
Definition at line 1736 of file sch_io_geda.cpp.
References SYM_MIRROR_Y, SYM_ORIENT_0, SYM_ORIENT_180, SYM_ORIENT_270, and SYM_ORIENT_90.
Referenced by flushPendingComponent().
|
staticprivate |
Map gEDA dashstyle (0-4) to KiCad LINE_STYLE.
Definition at line 1707 of file sch_io_geda.cpp.
References DASH, DASHDOT, DASHDOTDOT, DEFAULT, and DOT.
Referenced by addSymbolGraphic(), parseArc(), parseBox(), parseCircle(), parseLine(), and parsePath().
|
private |
Track a point as a net or pin endpoint for junction detection.
Definition at line 4144 of file sch_io_geda.cpp.
References m_netEndpoints.
Referenced by flushPendingComponent(), parseNet(), and parsePin().
|
private |
Definition at line 345 of file sch_io_geda.h.
Referenced by addBusEntries(), LoadSchematicFile(), and parseBus().
|
private |
Definition at line 355 of file sch_io_geda.h.
Referenced by importHierarchicalSheet(), loadDeferredSheets(), and LoadSchematicFile().
|
private |
Definition at line 309 of file sch_io_geda.h.
Referenced by LoadSchematicFile(), parseText(), parseVersionLine(), and SCH_IO_GEDA().
|
private |
Definition at line 301 of file sch_io_geda.h.
Referenced by getLibName(), importHierarchicalSheet(), initSymbolLibrary(), loadDeferredSheets(), LoadSchematicFile(), and parsePicture().
|
private |
Set of fully-resolved file paths currently in the import call stack, used to detect and prevent circular hierarchy references.
Definition at line 359 of file sch_io_geda.h.
Referenced by importHierarchicalSheet(), and loadDeferredSheets().
|
private |
Loaded symbols for this import session, keyed by basename.
Definition at line 319 of file sch_io_geda.h.
Referenced by flushPendingComponent(), getOrLoadSymbol(), and LoadSchematicFile().
|
private |
The maximum Y coordinate seen during parsing (gEDA coords, before flip).
Definition at line 304 of file sch_io_geda.h.
Referenced by flushPendingComponent(), LoadSchematicFile(), parsePicture(), SCH_IO_GEDA(), and toKiCad().
|
protectedinherited |
Name of the IO loader.
Definition at line 234 of file io_base.h.
Referenced by PCB_IO_IPC2581::generateBOMSection(), GetName(), and IO_BASE().
|
private |
Definition at line 335 of file sch_io_geda.h.
Referenced by flushPendingComponent(), LoadSchematicFile(), and processNetAttributes().
|
private |
Net endpoint positions in raw gEDA coordinates for junction detection.
Definition at line 325 of file sch_io_geda.h.
Referenced by addJunctions(), LoadSchematicFile(), and trackEndpoint().
|
private |
Pending component awaiting symbol resolution.
Definition at line 312 of file sch_io_geda.h.
Referenced by flushPendingComponent(), importHierarchicalSheet(), LoadSchematicFile(), parseComponent(), and parseEmbeddedComponent().
|
private |
Sequential counter for auto-generated #PWR references.
Definition at line 322 of file sch_io_geda.h.
Referenced by flushPendingComponent(), LoadSchematicFile(), and SCH_IO_GEDA().
|
protectedinherited |
Progress reporter to track the progress of the operation, may be nullptr.
Definition at line 240 of file io_base.h.
Referenced by AdvanceProgressPhase(), SCH_IO_KICAD_LEGACY::checkpoint(), SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), SCH_IO_EAGLE::ensureLoadedLibrary(), PCB_IO_ODBPP::ExportODB(), PCB_IO_IPC2581::generateAvlSection(), PCB_IO_IPC2581::generateBOMSection(), PCB_IO_IPC2581::generateContentSection(), PCB_IO_IPC2581::generateEcadSection(), PCB_IO_IPC2581::generateHistorySection(), IO_BASE(), PCB_IO_ALLEGRO::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_CADSTAR_ARCHIVE::LoadBoard(), PCB_IO_EASYEDA::LoadBoard(), PCB_IO_EASYEDAPRO::LoadBoard(), PCB_IO_FABMASTER::LoadBoard(), PCB_IO_KICAD_SEXPR::LoadBoard(), PCB_IO_PADS::LoadBoard(), PCB_IO_PADS_BINARY::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), SCH_IO_KICAD_LEGACY::loadFile(), SCH_IO_KICAD_SEXPR::loadFile(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_EAGLE::LoadSchematicFile(), SCH_IO_LTSPICE::LoadSchematicFile(), SCH_IO_PADS::LoadSchematicFile(), SCH_IO_ALTIUM::ParseAltiumSch(), PCB_IO_IPC2581::SaveBoard(), SetProgressReporter(), and SCH_IO_CADSTAR_ARCHIVE::SetProgressReporter().
|
private |
Properties passed from the import framework (search paths, etc.)
Definition at line 362 of file sch_io_geda.h.
Referenced by initSymbolLibrary(), loadDeferredSheets(), LoadSchematicFile(), and SCH_IO_GEDA().
|
private |
gEDA file version fields from the "v YYYYMMDD N" header line.
Used for version-aware parsing of old format files.
Definition at line 308 of file sch_io_geda.h.
Referenced by LoadSchematicFile(), parseArc(), parseBox(), parseBus(), parseCircle(), parseLine(), parsePin(), parseText(), parseVersionLine(), and SCH_IO_GEDA().
|
protectedinherited |
Reporter to log errors/warnings to, may be nullptr.
Definition at line 237 of file io_base.h.
Referenced by SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), SCH_IO_GEDA::flushPendingComponent(), PCB_IO_ALTIUM_DESIGNER::FootprintLoad(), SCH_IO_GEDA::getOrLoadSymbol(), SCH_IO_GEDA::importHierarchicalSheet(), IO_BASE(), PCB_IO_ALLEGRO::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_PADS::LoadBoard(), PCB_IO_PADS_BINARY::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), PCB_IO_PADS::loadCopperShapes(), SCH_IO_GEDA::loadDeferredSheets(), PCB_IO_PADS::loadFootprints(), PCB_IO_PADS::loadKeepouts(), SCH_IO_ALTIUM::LoadSchematicFile(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_GEDA::LoadSchematicFile(), SCH_IO_LTSPICE::LoadSchematicFile(), SCH_IO_PADS::LoadSchematicFile(), PCB_IO_PADS::loadTexts(), PCB_IO_PADS_BINARY::loadTexts(), PCB_IO_PADS::loadTracksAndVias(), PCB_IO_PADS_BINARY::loadTracksAndVias(), PCB_IO_PADS::loadZones(), PCB_IO_PADS_BINARY::loadZones(), SCH_IO_ALTIUM::ParsePowerPort(), PCB_IO_ALLEGRO::PCB_IO_ALLEGRO(), PCB_IO_ALTIUM_DESIGNER::PCB_IO_ALTIUM_DESIGNER(), PCB_IO_SOLIDWORKS::PCB_IO_SOLIDWORKS(), Report(), PCB_IO_PADS::reportStatistics(), PCB_IO_PADS_BINARY::reportStatistics(), SCH_IO_ALTIUM::SCH_IO_ALTIUM(), SCH_IO_CADSTAR_ARCHIVE::SCH_IO_CADSTAR_ARCHIVE(), SCH_IO_EAGLE::SCH_IO_EAGLE(), SCH_IO_EASYEDA::SCH_IO_EASYEDA(), SCH_IO_EASYEDAPRO::SCH_IO_EASYEDAPRO(), SCH_IO_GEDA::SCH_IO_GEDA(), SCH_IO_LTSPICE::SCH_IO_LTSPICE(), SetReporter(), and SCH_IO_CADSTAR_ARCHIVE::SetReporter().
|
private |
Definition at line 299 of file sch_io_geda.h.
Referenced by importHierarchicalSheet(), LoadSchematicFile(), and SCH_IO_GEDA().
|
private |
Definition at line 300 of file sch_io_geda.h.
Referenced by flushPendingComponent(), getLibName(), loadDeferredSheets(), LoadSchematicFile(), and SCH_IO_GEDA().
|
private |
Definition at line 298 of file sch_io_geda.h.
Referenced by addBusEntries(), addJunctions(), fitPageToContent(), flushPendingComponent(), importHierarchicalSheet(), LoadSchematicFile(), parseArc(), parseBox(), parseBus(), parseCircle(), parseLine(), parseNet(), parsePath(), parsePicture(), parsePin(), parseText(), processNetAttributes(), and SCH_IO_GEDA().
|
private |
Symbol library cache: gEDA basename -> cache entry.
Definition at line 315 of file sch_io_geda.h.
Referenced by flushPendingComponent(), getOrLoadSymbol(), loadBuiltinSymbol(), loadDeferredSheets(), LoadSchematicFile(), and scanSymbolDir().
|
private |
Definition at line 316 of file sch_io_geda.h.
Referenced by initSymbolLibrary(), loadDeferredSheets(), LoadSchematicFile(), and SCH_IO_GEDA().
|
staticconstexprprivate |
gEDA coordinates are mils with Y-up.
KiCad uses 100nm IU with Y-down. During parsing we store raw gEDA coordinates, then post-process to flip Y.
Definition at line 152 of file sch_io_geda.h.
Referenced by flushPendingComponent(), and toKiCadDist().