Show errors before warnings in DRC/ERC.

(cherry picked from commit 316a9511e813af257af23f60642859fa623537d4)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
This commit is contained in:
dsa-t 2025-08-21 00:25:07 +03:00
parent 81864057d2
commit f896417ed4
2 changed files with 16 additions and 0 deletions

View File

@ -19,6 +19,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <algorithm>
#include <erc/erc_item.h>
#include <erc/erc_settings.h>
#include <schematic.h>
@ -398,6 +399,13 @@ void SHEETLIST_ERC_ITEMS_PROVIDER::SetSeverities( int aSeverities )
if( markerSeverity & m_severities )
m_filteredMarkers.push_back( aMarker );
} );
// Sort markers so that errors appear before warnings
std::stable_sort( m_filteredMarkers.begin(), m_filteredMarkers.end(),
[]( const SCH_MARKER* a, const SCH_MARKER* b )
{
return a->GetSeverity() > b->GetSeverity();
} );
}

View File

@ -26,6 +26,7 @@
#include "wx/html/m_templ.h"
#include "wx/html/styleparams.h"
#include "core/kicad_algo.h"
#include <algorithm>
#include <drc/drc_item.h>
#include <drc/drc_rule.h>
#include <board.h>
@ -523,6 +524,13 @@ void DRC_ITEMS_PROVIDER::SetSeverities( int aSeverities )
m_filteredMarkers.push_back( marker );
}
}
// Sort markers so that errors appear before warnings
std::stable_sort( m_filteredMarkers.begin(), m_filteredMarkers.end(),
[]( const PCB_MARKER* a, const PCB_MARKER* b )
{
return a->GetSeverity() > b->GetSeverity();
} );
}