Fix compil issues, especially on Windows:

Replace SEVERITY_ERROR by RPT_SEVERITY_ERROR to avoid collision with a system definition.
Replace other SEVERITY_XXX by RPT_SEVERITY_XX for consistency.
Fix compil warnings and some other compil issues.
This commit is contained in:
jean-pierre charras 2020-03-04 10:48:18 +01:00
parent 21469efa63
commit b7cd0c54c2
44 changed files with 283 additions and 280 deletions

View File

@ -50,7 +50,7 @@ public:
m_hasMessage = false;
}
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED ) override
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) override
{
if( !aText.IsEmpty() )
m_hasMessage = true;

View File

@ -565,7 +565,7 @@ bool EnsureFileDirectoryExists( wxFileName* aTargetFullFileName,
msg.Printf( _( "Cannot make path \"%s\" absolute with respect to \"%s\"." ),
aTargetFullFileName->GetPath(),
baseFilePath );
aReporter->Report( msg, SEVERITY_ERROR );
aReporter->Report( msg, RPT_SEVERITY_ERROR );
}
return false;
@ -581,7 +581,7 @@ bool EnsureFileDirectoryExists( wxFileName* aTargetFullFileName,
if( aReporter )
{
msg.Printf( _( "Output directory \"%s\" created.\n" ), outputPath );
aReporter->Report( msg, SEVERITY_INFO );
aReporter->Report( msg, RPT_SEVERITY_INFO );
return true;
}
}
@ -590,7 +590,7 @@ bool EnsureFileDirectoryExists( wxFileName* aTargetFullFileName,
if( aReporter )
{
msg.Printf( _( "Cannot create output directory \"%s\".\n" ), outputPath );
aReporter->Report( msg, SEVERITY_ERROR );
aReporter->Report( msg, RPT_SEVERITY_ERROR );
}
return false;

View File

@ -132,11 +132,11 @@ void WX_HTML_REPORT_PANEL::scrollToBottom()
void WX_HTML_REPORT_PANEL::updateBadges()
{
int count = Count( SEVERITY_ERROR );
m_errorsBadge->SetBitmap( MakeBadge( SEVERITY_ERROR, count, m_errorsBadge, 2 ) );
int count = Count(RPT_SEVERITY_ERROR );
m_errorsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_ERROR, count, m_errorsBadge, 2 ) );
count = Count( SEVERITY_WARNING );
m_warningsBadge->SetBitmap( MakeBadge( SEVERITY_WARNING, count, m_warningsBadge, 2 ) );
count = Count(RPT_SEVERITY_WARNING );
m_warningsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_WARNING, count, m_warningsBadge, 2 ) );
}
@ -173,19 +173,19 @@ wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine )
switch( aLine.severity )
{
case SEVERITY_ERROR:
case RPT_SEVERITY_ERROR:
retv = "<font color=\"red\" size=2><b>" + _( "Error: " ) + "</b></font><font size=2>" +
aLine.message + "</font><br>";
break;
case SEVERITY_WARNING:
case RPT_SEVERITY_WARNING:
retv = "<font color=\"orange\" size=2><b>" + _( "Warning: " ) +
"</b></font><font size=2>" + aLine.message + "</font><br>";
break;
case SEVERITY_INFO:
case RPT_SEVERITY_INFO:
retv = "<font color=\"dark gray\" size=2><b>" + _( "Info: " ) + "</b>" + aLine.message +
"</font><br>";
break;
case SEVERITY_ACTION:
case RPT_SEVERITY_ACTION:
retv = "<font color=\"dark green\" size=2>" + aLine.message + "</font><br>";
break;
default:
@ -200,11 +200,11 @@ wxString WX_HTML_REPORT_PANEL::generatePlainText( const REPORT_LINE& aLine )
{
switch( aLine.severity )
{
case SEVERITY_ERROR:
case RPT_SEVERITY_ERROR:
return _( "Error: " ) + aLine.message + wxT( "\n" );
case SEVERITY_WARNING:
case RPT_SEVERITY_WARNING:
return _( "Warning: " ) + aLine.message + wxT( "\n" );
case SEVERITY_INFO:
case RPT_SEVERITY_INFO:
return _( "Info: " ) + aLine.message + wxT( "\n" );
default:
return aLine.message + wxT( "\n" );
@ -237,15 +237,15 @@ void WX_HTML_REPORT_PANEL::onMenuEvent( wxMenuEvent& event )
// Don't globally define this; different facilities use different definitions of "ALL"
static int SEVERITY_ALL = SEVERITY_WARNING | SEVERITY_ERROR | SEVERITY_INFO | SEVERITY_ACTION;
static int RPT_SEVERITY_ALL = RPT_SEVERITY_WARNING | RPT_SEVERITY_ERROR | RPT_SEVERITY_INFO | RPT_SEVERITY_ACTION;
void WX_HTML_REPORT_PANEL::onCheckBoxShowAll( wxCommandEvent& event )
{
if( event.IsChecked() )
m_severities = SEVERITY_ALL;
m_severities = RPT_SEVERITY_ALL;
else
m_severities = SEVERITY_ERROR;
m_severities = RPT_SEVERITY_ERROR;
syncCheckboxes();
Flush( true );
@ -254,20 +254,20 @@ void WX_HTML_REPORT_PANEL::onCheckBoxShowAll( wxCommandEvent& event )
void WX_HTML_REPORT_PANEL::syncCheckboxes()
{
m_checkBoxShowAll->SetValue( m_severities == SEVERITY_ALL );
m_checkBoxShowWarnings->SetValue( m_severities & SEVERITY_WARNING );
m_checkBoxShowErrors->SetValue( m_severities & SEVERITY_ERROR );
m_checkBoxShowInfos->SetValue( m_severities & SEVERITY_INFO );
m_checkBoxShowActions->SetValue( m_severities & SEVERITY_ACTION );
m_checkBoxShowAll->SetValue( m_severities == RPT_SEVERITY_ALL );
m_checkBoxShowWarnings->SetValue( m_severities & RPT_SEVERITY_WARNING );
m_checkBoxShowErrors->SetValue( m_severities & RPT_SEVERITY_ERROR );
m_checkBoxShowInfos->SetValue( m_severities & RPT_SEVERITY_INFO );
m_checkBoxShowActions->SetValue( m_severities & RPT_SEVERITY_ACTION );
}
void WX_HTML_REPORT_PANEL::onCheckBoxShowWarnings( wxCommandEvent& event )
{
if( event.IsChecked() )
m_severities |= SEVERITY_WARNING;
m_severities |= RPT_SEVERITY_WARNING;
else
m_severities &= ~SEVERITY_WARNING;
m_severities &= ~RPT_SEVERITY_WARNING;
syncCheckboxes();
Flush( true );
@ -277,9 +277,9 @@ void WX_HTML_REPORT_PANEL::onCheckBoxShowWarnings( wxCommandEvent& event )
void WX_HTML_REPORT_PANEL::onCheckBoxShowErrors( wxCommandEvent& event )
{
if( event.IsChecked() )
m_severities |= SEVERITY_ERROR;
m_severities |= RPT_SEVERITY_ERROR;
else
m_severities &= ~SEVERITY_ERROR;
m_severities &= ~RPT_SEVERITY_ERROR;
syncCheckboxes();
Flush( true );
@ -289,9 +289,9 @@ void WX_HTML_REPORT_PANEL::onCheckBoxShowErrors( wxCommandEvent& event )
void WX_HTML_REPORT_PANEL::onCheckBoxShowInfos( wxCommandEvent& event )
{
if( event.IsChecked() )
m_severities |= SEVERITY_INFO;
m_severities |= RPT_SEVERITY_INFO;
else
m_severities &= ~SEVERITY_INFO;
m_severities &= ~RPT_SEVERITY_INFO;
syncCheckboxes();
Flush( true );
@ -301,9 +301,9 @@ void WX_HTML_REPORT_PANEL::onCheckBoxShowInfos( wxCommandEvent& event )
void WX_HTML_REPORT_PANEL::onCheckBoxShowActions( wxCommandEvent& event )
{
if( event.IsChecked() )
m_severities |= SEVERITY_ACTION;
m_severities |= RPT_SEVERITY_ACTION;
else
m_severities &= ~SEVERITY_ACTION;
m_severities &= ~RPT_SEVERITY_ACTION;
syncCheckboxes();
Flush( true );
@ -363,7 +363,7 @@ void WX_HTML_REPORT_PANEL::SetLabel( const wxString& aLabel )
void WX_HTML_REPORT_PANEL::SetVisibleSeverities( int aSeverities )
{
if( aSeverities < 0 )
m_severities = SEVERITY_ALL;
m_severities = RPT_SEVERITY_ALL;
else
m_severities = aSeverities;

View File

@ -93,7 +93,7 @@ REPORTER& WX_HTML_PANEL_REPORTER::ReportHead( const wxString& aText, SEVERITY aS
bool WX_HTML_PANEL_REPORTER::HasMessage() const
{
return m_panel->Count( SEVERITY_ERROR | SEVERITY_WARNING ) > 0;
return m_panel->Count( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) > 0;
}
REPORTER& NULL_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
@ -116,11 +116,13 @@ REPORTER& STDOUT_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
{
switch( aSeverity )
{
case SEVERITY_UNDEFINED: std::cout << "SEVERITY_UNDEFINED: "; break;
case SEVERITY_INFO: std::cout << "SEVERITY_INFO: "; break;
case SEVERITY_WARNING: std::cout << "SEVERITY_WARNING: "; break;
case SEVERITY_ERROR: std::cout << "SEVERITY_ERROR: "; break;
case SEVERITY_ACTION: std::cout << "SEVERITY_ACTION: "; break;
case RPT_SEVERITY_UNDEFINED: std::cout << "SEVERITY_UNDEFINED: "; break;
case RPT_SEVERITY_INFO: std::cout << "SEVERITY_INFO: "; break;
case RPT_SEVERITY_WARNING: std::cout << "SEVERITY_WARNING: "; break;
case RPT_SEVERITY_ERROR: std::cout << "SEVERITY_ERROR: "; break;
case RPT_SEVERITY_ACTION: std::cout << "SEVERITY_ACTION: "; break;
case RPT_SEVERITY_EXCLUSION:
case RPT_SEVERITY_IGNORE: break;
}
std::cout << aText << std::endl;

View File

@ -64,20 +64,20 @@ wxBitmap MakeBadge( SEVERITY aStyle, int aCount, wxWindow* aWindow, int aDepth )
switch( aStyle )
{
case SEVERITY_ERROR:
case RPT_SEVERITY_ERROR:
badgeColour = *wxRED;
textColour = *wxWHITE;
break;
case SEVERITY_WARNING:
case RPT_SEVERITY_WARNING:
badgeColour = *wxYELLOW;
textColour = *wxBLACK;
break;
case SEVERITY_ACTION:
case RPT_SEVERITY_ACTION:
badgeColour = *wxGREEN;
textColour = *wxWHITE;
break;
case SEVERITY_EXCLUSION:
case SEVERITY_INFO:
case RPT_SEVERITY_EXCLUSION:
case RPT_SEVERITY_INFO:
default:
badgeColour = *wxLIGHT_GREY;
textColour = *wxBLACK;

View File

@ -114,7 +114,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
{
wxString msg;
msg.Printf( _( "%d duplicate time stamps were found and replaced." ), count );
aReporter.ReportTail( msg, SEVERITY_WARNING );
aReporter.ReportTail( msg, RPT_SEVERITY_WARNING );
}
}
@ -221,12 +221,12 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
newRef );
}
aReporter.Report( msg, SEVERITY_ACTION );
aReporter.Report( msg, RPT_SEVERITY_ACTION );
}
// Final control (just in case ... ).
if( !CheckAnnotate( aReporter, !aAnnotateSchematic ) )
aReporter.ReportTail( _( "Annotation complete." ), SEVERITY_ACTION );
aReporter.ReportTail( _( "Annotation complete." ), RPT_SEVERITY_ACTION );
// Update on screen references, that can be modified by previous calculations:
g_CurrentSheet->UpdateAllScreenReferences();

View File

@ -525,7 +525,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
tmp );
}
aReporter.Report( msg, SEVERITY_WARNING );
aReporter.Report( msg, RPT_SEVERITY_WARNING );
error++;
break;
}
@ -547,7 +547,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
flatList[ii].m_Unit,
flatList[ii].GetLibPart()->GetUnitCount() );
aReporter.Report( msg, SEVERITY_ERROR );
aReporter.Report( msg, RPT_SEVERITY_ERROR );
error++;
break;
}
@ -591,7 +591,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
tmp );
}
aReporter.Report( msg, SEVERITY_ERROR );
aReporter.Report( msg, RPT_SEVERITY_ERROR );
error++;
continue;
}
@ -621,7 +621,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
tmp );
}
aReporter.Report( msg, SEVERITY_ERROR );
aReporter.Report( msg, RPT_SEVERITY_ERROR );
error++;
}
@ -640,7 +640,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
LIB_PART::SubReference( flatList[next].m_Unit ),
flatList[next].m_Value->GetText() );
aReporter.Report( msg, SEVERITY_ERROR );
aReporter.Report( msg, RPT_SEVERITY_ERROR );
error++;
}
}

