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

gEDA-user: silkscreen patches



Hello

I have made two patches (separated by a line of ========= ) that exclude
silkscreen from the areas that are not covered by soldermask. Usually
silkscreen goes over these areas and then the solder would be contaminated and
the soldering process probably ruined.

The first one is for pcb-20030815, the second one for pcb-20031113.
Cl<


--- old/src/print.c	2003-07-20 19:35:00.000000000 +0200
+++ new/src/print.c	2003-11-17 20:04:41.000000000 +0100
@@ -429,6 +429,76 @@
 }
 
 /* ---------------------------------------------------------------------------
+ * prints solder and component side placement plans
+ * first print element outlines and names, then silk layer
+ * returns != zero on error
+ */
+static int
+PrintPlans (void)
+{
+  static char *extention[2] = { "componentplan", "solderplan" },
+    *DOSextention[2] =
+  {
+  "cplan", "splan"}
+  , *description[2] =
+  {
+  "placement plan, component side", "placement plan, solder side"};
+  LayerTypePtr layer;
+  int i;
+  Boolean noData;
+
+  /* loop over both sides, start with component */
+  for (i = 0; i < 2; i++)
+    {
+      layer =
+	&PCB->Data->Layer[MAX_LAYER +
+			  (i == 0 ? COMPONENT_LAYER : SOLDER_LAYER)];
+      noData = True;
+      ELEMENT_LOOP (PCB->Data,
+		    if ((TEST_FLAG (ONSOLDERFLAG, element) == 0) == (i == 0))
+		    {
+		    noData = False; break;}
+      );
+      if (layer->PolygonN || layer->LineN || layer->ArcN || layer->TextN)
+	noData = False;
+      if (noData)
+	continue;
+      /* start with the component side */
+      if (SetupPrintFile (GlobalDOSFlag ? DOSextention[i] : extention[i],
+			  description[i]))
+	return (1);
+      /* positive polarity */
+      Device->Polarity (0);
+      /* print element outlines and canonical, instance or
+       * value descriptions
+       */
+      if (GlobalAlignmentFlag)
+	FPrintAlignment ();
+
+      SetPrintColor (PCB->ElementColor);
+      ELEMENT_LOOP (PCB->Data,
+		    if ((TEST_FLAG (ONSOLDERFLAG, element) == 0) == (i == 0))
+		    Device->ElementPackage (element););
+
+      POLYGON_LOOP (layer, Device->Poly (polygon));
+      LINE_LOOP (layer, Device->Line (line, False));
+      ARC_LOOP (layer, Device->Arc (arc, False));
+      TEXT_LOOP (layer, Device->Text (text));
+
+      Device->Polarity (3);
+      SetPrintColor (PCB->PinColor);
+      ALLPAD_LOOP (PCB->Data,
+		   if ((TEST_FLAG (ONSOLDERFLAG, pad) == 0) == (i == 0))
+		   Device->Pad (pad, 2););
+      ALLPIN_LOOP (PCB->Data, Device->PinOrVia (pin, 2););
+      VIA_LOOP (PCB->Data, Device->PinOrVia (via, 2););
+
+      ClosePrintFile ();
+    }
+  return (0);
+}
+
+/* ---------------------------------------------------------------------------
  * prints solder and component side silk screens
  * first print element outlines and names, then silk layer
  * returns != zero on error
@@ -484,6 +554,15 @@
       LINE_LOOP (layer, Device->Line (line, False));
       ARC_LOOP (layer, Device->Arc (arc, False));
       TEXT_LOOP (layer, Device->Text (text));
+
+      Device->Polarity (2);
+      SetPrintColor (PCB->PinColor);
+      ALLPAD_LOOP (PCB->Data,
+		   if ((TEST_FLAG (ONSOLDERFLAG, pad) == 0) == (i == 0))
+		   Device->Pad (pad, 2););
+      ALLPIN_LOOP (PCB->Data, Device->PinOrVia (pin, 2););
+      VIA_LOOP (PCB->Data, Device->PinOrVia (via, 2););
+
       ClosePrintFile ();
     }
   return (0);
@@ -711,7 +790,7 @@
   Device->init (&DeviceFlags);
   /* OK, call all necessary subroutines */
   if (PrintLayergroups () || PrintSilkscreen () ||
-      PrintDrill () || PrintMask () || PrintPaste ())
+      PrintDrill () || PrintMask () || PrintPaste () || PrintPlans () )
     return (1);
   Device->Exit ();
   restoreCursor();

===============================================================================

