1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-06-30 21:52:56 +03:00
Commit Graph

85 Commits

Author SHA1 Message Date
werner
d9b7ad94ec - when displaying loop iterations, we now use the active count, not just the
last count
- loop iterations now show the actual value, not the zero-based iteration 
  number
- gui.html: added a GUI manual (in progress)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5531 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-22 22:55:39 +00:00
werner
63e60182bb - new visualization option: show all frames or show only current frame
- new visualization option: highlight pads and silk ("final" view)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5527 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-22 19:00:55 +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
18be341c2d Bug-fixing ...
- obj.c: embarrasingly, the default offset wasn't a distance
- connect_obj: didn't update the object's frame pointer, deeply confusing
  deletion



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5524 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-22 14:29:48 +00:00
werner
60147b98e2 - inst.c: we can drag points at a frame base again
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5523 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-22 13:18:15 +00:00
werner
a44530f621 Selection now tries to help us not to get lost.
- postscript.c: started adding generation of object-level frames (on-going)
- gui_canvas.c: moved call to inst_deselect into inst_select, so that 
  inst_select can keep track of the previous selection (if any)
- inst_select: if clicking on the location of the previous selection, try to 
  select the next matching item
- inst_select: if we can't find an active item, try to see if we can get
  something by changing active references or - if all else fails - by 
  activating a different frame
- end_new_frame: reset the tool after placing the frame



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5522 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-22 12:27:47 +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
9f814ab010 Improving Postscript output (on-going)
- postscript.c: added page layout parameters and header
- postscript.c: increase initial size for maxfont from 100 to 1000, so that we 
  don't end up with zero-sized fonts for zoom = 1
- postscript.c: desired size of measurement text is no longer affected by zoom
- postscript.c: roughly doubled size of measurement text
- postscript.c: adjust zoom to package dimension and try to draw 2x and 1x 
  package next to enlarged package



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5517 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-21 23:28:38 +00:00
werner
347ef8aad5 When deleting frame "foo" in root->foo->bar and then linking bar from root,
bar didn't automatically become active, which was rather confusing. We now
also try harder to keep a frame active. 

- when deleting a frame, also reset all outbound active references
- when removing the active frame reference, search for a suitable replacement
  instead of just setting it to NULL
- gui_style.c: made inactive frames a little more visible



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5516 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-21 19:50:45 +00:00
werner
a6f73ae297 - calculation of a rounded pad's diagonal is now more sensible. We use the
length of the part of the diagonal that's on the pad. In the case of a 
  circle (BGA), this is just the diameter.
- changed label for diagonals from "r" to "d"



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5515 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-21 19:19:33 +00:00
werner
94f4534494 - measurement offsets can now use variables. We evaluate the offset during
instantiation and create a partially formed instance. During measurement
  instantiation, we complete that instance.