View File

@ -489,7 +489,7 @@ void DIALOG_ERC::TestErc( REPORTER& aReporter )
if( m_parent->CheckAnnotate( aReporter, false ) )
{
if( aReporter.HasMessage() )
aReporter.ReportTail( _( "Annotation required!" ), SEVERITY_ERROR );
aReporter.ReportTail( _( "Annotation required!" ), RPT_SEVERITY_ERROR );
return;
}
@ -622,7 +622,7 @@ void DIALOG_ERC::TestErc( REPORTER& aReporter )
m_parent->GetCanvas()->Refresh();
// Display message
aReporter.ReportTail( _( "Finished" ), SEVERITY_INFO );
aReporter.ReportTail( _( "Finished" ), RPT_SEVERITY_INFO );
if( m_settings.write_erc_file )
{

View File

@ -331,7 +331,7 @@ wxFileName DIALOG_PLOT_SCHEMATIC::createPlotFileName( wxTextCtrl* aOutputDirecto
{
wxString msg = wxString::Format( _( "Could not write plot files to folder \"%s\"." ),
outputDir.GetPath() );
aReporter->Report( msg, SEVERITY_ERROR );
aReporter->Report( msg, RPT_SEVERITY_ERROR );
}
wxFileName fn( plotFileName );

View File

@ -203,7 +203,7 @@ void DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable( REPORTER& aReporter )
{
msg.Printf( _( "Adding library \"%s\", file \"%s\" to project symbol library table." ),
libName, fullFileName );
aReporter.Report( msg, SEVERITY_INFO );
aReporter.Report( msg, RPT_SEVERITY_INFO );
prjLibTable.InsertRow( new SYMBOL_LIB_TABLE_ROW( libName, fullFileName,
pluginType ) );
@ -211,7 +211,7 @@ void DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable( REPORTER& aReporter )
else
{
msg.Printf( _( "Library \"%s\" not found." ), fullFileName );
aReporter.Report( msg, SEVERITY_WARNING );
aReporter.Report( msg, RPT_SEVERITY_WARNING );
}
}
@ -229,10 +229,10 @@ void DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable( REPORTER& aReporter )
{
msg.Printf( _( "Failed to write project symbol library table. Error:\n %s" ),
ioe.What() );
aReporter.ReportTail( msg, SEVERITY_ERROR );
aReporter.ReportTail( msg, RPT_SEVERITY_ERROR );
}
aReporter.ReportTail( _( "Created project symbol library table.\n" ), SEVERITY_INFO );
aReporter.ReportTail( _( "Created project symbol library table.\n" ), RPT_SEVERITY_INFO );
}
}
}
@ -255,20 +255,20 @@ void DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable( REPORTER& aReporter )
{
msg.Printf( _( "No symbol \"%s\" found in symbol library table." ),
symbol->GetLibId().GetLibItemName().wx_str() );
aReporter.Report( msg, SEVERITY_WARNING );
aReporter.Report( msg, RPT_SEVERITY_WARNING );
}
else
{
msg.Printf( _( "Symbol \"%s\" mapped to symbol library \"%s\"." ),
symbol->GetLibId().GetLibItemName().wx_str(),
symbol->GetLibId().GetLibNickname().wx_str() );
aReporter.Report( msg,SEVERITY_ACTION );
aReporter.Report( msg, RPT_SEVERITY_ACTION );
screen->SetModify();
}
}
}
aReporter.Report( _( "Symbol library table mapping complete!" ), SEVERITY_INFO );
aReporter.Report( _( "Symbol library table mapping complete!" ), RPT_SEVERITY_INFO );
schematic.UpdateSymbolLinks( true );
}
@ -363,7 +363,7 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter )
tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
srcFileName.GetFullPath(), destFileName.GetFullPath() );
aReporter.Report( tmp, SEVERITY_INFO );
aReporter.Report( tmp, RPT_SEVERITY_INFO );
if( wxFileName::Exists( srcFileName.GetFullPath() )
&& !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
@ -396,7 +396,7 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter )
tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
screen->GetFileName(), destFileName.GetFullPath() );
aReporter.Report( tmp, SEVERITY_INFO );
aReporter.Report( tmp, RPT_SEVERITY_INFO );
if( !destFileName.DirExists() && !destFileName.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) )
{
@ -420,7 +420,7 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter )
tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
Prj().GetProjectFullName(), destFileName.GetFullPath() );
aReporter.Report( tmp, SEVERITY_INFO );
aReporter.Report( tmp, RPT_SEVERITY_INFO );
if( wxFileName::Exists( Prj().GetProjectFullName() )
&& !wxCopyFile( Prj().GetProjectFullName(), destFileName.GetFullPath() ) )
@ -440,7 +440,7 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter )
tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
srcFileName.GetFullPath(), destFileName.GetFullPath() );
aReporter.Report( tmp, SEVERITY_INFO );
aReporter.Report( tmp, RPT_SEVERITY_INFO );
if( srcFileName.Exists()
&& !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
@ -456,7 +456,7 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter )
tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
srcFileName.GetFullPath(),
destFileName.GetFullPath() );
aReporter.Report( tmp, SEVERITY_INFO );
aReporter.Report( tmp, RPT_SEVERITY_INFO );
if( srcFileName.Exists()
&& !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
@ -472,7 +472,7 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter )
tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
srcFileName.GetFullPath(),
destFileName.GetFullPath() );
aReporter.Report( tmp, SEVERITY_INFO );
aReporter.Report( tmp, RPT_SEVERITY_INFO );
if( srcFileName.Exists()
&& !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )

View File

