Improve marker counting and reporting.

This commit is contained in:
Jeff Young 2022-09-11 17:27:47 +01:00
parent e56635a02b
commit c16a640477
2 changed files with 30 additions and 10 deletions

View File

@ -1178,6 +1178,8 @@ void DIALOG_DRC::updateDisplayedCounts()
numExcluded += m_fpWarningsProvider->GetCount( RPT_SEVERITY_EXCLUSION ); numExcluded += m_fpWarningsProvider->GetCount( RPT_SEVERITY_EXCLUSION );
} }
bool showErrors = m_showErrors->GetValue();
bool showWarnings = m_showWarnings->GetValue();
bool errorsOverflowed = false; bool errorsOverflowed = false;
bool warningsOverflowed = false; bool warningsOverflowed = false;
bool markersOverflowed = false; bool markersOverflowed = false;
@ -1186,31 +1188,36 @@ void DIALOG_DRC::updateDisplayedCounts()
for( int ii = DRCE_FIRST; ii < DRCE_LAST; ++ii ) 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 ) if( bds.GetSeverity( ii ) == RPT_SEVERITY_ERROR )
{
errorsOverflowed = true; errorsOverflowed = true;
}
else if( bds.GetSeverity( ii ) == RPT_SEVERITY_WARNING ) else if( bds.GetSeverity( ii ) == RPT_SEVERITY_WARNING )
{
warningsOverflowed = true; warningsOverflowed = true;
}
if( ii == DRCE_UNCONNECTED_ITEMS ) 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 else if( ii == DRCE_MISSING_FOOTPRINT
|| ii == DRCE_DUPLICATE_FOOTPRINT || ii == DRCE_DUPLICATE_FOOTPRINT
|| ii == DRCE_EXTRA_FOOTPRINT || ii == DRCE_EXTRA_FOOTPRINT
|| ii == DRCE_NET_CONFLICT ) || 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 else
{ {
markersOverflowed = true; if( showWarnings && bds.GetSeverity( ii ) == RPT_SEVERITY_WARNING )
markersOverflowed = true;
else if( showErrors && bds.GetSeverity( ii ) == RPT_SEVERITY_ERROR )
markersOverflowed = true;
} }
} }
} }

View File

@ -172,8 +172,21 @@ void PCB_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_
{ {
aList.emplace_back( _( "Type" ), _( "Marker" ) ); aList.emplace_back( _( "Type" ), _( "Marker" ) );
aList.emplace_back( _( "Violation" ), m_rcItem->GetErrorMessage() ); aList.emplace_back( _( "Violation" ), m_rcItem->GetErrorMessage() );
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 ) if( GetMarkerType() == MARKER_DRAWING_SHEET )
{ {