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_BOM_REV "--bom-rev"
41#define ARG_UNITS "--units"
42#define ARG_MODE "--mode"
43#define ARG_SECTIONS "--sections"
44#define ARG_NET_NAMES "--net-names"
45#define ARG_REF_DES "--ref-des"
53 m_argParser.add_description( std::string(
"Export the PCB in IPC-2581 format" ) );
56 .help( std::string(
"Precision" ) )
59 .metavar(
"PRECISION" );
62 .help( std::string(
"Compress the output" ) )
66 .default_value( std::string(
"C" ) )
67 .help( std::string(
"IPC-2581 standard version" ) )
71 .default_value( std::string(
"mm" ) )
72 .help( std::string(
"Units" ) )
73 .choices(
"mm",
"in" );
76 .default_value( std::string() )
78 "Name of the part field to use for the Bill of Material Internal Id Column" ) )
79 .metavar(
"FIELD_NAME" );
82 .default_value( std::string() )
83 .help( std::string(
"Name of the part field to use for the Bill of "
84 "Material Manufacturer Part Number Column" ) )
85 .metavar(
"FIELD_NAME" );
88 .default_value( std::string() )
89 .help( std::string(
"Name of the part field to use for the Bill of "
90 "Material Manufacturer Column" ) )
91 .metavar(
"FIELD_NAME" );
94 .default_value( std::string() )
95 .help( std::string(
"Name of the part field to use for the Bill of "
96 "Material Distributor Part Number Column" ) )
97 .metavar(
"FIELD_NAME" );
100 .default_value( std::string() )
101 .help( std::string(
"Name to insert into Bill of "
102 "Material Distributor Column" ) )
103 .metavar(
"FIELD_NAME" );
106 .default_value( std::string() )
107 .help( std::string(
"BOM revision to use in the output file. "
108 "Defaults to schematic revision from the project file" ) )
109 .metavar(
"REVISION" );
114 .default_value( std::string() )
115 .help( std::string(
"Data set to export, per the IPC-2581 function mode table: "
116 "userdef, bom, stackup, fabrication, assembly, test or "
118 .metavar(
"DATA_SET" );
121 .default_value( std::string() )
122 .help( std::string(
"Override the optional sections of the chosen data set, as "
123 "IPC-2581 section key letters" ) )
124 .metavar(
"SECTION_KEY" );
127 .default_value( std::string(
"include" ) )
128 .help( std::string(
"Whether net names are exported as authored or replaced "
129 "with opaque names that preserve connectivity" ) )
130 .choices(
"include",
"anonymize" );
133 .default_value( std::string(
"include" ) )
134 .help( std::string(
"Whether reference designators are exported" ) )
135 .choices(
"include",
"omit" );
146 ipc2581Job->SetConfiguredOutputPath(
m_argOutput );
153 if( !wxFile::Exists( ipc2581Job->m_filename ) )
155 wxFprintf( stderr,
_(
"Board file does not exist or is not accessible\n" ) );
165 else if( version ==
'C' )
171 else if( units ==
"in" )
174 ipc2581Job->m_colInternalId =
176 ipc2581Job->m_colMfgPn =
179 ipc2581Job->m_colDistPn =
181 ipc2581Job->m_colDist =
183 ipc2581Job->m_bomRev =
std::map< wxString, wxString > m_argDefineVars
Value of the drawing sheet arg if configured.
void addVariantsArg()
Set up the list of variants to output arguement.
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.
std::vector< wxString > m_argVariantNames
The list of variant names to output.
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, IO_TYPE aInputType=IO_TYPE::FILE, IO_TYPE aOutputType=IO_TYPE::FILE)