Support --mirror option in "kicad-cli pcb export pdf"

This commit is contained in:
Alex 2023-06-10 04:54:11 +03:00
parent d5edde799c
commit 2450435131
5 changed files with 10 additions and 1 deletions

View File

@ -33,6 +33,7 @@ public:
m_filename(),
m_outputFile(),
m_colorTheme(),
m_mirror( false ),
m_blackAndWhite( false ),
m_negative( false ),
m_plotFootprintValues( true ),
@ -46,6 +47,7 @@ public:
wxString m_outputFile;
wxString m_colorTheme;
bool m_mirror;
bool m_blackAndWhite;
bool m_negative;
bool m_plotFootprintValues;

View File

@ -41,6 +41,7 @@ namespace CLI
#define ARG_EXCLUDE_VALUE "--exclude-value"
#define ARG_THEME "--theme"
#define ARG_INCLUDE_BORDER_TITLE "--include-border-title"
#define ARG_MIRROR "--mirror"
struct EXPORT_PCB_BASE_COMMAND : public COMMAND
{

View File

@ -35,6 +35,11 @@ CLI::EXPORT_PCB_PDF_COMMAND::EXPORT_PCB_PDF_COMMAND() : EXPORT_PCB_BASE_COMMAND(
{
addLayerArg( true );
m_argParser.add_argument( "-m", ARG_MIRROR )
.help( UTF8STDSTR( _( "Mirror the board (useful for trying to show bottom layers)" ) ) )
.implicit_value( true )
.default_value( false );
m_argParser.add_argument( "--erd", ARG_EXCLUDE_REFDES )
.help( UTF8STDSTR( _( "Exclude the reference designator text" ) ) )
.implicit_value( true )
@ -89,6 +94,7 @@ int CLI::EXPORT_PCB_PDF_COMMAND::doPerform( KIWAY& aKiway )
pdfJob->m_plotBorderTitleBlocks = m_argParser.get<bool>( ARG_INCLUDE_BORDER_TITLE );
pdfJob->m_mirror = m_argParser.get<bool>( ARG_MIRROR );
pdfJob->m_blackAndWhite = m_argParser.get<bool>( ARG_BLACKANDWHITE );
pdfJob->m_colorTheme = FROM_UTF8( m_argParser.get<std::string>( ARG_THEME ).c_str() );
pdfJob->m_negative = m_argParser.get<bool>( ARG_NEGATIVE );

View File

@ -33,7 +33,6 @@
#define ARG_EXCLUDE_DRAWING_SHEET "--exclude-drawing-sheet"
#define ARG_PAGE_SIZE "--page-size-mode"
#define ARG_MIRROR "--mirror"
CLI::EXPORT_PCB_SVG_COMMAND::EXPORT_PCB_SVG_COMMAND() : EXPORT_PCB_BASE_COMMAND( "svg" )

View File

@ -240,6 +240,7 @@ int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob )
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
plotOpts.SetColorSettings( mgr.GetColorSettings( aPdfJob->m_colorTheme ) );
plotOpts.SetMirror( aPdfJob->m_mirror );
plotOpts.SetBlackAndWhite( aPdfJob->m_blackAndWhite );
plotOpts.SetNegative( aPdfJob->m_negative );