Add flag to pdf jobs created by gui needed for processing correctly. Fix enum naming
This commit is contained in:
@@ -40,7 +40,7 @@ JOB_EXPORT_PCB_PDF::JOB_EXPORT_PCB_PDF() :
|
||||
JOB_EXPORT_PCB_PLOT( JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::PDF, "pdf", false ),
|
||||
m_pdfFrontFPPropertyPopups( true ),
|
||||
m_pdfBackFPPropertyPopups( true ),
|
||||
m_pdfMetadata( true ), m_pdfSingle( false ), m_pdfGenMode( GEN_MODE::ALL_LAYERS_ONE_PAGE )
|
||||
m_pdfMetadata( true ), m_pdfSingle( false ), m_pdfGenMode( GEN_MODE::ALL_LAYERS_ONE_FILE )
|
||||
{
|
||||
m_params.emplace_back( new JOB_PARAM<wxString>( "color_theme", &m_colorTheme, m_colorTheme ) );
|
||||
m_params.emplace_back( new JOB_PARAM<bool>( "mirror", &m_mirror, m_mirror ) );
|
||||
|
||||
@@ -47,11 +47,11 @@ public:
|
||||
enum class GEN_MODE
|
||||
{
|
||||
///< DEPRECATED MODE
|
||||
ALL_LAYERS_ONE_PAGE,
|
||||
ALL_LAYERS_ONE_FILE,
|
||||
///< "Single Document" mode
|
||||
ONE_LAYER_ONE_PAGE,
|
||||
ONE_PAGE_PER_LAYER_ONE_FILE,
|
||||
///< The most traditional output mode KiCad has had
|
||||
ALL_LAYERS_SEPARATE_PAGES
|
||||
ALL_LAYERS_SEPARATE_FILE
|
||||
};
|
||||
|
||||
///< uused by the cli, will be removed when the other behavior is deprecated
|
||||
|
||||
@@ -162,14 +162,14 @@ int CLI::PCB_EXPORT_PDF_COMMAND::doPerform( KIWAY& aKiway )
|
||||
|
||||
if( argModeMulti )
|
||||
{
|
||||
pdfJob->m_pdfGenMode = JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_LAYER_ONE_PAGE;
|
||||
pdfJob->m_pdfGenMode = JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_PAGE_PER_LAYER_ONE_FILE;
|
||||
}
|
||||
else if( argModeSeparate )
|
||||
{
|
||||
pdfJob->m_pdfGenMode = JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_SEPARATE_PAGES;
|
||||
pdfJob->m_pdfGenMode = JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_SEPARATE_FILE;
|
||||
}
|
||||
|
||||
if( pdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_ONE_PAGE )
|
||||
if( pdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_ONE_FILE )
|
||||
{
|
||||
wxFprintf( stdout,
|
||||
wxT( "\033[33;1m%s\033[0m\n" ),
|
||||
|
||||
@@ -543,6 +543,16 @@ void DIALOG_PLOT::transferPlotParamsToJob()
|
||||
pdfJob->m_pdfBackFPPropertyPopups = m_plotOpts.m_PDFBackFPPropertyPopups;
|
||||
pdfJob->m_pdfMetadata = m_plotOpts.m_PDFMetadata;
|
||||
pdfJob->m_pdfSingle = m_plotOpts.m_PDFSingle;
|
||||
|
||||
// we need to embed this for the cli deprecation fix
|
||||
if( pdfJob->m_pdfSingle )
|
||||
{
|
||||
pdfJob->m_pdfGenMode = JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_PAGE_PER_LAYER_ONE_FILE;
|
||||
}
|
||||
else
|
||||
{
|
||||
pdfJob->m_pdfGenMode = JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_SEPARATE_FILE;
|
||||
}
|
||||
}
|
||||
|
||||
m_job->m_useDrillOrigin = m_plotOpts.GetUseAuxOrigin();
|
||||
|
||||
@@ -775,7 +775,7 @@ int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob )
|
||||
brd->GetProject()->ApplyTextVars( aJob->GetVarOverrides() );
|
||||
brd->SynchronizeProperties();
|
||||
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_ONE_PAGE
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_ONE_FILE
|
||||
&& aPdfJob->GetOutputPath().IsEmpty() )
|
||||
{
|
||||
wxFileName fn = brd->GetFileName();
|
||||
@@ -833,7 +833,7 @@ int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob )
|
||||
int returnCode = CLI::EXIT_CODES::OK;
|
||||
|
||||
// DEPRECATED CLI BEHAVIOR AS OF KICAD 9.0, TO BE REMOVED
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_ONE_PAGE )
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_ONE_FILE )
|
||||
{
|
||||
PCB_LAYER_ID layer = UNDEFINED_LAYER;
|
||||
wxString layerName;
|
||||
@@ -922,7 +922,7 @@ int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob )
|
||||
wxString msg;
|
||||
fn.SetName( brdFn.GetName() );
|
||||
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_LAYER_ONE_PAGE )
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_PAGE_PER_LAYER_ONE_FILE )
|
||||
{
|
||||
fn.SetExt( GetDefaultPlotExtension( PLOT_FORMAT::PDF ) );
|
||||
}
|
||||
@@ -932,10 +932,10 @@ int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob )
|
||||
fn.SetName( fn.GetName() + wxString::Format( wxT( "_%s" ), layerName ) );
|
||||
}
|
||||
|
||||
if( ( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_LAYER_ONE_PAGE
|
||||
if( ( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_PAGE_PER_LAYER_ONE_FILE
|
||||
&& i == 0 )
|
||||
|| aPdfJob->m_pdfGenMode
|
||||
== JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_SEPARATE_PAGES )
|
||||
== JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_SEPARATE_FILE )
|
||||
{
|
||||
// this will only be used by pdf
|
||||
wxString pageNumber = wxString::Format( "%zu", pageNum );
|
||||
@@ -970,7 +970,7 @@ int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob )
|
||||
PlotInteractiveLayer( brd, plotter, plotOpts );
|
||||
|
||||
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_LAYER_ONE_PAGE
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_PAGE_PER_LAYER_ONE_FILE
|
||||
&& i != aPdfJob->m_printMaskLayer.size() - 1 )
|
||||
{
|
||||
wxString pageNumber = wxString::Format( "%zu", pageNum + 1 );
|
||||
@@ -986,7 +986,7 @@ int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob )
|
||||
|
||||
|
||||
// last page
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_SEPARATE_PAGES
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ALL_LAYERS_SEPARATE_FILE
|
||||
|| i == aPdfJob->m_printMaskLayer.size() - 1 )
|
||||
{
|
||||
plotter->EndPlot();
|
||||
@@ -1005,7 +1005,7 @@ int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob )
|
||||
|
||||
returnCode = CLI::EXIT_CODES::ERR_UNKNOWN;
|
||||
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_LAYER_ONE_PAGE )
|
||||
if( aPdfJob->m_pdfGenMode == JOB_EXPORT_PCB_PDF::GEN_MODE::ONE_PAGE_PER_LAYER_ONE_FILE )
|
||||
{
|
||||
// bail so we dont continue pointlessly
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user