7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 00:21:31 +00:00

Persist generate-gerber-job-file setting.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20158
This commit is contained in:
Jeff Young 2025-02-28 22:10:02 +00:00
parent 6e66b22a13
commit c0e4c6a865
3 changed files with 23 additions and 5 deletions

View File

@ -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 ) );
}

View File

@ -1074,11 +1074,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;
}
@ -1162,6 +1165,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;

View File

@ -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 );