From b7cd0c54c2e6532896655f352b59f1e3828f340b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 4 Mar 2020 10:48:18 +0100 Subject: [PATCH] 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. --- 3d-viewer/3d_canvas/status_text_reporter.h | 4 +- common/common.cpp | 6 +- common/dialogs/wx_html_report_panel.cpp | 56 ++++++++--------- common/reporter.cpp | 14 +++-- common/widgets/ui_common.cpp | 10 ++-- eeschema/annotate.cpp | 6 +- eeschema/component_references_lister.cpp | 10 ++-- eeschema/dialogs/dialog_erc.cpp | 4 +- eeschema/dialogs/dialog_plot_schematic.cpp | 2 +- eeschema/dialogs/dialog_symbol_remap.cpp | 26 ++++---- eeschema/netlist_generator.cpp | 14 ++--- eeschema/plot_schematic_DXF.cpp | 6 +- eeschema/plot_schematic_HPGL.cpp | 6 +- eeschema/plot_schematic_PDF.cpp | 6 +- eeschema/plot_schematic_PS.cpp | 6 +- eeschema/plot_schematic_SVG.cpp | 6 +- eeschema/sim/sim_plot_frame.cpp | 2 +- eeschema/tools/backannotate.cpp | 28 ++++----- gerbview/files.cpp | 22 +++---- gerbview/job_file_reader.cpp | 2 +- include/reporter.h | 22 +++---- include/widgets/ui_common.h | 17 +++--- pcbnew/board_design_settings.cpp | 18 +++--- pcbnew/class_marker_pcb.cpp | 8 +-- pcbnew/dialogs/dialog_board_setup.h | 2 +- pcbnew/dialogs/dialog_drc.cpp | 60 +++++++++---------- pcbnew/dialogs/dialog_exchange_footprints.cpp | 4 +- pcbnew/dialogs/dialog_export_step.cpp | 10 ++-- pcbnew/dialogs/dialog_export_svg.cpp | 4 +- pcbnew/dialogs/dialog_netlist.cpp | 6 +- pcbnew/dialogs/dialog_plot.cpp | 14 ++--- pcbnew/dialogs/panel_setup_drc_severities.cpp | 22 +++---- pcbnew/dialogs/panel_setup_drc_severities.h | 2 +- pcbnew/drc/drc.cpp | 2 +- pcbnew/drc/drc_tree_model.cpp | 4 +- pcbnew/drc/drc_tree_model.h | 6 +- pcbnew/exporters/export_hyperlynx.cpp | 2 +- pcbnew/exporters/gen_footprints_placefile.cpp | 36 +++++------ pcbnew/exporters/gerber_jobfile_writer.cpp | 8 +-- .../netlist_reader/board_netlist_updater.cpp | 56 ++++++++--------- pcbnew/netlist_reader/netlist.cpp | 8 +-- qa/pcbnew/drc/test_drc_courtyard_invalid.cpp | 4 +- qa/pcbnew/drc/test_drc_courtyard_overlap.cpp | 4 +- qa/pcbnew_tools/tools/drc_tool/drc_tool.cpp | 8 +-- 44 files changed, 283 insertions(+), 280 deletions(-) diff --git a/3d-viewer/3d_canvas/status_text_reporter.h b/3d-viewer/3d_canvas/status_text_reporter.h index 0bae5beb7f..f0b9e1b7af 100644 --- a/3d-viewer/3d_canvas/status_text_reporter.h +++ b/3d-viewer/3d_canvas/status_text_reporter.h @@ -30,7 +30,7 @@ #define STATUS_TEXT_REPORTER_H_ #include - + /** * STATUS_TEXT_REPORTER * is a wrapper for reporting to a wxString in a wxFrame status text. @@ -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; diff --git a/common/common.cpp b/common/common.cpp index 8a72a48a2d..9eeb1b2cd0 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -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; diff --git a/common/dialogs/wx_html_report_panel.cpp b/common/dialogs/wx_html_report_panel.cpp index 3920d6bb1d..090fee3f42 100644 --- a/common/dialogs/wx_html_report_panel.cpp +++ b/common/dialogs/wx_html_report_panel.cpp @@ -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 = "" + _( "Error: " ) + "" + aLine.message + "
"; break; - case SEVERITY_WARNING: + case RPT_SEVERITY_WARNING: retv = "" + _( "Warning: " ) + "" + aLine.message + "
"; break; - case SEVERITY_INFO: + case RPT_SEVERITY_INFO: retv = "" + _( "Info: " ) + "" + aLine.message + "
"; break; - case SEVERITY_ACTION: + case RPT_SEVERITY_ACTION: retv = "" + aLine.message + "
"; 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; diff --git a/common/reporter.cpp b/common/reporter.cpp index 5573d8bd76..40c6fd0427 100644 --- a/common/reporter.cpp +++ b/common/reporter.cpp @@ -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; diff --git a/common/widgets/ui_common.cpp b/common/widgets/ui_common.cpp index dea795a352..71852a6c30 100644 --- a/common/widgets/ui_common.cpp +++ b/common/widgets/ui_common.cpp @@ -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; diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp index 836012dd55..ba4e3e0d6f 100644 --- a/eeschema/annotate.cpp +++ b/eeschema/annotate.cpp @@ -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(); diff --git a/eeschema/component_references_lister.cpp b/eeschema/component_references_lister.cpp index f9698176ec..f038a1ca6d 100644 --- a/eeschema/component_references_lister.cpp +++ b/eeschema/component_references_lister.cpp @@ -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++; } } diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 99c6ef9067..b996f61ecf 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -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 ) { diff --git a/eeschema/dialogs/dialog_plot_schematic.cpp b/eeschema/dialogs/dialog_plot_schematic.cpp index 57ffc6639e..73a837d43a 100644 --- a/eeschema/dialogs/dialog_plot_schematic.cpp +++ b/eeschema/dialogs/dialog_plot_schematic.cpp @@ -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 ); diff --git a/eeschema/dialogs/dialog_symbol_remap.cpp b/eeschema/dialogs/dialog_symbol_remap.cpp index aad5bb786c..5f92e3aff0 100644 --- a/eeschema/dialogs/dialog_symbol_remap.cpp +++ b/eeschema/dialogs/dialog_symbol_remap.cpp @@ -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() ) ) diff --git a/eeschema/netlist_generator.cpp b/eeschema/netlist_generator.cpp index a113f310c1..901721797a 100644 --- a/eeschema/netlist_generator.cpp +++ b/eeschema/netlist_generator.cpp @@ -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 diff --git a/eeschema/plot_schematic_DXF.cpp b/eeschema/plot_schematic_DXF.cpp index 89b07c038c..e28c8251f9 100644 --- a/eeschema/plot_schematic_DXF.cpp +++ b/eeschema/plot_schematic_DXF.cpp @@ -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(); diff --git a/eeschema/plot_schematic_HPGL.cpp b/eeschema/plot_schematic_HPGL.cpp index 0948cf3bad..79ee686c7f 100644 --- a/eeschema/plot_schematic_HPGL.cpp +++ b/eeschema/plot_schematic_HPGL.cpp @@ -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 ); } } diff --git a/eeschema/plot_schematic_PDF.cpp b/eeschema/plot_schematic_PDF.cpp index 34bf6b6ab8..1020de7b9b 100644 --- a/eeschema/plot_schematic_PDF.cpp +++ b/eeschema/plot_schematic_PDF.cpp @@ -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 ); } diff --git a/eeschema/plot_schematic_PS.cpp b/eeschema/plot_schematic_PS.cpp index 505832e782..8be731ecd3 100644 --- a/eeschema/plot_schematic_PS.cpp +++ b/eeschema/plot_schematic_PS.cpp @@ -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 ); } } diff --git a/eeschema/plot_schematic_SVG.cpp b/eeschema/plot_schematic_SVG.cpp index 64c710def7..9e9cac7240 100644 --- a/eeschema/plot_schematic_SVG.cpp +++ b/eeschema/plot_schematic_SVG.cpp @@ -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; } } diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index 306061704b..23b7c12a5e 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -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 ); diff --git a/eeschema/tools/backannotate.cpp b/eeschema/tools/backannotate.cpp index 4b44fb52ad..320f8a0b8b 100644 --- a/eeschema/tools/backannotate.cpp +++ b/eeschema/tools/backannotate.cpp @@ -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 ); } diff --git a/gerbview/files.cpp b/gerbview/files.cpp index 79d101a63b..eec2327c97 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -308,7 +308,7 @@ bool GERBVIEW_FRAME::loadListOfGerberAndDrillFiles( const wxString& aPath, wxString warning; warning << "" << _( "File not found:" ) << "
" << filename.GetFullPath() << "
"; - 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( _( "Unable to create temporary file \"%s\"\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( _("unzipped file %s read error\n"), unzipped_tempfile ); - aReporter->Report( msg, SEVERITY_ERROR ); + aReporter->Report( msg, RPT_SEVERITY_ERROR ); } } else diff --git a/gerbview/job_file_reader.cpp b/gerbview/job_file_reader.cpp index d3043f9d81..d12ac77ed3 100644 --- a/gerbview/job_file_reader.cpp +++ b/gerbview/job_file_reader.cpp @@ -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; } diff --git a/include/reporter.h b/include/reporter.h index ffcb944bee..46fa720fa6 100644 --- a/include/reporter.h +++ b/include/reporter.h @@ -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; } }; diff --git a/include/widgets/ui_common.h b/include/widgets/ui_common.h index 2d73a8dd88..894414d716 100644 --- a/include/widgets/ui_common.h +++ b/include/widgets/ui_common.h @@ -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 ); diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 6ee6b4af31..7685de4220 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -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; } diff --git a/pcbnew/class_marker_pcb.cpp b/pcbnew/class_marker_pcb.cpp index 220513150c..afdeb08af4 100644 --- a/pcbnew/class_marker_pcb.cpp +++ b/pcbnew/class_marker_pcb.cpp @@ -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; } } diff --git a/pcbnew/dialogs/dialog_board_setup.h b/pcbnew/dialogs/dialog_board_setup.h index b746922e11..32a9066698 100644 --- a/pcbnew/dialogs/dialog_board_setup.h +++ b/pcbnew/dialogs/dialog_board_setup.h @@ -22,7 +22,6 @@ #define KICAD_DIALOG_BOARD_SETUP_H #include -#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 diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 9ce7c953a6..66d27a1568 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -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( aEvent.GetModel() )->ValueChanged( node ); else static_cast( 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 ) ); } diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index 99cabe3178..46519153f5 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -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; } diff --git a/pcbnew/dialogs/dialog_export_step.cpp b/pcbnew/dialogs/dialog_export_step.cpp index e77dab3495..239c441647 100644 --- a/pcbnew/dialogs/dialog_export_step.cpp +++ b/pcbnew/dialogs/dialog_export_step.cpp @@ -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 ); } } diff --git a/pcbnew/dialogs/dialog_export_svg.cpp b/pcbnew/dialogs/dialog_export_svg.cpp index e6e6442b0a..1319eb729b 100644 --- a/pcbnew/dialogs/dialog_export_svg.cpp +++ b/pcbnew/dialogs/dialog_export_svg.cpp @@ -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 ) diff --git a/pcbnew/dialogs/dialog_netlist.cpp b/pcbnew/dialogs/dialog_netlist.cpp index a72052035f..8a1a8ceb03 100644 --- a/pcbnew/dialogs/dialog_netlist.cpp +++ b/pcbnew/dialogs/dialog_netlist.cpp @@ -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; diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index f9076546ca..a330a83744 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -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. diff --git a/pcbnew/dialogs/panel_setup_drc_severities.cpp b/pcbnew/dialogs/panel_setup_drc_severities.cpp index 6fc2339f18..1232edf6f9 100644 --- a/pcbnew/dialogs/panel_setup_drc_severities.cpp +++ b/pcbnew/dialogs/panel_setup_drc_severities.cpp @@ -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; } diff --git a/pcbnew/dialogs/panel_setup_drc_severities.h b/pcbnew/dialogs/panel_setup_drc_severities.h index 58f48d94a7..95e5cdd75d 100644 --- a/pcbnew/dialogs/panel_setup_drc_severities.h +++ b/pcbnew/dialogs/panel_setup_drc_severities.h @@ -26,7 +26,7 @@ #define KICAD_PANEL_SETUP_DRC_SEVERITIES_H #include -#include +#include class BOARD; diff --git a/pcbnew/drc/drc.cpp b/pcbnew/drc/drc.cpp index a0e6a03367..2c3d5fc685 100644 --- a/pcbnew/drc/drc.cpp +++ b/pcbnew/drc/drc.cpp @@ -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; diff --git a/pcbnew/drc/drc_tree_model.cpp b/pcbnew/drc/drc_tree_model.cpp index 645d88d994..676aea4efc 100644 --- a/pcbnew/drc/drc_tree_model.cpp +++ b/pcbnew/drc/drc_tree_model.cpp @@ -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(); diff --git a/pcbnew/drc/drc_tree_model.h b/pcbnew/drc/drc_tree_model.h index 56c2cf9f3c..cb0172bdaa 100644 --- a/pcbnew/drc/drc_tree_model.h +++ b/pcbnew/drc/drc_tree_model.h @@ -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 ) { diff --git a/pcbnew/exporters/export_hyperlynx.cpp b/pcbnew/exporters/export_hyperlynx.cpp index b832473e75..c7dbd3b15d 100644 --- a/pcbnew/exporters/export_hyperlynx.cpp +++ b/pcbnew/exporters/export_hyperlynx.cpp @@ -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; } diff --git a/pcbnew/exporters/gen_footprints_placefile.cpp b/pcbnew/exporters/gen_footprints_placefile.cpp index e43be20889..f639cf325b 100644 --- a/pcbnew/exporters/gen_footprints_placefile.cpp +++ b/pcbnew/exporters/gen_footprints_placefile.cpp @@ -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; } diff --git a/pcbnew/exporters/gerber_jobfile_writer.cpp b/pcbnew/exporters/gerber_jobfile_writer.cpp index 7ad197ad13..e3ad468fa3 100644 --- a/pcbnew/exporters/gerber_jobfile_writer.cpp +++ b/pcbnew/exporters/gerber_jobfile_writer.cpp @@ -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; diff --git a/pcbnew/netlist_reader/board_netlist_updater.cpp b/pcbnew/netlist_reader/board_netlist_updater.cpp index 8be1321ae6..77bbe2377c 100644 --- a/pcbnew/netlist_reader/board_netlist_updater.cpp +++ b/pcbnew/netlist_reader/board_netlist_updater.cpp @@ -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; } diff --git a/pcbnew/netlist_reader/netlist.cpp b/pcbnew/netlist_reader/netlist.cpp index 9435521bc8..e65acaba41 100644 --- a/pcbnew/netlist_reader/netlist.cpp +++ b/pcbnew/netlist_reader/netlist.cpp @@ -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; } diff --git a/qa/pcbnew/drc/test_drc_courtyard_invalid.cpp b/qa/pcbnew/drc/test_drc_courtyard_invalid.cpp index a4aa24c4a2..1778c6ed66 100644 --- a/qa/pcbnew/drc/test_drc_courtyard_invalid.cpp +++ b/qa/pcbnew/drc/test_drc_courtyard_invalid.cpp @@ -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; } diff --git a/qa/pcbnew/drc/test_drc_courtyard_overlap.cpp b/qa/pcbnew/drc/test_drc_courtyard_overlap.cpp index 0e2a4f16bb..ee7a2441b0 100644 --- a/qa/pcbnew/drc/test_drc_courtyard_overlap.cpp +++ b/qa/pcbnew/drc/test_drc_courtyard_overlap.cpp @@ -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; } diff --git a/qa/pcbnew_tools/tools/drc_tool/drc_tool.cpp b/qa/pcbnew_tools/tools/drc_tool/drc_tool.cpp index 822fe1e207..d03da886a5 100644 --- a/qa/pcbnew_tools/tools/drc_tool/drc_tool.cpp +++ b/qa/pcbnew_tools/tools/drc_tool/drc_tool.cpp @@ -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; }