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

Re: gEDA-user: paste gerber output of PCB



Index: draw.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/draw.c,v
retrieving revision 1.51
diff -p -U2 -r1.51 draw.c
--- draw.c	19 Apr 2006 22:36:46 -0000	1.51
+++ draw.c	14 May 2006 02:06:25 -0000
@@ -423,5 +423,5 @@ static void
 DrawEverything (BoxTypePtr drawn_area)
 {
-  int i, ngroups;
+  int i, ngroups, side;
   int component, solder;
   /* This is the list of layer groups we will draw.  */
@@ -542,4 +542,40 @@ DrawEverything (BoxTypePtr drawn_area)
     }
 
+  for (side=0; side<=1; side++)
+    {
+      int doit;
+      Boolean NoData = True;
+      ALLPAD_LOOP (PCB->Data);
+      {
+	if ((TEST_FLAG (ONSOLDERFLAG, pad) && side == SOLDER_LAYER)
+	    || (!TEST_FLAG (ONSOLDERFLAG, pad) && side == COMPONENT_LAYER))
+          {
+            NoData = False;
+            break;
+          }
+      }
+      ENDALL_LOOP;
+
+      /* skip empty files */
+      if (NoData)
+        continue;
+
+      if (side == SOLDER_LAYER)
+	doit = gui->set_layer ("bottompaste", SL(PASTE, BOTTOM));
+      else
+	doit = gui->set_layer ("toppaste", SL(PASTE, TOP));
+      if (doit)
+	{
+	  gui->set_color (Output.fgGC, PCB->ElementColor);
+	  ALLPAD_LOOP (PCB->Data);
+	  {
+	    if ((TEST_FLAG (ONSOLDERFLAG, pad) && side == SOLDER_LAYER)
+		|| (!TEST_FLAG (ONSOLDERFLAG, pad) && side == COMPONENT_LAYER))
+	      DrawPadLowLevel (pad);
+	  }
+	  ENDALL_LOOP;
+	}
+    }
+
   doing_assy = True;
   if (gui->set_layer ("topassembly", SL (ASSY, TOP)))