|
KiCad PCB EDA Suite
|
#include <panel_remote_symbol.h>
Public Member Functions | |
| PANEL_REMOTE_SYMBOL (SCH_EDIT_FRAME *aParent) | |
| void | RefreshDataSources () |
| bool | HasDataSources () const |
| void | BindWebViewLoaded () |
Private Member Functions | |
| void | onDataSourceChanged (wxCommandEvent &aEvent) |
| void | onConfigure (wxCommandEvent &aEvent) |
| void | onWebViewLoaded (wxWebViewEvent &aEvent) |
| bool | loadDataSource (size_t aIndex) |
| bool | loadDataSource (const PCM_INSTALLATION_ENTRY &aEntry) |
| std::optional< wxFileName > | findDataSourceJson (const PCM_INSTALLATION_ENTRY &aEntry) const |
| void | showMessage (const wxString &aMessage) |
| std::optional< wxString > | extractUrlFromJson (const wxString &aJsonContent) const |
| void | onKicadMessage (const wxString &aMessage) |
| void | handleRpcMessage (const nlohmann::json &aMessage) |
| void | beginSessionHandshake () |
| void | sendRpcMessage (const wxString &aCommand, nlohmann::json aParameters=nlohmann::json::object(), std::optional< int > aResponseTo=std::nullopt, const wxString &aStatus=wxS("OK"), const std::string &aData=std::string(), const wxString &aErrorCode=wxEmptyString, const wxString &aErrorMessage=wxEmptyString) |
| void | respondWithError (const wxString &aCommand, int aResponseTo, const wxString &aErrorCode, const wxString &aErrorMessage) |
| bool | ensureDestinationRoot (wxFileName &aOutDir, wxString &aError) const |
| bool | ensureSymbolLibraryEntry (const wxFileName &aLibraryFile, const wxString &aNickname, bool aGlobalTable, wxString &aError) const |
| bool | ensureFootprintLibraryEntry (const wxFileName &aLibraryDir, const wxString &aNickname, bool aGlobalTable, wxString &aError) const |
| wxString | sanitizedPrefix () const |
| bool | receiveFootprint (const nlohmann::json &aParams, const std::vector< uint8_t > &aPayload, wxString &aError) |
| bool | receiveSymbol (const nlohmann::json &aParams, const std::vector< uint8_t > &aPayload, wxString &aError) |
| bool | receive3DModel (const nlohmann::json &aParams, const std::vector< uint8_t > &aPayload, wxString &aError) |
| bool | receiveSPICEModel (const nlohmann::json &aParams, const std::vector< uint8_t > &aPayload, wxString &aError) |
| bool | placeDownloadedSymbol (const wxString &aNickname, const wxString &aLibItemName, wxString &aError) |
| wxString | sanitizeFileComponent (const wxString &aComponent, const wxString &aDefault) const |
| wxString | sanitizeForScript (const std::string &aJson) const |
| wxString | jsonString (const nlohmann::json &aObject, const char *aKey) const |
| bool | decodeBase64Payload (const std::string &aMessage, std::vector< uint8_t > &aOutPayload, wxString &aError) const |
| bool | decompressIfNeeded (const std::string &aCompression, const std::vector< uint8_t > &aInput, std::vector< uint8_t > &aOutput, wxString &aError) const |
| bool | writeBinaryFile (const wxFileName &aFile, const std::vector< uint8_t > &aData, wxString &aError) const |
| std::unique_ptr< LIB_SYMBOL > | loadSymbolFromPayload (const std::vector< uint8_t > &aPayload, const wxString &aLibItemName, wxString &aError) const |
Private Attributes | |
| SCH_EDIT_FRAME * | m_frame |
| wxChoice * | m_dataSourceChoice |
| BITMAP_BUTTON * | m_configButton |
| WEBVIEW_PANEL * | m_webView |
| std::shared_ptr< PLUGIN_CONTENT_MANAGER > | m_pcm |
| std::vector< PCM_INSTALLATION_ENTRY > | m_dataSources |
| KIID | m_sessionId |
| int | m_messageIdCounter |
| bool | m_pendingHandshake |
Definition at line 48 of file panel_remote_symbol.h.
|
explicit |
Definition at line 293 of file panel_remote_symbol.cpp.
References m_configButton, m_dataSourceChoice, m_frame, m_pcm, and m_webView.
|
private |
Definition at line 702 of file panel_remote_symbol.cpp.
References GetSemanticVersion(), m_messageIdCounter, m_sessionId, m_webView, REMOTE_SYMBOL_SESSION_VERSION, and sendRpcMessage().
Referenced by onWebViewLoaded().
| void PANEL_REMOTE_SYMBOL::BindWebViewLoaded | ( | ) |
Definition at line 346 of file panel_remote_symbol.cpp.
References m_webView, and onWebViewLoaded().
|
private |
Definition at line 79 of file panel_remote_symbol.cpp.
References _.
Referenced by handleRpcMessage().
|
private |
Definition at line 102 of file panel_remote_symbol.cpp.
References _.
Referenced by handleRpcMessage().
|
private |
Definition at line 944 of file panel_remote_symbol.cpp.
References _, EESCHEMA_SETTINGS::REMOTE_SYMBOL_CONFIG::DefaultDestinationDir(), EESCHEMA_SETTINGS::REMOTE_SYMBOL_CONFIG::destination_dir, ExpandEnvVarSubstitutions(), FN_NORMALIZE_FLAGS, GetAppSettings(), GetSettingsManager(), EESCHEMA_SETTINGS::m_RemoteSymbol, Pgm(), and Prj().
Referenced by receive3DModel(), receiveFootprint(), receiveSPICEModel(), and receiveSymbol().
|
private |
Definition at line 1042 of file panel_remote_symbol.cpp.
References _, FOOTPRINT, 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 receiveFootprint().
|
private |
Definition at line 986 of file panel_remote_symbol.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(), SYMBOL, LIBRARY_MANAGER::Table(), table, and LIBRARY_TABLE_ROW::URI().
Referenced by receiveSymbol().
|
private |
Definition at line 543 of file panel_remote_symbol.cpp.
Referenced by loadDataSource().
|
private |
Definition at line 472 of file panel_remote_symbol.cpp.
References PCM_PACKAGE::identifier, m_pcm, and PCM_INSTALLATION_ENTRY::package.
Referenced by loadDataSource().
|
private |
Definition at line 772 of file panel_remote_symbol.cpp.
References _, decodeBase64Payload(), decompressIfNeeded(), GetSemanticVersion(), jsonString(), m_sessionId, receive3DModel(), receiveFootprint(), receiveSPICEModel(), receiveSymbol(), REMOTE_SYMBOL_SESSION_VERSION, respondWithError(), and sendRpcMessage().
Referenced by onKicadMessage().
|
inline |
Definition at line 54 of file panel_remote_symbol.h.
References m_dataSources.
|
private |
Definition at line 69 of file panel_remote_symbol.cpp.
Referenced by handleRpcMessage(), receive3DModel(), receiveFootprint(), receiveSPICEModel(), and receiveSymbol().
|
private |
Definition at line 422 of file panel_remote_symbol.cpp.
References _, extractUrlFromJson(), findDataSourceJson(), PCM_PACKAGE::identifier, m_pendingHandshake, m_webView, PCM_PACKAGE::name, PCM_INSTALLATION_ENTRY::package, and showMessage().
|
private |
Definition at line 413 of file panel_remote_symbol.cpp.
References loadDataSource(), and m_dataSources.
Referenced by loadDataSource(), onDataSourceChanged(), and RefreshDataSources().
|
private |
Definition at line 217 of file panel_remote_symbol.cpp.
References _, and IO_ERROR::What().
Referenced by receiveSymbol().
|
private |
Definition at line 403 of file panel_remote_symbol.cpp.
References RefreshDataSources(), and DIALOG_SHIM::ShowModal().
|
private |
Definition at line 392 of file panel_remote_symbol.cpp.
References loadDataSource().
|
private |
Definition at line 658 of file panel_remote_symbol.cpp.
References handleRpcMessage().
|
private |
Definition at line 682 of file panel_remote_symbol.cpp.
References beginSessionHandshake(), and m_pendingHandshake.
Referenced by BindWebViewLoaded().
|
private |
Definition at line 1125 of file panel_remote_symbol.cpp.
References _, AUTOPLACE_AUTO, SCH_SYMBOL::AutoplaceFields(), m_frame, SCH_ACTIONS::placeSymbol, TOOL_MANAGER::PostAction(), LIB_ID::SetLibItemName(), LIB_ID::SetLibNickname(), and EDA_ITEM::SetParent().
Referenced by receiveSymbol().
|
private |
Definition at line 1412 of file panel_remote_symbol.cpp.
References _, ensureDestinationRoot(), jsonString(), sanitizedPrefix(), sanitizeFileComponent(), and writeBinaryFile().
Referenced by handleRpcMessage().
|
private |
Definition at line 1316 of file panel_remote_symbol.cpp.
References _, EESCHEMA_SETTINGS::REMOTE_SYMBOL_CONFIG::add_to_global_table, ensureDestinationRoot(), ensureFootprintLibraryEntry(), FOOTPRINT, GetAppSettings(), PGM_BASE::GetLibraryManager(), GLOBAL, jsonString(), EESCHEMA_SETTINGS::m_RemoteSymbol, Pgm(), PROJECT, LIBRARY_MANAGER::ReloadLibraryEntry(), sanitizedPrefix(), sanitizeFileComponent(), and writeBinaryFile().
Referenced by handleRpcMessage().
|
private |
Definition at line 1477 of file panel_remote_symbol.cpp.
References _, ensureDestinationRoot(), jsonString(), sanitizedPrefix(), sanitizeFileComponent(), and writeBinaryFile().
Referenced by handleRpcMessage().
|
private |
Definition at line 1186 of file panel_remote_symbol.cpp.
References _, EESCHEMA_SETTINGS::REMOTE_SYMBOL_CONFIG::add_to_global_table, ensureDestinationRoot(), ensureSymbolLibraryEntry(), GetAppSettings(), PGM_BASE::GetLibraryManager(), GLOBAL, jsonString(), loadSymbolFromPayload(), m_frame, EESCHEMA_SETTINGS::m_RemoteSymbol, Pgm(), placeDownloadedSymbol(), PROJECT, LIBRARY_MANAGER::ReloadLibraryEntry(), sanitizedPrefix(), sanitizeFileComponent(), SYMBOL_LIBRARY_ADAPTER::SAVE_OK, SYMBOL_LIBRARY_ADAPTER::SaveSymbol(), LIB_ID::SetLibItemName(), LIB_ID::SetLibNickname(), SYMBOL, and PROJECT_SCH::SymbolLibAdapter().
Referenced by handleRpcMessage().
| void PANEL_REMOTE_SYMBOL::RefreshDataSources | ( | ) |
Definition at line 355 of file panel_remote_symbol.cpp.
References _, GetAppSettings(), loadDataSource(), m_dataSourceChoice, m_dataSources, m_pcm, PT_DATASOURCE, and showMessage().
Referenced by onConfigure().
|
private |
Definition at line 763 of file panel_remote_symbol.cpp.
References sendRpcMessage().
Referenced by handleRpcMessage().
|
private |
Definition at line 1098 of file panel_remote_symbol.cpp.
References EESCHEMA_SETTINGS::REMOTE_SYMBOL_CONFIG::DefaultLibraryPrefix(), and GetAppSettings().
Referenced by receive3DModel(), receiveFootprint(), receiveSPICEModel(), and receiveSymbol().
|
private |
Definition at line 156 of file panel_remote_symbol.cpp.
References result.
Referenced by receive3DModel(), receiveFootprint(), receiveSPICEModel(), and receiveSymbol().
|
private |
Definition at line 148 of file panel_remote_symbol.cpp.
Referenced by sendRpcMessage().
|
private |
Definition at line 720 of file panel_remote_symbol.cpp.
References m_messageIdCounter, m_sessionId, m_webView, REMOTE_SYMBOL_SESSION_VERSION, and sanitizeForScript().
Referenced by beginSessionHandshake(), handleRpcMessage(), and respondWithError().
|
private |
Definition at line 518 of file panel_remote_symbol.cpp.
References m_webView.
Referenced by loadDataSource(), and RefreshDataSources().
|
private |
Definition at line 176 of file panel_remote_symbol.cpp.
References _.
Referenced by receive3DModel(), receiveFootprint(), and receiveSPICEModel().
|
private |
Definition at line 125 of file panel_remote_symbol.h.
Referenced by PANEL_REMOTE_SYMBOL().
|
private |
Definition at line 124 of file panel_remote_symbol.h.
Referenced by PANEL_REMOTE_SYMBOL(), and RefreshDataSources().
|
private |
Definition at line 128 of file panel_remote_symbol.h.
Referenced by HasDataSources(), loadDataSource(), and RefreshDataSources().
|
private |
Definition at line 123 of file panel_remote_symbol.h.
Referenced by PANEL_REMOTE_SYMBOL(), placeDownloadedSymbol(), and receiveSymbol().
|
private |
Definition at line 130 of file panel_remote_symbol.h.
Referenced by beginSessionHandshake(), and sendRpcMessage().
|
private |
Definition at line 127 of file panel_remote_symbol.h.
Referenced by findDataSourceJson(), PANEL_REMOTE_SYMBOL(), and RefreshDataSources().
|
private |
Definition at line 131 of file panel_remote_symbol.h.
Referenced by loadDataSource(), and onWebViewLoaded().
|
private |
Definition at line 129 of file panel_remote_symbol.h.
Referenced by beginSessionHandshake(), handleRpcMessage(), and sendRpcMessage().
|
private |
Definition at line 126 of file panel_remote_symbol.h.
Referenced by beginSessionHandshake(), BindWebViewLoaded(), loadDataSource(), PANEL_REMOTE_SYMBOL(), sendRpcMessage(), and showMessage().