diff --git a/pcbnew/pcb_plotter.cpp b/pcbnew/pcb_plotter.cpp index 51a90f4cbc..d213e369f6 100644 --- a/pcbnew/pcb_plotter.cpp +++ b/pcbnew/pcb_plotter.cpp @@ -357,6 +357,19 @@ void PCB_PLOTTER::PlotJobToPlotOpts( PCB_PLOT_PARAMS& aOpts, JOB_EXPORT_PCB_PLOT aOpts.SetIncludeGerberNetlistInfo( gJob->m_includeNetlistAttributes ); aOpts.SetCreateGerberJobFile( gJob->m_createJobsFile ); aOpts.SetGerberPrecision( gJob->m_precision ); + // Always disable plot pad holes + aOpts.SetDrillMarksType( DRILL_MARKS::NO_DRILL_SHAPE ); + } + else + { + // Drill marks doesn't apply to GERBER + switch( aJob->m_drillShapeOption ) + { + case DRILL_MARKS::NO_DRILL_SHAPE: aOpts.SetDrillMarksType( DRILL_MARKS::NO_DRILL_SHAPE ); break; + case DRILL_MARKS::SMALL_DRILL_SHAPE: aOpts.SetDrillMarksType( DRILL_MARKS::SMALL_DRILL_SHAPE ); break; + default: + case DRILL_MARKS::FULL_DRILL_SHAPE: aOpts.SetDrillMarksType( DRILL_MARKS::FULL_DRILL_SHAPE ); break; + } } if( aJob->m_plotFormat == JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::SVG ) @@ -417,14 +430,6 @@ void PCB_PLOTTER::PlotJobToPlotOpts( PCB_PLOT_PARAMS& aOpts, JOB_EXPORT_PCB_PLOT case JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::PDF: aOpts.SetFormat( PLOT_FORMAT::PDF ); break; } - switch( aJob->m_drillShapeOption ) - { - case DRILL_MARKS::NO_DRILL_SHAPE: aOpts.SetDrillMarksType( DRILL_MARKS::NO_DRILL_SHAPE ); break; - case DRILL_MARKS::SMALL_DRILL_SHAPE: aOpts.SetDrillMarksType( DRILL_MARKS::SMALL_DRILL_SHAPE ); break; - default: - case DRILL_MARKS::FULL_DRILL_SHAPE: aOpts.SetDrillMarksType( DRILL_MARKS::FULL_DRILL_SHAPE ); break; - } - SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); wxString theme = aJob->m_colorTheme; diff --git a/pcbnew/pcbnew_jobs_handler.cpp b/pcbnew/pcbnew_jobs_handler.cpp index 75d7743978..ca09a9bdd8 100644 --- a/pcbnew/pcbnew_jobs_handler.cpp +++ b/pcbnew/pcbnew_jobs_handler.cpp @@ -1126,7 +1126,7 @@ int PCBNEW_JOBS_HANDLER::JobExportGerbers( JOB* aJob ) if( aGerberJob->m_useBoardPlotParams ) plotOpts = boardPlotOptions; else - populateGerberPlotOptionsFromJob( plotOpts, aGerberJob ); + PCB_PLOTTER::PlotJobToPlotOpts( plotOpts, aGerberJob, *m_reporter ); if( plotOpts.GetUseGerberProtelExtensions() ) fileExt = GetGerberProtelExtension( layer ); @@ -1247,38 +1247,6 @@ int PCBNEW_JOBS_HANDLER::JobExportGencad( JOB* aJob ) } -void PCBNEW_JOBS_HANDLER::populateGerberPlotOptionsFromJob( PCB_PLOT_PARAMS& aPlotOpts, - JOB_EXPORT_PCB_GERBER* aJob ) -{ - aPlotOpts.SetFormat( PLOT_FORMAT::GERBER ); - - aPlotOpts.SetPlotFrameRef( aJob->m_plotDrawingSheet ); - aPlotOpts.SetPlotValue( aJob->m_plotFootprintValues ); - aPlotOpts.SetPlotReference( aJob->m_plotRefDes ); - - aPlotOpts.SetSubtractMaskFromSilk( aJob->m_subtractSolderMaskFromSilk ); - - // Always disable plot pad holes - aPlotOpts.SetDrillMarksType( DRILL_MARKS::NO_DRILL_SHAPE ); - - aPlotOpts.SetDisableGerberMacros( aJob->m_disableApertureMacros ); - aPlotOpts.SetUseGerberX2format( aJob->m_useX2Format ); - aPlotOpts.SetIncludeGerberNetlistInfo( aJob->m_includeNetlistAttributes ); - aPlotOpts.SetUseAuxOrigin( aJob->m_useDrillOrigin ); - aPlotOpts.SetUseGerberProtelExtensions( aJob->m_useProtelFileExtension ); - aPlotOpts.SetGerberPrecision( aJob->m_precision ); -} - - -void PCBNEW_JOBS_HANDLER::populateGerberPlotOptionsFromJob( PCB_PLOT_PARAMS& aPlotOpts, - JOB_EXPORT_PCB_GERBERS* aJob ) -{ - populateGerberPlotOptionsFromJob( aPlotOpts, static_cast( aJob ) ); - - aPlotOpts.SetCreateGerberJobFile( aJob->m_createJobsFile ); -} - - int PCBNEW_JOBS_HANDLER::JobExportGerber( JOB* aJob ) { int exitCode = CLI::EXIT_CODES::OK; @@ -1318,7 +1286,7 @@ int PCBNEW_JOBS_HANDLER::JobExportGerber( JOB* aJob ) } PCB_PLOT_PARAMS plotOpts; - populateGerberPlotOptionsFromJob( plotOpts, aGerberJob ); + PCB_PLOTTER::PlotJobToPlotOpts( plotOpts, aGerberJob, *m_reporter ); plotOpts.SetLayerSelection( aGerberJob->m_plotLayerSequence ); plotOpts.SetPlotOnAllLayersSequence( aGerberJob->m_plotOnAllLayersSequence );