|
KiCad PCB EDA Suite
|
#include <cstdint>#include <vector>#include <wx/filename.h>#include <wx/string.h>Go to the source code of this file.
Functions | |
| wxString | SanitizeRemoteFileComponent (const wxString &aValue, const wxString &aDefault, bool aLower=false) |
| Replace non-alphanumeric characters (other than _ - .) with underscores. | |
| wxString | RemoteLibraryPrefix () |
| Return the configured (or default) library prefix for remote downloads, sanitized for use as a filename component. | |
| bool | WriteRemoteBinaryFile (const wxFileName &aOutput, const std::vector< uint8_t > &aPayload, wxString &aError) |
| Write binary data to a file, creating parent directories as needed. | |
| bool | EnsureRemoteDestinationRoot (wxFileName &aOutDir, wxString &aError) |
| Resolve and create the configured destination root directory for remote symbol downloads. | |
| bool | EnsureRemoteLibraryEntry (LIBRARY_TABLE_TYPE aTableType, const wxFileName &aLibraryPath, const wxString &aNickname, bool aGlobalTable, bool aStrict, wxString &aError) |
| Add or update a library table entry for a remote download library. | |
| bool | PlaceRemoteDownloadedSymbol (SCH_EDIT_FRAME *aFrame, const wxString &aNickname, const wxString &aLibItemName, wxString &aError) |
| Place a symbol from a remote download into the schematic editor. | |
| bool EnsureRemoteDestinationRoot | ( | wxFileName & | aOutDir, |
| wxString & | aError ) |
Resolve and create the configured destination root directory for remote symbol downloads.
Definition at line 108 of file remote_symbol_import_utils.cpp.
References _, REMOTE_PROVIDER_SETTINGS::DefaultDestinationDir(), REMOTE_PROVIDER_SETTINGS::destination_dir, ExpandEnvVarSubstitutions(), FN_NORMALIZE_FLAGS, GetAppSettings(), GetSettingsManager(), EESCHEMA_SETTINGS::m_RemoteSymbol, Pgm(), and Prj().
Referenced by REMOTE_SYMBOL_IMPORT_JOB::Import(), PANEL_REMOTE_SYMBOL::receive3DModel(), PANEL_REMOTE_SYMBOL::receiveFootprint(), PANEL_REMOTE_SYMBOL::receiveSPICEModel(), and PANEL_REMOTE_SYMBOL::receiveSymbol().
| bool EnsureRemoteLibraryEntry | ( | LIBRARY_TABLE_TYPE | aTableType, |
| const wxFileName & | aLibraryPath, | ||
| const wxString & | aNickname, | ||
| bool | aGlobalTable, | ||
| bool | aStrict, | ||
| wxString & | aError ) |
Add or update a library table entry for a remote download library.
When aStrict is false, a missing library table is not treated as an error.
Definition at line 146 of file remote_symbol_import_utils.cpp.
References _, PGM_BASE::GetLibraryManager(), GLOBAL, Pgm(), PROJECT, LIBRARY_TABLE_ROW::SetDescription(), LIBRARY_TABLE_ROW::SetNickname(), LIBRARY_TABLE_ROW::SetOk(), LIBRARY_TABLE_ROW::SetOptions(), LIBRARY_TABLE_ROW::SetType(), LIBRARY_TABLE_ROW::SetURI(), LIBRARY_MANAGER::Table(), table, and LIBRARY_TABLE_ROW::URI().
Referenced by REMOTE_SYMBOL_IMPORT_JOB::Import(), PANEL_REMOTE_SYMBOL::receiveFootprint(), and PANEL_REMOTE_SYMBOL::receiveSymbol().
| bool PlaceRemoteDownloadedSymbol | ( | SCH_EDIT_FRAME * | aFrame, |
| const wxString & | aNickname, | ||
| const wxString & | aLibItemName, | ||
| wxString & | aError ) |
Place a symbol from a remote download into the schematic editor.
Definition at line 205 of file remote_symbol_import_utils.cpp.
References _, AUTOPLACE_AUTO, SCH_SYMBOL::AutoplaceFields(), SCH_BASE_FRAME::eeconfig(), EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::enable, SCH_EDIT_FRAME::GetCurrentSheet(), SCH_BASE_FRAME::GetLibSymbol(), SCH_EDIT_FRAME::GetScreen(), TOOLS_HOLDER::GetToolManager(), EESCHEMA_SETTINGS::m_AutoplaceFields, SCH_ACTIONS::placeSymbol, TOOL_MANAGER::PostAction(), LIB_ID::SetLibItemName(), LIB_ID::SetLibNickname(), and EDA_ITEM::SetParent().
Referenced by REMOTE_SYMBOL_IMPORT_JOB::Import(), and PANEL_REMOTE_SYMBOL::receiveSymbol().
| wxString RemoteLibraryPrefix | ( | ) |
Return the configured (or default) library prefix for remote downloads, sanitized for use as a filename component.
Definition at line 59 of file remote_symbol_import_utils.cpp.
References REMOTE_PROVIDER_SETTINGS::DefaultLibraryPrefix(), GetAppSettings(), REMOTE_PROVIDER_SETTINGS::library_prefix, EESCHEMA_SETTINGS::m_RemoteSymbol, and SanitizeRemoteFileComponent().
Referenced by REMOTE_SYMBOL_IMPORT_JOB::Import(), PANEL_REMOTE_SYMBOL::receive3DModel(), PANEL_REMOTE_SYMBOL::receiveFootprint(), PANEL_REMOTE_SYMBOL::receiveSPICEModel(), and PANEL_REMOTE_SYMBOL::receiveSymbol().
| wxString SanitizeRemoteFileComponent | ( | const wxString & | aValue, |
| const wxString & | aDefault, | ||
| bool | aLower = false ) |
Replace non-alphanumeric characters (other than _ - .) with underscores.
Returns aDefault when aValue is empty after trimming.
Definition at line 39 of file remote_symbol_import_utils.cpp.
References result.
Referenced by PANEL_REMOTE_SYMBOL::cookieFilePath(), REMOTE_SYMBOL_IMPORT_JOB::Import(), PANEL_REMOTE_SYMBOL::receive3DModel(), PANEL_REMOTE_SYMBOL::receiveFootprint(), PANEL_REMOTE_SYMBOL::receiveSPICEModel(), PANEL_REMOTE_SYMBOL::receiveSymbol(), and RemoteLibraryPrefix().
| bool WriteRemoteBinaryFile | ( | const wxFileName & | aOutput, |
| const std::vector< uint8_t > & | aPayload, | ||
| wxString & | aError ) |
Write binary data to a file, creating parent directories as needed.
Definition at line 71 of file remote_symbol_import_utils.cpp.
References _.
Referenced by REMOTE_SYMBOL_IMPORT_JOB::Import(), PANEL_REMOTE_SYMBOL::receive3DModel(), PANEL_REMOTE_SYMBOL::receiveFootprint(), and PANEL_REMOTE_SYMBOL::receiveSPICEModel().