mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 22:03:47 +00:00
Fix output paths in drc/erc jobs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19355
This commit is contained in:
parent
6e2e66dc47
commit
a2b6f63801
@ -84,7 +84,7 @@ void DIALOG_RC_JOB::OnFormatChoice( wxCommandEvent& event )
|
||||
|
||||
bool DIALOG_RC_JOB::TransferDataToWindow()
|
||||
{
|
||||
m_textCtrlOutputPath->SetValue( m_job->m_filename );
|
||||
m_textCtrlOutputPath->SetValue( m_job->GetOutputPath() );
|
||||
setSelectedFormat( m_job->m_format );
|
||||
m_cbHaltOutput->SetValue( m_job->m_exitCodeViolations );
|
||||
|
||||
@ -97,7 +97,7 @@ bool DIALOG_RC_JOB::TransferDataToWindow()
|
||||
|
||||
bool DIALOG_RC_JOB::TransferDataFromWindow()
|
||||
{
|
||||
m_job->m_filename = m_textCtrlOutputPath->GetValue();
|
||||
m_job->SetOutputPath( m_textCtrlOutputPath->GetValue() );
|
||||
m_job->m_format = getSelectedFormat();
|
||||
m_job->m_exitCodeViolations = m_cbHaltOutput->GetValue();
|
||||
|
||||
|
@ -1067,15 +1067,15 @@ int EESCHEMA_JOBS_HANDLER::JobSchErc( JOB* aJob )
|
||||
|
||||
if( ercJob->m_outputFile.IsEmpty() )
|
||||
{
|
||||
wxFileName fn = sch->GetFileName() + wxS( "-erc" );
|
||||
fn.SetName( fn.GetName() );
|
||||
wxFileName fn = sch->GetFileName();
|
||||
fn.SetName( fn.GetName() + wxS( "-erc" ) );
|
||||
|
||||
if( ercJob->m_format == JOB_SCH_ERC::OUTPUT_FORMAT::JSON )
|
||||
fn.SetExt( FILEEXT::JsonFileExtension );
|
||||
else
|
||||
fn.SetExt( FILEEXT::ReportFileExtension );
|
||||
|
||||
ercJob->m_outputFile = fn.GetFullName();
|
||||
ercJob->SetOutputPath( fn.GetFullName() );
|
||||
}
|
||||
|
||||
EDA_UNITS units;
|
||||
@ -1110,19 +1110,20 @@ int EESCHEMA_JOBS_HANDLER::JobSchErc( JOB* aJob )
|
||||
bool wroteReport = false;
|
||||
|
||||
if( ercJob->m_format == JOB_SCH_ERC::OUTPUT_FORMAT::JSON )
|
||||
wroteReport = reportWriter.WriteJsonReport( ercJob->m_outputFile );
|
||||
wroteReport = reportWriter.WriteJsonReport( ercJob->GetFullOutputPath() );
|
||||
else
|
||||
wroteReport = reportWriter.WriteTextReport( ercJob->m_outputFile );
|
||||
wroteReport = reportWriter.WriteTextReport( ercJob->GetFullOutputPath() );
|
||||
|
||||
if( !wroteReport )
|
||||
{
|
||||
m_reporter->Report( wxString::Format( _( "Unable to save ERC report to %s\n" ),
|
||||
ercJob->m_outputFile ),
|
||||
ercJob->GetFullOutputPath() ),
|
||||
RPT_SEVERITY_INFO );
|
||||
return CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT;
|
||||
}
|
||||
|
||||
m_reporter->Report( wxString::Format( _( "Saved ERC Report to %s\n" ), ercJob->m_outputFile ),
|
||||
m_reporter->Report(
|
||||
wxString::Format( _( "Saved ERC Report to %s\n" ), ercJob->GetFullOutputPath() ),
|
||||
RPT_SEVERITY_INFO );
|
||||
|
||||
if( ercJob->m_exitCodeViolations )
|
||||
|
@ -1575,15 +1575,15 @@ int PCBNEW_JOBS_HANDLER::JobExportDrc( JOB* aJob )
|
||||
|
||||
if( drcJob->m_outputFile.IsEmpty() )
|
||||
{
|
||||
wxFileName fn = brd->GetFileName() + wxS( "-drc" );
|
||||
fn.SetName( fn.GetName() );
|
||||
wxFileName fn = brd->GetFileName();
|
||||
fn.SetName( fn.GetName() + wxS( "-drc" ) );
|
||||
|
||||
if( drcJob->m_format == JOB_PCB_DRC::OUTPUT_FORMAT::JSON )
|
||||
fn.SetExt( FILEEXT::JsonFileExtension );
|
||||
else
|
||||
fn.SetExt( FILEEXT::ReportFileExtension );
|
||||
|
||||
drcJob->m_outputFile = fn.GetFullName();
|
||||
drcJob->SetOutputPath( fn.GetFullName() );
|
||||
}
|
||||
|
||||
EDA_UNITS units;
|
||||
@ -1699,20 +1699,19 @@ int PCBNEW_JOBS_HANDLER::JobExportDrc( JOB* aJob )
|
||||
bool wroteReport = false;
|
||||
|
||||
if( drcJob->m_format == JOB_PCB_DRC::OUTPUT_FORMAT::JSON )
|
||||
wroteReport = reportWriter.WriteJsonReport( drcJob->m_outputFile );
|
||||
wroteReport = reportWriter.WriteJsonReport( drcJob->GetFullOutputPath() );
|
||||
else
|
||||
wroteReport = reportWriter.WriteTextReport( drcJob->m_outputFile );
|
||||
wroteReport = reportWriter.WriteTextReport( drcJob->GetFullOutputPath() );
|
||||
|
||||
if( !wroteReport )
|
||||
{
|
||||
m_reporter->Report( wxString::Format( _( "Unable to save DRC report to %s\n" ),
|
||||
drcJob->m_outputFile ),
|
||||
drcJob->GetFullOutputPath() ),
|
||||
RPT_SEVERITY_INFO );
|
||||
return CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT;
|
||||
}
|
||||
|
||||
m_reporter->Report( wxString::Format( _( "Saved DRC Report to %s\n" ),
|
||||
drcJob->m_outputFile ),
|
||||
m_reporter->Report( wxString::Format( _( "Saved DRC Report to %s\n" ), drcJob->GetFullOutputPath() ),
|
||||
RPT_SEVERITY_INFO );
|
||||
|
||||
if( drcJob->m_exitCodeViolations )
|
||||
|
Loading…
Reference in New Issue
Block a user