1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-09-30 15:22:00 +03:00
Commit Graph

51 Commits

Author SHA1 Message Date
Erich Heinzle
7081258910 diff for gEDA PCB export in fped
I have

1) sorted out the tabbing

2) simplified > 1 element export by exporting elements in a layout (.pcb)

3) documented incompatibilities in the README

4) done it as a diff against origin master

let me know if you need anything else done

Cheers.

Erich

From dae69d9a63071a15c213c72e70b86fe963a67dd4 Mon Sep 17 00:00:00 2001
From: erich_heinzle <a1039181@gmail.com>
Date: Sun, 22 Jan 2017 23:48:57 +1030
Subject: [PATCH] support for export to gEDA format of single and multiple
 footprints in a .pcb layout
2017-01-22 13:15:26 -03:00
Werner Almesberger
f3299aaf29 gui.c: add "Allow" menu to GUI 2016-03-21 21:37:07 -03:00
Werner Almesberger
e3deb3978f update the menu bar (specifically, View > Show ...) after changes with "/" 2015-01-13 21:54:59 -03:00
Werner Almesberger
5a1fd80fc8 new sidebar mode "Show packages"
Yes, now one can finally go through header.fpd and its 160 packages
without going crazy !
2015-01-09 01:58:29 -03:00
Werner Almesberger
809e8142b5 gui.c (change_world): don't change color of the active frame
We're re-creating all the frames anyway (*), so why was this there ?
(*) And if we don't, which will happen in the near future, that's even
    worse.
2015-01-09 01:56:53 -03:00
Werner Almesberger
73389fba76 sanitize show var/code handling; switch to enum for future changes 2015-01-09 00:57:36 -03:00
Werner Almesberger
8982d09474 add experimental reload feature
This is a first crude attempt at allowing reloading without exiting
fped. This should be useful when writing a design as text and using
the GUI only to visualize it.

Reload is only enabled (in the File menu) if the file doesn't have
the "MACHINE-GENERATED" header.

Known bugs:
- exits on parse errors
- leaks memory badly
- current frame is reset to root
2012-08-21 02:08:26 -03:00
Werner Almesberger
86c082f5a9 track bounding box also on a per-package basis and use this to scale Postscript
Until now, everything used the bounding box of the root frame which
contains all the packages, visible or not. We now also record what
ends up in which package, allowing inst_get_bbox to return the
bounding box of a specific package.

This is mainly useful for scaling Postscript output where only one
package is printed per sheet and there is not much point in reserving
space for any other packages that may be generated from the same
footprint definition.
2012-07-12 17:40:31 -03:00
Werner Almesberger
59b90b3054 reset reachable_pkg in the instantiation process and restore on inst_revert
Before, it was reset outside and not restored when instatiation failed.
This caused fped to segfault.
2012-05-28 23:58:05 -03:00
Werner Almesberger
f2d3986600 fix whitespace anomalies
/ \t/, / $/, and /\t$/
2012-05-28 03:11:15 -03:00
Werner Almesberger
e0351bdf73 make active package track active variables (for the GUI)
If the package whose name is produced by the active variable values
is active and the variables change, then make the newly active
package the one whose name is produced by the changed variables.

This way, iterating through a table or a loop will automatically
switch to the right package, with the exception that, if the user
choses to explicitly select a different package (by clicking on
its name in the packages line), then that selection takes priority.

Explicit selection loses its priority when active package and active
variables coincide again. I.e., one can simply "catch" the active
package by activating the corresponding values.
2012-05-25 19:20:29 -03:00
Werner Almesberger
6cadac8977 Makefile: switched from SVN to git
- Makefile (CFLAGS): renamed cpp macro SVN_VERSION to VERSION
- Makefile (SVN_VERSION, SVN_STATUS): renamed to GIT_VERSION and
  GIT_STATUS and switched to corresponding git command
- Makefile (.PHONY, update): removed this little-used target
2011-07-28 06:40:34 -03:00
werner
1409cfafd8 - gui.c (change_world_reselect): take into account that we may get called
with a selected object but no selected instance. In this case, don't try to
  re-select. (Not perfect, but better than the crash this caused so far.)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5999 99fdad57-331a-0410-800a-d7fa5415bdb3
2011-01-22 00:54:56 +00:00
werner
dbace0b2fa Cleaned up the disgusting mess that was the list of frames. The changes:
- removed root_frame. "frames" now takes its place.
- removed frame->prev. In those few cases where we need the previous frame (for
  deletion and dumping), we walk the list or recurse.
- the list of frames is now in GUI order, not file order.
- when reading the .fpd file, put the root frame first and leave it there.
- instead of walking the frames list and excluding the root frame by testing
  frame->name, just start at frames->next
- likewise, instead of testing !frame->name just use frame == frames



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5948 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-28 00:34:32 +00:00
werner
8cd9b7b514 Added a "Save as" dialog and made fped disable "Save" if working on a manually
created file. This is a precaution against accidently saving to a manual work,
which would change the structure and remove all comments.

- fped.h, fped.c, file.c: moved declaration of save_file_name into shared 
  header
- dump.h, dump.c (MACHINE_GENERATED): moved header marking machine-generated
  files into shared macro
- gui.c (save_as_fpd): added "Save as" dialog
- fped.h, fped.c (load_file), gui.c: disable "Save" if editing a file that 
  doesn't have the machine-generated header



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5922 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-20 01:11:45 +00:00
werner
4bfb601a40 Wrap wide tables.
- gui_frame.c (build_table): restructured code to build tables column by column
  instead of row by row
