X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-TCPREMOTEIP: 173.48.170.224 X-Authenticated-UID: jpd AT noqsi DOT com From: John Doty Content-Type: multipart/alternative; boundary="Apple-Mail=_52870944-FB84-4A74-8D2B-70B02582815F" Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [geda-user] Proposal: Library handling Date: Wed, 19 Feb 2020 14:18:29 -0500 References: To: geda-user AT delorie DOT com In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3273) Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --Apple-Mail=_52870944-FB84-4A74-8D2B-70B02582815F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 The thing that this proposal doesn=E2=80=99t address is that neither = external library symbols nor embedded symbols are ideal for an evolving = project. External library symbols are good starting points, but need = customization (mostly attribute additions and changes, but sometimes = more) to be usable. Embedded symbols are inflexible. What works for me is to copy a library symbol, give it a name like = =E2=80=9Cbypass_cap=E2=80=9D or =E2=80=9Clow_speed_opamp=E2=80=9D that = reflects its role in the project, and place it in the project=E2=80=99s = symbol directory. Then, instead of adding attributes to each instance, I = put them in the symbol file. This makes it easy to control BOM = complexity: if I want to change my bypass caps from 0603 to 0805, I do = it in one place. I isolates the project from library changes without the = inflexibility of embedded symbols. It solves the =E2=80=9Clight vs. = heavy=E2=80=9D symbol dilemma: you don=E2=80=99t need a library = containing a billion heavy symbols, but your project reaps the benefits = of the heavy symbols it needs. This approach, however, starts out clumsily with gschem as it is (lots = of manual copying). The benefits come later. It would be nice if gschem = supported this approach fluently. > On Feb 19, 2020, at 10:06 AM, Roland Lutz wrote: >=20 > Hi, >=20 > I have some ideas about improving library handling in gEDA/gaf which = I'd like to put up for discussion here. >=20 >=20 >=20 > Proposal 1: Named libraries > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >=20 > A symbol is currently referenced by its basename, e.g. = "resistor-1.sym". When gEDA looks for a symbol, it searches all library = directories for a file with that name, and uses the first one it finds. >=20 > I suggest referencing symbols by two strings: the basename, and a = library identifier. Using the basename (instead of e.g. a full path) = allows library authors to revise the internal organization of the = library. Using a library identifier (instead of e.g. a library path) = allows the user to reorganize the libraries on their machine and = facilitates sharing schematic files between users. >=20 > When a library is added, a library identifier would be specified, = e.g.: >=20 > (add-library "kmk-essentials" "~/geda/kmk-essentials") >=20 > Some library identifiers are reserved for special purposes: >=20 > unknown > This is the internal identifier used whenever a symbol is = referenced > by an old file which doesn't specify a library identifier. This = means > the old symbol lookup logic is to be used. >=20 > default > This is the identifier for the historic default library. >=20 > local > This identifier is reserved for project-local libraries specified = in > the project's configuration file. The user interface may offer > dedicated controls to manipulate project-local libraries. >=20 >=20 >=20 > Proposal 2: Library section > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >=20 > Currently, symbols are referenced from the schematic file like this: >=20 > C 5000 2000 1 0 0 resistor-1.sym >=20 > For embedded symbols, a section containing the symbol contents = follows: >=20 > C 5000 2000 1 0 0 EMBEDDEDresistor-1.sym > [ > L 5600 2200 5500 2000 3 0 0 0 -1 -1 > L 5500 2000 5400 2200 3 0 0 0 -1 -1 > ...and so on... > ] >=20 > This is repeated every time the embedded symbol is used. >=20 > I propose adding special syntax to the file format which allows = embedding a symbol once and then referencing it, e.g.: >=20 > s resistor-1 1 default resistor-1.sym > [ > L 600 200 500 0 3 0 0 0 -1 -1 > L 500 0 400 200 3 0 0 0 -1 -1 > ...and so on... > ] >=20 > =46rom there on, whenever the symbol "resistor-1" is referenced, this = means the symbol file "resistor-1.sym" from the default library, whose = contents are included for convenience. The distinction between basename = and symbol identifier is made so multiple symbols with the same basename = can be used; in that case, gEDA would assign a different identifier to = each symbol, e.g. "resistor-1<1>". >=20 > There are three modes of embedding a symbol: >=20 > omit (0) > The symbol's contents are omitted, i.e., it isn't embedded at all. > This is useful for minimizing changes when using an SCM. >=20 > reference (1) > The symbol's contents are included, but the file in the library is > authoritative. This is useful for distributing schematic files to = other > users, and for detecting symbol changes. The UI would display a > warning if the library is missing or the symbol in the library = differs > from the one included in the schematic but require a user = interaction > before updating the symbol in the schematic. >=20 > embed (2) > The symbol embedded in the schematic is authoritative; its basename = is > included for reference but otherwise ignored. This is useful for > including custom one-off symbols without having to bother with > external files. >=20 >=20 >=20 > Any thoughts or comments? >=20 > Roland >=20 >=20 John Doty Noqsi Aerospace, Ltd. jpd AT noqsi DOT com --Apple-Mail=_52870944-FB84-4A74-8D2B-70B02582815F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 The thing that this proposal doesn=E2=80=99t address is that = neither external library symbols nor embedded symbols are ideal for an = evolving project.

