30#include <wx/tokenzr.h> 
   32#define ARG_FORMAT "--format" 
   33#define ARG_EXCELLON_MIRRORY "--excellon-mirror-y" 
   34#define ARG_EXCELLON_MINIMALHEAD "--excellon-min-header" 
   35#define ARG_EXCELLON_SEPARATE_TH "--excellon-separate-th" 
   36#define ARG_EXCELLON_ZEROS_FORMAT "--excellon-zeros-format" 
   37#define ARG_EXCELLON_OVAL_FORMAT "--excellon-oval-format" 
   38#define ARG_GERBER_PRECISION "--gerber-precision" 
   39#define ARG_EXCELLON_UNITS "--excellon-units" 
   40#define ARG_GENERATE_MAP "--generate-map" 
   41#define ARG_GENERATE_TENTING "--generate-tenting" 
   42#define ARG_MAP_FORMAT "--map-format" 
   43#define ARG_DRILL_ORIGIN "--drill-origin" 
   52            .default_value( std::string( 
"excellon" ) )
 
   57            .default_value( std::string( 
"absolute" ) )
 
   59            .metavar( 
"DRILL_ORIGIN" );
 
   62            .default_value( std::string( 
"decimal" ) )
 
   64                    _( 
"Valid options are: decimal,suppressleading,suppresstrailing,keep." ) ) )
 
   65            .metavar( 
"ZEROS_FORMAT" );
 
   68            .default_value( std::string( 
"alternate" ) )
 
   70            .metavar( 
"OVAL_FORMAT" );
 
   73            .default_value( std::string( 
"mm" ) )
 
   86            .
help( 
UTF8STDSTR( 
_( 
"Generate independent files for NPTH and PTH holes" ) ) )
 
   98            .default_value( std::string( 
"pdf" ) )
 
  100            .metavar( 
"MAP_FORMAT" );
 
 
  116    if( !drillJob->GetConfiguredOutputPath().IsEmpty() )
 
  118        wxFileName fn( drillJob->GetConfiguredOutputPath(), wxEmptyString );
 
  122            wxFprintf( stderr, 
_( 
"Output must be a directory\n" ) );
 
  129    if( format == wxS( 
"excellon" ) )
 
  133    else if( format == wxS( 
"gerber" ) )
 
  139        wxFprintf( stderr, 
_( 
"Invalid drill format\n" ) );
 
  145    if( units == wxS( 
"mm" ) )
 
  149    else if( units == wxS( 
"in" ) )
 
  155        wxFprintf( stderr, 
_( 
"Invalid units specified\n" ) );
 
  161    if( zeroFormat == wxS( 
"decimal" ) )
 
  165    else if( zeroFormat == wxS( 
"suppressleading" ) )
 
  169    else if( zeroFormat == wxS( 
"suppresstrailing" ) )
 
  173    else if( zeroFormat == wxS( 
"keep" ) )
 
  179        wxFprintf( stderr, 
_( 
"Invalid zeros format specified\n" ) );
 
  183    wxString drillFormat =
 
  186    if( drillFormat == wxS( 
"route" ) )
 
  188        drillJob->m_excellonOvalDrillRoute = 
true;
 
  190    else if( drillFormat == wxS( 
"alternate" ) )
 
  192        drillJob->m_excellonOvalDrillRoute = 
false;
 
  196        wxFprintf( stderr, 
_( 
"Invalid oval drill format specified\n" ) );
 
  202    if( mapFormat == wxS( 
"pdf" ) )
 
  206    else if( mapFormat == wxS( 
"ps" ) )
 
  210    else if( mapFormat == wxS( 
"gerberx2" ) )
 
  214    else if( mapFormat == wxS( 
"dxf" ) )
 
  218    else if( mapFormat == wxS( 
"svg" ) )
 
  224        wxFprintf( stderr, 
_( 
"Invalid map format specified\n" ) );
 
  230    if( origin == wxS( 
"absolute" ) )
 
  234    else if( origin == wxS( 
"plot" ) )
 
  240        wxFprintf( stderr, 
_( 
"Invalid origin mode specified\n" ) );
 
  251    if( drillJob->m_gerberPrecision != 5 && drillJob->m_gerberPrecision != 6 )
 
  253        wxFprintf( stderr, 
_( 
"Gerber coordinate precision should be either 5 or 6\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.
 
PCB_EXPORT_DRILL_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)
 
#define ARG_EXCELLON_SEPARATE_TH
 
#define ARG_GENERATE_TENTING
 
#define ARG_EXCELLON_MINIMALHEAD
 
#define ARG_EXCELLON_ZEROS_FORMAT
 
#define ARG_EXCELLON_UNITS
 
#define ARG_EXCELLON_MIRRORY
 
#define ARG_EXCELLON_OVAL_FORMAT
 
#define ARG_GERBER_PRECISION
 
This file contains miscellaneous commonly used macros and functions.
 
static const int ERR_ARGS
 
wxString From_UTF8(const char *cstring)
 
PCB_EXPORT_BASE_COMMAND(const std::string &aName, bool aInputCanBeDir=false, bool aOutputIsDir=false)