1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-06 03:29:22 +02:00
Commit Graph

39 Commits

Author SHA1 Message Date
werner
c9af8cd0fe The mechanism for selecting points for measurements reaches its limits when
using frames to encapsulate building blocks, e.g., like macros or functions in
a programming language. Since measurements only know about the frame containing
a vector but not the frames containing that frame, invocations of this frame
from different places can only be distinguished within the min/next/max scheme.
(See the example in README.)

To eliminate this limitation, one needs a way to tell fped to consider a point
only if it has been instantiated through a certain path, e.g., by requiring
some other frames to be visited in its instantiation. This increases the number
of distinct points available for measurements.

The mechanism chosen is to qualify a measurement point with frames that lead to
it. This list of outer frames does not have to include all frames. Without
qualifying, the old behaviour results.

Note that this doesn't cover all possible ways in which a point can appear in
different roles. Multiple frame references can also result from repeating the
same frame reference in the same parent frame. The current qualification
mechanism does not allow such paths to be distinguished. However, one can 
always introduce intermediate frames for this purpose.

Furthermore, repetitions create multiple instances of a point, although in what
should be considered the same role.

- fpd.l: make scanner support free-format a little better by switching back to
  keyword mode after frame braces. This way, one can write a simple frame in a
  single line, which is useful for regression tests.
- fpd.l, fpd.y, README, test/dbg_meas: added %meas directive to print the 
  result of a measurement
- fpd.y, README: measurements can now be labeled. Note that, due to limitations
  of the grammar, the first measurement cannot be labeled.
- error.h, error.c (yywarn): new function for non-fatal diagnostics that always
  get reported to standard error
- bitset.h, bitset.c: functions to manipulate variable-size bit sets
- meas.h, fpd.y, README, test/meas_qual: added the means to specify qualifiers
  for points used in measurements
- dump.c (print_meas_base, print_meas): dump qualifiers
- delete.c (delete_references, test/del_frame): delete measurements that
  reference a frame being deleted in their qualifiers
- obj.h, obj.c (enumerate_frames, instantiate): enumerate all frames so that we
  have an index into the bit vector of visited frames
- meas.h, meas.c (reset_samples, meas_post), obj.c (generate_vecs,
  generate_frame, instantiate): record the set of frames visited for each
  sample
- meas.c (meas_post): only treat two instances of a point as equivalent if the
  set of frames visited of one of them is a superset of set of the other. In
  this case, keep the union of the two sets.
- meas.h, meas.c (meas_find_min, meas_find_next, meas_find_max),
  test/meas_qual: instantiate_meas_pkg only select points for which all frames
  in the qualification have been visited
- gui_meas.c (is_min, is_next, is_max, is_a_next): updated for above change
- inst.h, inst.c (curr_frame, propagate_bbox, add_inst, inst_begin_frame,
  inst_end_frame, inst_start): renamed curr_frame to frame_instantiating to
  avoid clash with curr_frame in fpd.y
- inst.h, inst.c (find_meas_hint): make global
- test/structure, test/del_vec, test/del_frame: fped now warns if a measurement
  is in an unlinked frame. Changed regressions tests to avoid this warning.
- test/Common: new function expect_grep to compare only part of the output



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5967 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-05-29 21:13:48 +00:00
werner
ac535d6e03 Deleting things often left measurements behind. Fixed these bugs, enhanced %del
to also delete frames and items in other frames than the current one, and added
the corresponding regression tests.

- fpd.y, README: %del can now also delete frames
- test/del_frame: regression test for frame deletion
- fpd.y: moved all debug items into debug_item, so that they can be invoked
  after defining measurements
- README: clarified that object labels aren't entirely hidden in the GUI
- delete.c (delete_references): also delete measurements referencing the frame
  (test/del_frame)
- fpd.y (dbg_link_frame): described why we need base_frame in addition to 
  base_vec
- fpd.y, README: %del can now also reach into frames other than the current one
- delete.c (do_delete_vec): also delete references in the root frame, i.e.,
  measurements (tests/del_vec)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5947 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-27 22:36:46 +00:00
werner
82a12023cd I thought there was a bug in frame ordering, but it turns out that it works
fine. Anyway, here's a new debug construct (%frame) and a bunch of new 
regression tests.

