![]() |
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 wxString | GetFileExtension () const override |
Return the file extension for the SCH_PLUGIN. More... | |
const wxString | GetLibraryFileExtension () const override |
Return the library file extension for the SCH_PLUGIN object. More... | |
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 * | Load (const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const PROPERTIES *aProperties=nullptr) override |
Load information from some input file format that this SCH_PLUGIN implementation knows about, into either a new SCH_SHEET or an existing one. More... | |
void | LoadContent (LINE_READER &aReader, SCH_SCREEN *aScreen, int version=EESCHEMA_VERSION) |
void | Save (const wxString &aFileName, SCH_SHEET *aScreen, SCHEMATIC *aSchematic, const PROPERTIES *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 PROPERTIES *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 PROPERTIES *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 PROPERTIES *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 PROPERTIES *aProperties=nullptr) override |
Write aSymbol to an existing library located at aLibraryPath. More... | |
void | DeleteSymbol (const wxString &aLibraryPath, const wxString &aSymbolName, const PROPERTIES *aProperties=nullptr) override |
Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath. More... | |
void | CreateSymbolLib (const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) override |
Create a new empty symbol library at aLibraryPath. More... | |
bool | DeleteSymbolLib (const wxString &aLibraryPath, const PROPERTIES *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 PROPERTIES *aProperties=nullptr) override |
bool | CheckHeader (const wxString &aFileName) override |
Return true if the first line in aFileName begins with the expected header. More... | |
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 (PROPERTIES *aListToAppendTo) const |
Append supported SCH_PLUGIN options to aListToAppenTo along with internationalized descriptions. 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 PROPERTIES *aProperties=nullptr) |
initialize PLUGIN like a constructor would. More... | |
Protected Attributes | |
int | m_version |
Version of file being loaded. More... | |
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... | |
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 63 of file sch_legacy_plugin.h.
SCH_LEGACY_PLUGIN::SCH_LEGACY_PLUGIN | ( | ) |
Definition at line 569 of file sch_legacy_plugin.cpp.
References init().
|
virtual |
|
private |
Definition at line 4323 of file sch_legacy_plugin.cpp.
References SYMBOL_LIBS::IncrementModifyGeneration(), isBuffering(), SCH_LEGACY_PLUGIN_CACHE::IsFile(), SCH_LEGACY_PLUGIN_CACHE::IsFileChanged(), SCH_LEGACY_PLUGIN_CACHE::Load(), and m_cache.
Referenced by DeleteSymbol(), EnumerateSymbolLib(), LoadSymbol(), and SaveSymbol().
|
overridevirtual |
Return true if the first line in aFileName begins with the expected header.
aFileName | is the name of the file to use as input |
Reimplemented from SCH_PLUGIN.
Definition at line 4520 of file sch_legacy_plugin.cpp.
|
private |
Definition at line 595 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 4456 of file sch_legacy_plugin.cpp.
References _, Format(), SCH_LEGACY_PLUGIN_CACHE::Load(), m_cache, SCH_LEGACY_PLUGIN_CACHE::Save(), SCH_LEGACY_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 4442 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 4475 of file sch_legacy_plugin.cpp.
References _, Format(), SCH_LEGACY_PLUGIN_CACHE::IsFile(), m_cache, and THROW_IO_ERROR.
|
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 4369 of file sch_legacy_plugin.cpp.
References cacheLib(), m_cache, SCH_LEGACY_PLUGIN_CACHE::m_symbols, and SYMBOL_LIB_TABLE::PropPowerSymsOnly.
|
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 4390 of file sch_legacy_plugin.cpp.
References cacheLib(), m_cache, SCH_LEGACY_PLUGIN_CACHE::m_symbols, and SYMBOL_LIB_TABLE::PropPowerSymsOnly.
void SCH_LEGACY_PLUGIN::Format | ( | SCH_SHEET * | aSheet | ) |
Definition at line 1903 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 Save().
void SCH_LEGACY_PLUGIN::Format | ( | SELECTION * | aSelection, |
OUTPUTFORMATTER * | aFormatter | ||
) |
Definition at line 2002 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 4549 of file sch_legacy_plugin.cpp.
References SCH_LEGACY_PLUGIN_CACHE::SaveSymbol().
|
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 141 of file sch_legacy_plugin.h.
References m_error.
|
inlineoverridevirtual |
Return the file extension for the SCH_PLUGIN.
Implements SCH_PLUGIN.
Definition at line 75 of file sch_legacy_plugin.h.
|
inlineoverridevirtual |
Return the library file extension for the SCH_PLUGIN object.
Implements SCH_PLUGIN.
Definition at line 80 of file sch_legacy_plugin.h.
|
overridevirtual |
Return the modification hash from the library cache.
Implements SCH_PLUGIN.
Definition at line 4359 of file sch_legacy_plugin.cpp.
References SCH_LEGACY_PLUGIN_CACHE::GetModifyHash(), and m_cache.
|
inlineoverridevirtual |
Return a brief hard coded name for this SCH_PLUGIN.
Implements SCH_PLUGIN.
Definition at line 70 of file sch_legacy_plugin.h.
|
protected |
initialize PLUGIN like a constructor would.
Definition at line 585 of file sch_legacy_plugin.cpp.
References m_cache, m_out, m_rootSheet, m_schematic, and m_version.
Referenced by Load(), Save(), and SCH_LEGACY_PLUGIN().
|
private |
Definition at line 4353 of file sch_legacy_plugin.cpp.
References PROPERTIES::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 4535 of file sch_legacy_plugin.cpp.
|
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 617 of file sch_legacy_plugin.cpp.
References SCH_SHEET::GetFileName(), PROJECT::GetProjectPath(), init(), SCHEMATIC::IsValid(), loadHierarchy(), m_currentPath, m_path, m_rootSheet, SCHEMATIC::Prj(), SCHEMATIC::Root(), and traceSchLegacyPlugin.
|
private |
Definition at line 1130 of file sch_legacy_plugin.cpp.
References _, image, LINE_READER::Line(), Mils2Iu, parseDouble(), parseInt(), LINE_READER::ReadLine(), SCH_PARSE_ERROR, strCompare(), and THROW_IO_ERROR.
Referenced by LoadContent().
|
private |
Definition at line 1850 of file sch_legacy_plugin.cpp.
References LINE_READER::Line(), parseUnquotedString(), and strCompare().
Referenced by LoadContent().
|
private |
Definition at line 1361 of file sch_legacy_plugin.cpp.
References LINE_READER::Line(), Mils2Iu, parseInt(), LINE_READER::ReadLine(), SCH_PARSE_ERROR, and strCompare().
Referenced by LoadContent().
void SCH_LEGACY_PLUGIN::LoadContent | ( | LINE_READER & | aReader, |
SCH_SCREEN * | aScreen, | ||
int | version = EESCHEMA_VERSION |
||
) |
Definition at line 804 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 765 of file sch_legacy_plugin.cpp.
References _, Format(), 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 851 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 686 of file sch_legacy_plugin.cpp.
References SCH_SHEET::GetFileName(), SCH_SHEET::GetScreen(), SCH_SCREEN::Items(), loadFile(), m_currentPath, m_error, m_rootSheet, m_schematic, 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 Load().
|
private |
Definition at line 1219 of file sch_legacy_plugin.cpp.
References LINE_READER::Line(), Mils2Iu, name, parseInt(), parseUnquotedString(), and strCompare().
Referenced by LoadContent().
|
private |
Definition at line 1241 of file sch_legacy_plugin.cpp.
References LINE_READER::Line(), Mils2Iu, name, parseInt(), parseUnquotedString(), and strCompare().
Referenced by LoadContent().
|
private |
Definition at line 891 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().
|
private |
Definition at line 1020 of file sch_legacy_plugin.cpp.
References _, BOTTOM, ConvertToNewOverbarNotation(), LEFT, Mils2Iu, parseChar(), parseInt(), parseQuotedString(), parseUnquotedString(), PS_BIDI, PS_INPUT, PS_OUTPUT, PS_TRISTATE, PS_UNSPECIFIED, LINE_READER::ReadLine(), RIGHT, SCH_PARSE_ERROR, EDA_TEXT::SetText(), EDA_TEXT::SetTextSize(), strCompare(), text, THROW_IO_ERROR, and TOP.
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 4411 of file sch_legacy_plugin.cpp.
References cacheLib(), m_cache, and SCH_LEGACY_PLUGIN_CACHE::m_symbols.
|
private |
Definition at line 1534 of file sch_legacy_plugin.cpp.
References _, convert, TEMPLATE_FIELDNAME::GetDefaultFieldName(), SCH_SHEET::GetScreen(), LINE_READER::GetSource(), GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_TOP, LINE_READER::Line(), LINE_READER::LineNumber(), m_rootSheet, EDA_ITEM::m_Uuid, m_version, MANDATORY_FIELDS, MAX_UNIT_COUNT_PER_PACKAGE, Mils2Iu, name, LIB_ID::Parse(), parseChar(), parseHex(), parseInt(), parseQuotedString(), parseUnquotedString(), path, LINE_READER::ReadLine(), REFERENCE_FIELD, SCH_PARSE_ERROR, EDA_TEXT::SetBold(), BASE_SCREEN::SetContentModified(), EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetItalic(), LIB_ID::SetLibItemName(), SCH_FIELD::SetName(), EDA_TEXT::SetText(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetTextPos(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetVertJustify(), EDA_TEXT::SetVisible(), strCompare(), text, TEXT_ANGLE_HORIZ, TEXT_ANGLE_VERT, THROW_PARSE_ERROR, TRANSFORM::x1, TRANSFORM::x2, TRANSFORM::y1, and TRANSFORM::y2.
Referenced by LoadContent().
|
private |
Definition at line 1417 of file sch_legacy_plugin.cpp.
References _, ConvertToNewOverbarNotation(), FROM_UTF8(), GetPenSizeForBold(), LINE_READER::Line(), m_version, Mils2Iu, parseInt(), LINE_READER::ReadLine(), SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_PARSE_ERROR, sheetLabelNames, strCompare(), and text.
Referenced by LoadContent().
|
private |
Definition at line 1263 of file sch_legacy_plugin.cpp.
References color, SCH_LINE::GetLineStyleByName(), is_eol(), LAYER_BUS, LAYER_NOTES, LAYER_WIRE, LINE_READER::Line(), Mils2Iu, parseInt(), parseUnquotedString(), LINE_READER::ReadLine(), SCH_PARSE_ERROR, strCompare(), T_COLOR, T_COLORA, T_STYLE, and T_WIDTH.
Referenced by LoadContent().
|
static |
Definition at line 4542 of file sch_legacy_plugin.cpp.
References SCH_LEGACY_PLUGIN_CACHE::LoadPart().
|
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 1877 of file sch_legacy_plugin.cpp.
References Format(), SCH_SHEET::GetScreen(), init(), m_out, and SCH_SCREEN::SetFileExists().
|
private |
Definition at line 2189 of file sch_legacy_plugin.cpp.
References SCH_BITMAP::GetImage(), BITMAP_BASE::GetImageData(), SCH_BITMAP::GetPosition(), BITMAP_BASE::GetScale(), image, m_out, and OUTPUTFORMATTER::Print().
Referenced by Format().
|
private |
Definition at line 2442 of file sch_legacy_plugin.cpp.
References m_out, OUTPUTFORMATTER::Print(), and TO_UTF8.
Referenced by Format().
|
private |
Definition at line 2313 of file sch_legacy_plugin.cpp.
References SCH_BUS_ENTRY_BASE::GetEnd(), SCH_ITEM::GetLayer(), SCH_BUS_ENTRY_BASE::GetPosition(), LAYER_WIRE, m_out, and OUTPUTFORMATTER::Print().
Referenced by Format().
|
private |
Definition at line 2153 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_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_TOP, EDA_TEXT::IsBold(), EDA_TEXT::IsItalic(), EDA_TEXT::IsVisible(), m_out, MANDATORY_FIELDS, OUTPUTFORMATTER::Print(), and TEXT_ANGLE_HORIZ.
Referenced by saveSymbol().
|
private |
Definition at line 2293 of file sch_legacy_plugin.cpp.
References SCH_JUNCTION::GetPosition(), m_out, and OUTPUTFORMATTER::Print().
Referenced by Format().
|
overridevirtual |
Reimplemented from SCH_PLUGIN.
Definition at line 4501 of file sch_legacy_plugin.cpp.
References SCH_LEGACY_PLUGIN_CACHE::GetFileName(), SCH_LEGACY_PLUGIN_CACHE::IsFile(), m_cache, SCH_LEGACY_PLUGIN_CACHE::Save(), SCH_LEGACY_PLUGIN_CACHE::SetFileName(), SCH_LEGACY_PLUGIN_CACHE::SetModified(), and writeDocFile().
|
private |
Definition at line 2330 of file sch_legacy_plugin.cpp.
References SCH_LINE::GetDefaultStyle(), SCH_LINE::GetEndPoint(), SCH_ITEM::GetLayer(), SCH_LINE::GetLineColor(), SCH_LINE::GetLineSize(), SCH_LINE::GetLineStyle(), SCH_LINE::GetLineStyleName(), SCH_LINE::GetStartPoint(), SCH_LINE::IsGraphicLine(), LAYER_BUS, LAYER_WIRE, m_out, OUTPUTFORMATTER::Print(), T_STYLE, T_WIDTH, and TO_UTF8.
Referenced by Format().
|
private |
Definition at line 2303 of file sch_legacy_plugin.cpp.
References SCH_NO_CONNECT::GetPosition(), m_out, and OUTPUTFORMATTER::Print().
Referenced by Format().
|
private |
Definition at line 2229 of file sch_legacy_plugin.cpp.
References KIID::AsLegacyTimestamp(), BOTTOM, EscapedUTF8(), SCH_SHEET::GetFields(), SCH_SHEET::GetPins(), SCH_SHEET::GetPosition(), SCH_SHEET::GetSize(), EDA_TEXT::GetText(), EDA_TEXT::GetTextSize(), LEFT, m_out, EDA_ITEM::m_Uuid, pin, OUTPUTFORMATTER::Print(), PS_BIDI, PS_INPUT, PS_OUTPUT, PS_TRISTATE, PS_UNSPECIFIED, RIGHT, SHEETFILENAME, SHEETNAME, and TOP.
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 4428 of file sch_legacy_plugin.cpp.
References SCH_LEGACY_PLUGIN_CACHE::AddSymbol(), cacheLib(), isBuffering(), m_cache, SCH_LEGACY_PLUGIN_CACHE::Save(), and writeDocFile().
|
private |
Definition at line 2047 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(), m_out, SYMBOL_INSTANCE_REFERENCE::m_Reference, EDA_ITEM::m_Uuid, MANDATORY_FIELDS, path, OUTPUTFORMATTER::Print(), REFERENCE_FIELD, saveField(), TO_UTF8, toUTFTildaText(), TRANSFORM::x1, TRANSFORM::x2, TRANSFORM::y1, and TRANSFORM::y2.
Referenced by Format().
|
private |
Definition at line 2369 of file sch_legacy_plugin.cpp.
References SCH_TEXT::GetLabelSpinStyle(), SCH_ITEM::GetLayer(), SCH_TEXT::GetPosition(), SCH_TEXT::GetShape(), EDA_TEXT::GetText(), EDA_TEXT::GetTextThickness(), EDA_TEXT::GetTextWidth(), EDA_TEXT::IsItalic(), LAYER_GLOBLABEL, LAYER_HIERLABEL, LAYER_LOCLABEL, LAYER_NOTES, m_out, OUTPUTFORMATTER::Print(), sheetLabelNames, text, and TO_UTF8.
Referenced by Format().
|
inlineoverridevirtual |
Set an optional progress reporter.
Reimplemented from SCH_PLUGIN.
Definition at line 85 of file sch_legacy_plugin.h.
References m_progressReporter.
|
inlinevirtualinherited |
Set an optional reporter for warnings/errors.
Reimplemented in SCH_EAGLE_PLUGIN, SCH_ALTIUM_PLUGIN, and CADSTAR_SCH_ARCHIVE_PLUGIN.
Definition at line 166 of file sch_io_mgr.h.
|
virtualinherited |
Append supported SCH_PLUGIN options to aListToAppenTo along with internationalized descriptions.
Options are typically appended so that a derived SCH_PLUGIN can call its base class function by the same name first, thus inheriting options declared there. (Some base class options could pertain to all Symbol*() functions in all derived SCH_PLUGINs.) Note that since aListToAppendTo is a PROPERTIES object, all options will be unique and last guy wins.
aListToAppendTo | holds a tuple of
In the future perhaps aListToAppendTo evolves to something capable of also holding a wxValidator for the cells in said dialog: http://forums.wxwidgets.org/viewtopic.php?t=23277&p=104180. This would require a 3 column list, and introducing wx GUI knowledge to SCH_PLUGIN, which has been avoided to date. |
Definition at line 133 of file sch_plugin.cpp.
References _.
|
private |
Definition at line 4342 of file sch_legacy_plugin.cpp.
References PropNoDocFile.
Referenced by CreateSymbolLib(), DeleteSymbol(), SaveLibrary(), and SaveSymbol().
|
protected |
Definition at line 192 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 189 of file sch_legacy_plugin.h.
Referenced by Load(), and loadHierarchy().
|
protected |
For throwing exceptions or errors on partial schematic loads.
Definition at line 181 of file sch_legacy_plugin.h.
Referenced by GetError(), loadHeader(), and loadHierarchy().
|
protected |
Definition at line 185 of file sch_legacy_plugin.h.
Referenced by checkpoint().
|
protected |
for progress reporting
Definition at line 186 of file sch_legacy_plugin.h.
Referenced by checkpoint(), and loadFile().
|
protected |
for progress reporting
Definition at line 184 of file sch_legacy_plugin.h.
Referenced by checkpoint(), and loadFile().
|
protected |
The formatter for saving SCH_SCREEN objects.
Definition at line 191 of file sch_legacy_plugin.h.
Referenced by Format(), init(), Save(), saveBitmap(), saveBusAlias(), saveBusEntry(), saveField(), saveJunction(), saveLine(), saveNoConnect(), saveSheet(), saveSymbol(), and saveText().
|
protected |
Root project path for loading child sheets.
Definition at line 188 of file sch_legacy_plugin.h.
Referenced by Load().
|
protected |
optional; may be nullptr
Definition at line 183 of file sch_legacy_plugin.h.
Referenced by checkpoint(), loadFile(), and SetProgressReporter().
|
protected |
The root sheet of the schematic being loaded.
Definition at line 190 of file sch_legacy_plugin.h.
Referenced by init(), Load(), LoadContent(), loadHierarchy(), and loadSymbol().
|
protected |
Definition at line 193 of file sch_legacy_plugin.h.
Referenced by Format(), init(), and loadHierarchy().
|
protected |
Version of file being loaded.
Definition at line 179 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 95 of file sch_legacy_plugin.h.
Referenced by SYMBOL_LIB::EnableBuffering(), isBuffering(), SYMBOL_LIB::IsBuffering(), SCH_EAGLE_PLUGIN::Load(), 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 101 of file sch_legacy_plugin.h.
Referenced by SYMBOL_LIB::IsCache(), SYMBOL_LIB::Save(), SYMBOL_LIB::SetCache(), and writeDocFile().