|
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 | onRefresh (wxCommandEvent &aEvent) |
| void | onWebViewLoaded (wxWebViewEvent &aEvent) |
| void | onRemoteLoginResult (wxCommandEvent &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 | handleRemoteLogin (const nlohmann::json &aParams, int aMessageId) |
| void | stopLoginServer () |
| void | storeUserIdForActiveSource (const wxString &aUserId) |
| void | loadStoredUserIdForActiveSource () |
| wxString | currentDataSourceKey () const |
| 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 | receiveComponent (const nlohmann::json &aParams, const std::vector< uint8_t > &aPayload, wxString &aError, nlohmann::json *aResponseParams=nullptr) |
| 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 |
| wxString | normalizeDataSourceUrl (const wxString &aUrl) 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 |
| BITMAP_BUTTON * | m_refreshButton |
| 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 |
| std::unique_ptr< REMOTE_LOGIN_SERVER > | m_loginServer |
| wxString | m_activeDataSourceUrl |
| wxString | m_activeUserId |
| bool | m_webViewLoadedBound |
Definition at line 50 of file panel_remote_symbol.h.
|
explicit |
Definition at line 475 of file panel_remote_symbol.cpp.
References m_configButton, m_dataSourceChoice, m_frame, m_pcm, m_refreshButton, and m_webView.
|
private |
Definition at line 902 of file panel_remote_symbol.cpp.
References GetSemanticVersion(), m_messageIdCounter, m_sessionId, m_webView, REMOTE_SYMBOL_SESSION_VERSION, and sendRpcMessage().
Referenced by handleRpcMessage(), and onWebViewLoaded().
| void PANEL_REMOTE_SYMBOL::BindWebViewLoaded | ( | ) |
Definition at line 536 of file panel_remote_symbol.cpp.
References m_webView, m_webViewLoadedBound, and onWebViewLoaded().
|
private |
Definition at line 297 of file panel_remote_symbol.cpp.
References m_activeDataSourceUrl.
|
private |
Definition at line 212 of file panel_remote_symbol.cpp.
References _.
Referenced by handleRpcMessage(), and receiveComponent().
|
private |
Definition at line 235 of file panel_remote_symbol.cpp.
References _.
Referenced by handleRpcMessage(), and receiveComponent().
|
private |
Definition at line 1248 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(), receiveComponent(), receiveFootprint(), receiveSPICEModel(), and receiveSymbol().
|
private |
Definition at line 1346 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 receiveComponent(), and receiveFootprint().
|
private |
Definition at line 1290 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 receiveComponent(), and receiveSymbol().
|
private |
Definition at line 743 of file panel_remote_symbol.cpp.
Referenced by loadDataSource().
|
private |
Definition at line 682 of file panel_remote_symbol.cpp.
References PCM_PACKAGE::identifier, m_pcm, and PCM_INSTALLATION_ENTRY::package.
Referenced by loadDataSource().
|
private |
Definition at line 925 of file panel_remote_symbol.cpp.
References _, jsonString(), m_loginServer, respondWithError(), sendRpcMessage(), and stopLoginServer().
Referenced by handleRpcMessage().
|
private |
Definition at line 1052 of file panel_remote_symbol.cpp.
References _, beginSessionHandshake(), decodeBase64Payload(), decompressIfNeeded(), GetAppSettings(), GetSemanticVersion(), PGM_BASE::GetSettingsManager(), handleRemoteLogin(), jsonString(), m_activeDataSourceUrl, m_activeUserId, m_sessionId, Pgm(), receive3DModel(), receiveComponent(), receiveFootprint(), receiveSPICEModel(), receiveSymbol(), REMOTE_SYMBOL_SESSION_VERSION, respondWithError(), SETTINGS_MANAGER::Save(), and sendRpcMessage().
Referenced by onKicadMessage().
| bool PANEL_REMOTE_SYMBOL::HasDataSources | ( | ) | const |
Definition at line 624 of file panel_remote_symbol.cpp.
References m_dataSources.
|
private |
Definition at line 202 of file panel_remote_symbol.cpp.
Referenced by handleRemoteLogin(), handleRpcMessage(), receive3DModel(), receiveFootprint(), receiveSPICEModel(), and receiveSymbol().
|
private |
Definition at line 630 of file panel_remote_symbol.cpp.
References _, extractUrlFromJson(), findDataSourceJson(), PCM_PACKAGE::identifier, loadStoredUserIdForActiveSource(), m_activeDataSourceUrl, m_pendingHandshake, m_webView, PCM_PACKAGE::name, normalizeDataSourceUrl(), PCM_INSTALLATION_ENTRY::package, showMessage(), and stopLoginServer().
|
private |
Definition at line 615 of file panel_remote_symbol.cpp.
References loadDataSource(), and m_dataSources.
Referenced by loadDataSource(), onDataSourceChanged(), and RefreshDataSources().
|
private |
Definition at line 302 of file panel_remote_symbol.cpp.
References GetAppSettings(), m_activeDataSourceUrl, and m_activeUserId.
Referenced by loadDataSource().
|
private |
Definition at line 396 of file panel_remote_symbol.cpp.
References _, and IO_ERROR::What().
Referenced by receiveComponent(), and receiveSymbol().
|
private |
Definition at line 286 of file panel_remote_symbol.cpp.
Referenced by loadDataSource().
|
private |
Definition at line 598 of file panel_remote_symbol.cpp.
References RefreshDataSources(), and DIALOG_SHIM::ShowModal().
|
private |
Definition at line 587 of file panel_remote_symbol.cpp.
References loadDataSource().
|
private |
Definition at line 858 of file panel_remote_symbol.cpp.
References handleRpcMessage().
|
private |
Definition at line 608 of file panel_remote_symbol.cpp.
References m_webView.
|
private |
Definition at line 976 of file panel_remote_symbol.cpp.
References m_activeDataSourceUrl, m_webView, stopLoginServer(), and storeUserIdForActiveSource().
|
private |
Definition at line 882 of file panel_remote_symbol.cpp.
References beginSessionHandshake(), and m_pendingHandshake.
Referenced by BindWebViewLoaded().
|
private |
Definition at line 1429 of file panel_remote_symbol.cpp.
References _, AUTOPLACE_AUTO, SCH_SYMBOL::AutoplaceFields(), SYMBOL_LIBRARY_ADAPTER::LoadSymbol(), m_frame, SCH_ACTIONS::placeSymbol, TOOL_MANAGER::PostAction(), LIB_ID::SetLibItemName(), LIB_ID::SetLibNickname(), EDA_ITEM::SetParent(), and PROJECT_SCH::SymbolLibAdapter().
Referenced by receiveSymbol().
|
private |
Definition at line 1751 of file panel_remote_symbol.cpp.
References _, ensureDestinationRoot(), jsonString(), sanitizedPrefix(), sanitizeFileComponent(), and writeBinaryFile().
Referenced by handleRpcMessage().
|
private |
Definition at line 1875 of file panel_remote_symbol.cpp.
References _, EESCHEMA_SETTINGS::REMOTE_SYMBOL_CONFIG::add_to_global_table, decodeBase64Payload(), decompressIfNeeded(), empty(), ensureDestinationRoot(), ensureFootprintLibraryEntry(), ensureSymbolLibraryEntry(), GetAppSettings(), loadSymbolFromPayload(), EESCHEMA_SETTINGS::m_RemoteSymbol, name, sanitizedPrefix(), sanitizeFileComponent(), IO_ERROR::What(), and writeBinaryFile().
Referenced by handleRpcMessage().
|
private |
Definition at line 1661 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 1816 of file panel_remote_symbol.cpp.
References _, ensureDestinationRoot(), jsonString(), sanitizedPrefix(), sanitizeFileComponent(), and writeBinaryFile().
Referenced by handleRpcMessage().
|
private |
Definition at line 1506 of file panel_remote_symbol.cpp.
References _, EESCHEMA_SETTINGS::REMOTE_SYMBOL_CONFIG::add_to_global_table, ensureDestinationRoot(), ensureSymbolLibraryEntry(), GetAppSettings(), PGM_BASE::GetLibraryManager(), GLOBAL, jsonString(), SYMBOL_LIBRARY_ADAPTER::LoadOne(), 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 550 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 1043 of file panel_remote_symbol.cpp.
References sendRpcMessage().
Referenced by handleRemoteLogin(), and handleRpcMessage().
|
private |
Definition at line 1402 of file panel_remote_symbol.cpp.
References EESCHEMA_SETTINGS::REMOTE_SYMBOL_CONFIG::DefaultLibraryPrefix(), and GetAppSettings().
Referenced by receive3DModel(), receiveComponent(), receiveFootprint(), receiveSPICEModel(), and receiveSymbol().
|
private |
Definition at line 335 of file panel_remote_symbol.cpp.
References result.
Referenced by receive3DModel(), receiveComponent(), receiveFootprint(), receiveSPICEModel(), and receiveSymbol().
|
private |
Definition at line 278 of file panel_remote_symbol.cpp.
Referenced by sendRpcMessage().
|
private |
Definition at line 998 of file panel_remote_symbol.cpp.
References m_activeUserId, m_messageIdCounter, m_sessionId, m_webView, REMOTE_SYMBOL_SESSION_VERSION, and sanitizeForScript().
Referenced by beginSessionHandshake(), handleRemoteLogin(), handleRpcMessage(), and respondWithError().
|
private |
Definition at line 728 of file panel_remote_symbol.cpp.
References m_webView.
Referenced by loadDataSource(), and RefreshDataSources().
|
private |
Definition at line 919 of file panel_remote_symbol.cpp.
References m_loginServer.
Referenced by handleRemoteLogin(), loadDataSource(), and onRemoteLoginResult().
|
private |
Definition at line 318 of file panel_remote_symbol.cpp.
References GetAppSettings(), PGM_BASE::GetSettingsManager(), m_activeDataSourceUrl, m_activeUserId, Pgm(), and SETTINGS_MANAGER::Save().
Referenced by onRemoteLoginResult().
|
private |
Definition at line 355 of file panel_remote_symbol.cpp.
References _.
Referenced by receive3DModel(), receiveComponent(), receiveFootprint(), and receiveSPICEModel().
|
private |
Definition at line 146 of file panel_remote_symbol.h.
Referenced by currentDataSourceKey(), handleRpcMessage(), loadDataSource(), loadStoredUserIdForActiveSource(), onRemoteLoginResult(), and storeUserIdForActiveSource().
|
private |
Definition at line 147 of file panel_remote_symbol.h.
Referenced by handleRpcMessage(), loadStoredUserIdForActiveSource(), sendRpcMessage(), and storeUserIdForActiveSource().
|
private |
Definition at line 137 of file panel_remote_symbol.h.
Referenced by PANEL_REMOTE_SYMBOL().
|
private |
Definition at line 136 of file panel_remote_symbol.h.
Referenced by PANEL_REMOTE_SYMBOL(), and RefreshDataSources().
|
private |
Definition at line 141 of file panel_remote_symbol.h.
Referenced by HasDataSources(), loadDataSource(), and RefreshDataSources().
|
private |
Definition at line 135 of file panel_remote_symbol.h.
Referenced by PANEL_REMOTE_SYMBOL(), placeDownloadedSymbol(), and receiveSymbol().
|
private |
Definition at line 145 of file panel_remote_symbol.h.
Referenced by handleRemoteLogin(), and stopLoginServer().
|
private |
Definition at line 143 of file panel_remote_symbol.h.
Referenced by beginSessionHandshake(), and sendRpcMessage().
|
private |
Definition at line 140 of file panel_remote_symbol.h.
Referenced by findDataSourceJson(), PANEL_REMOTE_SYMBOL(), and RefreshDataSources().
|
private |
Definition at line 144 of file panel_remote_symbol.h.
Referenced by loadDataSource(), and onWebViewLoaded().
|
private |
Definition at line 138 of file panel_remote_symbol.h.
Referenced by PANEL_REMOTE_SYMBOL().
|
private |
Definition at line 142 of file panel_remote_symbol.h.
Referenced by beginSessionHandshake(), handleRpcMessage(), and sendRpcMessage().
|
private |
Definition at line 139 of file panel_remote_symbol.h.
Referenced by beginSessionHandshake(), BindWebViewLoaded(), loadDataSource(), onRefresh(), onRemoteLoginResult(), PANEL_REMOTE_SYMBOL(), sendRpcMessage(), and showMessage().
|
private |
Definition at line 148 of file panel_remote_symbol.h.
Referenced by BindWebViewLoaded().