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

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 ()
 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)
 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
 

Detailed Description

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 162 of file footprint_wizard.h.

Constructor & Destructor Documentation

◆ FOOTPRINT_WIZARD_MANAGER()

FOOTPRINT_WIZARD_MANAGER::FOOTPRINT_WIZARD_MANAGER ( )
inline

Definition at line 165 of file footprint_wizard.h.

◆ ~FOOTPRINT_WIZARD_MANAGER()

FOOTPRINT_WIZARD_MANAGER::~FOOTPRINT_WIZARD_MANAGER ( )
default

Member Function Documentation

◆ Generate()

tl::expected< FOOTPRINT *, wxString > FOOTPRINT_WIZARD_MANAGER::Generate ( FOOTPRINT_WIZARD * aWizard)

Generates a footprint using a given wizard.

Parameters
aWizardis the wizard data instance (with parameters set) to feed into the wizard
Returns
a generated footprint, or an error message if generation failed

Definition at line 125 of file footprint_wizard.cpp.

References _, 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::GetBuiltFootprint(), and FOOTPRINT_WIZARD_FRAME::RegenerateFootprint().

◆ GetWizard()

std::optional< FOOTPRINT_WIZARD * > FOOTPRINT_WIZARD_MANAGER::GetWizard ( const wxString & aIdentifier)

Definition at line 80 of file footprint_wizard.cpp.

References m_wizards.

◆ RefreshInfo()

bool FOOTPRINT_WIZARD_MANAGER::RefreshInfo ( FOOTPRINT_WIZARD * aWizard)
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.

Returns
true if the call succeeded

Definition at line 89 of file footprint_wizard.cpp.

References WIZARD_INFO::FromProto(), FOOTPRINT_WIZARD::Identifier(), FOOTPRINT_WIZARD::Info(), info, API_PLUGIN_MANAGER::InvokeActionSync(), and Pgm().

Referenced by ReloadWizards().

◆ ReloadWizards()

void FOOTPRINT_WIZARD_MANAGER::ReloadWizards ( )

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().

Note that doing so clears the existing list and invalidates any existing pointers to wizards.

Definition at line 39 of file footprint_wizard.cpp.

References FOOTPRINT_WIZARD, API_PLUGIN_MANAGER::GetActionsForScope(), m_wizards, Pgm(), and RefreshInfo().

Referenced by DIALOG_FOOTPRINT_WIZARD_LIST::initLists().

◆ Wizards()

std::vector< FOOTPRINT_WIZARD * > FOOTPRINT_WIZARD_MANAGER::Wizards ( ) const

Member Data Documentation

◆ m_wizards

std::map<wxString, std::unique_ptr<FOOTPRINT_WIZARD> > FOOTPRINT_WIZARD_MANAGER::m_wizards
private

Definition at line 197 of file footprint_wizard.h.

Referenced by GetWizard(), ReloadWizards(), and Wizards().


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