From f7b971ecb7d24ea4e486f6df14c156dc9a9a754a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 28 May 2024 18:10:50 +0100 Subject: [PATCH] Setup Footprint-Editor-specific severities. Fixes https://gitlab.com/kicad/code/kicad/-/issues/18102 --- pcbnew/initpcb.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pcbnew/initpcb.cpp b/pcbnew/initpcb.cpp index 4ebcc3b8f4..041d79c85d 100644 --- a/pcbnew/initpcb.cpp +++ b/pcbnew/initpcb.cpp @@ -35,6 +35,7 @@ #include #include +#include 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& 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 );