- fpd.y, fpd.l, README: added new directive %frame to link frames also to other
  frames than the current one (like in the GUI)
- gui_tool.h, gui_tool.c: export is_parent_of
- test/frame_ref: regression tests to ensure that frame order remains valid,
  even if we reference late from early frames



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5945 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-27 01:02:24 +00:00
werner
39fef16d1c Got rid of the requirement to have a "package" directive. Fixed a grammar error
found in the process. Also taught the regression test system a new trick: the
path to "fped" can be passed in the environment variable FPED. E.g.,
FPED=fped.r5943 make test

- fped.c (usage, main): duplicating the -T option produces a dump to stdout
  before exiting (like %dump would)
- test/Common: new command fped_dump to invoked fped with a second -T option
- test/Common: if the environment variable FPED is set, use its content to
  invoke fped (default is ../fped)
- test/Common: if the environment variable CWD_PREFIX is set, prepend it to
  $FPED if the latter is a relative path 
- Makefile (test, tests): set CWD_PREFIX to .., so that the path given in FPED
  is valid at the point of invocation
- fpd.y: revised grammar to make "package" optional
- fpd.y: measurements were syntactically allowed inside non-root frame
  (test/structure)
- test/structure: test various combinations of the grammatical file structure
- test/tsort: removed all the now unnecessary "package" directives



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5944 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-26 23:11:22 +00:00
werner
bc27b094af With a little help from m8cutils and abyss, we now have regression tests for
the topological sort. "make test" or "make tests" invokes the regression tests,
"make valgrind" runs them under valgrind's watchful eyes.

- fped.c (usage, main): added option -T to force batch mode (for regression
  testing)
- Makefile, test/Common: added regression test infrastructure
- test/tsort: test cases for the topological sort
- README: added pointer to test/tsort



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5943 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-26 21:30:21 +00:00
werner
190bcaf982 Added a topological sort algorithm, for use when dumping.
- tsort.h, tsort.c, Makefile: stable topological sort with priorities
- fpd.l, fpd.y: added directive %tsort to test-drive the sort algorithm
- README: documented %tsort



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5942 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-26 15:18:01 +00:00
werner
6db067a90f More work on holes: added documentation and Postscript output.
- overlap.c (inside, test_overlap): check for instance type 
- overlap.c (inside, test_overlap): support hole instances
- README: put a pointer to the GUI description at the beginning
- README, gui.html: documented role and creation of holes
- inst.h: holes can now link to pads and vice versa
- hole.c, obj.c (instantiate): connect holes with pads and apply consistency 
  checks
- postscript.c: added output for holes
- icons/hole.fig: make hatched surroundings of hole look more round



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5940 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-25 13:09:36 +00:00
werner
6374b3a61a Added debugging directives to the fped language. They're describe at the end
of README.

- fpd.l, fpd.y, README: added debugging directives %del, %move, %print, %dump,
  and %exit
- obj.h, fpd.y (find_obj, find_label, new_obj): objects can now be labeled
- obj.c (obj_anchors), inst.c (inst_anchors): gathering the list of anchors is 
  now a per-object function, not an instance "method". inst_anchors implements 
  the vector vs. object switch.
- inst.h, inst.c: removed all *_op_anchors functions
- expr.c (str_unit): in the past, we returned a malloc'ed string, but these 
  times are long gone. Thus, don't stralloc("").



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5919 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-19 14:39:57 +00:00
werner
feabeb73f4 The build process used dependencies only if they were explicitly generated.
This often caused accidental builds without proper dependencies.

- Makefile: include .depend also if it doesn't exist yet. This way, GNU make
  will build it and all is fine.
- Makefile: use "-include" instead of "include" to avoid unnecessary nagging
- Makefile: make .depend depend on *.h and *.c, so that we catch all changes
  that _might_ affect the dependencies (this is a little inefficient but better
  safe than sorry)
