-
Notifications
You must be signed in to change notification settings - Fork 276
Description
From the syntax description:
If
autogenerate: trueis set, the connector will not be generated at first. When defining theconnectionssection (see below), every time the connector is mentioned, a new instance with an auto-incremented designator is generated and attached.Since the auto-incremented and auto-assigned designator is not known to the user, one instance of the connector can not be referenced again outside the point of creation. The
autogenerate: trueoption is therefore only useful for terminals with only one wire attached, or splices with exactly one wire going in, and one wire going out. If more wires are to be attached (e.g. for a three-way splice, or a crimp where multiple wires are joined), a separate connector withautogenerate: falseand a user-defined, unique designator needs to be used.
An idea to remove the restriction of not knowing the designator of auto-generated connectors and not being able to reference them at a later point, would be to add a new syntax feature to allow the user to assign designators to auto-generated connectors.
Proposed syntax:
X.X1[Edit 2020-10-22: changed from -> to . to distinguish from arrows proposed in #134]
This would generate a new instance of component X and assign it the X1 designator.
This is just an idea, an other possible alternatives come to mind:
X.X1X->X1(possible confusion with arrow notation discussed in [feature] Connector-Connector & Connector-Ferrule mating #134)X:X1(seems to be legal YAML, even when used as dict keyX:X1: [1-4]but probably risky/confusing)X$X1X1(X)X1@X- and many more
The following example takes this a step further, and proposes auto-generating cables as well.
Example for a Y-splice, reusing connectors, ferrules and cables through auto-generation:
connectors:
X:
autogenerate: true
pincount: 4
F:
autogenerate: true
style: simple
type: ferrule
cables:
C:
autogenerate: true
wirecount: 4
color_code: DIN
connections:
-
- X.X2: [1-4]
- C.C1: [1-4]
- [F.F1, F.F2, F.F3, F.F4] # generate new instances of F and assign designators
- C.C2: [1-4]
- X.X2: [1-4]
-
- [F1, F2, F3, F4] # use previously assigned designators
- C.C3: [1-4]
- X.X3: [1-4]The idea is to make the new syntax work in additon to the current one, which generates unknown, auto-incremented designators not exposed to the user, since that should be good enough for simple cases.