diff -pur pcb-20031113/src/print.c pcb-20031113-silkscreen/src/print.c
--- pcb-20031113/src/print.c	2003-11-13 09:01:30.000000000 +0000
+++ pcb-20031113-silkscreen/src/print.c	2004-01-31 20:11:40.000000000 +0000
@@ -431,6 +431,76 @@ PrintLayergroups (void)
 }
 
 /* ---------------------------------------------------------------------------
+ * prints solder and component side placement plans
+ * first print element outlines and names, then silk layer
+ * returns != zero on error
+ */
+static int
+PrintPlans (void)
+{
+  static char *extention[2] = { "componentplan", "solderplan" },
+    *DOSextention[2] =
+  {
+  "cplan", "splan"}
+  , *description[2] =
+  {
+  "placement plan, component side", "placement plan, solder side"};
+  LayerTypePtr layer;
+  int i;
+  Boolean noData;
+
+  /* loop over both sides, start with component */
+  for (i = 0; i < 2; i++)
+    {
+      layer =
+	&PCB->Data->Layer[MAX_LAYER +
+			  (i == 0 ? COMPONENT_LAYER : SOLDER_LAYER)];
+      noData = True;
+      ELEMENT_LOOP (PCB->Data,
+		    if ((TEST_FLAG (ONSOLDERFLAG, element) == 0) == (i == 0))
+		    {
+		    noData = False; break;}
+      );
+      if (layer->PolygonN || layer->LineN || layer->ArcN || layer->TextN)
+	noData = False;
+      if (noData)
+	continue;
+      /* start with the component side */
+      if (SetupPrintFile (GlobalDOSFlag ? DOSextention[i] : extention[i],
+			  description[i]))
+	return (1);
+      /* positive polarity */
+      Device->Polarity (0);
+      /* print element outlines and canonical, instance or
+       * value descriptions
+       */
+      if (GlobalAlignmentFlag)
+	FPrintAlignment ();
+
+      SetPrintColor (PCB->ElementColor);
+      ELEMENT_LOOP (PCB->Data,
+		    if ((TEST_FLAG (ONSOLDERFLAG, element) == 0) == (i == 0))
+		    Device->ElementPackage (element););
+
+      POLYGON_LOOP (layer, Device->Poly (polygon));
+      LINE_LOOP (layer, Device->Line (line, False));
+      ARC_LOOP (layer, Device->Arc (arc, False));
+      TEXT_LOOP (layer, Device->Text (text));
+
+      Device->Polarity (3);
+      SetPrintColor (PCB->PinColor);
+      ALLPAD_LOOP (PCB->Data,
+		   if ((TEST_FLAG (ONSOLDERFLAG, pad) == 0) == (i == 0))
+		   Device->Pad (pad, 2););
+      ALLPIN_LOOP (PCB->Data, Device->PinOrVia (pin, 2););
+      VIA_LOOP (PCB->Data, Device->PinOrVia (via, 2););
+
+      ClosePrintFile ();
+    }
+  return (0);
+}
+
+/* ---------------------------------------------------------------------------
  * prints solder and component side silk screens
  * first print element outlines and names, then silk layer
  * returns != zero on error
@@ -486,6 +556,15 @@ PrintSilkscreen (void)
       LINE_LOOP (layer, Device->Line (line, False));
       ARC_LOOP (layer, Device->Arc (arc, False));
       TEXT_LOOP (layer, Device->Text (text));
+
+      Device->Polarity (2);
+      SetPrintColor (PCB->PinColor);
+      ALLPAD_LOOP (PCB->Data,
+		   if ((TEST_FLAG (ONSOLDERFLAG, pad) == 0) == (i == 0))
+		   Device->Pad (pad, 2););
+      ALLPIN_LOOP (PCB->Data, Device->PinOrVia (pin, 2););
+      VIA_LOOP (PCB->Data, Device->PinOrVia (via, 2););
+
       ClosePrintFile ();
     }
   return (0);
@@ -949,7 +1028,8 @@ Print (char *Command, float Scale,
   Device->init (&DeviceFlags);
   /* OK, call all necessary subroutines */
   if (PrintLayergroups () || PrintSilkscreen () ||
-      PrintDrill () || PrintMask () || PrintPaste () || PrintFab ())
+      PrintDrill () || PrintMask () || PrintPaste () || PrintFab () ||
+      PrintPlans() )
     return (1);
   Device->Exit ();
   restoreCursor();
Only in pcb-20031113-silkscreen/src: print.c.rej
Only in pcb-20031113-silkscreen/src: print.c~