29#include <wx/tokenzr.h>
33#define ARG_COMPRESS "--compress"
35#define ARG_BOM_COL_INT_ID "--bom-col-int-id"
36#define ARG_BOM_COL_MFG_PN "--bom-col-mfg-pn"
37#define ARG_BOM_COL_MFG "--bom-col-mfg"
38#define ARG_BOM_COL_DIST_PN "--bom-col-dist-pn"
39#define ARG_BOM_COL_DIST "--bom-col-dist"
40#define ARG_UNITS "--units"
48 m_argParser.add_description( std::string(
"Export the PCB in IPC-2581 format" ) );
51 .help( std::string(
"Precision" ) )
54 .metavar(
"PRECISION" );
57 .help( std::string(
"Compress the output" ) )
61 .default_value( std::string(
"C" ) )
62 .help( std::string(
"IPC-2581 standard version" ) )
66 .default_value( std::string(
"mm" ) )
67 .help( std::string(
"Units" ) )
68 .choices(
"mm",
"in" );
71 .default_value( std::string() )
73 "Name of the part field to use for the Bill of Material Internal Id Column" ) )
74 .metavar(
"FIELD_NAME" );
77 .default_value( std::string() )
78 .help( std::string(
"Name of the part field to use for the Bill of "
79 "Material Manufacturer Part Number Column" ) )
80 .metavar(
"FIELD_NAME" );
83 .default_value( std::string() )
84 .help( std::string(
"Name of the part field to use for the Bill of "
85 "Material Manufacturer Column" ) )
86 .metavar(
"FIELD_NAME" );
89 .default_value( std::string() )
90 .help( std::string(
"Name of the part field to use for the Bill of "
91 "Material Distributor Part Number Column" ) )
92 .metavar(
"FIELD_NAME" );
95 .default_value( std::string() )
96 .help( std::string(
"Name to insert into Bill of "
97 "Material Distributor Column" ) )
98 .metavar(
"FIELD_NAME" );
108 ipc2581Job->SetConfiguredOutputPath(
m_argOutput );
112 if( !wxFile::Exists( ipc2581Job->m_filename ) )
114 wxFprintf( stderr,
_(
"Board file does not exist or is not accessible\n" ) );
124 else if( version ==
'C' )
130 else if( units ==
"in" )
133 ipc2581Job->m_colInternalId =
135 ipc2581Job->m_colMfgPn =
138 ipc2581Job->m_colDistPn =
140 ipc2581Job->m_colDist =
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.
wxString m_argDrawingSheet
Value of the drawing sheet arg if configured.
wxString m_argOutput
Value of the output arg if configured.
wxString m_argInput
Value of the common input 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
#define ARG_BOM_COL_MFG_PN
This file contains miscellaneous commonly used macros and functions.
static const int ERR_INVALID_INPUT_FILE
std::vector< FAB_LAYER_COLOR > dummy
wxString From_UTF8(const char *cstring)
PCB_EXPORT_BASE_COMMAND(const std::string &aName, bool aInputCanBeDir=false, bool aOutputIsDir=false)