- gui_frame.c (build_table): wrap tables wider than the screen area available
  for variables and tables
- gui_util.h, gui_util.c (get_widget_width): new helper function that returns a
  widget's requested width
- gui.c, gui_style.h: replace hard-coded initial pane size with constants
  DEFAULT_FRAME_AREA_WIDTH and DEFAULT_FRAME_AREA_HEIGHT
- gui.c (change_world): pass the width of the left pane as a wrapping hint to 
  build_frames
- gui_frame.c (build_frames): subtract width of longest package template or 
  frame name from available width
- gui.c (change_world): moved call to build_frames to separate function
  do_build_frames
- gui.c (gui_main): used g_signal_connect_swapped instead of g_signal_connect
  for no good reason



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5847 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-02-19 10:27:46 +00:00
werner
53a01182a3 Show fped's SVN revision in the title bar.
- Makefile: pass SVN version and commit status to CPP
- gui.c (gui_main): show SVN revision in the title bar, if available



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5845 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-02-18 14:03:14 +00:00
werner
9c22c1b2e5 gtk_init calls setlocale(..., ""), which can upset all uses of scanf, printf,
etc. We restore sanity by resetting the locale to "C". Reported by Nick 
Oestergaard.

- gui.c (gui_init): reset the locale to "C" after calling gtk_init 



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5793 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-18 22:57:49 +00:00
werner
bdd6e95521 Added tooltips to all icons acting as buttons.
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5767 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-01 14:59:17 +00:00
werner
83669c6db7 When entering the first vectors, where were a number of display anomalies
such a vectors pointing in the wrong direction. They were caused by overflows
due to inadequate zoom settings.

- gui.c (change_world): if the extents have grown, zoom to extents



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5756 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-15 20:05:37 +00:00
werner
c91156aac0 - gui_util.c: make container clean-out globally available as vacate_widget
- gui_status.c: the x entry are is now a vbox with variable content
- the pad type is now shown in the x entry area and can be changed by clicking
  on it



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5633 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-12 23:15:15 +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
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
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
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
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
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
werner
e677ee1691 - for consistency, renamed gui_tools to gui_tool
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5410 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-08 19:44:17 +00:00
werner
a1de1ee2d9 - moved handling of frame area from gui.c to gui_frame.c and cleaned up their
includes



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5409 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-08 19:35:16 +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
605bd52dc9 Finished deletion. Assorted bug fixes.
- columns can now be deleted/undeleted
- reset active row if deleting that row
- grammar now accepts an empty file
- when a non-canvas entry becomes editable, we set the focus to it
- when adding the first reference to a frame, make it active
- when deleting the active reference to a frame, set the pointer to NULL
- measurements didn't have a drag_new action, causing trying to create them to
  crash fped
- offset field of measurements was incorrectly labeled "width"
- fixed operator precedence in gridify. Someone needs more sleep :-(



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5398 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-07 00:48:06 +00:00
werner
766efce919 - tables no longer try to fill the available space in the variables area
- added string-valued expressions (on-going)
- loops, tables, and rows can now be deleted/undeleted (still need columns)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5397 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-06 21:57:18 +00:00
werner
30664583a1 - when dragging the endpoint of an arc, show a helper line to visually connect
the point being dragged
- added pop-up menus for all frame and variable items (on-going)
- clickable items in the frame/var area now only respond to the left button,
  unless they have a pop-up
- removed the frame delete icon - use pop-up instead



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5396 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-06 20:19:00 +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
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
5d989a3e28 - GUI: added creation and moving of vectors, measurements, and frame references
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5389 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-05 14:44:36 +00:00
werner
cdcd2f36b3 - started functions to dump .fpd files (automatic labeling doesn't quite work
yet)
- don't pass argc, argv to gui_main. They've been harvested before.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5388 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-05 10:35:48 +00:00
werner
8377ab0e0d - previous Makefile change was: tentative fix for compatibility with older
ImageMagick versions (reported by Alvaro Lopes)
- we can now also select the frame's origin as a reference
- added general frame selection logic
- make sure we always use %s when passing names to status_set_name
- we can now drag endpoints (in progress)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5385 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-04 18:03:06 +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
0015f96f14 - renamed gui_icons to gui_tools
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5383 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-04 07:24:13 +00:00
werner
3d2748a623 Valgrind and gcc -O:
- stralloc_vprintf: used snprintf instead of vsnprintf. Oops !
- build_frames: didn't initialize "n"
- added a few initializations to stop gcc from complaining



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5382 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-04 07:04:36 +00:00
werner
7674be9b10 - fixed stupid realloc(..., len) error
- rearranged input area and added vector component edit capability



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5381 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-04 00:23:10 +00:00
werner
0ff7a6a3ab - before changing the world, always deselect (reported by Dave Ball)
- gui_draw_pad: add 10% of slack so that pad names are upright unless we really
  need to rotate



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5380 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-03 23:23:00 +00:00
werner
96d41a37ab - moved building of an activator into new function add_activator
- added loop value selection (quick and dirty)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5379 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-03 22:58:15 +00:00
werner
6c2734f6ac - combined frame and variable view into a single table
- make_var now sets up all back pointers, so we don't crash when deselecting a
  variable (this bug was uncovered by cleanup in the previous commit)
- report_parse_error didn't print a newline at the end of the message
- introduced frame reference selection and the data structures needed for it
- bounding box calculation of arcs used x for y
- added frame reference selection example quad.fpd



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5377 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-03 21:10:49 +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