Browse Source

Persist generate-gerber-job-file setting.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20158

(cherry picked from commit c0e4c6a865)
9.0
Jeff Young 8 months ago
parent
commit
0c2edf8e5c
  1. 3
      common/jobs/job_export_pcb_gerbers.cpp
  2. 20
      pcbnew/pcbnew_jobs_handler.cpp
  3. 5
      pcbnew/pcbnew_jobs_handler.h

3
common/jobs/job_export_pcb_gerbers.cpp

@ -34,6 +34,9 @@ JOB_EXPORT_PCB_GERBERS::JOB_EXPORT_PCB_GERBERS() :
m_params.emplace_back( new JOB_PARAM_LSEQ( "layers_include_on_all", &m_layersIncludeOnAll,
m_layersIncludeOnAll ) );
m_params.emplace_back( new JOB_PARAM<bool>( "create_gerber_job_file", &m_createJobsFile,
m_createJobsFile ) );
}

20
pcbnew/pcbnew_jobs_handler.cpp

@ -1065,11 +1065,14 @@ int PCBNEW_JOBS_HANDLER::JobExportGerbers( JOB* aJob )
delete plotter;
}
wxFileName fn( brd->GetFileName() );
if( aGerberJob->m_createJobsFile )
{
wxFileName fn( brd->GetFileName() );
// Build gerber job file from basename
BuildPlotFileName( &fn, outPath, wxT( "job" ), FILEEXT::GerberJobFileExtension );
jobfile_writer.CreateJobFile( fn.GetFullPath() );
// Build gerber job file from basename
BuildPlotFileName( &fn, outPath, wxT( "job" ), FILEEXT::GerberJobFileExtension );
jobfile_writer.CreateJobFile( fn.GetFullPath() );
}
return exitCode;
}
@ -1153,6 +1156,15 @@ void PCBNEW_JOBS_HANDLER::populateGerberPlotOptionsFromJob( PCB_PLOT_PARAMS& aPl
}
void PCBNEW_JOBS_HANDLER::populateGerberPlotOptionsFromJob( PCB_PLOT_PARAMS& aPlotOpts,
JOB_EXPORT_PCB_GERBERS* aJob )
{
populateGerberPlotOptionsFromJob( aPlotOpts, static_cast<JOB_EXPORT_PCB_GERBER*>( aJob ) );
aPlotOpts.SetCreateGerberJobFile( aJob->m_createJobsFile );
}
int PCBNEW_JOBS_HANDLER::JobExportGerber( JOB* aJob )
{
int exitCode = CLI::EXIT_CODES::OK;

5
pcbnew/pcbnew_jobs_handler.h

@ -29,6 +29,7 @@ class BOARD;
class DS_PROXY_VIEW_ITEM;
class FOOTPRINT;
class JOB_EXPORT_PCB_GERBER;
class JOB_EXPORT_PCB_GERBERS;
class JOB_FP_EXPORT_SVG;
class PCBNEW_JOBS_HANDLER : public JOB_DISPATCHER
@ -54,8 +55,10 @@ public:
private:
BOARD* getBoard( const wxString& aPath = wxEmptyString );
void populateGerberPlotOptionsFromJob( PCB_PLOT_PARAMS& aPlotOpts,
void populateGerberPlotOptionsFromJob( PCB_PLOT_PARAMS& aPlotOpts,
JOB_EXPORT_PCB_GERBER* aJob );
void populateGerberPlotOptionsFromJob( PCB_PLOT_PARAMS& aPlotOpts,
JOB_EXPORT_PCB_GERBERS* aJob );
int doFpExportSvg( JOB_FP_EXPORT_SVG* aSvgJob, const FOOTPRINT* aFootprint );
void loadOverrideDrawingSheet( BOARD* brd, const wxString& aSheetPath );

Loading…
Cancel
Save