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

gEDA-user: pcb [PATCH] Added ActionSetViasTented to allow for setting the solder mask of vias to be fully tented.



Hi all,

And another patch.

This one is created from a fresh branch so it should be able to apply
without the former patch.

Another EUR 0.02

Kind regards,

Bert Timmerman.
From c8d3f4f39b327e5051abba98b2e73f6f29a16cc8 Mon Sep 17 00:00:00 2001
From: Bert Timmerman <bert.timmerman@xxxxxxxxx>
Date: Sun, 29 Nov 2009 18:09:24 +0100
Subject: [PATCH] Added ActionSetViasTented to allow for setting the solder mask for vias to be fully tented.

Set the solder mask for vias to be fully tented, that is to fully cover the copper annulus and drill hole.
What you can do is this:
* Enable the solder mask layer.
* Select the vias that need their solder mask value changed to fully cover the copper annulus and drilling hole.
* :SetViasTented(Selected) to change only the selected vias.
Or you can do:
* :SetViasTented(All) to change all vias.
---
 src/action.c |   82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/src/action.c b/src/action.c
index 6b979d3..7910521 100644
--- a/src/action.c
+++ b/src/action.c
@@ -4251,6 +4251,85 @@ ActionMinMaskGap (int argc, char **argv, int x, int y)
 
 /* ---------------------------------------------------------------------------  */
 
+static const char setviastented_syntax[] =
+  "SetViasTented(Selected)\n"
+  "SetViasTented(All)";
+
+static const char setviastented_help[] =
+  "Set the solder mask for vias to be fully tented.";
+
+/* %start-doc actions SetViasTented
+
+What you can do is this:
+
+* Enable the solder mask layer.
+
+* Select the vias that need their solder mask value changed to fully cover the copper annulus and drilling hole.
+
+* :SetViasTented(Selected) to change only the selected vias.
+
+Or you can do:
+
+* :SetViasTented(All) to change all vias.
+
+There is a MinMaskGap action to increase the solder mask gap to vendor minimum requirements.
+
+%end-doc */
+
+static int
+ActionSetViasTented (int argc, char **argv, int x, int y)
+{
+  char *function = ARG (0);
+  int value;
+  int flags;
+  int all;
+
+  if (!function)
+    return 1;
+  all = 0;
+  if (strcasecmp (function, "Selected") == 0)
+    flags = SELECTEDFLAG;
+  else if (strcasecmp (function, "") == 0)
+    all = 1;
+  else
+    {
+      flags = 0;
+    }
+
+  HideCrosshair (True);
+  SaveUndoSerialNumber ();
+  if (all)
+  {
+    VIA_LOOP (PCB->Data);
+    {
+      value = via->Thickness;
+      ChangeObjectMaskSize (VIA_TYPE, via, 0, 0, -value, 1);
+      RestoreUndoSerialNumber ();
+    }
+    END_LOOP; /* VIA_LOOP */
+  }
+  else
+  {  
+    VIA_LOOP (PCB->Data);
+    {
+      if (!TEST_FLAGS (flags, via))
+        continue;
+      else
+      {
+        value = via->Thickness;
+	ChangeObjectMaskSize (VIA_TYPE, via, 0, 0, -value, 1);
+	RestoreUndoSerialNumber ();
+      }
+    }
+    END_LOOP; /* VIA_LOOP */
+  }
+  RestoreUndoSerialNumber ();
+  IncrementUndoSerialNumber ();
+  return 0;
+}
+
+/* ---------------------------------------------------------------------------  */
+
 static const char mincleargap_syntax[] =
   "MinClearGap(delta)\n" "MinClearGap(Selected, delta)";
 
@@ -6919,6 +6998,9 @@ HID_Action action_action_list[] = {
   {"SaveTo", 0, ActionSaveTo,
    saveto_help, saveto_syntax}
   ,
+  {"SetViasTented", 0, ActionSetViasTented,
+   setviastented_help, setviastented_syntax}
+  ,
   {"SetSquare", 0, ActionSetSquare,
    setsquare_help, setsquare_syntax}
   ,
-- 
1.5.0.6


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