On Wednesday 04 July 2007 19:50:23 Sean D'Epagnier wrote:
> Instead I proprose adding a button in the components dialog window that
> will copy the selected component it to the project-specific library and
> switch to it. The actual location of the project directory could be
> specified in gafrc, if not specified, maybe this button should not exist??
> Or should it use some default location? or should it popup explaining how
> to enable the feature?
>
> If I do things this way, hopefully the only new code to add will be in the
> button clicked handler, and it is a simpler change as well.
You're welcome to implement this, but I genuinely think it's a bad idea and
will oppose putting it in the main gEDA tree. This is mainly due to the way
that configuration variables are handled in libgeda, which will result in the
component library getting very confused if you open a schematic from a
different project in the same instance of gschem. I do intend to fix this at
some point.
What I would do is as follows (requires gEDA 1.1).
gafrc:
(define project-symbol-path "/path/to/project/symbols")
; Last library added has precedence
(component-library project-symbol-path "<projectname> symbols")
gschemrc:
; Make sure project symbols are first in list
(sort-component-library "disabled")
These snippets together should have the same effect as most of what you need.
You'd then need to find a way to (1) find the current symbol name from Scheme,
(2) get a return value from hierarchy-down-symbol indicating success, and (3)
save to a given file name from Scheme. This would allow you to write a
Scheme function which you could bind to a keystroke or menu item, which would
go down the symbol, and save it to the project component library. I'll add
these to my todo list (as well as making it possible to refresh the component
library from Scheme).
In general, gschem/geda needs Scheme callbacks which let you do more
manipulation of the GUI and the document.
Note that this solution will still fail if you open a schematic from a
different project which also uses this mechanism. I'll think about how to
deal with this some more... perhaps something with macros...?
> On another note.. what do you think about having the ability to query
> gedasymbols.org from within gschem?
>
It's at the top of my to-do list. In fact, all of the necessary code that
needs to be added to gEDA is already in the 1.1 branch. All that's needed is
to add the helper program which will maintain the local cache of symbols and
use curl to talk to the web server. I hope to make it so that all you need
to serve a symbol library would be an FTP or HTTP server.
Investigate the component-library-command and component-library-funcs Scheme
procedures.
I hope some of that helps.
Peter
--
Peter Brett
Electronic Systems Engineer
Integral Informatics Ltd
Attachment:
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ geda-user mailing list geda-user@xxxxxxxxxxxxxx http://www.seul.org/cgi-bin/mailman/listinfo/geda-user