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 IPC2581 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(
"IPC2581 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" );
112 ipc2581Job->m_filename = m_argInput;
113 ipc2581Job->SetOutputPath( m_argOutput );
114 ipc2581Job->m_drawingSheet = m_argDrawingSheet;
115 ipc2581Job->SetVarOverrides( m_argDefineVars );
117 if( !wxFile::Exists( ipc2581Job->m_filename ) )
119 wxFprintf( stderr,
_(
"Board file does not exist or is not accessible\n" ) );
123 ipc2581Job->m_compress = m_argParser.get<
bool>(
ARG_COMPRESS );
124 ipc2581Job->m_precision = m_argParser.get<
int>(
ARG_PRECISION );
129 else if( version ==
'C' )
135 else if( units ==
"in" )
138 ipc2581Job->m_colInternalId =
140 ipc2581Job->m_colMfgPn =
143 ipc2581Job->m_colDistPn =
145 ipc2581Job->m_colDist =
argparse::ArgumentParser m_argParser
void addDefineArg()
Set up the drawing sheet arg used by many of the export commands.
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)
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)
int doPerform(KIWAY &aKiway) override
The internal handler that should be overloaded to implement command specific processing and work.