[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Color silk layers in pcb



On 9/3/10, Stefan Salewski <mail@xxxxxxxxxxxx> wrote:
> On Fri, 2010-09-03 at 11:53 +0200, Pawel Kusmierski wrote:
>>    Can I get pcb to either treat a layer other than the default silk as
>>    non-metal
>>    (so it would not short pads and mess up nets),
> No, currently we have only one silk layer. You may "miss-use" other
> copper layers for that task -- it may work when that layer is not in
> your real copper layer groups, but unfortunately it still connects to
> vias and can generate shorts.

Probably this patch may be used as a workaround.

Put your non-copper layer into a distinct layer group
(File->Preferences->Layers, Groups Tab), add to the layer an attribute
named "PCB::skip-drc" (Edit->Edit attributes of->Current Layer),
and PCB should skip the layer during DRC and connections lookup.

Kind regards
From 1bec53aea09312b99ee14c40fe7efcaa80158467 Mon Sep 17 00:00:00 2001
From: Ineiev <ineiev@xxxxxxxxxxxxxxxx>
Date: Sat, 4 Sep 2010 14:12:46 +0400
Subject: [PATCH] recognize PCB::skip-drc layer attribute

layers with `PCB::skip-drc' attribute are excluded
from DRC and connection lookup
---
 src/action.c |    2 +-
 src/action.h |    2 ++
 src/find.c   |   23 +++++++++++++++++++++--
 src/global.h |    1 +
 4 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/src/action.c b/src/action.c
index 32e294c..2936080 100644
--- a/src/action.c
+++ b/src/action.c
@@ -6957,7 +6957,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..7b64e05 100644
--- a/src/action.h
+++ b/src/action.h
@@ -46,4 +46,6 @@ 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 593be70..ac94f4b 100644
--- a/src/find.c
+++ b/src/find.c
@@ -81,6 +81,7 @@
 
 #include "global.h"
 
+#include "action.h"
 #include "crosshair.h"
 #include "data.h"
 #include "draw.h"
@@ -826,6 +827,8 @@ LookupLOConnectionsToPVList (bool AndRats)
       /* now all lines, arcs and polygons of the several layers */
       for (layer = 0; layer < max_layer; layer++)
         {
+	  if (LAYER_PTR (layer)->no_drc)
+	    continue;
           info.layer = layer;
           /* add touching lines */
           if (setjmp (info.env) == 0)
@@ -1173,6 +1176,8 @@ LookupPVConnectionsToLOList (bool AndRats)
   /* loop over all layers */
   for (layer = 0; layer < max_layer; layer++)
     {
+      if (LAYER_PTR (layer)->no_drc)
+	continue;
       /* do nothing if there are no PV's */
       if (TotalP + TotalV == 0)
         {
@@ -2900,6 +2905,18 @@ ListsEmpty (bool AndRats)
   return (empty);
 }
 
+static void
+reassign_no_drc_flags (void)
+{
+  int layer;
+
+  for (layer = 0; layer < max_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 
  */
@@ -2907,6 +2924,7 @@ static bool
 DoIt (bool AndRats, bool AndDraw)
 {
   bool new = false;
+  reassign_no_drc_flags ();
   do
     {
       /* lookup connections; these are the steps (2) to (4)
@@ -3349,6 +3367,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);
@@ -3365,8 +3384,8 @@ LookupConnection (LocationType X, LocationType Y, bool AndDraw,
           int laynum = GetLayerNumber (PCB->Data,
                                        (LayerTypePtr) ptr1);
 
-          /* don't mess with silk objects! */
-          if (laynum >= max_layer)
+          /* don't mess with non-conducting objects! */
+          if (laynum >= max_layer || ((LayerTypePtr)ptr1)->no_drc)
             return;
         }
     }
diff --git a/src/global.h b/src/global.h
index bb78abc..1c7ca26 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;
 
-- 
1.6.0.2


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user