Setup Footprint-Editor-specific severities.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18102
This commit is contained in:
Jeff Young 2024-05-28 18:10:50 +01:00
parent 139d356065
commit f7b971ecb7
1 changed files with 15 additions and 0 deletions

View File

@ -35,6 +35,7 @@
#include <footprint_edit_frame.h>
#include <widgets/appearance_controls.h>
#include <drc/drc_item.h>
bool PCB_EDIT_FRAME::Clear_Pcb( bool doAskAboutUnsavedChanges, bool aFinal )
@ -141,6 +142,20 @@ bool FOOTPRINT_EDIT_FRAME::Clear_Pcb( bool doAskAboutUnsavedChanges )
// This board will only be used to hold a footprint for editing
GetBoard()->SetBoardUse( BOARD_USE::FPHOLDER );
// Setup our own severities for the Footprint Checker.
// These are not (at present) user-editable.
std::map<int, SEVERITY>& drcSeverities = GetBoard()->GetDesignSettings().m_DRCSeverities;
for( int errorCode = DRCE_FIRST; errorCode <= DRCE_LAST; ++errorCode )
drcSeverities[ errorCode ] = RPT_SEVERITY_ERROR;
drcSeverities[ DRCE_DRILLED_HOLES_COLOCATED ] = RPT_SEVERITY_WARNING;
drcSeverities[ DRCE_DRILLED_HOLES_TOO_CLOSE ] = RPT_SEVERITY_WARNING;
drcSeverities[ DRCE_PADSTACK ] = RPT_SEVERITY_WARNING;
drcSeverities[ DRCE_FOOTPRINT_TYPE_MISMATCH ] = RPT_SEVERITY_WARNING;
// clear filename, to avoid overwriting an old file
GetBoard()->SetFileName( wxEmptyString );