@ -119,33 +119,33 @@ bool SCH_EDIT_FRAME::WriteNetListFile( NETLIST_OBJECT_LIST* aConnectedItemsList,
msg << _( "Run command:" ) << wxT( "\n" ) << commandLine << wxT( "\n\n" );
aReporter->ReportHead( msg, SEVERITY_ACTION );
aReporter->ReportHead( msg, RPT_SEVERITY_ACTION );
if( diag != 0 )
aReporter->ReportTail( wxString::Format(
_("Command error. Return code %d" ), diag ),
SEVERITY_ERROR );
RPT_SEVERITY_ERROR );
else
aReporter->ReportTail( _( "Success" ), SEVERITY_INFO );
aReporter->ReportTail( _( "Success" ), RPT_SEVERITY_INFO );
if( output.GetCount() )
{
msg.Empty();
msg << wxT( "\n" ) << _( "Info messages:" ) << wxT( "\n" );
aReporter->Report( msg, SEVERITY_INFO );
aReporter->Report( msg, RPT_SEVERITY_INFO );
for( unsigned ii = 0; ii < output.GetCount(); ii++ )
aReporter->Report( output[ii] + wxT( "\n" ), SEVERITY_INFO );
aReporter->Report( output[ii] + wxT( "\n" ), RPT_SEVERITY_INFO );
}
if( errors.GetCount() )
{
msg.Empty();
msg << wxT("\n") << _( "Error messages:" ) << wxT( "\n" );
aReporter->Report( msg, SEVERITY_INFO );
aReporter->Report( msg, RPT_SEVERITY_INFO );
for( unsigned ii = 0; ii < errors.GetCount(); ii++ )
aReporter->Report( errors[ii] + wxT( "\n" ), SEVERITY_ERROR );
aReporter->Report( errors[ii] + wxT( "\n" ), RPT_SEVERITY_ERROR );
}
}
else

View File

@ -77,18 +77,18 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
aPlotFrameRef ) )
{
msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
reporter.Report( msg, SEVERITY_ACTION );
reporter.Report( msg, RPT_SEVERITY_ACTION );
}
else // Error
{
msg.Printf( _( "Unable to create file \"%s\".\n" ), plotFileName.GetFullPath() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
}
catch( IO_ERROR& e )
{
msg.Printf( wxT( "DXF Plotter exception: %s"), e.What() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
schframe->SetCurrentSheet( oldsheetpath );
schframe->GetCurrentSheet().UpdateAllScreenReferences();
schframe->SetSheetNumberAndCount();

View File

@ -149,18 +149,18 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
plot_scale, aPlotFrameRef ) )
{
msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
reporter.Report( msg, SEVERITY_ACTION );
reporter.Report( msg, RPT_SEVERITY_ACTION );
}
else
{
msg.Printf( _( "Unable to create file \"%s\".\n" ), plotFileName.GetFullPath() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
}
catch( IO_ERROR& e )
{
msg.Printf( wxT( "HPGL Plotter exception: %s"), e.What() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
}

View File

@ -88,7 +88,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
if( !plotter->OpenFile( plotFileName.GetFullPath() ) )
{
msg.Printf( _( "Unable to create file \"%s\".\n" ), plotFileName.GetFullPath() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
delete plotter;
return;
}
@ -101,7 +101,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
{
// Cannot plot PDF file
msg.Printf( wxT( "PDF Plotter exception: %s" ), e.What() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
restoreEnvironment( plotter, oldsheetpath );
return;
@ -122,7 +122,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
// Everything done, close the plot and restore the environment
msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
reporter.Report( msg, SEVERITY_ACTION );
reporter.Report( msg, RPT_SEVERITY_ACTION );
restoreEnvironment( plotter, oldsheetpath );
}

View File

@ -104,20 +104,20 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
scale, aPlotFrameRef ) )
{
msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
reporter.Report( msg, SEVERITY_ACTION );
reporter.Report( msg, RPT_SEVERITY_ACTION );
}
else
{
// Error
msg.Printf( _( "Unable to create file \"%s\".\n" ), plotFileName.GetFullPath() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
}
catch( IO_ERROR& e )
{
msg.Printf( wxT( "PS Plotter exception: %s"), e.What() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
}

View File

@ -74,19 +74,19 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
if( !success )
{
msg.Printf( _( "Cannot create file \"%s\".\n" ), plotFileName.GetFullPath() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
else
{
msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
reporter.Report( msg, SEVERITY_ACTION );
reporter.Report( msg, RPT_SEVERITY_ACTION );
}
}
catch( const IO_ERROR& e )
{
// Cannot plot SVG file
msg.Printf( wxT( "SVG Plotter exception: %s" ), e.What() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
break;
}
}

View File

@ -61,7 +61,7 @@ public:
{
}
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED ) override
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) override
{
wxCommandEvent* event = new wxCommandEvent( EVT_SIM_REPORT );
event->SetString( aText );

View File

@ -61,7 +61,7 @@ bool BACK_ANNOTATE::BackAnnotateSymbols( const std::string& aNetlist )
&& !m_settings.processReferences )
{
m_settings.reporter.ReportTail(
_( "Select at least one property to back annotate" ), SEVERITY_ERROR );
_( "Select at least one property to back annotate" ), RPT_SEVERITY_ERROR );
return false;
}
@ -85,16 +85,16 @@ bool BACK_ANNOTATE::BackAnnotateSymbols( const std::string& aNetlist )
if( !m_settings.dryRun )
{
msg.Printf( _( "Schematic is back-annotated. %d changes applied." ), m_changesCount );
m_settings.reporter.ReportTail( msg, SEVERITY_ACTION );
m_settings.reporter.ReportTail( msg, RPT_SEVERITY_ACTION );
}
else
m_settings.reporter.ReportTail(
_( "No errors during dry run. Ready to go." ), SEVERITY_ACTION );
_( "No errors during dry run. Ready to go." ), RPT_SEVERITY_ACTION );
}
else
{
msg.Printf( _( "Found %d errors. Fix them and run back annotation." ), errors );
m_settings.reporter.ReportTail( msg, SEVERITY_ERROR );
m_settings.reporter.ReportTail( msg, RPT_SEVERITY_ERROR );
}
return !errors;
@ -149,7 +149,7 @@ int BACK_ANNOTATE::getPcbModulesFromString( const std::string& aPayload )
if( path == "" )
{
msg.Printf( _( "Footprint \"%s\" has no symbol associated." ), ref );
m_settings.reporter.ReportHead( msg, SEVERITY_WARNING );
m_settings.reporter.ReportHead( msg, RPT_SEVERITY_WARNING );
continue;
}
footprint = UTF8( item.second.get_child( "fpid" ).front().first );
@ -168,7 +168,7 @@ int BACK_ANNOTATE::getPcbModulesFromString( const std::string& aPayload )
// Module with this path already exists - generate error
msg.Printf( _( "Pcb footprints \"%s\" and \"%s\" linked to same symbol" ),
nearestItem->second->ref, ref );
m_settings.reporter.ReportHead( msg, SEVERITY_ERROR );
m_settings.reporter.ReportHead( msg, RPT_SEVERITY_ERROR );
++errors;
}
else
@ -223,7 +223,7 @@ int BACK_ANNOTATE::getChangeList()
wxString msg;
msg.Printf( _( "Cannot find symbol for \"%s\" footprint" ), pcbData->ref );
++errors;
m_settings.reporter.ReportTail( msg, SEVERITY_ERROR );
m_settings.reporter.ReportTail( msg, RPT_SEVERITY_ERROR );
}
}
return errors;
@ -248,7 +248,7 @@ int BACK_ANNOTATE::checkForUnusedSymbols()
++errors;
wxString msg;
msg.Printf( _( "Cannot find footprint for \"%s\" symbol" ), m_refs[i++].GetFullRef() );
m_settings.reporter.ReportTail( msg, SEVERITY_ERROR );
m_settings.reporter.ReportTail( msg, RPT_SEVERITY_ERROR );
}
++i;
@ -310,7 +310,7 @@ int BACK_ANNOTATE::checkSharedSchematicErrors()
msg.Printf( _( "\"%s\" and \"%s\" use the same schematic symbol.\n"
"They cannot have different footprints or values." ),
( it + 1 )->second->ref, it->second->ref );
m_settings.reporter.ReportTail( msg, SEVERITY_ERROR );
m_settings.reporter.ReportTail( msg, RPT_SEVERITY_ERROR );
}
}
else
@ -328,7 +328,7 @@ int BACK_ANNOTATE::checkSharedSchematicErrors()
msg.Printf( _( "Unable to change \"%s\" footprint or value because associated"
" symbol is reused in the another project" ),
it->second->ref );
m_settings.reporter.ReportTail( msg, SEVERITY_ERROR );
m_settings.reporter.ReportTail( msg, RPT_SEVERITY_ERROR );
++errors;
}
}
@ -359,7 +359,7 @@ void BACK_ANNOTATE::applyChangelist()
msg.Printf( _( "Change \"%s\" reference to \"%s\"." ), ref.GetFullRef(), module.ref );
if( !m_settings.dryRun )
ref.GetComp()->SetRef( &ref.GetSheetPath(), module.ref );
m_settings.reporter.ReportHead( msg, SEVERITY_ACTION );
m_settings.reporter.ReportHead( msg, RPT_SEVERITY_ACTION );
}
if( m_settings.processFootprints && oldFootprint != module.footprint )
@ -370,7 +370,7 @@ void BACK_ANNOTATE::applyChangelist()
if( !m_settings.dryRun )
ref.GetComp()->GetField( FOOTPRINT )->SetText( module.footprint );
m_settings.reporter.ReportHead( msg, SEVERITY_ACTION );
m_settings.reporter.ReportHead( msg, RPT_SEVERITY_ACTION );
}
if( m_settings.processValues && oldValue != module.value )
@ -380,12 +380,12 @@ void BACK_ANNOTATE::applyChangelist()
getTextFromField( ref, VALUE ), module.value );
if( !m_settings.dryRun )
item.first.GetComp()->GetField( VALUE )->SetText( module.value );
m_settings.reporter.ReportHead( msg, SEVERITY_ACTION );
m_settings.reporter.ReportHead( msg, RPT_SEVERITY_ACTION );
}
if( changesCountBefore == m_changesCount )
++leftUnchanged;
}
msg.Printf( _( "%d symbols left unchanged" ), leftUnchanged );
m_settings.reporter.ReportHead( msg, SEVERITY_INFO );
m_settings.reporter.ReportHead( msg, RPT_SEVERITY_INFO );
}

View File