- README: "make dep" is no longer needed
- TODO: added thoughts for more improvements



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5774 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-02 23:58:03 +00:00
werner
887643e65a Indicated more prominently that fped is licensed under the GPLv2 and
included the license text. (Thanks to nickoe for pointing this out.)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5762 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-27 22:07:16 +00:00
werner
30f444daee Added package name (transfig) of fig2dev
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5761 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-27 20:55:41 +00:00
werner
3d6c9b2a1f Added Netpbm to prerequisites.
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5759 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-16 17:26:31 +00:00
werner
c6312cd313 A bit of cleanup, as suggested by Chitlesh Goorah.
- moved all examples to examples/
- README: updated and corrected example invocation



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5748 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-02 15:36:00 +00:00
werner
6f2dc7fb0b Added functions sin(), cos(), and sqrt().
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5732 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-01 12:43:59 +00:00
werner
c172870dfd - README: added link to the GUI manual
- added a conceptual explanation of instantiation (with picture)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5636 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-13 13:16:39 +00:00
werner
76c3c1c1d0 - added solder mask pad type (patch by Rene Harder)
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5627 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-11 18:34:51 +00:00
werner
8d94993c45 - added pad type (for non-solder and solder-paste-only pads) to FPD language
(GUI is still missing)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5554 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-27 09:45:57 +00:00
werner
5a2eb77629 Made life in mil-land a little less painful.
- .fpd file format: new directive "unit" to set the default unit
- new selection was too aggressive - make it only rearrange settings if we also
  fail the second vector search
- gui_draw_pad_text: calculation of height vs. width lost too much precision,
  causing pad text to be rotated arbitrarily
- drag_new_vec: display distance in mil if unit is mil
- end_new_raw_vec: store distance in mil if unit is mil
- gridify: use a 10 mil grid if unit is mil
- ps_hline: corrected gsave/grestore mismatch
- Makefile: made "all" a prerequisite of "install"
- Postscript output now mentions the default unit (if set)
- ps_package: height and width were swapped, oopsie !



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5525 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-22 15:58:58 +00:00
werner
9e48901814 - postscript.c: added DSC comments
- postscript.c: generate a page for each package
- gui_style.h: changed monospaced font to Liberation Mono, to alleviate "l" vs.
  "1" problem



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5519 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-22 08:58:26 +00:00
werner
4db1ade3bd - Makefile: now requires /bin/bash (for PIPESTATUS)
- Makefile: use PIPESTATUS to catch errors in the icon conversion pipe
- Makefile: whitespace and comment cleanup
- gui_style.c: removed no longer needed definition of INVALID



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5487 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-19 14:38:59 +00:00
werner
de044ca61f We can now generate part families.
- README: added build prerequisites
- "part name" is now more correctly called "package name"
- changed keyword "part" to "package"
- removed inst_debug and struct inst_ops.debug functions - never really used 
  them anyway
- we can now generate multiple packages from a single file



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5478 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-17 20:42:51 +00:00
werner
d39ae30f6e - added rounded pads
- initialize item_widget to NULL if not showing items or bad things happen



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5440 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-14 10:18:40 +00:00
werner
2d8b36d65c - named vectors in sc89.fpd
- README: described use of "loop" as "if" and change fbga.fpd to use this



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5428 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-12 17:56:55 +00:00
werner
2bae5614d9 - when selecting an object via the item list, make its frame active
- having variables and items on the screen at the same time was too much. We 
  can now toggle with "/" while the canvas has the focus. (This needs better 
  controls.)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5425 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-12 14:44:17 +00:00
werner
4a0fd61016 More work on measurements. Getting there ...
- removed support for old-style measurements
- new-style measurements are now embedded in "struct obj", so we can dump and 
  delete them
- "measxy" is now called "meas"
- updated examples to use new-style measurements



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5412 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-09 00:06:54 +00:00
werner
751e845250 New-style measurements are coming to the GUI soon !
- moved measurement operations from gui_tools.c to new file gui_meas.c
- added support for creating new-style measurements through the GUI
- the offset is optional in new-style expressions



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5407 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-08 18:50:17 +00:00
werner
5c3921db16 This introduction was missing in the previous commit:
For the new measurements, we need more flexible canvas markup options. This
  includes the thicker circle for hovering.

  To generalize hovering, we can't rely on redrawing alone but need to use a
  pixmap to store the background as well. This creates a complex interaction
  with dragging, which the existing code cannot handle cleanly. 
  Therefore, ...

