KiCad PCB EDA Suite
|
Bill of material output generator. More...
#include <bom_plugins.h>
Public Member Functions | |
BOM_GENERATOR_HANDLER (const wxString &aFile) | |
bool | IsOk () |
Return true if the plugin is ready to work, i.e. | |
const wxString & | GetInfo () const |
Return plugin description stored in the plugin header file (if available). | |
const wxFileName & | GetFile () const |
Return the file name of the plugin. | |
wxString | GetStoredPath () const |
wxFileName | FindFilePath () const |
Returns the calculated path to the plugin: if the path is already absolute and exists, just return it. | |
const wxString & | GetName () const |
Return the customisable plugin name. | |
void | SetName (const wxString &aName) |
Set the customisable plugin name. | |
const wxString & | GetCommand () const |
Return the command to execute the plugin. | |
void | SetCommand (const wxString &aCommand) |
Set the command to execute the plugin. | |
wxArrayString & | Options () |
Accessor to array of options. | |
Static Public Member Functions | |
static bool | IsValidGenerator (const wxString &aFile) |
Return true if a file name matches a recognized plugin format. | |
Protected Member Functions | |
wxString | readHeader (const wxString &aEndSection) |
Read the plugin file header. | |
Static Protected Member Functions | |
static wxString | getOutputExtension (const wxString &aHeader) |
Extracts the output BOM file's extension, including the '. | |
Protected Attributes | |
bool | m_isOk |
Path to the plugin. | |
wxFileName | m_file |
Path to the plugin stored in config (can be absolute or just a filename) | |
const wxString | m_storedPath |
User customisable name. | |
wxString | m_name |
Command to execute the plugin. | |
wxString | m_cmd |
Description of the plugin (normally from the plugin header) | |
wxString | m_info |
Plugin specific options. | |
wxArrayString | m_options |
Bill of material output generator.
A Material output generator is an external application called by Eeschema to create a BOM from our intermediate XML netlist. A generator can be a script or an executable that can read the intermediate XML netlist file and generates a output (the BOM file)
Definition at line 45 of file bom_plugins.h.
BOM_GENERATOR_HANDLER::BOM_GENERATOR_HANDLER | ( | const wxString & | aFile | ) |
aFile | is path to the plugin file. |
Definition at line 35 of file bom_plugins.cpp.
References _, BOM_TRACE, FindFilePath(), getOutputExtension(), m_cmd, m_file, m_info, m_isOk, m_name, and readHeader().
wxFileName BOM_GENERATOR_HANDLER::FindFilePath | ( | ) | const |
Returns the calculated path to the plugin: if the path is already absolute and exists, just return it.
Otherwise if the path is just a filename, look for that file in the user and system plugin directories and return the first one found. If neither is found, just return m_file.
Definition at line 197 of file bom_plugins.cpp.
References BOM_TRACE, PATHS::GetStockPluginsPath(), PATHS::GetUserPluginsPath(), and m_file.
Referenced by BOM_GENERATOR_HANDLER(), and DIALOG_BOM::pluginInit().
|
inline |
Return the command to execute the plugin.
Definition at line 114 of file bom_plugins.h.
References m_cmd.
Referenced by DIALOG_BOM::pluginInit().
|
inline |
Return the file name of the plugin.
Definition at line 76 of file bom_plugins.h.
References m_file.
Referenced by DIALOG_BOM::pluginInit().
|
inline |
Return plugin description stored in the plugin header file (if available).
Definition at line 68 of file bom_plugins.h.
References m_info.
Referenced by DIALOG_BOM::pluginInit().
|
inline |
Return the customisable plugin name.
Definition at line 96 of file bom_plugins.h.
References m_name.
Referenced by DIALOG_BOM::pluginInit().
|
staticprotected |
Extracts the output BOM file's extension, including the '.
', from the plugin file header. If the output extension cannot be determined from the plugin header, returns wxEmptyString.
aHeader | is the plugin file's header, as returned by readHeader() true if the plugin is working (i.e. if the plugin file exists and was read |
Definition at line 176 of file bom_plugins.cpp.
Referenced by BOM_GENERATOR_HANDLER().
|
inline |
Definition at line 81 of file bom_plugins.h.
References m_storedPath.
|
inline |
Return true if the plugin is ready to work, i.e.
if the plugin file is found and readable.
Definition at line 56 of file bom_plugins.h.
References m_isOk.
Referenced by DIALOG_BOM::pluginInit().
|
static |
Return true if a file name matches a recognized plugin format.
aFile | is path to the plugin file. |
Definition at line 128 of file bom_plugins.cpp.
|
inline |
Accessor to array of options.
Definition at line 130 of file bom_plugins.h.
References m_options.
Referenced by DIALOG_BOM::pluginInit().
|
protected |
Read the plugin file header.
aEndSection | is a string marking end of the header. |
Definition at line 143 of file bom_plugins.cpp.
References m_file.
Referenced by BOM_GENERATOR_HANDLER().
|
inline |
Set the command to execute the plugin.
Definition at line 122 of file bom_plugins.h.
References m_cmd.
|
inline |
Set the customisable plugin name.
aName | is the new name. |
Definition at line 106 of file bom_plugins.h.
References m_name.
|
protected |
Description of the plugin (normally from the plugin header)
Definition at line 164 of file bom_plugins.h.
Referenced by BOM_GENERATOR_HANDLER(), GetCommand(), and SetCommand().
|
protected |
Path to the plugin stored in config (can be absolute or just a filename)
Definition at line 155 of file bom_plugins.h.
Referenced by BOM_GENERATOR_HANDLER(), FindFilePath(), GetFile(), and readHeader().
|
protected |
Plugin specific options.
Definition at line 167 of file bom_plugins.h.
Referenced by BOM_GENERATOR_HANDLER(), and GetInfo().
|
protected |
Path to the plugin.
Definition at line 152 of file bom_plugins.h.
Referenced by BOM_GENERATOR_HANDLER(), and IsOk().
|
protected |
Command to execute the plugin.
Definition at line 161 of file bom_plugins.h.
Referenced by BOM_GENERATOR_HANDLER(), GetName(), and SetName().
|
protected |
Definition at line 170 of file bom_plugins.h.
Referenced by Options().
|
protected |
User customisable name.
Definition at line 158 of file bom_plugins.h.
Referenced by GetStoredPath().