KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_HTTP_LIB_PLUGIN Class Reference

A KiCad HTTP library provides both symbol and footprint metadata, so there are "shim" plugins on both the symbol and footprint side of things that expose the database contents to the schematic and board editors. More...

#include <sch_http_lib_plugin.h>

Inheritance diagram for SCH_HTTP_LIB_PLUGIN:
SCH_PLUGIN

Public Member Functions

 SCH_HTTP_LIB_PLUGIN ()
 
virtual ~SCH_HTTP_LIB_PLUGIN ()
 
const wxString GetName () const override
 Return a brief hard coded name for this SCH_PLUGIN. More...
 
const PLUGIN_FILE_DESC GetLibraryFileDesc () const override
 Returns symbol library description for the SCH_PLUGIN. More...
 
int GetModifyHash () const override
 Return the modification hash from the library cache. More...
 
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_SYMBOLLoadSymbol (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...
 
bool SupportsSubLibraries () const override
 
void GetSubLibraryNames (std::vector< wxString > &aNames) override
 Retrieves a list of sub-libraries in this library. More...
 
void GetAvailableSymbolFields (std::vector< wxString > &aNames) override
 Retrieves a list of (custom) field names that are present on symbols in this library. More...
 
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. More...
 
bool IsSymbolLibWritable (const wxString &aLibraryPath) override
 Return true if the library at aLibraryPath is writable. More...
 
void SetLibTable (SYMBOL_LIB_TABLE *aTable) override
 Some library plugins need to have access to their parent library table. More...
 
HTTP_LIB_SETTINGSSettings () const
 
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...
 
virtual void SetReporter (REPORTER *aReporter)
 Set an optional reporter for warnings/errors. More...
 
virtual void SetProgressReporter (PROGRESS_REPORTER *aReporter)
 Set an optional progress reporter. More...
 
virtual const PLUGIN_FILE_DESC GetSchematicFileDesc () const
 Returns schematic file description for the SCH_PLUGIN. More...
 
virtual bool CanReadSchematicFile (const wxString &aFileName) const
 Checks if this SCH_PLUGIN can read the specified schematic file. More...
 
virtual bool CanReadLibrary (const wxString &aFileName) const
 Checks if this SCH_PLUGIN can read the specified symbol library file. More...
 
virtual void SaveLibrary (const wxString &aFileName, const STRING_UTF8_MAP *aProperties=nullptr)
 
virtual SCH_SHEETLoadSchematicFile (const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const STRING_UTF8_MAP *aProperties=nullptr)
 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...
 
virtual void SaveSchematicFile (const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const STRING_UTF8_MAP *aProperties=nullptr)
 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...
 
virtual void DeleteSymbol (const wxString &aLibraryPath, const wxString &aSymbolName, const STRING_UTF8_MAP *aProperties=nullptr)
 Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath. More...
 
virtual void CreateSymbolLib (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr)
 Create a new empty symbol library at aLibraryPath. More...
 
virtual bool DeleteSymbolLib (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr)
 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...
 
virtual void SymbolLibOptions (STRING_UTF8_MAP *aListToAppendTo) const
 Append supported SCH_PLUGIN options to aListToAppenTo along with internationalized descriptions. More...
 
virtual const wxString & GetError () const
 Return an error string to the caller. More...
 

Private Member Functions

void ensureSettings (const wxString &aSettingsPath)
 
void ensureConnection ()
 
void connect ()
 
LIB_SYMBOLloadSymbolFromPart (const wxString &aSymbolName, const HTTP_LIB_CATEGORY &aCategory, const HTTP_LIB_PART &aPart)
 

Private Attributes

SYMBOL_LIB_TABLEm_libTable
 
std::map< std::string, std::vector< HTTP_LIB_PART > > m_cachedParts
 
std::unique_ptr< HTTP_LIB_CONNECTIONm_conn
 Generally will be null if no valid connection is established. More...
 
std::unique_ptr< HTTP_LIB_SETTINGSm_settings
 
std::set< wxString > m_customFields
 
std::set< wxString > m_defaultShownFields
 
wxString m_lastError
 
wxString symbol_field = "symbol"
 
wxString footprint_field = "footprint"
 
wxString description_field = "description"
 
wxString keywords_field = "keywords"
 
wxString value_field = "value"
 
wxString datasheet_field = "datasheet"
 
wxString reference_field = "reference"
 

Detailed Description

A KiCad HTTP library provides both symbol and footprint metadata, so there are "shim" plugins on both the symbol and footprint side of things that expose the database contents to the schematic and board editors.

The architecture of these is slightly different from the other plugins because the backing file is just a configuration file rather than something that contains symbol or footprint data.

Definition at line 37 of file sch_http_lib_plugin.h.

Constructor & Destructor Documentation

◆ SCH_HTTP_LIB_PLUGIN()

SCH_HTTP_LIB_PLUGIN::SCH_HTTP_LIB_PLUGIN ( )

Definition at line 31 of file sch_http_lib_plugin.cpp.

◆ ~SCH_HTTP_LIB_PLUGIN()

SCH_HTTP_LIB_PLUGIN::~SCH_HTTP_LIB_PLUGIN ( )
virtual

Definition at line 37 of file sch_http_lib_plugin.cpp.

Member Function Documentation

◆ CanReadLibrary()

bool SCH_PLUGIN::CanReadLibrary ( const wxString &  aFileName) const
virtualinherited

◆ CanReadSchematicFile()

bool SCH_PLUGIN::CanReadSchematicFile ( const wxString &  aFileName) const
virtualinherited

◆ connect()

void SCH_HTTP_LIB_PLUGIN::connect ( )
private

Definition at line 314 of file sch_http_lib_plugin.cpp.

References m_conn, m_lastError, and m_settings.

Referenced by ensureConnection().

◆ CreateSymbolLib()

void SCH_PLUGIN::CreateSymbolLib ( const wxString &  aLibraryPath,
const STRING_UTF8_MAP aProperties = nullptr 
)
virtualinherited

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.

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several footprints.
aPropertiesis 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.
Exceptions
IO_ERRORif there is a problem finding the library, or creating it.

Reimplemented in SCH_SEXPR_PLUGIN, and SCH_LEGACY_PLUGIN.

Definition at line 181 of file sch_plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by SYMBOL_LIB_TABLE::CreateSymbolLib(), SYMBOL_EDIT_FRAME::ExportSymbol(), SCH_ALTIUM_PLUGIN::LoadSchematicFile(), CADSTAR_SCH_ARCHIVE_PLUGIN::LoadSchematicFile(), SCH_EAGLE_PLUGIN::LoadSchematicFile(), and SCH_EASYEDAPRO_PLUGIN::LoadSchematicFile().

◆ DeleteSymbol()

void SCH_PLUGIN::DeleteSymbol ( const wxString &  aLibraryPath,
const wxString &  aSymbolName,
const STRING_UTF8_MAP aProperties = nullptr 
)
virtualinherited

Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath.

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several symbols.
aSymbolNameis the name of a LIB_SYMBOL associated with it's root LIB_SYMBOL object to delete from the specified library.
aPropertiesis 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.
Exceptions
IO_ERRORif there is a problem finding the alias or the library or deleting it.

Reimplemented in SCH_SEXPR_PLUGIN, and SCH_LEGACY_PLUGIN.

Definition at line 173 of file sch_plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by SYMBOL_LIB_TABLE::DeleteSymbol(), and LIB_BUFFER::SaveBuffer().

◆ DeleteSymbolLib()

bool SCH_PLUGIN::DeleteSymbolLib ( const wxString &  aLibraryPath,
const STRING_UTF8_MAP aProperties = nullptr 
)
virtualinherited

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.

Parameters
aLibraryPathis a locator for the "library", usually a directory or file which will contain symbols.
aPropertiesis 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.
Returns
true if library deleted or false if library did not exist.
Exceptions
IO_ERRORif there is a problem deleting an existing library.

Reimplemented in SCH_SEXPR_PLUGIN, and SCH_LEGACY_PLUGIN.

Definition at line 188 of file sch_plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by SYMBOL_LIB_TABLE::DeleteSymbolLib().

◆ ensureConnection()

void SCH_HTTP_LIB_PLUGIN::ensureConnection ( )
private

Definition at line 297 of file sch_http_lib_plugin.cpp.

References _, connect(), m_conn, m_lastError, m_settings, and THROW_IO_ERROR.

Referenced by EnumerateSymbolLib(), and LoadSymbol().

◆ ensureSettings()

void SCH_HTTP_LIB_PLUGIN::ensureSettings ( const wxString &  aSettingsPath)
private

Definition at line 211 of file sch_http_lib_plugin.cpp.

References _, m_settings, path, THROW_IO_ERROR, and traceHTTPLib.

Referenced by EnumerateSymbolLib(), GetSubLibraryNames(), and LoadSymbol().

◆ EnumerateSymbolLib() [1/2]

void SCH_HTTP_LIB_PLUGIN::EnumerateSymbolLib ( std::vector< LIB_SYMBOL * > &  aSymbolList,
const wxString &  aLibraryPath,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtual

Populate a list of LIB_SYMBOL aliases contained within the library aLibraryPath.

Note
It is the responsibility of the caller to delete the returned object from the heap. Failure to do this will result in memory leaks.
Parameters
aSymbolListis an array to populate with the LIB_SYMBOL pointers associated with the library.
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing one or more LIB_SYMBOL objects.
aPropertiesis 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.
Exceptions
IO_ERRORif the library cannot be found, the part library cannot be loaded.

Reimplemented from SCH_PLUGIN.

Definition at line 54 of file sch_http_lib_plugin.cpp.

References _, ensureConnection(), ensureSettings(), LIB_SYMBOL::IsPower(), loadSymbolFromPart(), m_cachedParts, m_conn, m_lastError, m_libTable, SYMBOL_LIB_TABLE::PropPowerSymsOnly, and THROW_IO_ERROR.

◆ EnumerateSymbolLib() [2/2]

void SCH_HTTP_LIB_PLUGIN::EnumerateSymbolLib ( wxArrayString &  aSymbolNameList,
const wxString &  aLibraryPath,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtual

Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.

Parameters
aSymbolNameListis an array to populate with the LIB_SYMBOL names associated with the library.
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing one or more LIB_SYMBOL objects.
aPropertiesis 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.
Exceptions
IO_ERRORif the library cannot be found, the part library cannot be loaded.

Reimplemented from SCH_PLUGIN.

Definition at line 42 of file sch_http_lib_plugin.cpp.

References EnumerateSymbolLib().

Referenced by EnumerateSymbolLib().

◆ GetAvailableSymbolFields()

void SCH_HTTP_LIB_PLUGIN::GetAvailableSymbolFields ( std::vector< wxString > &  aNames)
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.

Parameters
aNameswill be filled with any custom fields present in this library.

Reimplemented from SCH_PLUGIN.

Definition at line 197 of file sch_http_lib_plugin.cpp.

References m_customFields.

◆ GetDefaultSymbolFields()

void SCH_HTTP_LIB_PLUGIN::GetDefaultSymbolFields ( std::vector< wxString > &  aNames)
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.

Parameters
aNameswill be filled with the custom field names that should be shown by default

Reimplemented from SCH_PLUGIN.

Definition at line 204 of file sch_http_lib_plugin.cpp.

References m_defaultShownFields.

◆ GetError()

const wxString & SCH_PLUGIN::GetError ( ) const
virtualinherited

Return an error string to the caller.

This is useful for schematic loaders that can load partial schematics where throwing an exception would be problematic such as the KiCad legacy plugin.

Returns
an unformatted string containing errors if any.

Reimplemented in SCH_SEXPR_PLUGIN, and SCH_LEGACY_PLUGIN.

Definition at line 214 of file sch_plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by KI_TEST::SCHEMATIC_TEST_FIXTURE::LoadSchematic(), SCH_EDIT_FRAME::LoadSheetFromFile(), and SCH_EDIT_FRAME::OpenProjectFiles().

◆ GetLibraryFileDesc()

const PLUGIN_FILE_DESC SCH_HTTP_LIB_PLUGIN::GetLibraryFileDesc ( ) const
inlineoverridevirtual

Returns symbol library description for the SCH_PLUGIN.

Reimplemented from SCH_PLUGIN.

Definition at line 49 of file sch_http_lib_plugin.h.

References _HKI, and HTTPLibraryFileExtension.

◆ GetModifyHash()

int SCH_HTTP_LIB_PLUGIN::GetModifyHash ( ) const
inlineoverridevirtual

Return the modification hash from the library cache.

Note
This is temporary until the new s-expr file format is implement. The new file format will embed symbols instead of referencing them from the library. This function can be removed when the new file format is implemented.
Returns
the modification hash of the library cache.

Implements SCH_PLUGIN.

Definition at line 55 of file sch_http_lib_plugin.h.

◆ GetName()

const wxString SCH_HTTP_LIB_PLUGIN::GetName ( ) const
inlineoverridevirtual

Return a brief hard coded name for this SCH_PLUGIN.

Implements SCH_PLUGIN.

Definition at line 44 of file sch_http_lib_plugin.h.

◆ GetSchematicFileDesc()

const PLUGIN_FILE_DESC SCH_PLUGIN::GetSchematicFileDesc ( ) const
virtualinherited

◆ GetSubLibraryNames()

void SCH_HTTP_LIB_PLUGIN::GetSubLibraryNames ( std::vector< wxString > &  aNames)
overridevirtual

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.

Parameters
aNameswill be filled with a list of sub-libraries within this symbol library

Reimplemented from SCH_PLUGIN.

Definition at line 178 of file sch_http_lib_plugin.cpp.

References ensureSettings(), and m_conn.

◆ IsSymbolLibWritable()

bool SCH_HTTP_LIB_PLUGIN::IsSymbolLibWritable ( const wxString &  aLibraryPath)
inlineoverridevirtual

Return true if the library at aLibraryPath is writable.

(Often system libraries are read only because of where they are installed.)

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several symbols.
Exceptions
IO_ERRORif no library at aLibraryPath exists.

Reimplemented from SCH_PLUGIN.

Definition at line 76 of file sch_http_lib_plugin.h.

◆ LoadSchematicFile()

SCH_SHEET * SCH_PLUGIN::LoadSchematicFile ( const wxString &  aFileName,
SCHEMATIC aSchematic,
SCH_SHEET aAppendToMe = nullptr,
const STRING_UTF8_MAP aProperties = nullptr 
)
virtualinherited

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.

Parameters
aFileNameis the name of the file to use as input and may be foreign in nature or native in nature.
aKiwayis the KIWAY object used to access the symbol libraries loaded by the project.
aAppendToMeis an existing SCH_SHEET to append to, but if NULL then this means "do not append, rather load anew".
aPropertiesis 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.
Returns
the successfully loaded schematic, or the same one as aAppendToMe if aAppendToMe was not NULL, and the caller owns it.
Exceptions
IO_ERRORif 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 in SCH_ALTIUM_PLUGIN, CADSTAR_SCH_ARCHIVE_PLUGIN, SCH_EAGLE_PLUGIN, SCH_EASYEDA_PLUGIN, SCH_EASYEDAPRO_PLUGIN, SCH_SEXPR_PLUGIN, SCH_LEGACY_PLUGIN, and SCH_LTSPICE_PLUGIN.

Definition at line 124 of file sch_plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by SCH_EDIT_FRAME::importFile(), KI_TEST::SCHEMATIC_TEST_FIXTURE::LoadSchematic(), EESCHEMA_HELPERS::LoadSchematic(), SCH_EDIT_FRAME::LoadSheetFromFile(), and SCH_EDIT_FRAME::OpenProjectFiles().

◆ LoadSymbol()

LIB_SYMBOL * SCH_HTTP_LIB_PLUGIN::LoadSymbol ( const wxString &  aLibraryPath,
const wxString &  aPartName,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtual

Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this SCH_PLUGIN knows about.

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several symbols.
aPartNameis the name of the LIB_SYMBOL to load.
aPropertiesis 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.
Returns
the part created on the heap if found caller shares it or NULL if not found.
Exceptions
IO_ERRORif 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 108 of file sch_http_lib_plugin.cpp.

References ensureConnection(), ensureSettings(), HTTP_LIB_CATEGORY::id, loadSymbolFromPart(), m_cachedParts, m_conn, m_lastError, m_libTable, HTTP_LIB_CATEGORY::name, THROW_IO_ERROR, and traceHTTPLib.

◆ loadSymbolFromPart()

◆ SaveLibrary()

◆ SaveSchematicFile()

void SCH_PLUGIN::SaveSchematicFile ( const wxString &  aFileName,
SCH_SHEET aSheet,
SCHEMATIC aSchematic,
const STRING_UTF8_MAP aProperties = nullptr 
)
virtualinherited

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.

Parameters
aFileNameis the name of a file to save to on disk.
aSheetis 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.
aSchematicis the SCHEMATIC object used to access any schematic-wide or project information needed to save the document.
aPropertiesis 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.
Exceptions
IO_ERRORif there is a problem saving or exporting.

Reimplemented in SCH_LEGACY_PLUGIN, and SCH_SEXPR_PLUGIN.

Definition at line 131 of file sch_plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), and SCH_EDIT_FRAME::saveSchematicFile().

◆ SaveSymbol()

void SCH_HTTP_LIB_PLUGIN::SaveSymbol ( const wxString &  aLibraryPath,
const LIB_SYMBOL aSymbol,
const STRING_UTF8_MAP aProperties = nullptr 
)
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.

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several symbols.
aSymbolis what to store in the library. The library is refreshed and the caller must update any LIB_SYMBOL pointers that may have changed.
aPropertiesis 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.
Exceptions
IO_ERRORif there is a problem saving.

Reimplemented from SCH_PLUGIN.

Definition at line 447 of file sch_http_lib_plugin.cpp.

◆ SetLibTable()

void SCH_HTTP_LIB_PLUGIN::SetLibTable ( SYMBOL_LIB_TABLE aTable)
inlineoverridevirtual

Some library plugins need to have access to their parent library table.

Parameters
aTableis the table this plugin is registered within.

Reimplemented from SCH_PLUGIN.

Definition at line 82 of file sch_http_lib_plugin.h.

References m_libTable.

◆ SetProgressReporter()

virtual void SCH_PLUGIN::SetProgressReporter ( PROGRESS_REPORTER aReporter)
inlinevirtualinherited

◆ SetReporter()

virtual void SCH_PLUGIN::SetReporter ( REPORTER aReporter)
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().

◆ Settings()

HTTP_LIB_SETTINGS * SCH_HTTP_LIB_PLUGIN::Settings ( ) const
inline

Definition at line 88 of file sch_http_lib_plugin.h.

References m_settings.

◆ SupportsSubLibraries()

bool SCH_HTTP_LIB_PLUGIN::SupportsSubLibraries ( ) const
inlineoverridevirtual
Returns
true if this plugin supports libraries that contain sub-libraries.

Reimplemented from SCH_PLUGIN.

Definition at line 68 of file sch_http_lib_plugin.h.

◆ SymbolLibOptions()

void SCH_PLUGIN::SymbolLibOptions ( STRING_UTF8_MAP aListToAppendTo) const
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.

Parameters
aListToAppendToholds a tuple of
option
This eventually is what shows up into the fp-lib-table "options" field, possibly combined with others.
internationalized description
The internationalized description is displayed in DIALOG_PLUGIN_OPTIONS. It may be multi-line and be quite explanatory of the option.

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 202 of file sch_plugin.cpp.

Referenced by SYMBOL_GRID_TRICKS::optionsEditor().

Member Data Documentation

◆ datasheet_field

wxString SCH_HTTP_LIB_PLUGIN::datasheet_field = "datasheet"
private

Definition at line 125 of file sch_http_lib_plugin.h.

Referenced by loadSymbolFromPart().

◆ description_field

wxString SCH_HTTP_LIB_PLUGIN::description_field = "description"
private

Definition at line 122 of file sch_http_lib_plugin.h.

Referenced by loadSymbolFromPart().

◆ footprint_field

wxString SCH_HTTP_LIB_PLUGIN::footprint_field = "footprint"
private

Definition at line 121 of file sch_http_lib_plugin.h.

Referenced by loadSymbolFromPart().

◆ keywords_field

wxString SCH_HTTP_LIB_PLUGIN::keywords_field = "keywords"
private

Definition at line 123 of file sch_http_lib_plugin.h.

Referenced by loadSymbolFromPart().

◆ m_cachedParts

std::map<std::string, std::vector<HTTP_LIB_PART> > SCH_HTTP_LIB_PLUGIN::m_cachedParts
private

Definition at line 107 of file sch_http_lib_plugin.h.

Referenced by EnumerateSymbolLib(), and LoadSymbol().

◆ m_conn

std::unique_ptr<HTTP_LIB_CONNECTION> SCH_HTTP_LIB_PLUGIN::m_conn
private

Generally will be null if no valid connection is established.

Definition at line 110 of file sch_http_lib_plugin.h.

Referenced by connect(), ensureConnection(), EnumerateSymbolLib(), GetSubLibraryNames(), and LoadSymbol().

◆ m_customFields

std::set<wxString> SCH_HTTP_LIB_PLUGIN::m_customFields
private

Definition at line 114 of file sch_http_lib_plugin.h.

Referenced by GetAvailableSymbolFields(), and loadSymbolFromPart().

◆ m_defaultShownFields

std::set<wxString> SCH_HTTP_LIB_PLUGIN::m_defaultShownFields
private

Definition at line 116 of file sch_http_lib_plugin.h.

Referenced by GetDefaultSymbolFields().

◆ m_lastError

wxString SCH_HTTP_LIB_PLUGIN::m_lastError
private

Definition at line 118 of file sch_http_lib_plugin.h.

Referenced by connect(), ensureConnection(), EnumerateSymbolLib(), and LoadSymbol().

◆ m_libTable

SYMBOL_LIB_TABLE* SCH_HTTP_LIB_PLUGIN::m_libTable
private

◆ m_settings

std::unique_ptr<HTTP_LIB_SETTINGS> SCH_HTTP_LIB_PLUGIN::m_settings
private

Definition at line 112 of file sch_http_lib_plugin.h.

Referenced by connect(), ensureConnection(), ensureSettings(), and Settings().

◆ reference_field

wxString SCH_HTTP_LIB_PLUGIN::reference_field = "reference"
private

Definition at line 126 of file sch_http_lib_plugin.h.

Referenced by loadSymbolFromPart().

◆ symbol_field

wxString SCH_HTTP_LIB_PLUGIN::symbol_field = "symbol"
private

Definition at line 120 of file sch_http_lib_plugin.h.

◆ value_field

wxString SCH_HTTP_LIB_PLUGIN::value_field = "value"
private

Definition at line 124 of file sch_http_lib_plugin.h.

Referenced by loadSymbolFromPart().


The documentation for this class was generated from the following files: