← Back to team overview

kicad-developers team mailing list archive

[PATCH 1/2] DRC: Add test for via drill size

 

This test is only run when the via size itself is acceptable, to avoid
bigger changes to the codebase.
---
 pcbnew/class_drc_item.cpp               |  4 ++++
 pcbnew/drc_clearance_test_functions.cpp | 12 ++++++++++++
 pcbnew/drc_stuff.h                      | 26 ++++++++++++++------------
 3 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/pcbnew/class_drc_item.cpp b/pcbnew/class_drc_item.cpp
index ff145f4..cf92901 100644
--- a/pcbnew/class_drc_item.cpp
+++ b/pcbnew/class_drc_item.cpp
@@ -89,6 +89,10 @@ wxString DRC_ITEM::GetErrorText() const
         return wxString( _( "Too small via size" ) );
     case DRCE_TOO_SMALL_MICROVIA:
         return wxString( _( "Too small micro via size" ) );
+    case DRCE_TOO_SMALL_VIA_DRILL:
+        return wxString( _( "Too small via drill" ) );
+    case DRCE_TOO_SMALL_MICROVIA_DRILL:
+        return wxString( _( "Too small micro via drill" ) );
 
     // use < since this is text ultimately embedded in HTML
     case DRCE_NETCLASS_TRACKWIDTH:
diff --git a/pcbnew/drc_clearance_test_functions.cpp b/pcbnew/drc_clearance_test_functions.cpp
index ce34c80..5bf79a3 100644
--- a/pcbnew/drc_clearance_test_functions.cpp
+++ b/pcbnew/drc_clearance_test_functions.cpp
@@ -169,6 +169,12 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
                                               DRCE_TOO_SMALL_MICROVIA, m_currentMarker );
                 return false;
             }
+            if( refvia->GetDrill() < dsnSettings.m_MicroViasMinDrill )
+            {
+                m_currentMarker = fillMarker( refvia, NULL,
+                                              DRCE_TOO_SMALL_MICROVIA_DRILL, m_currentMarker );
+                return false;
+            }
         }
         else
         {
@@ -178,6 +184,12 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
                                               DRCE_TOO_SMALL_VIA, m_currentMarker );
                 return false;
             }
+            if( refvia->GetDrill() < dsnSettings.m_ViasMinDrill )
+            {
+                m_currentMarker = fillMarker( refvia, NULL,
+                                              DRCE_TOO_SMALL_VIA_DRILL, m_currentMarker );
+                return false;
+            }
         }
 
         // test if via's hole is bigger than its diameter
diff --git a/pcbnew/drc_stuff.h b/pcbnew/drc_stuff.h
index 9a5e147..1d863ea 100644
--- a/pcbnew/drc_stuff.h
+++ b/pcbnew/drc_stuff.h
@@ -66,18 +66,20 @@
 #define DRCE_TOO_SMALL_TRACK_WIDTH             27   ///< Too small track width
 #define DRCE_TOO_SMALL_VIA                     28   ///< Too small via size
 #define DRCE_TOO_SMALL_MICROVIA                29   ///< Too small micro via size
-#define DRCE_NETCLASS_TRACKWIDTH               30   ///< netclass has TrackWidth < board.m_designSettings->m_TrackMinWidth
-#define DRCE_NETCLASS_CLEARANCE                31   ///< netclass has Clearance < board.m_designSettings->m_TrackClearance
-#define DRCE_NETCLASS_VIASIZE                  32   ///< netclass has ViaSize < board.m_designSettings->m_ViasMinSize
-#define DRCE_NETCLASS_VIADRILLSIZE             33   ///< netclass has ViaDrillSize < board.m_designSettings->m_ViasMinDrill
-#define DRCE_NETCLASS_uVIASIZE                 34   ///< netclass has ViaSize < board.m_designSettings->m_MicroViasMinSize
-#define DRCE_NETCLASS_uVIADRILLSIZE            35   ///< netclass has ViaSize < board.m_designSettings->m_MicroViasMinDrill
-#define DRCE_VIA_INSIDE_KEEPOUT                36   ///< Via in inside a keepout area
-#define DRCE_TRACK_INSIDE_KEEPOUT              37   ///< Track in inside a keepout area
-#define DRCE_PAD_INSIDE_KEEPOUT                38   ///< Pad in inside a keepout area
-#define DRCE_VIA_INSIDE_TEXT                   39   ///< Via in inside a text area
-#define DRCE_TRACK_INSIDE_TEXT                 40   ///< Track in inside a text area
-#define DRCE_PAD_INSIDE_TEXT                   41   ///< Pad in inside a text area
+#define DRCE_TOO_SMALL_VIA_DRILL               30   ///< Too small via drill
+#define DRCE_TOO_SMALL_MICROVIA_DRILL          31   ///< Too small micro via drill
+#define DRCE_NETCLASS_TRACKWIDTH               32   ///< netclass has TrackWidth < board.m_designSettings->m_TrackMinWidth
+#define DRCE_NETCLASS_CLEARANCE                33   ///< netclass has Clearance < board.m_designSettings->m_TrackClearance
+#define DRCE_NETCLASS_VIASIZE                  34   ///< netclass has ViaSize < board.m_designSettings->m_ViasMinSize
+#define DRCE_NETCLASS_VIADRILLSIZE             35   ///< netclass has ViaDrillSize < board.m_designSettings->m_ViasMinDrill
+#define DRCE_NETCLASS_uVIASIZE                 36   ///< netclass has ViaSize < board.m_designSettings->m_MicroViasMinSize
+#define DRCE_NETCLASS_uVIADRILLSIZE            37   ///< netclass has ViaSize < board.m_designSettings->m_MicroViasMinDrill
+#define DRCE_VIA_INSIDE_KEEPOUT                38   ///< Via in inside a keepout area
+#define DRCE_TRACK_INSIDE_KEEPOUT              39   ///< Track in inside a keepout area
+#define DRCE_PAD_INSIDE_KEEPOUT                40   ///< Pad in inside a keepout area
+#define DRCE_VIA_INSIDE_TEXT                   41   ///< Via in inside a text area
+#define DRCE_TRACK_INSIDE_TEXT                 42   ///< Track in inside a text area
+#define DRCE_PAD_INSIDE_TEXT                   43   ///< Pad in inside a text area
 
 
 class EDA_DRAW_PANEL;

Follow ups