@ -308,7 +308,7 @@ bool GERBVIEW_FRAME::loadListOfGerberAndDrillFiles( const wxString& aPath,
wxString warning;
warning << "<b>" << _( "File not found:" ) << "</b><br>"
<< filename.GetFullPath() << "<br>";
reporter.Report( warning, SEVERITY_WARNING );
reporter.Report( warning, RPT_SEVERITY_WARNING );
success = false;
continue;
}
@ -350,7 +350,7 @@ bool GERBVIEW_FRAME::loadListOfGerberAndDrillFiles( const wxString& aPath,
if( layer == NO_AVAILABLE_LAYERS && ii < aFilenameList.GetCount()-1 )
{
success = false;
reporter.Report( MSG_NO_MORE_LAYER, SEVERITY_ERROR );
reporter.Report( MSG_NO_MORE_LAYER, RPT_SEVERITY_ERROR );
// Report the name of not loaded files:
ii += 1;
@ -358,7 +358,7 @@ bool GERBVIEW_FRAME::loadListOfGerberAndDrillFiles( const wxString& aPath,
{
filename = aFilenameList[ii++];
wxString txt = wxString::Format( MSG_NOT_LOADED, filename.GetFullName() );
reporter.Report( txt, SEVERITY_ERROR );
reporter.Report( txt, RPT_SEVERITY_ERROR );
}
break;
}
@ -471,7 +471,7 @@ bool GERBVIEW_FRAME::LoadExcellonFiles( const wxString& aFullFileName )
if( layer == NO_AVAILABLE_LAYERS && ii < filenamesList.GetCount()-1 )
{
success = false;
reporter.Report( MSG_NO_MORE_LAYER, SEVERITY_ERROR );
reporter.Report( MSG_NO_MORE_LAYER, RPT_SEVERITY_ERROR );
// Report the name of not loaded files:
ii += 1;
@ -479,7 +479,7 @@ bool GERBVIEW_FRAME::LoadExcellonFiles( const wxString& aFullFileName )
{
filename = filenamesList[ii++];
wxString txt = wxString::Format( MSG_NOT_LOADED, filename.GetFullName() );
reporter.Report( txt, SEVERITY_ERROR );
reporter.Report( txt, RPT_SEVERITY_ERROR );
}
break;
}
@ -522,7 +522,7 @@ bool GERBVIEW_FRAME::unarchiveFiles( const wxString& aFullFileName, REPORTER* aR
if( aReporter )
{
msg.Printf( _( "Zip file \"%s\" cannot be opened" ), aFullFileName );
aReporter->Report( msg, SEVERITY_ERROR );
aReporter->Report( msg, RPT_SEVERITY_ERROR );
}
return false;
@ -564,7 +564,7 @@ bool GERBVIEW_FRAME::unarchiveFiles( const wxString& aFullFileName, REPORTER* aR
if( aReporter )
{
msg.Printf( _( "Info: skip file \"%s\" (unknown type)\n" ), entry->GetName() );
aReporter->Report( msg, SEVERITY_WARNING );
aReporter->Report( msg, RPT_SEVERITY_WARNING );
}
continue;
@ -579,13 +579,13 @@ bool GERBVIEW_FRAME::unarchiveFiles( const wxString& aFullFileName, REPORTER* aR
if( aReporter )
{
if( !reported_no_more_layer )
aReporter->Report( MSG_NO_MORE_LAYER, SEVERITY_ERROR );
aReporter->Report( MSG_NO_MORE_LAYER, RPT_SEVERITY_ERROR );
reported_no_more_layer = true;
// Report the name of not loaded files:
msg.Printf( MSG_NOT_LOADED, GetChars( entry->GetName() ) );
aReporter->Report( msg, SEVERITY_ERROR );
aReporter->Report( msg, RPT_SEVERITY_ERROR );
}
delete entry;
@ -606,7 +606,7 @@ bool GERBVIEW_FRAME::unarchiveFiles( const wxString& aFullFileName, REPORTER* aR
{
msg.Printf( _( "<b>Unable to create temporary file \"%s\"</b>\n"),
unzipped_tempfile );
aReporter->Report( msg, SEVERITY_ERROR );
aReporter->Report( msg, RPT_SEVERITY_ERROR );
}
}
}
@ -635,7 +635,7 @@ bool GERBVIEW_FRAME::unarchiveFiles( const wxString& aFullFileName, REPORTER* aR
if( aReporter )
{
msg.Printf( _("<b>unzipped file %s read error</b>\n"), unzipped_tempfile );
aReporter->Report( msg, SEVERITY_ERROR );
aReporter->Report( msg, RPT_SEVERITY_ERROR );
}
}
else

View File

@ -152,7 +152,7 @@ bool GERBER_JOBFILE_READER::ReadGerberJobFile()
{
if( m_reporter )
m_reporter->ReportTail( _( "This job file uses an outdated format. Please recreate it." ),
SEVERITY_WARNING );
RPT_SEVERITY_WARNING );
return false;
}

View File

@ -83,13 +83,13 @@ public:
* RPT_ERROR, RPT_ACTION ) used to filter and format messages
*/
virtual REPORTER& Report( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED ) = 0;
virtual REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) = 0;
/**
* Function ReportTail
* Places the report at the end of the list, for objects that support report ordering
*/
virtual REPORTER& ReportTail( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED )
virtual REPORTER& ReportTail( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED )
{
return Report( aText, aSeverity );
}
@ -98,12 +98,12 @@ public:
* Function ReportHead
* Places the report at the beginning of the list for objects that support ordering
*/
virtual REPORTER& ReportHead( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED )
virtual REPORTER& ReportHead( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED )
{
return Report( aText, aSeverity );
}
REPORTER& Report( const char* aText, SEVERITY aSeverity = SEVERITY_UNDEFINED );
REPORTER& Report( const char* aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED );
REPORTER& operator <<( const wxString& aText ) { return Report( aText ); }
REPORTER& operator <<( const wxChar* aText ) { return Report( wxString( aText ) ); }
@ -141,7 +141,7 @@ public:
{
}
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED ) override;
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) override;
bool HasMessage() const override;
};
@ -166,7 +166,7 @@ public:
{
}
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED ) override;
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) override;
bool HasMessage() const override;
};
@ -191,11 +191,11 @@ public:
{
}
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED ) override;
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) override;
REPORTER& ReportTail( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED ) override;
REPORTER& ReportTail( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) override;
REPORTER& ReportHead( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED ) override;
REPORTER& ReportHead( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) override;
bool HasMessage() const override;
};
@ -219,7 +219,7 @@ public:
static REPORTER& GetInstance();
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED ) override;
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) override;
bool HasMessage() const override { return false; }
};
@ -242,7 +242,7 @@ public:
static REPORTER& GetInstance();
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = SEVERITY_UNDEFINED ) override;
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED ) override;
bool HasMessage() const override { return false; }
};

View File

@ -40,15 +40,16 @@ int GetStdMargin();
}
// Note: On windows, SEVERITY_ERROR collides with a system declaration,
// so we used RPT_SEVERITY _xxx instead of SEVERITY _xxx
enum SEVERITY {
SEVERITY_UNDEFINED = 0x00,
SEVERITY_INFO = 0x01,
SEVERITY_EXCLUSION = 0x02,
SEVERITY_ACTION = 0x04,
SEVERITY_WARNING = 0x08,
SEVERITY_ERROR = 0x10,
SEVERITY_IGNORE = 0x20
RPT_SEVERITY_UNDEFINED = 0x00,
RPT_SEVERITY_INFO = 0x01,
RPT_SEVERITY_EXCLUSION = 0x02,
RPT_SEVERITY_ACTION = 0x04,
RPT_SEVERITY_WARNING = 0x08,
RPT_SEVERITY_ERROR = 0x10,
RPT_SEVERITY_IGNORE = 0x20
};
wxBitmap MakeBadge( SEVERITY aStyle, int aCount, wxWindow* aWindow, int aDepth = 1 );

View File

@ -84,17 +84,17 @@ public:
if( aConfig->Read( wxT( "RequireCourtyardDefinitions" ), &flag, false ) )
{
if( flag )
bds.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = SEVERITY_ERROR;
bds.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = RPT_SEVERITY_ERROR;
else
bds.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = SEVERITY_IGNORE;
bds.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = RPT_SEVERITY_IGNORE;
}
if( aConfig->Read( wxT( "ProhibitOverlappingCourtyards" ), &flag, false ) )
{
if( flag )
bds.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = SEVERITY_ERROR;
bds.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = RPT_SEVERITY_ERROR;
else
bds.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = SEVERITY_IGNORE;
bds.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = RPT_SEVERITY_IGNORE;
}
// TO DO: figure out what we're going to use as keys here so we can read/write these....
@ -116,9 +116,9 @@ public:
// TO DO: for now just write out the legacy ones so we don't lose them
// TO DO: remove this once the new scheme is in place
aConfig->Write( wxT( "RequireCourtyardDefinitions" ),
bds.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] != SEVERITY_IGNORE );
bds.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] != RPT_SEVERITY_IGNORE );
aConfig->Write( wxT( "ProhibitOverlappingCourtyards" ),
bds.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] != SEVERITY_IGNORE );
bds.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] != RPT_SEVERITY_IGNORE );
aConfig->SetPath( oldPath );
}
@ -571,9 +571,9 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_HoleToHoleMin = Millimeter2iu( DEFAULT_HOLETOHOLEMIN );
for( int errorCode = DRCE_FIRST; errorCode <= DRCE_LAST; ++errorCode )
m_DRCSeverities[ errorCode ] = SEVERITY_ERROR;
m_DRCSeverities[ errorCode ] = RPT_SEVERITY_ERROR;
m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = SEVERITY_IGNORE;
m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = RPT_SEVERITY_IGNORE;
m_MaxError = ARC_HIGH_DEF;
m_ZoneUseNoOutlineInFill = false; // Use compatibility mode by default
@ -781,7 +781,7 @@ int BOARD_DESIGN_SETTINGS::GetSeverity( int aDRCErrorCode )
bool BOARD_DESIGN_SETTINGS::Ignore( int aDRCErrorCode )
{
return m_DRCSeverities[ aDRCErrorCode ] == SEVERITY_IGNORE;
return m_DRCSeverities[ aDRCErrorCode ] == RPT_SEVERITY_IGNORE;
}

