[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (2e29fd0c82c5ac586399446318f26efd33257645)
The branch, master has been updated
via 2e29fd0c82c5ac586399446318f26efd33257645 (commit)
via 85feb2ce0539bc462719d6efcdf28184dff9f61a (commit)
via 4f70768a4548612aad5a1a491889b32389f359c1 (commit)
from 2744a86d9d5dd34ab256b991c21ddd022e886dd0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/draw.c | 72 +++++++++++++++++++++++++---------------------------------
src/macro.h | 7 +++++
src/misc.c | 16 +++++++++++++
src/misc.h | 1 +
4 files changed, 55 insertions(+), 41 deletions(-)
=================
Commit Messages
=================
commit 2e29fd0c82c5ac586399446318f26efd33257645
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
draw.c: Add a DrawPaste() helper function for paste layers
:100644 100644 f12020d... cb1b790... M src/draw.c
commit 85feb2ce0539bc462719d6efcdf28184dff9f61a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
misc.c: Add query function IsPasteEmpty() to query a paste layer is empty
:100644 100644 02a883f... d63aef1... M src/misc.c
:100644 100644 b46cad4... cd7eb3d... M src/misc.h
commit 4f70768a4548612aad5a1a491889b32389f359c1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
Make the ON_SIDE() macro global, not local do draw.c
:100644 100644 47db1fd... f12020d... M src/draw.c
:100644 100644 19f80b8... 6dcd0d1... M src/macro.h
=========
Changes
=========
commit 2e29fd0c82c5ac586399446318f26efd33257645
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
draw.c: Add a DrawPaste() helper function for paste layers
diff --git a/src/draw.c b/src/draw.c
index f12020d..cb1b790 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -102,6 +102,7 @@ static void DrawEMark (ElementTypePtr, LocationType, LocationType, bool);
static void ClearPad (PadTypePtr, bool);
static void DrawHole (PinTypePtr);
static void DrawMask (int side, BoxType *);
+static void DrawPaste (int side, BoxType *);
static void DrawRats (BoxType *);
static void DrawSilk (int side, const BoxType *);
static int via_callback (const BoxType * b, void *cl);
@@ -334,6 +335,7 @@ DrawEverything (BoxTypePtr drawn_area)
int do_group[MAX_LAYER];
/* This is the reverse of the order in which we draw them. */
int drawn_groups[MAX_LAYER];
+ bool paste_empty;
PCB->Data->SILKLAYER.Color = PCB->ElementColor;
PCB->Data->BACKSILKLAYER.Color = PCB->InvisibleObjectsColor;
@@ -434,44 +436,13 @@ DrawEverything (BoxTypePtr drawn_area)
DrawRats(drawn_area);
}
- for (side = 0; side <= 1; side++)
- {
- int doit;
- bool 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;
+ paste_empty = IsPasteEmpty (COMPONENT_LAYER);
+ if (gui->set_layer ("toppaste", SL (PASTE, TOP), paste_empty))
+ DrawPaste (COMPONENT_LAYER, drawn_area);
- if (side == SOLDER_LAYER)
- doit = gui->set_layer ("bottompaste", SL (PASTE, BOTTOM), NoData);
- else
- doit = gui->set_layer ("toppaste", SL (PASTE, TOP), NoData);
- 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))
- if (!TEST_FLAG (NOPASTEFLAG, pad) && pad->Mask > 0)
- {
- if (pad->Mask < pad->Thickness)
- DrawPadLowLevel (Output.fgGC, pad, true, true);
- else
- DrawPadLowLevel (Output.fgGC, pad, false, false);
- }
- }
- ENDALL_LOOP;
- }
- }
+ paste_empty = IsPasteEmpty (SOLDER_LAYER);
+ if (gui->set_layer ("bottompaste", SL (PASTE, BOTTOM), paste_empty))
+ DrawPaste (SOLDER_LAYER, drawn_area);
doing_assy = true;
if (gui->set_layer ("topassembly", SL (ASSY, TOP), 0))
@@ -704,6 +675,26 @@ DrawMask (int side, BoxType * screen)
}
}
+/* ---------------------------------------------------------------------------
+ * draws solder paste layer for a given side of the board
+ */
+static void
+DrawPaste (int side, BoxType *drawn_area)
+{
+ gui->set_color (Output.fgGC, PCB->ElementColor);
+ ALLPAD_LOOP (PCB->Data);
+ {
+ if (ON_SIDE (pad, side) && !TEST_FLAG (NOPASTEFLAG, pad) && pad->Mask > 0)
+ {
+ if (pad->Mask < pad->Thickness)
+ DrawPadLowLevel (Output.fgGC, pad, true, true);
+ else
+ DrawPadLowLevel (Output.fgGC, pad, false, false);
+ }
+ }
+ ENDALL_LOOP;
+}
+
static void
DrawRats (BoxTypePtr drawn_area)
{
commit 85feb2ce0539bc462719d6efcdf28184dff9f61a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
misc.c: Add query function IsPasteEmpty() to query a paste layer is empty
diff --git a/src/misc.c b/src/misc.c
index 02a883f..d63aef1 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -600,6 +600,22 @@ IsLayerGroupEmpty (int num)
return true;
}
+bool
+IsPasteEmpty (int side)
+{
+ bool paste_empty = true;
+ ALLPAD_LOOP (PCB->Data);
+ {
+ if (ON_SIDE (pad, side) && !TEST_FLAG (NOPASTEFLAG, pad) && pad->Mask > 0)
+ {
+ paste_empty = false;
+ break;
+ }
+ }
+ ENDALL_LOOP;
+ return paste_empty;
+}
+
/* ---------------------------------------------------------------------------
* gets minimum and maximum coordinates
* returns NULL if layout is empty
diff --git a/src/misc.h b/src/misc.h
index b46cad4..cd7eb3d 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -47,6 +47,7 @@ bool IsDataEmpty (DataTypePtr);
bool IsLayerEmpty (LayerTypePtr);
bool IsLayerNumEmpty (int);
bool IsLayerGroupEmpty (int);
+bool IsPasteEmpty (int);
BoxTypePtr GetDataBoundingBox (DataTypePtr);
void CenterDisplay (LocationType, LocationType, bool);
void SetFontInfo (FontTypePtr);
commit 4f70768a4548612aad5a1a491889b32389f359c1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
Make the ON_SIDE() macro global, not local do draw.c
diff --git a/src/draw.c b/src/draw.c
index 47db1fd..f12020d 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -66,7 +66,6 @@ RCSID ("$Id$");
#define LARGE_TEXT_SIZE 3
#define N_TEXT_SIZES 4
-#define ON_SIDE(element, side) (TEST_FLAG (ONSOLDERFLAG, element) == (*side == SOLDER_LAYER))
/* ---------------------------------------------------------------------------
* some local identifiers
@@ -236,7 +235,7 @@ element_callback (const BoxType * b, void *cl)
ElementTypePtr element = (ElementTypePtr) b;
int *side = cl;
- if (ON_SIDE (element, side))
+ if (ON_SIDE (element, *side))
DrawElementPackage (element);
return 1;
}
@@ -251,7 +250,7 @@ name_callback (const BoxType * b, void *cl)
if (TEST_FLAG (HIDENAMEFLAG, element))
return 0;
- if (ON_SIDE (element, side))
+ if (ON_SIDE (element, *side))
DrawElementName (element);
return 0;
}
@@ -611,7 +610,7 @@ clearPad_callback (const BoxType * b, void *cl)
{
PadTypePtr pad = (PadTypePtr) b;
int *side = cl;
- if (ON_SIDE (pad, side) && pad->Mask)
+ if (ON_SIDE (pad, *side) && pad->Mask)
ClearPad (pad, true);
return 1;
}
diff --git a/src/macro.h b/src/macro.h
index 19f80b8..6dcd0d1 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -162,6 +162,13 @@ extern int mem_any_set (unsigned char *, int);
((TEST_FLAG(ONSOLDERFLAG, (o)) != 0) == SWAP_IDENT)
/* ---------------------------------------------------------------------------
+ * Determines if an object is on the given side. side is either SOLDER_LAYER
+ * or COMPONENT_LAYER.
+ */
+#define ON_SIDE(element, side) \
+ (TEST_FLAG (ONSOLDERFLAG, element) == (side == SOLDER_LAYER))
+
+/* ---------------------------------------------------------------------------
* some loop shortcuts
* all object loops run backwards to prevent from errors when deleting objects
*
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs