KiCad PCB EDA Suite
|
A SCH_PLUGIN derivation for loading schematic files created before the new s-expression file format. More...
#include <sch_legacy_plugin.h>
Public Member Functions | |
SCH_LEGACY_PLUGIN () | |
virtual | ~SCH_LEGACY_PLUGIN () |
const wxString | GetName () const override |
Return a brief hard coded name for this SCH_PLUGIN. More... | |
const PLUGIN_FILE_DESC | GetSchematicFileDesc () const override |
Returns schematic file description for the SCH_PLUGIN. More... | |
const PLUGIN_FILE_DESC | GetLibraryFileDesc () const override |
Returns symbol library description for the SCH_PLUGIN. More... | |
bool | CanReadSchematicFile (const wxString &aFileName) const override |
Checks if this SCH_PLUGIN can read the specified schematic file. More... | |
bool | CanReadLibrary (const wxString &aFileName) const override |
Checks if this SCH_PLUGIN can read the specified symbol library file. More... | |
void | SetProgressReporter (PROGRESS_REPORTER *aReporter) override |
Set an optional progress reporter. More... | |
int | GetModifyHash () const override |
Return the modification hash from the library cache. More... | |
SCH_SHEET * | LoadSchematicFile (const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const STRING_UTF8_MAP *aProperties=nullptr) override |
Load information from some input file format that this SCH_PLUGIN implementation knows about, into either a new SCH_SHEET or an existing one. More... | |
void | LoadContent (LINE_READER &aReader, SCH_SCREEN *aScreen, int version=EESCHEMA_VERSION) |
void | SaveSchematicFile (const wxString &aFileName, SCH_SHEET *aScreen, SCHEMATIC *aSchematic, const STRING_UTF8_MAP *aProperties=nullptr) override |
Write aSchematic to a storage file in a format that this SCH_PLUGIN implementation knows about, or it can be used to write a portion of aSchematic to a special kind of export file. More... | |
void | Format (SCH_SHEET *aSheet) |
void | Format (SELECTION *aSelection, OUTPUTFORMATTER *aFormatter) |
void | EnumerateSymbolLib (wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override |
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath. More... | |
void | EnumerateSymbolLib (std::vector< LIB_SYMBOL * > &aSymbolList, const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override |
Populate a list of LIB_SYMBOL aliases contained within the library aLibraryPath. More... | |
LIB_SYMBOL * | LoadSymbol (const wxString &aLibraryPath, const wxString &aAliasName, const STRING_UTF8_MAP *aProperties=nullptr) override |
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this SCH_PLUGIN knows about. More... | |
void | SaveSymbol (const wxString &aLibraryPath, const LIB_SYMBOL *aSymbol, const STRING_UTF8_MAP *aProperties=nullptr) override |
Write aSymbol to an existing library located at aLibraryPath. More... | |
void | DeleteSymbol (const wxString &aLibraryPath, const wxString &aSymbolName, const STRING_UTF8_MAP *aProperties=nullptr) override |
Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath. More... | |
void | CreateSymbolLib (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override |
Create a new empty symbol library at aLibraryPath. More... | |
bool | DeleteSymbolLib (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override |
Delete an existing symbol library and returns true if successful, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason. More... | |
void | SaveLibrary (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override |
bool | IsSymbolLibWritable (const wxString &aLibraryPath) override |
Return true if the library at aLibraryPath is writable. More... | |
const wxString & | GetError () const override |
Return an error string to the caller. More... | |
virtual void | SetReporter (REPORTER *aReporter) |
Set an optional reporter for warnings/errors. More... | |
virtual void | SymbolLibOptions (STRING_UTF8_MAP *aListToAppendTo) const |
Append supported SCH_PLUGIN options to aListToAppenTo along with internationalized descriptions. More... | |
virtual bool | SupportsSubLibraries () const |
virtual void | GetSubLibraryNames (std::vector< wxString > &aNames) |
Retrieves a list of sub-libraries in this library. More... | |
virtual void | GetAvailableSymbolFields (std::vector< wxString > &aNames) |
Retrieves a list of (custom) field names that are present on symbols in this library. More... | |
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. More... | |
virtual void | SetLibTable (SYMBOL_LIB_TABLE *aTable) |
Some library plugins need to have access to their parent library table. More... | |
Static Public Member Functions | |
static LIB_SYMBOL * | ParsePart (LINE_READER &aReader, int majorVersion=0, int minorVersion=0) |
static void | FormatPart (LIB_SYMBOL *aSymbol, 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. More... | |
static const char * | PropNoDocFile = "no_doc_file" |
The property used internally by the plugin to disable writing the library documentation (.dcm) file when saving the library cache. More... | |
Protected Member Functions | |
void | init (SCHEMATIC *aSchematic, const STRING_UTF8_MAP *aProperties=nullptr) |
initialize PLUGIN like a constructor would. More... | |
Static Protected Member Functions | |
static bool | fileStartsWithPrefix (const wxString &aFilePath, const wxString &aPrefix, bool aIgnoreWhitespace) |
static bool | fileStartsWithBinaryHeader (const wxString &aFilePath, const std::vector< uint8_t > &aHeader) |
Protected Attributes | |
int | m_version |
Version of file being loaded. More... | |
bool | m_appending |
wxString | m_error |
For throwing exceptions or errors on partial schematic loads. More... | |
PROGRESS_REPORTER * | m_progressReporter |
optional; may be nullptr More... | |
LINE_READER * | m_lineReader |
for progress reporting More... | |
unsigned | m_lastProgressLine |
unsigned | m_lineCount |
for progress reporting More... | |
wxString | m_path |
Root project path for loading child sheets. More... | |
std::stack< wxString > | m_currentPath |
Stack to maintain nested sheet paths. More... | |
SCH_SHEET * | m_rootSheet |
The root sheet of the schematic being loaded. More... | |
SCH_SHEET * | m_currentSheet |
The sheet currently being loaded. More... | |
OUTPUTFORMATTER * | m_out |
The formatter for saving SCH_SCREEN objects. More... | |
SCH_LEGACY_PLUGIN_CACHE * | m_cache |
SCHEMATIC * | m_schematic |
A SCH_PLUGIN derivation for loading schematic files created before the new s-expression file format.
The legacy parser and formatter attempt to be compatible with the legacy file format. The original parser was very forgiving in that it would parse only part of a keyword. So "$C", "$Co", and "$Com" could be used for "$Comp" and the old parser would allow this. This parser is not that forgiving and sticks to the legacy file format document.
As with all SCH_PLUGINs there is no UI dependencies i.e. windowing calls allowed.
Definition at line 65 of file sch_legacy_plugin.h.
SCH_LEGACY_PLUGIN::SCH_LEGACY_PLUGIN | ( | ) |
Definition at line 74 of file sch_legacy_plugin.cpp.
References init().
|
virtual |
Definition at line 85 of file sch_legacy_plugin.cpp.
References m_cache.
|
private |
Definition at line 2049 of file sch_legacy_plugin.cpp.
References isBuffering(), SCH_LIB_PLUGIN_CACHE::IsFile(), SCH_LIB_PLUGIN_CACHE::IsFileChanged(), SCH_LEGACY_PLUGIN_CACHE::Load(), and m_cache.
Referenced by DeleteSymbol(), EnumerateSymbolLib(), LoadSymbol(), and SaveSymbol().
|
overridevirtual |
Checks if this SCH_PLUGIN can read the specified symbol library file.
If not overriden, extension check is used.
Reimplemented from SCH_PLUGIN.
Definition at line 2250 of file sch_legacy_plugin.cpp.
References SCH_PLUGIN::CanReadLibrary(), and SCH_PLUGIN::fileStartsWithPrefix().
|
overridevirtual |
Checks if this SCH_PLUGIN can read the specified schematic file.
If not overriden, extension check is used.
Reimplemented from SCH_PLUGIN.
Definition at line 2241 of file sch_legacy_plugin.cpp.
References SCH_PLUGIN::CanReadSchematicFile(), and SCH_PLUGIN::fileStartsWithPrefix().
|
private |
Definition at line 102 of file sch_legacy_plugin.cpp.
References PROGRESS_REPORTER::KeepRefreshing(), LINE_READER::LineNumber(), m_lastProgressLine, m_lineCount, m_lineReader, m_progressReporter, PROGRESS_REPORTER::SetCurrentProgress(), and THROW_IO_ERROR.
Referenced by LoadContent(), and loadHeader().
|
overridevirtual |
Create a new empty symbol library at aLibraryPath.
It is an error to attempt to create an existing library or to attempt to create on a "read only" location.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aProperties | is an associative array that can be used to tell the library create function anything special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem finding the library, or creating it. |
Reimplemented from SCH_PLUGIN.
Definition at line 2177 of file sch_legacy_plugin.cpp.
References _, SCH_LEGACY_PLUGIN_CACHE::Load(), m_cache, SCH_LEGACY_PLUGIN_CACHE::Save(), SCH_LIB_PLUGIN_CACHE::SetModified(), THROW_IO_ERROR, and writeDocFile().
|
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_PLUGIN.
Definition at line 2163 of file sch_legacy_plugin.cpp.
References cacheLib(), SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol(), isBuffering(), m_cache, SCH_LEGACY_PLUGIN_CACHE::Save(), and writeDocFile().
|
overridevirtual |
Delete an existing symbol library and returns true if successful, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason.
aLibraryPath | is a locator for the "library", usually a directory or file which will contain symbols. |
aProperties | is an associative array that can be used to tell the library delete implementation function anything special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem deleting an existing library. |
Reimplemented from SCH_PLUGIN.
Definition at line 2196 of file sch_legacy_plugin.cpp.
References _, SCH_LIB_PLUGIN_CACHE::IsFile(), m_cache, and THROW_IO_ERROR.
|
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_PLUGIN.
Definition at line 2111 of file sch_legacy_plugin.cpp.
References cacheLib(), m_cache, SCH_LIB_PLUGIN_CACHE::m_symbols, and SYMBOL_LIB_TABLE::PropPowerSymsOnly.
|
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_PLUGIN.
Definition at line 2090 of file sch_legacy_plugin.cpp.
References cacheLib(), m_cache, SCH_LIB_PLUGIN_CACHE::m_symbols, and SYMBOL_LIB_TABLE::PropPowerSymsOnly.
|
staticprotectedinherited |
Definition at line 248 of file sch_plugin.cpp.
|
staticprotectedinherited |
Definition at line 223 of file sch_plugin.cpp.
References text.
Referenced by CanReadLibrary(), and CanReadSchematicFile().
void SCH_LEGACY_PLUGIN::Format | ( | SCH_SHEET * | aSheet | ) |
Definition at line 1480 of file sch_legacy_plugin.cpp.
References EESCHEMA_VERSION, EscapedUTF8(), SCH_SCREEN::GetBusAliases(), TITLE_BLOCK::GetComment(), TITLE_BLOCK::GetCompany(), TITLE_BLOCK::GetDate(), PAGE_INFO::GetHeightMils(), BASE_SCREEN::GetPageCount(), SCH_SCREEN::GetPageSettings(), TITLE_BLOCK::GetRevision(), SCH_SHEET::GetScreen(), TITLE_BLOCK::GetTitle(), SCH_SCREEN::GetTitleBlock(), PAGE_INFO::GetType(), BASE_SCREEN::GetVirtualPageNumber(), PAGE_INFO::GetWidthMils(), PAGE_INFO::IsCustom(), PAGE_INFO::IsPortrait(), SCH_SCREEN::Items(), m_out, m_schematic, OUTPUTFORMATTER::Print(), saveBitmap(), saveBusAlias(), saveBusEntry(), saveJunction(), saveLine(), saveNoConnect(), saveSheet(), saveSymbol(), saveText(), SCH_BITMAP_T, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_LAYER_ID_COUNT, SCH_LINE_T, SCH_NO_CONNECT_T, SCH_SHEET_T, SCH_SYMBOL_T, SCH_TEXT_T, SCHEMATIC_HEAD_STRING, and TO_UTF8.
Referenced by SaveSchematicFile().
void SCH_LEGACY_PLUGIN::Format | ( | SELECTION * | aSelection, |
OUTPUTFORMATTER * | aFormatter | ||
) |
Definition at line 1577 of file sch_legacy_plugin.cpp.
References SELECTION::GetItem(), SELECTION::GetSize(), m_out, saveBitmap(), saveBusEntry(), saveJunction(), saveLine(), saveNoConnect(), saveSheet(), saveSymbol(), saveText(), SCH_BITMAP_T, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_LINE_T, SCH_NO_CONNECT_T, SCH_SHEET_T, SCH_SYMBOL_T, SCH_TEXT_T, and EDA_ITEM::Type().
|
static |
Definition at line 2273 of file sch_legacy_plugin.cpp.
References SCH_LEGACY_PLUGIN_CACHE::SaveSymbol().
|
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 CADSTAR_SCH_ARCHIVE_PLUGIN, SCH_DATABASE_PLUGIN, SCH_HTTP_LIB_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 477 of file sch_io_mgr.h.
Referenced by SYMBOL_LIB_TABLE_ROW::GetAvailableSymbolFields(), and SCH_PLUGIN::GetDefaultSymbolFields().
|
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_DATABASE_PLUGIN, SCH_HTTP_LIB_PLUGIN, and SCH_SEXPR_PLUGIN.
Definition at line 491 of file sch_io_mgr.h.
References SCH_PLUGIN::GetAvailableSymbolFields().
Referenced by SYMBOL_LIB_TABLE_ROW::GetDefaultSymbolFields().
|
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_PLUGIN.
Definition at line 148 of file sch_legacy_plugin.h.
References m_error.
|
inlineoverridevirtual |
Returns symbol library description for the SCH_PLUGIN.
Reimplemented from SCH_PLUGIN.
Definition at line 83 of file sch_legacy_plugin.h.
References _HKI, and LegacySymbolLibFileExtension.
|
overridevirtual |
Return the modification hash from the library cache.
Implements SCH_PLUGIN.
Definition at line 2080 of file sch_legacy_plugin.cpp.
References SCH_LIB_PLUGIN_CACHE::GetModifyHash(), and m_cache.
|
inlineoverridevirtual |
Return a brief hard coded name for this SCH_PLUGIN.
Implements SCH_PLUGIN.
Definition at line 72 of file sch_legacy_plugin.h.
|
inlineoverridevirtual |
Returns schematic file description for the SCH_PLUGIN.
Reimplemented from SCH_PLUGIN.
Definition at line 77 of file sch_legacy_plugin.h.
References _HKI, and LegacySchematicFileExtension.
|
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_DATABASE_PLUGIN, and SCH_HTTP_LIB_PLUGIN.
Definition at line 466 of file sch_io_mgr.h.
Referenced by SYMBOL_LIB_TABLE_ROW::GetSubLibraryNames().
|
protected |
initialize PLUGIN like a constructor would.
Definition at line 91 of file sch_legacy_plugin.cpp.
References m_cache, m_currentSheet, m_out, m_rootSheet, m_schematic, and m_version.
Referenced by LoadSchematicFile(), SaveSchematicFile(), and SCH_LEGACY_PLUGIN().
|
private |
Definition at line 2074 of file sch_legacy_plugin.cpp.
References STRING_UTF8_MAP::Exists(), and PropBuffering.
Referenced by cacheLib(), DeleteSymbol(), and SaveSymbol().
|
overridevirtual |
Return true if the library at aLibraryPath is writable.
(Often system libraries are read only because of where they are installed.)
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several symbols. |
IO_ERROR | if no library at aLibraryPath exists. |
Reimplemented from SCH_PLUGIN.
Definition at line 2259 of file sch_legacy_plugin.cpp.
|
private |
Definition at line 644 of file sch_legacy_plugin.cpp.
References _, BITMAP_BASE::GetPPI(), BITMAP_BASE::GetScale(), LINE_READER::Line(), EDA_IU_SCALE::MilsToIU(), parseDouble(), parseInt(), LINE_READER::ReadLine(), SCH_PARSE_ERROR, schIUScale, BITMAP_BASE::SetScale(), strCompare(), THROW_IO_ERROR, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by LoadContent().
|
private |
Definition at line 1428 of file sch_legacy_plugin.cpp.
References LINE_READER::Line(), parseUnquotedString(), and strCompare().
Referenced by LoadContent().
|
private |
Definition at line 885 of file sch_legacy_plugin.cpp.
References LINE_READER::Line(), EDA_IU_SCALE::MilsToIU(), parseInt(), LINE_READER::ReadLine(), SCH_PARSE_ERROR, schIUScale, strCompare(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by LoadContent().
void SCH_LEGACY_PLUGIN::LoadContent | ( | LINE_READER & | aReader, |
SCH_SCREEN * | aScreen, | ||
int | version = EESCHEMA_VERSION |
||
) |
Definition at line 318 of file sch_legacy_plugin.cpp.
References SCH_SCREEN::AddBusAlias(), SCH_SCREEN::Append(), checkpoint(), LINE_READER::Line(), loadBitmap(), loadBusAlias(), loadBusEntry(), loadJunction(), loadNoConnect(), loadPageSettings(), loadSheet(), loadSymbol(), loadText(), loadWire(), m_rootSheet, m_version, LINE_READER::ReadLine(), SCH_PARSE_ERROR, and strCompare().
Referenced by loadFile().
|
private |
Definition at line 279 of file sch_legacy_plugin.cpp.
References _, PROGRESS_REPORTER::KeepRefreshing(), LINE_READER::Line(), LoadContent(), loadHeader(), m_lineCount, m_lineReader, m_progressReporter, m_version, FILE_LINE_READER::ReadLine(), PROGRESS_REPORTER::Report(), FILE_LINE_READER::Rewind(), strCompare(), and THROW_IO_ERROR.
Referenced by loadHierarchy().
|
private |
Definition at line 365 of file sch_legacy_plugin.cpp.
References _, checkpoint(), SCH_SCREEN::GetFileName(), LINE_READER::Line(), m_error, m_version, parseInt(), LINE_READER::ReadLine(), strCompare(), and THROW_IO_ERROR.
Referenced by loadFile().
|
private |
Definition at line 195 of file sch_legacy_plugin.cpp.
References SCH_SHEET::GetFileName(), SCH_SHEET::GetScreen(), SCH_SCREEN::GetUuid(), SCH_SCREEN::Items(), loadFile(), loadHierarchy(), m_currentPath, m_currentSheet, m_error, m_rootSheet, m_schematic, EDA_ITEM::m_Uuid, EE_RTREE::OfType(), SCH_SHEET_T, SCH_SHEET::SearchHierarchy(), SCH_SCREEN::SetFileExists(), SCH_SCREEN::SetFileName(), SCH_SCREEN::SetFileReadOnly(), EDA_ITEM::SetParent(), SCH_SHEET::SetScreen(), traceSchLegacyPlugin, and IO_ERROR::What().
Referenced by loadHierarchy(), and LoadSchematicFile().
|
private |
Definition at line 735 of file sch_legacy_plugin.cpp.
References LINE_READER::Line(), EDA_IU_SCALE::MilsToIU(), name, parseInt(), parseUnquotedString(), schIUScale, strCompare(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by LoadContent().
|
private |
Definition at line 757 of file sch_legacy_plugin.cpp.
References LINE_READER::Line(), EDA_IU_SCALE::MilsToIU(), name, parseInt(), parseUnquotedString(), schIUScale, strCompare(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by LoadContent().
|
private |
Definition at line 405 of file sch_legacy_plugin.cpp.
References _, PAGE_INFO::Custom, LINE_READER::Line(), parseInt(), parseQuotedString(), parseUnquotedString(), LINE_READER::ReadLine(), SCH_PARSE_ERROR, TITLE_BLOCK::SetComment(), TITLE_BLOCK::SetCompany(), TITLE_BLOCK::SetDate(), PAGE_INFO::SetHeightMils(), BASE_SCREEN::SetPageCount(), SCH_SCREEN::SetPageSettings(), PAGE_INFO::SetPortrait(), TITLE_BLOCK::SetRevision(), TITLE_BLOCK::SetTitle(), SCH_SCREEN::SetTitleBlock(), PAGE_INFO::SetType(), BASE_SCREEN::SetVirtualPageNumber(), PAGE_INFO::SetWidthMils(), and strCompare().
Referenced by LoadContent().
|
overridevirtual |
Load information from some input file format that this SCH_PLUGIN implementation knows about, into either a new SCH_SHEET or an existing one.
This may be used to load an entire new SCH_SHEET, or to augment an existing one if aAppendToMe is not NULL.
aFileName | is the name of the file to use as input and may be foreign in nature or native in nature. |
aKiway | is the KIWAY object used to access the symbol libraries loaded by the project. |
aAppendToMe | is an existing SCH_SHEET to append to, but if NULL then this means "do not append, rather load anew". |
aProperties | is an associative array that can be used to tell the loader how to load the file, because it can take any number of additional named arguments that the plugin is known to support. These are tuning parameters for the import or load. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem loading, and its contents should say what went wrong, using line number and character offsets of the input file if possible. |
Reimplemented from SCH_PLUGIN.
Definition at line 124 of file sch_legacy_plugin.cpp.
References SCH_SHEET::GetFileName(), PROJECT::GetProjectPath(), init(), SCHEMATIC::IsValid(), loadHierarchy(), m_appending, m_currentPath, m_path, m_rootSheet, SCHEMATIC::Prj(), SCHEMATIC::Root(), and traceSchLegacyPlugin.
|
private |
Definition at line 534 of file sch_legacy_plugin.cpp.
References _, ConvertToNewOverbarNotation(), EDA_IU_SCALE::MilsToIU(), parseChar(), parseInt(), parseQuotedString(), parseUnquotedString(), LINE_READER::ReadLine(), SCH_PARSE_ERROR, schIUScale, SCH_FIELD::SetText(), EDA_TEXT::SetTextSize(), strCompare(), text, THROW_IO_ERROR, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by LoadContent().
|
overridevirtual |
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this SCH_PLUGIN knows about.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several symbols. |
aPartName | is the name of the LIB_SYMBOL to load. |
aProperties | is an associative array that can be used to tell the loader implementation to do something special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if the library cannot be found or read. No exception is thrown in the case where aAliasName cannot be found. |
Reimplemented from SCH_PLUGIN.
Definition at line 2132 of file sch_legacy_plugin.cpp.
References cacheLib(), m_cache, and SCH_LIB_PLUGIN_CACHE::m_symbols.
|
private |
Definition at line 1081 of file sch_legacy_plugin.cpp.
References _, ANGLE_HORIZONTAL, ANGLE_VERTICAL, convert, TEMPLATE_FIELDNAME::GetDefaultFieldName(), SCH_SHEET::GetScreen(), LINE_READER::GetSource(), SCH_SCREEN::GetUuid(), GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_TOP, LINE_READER::Line(), LINE_READER::LineNumber(), m_appending, m_currentSheet, SCH_SYMBOL_INSTANCE::m_Path, SCH_SYMBOL_INSTANCE::m_Reference, m_rootSheet, SCH_SYMBOL_INSTANCE::m_Unit, m_version, MANDATORY_FIELDS, MAX_UNIT_COUNT_PER_PACKAGE, EDA_IU_SCALE::MilsToIU(), name, LIB_ID::Parse(), parseChar(), parseHex(), parseInt(), parseQuotedString(), parseUnquotedString(), path, LINE_READER::ReadLine(), REFERENCE_FIELD, SCH_PARSE_ERROR, schIUScale, EDA_TEXT::SetBold(), BASE_SCREEN::SetContentModified(), EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetItalic(), LIB_ID::SetLibItemName(), SCH_FIELD::SetName(), SCH_FIELD::SetText(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetTextPos(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetVertJustify(), EDA_TEXT::SetVisible(), strCompare(), text, THROW_PARSE_ERROR, VECTOR2< T >::x, TRANSFORM::x1, TRANSFORM::x2, VECTOR2< T >::y, TRANSFORM::y1, and TRANSFORM::y2.
Referenced by LoadContent().
|
private |
Definition at line 944 of file sch_legacy_plugin.cpp.
References _, ConvertToNewOverbarNotation(), From_UTF8(), GetPenSizeForBold(), LINE_READER::Line(), m_version, EDA_IU_SCALE::MilsToIU(), parseInt(), LINE_READER::ReadLine(), SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PARSE_ERROR, SCH_TEXT_T, schIUScale, SCH_LABEL_BASE::SetShape(), SCH_LABEL_BASE::SetSpinStyle(), sheetLabelNames, strCompare(), text, TYPE_NOT_INIT, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by LoadContent().
|
private |
Definition at line 779 of file sch_legacy_plugin.cpp.
References color, is_eol(), LAYER_BUS, LAYER_NOTES, LAYER_WIRE, LINE_READER::Line(), EDA_IU_SCALE::MilsToIU(), parseInt(), parseUnquotedString(), LINE_READER::ReadLine(), SCH_PARSE_ERROR, schIUScale, strCompare(), T_COLOR, T_COLORA, T_STYLE, T_WIDTH, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by LoadContent().
|
static |
Definition at line 2266 of file sch_legacy_plugin.cpp.
References SCH_LEGACY_PLUGIN_CACHE::LoadPart().
|
private |
Definition at line 1764 of file sch_legacy_plugin.cpp.
References SCH_BITMAP::GetImage(), BITMAP_BASE::GetImageData(), SCH_BITMAP::GetPosition(), BITMAP_BASE::GetScale(), image, EDA_IU_SCALE::IUToMils(), m_out, OUTPUTFORMATTER::Print(), schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Format().
|
private |
Definition at line 2038 of file sch_legacy_plugin.cpp.
References m_out, OUTPUTFORMATTER::Print(), and TO_UTF8.
Referenced by Format().
|
private |
Definition at line 1892 of file sch_legacy_plugin.cpp.
References SCH_BUS_ENTRY_BASE::GetEnd(), SCH_ITEM::GetLayer(), SCH_BUS_ENTRY_BASE::GetPosition(), EDA_IU_SCALE::IUToMils(), LAYER_WIRE, m_out, OUTPUTFORMATTER::Print(), schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Format().
|
private |
Definition at line 1728 of file sch_legacy_plugin.cpp.
References EscapedUTF8(), EDA_TEXT::GetHorizJustify(), SCH_FIELD::GetId(), SCH_FIELD::GetLibPosition(), SCH_FIELD::GetName(), EDA_TEXT::GetText(), EDA_TEXT::GetTextAngle(), EDA_TEXT::GetTextWidth(), EDA_TEXT::GetVertJustify(), GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_TOP, EDA_TEXT::IsBold(), EDA_ANGLE::IsHorizontal(), EDA_TEXT::IsItalic(), EDA_TEXT::IsVisible(), EDA_IU_SCALE::IUToMils(), m_out, MANDATORY_FIELDS, OUTPUTFORMATTER::Print(), schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by saveSymbol().
|
private |
Definition at line 1872 of file sch_legacy_plugin.cpp.
References SCH_JUNCTION::GetPosition(), EDA_IU_SCALE::IUToMils(), m_out, OUTPUTFORMATTER::Print(), schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Format().
|
overridevirtual |
Reimplemented from SCH_PLUGIN.
Definition at line 2222 of file sch_legacy_plugin.cpp.
References SCH_LIB_PLUGIN_CACHE::GetFileName(), SCH_LIB_PLUGIN_CACHE::IsFile(), m_cache, SCH_LEGACY_PLUGIN_CACHE::Save(), SCH_LIB_PLUGIN_CACHE::SetFileName(), SCH_LIB_PLUGIN_CACHE::SetModified(), and writeDocFile().
|
private |
Definition at line 1915 of file sch_legacy_plugin.cpp.
References SCH_LINE::GetEndPoint(), SCH_ITEM::GetLayer(), SCH_LINE::GetLineColor(), SCH_LINE::GetLineStyle(), STROKE_PARAMS::GetLineStyleToken(), SCH_LINE::GetLineWidth(), SCH_LINE::GetStartPoint(), SCH_LINE::IsGraphicLine(), EDA_IU_SCALE::IUToMils(), LAYER_BUS, LAYER_WIRE, m_out, OUTPUTFORMATTER::Print(), schIUScale, T_STYLE, T_WIDTH, TO_UTF8, KIGFX::COLOR4D::ToCSSString(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Format().
|
private |
Definition at line 1882 of file sch_legacy_plugin.cpp.
References SCH_NO_CONNECT::GetPosition(), EDA_IU_SCALE::IUToMils(), m_out, OUTPUTFORMATTER::Print(), schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Format().
|
overridevirtual |
Write aSchematic to a storage file in a format that this SCH_PLUGIN implementation knows about, or it can be used to write a portion of aSchematic to a special kind of export file.
aFileName | is the name of a file to save to on disk. |
aSheet | is the class SCH_SHEET in memory document tree from which to extract information when writing to aFileName. The caller continues to own the SCHEMATIC, and the plugin should refrain from modifying the SCHEMATIC if possible. |
aSchematic | is the SCHEMATIC object used to access any schematic-wide or project information needed to save the document. |
aProperties | is an associative array that can be used to tell the saver how to save the file, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. Set the #PropSaveCurrentSheetOnly property to only save the current sheet. Otherwise, all hierarchical sheets are saved. |
IO_ERROR | if there is a problem saving or exporting. |
Reimplemented from SCH_PLUGIN.
Definition at line 1453 of file sch_legacy_plugin.cpp.
References Format(), SCH_SHEET::GetScreen(), init(), m_out, and SCH_SCREEN::SetFileExists().
|
private |
Definition at line 1804 of file sch_legacy_plugin.cpp.
References KIID::AsLegacyTimestamp(), EscapedUTF8(), SCH_SHEET::GetFields(), SCH_SHEET::GetPins(), SCH_SHEET::GetPosition(), SCH_SHEET::GetSize(), EDA_TEXT::GetText(), EDA_TEXT::GetTextSize(), EDA_IU_SCALE::IUToMils(), m_out, EDA_ITEM::m_Uuid, pin, OUTPUTFORMATTER::Print(), schIUScale, SHEETFILENAME, SHEETNAME, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Format().
|
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. 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 from SCH_PLUGIN.
Definition at line 2149 of file sch_legacy_plugin.cpp.
References SCH_LIB_PLUGIN_CACHE::AddSymbol(), cacheLib(), isBuffering(), m_cache, SCH_LEGACY_PLUGIN_CACHE::Save(), and writeDocFile().
|
private |
Definition at line 1622 of file sch_legacy_plugin.cpp.
References KIID::AsLegacyTimestamp(), KIID::AsLegacyTimestampString(), LIB_ID::Format(), SCH_SYMBOL::GetConvert(), SCH_SYMBOL::GetField(), SCH_SYMBOL::GetFieldCount(), SCH_SYMBOL::GetFields(), SCH_SYMBOL::GetInstanceReferences(), SCH_SYMBOL::GetLibId(), SCH_SYMBOL::GetPosition(), SCH_SYMBOL::GetPrefix(), EDA_TEXT::GetText(), SCH_SYMBOL::GetTransform(), SCH_SYMBOL::GetUnit(), EDA_IU_SCALE::IUToMils(), m_out, SCH_SYMBOL_INSTANCE::m_Reference, EDA_ITEM::m_Uuid, MANDATORY_FIELDS, path, OUTPUTFORMATTER::Print(), REFERENCE_FIELD, saveField(), schIUScale, TO_UTF8, toUTFTildaText(), VECTOR2< T >::x, TRANSFORM::x1, TRANSFORM::x2, VECTOR2< T >::y, TRANSFORM::y1, and TRANSFORM::y2.
Referenced by Format().
|
private |
Definition at line 1957 of file sch_legacy_plugin.cpp.
References SCH_ITEM::GetLayer(), SCH_TEXT::GetPosition(), SCH_LABEL_BASE::GetShape(), SCH_LABEL_BASE::GetSpinStyle(), EDA_TEXT::GetText(), EDA_TEXT::GetTextThickness(), EDA_TEXT::GetTextWidth(), EDA_TEXT::IsItalic(), EDA_IU_SCALE::IUToMils(), LAYER_GLOBLABEL, LAYER_HIERLABEL, LAYER_LOCLABEL, LAYER_NOTES, m_out, OUTPUTFORMATTER::Print(), schIUScale, sheetLabelNames, text, TO_UTF8, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Format().
|
inlinevirtualinherited |
Some library plugins need to have access to their parent library table.
aTable | is the table this plugin is registered within. |
Reimplemented in SCH_DATABASE_PLUGIN, and SCH_HTTP_LIB_PLUGIN.
Definition at line 510 of file sch_io_mgr.h.
Referenced by SYMBOL_LIB_TABLE::FindRow(), SYMBOL_LIB_TABLE::LoadSymbolLib(), and SYMBOL_LIB_TABLE_ROW::Refresh().
|
inlineoverridevirtual |
Set an optional progress reporter.
Reimplemented from SCH_PLUGIN.
Definition at line 93 of file sch_legacy_plugin.h.
References m_progressReporter.
|
inlinevirtualinherited |
Set an optional reporter for warnings/errors.
Reimplemented in SCH_ALTIUM_PLUGIN, CADSTAR_SCH_ARCHIVE_PLUGIN, SCH_EAGLE_PLUGIN, SCH_EASYEDA_PLUGIN, SCH_EASYEDAPRO_PLUGIN, and SCH_LTSPICE_PLUGIN.
Definition at line 158 of file sch_io_mgr.h.
Referenced by SCH_EDIT_FRAME::importFile().
|
inlinevirtualinherited |
Reimplemented in SCH_DATABASE_PLUGIN, and SCH_HTTP_LIB_PLUGIN.
Definition at line 452 of file sch_io_mgr.h.
Referenced by SYMBOL_LIB_TABLE_ROW::SupportsSubLibraries().
|
virtualinherited |
Append supported SCH_PLUGIN options to aListToAppenTo along with internationalized descriptions.
Options are typically appended so that a derived SCH_PLUGIN can call its base class function by the same name first, thus inheriting options declared there. (Some base class options could pertain to all Symbol*() functions in all derived SCH_PLUGINs.) Note that since aListToAppendTo is a PROPERTIES object, all options will be unique and last guy wins.
aListToAppendTo | holds a tuple of
In the future perhaps aListToAppendTo evolves to something capable of also holding a wxValidator for the cells in said dialog: http://forums.wxwidgets.org/viewtopic.php?t=23277&p=104180. This would require a 3 column list, and introducing wx GUI knowledge to SCH_PLUGIN, which has been avoided to date. |
Reimplemented in CADSTAR_SCH_ARCHIVE_PLUGIN.
Definition at line 204 of file sch_plugin.cpp.
Referenced by SYMBOL_GRID_TRICKS::optionsEditor().
|
private |
Definition at line 2063 of file sch_legacy_plugin.cpp.
References PropNoDocFile.
Referenced by CreateSymbolLib(), DeleteSymbol(), SaveLibrary(), and SaveSymbol().
|
protected |
Definition at line 189 of file sch_legacy_plugin.h.
Referenced by LoadSchematicFile(), and loadSymbol().
|
protected |
Definition at line 203 of file sch_legacy_plugin.h.
Referenced by cacheLib(), CreateSymbolLib(), DeleteSymbol(), DeleteSymbolLib(), EnumerateSymbolLib(), GetModifyHash(), init(), LoadSymbol(), SaveLibrary(), SaveSymbol(), and ~SCH_LEGACY_PLUGIN().
|
protected |
Stack to maintain nested sheet paths.
Definition at line 199 of file sch_legacy_plugin.h.
Referenced by loadHierarchy(), and LoadSchematicFile().
|
protected |
The sheet currently being loaded.
Definition at line 201 of file sch_legacy_plugin.h.
Referenced by init(), loadHierarchy(), and loadSymbol().
|
protected |
For throwing exceptions or errors on partial schematic loads.
Definition at line 191 of file sch_legacy_plugin.h.
Referenced by GetError(), loadHeader(), and loadHierarchy().
|
protected |
Definition at line 195 of file sch_legacy_plugin.h.
Referenced by checkpoint().
|
protected |
for progress reporting
Definition at line 196 of file sch_legacy_plugin.h.
Referenced by checkpoint(), and loadFile().
|
protected |
for progress reporting
Definition at line 194 of file sch_legacy_plugin.h.
Referenced by checkpoint(), and loadFile().
|
protected |
The formatter for saving SCH_SCREEN objects.
Definition at line 202 of file sch_legacy_plugin.h.
Referenced by Format(), init(), saveBitmap(), saveBusAlias(), saveBusEntry(), saveField(), saveJunction(), saveLine(), saveNoConnect(), SaveSchematicFile(), saveSheet(), saveSymbol(), and saveText().
|
protected |
Root project path for loading child sheets.
Definition at line 198 of file sch_legacy_plugin.h.
Referenced by LoadSchematicFile().
|
protected |
optional; may be nullptr
Definition at line 193 of file sch_legacy_plugin.h.
Referenced by checkpoint(), loadFile(), and SetProgressReporter().
|
protected |
The root sheet of the schematic being loaded.
Definition at line 200 of file sch_legacy_plugin.h.
Referenced by init(), LoadContent(), loadHierarchy(), LoadSchematicFile(), and loadSymbol().
|
protected |
Definition at line 204 of file sch_legacy_plugin.h.
Referenced by Format(), init(), and loadHierarchy().
|
protected |
Version of file being loaded.
Indicate if we are appending the loaded schemitic or loading a full project.
Definition at line 186 of file sch_legacy_plugin.h.
Referenced by init(), LoadContent(), loadFile(), loadHeader(), loadSymbol(), and loadText().
|
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 103 of file sch_legacy_plugin.h.
Referenced by SYMBOL_LIB::EnableBuffering(), SYMBOL_LIB::IsBuffering(), isBuffering(), SCH_EAGLE_PLUGIN::LoadSchematicFile(), SYMBOL_LIB_TABLE_RESCUER::OpenRescueLibrary(), SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer(), and SYMBOL_LIBRARY_MANAGER::SaveLibrary().
|
static |
The property used internally by the plugin to disable writing the library documentation (.dcm) file when saving the library cache.
Definition at line 109 of file sch_legacy_plugin.h.
Referenced by SYMBOL_LIB::IsCache(), SYMBOL_LIB::Save(), SYMBOL_LIB::SetCache(), and writeDocFile().