Hi, I have rewritten the skip_drc patch (originally written by Ineiev) to apply to the current git HEAD.
The original patch can be found here: http://www.seul.org/pipermail/geda-user/2010-September/048721.html My patch is attached. Levente
diff --git a/src/action.c b/src/action.c index de2738e..2ad20b1 100644 --- a/src/action.c +++ b/src/action.c @@ -7001,7 +7001,7 @@ find_element_by_refdes (char *refdes) return NULL; } -static AttributeType * +AttributeType * lookup_attr (AttributeListTypePtr list, const char *name) { int i; diff --git a/src/action.h b/src/action.h index ee116e8..ca1cbc3 100644 --- a/src/action.h +++ b/src/action.h @@ -46,4 +46,7 @@ void warpNoWhere (void); /* In gui-misc.c */ bool ActionGetLocation (char *); void ActionGetXY (char *); + +AttributeType * lookup_attr (AttributeListTypePtr list, const char *name); + #endif diff --git a/src/find.c b/src/find.c index 615659d..167f149 100644 --- a/src/find.c +++ b/src/find.c @@ -94,6 +94,7 @@ #include "set.h" #include "undo.h" #include "rats.h" +#include "action.h" #ifdef HAVE_LIBDMALLOC #include <dmalloc.h> @@ -822,6 +823,8 @@ LookupLOConnectionsToPVList (bool AndRats) /* now all lines, arcs and polygons of the several layers */ for (layer = 0; layer < max_copper_layer; layer++) { + if (LAYER_PTR (layer)->no_drc) + continue; info.layer = layer; /* add touching lines */ if (setjmp (info.env) == 0) @@ -1169,6 +1172,8 @@ LookupPVConnectionsToLOList (bool AndRats) /* loop over all layers */ for (layer = 0; layer < max_copper_layer; layer++) { + if (LAYER_PTR (layer)->no_drc) + continue; /* do nothing if there are no PV's */ if (TotalP + TotalV == 0) { @@ -2896,6 +2901,19 @@ ListsEmpty (bool AndRats) return (empty); } +static void +reassign_no_drc_flags (void) +{ + int layer; + + for (layer = 0; layer < max_copper_layer; layer++) + { + LayerTypePtr l = LAYER_PTR (layer); + l->no_drc = lookup_attr (&(l->Attributes), "PCB::skip-drc") != NULL; + } +} + + /* --------------------------------------------------------------------------- * loops till no more connections are found */ @@ -2903,6 +2921,7 @@ static bool DoIt (bool AndRats, bool AndDraw) { bool newone = false; + reassign_no_drc_flags (); do { /* lookup connections; these are the steps (2) to (4) @@ -3345,6 +3364,7 @@ LookupConnection (LocationType X, LocationType Y, bool AndDraw, /* check if there are any pins or pads at that position */ + reassign_no_drc_flags (); type = SearchObjectByLocation (LOOKUP_FIRST, &ptr1, &ptr2, &ptr3, X, Y, Range); @@ -3361,9 +3381,10 @@ LookupConnection (LocationType X, LocationType Y, bool AndDraw, int laynum = GetLayerNumber (PCB->Data, (LayerTypePtr) ptr1); - /* don't mess with silk objects! */ - if (laynum >= max_copper_layer) + /* don't mess with non-conducting objects! */ + if (laynum >= max_copper_layer || ((LayerTypePtr)ptr1)->no_drc) return; + } } else diff --git a/src/global.h b/src/global.h index 0420a18..8460714 100644 --- a/src/global.h +++ b/src/global.h @@ -301,6 +301,7 @@ typedef struct /* holds information about one layer */ char *Color, /* color */ *SelectedColor; AttributeListType Attributes; + int no_drc; /* whether to ignore the layer when checking the design rules */ } LayerType, *LayerTypePtr;
_______________________________________________ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user