1 #ifndef _SCH_LEGACY_PLUGIN_H_ 2 #define _SCH_LEGACY_PLUGIN_H_ 72 return wxT(
"Eeschema-Legacy" );
107 const PROPERTIES* aProperties =
nullptr )
override;
113 const PROPERTIES* aProperties =
nullptr )
override;
120 const wxString& aLibraryPath,
121 const PROPERTIES* aProperties =
nullptr )
override;
123 const wxString& aLibraryPath,
124 const PROPERTIES* aProperties =
nullptr )
override;
126 const PROPERTIES* aProperties =
nullptr )
override;
128 const PROPERTIES* aProperties =
nullptr )
override;
129 void DeleteSymbol(
const wxString& aLibraryPath,
const wxString& aSymbolName,
130 const PROPERTIES* aProperties =
nullptr )
override;
132 const PROPERTIES* aProperties =
nullptr )
override;
134 const PROPERTIES* aProperties =
nullptr )
override;
136 const PROPERTIES* aProperties =
nullptr )
override;
138 bool CheckHeader(
const wxString& aFileName )
override;
144 int minorVersion = 0 );
199 #endif // _SCH_LEGACY_PLUGIN_H_
SCH_SHEET * loadSheet(LINE_READER &aReader)
void LoadContent(LINE_READER &aReader, SCH_SCREEN *aScreen, int version=EESCHEMA_VERSION)
SCH_JUNCTION * loadJunction(LINE_READER &aReader)
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...
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
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,...
wxString m_error
For throwing exceptions or errors on partial schematic loads.
Holds all the data relating to one schematic.
Object used to load, save, search, and otherwise manipulate symbol library files.
void saveLine(SCH_LINE *aLine)
A progress reporter interface for use in multi-threaded environments.
SCH_LEGACY_PLUGIN_CACHE * m_cache
virtual ~SCH_LEGACY_PLUGIN()
void init(SCHEMATIC *aSchematic, const PROPERTIES *aProperties=nullptr)
initialize PLUGIN like a constructor would.
SCH_SHEET * m_rootSheet
The root sheet of the schematic being loaded.
void saveText(SCH_TEXT *aText)
void saveNoConnect(SCH_NO_CONNECT *aNoConnect)
A name/value tuple with unique names and optional values.
Define a library symbol object.
void saveSheet(SCH_SHEET *aSheet)
SCH_BUS_ENTRY_BASE * loadBusEntry(LINE_READER &aReader)
const wxString GetName() const override
Return a brief hard coded name for this SCH_PLUGIN.
const wxString & GetError() const override
Return an error string to the caller.
A cache assistant for the symbol library portion of the SCH_PLUGIN API, and only for the SCH_LEGACY_P...
void saveField(SCH_FIELD *aField)
unsigned m_lastProgressLine
static void FormatPart(LIB_SYMBOL *aSymbol, OUTPUTFORMATTER &aFormatter)
Base class for a bus or wire entry.
const wxString GetFileExtension() const override
Return the file extension for the SCH_PLUGIN.
void saveJunction(SCH_JUNCTION *aJunction)
int m_version
Version of file being loaded.
void loadFile(const wxString &aFileName, SCH_SCREEN *aScreen)
void saveSymbol(SCH_SYMBOL *aSymbol)
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.
wxString m_path
Root project path for loading child sheets.
Base class that schematic file and library loading and saving plugins should derive from.
bool isBuffering(const PROPERTIES *aProperties)
void loadHierarchy(SCH_SHEET *aSheet)
void cacheLib(const wxString &aLibraryFileName, const PROPERTIES *aProperties)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
void loadPageSettings(LINE_READER &aReader, SCH_SCREEN *aScreen)
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,...
void saveBitmap(SCH_BITMAP *aBitmap)
static const char * PropNoDocFile
The property used internally by the plugin to disable writing the library documentation (....
static LIB_SYMBOL * ParsePart(LINE_READER &aReader, int majorVersion=0, int minorVersion=0)
Object to handle a bitmap image that can be inserted in a schematic.
void SaveLibrary(const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) override
A SCH_PLUGIN derivation for loading schematic files created before the new s-expression file format.
bool CheckHeader(const wxString &aFileName) override
Return true if the first line in aFileName begins with the expected header.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void Format(SCH_SHEET *aSheet)
SCH_BITMAP * loadBitmap(LINE_READER &aReader)
void saveBusAlias(std::shared_ptr< BUS_ALIAS > aAlias)
Segment description base class to describe items which have 2 end points (track, wire,...
OUTPUTFORMATTER * m_out
The formatter for saving SCH_SCREEN objects.
LINE_READER * m_lineReader
for progress reporting
PROGRESS_REPORTER * m_progressReporter
optional; may be nullptr
void CreateSymbolLib(const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) override
Create a new empty symbol library at aLibraryPath.
unsigned m_lineCount
for progress reporting
const wxString GetLibraryFileExtension() const override
Return the library file extension for the SCH_PLUGIN object.
void SaveSymbol(const wxString &aLibraryPath, const LIB_SYMBOL *aSymbol, const PROPERTIES *aProperties=nullptr) override
Write aSymbol to an existing library located at aLibraryPath.
static const char * PropBuffering
The property used internally by the plugin to enable cache buffering which prevents the library file ...
int GetModifyHash() const override
Return the modification hash from the library cache.
SCH_NO_CONNECT * loadNoConnect(LINE_READER &aReader)
void loadHeader(LINE_READER &aReader, SCH_SCREEN *aScreen)
SCH_LINE * loadWire(LINE_READER &aReader)
SCH_TEXT * loadText(LINE_READER &aReader)
bool IsSymbolLibWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
SCH_SYMBOL * loadSymbol(LINE_READER &aReader)
void saveBusEntry(SCH_BUS_ENTRY_BASE *aBusEntry)
bool writeDocFile(const PROPERTIES *aProperties)
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.
std::shared_ptr< BUS_ALIAS > loadBusAlias(LINE_READER &aReader, SCH_SCREEN *aScreen)
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 return...
void SetProgressReporter(PROGRESS_REPORTER *aReporter) override
Set an optional progress reporter.
std::stack< wxString > m_currentPath
Stack to maintain nested sheet paths.