7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 16:29:18 +00:00

Formatting.

This commit is contained in:
Jeff Young 2025-01-15 16:12:59 +00:00
parent 5f45c2c0d1
commit 3b07401912
2 changed files with 17 additions and 25 deletions

View File

@ -155,9 +155,8 @@ bool JOBS_RUNNER::RunJobsForOutput( JOBSET_OUTPUT* aOutput, bool aBail )
aOutput->m_lastRunSuccessMap.clear();
for( auto& reporter : aOutput->m_lastRunReporters )
{
delete reporter.second;
}
aOutput->m_lastRunReporters.clear();
wxString tempDirPath = tmp.GetFullPath();
@ -183,6 +182,7 @@ bool JOBS_RUNNER::RunJobsForOutput( JOBSET_OUTPUT* aOutput, bool aBail )
msg = wxString::Format( wxT( "Output precheck failed for output %s" ), aOutput->m_id );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
}
aOutput->m_lastRunSuccess = false;
return false;
}
@ -198,12 +198,13 @@ bool JOBS_RUNNER::RunJobsForOutput( JOBSET_OUTPUT* aOutput, bool aBail )
msg += wxString::Format( wxT( "|%-5s | %-50s\n" ), wxT( "No." ), wxT( "Description" ) );
int jobNum = 1;
for( const JOBSET_JOB& job : jobsForOutput )
{
msg += wxString::Format( wxT( "|%-5d | %-50s\n" ), jobNum,
job.GetDescription() );
msg += wxString::Format( wxT( "|%-5d | %-50s\n" ), jobNum, job.GetDescription() );
jobNum++;
}
msg += wxT( "|--------------------------------\n" );
msg += wxT( "\n" );
msg += wxT( "\n" );
@ -216,6 +217,7 @@ bool JOBS_RUNNER::RunJobsForOutput( JOBSET_OUTPUT* aOutput, bool aBail )
int jobNum = 1;
int failCount = 0;
int successCount = 0;
for( const JOBSET_JOB& job : jobsForOutput )
{
if( m_reporter != nullptr )
@ -233,6 +235,7 @@ bool JOBS_RUNNER::RunJobsForOutput( JOBSET_OUTPUT* aOutput, bool aBail )
job.m_job->SetTempOutputDirectory( tempDirPath );
REPORTER* reporterToUse = m_reporter;
if( !reporterToUse || reporterToUse == &NULL_REPORTER::GetInstance() )
{
reporterToUse = new WX_STRING_REPORTER;
@ -240,6 +243,7 @@ bool JOBS_RUNNER::RunJobsForOutput( JOBSET_OUTPUT* aOutput, bool aBail )
}
int result = 0;
if( iface < KIWAY::KIWAY_FACE_COUNT )
{
result = m_kiway->ProcessJob( iface, job.m_job.get(), reporterToUse );
@ -257,14 +261,7 @@ bool JOBS_RUNNER::RunJobsForOutput( JOBSET_OUTPUT* aOutput, bool aBail )
}
}
if( result == 0 )
{
aOutput->m_lastRunSuccessMap[job.m_id] = true;
}
else
{
aOutput->m_lastRunSuccessMap[job.m_id] = false;
}
aOutput->m_lastRunSuccessMap[job.m_id] = result == 0;
if( m_reporter )
{
@ -290,20 +287,14 @@ bool JOBS_RUNNER::RunJobsForOutput( JOBSET_OUTPUT* aOutput, bool aBail )
if( result != 0 )
{
if( aBail )
{
return result;
}
else
{
success = false;
}
}
}
if( success )
{
success = aOutput->m_outputHandler->HandleOutputs( tempDirPath, m_project, outputs );
}
aOutput->m_lastRunSuccess = success;

View File

@ -69,13 +69,16 @@ bool PCB_PLOTTER::Plot( const wxString& aOutputPath,
// To reuse logic, in single plot mode, we want to kick any extra layers from the main list to commonLayers
LSEQ layersToPlot;
LSEQ commonLayers;
if( aOutputPathIsSingle )
{
layersToPlot.push_back( aLayersToPlot[0] );
if( aLayersToPlot.size() > 1 )
{
commonLayers.insert( commonLayers.end(), aLayersToPlot.begin() + 1,
aLayersToPlot.end() );
}
}
else
{
@ -84,9 +87,11 @@ bool PCB_PLOTTER::Plot( const wxString& aOutputPath,
}
size_t finalPageCount = 0;
for( size_t i = 0; i < layersToPlot.size(); i++ )
{
PCB_LAYER_ID layer = layersToPlot[i];
if( copperLayerShouldBeSkipped( layer ) )
continue;
@ -96,15 +101,14 @@ bool PCB_PLOTTER::Plot( const wxString& aOutputPath,
std::unique_ptr<GERBER_JOBFILE_WRITER> jobfile_writer;
if( m_plotOpts.GetFormat() == PLOT_FORMAT::GERBER && !aOutputPathIsSingle )
{
jobfile_writer = std::make_unique<GERBER_JOBFILE_WRITER>( m_board, m_reporter );
}
wxString fileExt( GetDefaultPlotExtension( m_plotOpts.GetFormat() ) );
wxString sheetPath;
wxString msg;
bool success = true;
PLOTTER* plotter = nullptr;
for( size_t i = 0, pageNum = 1; i < layersToPlot.size(); i++ )
{
PCB_LAYER_ID layer = layersToPlot[i];
@ -171,8 +175,7 @@ bool PCB_PLOTTER::Plot( const wxString& aOutputPath,
sheetPath = aSheetPath.value();
plotter = StartPlotBoard( m_board, &m_plotOpts, layer, layerName, fn.GetFullPath(),
sheetName,
sheetPath, pageName, pageNumber, finalPageCount );
sheetName, sheetPath, pageName, pageNumber, finalPageCount );
}
if( plotter )
@ -200,7 +203,6 @@ bool PCB_PLOTTER::Plot( const wxString& aOutputPath,
&& i != layersToPlot.size() - 1 )
{
wxString pageNumber = wxString::Format( "%zu", pageNum + 1 );
size_t nextI = i;
PCB_LAYER_ID nextLayer;
@ -217,8 +219,7 @@ bool PCB_PLOTTER::Plot( const wxString& aOutputPath,
static_cast<PDF_PLOTTER*>( plotter )->ClosePage();
static_cast<PDF_PLOTTER*>( plotter )->StartPage( pageNumber, pageName );
setupPlotterNewPDFPage( plotter, m_board, &m_plotOpts, sheetName, sheetPath,
pageNumber,
finalPageCount );
pageNumber, finalPageCount );
}