View File

@ -186,8 +186,8 @@ void MARKER_PCB::ViewGetLayers( int aLayers[], int& aCount ) const
switch( board->GetDesignSettings().GetSeverity( m_drc.GetErrorCode() ) )
{
default:
case SEVERITY::SEVERITY_ERROR: aLayers[0] = LAYER_DRC_ERROR; break;
case SEVERITY::SEVERITY_WARNING: aLayers[0] = LAYER_DRC_WARNING; break;
case SEVERITY::RPT_SEVERITY_ERROR: aLayers[0] = LAYER_DRC_ERROR; break;
case SEVERITY::RPT_SEVERITY_WARNING: aLayers[0] = LAYER_DRC_WARNING; break;
}
}
@ -207,8 +207,8 @@ GAL_LAYER_ID MARKER_PCB::GetColorLayer() const
switch( board->GetDesignSettings().GetSeverity( m_drc.GetErrorCode() ) )
{
default:
case SEVERITY::SEVERITY_ERROR: return LAYER_DRC_ERROR;
case SEVERITY::SEVERITY_WARNING: return LAYER_DRC_WARNING;
case SEVERITY::RPT_SEVERITY_ERROR: return LAYER_DRC_ERROR;
case SEVERITY::RPT_SEVERITY_WARNING: return LAYER_DRC_WARNING;
}
}

View File

@ -22,7 +22,6 @@
#define KICAD_DIALOG_BOARD_SETUP_H
#include <widgets/paged_dialog.h>
#include "panel_setup_drc_severities.h"
class PCB_EDIT_FRAME;
class PANEL_SETUP_FEATURE_CONSTRAINTS;
@ -32,6 +31,7 @@ class PANEL_SETUP_NETCLASSES;
class PANEL_SETUP_TRACKS_AND_VIAS;
class PANEL_SETUP_MASK_AND_PASTE;
class PANEL_SETUP_BOARD_STACKUP;
class PANEL_SETUP_DRC_SEVERITIES;
class DIALOG_BOARD_SETUP : public PAGED_DIALOG

View File

@ -52,7 +52,7 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFra
m_unconnectedTreeModel( nullptr ),
m_footprintWarningsProvider( nullptr ),
m_footprintWarningsTreeModel( nullptr ),
m_severities( SEVERITY_ERROR | SEVERITY_WARNING )
m_severities( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING )
{
SetName( DIALOG_DRC_WINDOW_NAME ); // Set a window name to be able to find it
@ -180,15 +180,15 @@ void DIALOG_DRC_CONTROL::setDRCParameters()
// Don't globally define this; different facilities use different definitions of "ALL"
static int SEVERITY_ALL = SEVERITY_WARNING | SEVERITY_ERROR | SEVERITY_EXCLUSION;
static int RPT_SEVERITY_ALL = RPT_SEVERITY_WARNING | RPT_SEVERITY_ERROR | RPT_SEVERITY_EXCLUSION;
void DIALOG_DRC_CONTROL::syncCheckboxes()
{
m_showAll->SetValue( m_severities == SEVERITY_ALL );
m_showErrors->SetValue( m_severities & SEVERITY_ERROR );
m_showWarnings->SetValue( m_severities & SEVERITY_WARNING );
m_showExclusions->SetValue( m_severities & SEVERITY_EXCLUSION );
m_showAll->SetValue( m_severities == RPT_SEVERITY_ALL );
m_showErrors->SetValue( m_severities & RPT_SEVERITY_ERROR );
m_showWarnings->SetValue( m_severities & RPT_SEVERITY_WARNING );
m_showExclusions->SetValue( m_severities & RPT_SEVERITY_EXCLUSION );
}
@ -284,8 +284,8 @@ void DIALOG_DRC_CONTROL::OnDRCItemRClick( wxDataViewEvent& aEvent )
switch( m_BrdSettings.m_DRCSeverities[ drcItem->GetErrorCode() ] )
{
case SEVERITY_ERROR: listName = _( "errors" ); break;
case SEVERITY_WARNING: listName = _( "warnings" ); break;
case RPT_SEVERITY_ERROR: listName = _( "errors" ); break;
case RPT_SEVERITY_WARNING: listName = _( "warnings" ); break;
default: listName = _( "appropriate" ); break;
}
@ -302,7 +302,7 @@ void DIALOG_DRC_CONTROL::OnDRCItemRClick( wxDataViewEvent& aEvent )
menu.AppendSeparator();
if( m_BrdSettings.m_DRCSeverities[ drcItem->GetErrorCode() ] == SEVERITY_WARNING )
if( m_BrdSettings.m_DRCSeverities[ drcItem->GetErrorCode() ] == RPT_SEVERITY_WARNING )
{
menu.Append( 3, wxString::Format( _( "Change severity to Error for all '%s' violations" ),
drcItem->GetErrorText(),
@ -333,7 +333,7 @@ void DIALOG_DRC_CONTROL::OnDRCItemRClick( wxDataViewEvent& aEvent )
node->m_DrcItem->GetParent()->SetExcluded( true );
// Update view
if( m_severities & SEVERITY_EXCLUSION )
if( m_severities & RPT_SEVERITY_EXCLUSION )
static_cast<DRC_TREE_MODEL*>( aEvent.GetModel() )->ValueChanged( node );
else
static_cast<DRC_TREE_MODEL*>( aEvent.GetModel() )->DeleteCurrentItem( false );
@ -342,7 +342,7 @@ void DIALOG_DRC_CONTROL::OnDRCItemRClick( wxDataViewEvent& aEvent )
break;
case 3:
m_BrdSettings.m_DRCSeverities[ drcItem->GetErrorCode() ] = SEVERITY_ERROR;
m_BrdSettings.m_DRCSeverities[ drcItem->GetErrorCode() ] = RPT_SEVERITY_ERROR;
m_brdEditor->GetBoard()->SetDesignSettings( m_BrdSettings );
// Rebuild model and view
@ -351,7 +351,7 @@ void DIALOG_DRC_CONTROL::OnDRCItemRClick( wxDataViewEvent& aEvent )
break;
case 4:
m_BrdSettings.m_DRCSeverities[ drcItem->GetErrorCode() ] = SEVERITY_WARNING;
m_BrdSettings.m_DRCSeverities[ drcItem->GetErrorCode() ] = RPT_SEVERITY_WARNING;
m_brdEditor->GetBoard()->SetDesignSettings( m_BrdSettings );
// Rebuild model and view
@ -360,7 +360,7 @@ void DIALOG_DRC_CONTROL::OnDRCItemRClick( wxDataViewEvent& aEvent )
break;
case 5:
m_BrdSettings.m_DRCSeverities[ drcItem->GetErrorCode() ] = SEVERITY_IGNORE;
m_BrdSettings.m_DRCSeverities[ drcItem->GetErrorCode() ] = RPT_SEVERITY_IGNORE;
m_brdEditor->GetBoard()->SetDesignSettings( m_BrdSettings );
for( MARKER_PCB* marker : m_brdEditor->GetBoard()->Markers() )
@ -382,18 +382,18 @@ void DIALOG_DRC_CONTROL::OnSeverity( wxCommandEvent& aEvent )
int flag = 0;
if( aEvent.GetEventObject() == m_showAll )
flag = SEVERITY_ALL;
flag = RPT_SEVERITY_ALL;
else if( aEvent.GetEventObject() == m_showErrors )
flag = SEVERITY_ERROR;
flag = RPT_SEVERITY_ERROR;
else if( aEvent.GetEventObject() == m_showWarnings )
flag = SEVERITY_WARNING;
flag = RPT_SEVERITY_WARNING;
else if( aEvent.GetEventObject() == m_showExclusions )
flag = SEVERITY_EXCLUSION;
flag = RPT_SEVERITY_EXCLUSION;
if( aEvent.IsChecked() )
m_severities |= flag;
else if( aEvent.GetEventObject() == m_showAll )
m_severities = SEVERITY_ERROR;
m_severities = RPT_SEVERITY_ERROR;
else
m_severities &= ~flag;
@ -618,26 +618,26 @@ void DIALOG_DRC_CONTROL::updateDisplayedCounts()
if( m_markersProvider )
{
numErrors += m_markersProvider->GetCount( SEVERITY_ERROR );
numWarnings += m_markersProvider->GetCount( SEVERITY_WARNING );
numExcluded += m_markersProvider->GetCount( SEVERITY_EXCLUSION );
numErrors += m_markersProvider->GetCount( RPT_SEVERITY_ERROR );
numWarnings += m_markersProvider->GetCount( RPT_SEVERITY_WARNING );
numExcluded += m_markersProvider->GetCount( RPT_SEVERITY_EXCLUSION );
}
if( m_unconnectedItemsProvider )
{
numErrors += m_unconnectedItemsProvider->GetCount( SEVERITY_ERROR );
numWarnings += m_unconnectedItemsProvider->GetCount( SEVERITY_WARNING );
numExcluded += m_unconnectedItemsProvider->GetCount( SEVERITY_EXCLUSION );
numErrors += m_unconnectedItemsProvider->GetCount( RPT_SEVERITY_ERROR );
numWarnings += m_unconnectedItemsProvider->GetCount( RPT_SEVERITY_WARNING );
numExcluded += m_unconnectedItemsProvider->GetCount( RPT_SEVERITY_EXCLUSION );
}
if( m_footprintWarningsProvider )
{
numErrors += m_footprintWarningsProvider->GetCount( SEVERITY_ERROR );
numWarnings += m_footprintWarningsProvider->GetCount( SEVERITY_WARNING );
numExcluded += m_footprintWarningsProvider->GetCount( SEVERITY_EXCLUSION );
numErrors += m_footprintWarningsProvider->GetCount( RPT_SEVERITY_ERROR );
numWarnings += m_footprintWarningsProvider->GetCount( RPT_SEVERITY_WARNING );
numExcluded += m_footprintWarningsProvider->GetCount( RPT_SEVERITY_EXCLUSION );
}
m_errorsBadge->SetBitmap( MakeBadge( SEVERITY_ERROR, numErrors, m_errorsBadge ) );
m_warningsBadge->SetBitmap( MakeBadge( SEVERITY_WARNING, numWarnings, m_warningsBadge ) );
m_exclusionsBadge->SetBitmap( MakeBadge( SEVERITY_EXCLUSION, numExcluded, m_exclusionsBadge ) );
m_errorsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_ERROR, numErrors, m_errorsBadge ) );
m_warningsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_WARNING, numWarnings, m_warningsBadge ) );
m_exclusionsBadge->SetBitmap( MakeBadge( RPT_SEVERITY_EXCLUSION, numExcluded, m_exclusionsBadge ) );
}

