27#include <wx/filename.h>
30#define ARG_FORMAT "--format"
31#define ARG_LAYER_MAP "--layer-map"
32#define ARG_AUTO_MAP "--auto-map"
33#define ARG_REPORT_FORMAT "--report-format"
34#define ARG_REPORT_FILE "--report-file"
42 UTF8STDSTR(
_(
"Import a non-KiCad PCB file to KiCad format" ) ) );
45 .default_value( std::string(
"auto" ) )
46 .help(
UTF8STDSTR(
_(
"Input format hint: auto, pads, altium, eagle, cadstar, "
47 "fabmaster, pcad, solidworks (default: auto)" ) ) )
51 .default_value( std::string(
"" ) )
52 .help(
UTF8STDSTR(
_(
"JSON file with layer name mappings" ) ) )
56 .help(
UTF8STDSTR(
_(
"Use automatic layer mapping (default behavior)" ) ) )
60 .default_value( std::string(
"none" ) )
61 .help(
UTF8STDSTR(
_(
"Import report format: none, json, text (default: none)" ) ) )
65 .default_value( std::string(
"" ) )
66 .help(
UTF8STDSTR(
_(
"File path for import report (default: stdout)" ) ) )
73 std::unique_ptr<JOB_PCB_IMPORT> importJob = std::make_unique<JOB_PCB_IMPORT>();
80 if( format == wxS(
"auto" ) )
84 else if( format == wxS(
"pads" ) )
88 else if( format == wxS(
"altium" ) )
92 else if( format == wxS(
"eagle" ) )
96 else if( format == wxS(
"cadstar" ) )
100 else if( format == wxS(
"fabmaster" ) )
104 else if( format == wxS(
"pcad" ) )
108 else if( format == wxS(
"solidworks" ) )
114 wxFprintf( stderr,
_(
"Invalid format: %s\n" ), format );
119 importJob->m_layerMapFile = layerMapFile;
125 if( reportFormat == wxS(
"none" ) )
129 else if( reportFormat == wxS(
"json" ) )
133 else if( reportFormat == wxS(
"text" ) )
139 wxFprintf( stderr,
_(
"Invalid report format: %s\n" ), reportFormat );
144 importJob->m_reportFile = reportFile;
argparse::ArgumentParser m_argParser
COMMAND(const std::string &aName)
Define a new COMMAND instance.
void addCommonArgs(bool aInput, bool aOutput, IO_TYPE aInputType, IO_TYPE aOutputType)
Set up the most common of args used across cli.
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)
#define ARG_REPORT_FORMAT
This file contains miscellaneous commonly used macros and functions.
static const int ERR_ARGS
wxString From_UTF8(const char *cstring)