From c16a640477b22730cbdaeeee2a3b226a56ea85a7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 11 Sep 2022 17:27:47 +0100 Subject: [PATCH] Improve marker counting and reporting. --- pcbnew/dialogs/dialog_drc.cpp | 23 +++++++++++++++-------- pcbnew/pcb_marker.cpp | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 35963f2dc9..bc09f7c022 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -1178,6 +1178,8 @@ void DIALOG_DRC::updateDisplayedCounts() numExcluded += m_fpWarningsProvider->GetCount( RPT_SEVERITY_EXCLUSION ); } + bool showErrors = m_showErrors->GetValue(); + bool showWarnings = m_showWarnings->GetValue(); bool errorsOverflowed = false; bool warningsOverflowed = false; bool markersOverflowed = false; @@ -1186,31 +1188,36 @@ void DIALOG_DRC::updateDisplayedCounts() for( int ii = DRCE_FIRST; ii < DRCE_LAST; ++ii ) { - if( drcEngine->IsErrorLimitExceeded( ii ) && bds.GetSeverity( ii ) != RPT_SEVERITY_IGNORE ) + if( drcEngine->IsErrorLimitExceeded( ii ) ) { if( bds.GetSeverity( ii ) == RPT_SEVERITY_ERROR ) - { errorsOverflowed = true; - } else if( bds.GetSeverity( ii ) == RPT_SEVERITY_WARNING ) - { warningsOverflowed = true; - } if( ii == DRCE_UNCONNECTED_ITEMS ) { - unconnectedOverflowed = true; + if( showWarnings && bds.GetSeverity( ii ) == RPT_SEVERITY_WARNING ) + unconnectedOverflowed = true; + else if( showErrors && bds.GetSeverity( ii ) == RPT_SEVERITY_ERROR ) + unconnectedOverflowed = true; } else if( ii == DRCE_MISSING_FOOTPRINT || ii == DRCE_DUPLICATE_FOOTPRINT || ii == DRCE_EXTRA_FOOTPRINT || ii == DRCE_NET_CONFLICT ) { - footprintsOverflowed = true; + if( showWarnings && bds.GetSeverity( ii ) == RPT_SEVERITY_WARNING ) + footprintsOverflowed = true; + else if( showErrors && bds.GetSeverity( ii ) == RPT_SEVERITY_ERROR ) + footprintsOverflowed = true; } else { - markersOverflowed = true; + if( showWarnings && bds.GetSeverity( ii ) == RPT_SEVERITY_WARNING ) + markersOverflowed = true; + else if( showErrors && bds.GetSeverity( ii ) == RPT_SEVERITY_ERROR ) + markersOverflowed = true; } } } diff --git a/pcbnew/pcb_marker.cpp b/pcbnew/pcb_marker.cpp index 97d4f72774..7932b40853 100644 --- a/pcbnew/pcb_marker.cpp +++ b/pcbnew/pcb_marker.cpp @@ -172,8 +172,21 @@ void PCB_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetErrorMessage() ); - aList.emplace_back( _( "Severity" ), GetSeverity() == RPT_SEVERITY_ERROR ? _( "Error" ) - : _( "Warning" ) ); + + switch( GetSeverity() ) + { + case RPT_SEVERITY_IGNORE: + aList.emplace_back( _( "Severity" ), _( "Ignore" ) ); + break; + case RPT_SEVERITY_WARNING: + aList.emplace_back( _( "Severity" ), _( "Warning" ) ); + break; + case RPT_SEVERITY_ERROR: + aList.emplace_back( _( "Severity" ), _( "Error" ) ); + break; + default: + break; + } if( GetMarkerType() == MARKER_DRAWING_SHEET ) {