|
KiCad PCB EDA Suite
|
A SCH_IO derivation for loading schematic files using the new s-expression file format. More...
#include <sch_io_kicad_sexpr.h>
Public Member Functions | |
| SCH_IO_KICAD_SEXPR () | |
| virtual | ~SCH_IO_KICAD_SEXPR () |
| 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. | |
| 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. | |
| void | LoadContent (LINE_READER &aReader, SCH_SHEET *aSheet, int aVersion=SEXPR_SCHEMATIC_FILE_VERSION) |
| void | SaveSchematicFile (const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
| 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. | |
| void | FormatSchematicToFormatter (OUTPUTFORMATTER *aOut, SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Serialize a schematic sheet to an OUTPUTFORMATTER without file I/O or Prettify. | |
| void | Format (SCH_SHEET *aSheet) |
| void | Format (SCH_SELECTION *aSelection, SCH_SHEET_PATH *aSelectionPath, SCHEMATIC &aSchematic, OUTPUTFORMATTER *aFormatter, bool aForClipboard) |
| void | EnumerateSymbolLib (wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
| Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath. | |
| void | EnumerateSymbolLib (std::vector< LIB_SYMBOL * > &aSymbolList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
| Populate a list of LIB_SYMBOL aliases contained within the library aLibraryPath. | |
| LIB_SYMBOL * | LoadSymbol (const wxString &aLibraryPath, const wxString &aAliasName, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
| Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this SCH_IO knows about. | |
| void | SaveSymbol (const wxString &aLibraryPath, std::unique_ptr< LIB_SYMBOL > aSymbol, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
| Write aSymbol to an existing library located at aLibraryPath. | |
| void | DeleteSymbol (const wxString &aLibraryPath, const wxString &aSymbolName, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
| Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath. | |
| void | CreateLibrary (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
| Create a new empty library at aLibraryPath empty. | |
| bool | DeleteLibrary (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
| 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. | |
| void | SaveLibrary (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override |
| bool | CanReadLibrary (const wxString &aLibraryPath) const override |
| Checks if this IO object can read the specified library file/directory. | |
| bool | IsLibraryWritable (const wxString &aLibraryPath) override |
| Return true if the library at aLibraryPath is writable. | |
| void | GetAvailableSymbolFields (std::vector< wxString > &aNames) override |
| Retrieves a list of (custom) field names that are present on symbols in this library. | |
| void | GetDefaultSymbolFields (std::vector< wxString > &aNames) override |
| Retrieves a list of (custom) field names that should be shown by default for this library in the symbol chooser. | |
| const wxString & | GetError () const override |
| Return an error string to the caller. | |
| virtual bool | CanReadSchematicFile (const wxString &aFileName) const |
| Checks if this SCH_IO can read the specified schematic file. | |
| virtual std::vector< LIB_SYMBOL * > | GetImportedCachedLibrarySymbols () |
| Return the canonical symbol definitions produced by the last LoadSchematicFile(). | |
| virtual void | CheckLibrary (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Validate that the library at aLibraryPath is reachable and well-formed, without necessarily loading symbol data. | |
| 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 | 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 | SupportsConfigurationDialog () const |
| virtual DIALOG_SHIM * | CreateConfigurationDialog (wxWindow *aParent) |
| virtual void | Report (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) const |
| virtual void | AdvanceProgressPhase () |
Static Public Member Functions | |
| static std::vector< LIB_SYMBOL * > | ParseLibSymbols (std::string &aSymbolText, std::string aSource, int aFileVersion=SEXPR_SCHEMATIC_FILE_VERSION) |
| static void | FormatLibSymbol (LIB_SYMBOL *aPart, OUTPUTFORMATTER &aFormatter) |
Static Public Attributes | |
| static const char * | PropBuffering = "buffering" |
| The property used internally by the plugin to enable cache buffering which prevents the library file from being written every time the cache is changed. | |
Protected Member Functions | |
| void | init (SCHEMATIC *aSchematic, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| initialize PLUGIN like a constructor would. | |
Protected Attributes | |
| int | m_version |
| Version of file being loaded. | |
| bool | m_appending |
| Schematic load append status. | |
| bool | m_sheetLoad |
| Loading a sheet into an open schematic. | |
| wxString | m_error |
| For throwing exceptions or errors on partial loads. | |
| wxString | m_path |
| Root project path for loading child sheets. | |
| std::stack< wxString > | m_currentPath |
| Stack to maintain nested sheet paths. | |
| SCH_SHEET * | m_rootSheet |
| The root sheet of the schematic being loaded. | |
| std::vector< SCH_SHEET * > | m_loadedRootSheets |
| Root sheets from previous LoadSchematicFile() calls, enabling screen reuse across top-level sheets that share sub-sheet files. | |
| SCH_SHEET_PATH | m_currentSheetPath |
| SCHEMATIC * | m_schematic = nullptr |
| init() reads this before assigning it. | |
| OUTPUTFORMATTER * | m_out |
| The formatter for saving SCH_SCREEN objects. | |
| SCH_IO_KICAD_SEXPR_LIB_CACHE * | m_cache |
| std::function< bool(wxString aTitle, int aIcon, wxString aMsg, wxString aAction)> | m_queryUserCallback |
| 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 | |
| void | loadHierarchy (const SCH_SHEET_PATH &aParentSheetPath, SCH_SHEET *aSheet) |
| void | loadFile (const wxString &aFileName, SCH_SHEET *aSheet) |
| void | saveSymbol (SCH_SYMBOL *aSymbol, const SCHEMATIC &aSchematic, const SCH_SHEET_LIST &aSheetList, bool aForClipboard, const SCH_SHEET_PATH *aRelativePath=nullptr) |
| void | saveField (SCH_FIELD *aField) |
| void | saveBitmap (const SCH_BITMAP &aBitmap) |
| void | saveSheet (SCH_SHEET *aSheet, const SCH_SHEET_LIST &aSheetList) |
| void | saveJunction (SCH_JUNCTION *aJunction) |
| void | saveNoConnect (SCH_NO_CONNECT *aNoConnect) |
| void | saveBusEntry (SCH_BUS_ENTRY_BASE *aBusEntry) |
| void | saveLine (SCH_LINE *aLine) |
| void | saveShape (SCH_SHAPE *aShape) |
| void | saveRuleArea (SCH_RULE_AREA *aRuleArea) |
| void | saveText (SCH_TEXT *aText) |
| void | saveTextBox (SCH_TEXTBOX *aText) |
| void | saveTable (SCH_TABLE *aTable) |
| void | saveGroup (SCH_GROUP *aGroup) |
| void | saveInstances (const std::vector< SCH_SHEET_INSTANCE > &aSheets) |
| void | cacheLib (const wxString &aLibraryFileName, const std::map< std::string, UTF8 > *aProperties) |
| bool | isBuffering (const std::map< std::string, UTF8 > *aProperties) |
A SCH_IO derivation for loading schematic files using the new s-expression file format.
As with all SCH_IOs there is no UI dependencies i.e. windowing calls allowed.
Definition at line 67 of file sch_io_kicad_sexpr.h.
| SCH_IO_KICAD_SEXPR::SCH_IO_KICAD_SEXPR | ( | ) |
Definition at line 80 of file sch_io_kicad_sexpr.cpp.
References init(), and SCH_IO::SCH_IO().
|
virtual |
Definition at line 86 of file sch_io_kicad_sexpr.cpp.
References m_cache.
|
virtualinherited |
Definition at line 133 of file io_base.cpp.
References m_progressReporter, and THROW_IO_CANCELLED.
|
private |
Definition at line 1861 of file sch_io_kicad_sexpr.cpp.
References isBuffering(), and m_cache.
Referenced by DeleteSymbol(), EnumerateSymbolLib(), EnumerateSymbolLib(), LoadSymbol(), and SaveSymbol().
|
overridevirtual |
Checks if this IO object can read the specified library file/directory.
If not overridden, extension check is used.
Reimplemented from IO_BASE.
Definition at line 2079 of file sch_io_kicad_sexpr.cpp.
References IO_BASE::CanReadLibrary(), and FILEEXT::KiCadSymbolLibFileExtension.
|
virtualinherited |
Checks if this SCH_IO can read the specified schematic file.
If not overriden, extension check is used.
Reimplemented in SCH_IO_ALTIUM, SCH_IO_DIPTRACE, SCH_IO_EAGLE, SCH_IO_EASYEDA, SCH_IO_EASYEDAPRO, SCH_IO_EASYEDAPRO_V3, SCH_IO_GEDA, SCH_IO_KICAD_LEGACY, SCH_IO_ORCAD, SCH_IO_PADS, and SCH_IO_PCAD.
Definition at line 47 of file sch_io.cpp.
References GetSchematicFileDesc(), and IO_BASE::IO_FILE_DESC::m_FileExtensions.
Referenced by SCH_IO_ALTIUM::CanReadSchematicFile(), SCH_IO_DIPTRACE::CanReadSchematicFile(), SCH_IO_EAGLE::CanReadSchematicFile(), SCH_IO_EASYEDA::CanReadSchematicFile(), SCH_IO_KICAD_LEGACY::CanReadSchematicFile(), SCH_IO_ORCAD::CanReadSchematicFile(), and SCH_IO_PADS::CanReadSchematicFile().
|
virtualinherited |
Validate that the library at aLibraryPath is reachable and well-formed, without necessarily loading symbol data.
This is used for editing library tables, where a full EnumerateSymbolLib can be expensive for some libraries (e.g. HTTP or Database) and should not be done just to check if the library is OK to use.
| 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 or is not well-formed. |
Reimplemented in SCH_IO_DATABASE, and SCH_IO_HTTP_LIB.
Definition at line 108 of file sch_io.cpp.
References EnumerateSymbolLib().
Referenced by SYMBOL_LIBRARY_ADAPTER::CheckLibrary().
|
inlinevirtualinherited |
Reimplemented in SCH_IO_DATABASE.
|
overridevirtual |
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 from IO_BASE.
Definition at line 1998 of file sch_io_kicad_sexpr.cpp.
References _, m_cache, and THROW_IO_ERRORF.
Referenced by BOOST_AUTO_TEST_CASE().
|
overridevirtual |
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 from IO_BASE.
Definition at line 2023 of file sch_io_kicad_sexpr.cpp.
References _, m_cache, and THROW_IO_ERRORF.
|
overridevirtual |
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 from SCH_IO.
Definition at line 1986 of file sch_io_kicad_sexpr.cpp.
References cacheLib(), isBuffering(), and m_cache.
|
overridevirtual |
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 from SCH_IO.
Definition at line 1927 of file sch_io_kicad_sexpr.cpp.
References _, cacheLib(), isBuffering(), m_cache, SYMBOL_LIBRARY_ADAPTER::PropPowerSymsOnly, and THROW_IO_ERRORF.
|
overridevirtual |
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 from SCH_IO.
Definition at line 1906 of file sch_io_kicad_sexpr.cpp.
References _, cacheLib(), isBuffering(), m_cache, SYMBOL_LIBRARY_ADAPTER::PropPowerSymsOnly, and THROW_IO_ERRORF.
Referenced by KICAD_DIFF::SYM_LIB_DIFFER::LoadLibrary(), and parseLibraryFile().
| void SCH_IO_KICAD_SEXPR::Format | ( | SCH_SELECTION * | aSelection, |
| SCH_SHEET_PATH * | aSelectionPath, | ||
| SCHEMATIC & | aSchematic, | ||
| OUTPUTFORMATTER * | aFormatter, | ||
| bool | aForClipboard ) |
Definition at line 647 of file sch_io_kicad_sexpr.cpp.
References EDA_ITEM::ClearFlags(), LIB_ID::Format(), SCH_SYMBOL::GetLibId(), SCH_SCREEN::GetLibSymbols(), EDA_ITEM::GetParent(), SCH_SYMBOL::GetSchSymbolLibraryName(), SCH_SELECTION::GetScreen(), SCHEMATIC::Hierarchy(), m_out, m_schematic, name, saveBitmap(), saveBusEntry(), saveGroup(), saveJunction(), saveLine(), saveNoConnect(), saveRuleArea(), saveShape(), saveSheet(), SCH_IO_KICAD_SEXPR_LIB_CACHE::SaveSymbol(), saveSymbol(), saveTable(), saveText(), saveTextBox(), SCH_BITMAP_T, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_GROUP_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_LINE_T, SCH_NO_CONNECT_T, SCH_RULE_AREA_T, SCH_SHAPE_T, SCH_SHEET_T, SCH_SYMBOL_T, SCH_TABLE_T, SCH_TABLECELL_T, SCH_TEXT_T, SCH_TEXTBOX_T, SKIP_STRUCT, table, EDA_ITEM::Type(), SCH_SYMBOL::UseLibIdLookup(), and UTF8::wx_str().
| void SCH_IO_KICAD_SEXPR::Format | ( | SCH_SHEET * | aSheet | ) |
Definition at line 442 of file sch_io_kicad_sexpr.cpp.
References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, PAGE_INFO::Format(), TITLE_BLOCK::Format(), KICAD_FORMAT::FormatBool(), FormatDouble2Str(), KICAD_FORMAT::FormatUuid(), KIGFX::COLOR4D::g, SCH_NETCHAIN::GetColor(), SCH_SCREEN::GetLibSymbols(), GetMajorMinorVersion(), SCH_NETCHAIN::GetName(), SCH_NETCHAIN::GetNetClass(), SCH_NETCHAIN::GetNets(), SCH_SCREEN::GetPageSettings(), SCH_SHEET::GetRootInstance(), SCH_SHEET::GetScreen(), SCH_NETCHAIN::GetTerminalPinNum(), SCH_NETCHAIN::GetTerminalRef(), SCH_SCREEN::GetTitleBlock(), SCH_SHEET::HasRootInstance(), SCH_NETCHAIN::IsPersistableNet(), SCH_SCREEN::Items(), KiROUND(), m_out, m_schematic, EDA_ITEM::m_Uuid, SCH_SCREEN::m_uuid, KIGFX::COLOR4D::r, saveBitmap(), saveBusEntry(), saveGroup(), saveInstances(), saveJunction(), saveLine(), saveNoConnect(), saveRuleArea(), saveShape(), saveSheet(), SCH_IO_KICAD_SEXPR_LIB_CACHE::SaveSymbol(), saveSymbol(), saveTable(), saveText(), saveTextBox(), SCH_BITMAP_T, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_GROUP_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_LINE_T, SCH_MARKER_T, SCH_NO_CONNECT_T, SCH_RULE_AREA_T, SCH_SHAPE_T, SCH_SHEET_T, SCH_SYMBOL_T, SCH_TABLE_T, SCH_TEXT_T, SCH_TEXTBOX_T, SEXPR_SCHEMATIC_FILE_VERSION, EDA_ITEM::Type(), and KIGFX::COLOR4D::UNSPECIFIED.
Referenced by SCH_EDITOR_CONTROL::doCopy(), FormatSchematicToFormatter(), and API_HANDLER_SCH::handleSaveSelectionToString().
|
static |
Definition at line 2174 of file sch_io_kicad_sexpr.cpp.
References SCH_IO_KICAD_SEXPR_LIB_CACHE::SaveSymbol().
Referenced by SYMBOL_EDITOR_EDIT_TOOL::Copy(), and SYMBOL_EDIT_FRAME::CopySymbolToClipboard().
| void SCH_IO_KICAD_SEXPR::FormatSchematicToFormatter | ( | OUTPUTFORMATTER * | aOut, |
| SCH_SHEET * | aSheet, | ||
| SCHEMATIC * | aSchematic, | ||
| const std::map< std::string, UTF8 > * | aProperties = nullptr ) |
Serialize a schematic sheet to an OUTPUTFORMATTER without file I/O or Prettify.
Handles init() and Format(). Skips GroupsSanityCheck and SetFileExists side effects.
Definition at line 426 of file sch_io_kicad_sexpr.cpp.
References Format(), init(), and m_out.
Referenced by API_HANDLER_SCH::handleSaveDocumentToString(), SaveSchematicFile(), and SCHEMATIC::SaveToHistory().
|
overridevirtual |
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 from SCH_IO.
Definition at line 2119 of file sch_io_kicad_sexpr.cpp.
Referenced by GetDefaultSymbolFields().
|
overridevirtual |
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 from SCH_IO.
Definition at line 2141 of file sch_io_kicad_sexpr.cpp.
References GetAvailableSymbolFields().
|
inlineoverridevirtual |
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 from SCH_IO.
Definition at line 143 of file sch_io_kicad_sexpr.h.
References m_error.
Referenced by KI_TEST::LoadHierarchyFromRoot().
|
virtualinherited |
Return the canonical symbol definitions produced by the last LoadSchematicFile().
An importer implements this so a caller can materialize a project symbol library through SYMBOL_IMPORT_RECONCILER instead of the importer writing one itself. Ownership of the returned symbols passes to the caller.
Reimplemented in SCH_IO_CADSTAR_ARCHIVE, SCH_IO_EASYEDAPRO, and SCH_IO_EASYEDAPRO_V3.
Definition at line 76 of file sch_io.cpp.
References NOT_IMPLEMENTED.
Referenced by ReconcileImportedSymbols().
|
inlineoverridevirtual |
Get the descriptor for the library container that this IO plugin operates on.
Implements IO_BASE.
Definition at line 80 of file sch_io_kicad_sexpr.h.
References _HKI, and FILEEXT::KiCadSymbolLibFileExtension.
|
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, PCB_IO_KICAD_SEXPR, and PCB_IO_SPRINT_LAYOUT.
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 140 of file sch_io.cpp.
References IO_BASE::GetLibraryOptions().
|
overridevirtual |
Return the modification hash from the library cache.
Implements SCH_IO.
Definition at line 1896 of file sch_io_kicad_sexpr.cpp.
References m_cache.
|
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_EASYEDAPRO_V3::EnumerateSymbolLib(), SCH_IO_EASYEDAPRO_V3::LoadSymbol(), SCH_IO_ALTIUM::ParseAltiumSch(), and SCH_IO_ALTIUM::ParseLibFile().
|
inlineoverridevirtual |
Returns schematic file description for the SCH_IO.
Reimplemented from SCH_IO.
Definition at line 74 of file sch_io_kicad_sexpr.h.
References _HKI, and FILEEXT::KiCadSchematicFileExtension.
|
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 347 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 336 of file sch_io.h.
Referenced by SYMBOL_LIBRARY_ADAPTER::GetSubLibraries().
|
protected |
initialize PLUGIN like a constructor would.
Definition at line 92 of file sch_io_kicad_sexpr.cpp.
References m_appending, m_cache, m_loadedRootSheets, m_out, m_rootSheet, m_schematic, m_sheetLoad, and m_version.
Referenced by FormatSchematicToFormatter(), LoadSchematicFile(), and SCH_IO_KICAD_SEXPR().
|
private |
Definition at line 1890 of file sch_io_kicad_sexpr.cpp.
References PropBuffering.
Referenced by cacheLib(), DeleteSymbol(), EnumerateSymbolLib(), EnumerateSymbolLib(), and SaveSymbol().
|
overridevirtual |
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 2108 of file sch_io_kicad_sexpr.cpp.
|
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().
| void SCH_IO_KICAD_SEXPR::LoadContent | ( | LINE_READER & | aReader, |
| SCH_SHEET * | aSheet, | ||
| int | aVersion = SEXPR_SCHEMATIC_FILE_VERSION ) |
Definition at line 364 of file sch_io_kicad_sexpr.cpp.
References SCH_IO_KICAD_SEXPR_PARSER::GetNetChainColors(), SCH_IO_KICAD_SEXPR_PARSER::GetNetChainMemberNets(), SCH_IO_KICAD_SEXPR_PARSER::GetNetChainNetClasses(), SCH_IO_KICAD_SEXPR_PARSER::GetNetChainTerminalRefs(), m_rootSheet, m_schematic, name, and SCH_IO_KICAD_SEXPR_PARSER::ParseSchematic().
Referenced by SCH_EDITOR_CONTROL::Paste().
|
private |
Definition at line 320 of file sch_io_kicad_sexpr.cpp.
References _, SCH_IO_KICAD_SEXPR_PARSER::GetNetChainColors(), SCH_IO_KICAD_SEXPR_PARSER::GetNetChainMemberNets(), SCH_IO_KICAD_SEXPR_PARSER::GetNetChainNetClasses(), SCH_IO_KICAD_SEXPR_PARSER::GetNetChainTerminalRefs(), m_appending, IO_BASE::m_progressReporter, m_rootSheet, m_schematic, m_sheetLoad, name, SCH_IO_KICAD_SEXPR_PARSER::ParseSchematic(), FILE_LINE_READER::ReadLine(), FILE_LINE_READER::Rewind(), and THROW_IO_CANCELLED.
Referenced by loadHierarchy().
|
private |
Definition at line 191 of file sch_io_kicad_sexpr.cpp.
References _, SCH_SHEET_PATH::empty(), ExpandTextVars(), SCH_SCREEN::GetFileName(), SCH_SHEET::GetFileName(), SCH_SHEET::GetScreen(), INTERNAL, SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), loadFile(), loadHierarchy(), m_currentPath, m_currentSheetPath, m_error, m_loadedRootSheets, m_rootSheet, m_schematic, EE_RTREE::OfType(), SCH_SHEET_PATH::pop_back(), SCH_SHEET_PATH::push_back(), SCH_SHEET_T, SCH_SCREEN::SetFileExists(), SCH_SCREEN::SetFileName(), SCH_SCREEN::SetFileReadOnly(), EDA_ITEM::SetParent(), SCH_SHEET::SetScreen(), traceSchPlugin, and IO_ERROR::What().
Referenced by loadHierarchy(), and LoadSchematicFile().
|
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 108 of file sch_io_kicad_sexpr.cpp.
References SCH_SHEET::GetFileName(), LOAD_INFO_REPORTER::GetInstance(), PROJECT::GetProjectPath(), init(), SCHEMATIC::IsValid(), loadHierarchy(), m_appending, m_currentPath, m_loadedRootSheets, m_path, m_rootSheet, SCHEMATIC::Project(), SCHEMATIC::Root(), and traceSchPlugin.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), KI_TEST::LoadHierarchyFromRoot(), ISSUE24858_FIXTURE::reload(), PIN_MAP_OVERRIDE_FIXTURE::reload(), and SCH_ELLIPSE_FIXTURE::RoundTrip().
|
overridevirtual |
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 from SCH_IO.
Definition at line 1948 of file sch_io_kicad_sexpr.cpp.
References cacheLib(), CTX_LEGACY_LIBID, EscapeString(), and m_cache.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 2147 of file sch_io_kicad_sexpr.cpp.
References SCH_IO_KICAD_SEXPR_PARSER::ParseSymbol().
Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::DuplicateSymbol(), and SYMBOL_EDITOR_EDIT_TOOL::Paste().
|
virtualinherited |
Definition at line 124 of file io_base.cpp.
References m_reporter.
Referenced by PCB_IO_IPC2581::addShape(), SCH_IO_EASYEDAPRO_V3::EnumerateSymbolLib(), PCB_IO_ODBPP::ExportODB(), PCB_IO_IPC2581::generateBOMSection(), PCB_IO_IPC2581::generateComponents(), PCB_IO_IPC2581::generateLayerSetDrill(), PCB_IO_IPC2581::generateLayerSetNet(), PCB_IO_IPC2581::generateProfile(), PCB_IO::ImportFootprint(), PCB_IO_DIPTRACE::loadBoard(), PCB_IO_EASYEDAPRO_V3::loadBoard(), SCH_IO_EAGLE::loadInstance(), SCH_IO_EAGLE::loadLibrary(), PCB_IO_KICAD_LEGACY::loadPAD(), PCB_IO_EAGLE::loadPolygon(), SCH_IO_EASYEDAPRO_V3::LoadSchematicFile(), SCH_IO_DATABASE::loadSymbolFromRow(), PCB_IO_KICAD_LEGACY::loadZONE_CONTAINER(), PCB_IO_EAGLE::packageCircle(), PCB_IO_EAGLE::packagePad(), PCB_IO_EAGLE::packagePolygon(), PCB_IO_EAGLE::packageRectangle(), PCB_IO_EAGLE::packageText(), and PCB_IO_EAGLE::packageWire().
|
private |
Definition at line 1163 of file sch_io_kicad_sexpr.cpp.
References KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), EDA_UNIT_UTILS::FormatInternalUnits(), KICAD_FORMAT::FormatStreamData(), KICAD_FORMAT::FormatUuid(), REFERENCE_IMAGE::GetImage(), BITMAP_BASE::GetImageData(), REFERENCE_IMAGE::GetImageScale(), REFERENCE_IMAGE::GetPosition(), BITMAP_BASE::GetPPI(), SCH_BITMAP::GetReferenceImage(), image, SCH_ITEM::IsLocked(), m_out, EDA_ITEM::m_Uuid, BITMAP_BASE::SaveImageData(), scale, schIUScale, SEXPR_SCHEMATIC_FILE_VERSION, VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Definition at line 1421 of file sch_io_kicad_sexpr.cpp.
References STROKE_PARAMS::Format(), KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), EDA_UNIT_UTILS::FormatInternalUnits(), KICAD_FORMAT::FormatUuid(), SCH_ITEM::GetClass(), SCH_BUS_ENTRY_BASE::GetEnd(), SCH_BUS_ENTRY_BASE::GetPosition(), SCH_BUS_ENTRY_BASE::GetSize(), SCH_BUS_ENTRY_BASE::GetStroke(), SCH_ITEM::IsLocked(), LAYER_BUS, m_out, EDA_ITEM::m_Uuid, saveLine(), schIUScale, SCH_LINE::SetEndPoint(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Definition at line 1125 of file sch_io_kicad_sexpr.cpp.
References SCH_FIELD::CanAutoplace(), DEFAULT_SIZE_TEXT, EDA_TEXT::Format(), EDA_UNIT_UTILS::FormatAngle(), KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), EDA_UNIT_UTILS::FormatInternalUnits(), SCH_FIELD::GetPosition(), SCH_FIELD::GetText(), EDA_TEXT::GetTextAngle(), EDA_TEXT::GetTextHeight(), SCH_FIELD::GetUntranslatedName(), EDA_TEXT::IsDefaultFormatting(), SCH_FIELD::IsNameShown(), SCH_ITEM::IsPrivate(), EDA_TEXT::IsVisible(), m_out, schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by saveSheet(), saveSymbol(), and saveText().
|
private |
Definition at line 1803 of file sch_io_kicad_sexpr.cpp.
References UTF8::c_str(), LIB_ID::Format(), KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), KICAD_FORMAT::FormatUuid(), EDA_GROUP::GetDesignBlockLibId(), EDA_GROUP::GetItems(), EDA_GROUP::GetName(), EDA_GROUP::HasDesignBlockLink(), SCH_ITEM::IsLocked(), m_out, and EDA_ITEM::m_Uuid.
|
private |
Definition at line 1838 of file sch_io_kicad_sexpr.cpp.
Referenced by Format().
|
private |
Definition at line 1375 of file sch_io_kicad_sexpr.cpp.
References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), FormatDouble2Str(), EDA_UNIT_UTILS::FormatInternalUnits(), KICAD_FORMAT::FormatUuid(), KIGFX::COLOR4D::g, SCH_JUNCTION::GetColor(), SCH_JUNCTION::GetDiameter(), SCH_JUNCTION::GetPosition(), SCH_ITEM::IsLocked(), KiROUND(), m_out, EDA_ITEM::m_Uuid, KIGFX::COLOR4D::r, schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
|
overridevirtual |
Reimplemented from SCH_IO.
Definition at line 2061 of file sch_io_kicad_sexpr.cpp.
References m_cache.
Referenced by BOOST_AUTO_TEST_CASE().
|
private |
Definition at line 1528 of file sch_io_kicad_sexpr.cpp.
References LINE_ENDING::Format(), STROKE_PARAMS::Format(), KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), EDA_UNIT_UTILS::FormatInternalUnits(), KICAD_FORMAT::FormatUuid(), SCH_LINE::GetEndEnding(), SCH_LINE::GetEndPoint(), SCH_ITEM::GetLayer(), SCH_LINE::GetStartEnding(), SCH_LINE::GetStartPoint(), SCH_LINE::GetStroke(), SCH_ITEM::IsLocked(), LAYER_BUS, LAYER_NOTES, LAYER_WIRE, LayerName(), m_out, EDA_ITEM::m_Uuid, schIUScale, TO_UTF8, UNIMPLEMENTED_FOR, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Format(), Format(), and saveBusEntry().
|
private |
Definition at line 1401 of file sch_io_kicad_sexpr.cpp.
References KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), EDA_UNIT_UTILS::FormatInternalUnits(), KICAD_FORMAT::FormatUuid(), SCH_NO_CONNECT::GetPosition(), SCH_ITEM::IsLocked(), m_out, EDA_ITEM::m_Uuid, schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Definition at line 1507 of file sch_io_kicad_sexpr.cpp.
References KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), SCH_RULE_AREA::GetDNP(), SCH_RULE_AREA::GetExcludedFromBoard(), SCH_RULE_AREA::GetExcludedFromBOM(), SCH_RULE_AREA::GetExcludedFromSim(), SCH_ITEM::IsLocked(), m_out, and saveShape().
|
overridevirtual |
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 from SCH_IO.
Definition at line 390 of file sch_io_kicad_sexpr.cpp.
References _, PRETTIFIED_FILE_OUTPUTFORMATTER::Finish(), FormatSchematicToFormatter(), SCH_SHEET::GetScreen(), SCH_SCREEN::GroupsSanityCheck(), m_queryUserCallback, and SCH_SCREEN::SetFileExists().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), KI_TEST::DumpSchematicToFile(), SCH_ELLIPSE_FIXTURE::RoundTrip(), and ISSUE24858_FIXTURE::saveAndRead().
|
private |
Definition at line 1456 of file sch_io_kicad_sexpr.cpp.
References ARC, BEZIER, CIRCLE, ELLIPSE, ELLIPSE_ARC, formatArc(), formatBezier(), formatCircle(), formatEllipse(), formatEllipseArc(), formatPoly(), formatRect(), EDA_SHAPE::GetFillColor(), EDA_SHAPE::GetFillMode(), EDA_SHAPE::GetShape(), SCH_SHAPE::GetStroke(), SCH_ITEM::IsLocked(), m_out, EDA_ITEM::m_Uuid, POLY, RECTANGLE, SCH_RULE_AREA_T, EDA_SHAPE::SHAPE_T_asString(), EDA_ITEM::Type(), and UNIMPLEMENTED_FOR.
Referenced by Format(), Format(), and saveRuleArea().
|
private |
Definition at line 1205 of file sch_io_kicad_sexpr.cpp.
References KIGFX::COLOR4D::a, AUTOPLACE_AUTO, AUTOPLACE_MANUAL, KIGFX::COLOR4D::b, EscapedUTF8(), STROKE_PARAMS::Format(), EDA_UNIT_UTILS::FormatAngle(), KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), FormatDouble2Str(), EDA_UNIT_UTILS::FormatInternalUnits(), KICAD_FORMAT::FormatUuid(), KIGFX::COLOR4D::g, SCH_SHEET::GetBackgroundColor(), SCH_SHEET::GetBorderColor(), SCH_SHEET::GetBorderWidth(), SCH_SHEET::GetDNP(), SCH_SHEET::GetExcludedFromBoard(), SCH_SHEET::GetExcludedFromBOM(), SCH_SHEET::GetExcludedFromSim(), SCH_SHEET::GetFields(), SCH_ITEM::GetFieldsAutoplaced(), SCH_SHEET::GetInstances(), SCH_SHEET::GetPins(), SCH_SHEET::GetPosition(), SCH_SHEET_LIST::GetSheetPathByKIIDPath(), getSheetPinAngle(), getSheetPinShapeToken(), SCH_SHEET::GetSize(), SCH_ITEM::IsLocked(), KiROUND(), m_out, m_schematic, EDA_ITEM::m_Uuid, name, path, pin, KIGFX::COLOR4D::r, saveField(), schIUScale, STROKE_PARAMS::SetWidth(), SOLID, VECTOR2< T >::x, and VECTOR2< T >::y.
|
overridevirtual |
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. Ownership is transferred to the plugin, which may retain or destroy the symbol: the caller must not use it after this call. |
| 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 from SCH_IO.
Definition at line 1974 of file sch_io_kicad_sexpr.cpp.
References cacheLib(), isBuffering(), and m_cache.
Referenced by BOOST_AUTO_TEST_CASE().
|
private |
Definition at line 808 of file sch_io_kicad_sexpr.cpp.
References ANGLE_0, ANGLE_180, ANGLE_270, ANGLE_90, KIID_PATH::AsString(), AUTOPLACE_AUTO, AUTOPLACE_MANUAL, SCH_SYMBOL::DEFAULT, LIB_ID::Format(), EDA_UNIT_UTILS::FormatAngle(), KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), EDA_UNIT_UTILS::FormatInternalUnits(), formatPinMapOverride(), KICAD_FORMAT::FormatUuid(), SCH_ITEM::GetBodyStyle(), SCH_SYMBOL::GetDNP(), SCH_SYMBOL::GetExcludedFromBoard(), SCH_SYMBOL::GetExcludedFromBOM(), SCH_SYMBOL::GetExcludedFromPosFiles(), SCH_SYMBOL::GetExcludedFromSim(), SCH_SYMBOL::GetFields(), SCH_ITEM::GetFieldsAutoplaced(), SCH_SYMBOL::GetInstance(), SCH_SYMBOL::GetInstances(), SCH_SYMBOL::GetLibId(), SCH_SYMBOL::GetOrientation(), EDA_ITEM::GetParent(), SCH_SYMBOL::GetPassthroughMode(), SCH_SYMBOL::GetPinMapOverride(), SCH_SYMBOL::GetPosition(), SCH_SYMBOL::GetPrefix(), SCH_SYMBOL::GetRawPins(), SCH_SYMBOL::GetSchSymbolLibraryName(), SCH_SHEET_LIST::GetSheetPathByKIIDPath(), SCHEMATIC::IsInstancePathInProject(), SCH_ITEM::IsLocked(), SCHEMATIC::IsTopLevelSheetUuid(), m_out, SCH_SYMBOL_INSTANCE::m_Reference, m_schematic, SCH_SYMBOL_INSTANCE::m_Unit, EDA_ITEM::m_Uuid, KIID_PATH::MakeRelativeTo(), name, SCHEMATIC::NormalizeInstancePath(), SCH_SHEET_PATH::Path(), path, pin, projectKey(), REFERENCE, saveField(), schIUScale, SYM_MIRROR_X, SYM_MIRROR_Y, SYM_ORIENT_180, SYM_ORIENT_270, SYM_ORIENT_90, toUTFTildaText(), SCH_SYMBOL::UseLibIdLookup(), UTF8::wx_str(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Definition at line 1694 of file sch_io_kicad_sexpr.cpp.
References SCH_TABLE::Clone(), SCH_TABLE::DeleteMarkedCells(), STROKE_PARAMS::Format(), KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), EDA_UNIT_UTILS::FormatInternalUnits(), KICAD_FORMAT::FormatUuid(), SCH_TABLE::GetBorderStroke(), SCH_TABLE::GetCell(), SCH_TABLE::GetCells(), SCH_TABLE::GetColCount(), SCH_TABLE::GetColWidth(), EDA_ITEM::GetFlags(), SCH_TABLE::GetRowCount(), SCH_TABLE::GetRowHeight(), SCH_TABLE::GetSeparatorsStroke(), SCH_ITEM::IsLocked(), EDA_ITEM::IsSelected(), m_out, EDA_ITEM::m_Uuid, saveTextBox(), schIUScale, SCH_TABLE::SetColCount(), SCH_TABLE::SetColWidth(), EDA_ITEM::SetFlags(), SCH_TABLE::SetRowHeight(), SKIP_STRUCT, SCH_TABLE::StrokeColumns(), SCH_TABLE::StrokeExternal(), SCH_TABLE::StrokeHeaderSeparator(), SCH_TABLE::StrokeRows(), and STRUCT_DELETED.
|
private |
Definition at line 1574 of file sch_io_kicad_sexpr.cpp.
References ANGLE_180, AUTOPLACE_AUTO, AUTOPLACE_MANUAL, SPIN_STYLE::BOTTOM, flag, EDA_UNIT_UTILS::FormatAngle(), KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), EDA_UNIT_UTILS::FormatInternalUnits(), KICAD_FORMAT::FormatUuid(), SCH_TEXT::GetExcludedFromSim(), SCH_LABEL_BASE::GetFields(), SCH_ITEM::GetFieldsAutoplaced(), SCH_TEXT::GetPosition(), SCH_LABEL_BASE::GetShape(), getSheetPinShapeToken(), SCH_LABEL_BASE::GetSpinStyle(), EDA_TEXT::GetText(), EDA_TEXT::GetTextAngle(), getTextTypeToken(), SCH_ITEM::IsLocked(), SPIN_STYLE::LEFT, m_out, EDA_ITEM::m_Uuid, SPIN_STYLE::RIGHT, saveField(), SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, schIUScale, EDA_ITEM::Type(), SPIN_STYLE::UP, VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Definition at line 1652 of file sch_io_kicad_sexpr.cpp.
References STROKE_PARAMS::Format(), EDA_UNIT_UTILS::FormatAngle(), KICAD_FORMAT::FormatBool(), KICAD_FORMAT::FormatCustomProperties(), formatFill(), EDA_UNIT_UTILS::FormatInternalUnits(), KICAD_FORMAT::FormatUuid(), EDA_SHAPE::GetEnd(), SCH_TEXTBOX::GetExcludedFromSim(), EDA_SHAPE::GetFillColor(), EDA_SHAPE::GetFillMode(), SCH_TEXTBOX::GetMarginBottom(), SCH_TEXTBOX::GetMarginLeft(), SCH_TEXTBOX::GetMarginRight(), SCH_TEXTBOX::GetMarginTop(), EDA_SHAPE::GetStart(), SCH_SHAPE::GetStroke(), EDA_TEXT::GetText(), EDA_TEXT::GetTextAngle(), SCH_ITEM::IsLocked(), m_out, EDA_ITEM::m_Uuid, SCH_TABLECELL_T, schIUScale, EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Format(), Format(), and saveTable().
|
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(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), KI_TEST::LoadBoardWithCapture(), SCH_IO_GEDA::loadDeferredSheets(), and SCH_IO_GEDA::LoadSchematicFile().
|
inlinevirtualinherited |
Reimplemented in SCH_IO_DATABASE.
|
inlinevirtualinherited |
Reimplemented in SCH_IO_DATABASE, and SCH_IO_HTTP_LIB.
Definition at line 322 of file sch_io.h.
Referenced by SYMBOL_LIBRARY_ADAPTER::SupportsSubLibraries().
|
protected |
Schematic load append status.
Definition at line 177 of file sch_io_kicad_sexpr.h.
Referenced by init(), loadFile(), and LoadSchematicFile().
|
protected |
Definition at line 191 of file sch_io_kicad_sexpr.h.
Referenced by cacheLib(), CreateLibrary(), DeleteLibrary(), DeleteSymbol(), EnumerateSymbolLib(), EnumerateSymbolLib(), GetAvailableSymbolFields(), GetModifyHash(), init(), LoadSymbol(), SaveLibrary(), SaveSymbol(), and ~SCH_IO_KICAD_SEXPR().
|
protected |
Stack to maintain nested sheet paths.
Definition at line 183 of file sch_io_kicad_sexpr.h.
Referenced by loadHierarchy(), and LoadSchematicFile().
|
protected |
Definition at line 188 of file sch_io_kicad_sexpr.h.
Referenced by loadHierarchy().
|
protected |
For throwing exceptions or errors on partial loads.
Definition at line 179 of file sch_io_kicad_sexpr.h.
Referenced by GetError(), and loadHierarchy().
|
protected |
Root sheets from previous LoadSchematicFile() calls, enabling screen reuse across top-level sheets that share sub-sheet files.
Definition at line 185 of file sch_io_kicad_sexpr.h.
Referenced by init(), loadHierarchy(), and LoadSchematicFile().
|
protectedinherited |
Name of the IO loader.
Definition at line 235 of file io_base.h.
Referenced by PCB_IO_IPC2581::generateBOMSection(), GetName(), and IO_BASE().
|
protected |
The formatter for saving SCH_SCREEN objects.
Definition at line 190 of file sch_io_kicad_sexpr.h.
Referenced by Format(), Format(), FormatSchematicToFormatter(), init(), saveBitmap(), saveBusEntry(), saveField(), saveGroup(), saveInstances(), saveJunction(), saveLine(), saveNoConnect(), saveRuleArea(), saveShape(), saveSheet(), saveSymbol(), saveTable(), saveText(), and saveTextBox().
|
protected |
Root project path for loading child sheets.
Definition at line 182 of file sch_io_kicad_sexpr.h.
Referenced by LoadSchematicFile().
|
protectedinherited |
Progress reporter to track the progress of the operation, may be nullptr.
Definition at line 241 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::generateComponents(), PCB_IO_IPC2581::generatePhyNetGroup(), IO_BASE(), PCB_IO_ALTIUM_CIRCUIT_MAKER::loadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::loadBoard(), PCB_IO_ALTIUM_DESIGNER::loadBoard(), PCB_IO_CADSTAR_ARCHIVE::loadBoard(), PCB_IO_DIPTRACE::loadBoard(), PCB_IO_EASYEDA::loadBoard(), PCB_IO_EASYEDAPRO::loadBoard(), PCB_IO_EASYEDAPRO_V3::loadBoard(), PCB_IO_FABMASTER::loadBoard(), PCB_IO_KICAD_SEXPR::loadBoard(), PCB_IO_PADS::loadBoard(), PCB_IO_PADS_BINARY::loadBoard(), PCB_IO_SOLIDWORKS::loadBoard(), PCB_IO_ALLEGRO::LoadBoardFromData(), SCH_IO_KICAD_LEGACY::loadFile(), SCH_IO_KICAD_SEXPR::loadFile(), SCH_IO_ORCAD::loadOlbSymbols(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_DIPTRACE::LoadSchematicFile(), SCH_IO_EAGLE::LoadSchematicFile(), SCH_IO_LTSPICE::LoadSchematicFile(), SCH_IO_ORCAD::LoadSchematicFile(), SCH_IO_PADS::LoadSchematicFile(), SCH_IO_ALTIUM::ParseAltiumSch(), PCB_IO_IPC2581::reportPhase(), PCB_IO_IPC2581::SaveBoard(), SetProgressReporter(), SCH_IO_CADSTAR_ARCHIVE::SetProgressReporter(), and PCB_IO_IPC2581::tickProgress().
|
protected |
Definition at line 196 of file sch_io_kicad_sexpr.h.
Referenced by SaveSchematicFile().
|
protectedinherited |
Reporter to log errors/warnings to, may be nullptr.
Definition at line 238 of file io_base.h.
Referenced by PCB_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), SCH_IO_GEDA::flushPendingComponent(), PCB_IO_ALTIUM_DESIGNER::FootprintLoad(), SCH_IO_GEDA::getOrLoadSymbol(), SCH_IO_GEDA::importHierarchicalSheet(), IO_BASE(), SCH_IO_PADS::loadBinarySchematicFile(), PCB_IO_ALTIUM_CIRCUIT_MAKER::loadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::loadBoard(), PCB_IO_ALTIUM_DESIGNER::loadBoard(), PCB_IO_AUTOTRAX::loadBoard(), PCB_IO_CADSTAR_ARCHIVE::loadBoard(), PCB_IO_FABMASTER::loadBoard(), PCB_IO_PADS::loadBoard(), PCB_IO_PADS_BINARY::loadBoard(), PCB_IO_PCAD::loadBoard(), PCB_IO_SOLIDWORKS::loadBoard(), PCB_IO_ALLEGRO::LoadBoardFromData(), PCB_IO_PADS::loadCopperShapes(), PCB_IO_PADS_BINARY::loadCopperShapes(), SCH_IO_GEDA::loadDeferredSheets(), PCB_IO_PADS::loadFootprints(), PCB_IO_PADS_BINARY::loadFootprints(), SCH_IO_ORCAD::loadOlbSymbols(), SCH_IO_ALTIUM::LoadSchematicFile(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_DIPTRACE::LoadSchematicFile(), SCH_IO_GEDA::LoadSchematicFile(), SCH_IO_LTSPICE::LoadSchematicFile(), SCH_IO_ORCAD::LoadSchematicFile(), SCH_IO_PADS::LoadSchematicFile(), PCB_IO_PADS::loadTracksAndVias(), PCB_IO_PADS_BINARY::loadTracksAndVias(), PCB_IO_PADS::loadZones(), PCB_IO_PADS_BINARY::loadZones(), SCH_IO_ALTIUM::ParseLibFile(), SCH_IO_ALTIUM::ParsePowerPort(), SCH_IO_PCAD::populateScreen(), Report(), SCH_IO_ALTIUM::SCH_IO_ALTIUM(), SCH_IO_CADSTAR_ARCHIVE::SCH_IO_CADSTAR_ARCHIVE(), SCH_IO_DIPTRACE::SCH_IO_DIPTRACE(), SCH_IO_EASYEDA::SCH_IO_EASYEDA(), SCH_IO_LTSPICE::SCH_IO_LTSPICE(), SCH_IO_ORCAD::SCH_IO_ORCAD(), SetReporter(), and SCH_IO_CADSTAR_ARCHIVE::SetReporter().
|
protected |
The root sheet of the schematic being loaded.
Definition at line 184 of file sch_io_kicad_sexpr.h.
Referenced by init(), LoadContent(), loadFile(), loadHierarchy(), and LoadSchematicFile().
|
protected |
init() reads this before assigning it.
Definition at line 189 of file sch_io_kicad_sexpr.h.
Referenced by Format(), Format(), init(), LoadContent(), loadFile(), loadHierarchy(), saveSheet(), and saveSymbol().
|
protected |
Loading a sheet into an open schematic.
Definition at line 178 of file sch_io_kicad_sexpr.h.
Referenced by init(), and loadFile().
|
protected |
Version of file being loaded.
Definition at line 176 of file sch_io_kicad_sexpr.h.
Referenced by init().
|
static |
The property used internally by the plugin to enable cache buffering which prevents the library file from being written every time the cache is changed.
This is useful when writing the schematic cache library file or saving a library to a new file name.
Definition at line 91 of file sch_io_kicad_sexpr.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), isBuffering(), SCH_IO_EAGLE::loadInstance(), SCH_IO_EAGLE::loadLibrary(), and SYMBOL_IMPORT_RECONCILER::writeAndRegisterCache().