This commit changes:

- README: documented use of label in new-style measurements



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5406 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-08 14:17:23 +00:00
werner
1a18292883 - added icons for new-style measurements (on-going)
- increased default window size for make room for new icons
- switch the canvas to dark blue when instantiation fails
- modularized point lookup logic of instantiate_meas
- added highlight mode (on-going)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5404 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-07 21:47:51 +00:00
werner
bb7355d84b - gui_tools.c:new_vec didn't initialize vec->samples, causing fped to crash
- we didn't dehover before deleting, which could cause a crash
- added delete tool to canvas. Thus ...
- we no longer need the Delete key on the canvas, so we can ...
- always focus the (first) entry field, and ...
- removed "focus" parameter to edit functions



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5403 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-07 19:42:57 +00:00
werner
d046f9306c - fpd.y: fixed check for empty part name
- added new-style measurements (experimental)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5400 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-07 13:37:51 +00:00
werner
995aa4ca04 - added menu item "Save" to dump the footprint to stdout
- added temporary solution for having a part name
- added part name to FPD example files
- reduced area in which the frame delete button responds



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5393 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-06 06:54:41 +00:00
werner
68b4fec921 - undelete after recursive delete now brings back everything deleted in that
operation, not just one object at a time
- vector reference counting is not needed now that we have recursive delete.
  Removed it.
- completed recursive delete of vectors
- gridify: give new vectors a minimum length, so that we don't get a weird
  display when starting a new footprint.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5391 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-06 04:33:49 +00:00
werner
08b788b929 - revamped delete logic: delete now always works. If there are references, we
remove them as well. (In progress.)
- added frame deletion
- gui_status.c:add_label added vertical padding to keep the input area from
  bouncing (by Alvaro Lopes)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5390 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-05 18:43:00 +00:00
werner
3db91b5c1b Added delete/undelete.
- when moving a point, we no longer restrict the area around the original
  position once the drag radius has been left
- objects can now be deleted by selecting them and pressing Delete
- deleted objects can be restored by pressing "u"



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5387 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-05 00:32:38 +00:00
werner
5d7ab083a3 - README: described use of semicolons
- README: added that loops can also execute zero times
- accept labels only at the beginning of a line
- rectangles and lines no longer use the bounding box for drawing (caused
  offset problems since we now correct for the line width)
- dist_rect and inside_rect no longer require their input pre-sorted
- pad instances now have their own structure and no longer abuse the bounding
  box to know the pad coordinates
- Makefile: use $(GEN) for fig2dev, to reduce chattiness
- when dragging a point, the symbol is now adjusted accordingly
- added moving of rects, pads, circles, and arcs
- added creation of pads 
- moved rotate_r from gui_inst.c to coord.c
- new function "theta" that combines most of the angle calculations
- save_pix_buf: y < 0 clipping changed width, not height



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5386 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-04 21:45:33 +00:00
werner
5add8b5229 GUI can create silk screen objects.
- made xpm name manipulation compatible with older versions of ImageMagick
  (reported by Alvaro Lopes)
- corrected all lines beginning with five or more spaces
- Makefile
- README: fixed loop example (reported by Joerg Reisenweber)
- moved draw_arc and draw_circle from gui_inst.c to gui_util.c
- added dragging and hovering
- added creation of lines, rectangles, and arcs via GUI
- removed arc tool (use circle instead)
- fixed reference counting in vectors



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5384 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-04 12:06:04 +00:00
werner
3c026696d4 - don't crash when editing a NULL expression (e.g., default width)
- bounding boxes of silk objects now include the width
- # zooms and centers to currently active frame instance



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5378 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-03 21:52:21 +00:00
werner
e1e758b54f - keyboard functions for the canvas: - zoom out, + or = zoom in, . center,
* zoom and center to extents
- variables in tables weren't properly initialized, causing stray recursive
  evaluation errors
- replaced table->active index with table->active_row pointer
- added row selection
- for fun, added tab.fpd row selection example 



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5375 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-03 17:58:32 +00:00
werner
e455b37abb Moved fped over to /trunk/eda
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5374 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-03 16:12:47 +00:00