[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Adding attributes to gschem symbols



On May 11, 2009, at 5:19 AM, Andy Fierman wrote:

> Hi,
>
> I am new to gEDA and have a question about how to make gschem
> attributes invisible in the schematic.
>
> I think I understand the basics of how to create and edit symbols with
> their associated attributes and text etc.
>
>
> * This is what I want to do:
>
> Add a set of attributes to every symbol I create in my local library

The problem with the local library is that its scope isn't a project.

> that will simplify my bill of material creation and general
> understability of my schematics. To do this where possible I am taking
> existing symbols or creating new ones and as well as the default set
> of gschem attributes such as device, refdes, value, footprint, I want
> to add an extra set of attributes of my own.

This is a good idea, but let's examine the consequences of different  
approaches below.

>
> I don't want all the extra attributes to be visible when I place an
> instance of the symbol on a schematic because it makes the schematic
> too cluttered. However, I do want to be able to edit their values in a
> schematic instance when I select it and either right click on "Edit
> ..." or double click on the instance to open the "Edit Attributes"
> window. So, in the symbol I set the visibility to 0 (invisible) and
> show_name_value to 1 (value only).
>
> Following the rules in http://geda.seul.org/wiki/geda:file_format_spec
> I can do that in the symbol fine, no problem.

You don't really need to refer to the file format. You can put these  
in the symbol with gschem through the GUI if you want.

>
>
> * The problem I have is this:
>
> When I place one of my components on the schematic it shows me the
> attributes I want and hides those I have set to be invisible. However,
> when I open the "Edit Attributes" window none of the attributes I have
> made invisible appear in the list of attributes in the top section of
> the window. They also do not appear in the drop down list for the "Add
> attribute", "Name" text box.

You're not restricted to the drop down list. If you have project  
attributes, just type their names.

>
> The only way I have found to get them to show up in the top section of
> the "Edit Attributes" window is if I make them visible in the symbol
> before I save it to the library.
>
> At first I thought this was a feature of the attributes being my own
> extra ones but more tinkering showed me that if I chose some of the
> gschem standard attributes such as "model" or "model-name", then it
> all gets a bit strange.
>
> If I make both "model" and "model-name" invisible in the symbol, then
> "model" is not in the top section of the window at all but
> "model-name" is shown there with the relevant 3 boxes; Vis (blank), N
> (blank) and V (ticked). Both attributes of course show in the drop
> down list for the "Add attribute", "Name" text box, I assume because
> they are gschem default attributes.

That's controlled by your gafrc file. The system default in 1.4 is:

(always-promote-attributes "footprint device value model-name")

You can put a line like that in you own gafrc file to override the  
default.

But let's look at the downside of promoted attributes: once promoted,  
they are in the schematic, overriding the symbol, so to make a change  
you can't just edit the symbol: you have to track down every instance  
in every schematic and fix it. This can be a real pain when you need  
to change the footprints of 300 bypass capacitors ;-). On the other  
hand, attributes that aren't promoted can still be overridden at  
schematic level by attaching an attribute of the same name to the  
symbol instance. Therefore, I prefer to minimize attribute promotion  
to gain maximum flexibility. Here's my gafrc file for a recent project:

;
(component-library "../components/symbols")
(source-library ".")
(always-promote-attributes "refdes")
(define default-titleblock "Noqsi-title-B.sym")
;

"component-library" tells gEDA where the project's components are.  
"source-library" tells where subcircuit schematics are (in with the  
top level). I don't promote any attributes that aren't absolutely  
necessary, so I get the benefits of your approach without the time  
consuming tedium that's needed to make a wholesale change in  
needlessly promoted attributes.

John Doty              Noqsi Aerospace, Ltd.
http://www.noqsi.com/
jpd@xxxxxxxxx




_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user