View File

@ -366,7 +366,7 @@ bool DIALOG_EXCHANGE_FOOTPRINTS::processModule( MODULE* aModule, const LIB_ID& a
if( !newModule )
{
msg << ": " << _( "*** footprint not found ***" );
m_MessageWindow->Report( msg, SEVERITY_ERROR );
m_MessageWindow->Report( msg, RPT_SEVERITY_ERROR );
return false;
}
@ -380,7 +380,7 @@ bool DIALOG_EXCHANGE_FOOTPRINTS::processModule( MODULE* aModule, const LIB_ID& a
m_currentModule = newModule;
msg += ": OK";
m_MessageWindow->Report( msg, SEVERITY_ACTION );
m_MessageWindow->Report( msg, RPT_SEVERITY_ACTION );
return true;
}

View File

@ -337,7 +337,7 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
bool success = false;
wxArrayString output, errors;
REPORTER& reporter = m_messagesPanel->Reporter();
reporter.ReportHead( wxString::Format( _( "Executing '%s'" ), cmdK2S ), SEVERITY_ACTION );
reporter.ReportHead( wxString::Format( _( "Executing '%s'" ), cmdK2S ), RPT_SEVERITY_ACTION );
{
wxBusyCursor dummy;
@ -356,23 +356,23 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
}
for( auto& err : errors )
reporter.Report( err, SEVERITY_WARNING );
reporter.Report( err, RPT_SEVERITY_WARNING );
if( result ) // Any troubles?
{
if( !success )
{
reporter.ReportTail( _( "Unable to create STEP file. Check that the board has a "
"valid outline and models." ), SEVERITY_ERROR );
"valid outline and models." ), RPT_SEVERITY_ERROR );
}
else
{
reporter.ReportTail( _( "STEP file has been created, but there are warnings." ),
SEVERITY_INFO );
RPT_SEVERITY_INFO );
}
}
else
{
reporter.ReportTail( _( "STEP file has been created successfully." ), SEVERITY_INFO );
reporter.ReportTail( _( "STEP file has been created successfully." ), RPT_SEVERITY_INFO );
}
}

View File

@ -262,12 +262,12 @@ void DIALOG_EXPORT_SVG::ExportSVGFile( bool aOnlyOneFile )
if( CreateSVGFile( path ) )
{
reporter.Report( wxString::Format( _( "Exported \"%s\"." ), path ), SEVERITY_ACTION );
reporter.Report( wxString::Format( _( "Exported \"%s\"." ), path ), RPT_SEVERITY_ACTION );
}
else // Error
{
reporter.Report( wxString::Format( _( "Unable to create file \"%s\"." ), path ),
SEVERITY_ERROR );
RPT_SEVERITY_ERROR );
}
if( aOnlyOneFile )

View File

@ -222,7 +222,7 @@ void DIALOG_NETLIST::onFilenameChanged()
{
m_MessageWindow->Clear();
REPORTER& reporter = m_MessageWindow->Reporter();
reporter.Report( _( "The netlist file does not exist." ), SEVERITY_ERROR );
reporter.Report( _( "The netlist file does not exist." ), RPT_SEVERITY_ERROR );
}
}
}
@ -272,14 +272,14 @@ void DIALOG_NETLIST::loadNetlist( bool aDryRun )
wxString msg;
msg.Printf( _( "Reading netlist file \"%s\".\n" ), GetChars( netlistFileName ) );
reporter.ReportHead( msg, SEVERITY_INFO );
reporter.ReportHead( msg, RPT_SEVERITY_INFO );
if( m_matchByTimestamp->GetSelection() == 1 )
msg = _( "Using references to match components and footprints.\n" );
else
msg = _( "Using time stamp fields (UUID) to match components and footprints.\n" );
reporter.ReportHead( msg, SEVERITY_INFO );
reporter.ReportHead( msg, RPT_SEVERITY_INFO );
m_MessageWindow->SetLazyUpdate( true ); // Use lazy update to speed the creation of the report
// (the window is not updated for each message)
m_matchByUUID = m_matchByTimestamp->GetSelection() == 0;

View File

@ -613,7 +613,7 @@ void DIALOG_PLOT::applyPlotSettings()
{
m_defaultPenSize.SetValue( tempOptions.GetHPGLPenDiameter() * IU_PER_MILS );
msg.Printf( _( "HPGL pen size constrained." ) );
reporter.Report( msg, SEVERITY_INFO );
reporter.Report( msg, RPT_SEVERITY_INFO );
}
}
else // keep the last value (initial value if no HPGL plot made)
@ -624,7 +624,7 @@ void DIALOG_PLOT::applyPlotSettings()
{
m_defaultLineWidth.SetValue( tempOptions.GetLineWidth() );
msg.Printf( _( "Default line width constrained." ) );
reporter.Report( msg, SEVERITY_INFO );
reporter.Report( msg, RPT_SEVERITY_INFO );
}
// X scale
@ -637,7 +637,7 @@ void DIALOG_PLOT::applyPlotSettings()
msg.Printf( wxT( "%f" ), m_XScaleAdjust );
m_fineAdjustXCtrl->SetValue( msg );
msg.Printf( _( "X scale constrained." ) );
reporter.Report( msg, SEVERITY_INFO );
reporter.Report( msg, RPT_SEVERITY_INFO );
}
// Y scale
@ -649,7 +649,7 @@ void DIALOG_PLOT::applyPlotSettings()
msg.Printf( wxT( "%f" ), m_YScaleAdjust );
m_fineAdjustYCtrl->SetValue( msg );
msg.Printf( _( "Y scale constrained." ) );
reporter.Report( msg, SEVERITY_INFO );
reporter.Report( msg, RPT_SEVERITY_INFO );
}
auto cfg = m_parent->GetSettings();
@ -670,7 +670,7 @@ void DIALOG_PLOT::applyPlotSettings()
StringFromValue( GetUserUnits(), m_widthAdjustMinValue, false, true ),
StringFromValue( GetUserUnits(), m_widthAdjustMaxValue, false, true ),
GetAbbreviatedUnitsLabel( GetUserUnits(), true ) );
reporter.Report( msg, SEVERITY_WARNING );
reporter.Report( msg, RPT_SEVERITY_WARNING );
}
// Store m_PSWidthAdjust in mm in user config
@ -856,12 +856,12 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
delete plotter;
msg.Printf( _( "Plot file \"%s\" created." ), fn.GetFullPath() );
reporter.Report( msg, SEVERITY_ACTION );
reporter.Report( msg, RPT_SEVERITY_ACTION );
}
else
{
msg.Printf( _( "Unable to create file \"%s\"." ), fn.GetFullPath() );
reporter.Report( msg, SEVERITY_ERROR );
reporter.Report( msg, RPT_SEVERITY_ERROR );
}
wxSafeYield(); // displays report message.

View File

