Changeset 5345
- Timestamp:
- 07/31/09 03:33:56 (4 years ago)
- Location:
- developers/werner/fped
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
developers/werner/fped/README
r5344 r5345 87 87 A circle is defined by its center and a point on the circle: 88 88 89 . arc <center> <point>89 .circ <center> <point> 90 90 91 91 This example draws a unit circle: 92 92 93 93 .vec @ 1mm, 0mm 94 . arc @ .94 .circ @ . 95 95 96 96 An arc is like a circle, but the part of the circle drawn is determined … … 99 99 from the center is ignored. 100 100 101 .arc <center> <radius>, <end> 102 103 Note the comma between the radius and the end angle. The arc is drawn 104 in a counter-clockwise direction. The following example draws an arc 105 of the unit circle in the x > 0, y > 0 quadrant: 101 .arc <center> <radius> <end> 102 103 The arc is drawn in a counter-clockwise direction. The following example 104 draws an arc of the unit circle in the x > 0, y > 0 quadrant: 106 105 107 106 from = .vec @ 1mm, 0mm 108 107 to = .vec @ 0mm, 1mm 109 .arc @ from ,to108 .arc @ from to 110 109 111 110 … … 226 225 x = 1, 3 227 226 .vec @ x*1mm, 0mm 228 . arc @ .227 .circ @ . 229 228 230 229 … … 251 250 { 3mm } 252 251 .vec @ x, 0mm 253 . arc @ .252 .circ @ . 254 253 255 254 Note that we can set the unit of the values directly in this case. -
developers/werner/fped/TODO
r5344 r5345 18 18 - syntax seems a little cryptic. too many dots and at signs. 19 19 - add measurements 20 - arc syntax is weird, with comma where we use spaces21 20 - Q: allow reassignment of vector names ? (no: would cause confusion in GUI) 22 21 - add KiCad output -
developers/werner/fped/fpd.l
r5335 r5345 38 38 ".rect" return TOK_RECT; 39 39 ".line" return TOK_LINE; 40 ".circ" return TOK_CIRC; 40 41 ".arc" return TOK_ARC; 41 42 -
developers/werner/fped/fpd.y
r5341 r5345 22 22 23 23 static struct frame *curr_frame; 24 static struct frame * *next_frame;24 static struct frame *last_frame = NULL; 25 25 static struct table **next_table; 26 26 static struct loop **next_loop; … … 123 123 124 124 125 %token TOK_FRAME TOK_TABLE TOK_VEC TOK_PAD TOK_RECT TOK_LINE TOK_ARC 125 %token TOK_FRAME TOK_TABLE TOK_VEC 126 %token TOK_PAD TOK_RECT TOK_LINE TOK_CIRC TOK_ARC 126 127 127 128 %token <num> NUMBER … … 142 143 all: 143 144 { 144 frames = zalloc_type(struct frame); 145 next_frame = &frames->next; 146 set_frame(frames); 145 root_frame = zalloc_type(struct frame); 146 set_frame(root_frame); 147 147 } 148 148 frame_defs frame_items 149 { 150 root_frame->prev = last_frame; 151 if (last_frame) 152 last_frame->next = root_frame; 153 else 154 frames = root_frame; 155 } 149 156 ; 150 157 … … 158 165 if (find_frame($2)) 159 166 yyerrorf("duplicate frame \"%s\"", $2); 160 *next_frame = zalloc_type(struct frame); 161 (*next_frame)->name = $2; 162 set_frame(*next_frame); 163 next_frame = &(*next_frame)->next; 167 curr_frame = zalloc_type(struct frame); 168 curr_frame->name = $2; 169 set_frame(curr_frame); 170 curr_frame->prev = last_frame; 171 if (last_frame) 172 last_frame->next = curr_frame; 173 else 174 frames = curr_frame; 175 last_frame = curr_frame; 164 176 165 177 } 166 178 frame_items '}' 167 179 { 168 set_frame( frames);180 set_frame(root_frame); 169 181 } 170 182 ; … … 302 314 { 303 315 $$ = alloc_type(struct vec); 316 $$->name = NULL; 304 317 $$->base = $2; 305 318 if ($2) … … 354 367 $$->u.line.other = $3; 355 368 } 356 | TOK_ ARC base base opt_base369 | TOK_CIRC base base 357 370 { 358 371 $$ = new_obj(ot_arc); 359 372 $$->base = $2; 360 373 $$->u.arc.start = $3; 361 $$->u.arc.end = $4 ? $4 : $3; 374 $$->u.arc.end = $3; 375 } 376 | TOK_ARC base base base 377 { 378 $$ = new_obj(ot_arc); 379 $$->base = $2; 380 $$->u.arc.start = $3; 381 $$->u.arc.end = $4; 362 382 } 363 383 | TOK_FRAME ID base -
developers/werner/fped/gui.c
r5343 r5345 221 221 GtkWidget *label; 222 222 223 for (f = frames; f; f = f->next) {223 for (f = root_frame; f; f = f->prev) { 224 224 label = label_in_box_new(f->name ? f->name : "(root)"); 225 225 gtk_box_pack_start(GTK_BOX(vbox), box_of_label(label), … … 322 322 323 323 make_screen(root); 324 build_vars(vars_box, frames);324 build_vars(vars_box, root_frame); 325 325 326 326 gtk_widget_show_all(root); … … 328 328 gui_setup_style(root->window); 329 329 init_canvas(); 330 select_frame( frames);330 select_frame(root_frame); 331 331 332 332 gtk_main(); -
developers/werner/fped/gui_style.c
r5342 r5345 52 52 gc_bg = gc("#000000", 0); 53 53 /* inactive in+path active act+path selected */ 54 style(gc_vec, "#202000", "#404020", "# 808040", "#c0c080", "#ffff80");54 style(gc_vec, "#202000", "#404020", "#909040", "#c0c080", "#ffff80"); 55 55 style(gc_obj, "#006060", INVALID, "#00ffff", INVALID, "#ffff80"); 56 56 style(gc_pad, "#400000", INVALID, "#ff0000", INVALID, "#ffff80"); -
developers/werner/fped/obj.c
r5343 r5345 26 26 27 27 struct frame *frames = NULL; 28 struct frame *root_frame = NULL; 28 29 struct frame *active_frame = NULL; 29 30 … … 278 279 279 280 inst_start(); 280 ok = generate_frame( frames, zero, NULL, 1);281 ok = generate_frame(root_frame, zero, NULL, 1); 281 282 if (ok) 282 283 inst_commit(); -
developers/werner/fped/obj.h
r5343 r5345 80 80 struct obj *objs; 81 81 struct frame *next; 82 struct frame *prev; /* for the list of frames in the GUI */ 82 83 83 84 /* used during generation */ … … 124 125 125 126 126 struct frame *frames; 127 struct frame *active_frame; 127 extern struct frame *frames; 128 extern struct frame *root_frame; 129 extern struct frame *active_frame; 128 130 129 131 -
developers/werner/fped/qfn.fpd
r5341 r5345 52 52 r = .vec c 0mm, 0.5mm 53 53 e = .vec c -0.5mm, 0mm 54 .arc c r ,e54 .arc c r e 55 55 56 56 r2 = .vec c 0mm, 0.8mm 57 . arc c r257 .circ c r2 58 58 59 59 /*
Note: See TracChangeset
for help on using the changeset viewer.
