Browse Source

Fix sch plot output path handling

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19483
pcb_db
Marek Roszko 10 months ago
parent
commit
2ee3ee341a
  1. 1
      common/jobs/job.h
  2. 6
      common/jobs/job_export_sch_plot.cpp
  3. 3
      common/jobs/job_export_sch_plot.h
  4. 12
      eeschema/eeschema_jobs_handler.cpp
  5. 5
      kicad/cli/command_sch_export_plot.cpp

1
common/jobs/job.h

@ -157,6 +157,7 @@ public:
bool OutputPathFullSpecified() const;
bool GetOutpathIsDirectory() const { return m_outputPathIsDirectory; }
protected:
std::string m_type;

6
common/jobs/job_export_sch_plot.cpp

@ -79,8 +79,6 @@ JOB_EXPORT_SCH_PLOT::JOB_EXPORT_SCH_PLOT() :
m_PDFHierarchicalLinks( true ),
m_PDFMetadata( true ),
m_theme(),
m_outputDirectory(),
m_outputFile(),
m_HPGLPlotOrigin( JOB_HPGL_PLOT_ORIGIN_AND_UNITS::USER_FIT_CONTENT )
{
m_params.emplace_back(
@ -106,10 +104,6 @@ JOB_EXPORT_SCH_PLOT::JOB_EXPORT_SCH_PLOT() :
m_PDFHierarchicalLinks ) );
m_params.emplace_back( new JOB_PARAM<bool>( "pdf_metadata", &m_PDFMetadata, m_PDFMetadata ) );
m_params.emplace_back( new JOB_PARAM<wxString>( "color_theme", &m_theme, m_theme ) );
m_params.emplace_back(
new JOB_PARAM<wxString>( "output_filename", &m_outputFile, m_outputFile ) );
m_params.emplace_back(
new JOB_PARAM<wxString>( "output_directory", &m_outputDirectory, m_outputDirectory ) );
m_params.emplace_back( new JOB_PARAM<JOB_HPGL_PLOT_ORIGIN_AND_UNITS>(
"hpgl_plot_origin", &m_HPGLPlotOrigin, m_HPGLPlotOrigin ) );

3
common/jobs/job_export_sch_plot.h

@ -95,9 +95,6 @@ public:
bool m_PDFMetadata;
wxString m_theme;
wxString m_outputDirectory;
wxString m_outputFile;
JOB_HPGL_PLOT_ORIGIN_AND_UNITS m_HPGLPlotOrigin;
};

12
eeschema/eeschema_jobs_handler.cpp

@ -340,8 +340,16 @@ int EESCHEMA_JOBS_HANDLER::JobExportPlot( JOB* aJob )
plotOpts.m_PDFPropertyPopups = aPlotJob->m_PDFPropertyPopups;
plotOpts.m_PDFHierarchicalLinks = aPlotJob->m_PDFHierarchicalLinks;
plotOpts.m_PDFMetadata = aPlotJob->m_PDFMetadata;
plotOpts.m_outputDirectory = aPlotJob->GetFullOutputPath();
plotOpts.m_outputFile = aPlotJob->GetFullOutputPath();
if (aPlotJob->GetOutpathIsDirectory())
{
plotOpts.m_outputDirectory = aPlotJob->GetFullOutputPath();
plotOpts.m_outputFile = wxEmptyString;
}
else
{
plotOpts.m_outputDirectory = wxEmptyString;
plotOpts.m_outputFile = aPlotJob->GetFullOutputPath();
}
plotOpts.m_pageSizeSelect = pageSizeSelect;
plotOpts.m_plotAll = aPlotJob->m_plotAll;
plotOpts.m_plotDrawingSheet = aPlotJob->m_plotDrawingSheet;

5
kicad/cli/command_sch_export_plot.cpp

@ -163,10 +163,7 @@ int CLI::SCH_EXPORT_PLOT_COMMAND::doPerform( KIWAY& aKiway )
plotJob->m_theme = From_UTF8( m_argParser.get<std::string>( ARG_THEME ).c_str() );
}
if( m_outputArgExpectsDir )
plotJob->m_outputDirectory = m_argOutput;
else
plotJob->m_outputFile = m_argOutput;
plotJob->SetOutputPath( m_argOutput );
plotJob->m_plotAll = plotJob->m_plotPages.size() == 0;

Loading…
Cancel
Save