@ -58,7 +58,7 @@ PANEL_SETUP_DRC_SEVERITIES::PANEL_SETUP_DRC_SEVERITIES( PAGED_DIALOG* aParent,
wxPanel* radioPanel = new wxPanel( scrollWin );
wxBoxSizer* radioSizer = new wxBoxSizer( wxHORIZONTAL );
for( int i = 0; i < sizeof( severities ) / sizeof( wxString ); ++i )
for( size_t i = 0; i < sizeof( severities ) / sizeof( wxString ); ++i )
{
m_buttonMap[errorCode][i] = new wxRadioButton( radioPanel,
baseID + errorCode * 10 + i,
@ -95,9 +95,9 @@ void PANEL_SETUP_DRC_SEVERITIES::ImportSettingsFrom( BOARD* aBoard )
{
switch( entry.second )
{
case SEVERITY_ERROR: m_buttonMap[entry.first][0]->SetValue( true ); break;
case SEVERITY_WARNING: m_buttonMap[entry.first][1]->SetValue( true ); break;
case SEVERITY_IGNORE: m_buttonMap[entry.first][2]->SetValue( true ); break;
case RPT_SEVERITY_ERROR: m_buttonMap[entry.first][0]->SetValue( true ); break;
case RPT_SEVERITY_WARNING: m_buttonMap[entry.first][1]->SetValue( true ); break;
case RPT_SEVERITY_IGNORE: m_buttonMap[entry.first][2]->SetValue( true ); break;
}
}
}
@ -112,9 +112,9 @@ bool PANEL_SETUP_DRC_SEVERITIES::TransferDataToWindow()
{
switch( entry.second )
{
case SEVERITY_ERROR: m_buttonMap[entry.first][0]->SetValue( true ); break;
case SEVERITY_WARNING: m_buttonMap[entry.first][1]->SetValue( true ); break;
case SEVERITY_IGNORE: m_buttonMap[entry.first][2]->SetValue( true ); break;
case RPT_SEVERITY_ERROR: m_buttonMap[entry.first][0]->SetValue( true ); break;
case RPT_SEVERITY_WARNING: m_buttonMap[entry.first][1]->SetValue( true ); break;
case RPT_SEVERITY_IGNORE: m_buttonMap[entry.first][2]->SetValue( true ); break;
}
}
}
@ -127,14 +127,14 @@ bool PANEL_SETUP_DRC_SEVERITIES::TransferDataFromWindow()
{
for( auto const& entry : m_buttonMap )
{
int severity = SEVERITY_UNDEFINED;
int severity = RPT_SEVERITY_UNDEFINED;
if( entry.second[0]->GetValue() )
severity = SEVERITY_ERROR;
severity = RPT_SEVERITY_ERROR;
else if( entry.second[1]->GetValue() )
severity = SEVERITY_WARNING;
severity = RPT_SEVERITY_WARNING;
else if( entry.second[2]->GetValue() )
severity = SEVERITY_IGNORE;
severity = RPT_SEVERITY_IGNORE;
m_brdSettings.m_DRCSeverities[ entry.first ] = severity;
}

View File

@ -26,7 +26,7 @@
#define KICAD_PANEL_SETUP_DRC_SEVERITIES_H
#include <map>
#include <wx/generic/panelg.h>
#include <wx/panel.h>
class BOARD;

View File

@ -74,7 +74,7 @@ DRC::DRC() :
m_drcRun = false;
m_footprintsTested = false;
m_severities = SEVERITY_ERROR | SEVERITY_WARNING;
m_severities = RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING;
m_segmAngle = 0;
m_segmLength = 0;

View File

@ -196,9 +196,9 @@ void DRC_TREE_MODEL::GetValue( wxVariant& aVariant,
{
auto& bds = m_parentFrame->GetBoard()->GetDesignSettings();
bool excluded = drcItem->GetParent() && drcItem->GetParent()->IsExcluded();
bool error = bds.m_DRCSeverities[ drcItem->GetErrorCode() ] == SEVERITY_ERROR;
bool error = bds.m_DRCSeverities[ drcItem->GetErrorCode() ] == RPT_SEVERITY_ERROR;
wxString prefix = wxString::Format( wxT( "%s%s" ),
excluded ? _( "Excluded " ) : wxEmptyString,
excluded ? _( "Excluded " ) : wxString( "" ),
error ? _( "Error: " ) : _( "Warning: " ) );
aVariant = prefix + drcItem->GetErrorText();

View File

@ -104,7 +104,7 @@ public:
int markerSeverity;
if( marker->IsExcluded() )
markerSeverity = SEVERITY_EXCLUSION;
markerSeverity = RPT_SEVERITY_EXCLUSION;
else
markerSeverity = bds.GetSeverity( marker->GetReporter().GetErrorCode() );
@ -126,7 +126,7 @@ public:
int markerSeverity;
if( marker->IsExcluded() )
markerSeverity = SEVERITY_EXCLUSION;
markerSeverity = RPT_SEVERITY_EXCLUSION;
else
markerSeverity = bds.GetSeverity( marker->GetReporter().GetErrorCode() );
@ -233,7 +233,7 @@ public:
if( aDeep )
{
for( int i = 0; i < m_sourceVector->size(); ++i )
for( size_t i = 0; i < m_sourceVector->size(); ++i )
{
if( m_sourceVector->at( i ) == item )
{

View File

@ -191,7 +191,7 @@ private:
_( "File contains pad shapes that are not supported by the Hyperlynx exporter\n"
"(Supported shapes are oval, rectangle, circle.)\n"
"They have been exported as oval pads." ),
SEVERITY_WARNING );
RPT_SEVERITY_WARNING );
}
break;
}

View File

@ -270,15 +270,15 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles()
{
msg.Printf( _( "Unable to create \"%s\"." ), fn.GetFullPath() );
wxMessageBox( msg );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
return false;
}
msg.Printf( _( "Front side (top side) place file: \"%s\"." ), filename );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
msg.Printf( _( "Component count: %d." ), fpcount );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
// Create the Back or Bottom side placement file
fullcount = fpcount;
@ -290,24 +290,24 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles()
if( fpcount < 0 )
{
msg.Printf( _( "Unable to create file \"%s\"." ), filename );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
wxMessageBox( msg );
return false;
}
// Display results
msg.Printf( _( "Back side (bottom side) place file: \"%s\"." ), filename );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
msg.Printf( _( "Component count: %d." ), fpcount );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
fullcount += fpcount;
msg.Printf( _( "Full component count: %d\n" ), fullcount );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
m_reporter->Report( _( "Component Placement File generation OK." ), SEVERITY_ACTION );
m_reporter->Report( _( "Component Placement File generation OK." ), RPT_SEVERITY_ACTION );
return true;
}
@ -343,7 +343,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
for( MODULE* item : fp_no_smd_list )
{
msg.Printf( _( "footprint %s (not set as SMD) forced in list" ), item->GetReference() );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
}
}
}
@ -395,7 +395,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
{
msg.Printf( _( "Unable to create \"%s\"." ), fn.GetFullPath() );
wxMessageBox( msg );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
return false;
}
@ -404,14 +404,14 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
else
msg.Printf( _( "Front side (top side) place file: \"%s\"." ),
fn.GetFullPath() );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
msg.Printf( _( "Component count: %d." ), fpcount );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
if( singleFile )
{
m_reporter->Report( _( "Component Placement File generation OK." ), SEVERITY_ACTION );
m_reporter->Report( _( "Component Placement File generation OK." ), RPT_SEVERITY_ACTION );
return true;
}
@ -437,7 +437,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
if( fpcount < 0 )
{
msg.Printf( _( "Unable to create file \"%s\"." ), fn.GetFullPath() );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
wxMessageBox( msg );
return false;
}
@ -446,21 +446,21 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles()
if( !singleFile )
{
msg.Printf( _( "Back side (bottom side) place file: \"%s\"." ), fn.GetFullPath() );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
msg.Printf( _( "Component count: %d." ), fpcount );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
}
if( !singleFile )
{
fullcount += fpcount;
msg.Printf( _( "Full component count: %d\n" ), fullcount );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
}
m_reporter->Report( _( "Component Placement File generation OK." ), SEVERITY_ACTION );
m_reporter->Report( _( "Component Placement File generation OK." ), RPT_SEVERITY_ACTION );
return true;
}

View File

@ -150,13 +150,13 @@ bool GERBER_JOBFILE_WRITER::CreateJobFile( const wxString& aFullFilename )
if( m_reporter )
{
msg.Printf( _( "Unable to create job file \"%s\"" ), aFullFilename );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
}
}
else if( m_reporter )
{
msg.Printf( _( "Create Gerber job file \"%s\"" ), aFullFilename );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
}
return success;
@ -404,7 +404,7 @@ void GERBER_JOBFILE_WRITER::addJSONFilesAttributes()
default:
skip_file = true;
m_reporter->Report( "Unexpected layer id in job file", SEVERITY_ERROR );
m_reporter->Report( "Unexpected layer id in job file", RPT_SEVERITY_ERROR );
break;
}
}
@ -555,7 +555,7 @@ void GERBER_JOBFILE_WRITER::addJSONMaterialStackup()
if( !uptodate && m_pcb->GetDesignSettings().m_HasStackup )
m_reporter->Report( _( "Board stackup settings not up to date\n"
"Please fix the stackup" ),
SEVERITY_ERROR );
RPT_SEVERITY_ERROR );
PCB_LAYER_ID last_copper_layer = F_Cu;

View File