- leak.supp: finally figured out how to write a valgrind suppression file
- fped.c: we don't need the FPED_NO_GUI kludge anymore
- fped.c: moved gui_cleanup_style to gui_main
- dereference icons (seems that this doesn't deallocate everything, though)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5514 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-21 18:20:37 +00:00
werner
9e7e804d1a - delete.c: added more destructor functions
- deallocate all our data structures on exit (to help find memory leaks, bad
  pointers, and general logic errors)
- fixed memory leak when allocating pad names in instantiation
- added "magic" environment variable FPED_NO_GUI to run fped without 
  initializing Gtk+
- added valgrind wrapper "leakcheck"
- delete.c: destroy() now requires a deletion to exist
- vacate_op: free string expressions
- destroy_obj: free measurement labels
- delete_references: use do_delete_obj so the we don't bump the group number
- delete_frame: delete references after deleting the frame itself, so they end
  up on the stack above the frame and get destroyed first
- do_delete_vec: like above, even though it doesn't matter here



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5506 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-21 08:34:17 +00:00
werner
2737f8a3fa - postscript.c: always run flattenpath before pathbbox
- postscript.c: fixed algorithm in "center"
- dump.c: reorder frames if we would end up with forward-references
- sc89.fpd, fbga.fpd: changed "part" to new "package"



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5490 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-19 22:13:47 +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
0e0e4ea32d - fixed precedence of unary minus, so that -(a+b) isn't printed as -a+b
- removed in_path logic (never missed not having it) and made selected vectors
  a little brighter



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5484 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-18 23:49:54 +00:00
werner
4920bb96fa - replaced awkward FOR_GLOBAL_INSTS / FOR_PKG_INSTS sequence with single
FOR_ALL_INSTS
- several functions only walked the active package instances, so we couldn't 
  access the origin of the root frame



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5482 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-18 22:03:51 +00:00
werner
f368014b3c - stupid typo made us crash when setting the package name
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5481 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-18 20:57:09 +00:00
werner
37b52f23fe Finally found a nice way to draw arcs in the GUI.
- we freed a package's samples list after recalculating the number of samples,
  which caused a crash after adding a new vector. We now record the original 
  list length in the package structure.
- when dragging a circle, offer the end point first, so that it becomes an arc



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5480 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-18 20:52:09 +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
9e1631df30 - ctime(3) already provides a newline, so don't add an extra one to the .mod
file, possibly confusing KiCad



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5463 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-16 12:24:03 +00:00
werner
be86e276b8 - adjust measurement bbox for projection (still not perfect, but better)
- we can now scroll-wheel through table rows
- added menu branch "View" with zoom and var/code display controls
- commented out is_min_of_next until its fate is decided, so that we don't get 
  a warning



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5462 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-16 12:04:01 +00:00
werner
5a86125002 Added Postscript outout for measurements, plus assorted changes.
- postscript.c: added patterns backhatchpath and crosspath (for pad overlaid 
  with solder paste)
- postscript.c: added measurements
- postscript.c: prefixed style parameters with PS_ to avoid future conflicts
  with gui_style.h
- when changing the default unit, we now cancel the selection, and refresh 
  canvas and current position
- on-screen measurements now suppress the unit if set to anything but "auto"
- use  __attribute__((format(printf, ...))) for printf-like functions
- the unit selector now has a white background to make it clearer that it can 
  be clicked



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5461 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-16 11:21:48 +00:00
werner
e3794589a8 - when editing a value list, we need to return the values and free them in case
of successful validation
- free previous expression in set_col_values
- added rapid entry also for table values (fill the row)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5460 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-16 05:05:12 +00:00
werner
64f80e84a2 Columns and loops can now be entered in one step as var = val, val, ...
- moved definition of expr_result from expr.c to fpd.y
- new header file fpd.h with all the things fpd.l and fpd.y export
- edit_var already calls edit_nothing, so there's no need to call it before
- added rapid entry option for loops, variables, and columns: var = val, ...



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5459 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-16 04:12:37 +00:00
werner
233fc4b683 - added KiCad export of arcs
- added pad names to Postscript export



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5458 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-16 01:51:21 +00:00
werner
230de72552 - 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
2009-08-15 23:25:05 +00:00
werner
b79c252d17 - dump.c didn't complete vector names used in measurements, causing them to be
lost and producing an invalid fpd file



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5455 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-15 22:06:51 +00:00
werner
ef58598695 - added -std=gnu99 so that we can use "round" and M_PI
- added unit status and selection (in lower right corner)
- added automatic unit selection
- pointer coordinates are now shown with their unit
- updated display of X, Y, width, offset, and radius for unit selection



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5454 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-15 20:52:08 +00:00
werner
6f00ab6ac2 - KiCad is very liberal when it comes to valid part names, and so are we now
(i.e., we now accept anything but control and non-ASCII characters)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5446 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-14 22:12:16 +00:00
werner
7af014b516 - when selecting an item in the canvas, we now check that the underlying object
is still connected. This prevents surprises when making extensive changes
  during instantiation failure.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5445 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-14 15:53:21 +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
dbcfae8261 - objects selected via the item view can now be edited directly, even if no
instance is found. This allows recovery from mistakes where a failing item
  never gets instantiated.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5434 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-13 10:57:39 +00:00
werner
8e54c1f7c3 - added the usual COLOR_ prefix also to TOOL_SELECTED/TOOL_UNSELECTED
- instantiate_meas if a mesurements has no samples, do the next one, don't stop
  completely
- when instantiation fails, the corresponding vector, object, or loop is now
  marked red in the variables/items list.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5432 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-13 09:30:16 +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
9f2ea8cdc2 - reduced padding around item lines
- item ordering heuristics failed to properly use "."
- updated description of "need" in dump.c
- saved fbga.fpd and sc89.fpd with new ordering



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5427 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-12 17:01:40 +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
a648cb888f - changed item list font to Courier, which looks a lot tidier
- active items can now be selected from the item list (selecting inactive items
  will be a little harder)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5424 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-12 11:26:59 +00:00
werner
e65d90947c - put hbox around frame table so that it doesn't grow when we give it more
space than it needs
- dump.c: separated ordering function from actual printing
- added list of vectors and object (on the right side of the variables)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5423 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-12 10:45:52 +00:00
werner
9c3cf7e51c - fbga.fpd: do this nicely and use a variable for the pitch
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5422 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-11 23:30:58 +00:00
werner
386a9fd50b - added support for string constants to unparse()
- implemented eval_str
- expand() now tries to obtain a string
- added example fbga.fpd to demonstrate use of strings
- when invoked with an inexisting file, fped now starts with an empty model,
  instead of getting confused 
- we now religiously call edit_nothing before adding fields to edit, so that
  we won't create a loop through edit-next



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5421 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-11 23:26:38 +00:00
werner
3064b2abbb - measurements entered through the GUI were connected to the active frame, not
the root frame



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5420 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-11 21:54:18 +00:00
werner
fe5f824b9e Make delete feel "safer".
- objects are now deleted by selecting them, then clicking on the delete icon
- removed tool_ops.click, which was only there because of delete



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5419 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-11 20:52:33 +00:00
werner
57e76aeb9e - vector labels are already in a per-frame namespace, so we don't need to add
the frame name when auto-generating them
- moved file I/O from gui.c to file.c
- ps_line used the wrong endpoint coordinate
- option -k makes fped write KiCad non-interactively
- option -p makes fped write Postscript non-interactively



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5418 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-11 20:17:39 +00:00
werner
1dfb8da99a - change file save logic to write to a temporary file first, so that we don't
leave an empty/corrupt main file if we crash during saving
- started adding Postscript output
- renamed "Save as KiCad" to "Write KiCad"
- switched from "manual" menu bar creation to GtkItemFactory



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5417 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-11 01:20:15 +00:00
werner
6f307d6ae7 - added KiCad output
- when saving a file, we now make a backup of any existing file with the same
  name



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5416 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-10 21:02:26 +00:00
werner
a0f8375c97 - trying to place a frame reference upset the overlay state and caused an abort
- dump any undumped non-measurements before the measurements
- finished sc89.fpd, with the full set of measurements



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5415 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-10 15:13:07 +00:00
werner
9c68c0de34 - File>Save now saves to a file if a second name is given on the command line,
to stdout if not
- there's no reason anymore to disallow editing the offset in new-style
  measurements
- struct inst_ops is no longer opaque, so we can avoid adding even more silly
  little access functions and open-code straightforward callbacks
- (re)stuctured hover/click/drag logic in gui_tool.c
- added optional debugging output to gui_canvas.c
- don't let a vector's base be dragged onto the vector's own end or onto one
  of its children
- measurements can now be properly changed by dragging



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5414 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-10 13:51:51 +00:00
werner
75d9780131 - band-aid: make canvas grab focus on click and scroll, so that it's easy to
get it back when we lose it
- improved heuristics for measx/measy: instead of looking for "next" or "max"
  on secondary coordinate, pick the one that's closest. I.e., if there's a
  chance to just connect with x' = 0 or y' = 0, do it.
- mouse wheel on loop value now selects next/previous value
- corrected proximity calculation for measurements
- vec/frame/meas toggle now deselects, so that we don't accidently leave a
  supposedly hidden item selected



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5413 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-09 01:51:20 +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
851c82af6f - simplified tool_button and moved it from gui_tool.c to into gui_util.c
- moved make_image from gui_tool.c to into gui_util.c as well
- generalized set_frame_image and moved it to gui_util.c as set_image
- tool_button_press_event didn't check which button was pressed
- added buttons to switch visibility of frames, vectors, and measurements
- when creating a measurement through the GUI, don't invert if both points are
  minima (otherwise, one could never get the text point the other way)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5411 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-08 21:59:33 +00:00