32#include <wx/tokenzr.h>
34#define ARG_EXCLUDE_DRAWING_SHEET "--exclude-drawing-sheet"
35#define ARG_NO_BACKGROUND_COLOR "--no-background-color"
36#define ARG_PAGES "--pages"
37#define ARG_EXCLUDE_PDF_PROPERTY_POPUPS "--exclude-pdf-property-popups"
38#define ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS "--exclude-pdf-hierarchical-links"
39#define ARG_EXCLUDE_PDF_METADATA "--exclude-pdf-metadata"
40#define ARG_FONT_NAME "--default-font"
41#define ARG_DRAW_HOP_OVER "--draw-hop-over"
43#define DEPRECATED_ARG_HPGL_PEN_SIZE "--pen-size"
44#define DEPRECATED_ARG_HPGL_ORIGIN "--origin"
47 const std::string& aDescription,
60 .default_value( std::string() )
61 .help(
UTF8STDSTR(
_(
"Color theme to use (will default to schematic settings)" ) ) )
62 .metavar(
"THEME_NAME" );
69 .implicit_value(
true )
70 .default_value(
false );
74 .default_value( wxString(
"" ).ToStdString() );
77 .help(
UTF8STDSTR(
_(
"Draw hop over at wire crossings" ) ) )
78 .implicit_value(
true )
79 .default_value(
false );
84 .help(
UTF8STDSTR(
_(
"Do not generate property popups in PDF" ) ) )
88 .help(
UTF8STDSTR(
_(
"Do not generate clickable links for hierarchical elements in PDF" ) ) )
92 .help(
UTF8STDSTR(
_(
"Do not generate PDF metadata from AUTHOR and SUBJECT variables" ) ) )
101 .help(
UTF8STDSTR(
_(
"Avoid setting a background color (regardless of theme)" ) ) )
106 .default_value( std::string() )
107 .help(
UTF8STDSTR(
_(
"List of page numbers separated by comma to print, blank or "
108 "unspecified is equivalent to all pages" ) ) )
109 .metavar(
"PAGE_LIST" );
114 .help(
UTF8STDSTR(
_(
"Deprecated. Has no effect." ) ) )
116 .default_value( 0.5 )
117 .metavar(
"PEN_SIZE" );
120 .help(
UTF8STDSTR(
_(
"Deprecated. Has no effect." ) ) )
123 .metavar(
"ORIGIN" );
132 wxFprintf( stderr,
_(
"Plotting to HPGL is no longer supported as of KiCad 10.0.\n" ) );
138 if( !wxFile::Exists( filename ) )
140 wxFprintf( stderr,
_(
"Schematic file does not exist or is not accessible\n" ) );
144 std::vector<wxString> pages;
146 wxStringTokenizer tokenizer( pagesStr,
",", wxTOKEN_STRTOK );
148 while( tokenizer.HasMoreTokens() )
149 pages.push_back( tokenizer.GetNextToken().Trim(
true ).Trim(
false ) );
151 std::unique_ptr<JOB_EXPORT_SCH_PLOT> plotJob;
162 plotJob->m_filename = filename;
164 plotJob->m_plotPages = pages;
182 plotJob->m_plotAll = plotJob->m_plotPages.size() == 0;
void addCommonArgs(bool aInput, bool aOutput, bool aInputCanBeDir, bool aOutputIsDir)
Set up the most common of args used across cli.
std::map< wxString, wxString > m_argDefineVars
Value of the drawing sheet arg if configured.
argparse::ArgumentParser m_argParser
COMMAND(const std::string &aName)
Define a new COMMAND instance.
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.
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.
SCH_EXPORT_PLOT_COMMAND(const std::string &aName, const std::string &aDescription, SCH_PLOT_FORMAT aPlotFormat, bool aOutputIsDir=true)
SCH_PLOT_FORMAT m_plotFormat
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_BLACKANDWHITE_DESC
#define ARG_BLACKANDWHITE
#define ARG_EXCLUDE_DRAWING_SHEET
#define ARG_EXCLUDE_PDF_PROPERTY_POPUPS
#define ARG_NO_BACKGROUND_COLOR
#define DEPRECATED_ARG_HPGL_ORIGIN
#define ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS
#define ARG_DRAW_HOP_OVER
#define DEPRECATED_ARG_HPGL_PEN_SIZE
#define ARG_EXCLUDE_PDF_METADATA
This file contains miscellaneous commonly used macros and functions.
static const int ERR_ARGS
static const int ERR_INVALID_INPUT_FILE
wxString From_UTF8(const char *cstring)