@ -145,7 +145,7 @@ MODULE* BOARD_NETLIST_UPDATER::addNewComponent( COMPONENT* aComponent )
msg.Printf( _( "Cannot add %s (no footprint assigned)." ),
aComponent->GetReference(),
aComponent->GetFPID().Format().wx_str() );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
++m_errorCount;
return nullptr;
}
@ -157,7 +157,7 @@ MODULE* BOARD_NETLIST_UPDATER::addNewComponent( COMPONENT* aComponent )
msg.Printf( _( "Cannot add %s (footprint \"%s\" not found)." ),
aComponent->GetReference(),
aComponent->GetFPID().Format().wx_str() );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
++m_errorCount;
return nullptr;
}
@ -165,7 +165,7 @@ MODULE* BOARD_NETLIST_UPDATER::addNewComponent( COMPONENT* aComponent )
msg.Printf( _( "Add %s (footprint \"%s\")." ),
aComponent->GetReference(),
aComponent->GetFPID().Format().wx_str() );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
// Set the pads ratsnest settings to the global settings
bool set_ratsnest = m_frame->GetDisplayOptions().m_ShowGlobalRatsnest;
@ -201,7 +201,7 @@ MODULE* BOARD_NETLIST_UPDATER::replaceComponent( NETLIST& aNetlist, MODULE* aPcb
msg.Printf( _( "Cannot update %s (no footprint assigned)." ),
aNewComponent->GetReference(),
aNewComponent->GetFPID().Format().wx_str() );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
++m_errorCount;
return nullptr;
}
@ -213,7 +213,7 @@ MODULE* BOARD_NETLIST_UPDATER::replaceComponent( NETLIST& aNetlist, MODULE* aPcb
msg.Printf( _( "Cannot update %s (footprint \"%s\" not found)." ),
aNewComponent->GetReference(),
aNewComponent->GetFPID().Format().wx_str() );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
++m_errorCount;
return nullptr;
}
@ -222,7 +222,7 @@ MODULE* BOARD_NETLIST_UPDATER::replaceComponent( NETLIST& aNetlist, MODULE* aPcb
aPcbComponent->GetReference(),
aPcbComponent->GetFPID().Format().wx_str(),
aNewComponent->GetFPID().Format().wx_str() );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
m_newFootprintsCount++;
@ -253,7 +253,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentParameters( MODULE* aPcbComponent,
msg.Printf( _( "Change %s reference to %s." ),
aPcbComponent->GetReference(),
aNewComponent->GetReference() );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
if ( !m_isDryRun )
{
@ -269,7 +269,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentParameters( MODULE* aPcbComponent,
aPcbComponent->GetReference(),
aPcbComponent->GetValue(),
aNewComponent->GetValue() );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
if( !m_isDryRun )
{
@ -285,7 +285,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentParameters( MODULE* aPcbComponent,
aPcbComponent->GetReference(),
aPcbComponent->GetPath().AsString(),
aNewComponent->GetPath().AsString() );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
if( !m_isDryRun )
{
@ -341,7 +341,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
msg.Printf( _( "Disconnect %s pin %s." ),
aPcbComponent->GetReference(),
pad->GetName() );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
}
else if( m_warnForNoNetPads && pad->IsOnCopperLayer() && !pad->GetName().IsEmpty() )
{
@ -349,7 +349,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
msg.Printf( _( "No net for component %s pin %s." ),
aPcbComponent->GetReference(),
pad->GetName() );
m_reporter->Report( msg, SEVERITY_WARNING);
m_reporter->Report( msg, RPT_SEVERITY_WARNING);
}
if( !m_isDryRun )
@ -397,7 +397,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
m_addedNets[netName] = netinfo;
msg.Printf( _( "Add net %s." ), UnescapeString( netName ) );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
}
if( !pad->GetNetname().IsEmpty() )
@ -417,7 +417,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
pad->GetName(),
UnescapeString( netName ) );
}
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
if( !m_isDryRun )
{
@ -488,7 +488,7 @@ bool BOARD_NETLIST_UPDATER::updateCopperZoneNets( NETLIST& aNetlist )
{
msg.Printf( _( "Reconnect via from %s to %s." ),
UnescapeString( via->GetNetname() ), UnescapeString( updatedNetname ) );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
if( !m_isDryRun )
{
@ -508,7 +508,7 @@ bool BOARD_NETLIST_UPDATER::updateCopperZoneNets( NETLIST& aNetlist )
{
msg.Printf( _( "Via connected to unknown net (%s)." ),
UnescapeString( via->GetNetname() ) );
m_reporter->Report( msg, SEVERITY_WARNING );
m_reporter->Report( msg, RPT_SEVERITY_WARNING );
++m_warningCount;
}
}
@ -550,7 +550,7 @@ bool BOARD_NETLIST_UPDATER::updateCopperZoneNets( NETLIST& aNetlist )
msg.Printf( _( "Reconnect copper zone from %s to %s." ),
UnescapeString( zone->GetNetname() ),
UnescapeString( updatedNetname ) );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
if( !m_isDryRun )
{
@ -570,7 +570,7 @@ bool BOARD_NETLIST_UPDATER::updateCopperZoneNets( NETLIST& aNetlist )
{
msg.Printf( _( "Copper zone (%s) has no pads connected." ),
UnescapeString( zone->GetNetname() ) );
m_reporter->Report( msg, SEVERITY_WARNING );
m_reporter->Report( msg, RPT_SEVERITY_WARNING );
++m_warningCount;
}
}
@ -598,12 +598,12 @@ bool BOARD_NETLIST_UPDATER::deleteUnusedComponents( NETLIST& aNetlist )
if( module->IsLocked() )
{
msg.Printf( _( "Cannot remove unused footprint %s (locked)." ), module->GetReference() );
m_reporter->Report( msg, SEVERITY_WARNING );
m_reporter->Report( msg, RPT_SEVERITY_WARNING );
continue;
}
msg.Printf( _( "Remove unused footprint %s." ), module->GetReference() );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
if( !m_isDryRun )
m_commit.Remove( module );
@ -662,7 +662,7 @@ bool BOARD_NETLIST_UPDATER::deleteSinglePadNets()
{
msg.Printf( _( "Remove single pad net %s." ),
UnescapeString( getNetname( previouspad ) ) );
m_reporter->Report( msg, SEVERITY_ACTION );
m_reporter->Report( msg, RPT_SEVERITY_ACTION );
if( !m_isDryRun )
previouspad->SetNetCode( NETINFO_LIST::UNCONNECTED );
@ -727,7 +727,7 @@ bool BOARD_NETLIST_UPDATER::testConnectivity( NETLIST& aNetlist )
component->GetReference(),
padname,
footprint->GetFPID().Format().wx_str() );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
++m_errorCount;
}
}
@ -765,7 +765,7 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
msg.Printf( _( "Processing component \"%s:%s\"." ),
component->GetReference(),
component->GetFPID().Format().wx_str() );
m_reporter->Report( msg, SEVERITY_INFO );
m_reporter->Report( msg, RPT_SEVERITY_INFO );
for( auto footprint : m_board->Modules() )
{
@ -816,7 +816,7 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
{
msg.Printf( _( "Multiple footprints found for \"%s\"." ),
component->GetReference() );
m_reporter->Report( msg, SEVERITY_ERROR );
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
}
}
@ -850,20 +850,20 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
}
// Update the ratsnest
m_reporter->ReportTail( wxT( "" ), SEVERITY_ACTION );
m_reporter->ReportTail( wxT( "" ), SEVERITY_ACTION );
m_reporter->ReportTail( wxT( "" ), RPT_SEVERITY_ACTION );
m_reporter->ReportTail( wxT( "" ), RPT_SEVERITY_ACTION );
msg.Printf( _( "Total warnings: %d, errors: %d." ), m_warningCount, m_errorCount );
m_reporter->ReportTail( msg, SEVERITY_ACTION );
m_reporter->ReportTail( msg, RPT_SEVERITY_ACTION );
if( m_errorCount )
{
m_reporter->ReportTail( _( "Errors occurred during the netlist update. Unless you fix them "
"your board will not be consistent with the schematics." ),
SEVERITY_ERROR );
RPT_SEVERITY_ERROR );
return false;
}
m_reporter->ReportTail( _( "Netlist update successful!" ), SEVERITY_ACTION );
m_reporter->ReportTail( _( "Netlist update successful!" ), RPT_SEVERITY_ACTION );
return true;
}

View File

@ -158,7 +158,7 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter )
{
msg.Printf( _( "No footprint defined for symbol \"%s\".\n" ),
component->GetReference() );
aReporter.Report( msg, SEVERITY_ERROR );
aReporter.Report( msg, RPT_SEVERITY_ERROR );
continue;
}
@ -178,7 +178,7 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter )
component->GetReference(),
GetChars( fpOnBoard->GetFPID().Format() ),
GetChars( component->GetFPID().Format() ) );
aReporter.Report( msg, SEVERITY_WARNING );
aReporter.Report( msg, RPT_SEVERITY_WARNING );
continue;
}
@ -204,7 +204,7 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter )
msg.Printf( _( "%s footprint ID \"%s\" is not valid." ),
component->GetReference(),
GetChars( component->GetFPID().Format() ) );
aReporter.Report( msg, SEVERITY_ERROR );
aReporter.Report( msg, RPT_SEVERITY_ERROR );
continue;
}
@ -221,7 +221,7 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter )
msg.Printf( _( "%s footprint \"%s\" not found in any libraries in the footprint library table.\n" ),
component->GetReference(),
GetChars( component->GetFPID().GetLibItemName() ) );
aReporter.Report( msg, SEVERITY_ERROR );
aReporter.Report( msg, RPT_SEVERITY_ERROR );
continue;
}

View File

@ -243,10 +243,10 @@ static BOARD_DESIGN_SETTINGS GetOverlapCheckDesignSettings()
// do the overlap tests - that's a different test, but if not set,
// the invalid courtyard checks don't run either
des_settings.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = SEVERITY_ERROR;
des_settings.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = RPT_SEVERITY_ERROR;
// we will also check for missing courtyards here
des_settings.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = SEVERITY_ERROR;
des_settings.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = RPT_SEVERITY_ERROR;
return des_settings;
}

View File

@ -448,10 +448,10 @@ static void CheckCollisionsMatchExpected( BOARD& aBoard,
static BOARD_DESIGN_SETTINGS GetOverlapCheckDesignSettings()
{
BOARD_DESIGN_SETTINGS des_settings;
des_settings.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = SEVERITY_ERROR;
des_settings.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = RPT_SEVERITY_ERROR;
// we might not always have courtyards - that's a separate test
des_settings.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = SEVERITY_IGNORE;
des_settings.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = RPT_SEVERITY_IGNORE;
return des_settings;
}

View File

@ -159,8 +159,8 @@ private:
BOARD_DESIGN_SETTINGS getDesignSettings() const override
{
BOARD_DESIGN_SETTINGS des_settings;
des_settings.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = SEVERITY_IGNORE;
des_settings.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = SEVERITY_ERROR;
des_settings.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = RPT_SEVERITY_IGNORE;
des_settings.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = RPT_SEVERITY_ERROR;
return des_settings;
}
@ -196,8 +196,8 @@ private:
BOARD_DESIGN_SETTINGS getDesignSettings() const override
{
BOARD_DESIGN_SETTINGS des_settings;
des_settings.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = SEVERITY_ERROR;
des_settings.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = SEVERITY_IGNORE;
des_settings.m_DRCSeverities[ DRCE_MISSING_COURTYARD_IN_FOOTPRINT ] = RPT_SEVERITY_ERROR;
des_settings.m_DRCSeverities[ DRCE_OVERLAPPING_FOOTPRINTS ] = RPT_SEVERITY_IGNORE;
return des_settings;
}