|
KiCad PCB EDA Suite
|
The footprint wizard manager interfaces with API_PLUGINs that can generate footprints. More...
#include <footprint_wizard.h>
Public Member Functions | |
| FOOTPRINT_WIZARD_MANAGER () | |
| ~FOOTPRINT_WIZARD_MANAGER ()=default | |
| void | ReloadWizards (std::shared_ptr< REPORTER > aReporter=nullptr) |
| Goes through the list of IPC API plugins that provide wizard actions and attempts to refresh the info of each one, placing the ones that work in to the internal list returned by Wizards(). | |
| std::optional< FOOTPRINT_WIZARD * > | GetWizard (const wxString &aIdentifier) |
| std::vector< FOOTPRINT_WIZARD * > | Wizards () const |
| tl::expected< FOOTPRINT *, wxString > | Generate (FOOTPRINT_WIZARD *aWizard) |
| Generates a footprint using a given wizard. | |
Static Public Member Functions | |
| static bool | RefreshInfo (FOOTPRINT_WIZARD *aWizard, std::shared_ptr< REPORTER > aReporter=nullptr) |
| Runs a wizard plugin with the –get-info argument, which should result in the plugin dumping a WizardInfo protobuf message in JSON format to stdout. | |
Private Attributes | |
| std::map< wxString, std::unique_ptr< FOOTPRINT_WIZARD > > | m_wizards |
The footprint wizard manager interfaces with API_PLUGINs that can generate footprints.
It uses API_PLUGIN_MANAGER to enumerate the loaded wizard plugins, and filters to those that generate footprints. It then handles calling the plugin to query capabilities, generate footprints, and so on.
Definition at line 178 of file footprint_wizard.h.
|
inline |
Definition at line 181 of file footprint_wizard.h.
|
default |
| tl::expected< FOOTPRINT *, wxString > FOOTPRINT_WIZARD_MANAGER::Generate | ( | FOOTPRINT_WIZARD * | aWizard | ) |
Generates a footprint using a given wizard.
| aWizard | is the wizard data instance (with parameters set) to feed into the wizard |
Definition at line 131 of file footprint_wizard.cpp.
References _, PGM_BASE::GetPluginManager(), FOOTPRINT_WIZARD::Identifier(), FOOTPRINT_WIZARD::Info(), API_PLUGIN_MANAGER::InvokeActionSync(), WIZARD_INFO::meta, WIZARD_META_INFO::name, WIZARD_INFO::parameters, Pgm(), and traceApi.
Referenced by FOOTPRINT_WIZARD_FRAME::RegenerateFootprint().
| std::optional< FOOTPRINT_WIZARD * > FOOTPRINT_WIZARD_MANAGER::GetWizard | ( | const wxString & | aIdentifier | ) |
Definition at line 79 of file footprint_wizard.cpp.
References m_wizards.
|
static |
Runs a wizard plugin with the –get-info argument, which should result in the plugin dumping a WizardInfo protobuf message in JSON format to stdout.
| aWizard | is the wizard to refresh |
| aReporter | is an optional reporter to receive failure messages |
Definition at line 88 of file footprint_wizard.cpp.
References _, WIZARD_INFO::FromProto(), PGM_BASE::GetPluginManager(), FOOTPRINT_WIZARD::Identifier(), FOOTPRINT_WIZARD::Info(), info, API_PLUGIN_MANAGER::InvokeActionSync(), Pgm(), RPT_SEVERITY_ERROR, KI_ERROR::SetDescription(), and KI_ERROR::SetTitle().
Referenced by BOOST_AUTO_TEST_CASE(), and ReloadWizards().
| void FOOTPRINT_WIZARD_MANAGER::ReloadWizards | ( | std::shared_ptr< REPORTER > | aReporter = nullptr | ) |
Goes through the list of IPC API plugins that provide wizard actions and attempts to refresh the info of each one, placing the ones that work in to the internal list returned by Wizards().
Wizards that fail to load are reported to aReporter, if one is provided. Note that doing so clears the existing list and invalidates any existing pointers to wizards.
| aReporter | is an optional reporter to receive wizard failure messages |
Definition at line 40 of file footprint_wizard.cpp.
References FOOTPRINT_WIZARD, API_PLUGIN_MANAGER::GetActionsForScope(), PGM_BASE::GetPluginManager(), m_wizards, Pgm(), and RefreshInfo().
Referenced by DIALOG_FOOTPRINT_WIZARD_LIST::initLists().
| std::vector< FOOTPRINT_WIZARD * > FOOTPRINT_WIZARD_MANAGER::Wizards | ( | ) | const |
Definition at line 58 of file footprint_wizard.cpp.
References FOOTPRINT_WIZARD::Info(), m_wizards, WIZARD_INFO::meta, and WIZARD_META_INFO::name.
Referenced by DIALOG_FOOTPRINT_WIZARD_LIST::initLists(), and DIALOG_FOOTPRINT_WIZARD_LIST::OnCellFpGeneratorClick().
|
private |
Definition at line 219 of file footprint_wizard.h.
Referenced by GetWizard(), ReloadWizards(), and Wizards().