From 230de72552ddde840ace796be9193cb2ea1a7bf5 Mon Sep 17 00:00:00 2001 From: werner Date: Sat, 15 Aug 2009 23:25:05 +0000 Subject: [PATCH] - Makefile: fixed odd indentation of "clean" target - Makfile: added "install" and "uninstall" targets - when deleting the currently active frame reference, reset active_ref of the frame, so that it can be set to a new value later - during instantiation, circles were classified as arcs - end point of KiCad circle didn't mirror the Y axis git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5457 99fdad57-331a-0410-800a-d7fa5415bdb3 --- Makefile | 14 ++++++++++++-- delete.c | 2 ++ inst.c | 7 ++++--- kicad.c | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index cc0651b..bbff33c 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,8 @@ # (at your option) any later version. # +PREFIX = /usr/local + OBJS = fped.o expr.o coord.o obj.o delete.o inst.o util.o error.o \ unparse.o file.o dump.o kicad.o postscript.o meas.o \ cpp.o lex.yy.o y.tab.o \ @@ -67,7 +69,7 @@ endif # ----- Rules ----------------------------------------------------------------- -.PHONY: all dep depend clean +.PHONY: all dep depend clean install uninstall .SUFFIXES: .fig .xpm @@ -111,6 +113,14 @@ endif # ----- Cleanup --------------------------------------------------------------- - clean: +clean: rm -f $(OBJS) $(XPMS:%=icons/%) rm -f lex.yy.c y.tab.c y.tab.h y.output .depend + +# ----- Install / uninstall --------------------------------------------------- + +install: + install -m 755 fped $(PREFIX)/bin/ + +uninstall: + rm -f $(PREFIX)/bin/fped diff --git a/delete.c b/delete.c index 810853e..8f0c052 100644 --- a/delete.c +++ b/delete.c @@ -229,6 +229,8 @@ static void do_delete_obj(struct obj *obj) del = new_deletion(dt_obj); del->u.obj.ref = obj; del->u.obj.prev = prev; + if (obj->type == ot_frame && obj->u.frame.ref->active_ref == obj) + obj->u.frame.ref->active_ref = NULL; } diff --git a/inst.c b/inst.c index 9e22f52..d08fb8b 100644 --- a/inst.c +++ b/inst.c @@ -804,12 +804,13 @@ int inst_arc(struct obj *obj, struct coord center, struct coord start, struct inst *inst; double r, a1, a2; - inst = add_inst(&arc_ops, ip_arc, center); + a1 = theta(center, start); + a2 = theta(center, end); + inst = add_inst(&arc_ops, + fmod(a1, 360) == fmod(a2, 360) ? ip_circ : ip_arc, center); inst->obj = obj; r = hypot(start.x-center.x, start.y-center.y); inst->u.arc.r = r; - a1 = theta(center, start); - a2 = theta(center, end); inst->u.arc.a1 = a1; inst->u.arc.a2 = a2; inst->u.arc.width = width; diff --git a/kicad.c b/kicad.c index 6fead13..cae53c1 100644 --- a/kicad.c +++ b/kicad.c @@ -145,7 +145,7 @@ static void kicad_circ(FILE *file, const struct inst *inst) units_to_kicad(inst->base.x), -units_to_kicad(inst->base.y), units_to_kicad(inst->base.x), - units_to_kicad(inst->base.y+inst->u.arc.r), + -units_to_kicad(inst->base.y+inst->u.arc.r), units_to_kicad(inst->u.arc.width), layer_silk_top); }