33#include <wx/tokenzr.h>
35#define ARG_EXCLUDE_DRAWING_SHEET "--exclude-drawing-sheet"
36#define ARG_NO_BACKGROUND_COLOR "--no-background-color"
37#define ARG_PAGES "--pages"
38#define ARG_EXCLUDE_PDF_PROPERTY_POPUPS "--exclude-pdf-property-popups"
39#define ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS "--exclude-pdf-hierarchical-links"
40#define ARG_EXCLUDE_PDF_METADATA "--exclude-pdf-metadata"
41#define ARG_FONT_NAME "--default-font"
42#define ARG_DRAW_HOP_OVER "--draw-hop-over"
43#define ARG_DPI "--dpi"
44#define ARG_NO_ANTIALIAS "--no-antialias"
46#define DEPRECATED_ARG_HPGL_PEN_SIZE "--pen-size"
47#define DEPRECATED_ARG_HPGL_ORIGIN "--origin"
50 const std::string& aDescription,
64 .default_value( std::string() )
65 .help(
UTF8STDSTR(
_(
"Color theme to use (will default to schematic settings)" ) ) )
66 .metavar(
"THEME_NAME" );
77 .default_value( wxString(
"" ).ToStdString() );
80 .help(
UTF8STDSTR(
_(
"Draw hop over at wire crossings" ) ) )
86 .help(
UTF8STDSTR(
_(
"Do not generate property popups in PDF" ) ) )
90 .help(
UTF8STDSTR(
_(
"Do not generate clickable links for hierarchical elements in PDF" ) ) )
94 .help(
UTF8STDSTR(
_(
"Do not generate PDF metadata from AUTHOR and SUBJECT variables" ) ) )
104 .help(
UTF8STDSTR(
_(
"Avoid setting a background color (regardless of theme)" ) ) )
111 .help(
UTF8STDSTR( wxString::Format(
_(
"Resolution in dots per inch (default %d)" ),
118 .help(
UTF8STDSTR(
_(
"Disable anti-aliasing" ) ) )
123 .default_value( std::string() )
124 .help(
UTF8STDSTR(
_(
"List of page numbers separated by comma to print, blank or "
125 "unspecified is equivalent to all pages" ) ) )
126 .metavar(
"PAGE_LIST" );
131 .help(
UTF8STDSTR(
_(
"Deprecated. Has no effect." ) ) )
133 .default_value( 0.5 )
134 .metavar(
"PEN_SIZE" );
137 .help(
UTF8STDSTR(
_(
"Deprecated. Has no effect." ) ) )
140 .metavar(
"ORIGIN" );
149 wxFprintf( stderr,
_(
"Plotting to HPGL is no longer supported as of KiCad 10.0.\n" ) );
155 if( !wxFile::Exists( filename ) )
157 wxFprintf( stderr,
_(
"Schematic file does not exist or is not accessible\n" ) );
161 std::vector<wxString> pages;
163 wxStringTokenizer tokenizer( pagesStr,
",", wxTOKEN_STRTOK );
165 while( tokenizer.HasMoreTokens() )
166 pages.push_back( tokenizer.GetNextToken().Trim(
true ).Trim(
false ) );
168 std::unique_ptr<JOB_EXPORT_SCH_PLOT> plotJob;
180 plotJob->m_filename = filename;
182 plotJob->m_plotPages = pages;
201 plotJob->m_plotAll = plotJob->m_plotPages.size() == 0;
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
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.
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.
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.
SCH_EXPORT_PLOT_COMMAND(const std::string &aName, const std::string &aDescription, SCH_PLOT_FORMAT aPlotFormat, IO_TYPE aOutputType)
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
constexpr int DEFAULT_PNG_DPI
constexpr int MIN_PNG_DPI
constexpr int MAX_PNG_DPI
wxString From_UTF8(const char *cstring)