32#define ARG_SIDE "--side"
33#define ARG_FORMAT "--format"
34#define ARG_UNITS "--units"
35#define ARG_NEGATE_BOTTOM_X "--bottom-negate-x"
36#define ARG_USE_DRILL_FILE_ORIGIN "--use-drill-file-origin"
37#define ARG_SMD_ONLY "--smd-only"
38#define ARG_EXCLUDE_FOOTPRINTS_TH "--exclude-fp-th"
39#define ARG_EXCLUDE_DNP "--exclude-dnp"
40#define ARG_GERBER_BOARD_EDGE "--gerber-board-edge"
41#define ARG_VARIANT "--variant"
50 .default_value( std::string(
"both" ) )
51 .
help(
UTF8STDSTR(
_(
"Valid options: front,back,both. Gerber format only supports "
52 "\"front\" or \"back\"." ) ) );
55 .default_value( std::string(
"ascii" ) )
60 .default_value( std::string(
"in" ) )
61 .
help(
UTF8STDSTR(
_(
"Output units; ascii or csv format only; valid options: "
66 .
help(
UTF8STDSTR(
_(
"Use negative X coordinates for footprints on bottom layer "
67 "(ascii or csv formats only)" ) ) )
71 .
help(
UTF8STDSTR(
_(
"Use drill/place file origin (ascii or csv only)" ) ) )
75 .
help(
UTF8STDSTR(
_(
"Include only SMD footprints (ascii or csv only)" ) ) )
80 _(
"Exclude all footprints with through-hole pads (ascii or csv only)" ) ) )
84 .
help(
UTF8STDSTR(
_(
"Exclude all footprints with the Do Not Populate flag set" ) ) )
92 .default_value( std::string(
"" ) )
93 .
help(
UTF8STDSTR(
_(
"Board variant for variant-aware filtering (DNP, BOM, position "
94 "file exclusions)" ) ) )
95 .metavar(
"VARIANT" );
106 if( !wxFile::Exists( aPosJob->m_filename ) )
108 wxFprintf( stderr,
_(
"Board file does not exist or is not accessible\n" ) );
113 aPosJob->m_singleFile =
true;
114 aPosJob->m_nakedFilename =
true;
124 if( format == wxS(
"ascii" ) )
128 else if( format == wxS(
"csv" ) )
132 else if( format == wxS(
"gerber" ) )
138 wxFprintf( stderr,
_(
"Invalid format\n" ) );
144 if( units == wxS(
"mm" ) )
148 else if( units == wxS(
"in" ) )
154 wxFprintf( stderr,
_(
"Invalid units specified\n" ) );
160 if( side == wxS(
"both" ) )
164 wxFprintf( stderr,
_(
"\"both\" not supported for Gerber format\n" ) );
170 else if( side == wxS(
"front" ) )
174 else if( side == wxS(
"back" ) )
180 wxFprintf( stderr,
_(
"Invalid side specified\n" ) );
argparse::ArgumentParser m_argParser
wxString m_argOutput
Value of the output arg if configured.
wxString m_argInput
Value of the common input arg if configured.
int doPerform(KIWAY &aKiway) override
The internal handler that should be overloaded to implement command specific processing and work.
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_USE_DRILL_FILE_ORIGIN
#define ARG_EXCLUDE_FOOTPRINTS_TH
#define ARG_GERBER_BOARD_EDGE
#define ARG_NEGATE_BOTTOM_X
This file contains miscellaneous commonly used macros and functions.
static const int ERR_ARGS
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)