External library symbols are good starting points, but need = customization (mostly attribute additions and changes, but sometimes = more) to be usable.

Embedded symbols are inflexible.

What works for me is to copy a library = symbol, give it a name like =E2=80=9Cbypass_cap=E2=80=9D or = =E2=80=9Clow_speed_opamp=E2=80=9D that reflects its role in the project, = and place it in the project=E2=80=99s symbol directory. Then, instead of = adding attributes to each instance, I put them in the symbol file. This = makes it easy to control BOM complexity: if I want to change my bypass = caps from 0603 to 0805, I do it in one place. I isolates the project = from library changes without the inflexibility of embedded symbols. It = solves the =E2=80=9Clight vs. heavy=E2=80=9D symbol dilemma: you don=E2=80= =99t need a library containing a billion heavy symbols, but your project = reaps the benefits of the heavy symbols it needs.
This approach, however, starts out = clumsily with gschem as it is (lots of manual copying). The benefits = come later. It would be nice if gschem supported this approach = fluently.

On Feb 19, 2020, at 10:06 AM, = Roland Lutz <rlutz AT hedmen DOT org> wrote:

Hi,
I have some ideas about improving library = handling in gEDA/gaf which I'd like to put up for discussion here.



Proposal 1: = Named libraries
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

A = symbol is currently referenced by its basename, e.g. "resistor-1.sym". = When gEDA looks for a symbol, it searches all library directories for a = file with that name, and uses the first one it finds.

I suggest referencing symbols by two strings: the basename, = and a library identifier.  Using the basename (instead of e.g. a = full path) allows library authors to revise the internal organization of = the library. Using a library identifier (instead of e.g. a library path) = allows the user to reorganize the libraries on their machine and = facilitates sharing schematic files between users.

When a library is added, a library identifier would be = specified, e.g.:

 (add-library = "kmk-essentials" "~/geda/kmk-essentials")

Some library identifiers are reserved for special = purposes:

 unknown
=    This is the internal identifier used whenever a symbol = is referenced
   by an old file which = doesn't specify a library identifier.  This means
=    the old symbol lookup logic is to be used.

 default
=    This is the identifier for the historic default = library.

 local
=    This identifier is reserved for project-local = libraries specified in
   the project's = configuration file.  The user interface may offer
=    dedicated controls to manipulate project-local = libraries.



Proposal 2: Library section
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D

Currently, symbols are = referenced from the schematic file like this:

C 5000 2000 1 0 0 resistor-1.sym

For embedded symbols, a section containing the symbol = contents follows:

C 5000 2000 1 0 0 = EMBEDDEDresistor-1.sym
[
L 5600 2200 5500 = 2000 3 0 0 0 -1 -1
L 5500 2000 5400 2200 3 0 0 0 -1 -1
...and so on...
]

This is repeated every time the embedded symbol is used.

I propose adding special syntax to the file = format which allows embedding a symbol once and then referencing it, = e.g.:

s resistor-1 1 default = resistor-1.sym
[
L 600 200 500 0 3 0 0 0 -1 = -1
L 500 0 400 200 3 0 0 0 -1 -1
...and so = on...
]

=46rom there on, = whenever the symbol "resistor-1" is referenced, this means the symbol = file "resistor-1.sym" from the default library, whose contents are = included for convenience.  The distinction between basename and = symbol identifier is made so multiple symbols with the same basename can = be used; in that case, gEDA would assign a different identifier to each = symbol, e.g. "resistor-1<1>".

There = are three modes of embedding a symbol:

=  omit (0)
   The symbol's contents = are omitted, i.e., it isn't embedded at all.
=    This is useful for minimizing changes when using an = SCM.

 reference (1)
=    The symbol's contents are included, but the file in = the library is
   authoritative. =  This is useful for distributing schematic files to other
   users, and for detecting symbol changes. =  The UI would display a
   warning if = the library is missing or the symbol in the library differs
=    from the one included in the schematic but require a = user interaction
   before updating the = symbol in the schematic.

 embed = (2)
   The symbol embedded in the = schematic is authoritative; its basename is
=    included for reference but otherwise ignored. =  This is useful for
   including = custom one-off symbols without having to bother with
=    external files.



Any thoughts or comments?

Roland



John Doty    =           Noqsi = Aerospace, Ltd.

jpd AT noqsi DOT com




= --Apple-Mail=_52870944-FB84-4A74-8D2B-70B02582815F--