32#define ARG_COMPRESS "--compress"
34#define ARG_BOM_COL_INT_ID "--bom-col-int-id"
35#define ARG_BOM_COL_MFG "--bom-col-mfg"
36#define ARG_BOM_COL_DIST_PN "--bom-col-dist-pn"
37#define ARG_BOM_COL_DIST "--bom-col-dist"
38#define ARG_BOM_REV "--bom-rev"
39#define ARG_MODE "--mode"
40#define ARG_REF_DES "--ref-des"
50 m_argParser.add_description( std::string(
"Export the PCB in IPC-2581 format" ) );
53 .help( std::string(
"Compress the output" ) )
57 .default_value( std::string(
"C" ) )
58 .help( std::string(
"IPC-2581 standard version" ) )
62 .default_value( std::string() )
64 "Name of the part field to use for the Bill of Material Internal Id Column" ) )
65 .metavar(
"FIELD_NAME" );
68 .default_value( std::string() )
69 .help( std::string(
"Name of the part field to use for the Bill of "
70 "Material Manufacturer Column" ) )
71 .metavar(
"FIELD_NAME" );
74 .default_value( std::string() )
75 .help( std::string(
"Name of the part field to use for the Bill of "
76 "Material Distributor Part Number Column" ) )
77 .metavar(
"FIELD_NAME" );
80 .default_value( std::string() )
81 .help( std::string(
"Name to insert into Bill of "
82 "Material Distributor Column" ) )
83 .metavar(
"FIELD_NAME" );
86 .default_value( std::string() )
87 .help( std::string(
"BOM revision to use in the output file. "
88 "Defaults to schematic revision from the project file" ) )
89 .metavar(
"REVISION" );
92 .default_value( std::string(
"include" ) )
93 .help( std::string(
"Whether reference designators are exported" ) )
94 .choices(
"include",
"omit" );
105 ipc2581Job->SetConfiguredOutputPath(
m_argOutput );
108 if( !wxFile::Exists( ipc2581Job->m_filename ) )
110 wxFprintf( stderr,
_(
"Board file does not exist or is not accessible\n" ) );
119 else if( version ==
'C' )
122 ipc2581Job->m_colInternalId =
125 ipc2581Job->m_colDistPn =
127 ipc2581Job->m_colDist =
129 ipc2581Job->m_bomRev =
std::map< wxString, wxString > m_argDefineVars
Value of the drawing sheet arg if configured.
argparse::ArgumentParser m_argParser
void addDefineArg()
Set up the drawing sheet arg used by many of the export commands.
void addVariantsArg(bool aRequireOutputToken=true)
Set up the list of variants to output arguement.
wxString m_argOutput
Value of the output arg if configured.
void addDrawingSheetArg()
Set up the drawing sheet arg used by many of the export commands.
int doPerform(KIWAY &aKiway) override
The internal handler that should be overloaded to implement command specific processing and work.
PCB_EXPORT_IPC2581_COMMAND()
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
int ProcessJob(KIWAY::FACE_T aFace, JOB *aJob, REPORTER *aReporter=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
#define ARG_BOM_COL_DIST_PN
#define ARG_BOM_COL_INT_ID
static wxString From_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
This file contains miscellaneous commonly used macros and functions.
static const int ERR_INVALID_INPUT_FILE
std::vector< FAB_LAYER_COLOR > dummy
PCB_EXPORT_BASE_COMMAND(const std::string &aName, IO_TYPE aInputType=IO_TYPE::FILE, IO_TYPE aOutputType=IO_TYPE::FILE)
void applyFabExportArgs(JOB_EXPORT_PCB_FAB &aJob)
void addFabExportArgs(const JOB_EXPORT_PCB_FAB &aJob, const std::string &aDataSetAlias={})
aJob says which data sets the format supports aDataSetAlias is a second name for the flag