Add info on connections and auto-generation
This commit is contained in:
parent
93a00cf1a1
commit
d811931b3a
92
syntax.md
92
syntax.md
@ -77,7 +77,13 @@ additional_bom_items: # custom items to add to BOM
|
||||
|
||||
### Auto-generation of connectors
|
||||
|
||||
<!-- TODO -->
|
||||
The `autogenerate: true` option is especially useful for very simple, recurring connectors such as crimp ferrules, splices, and others, where it would be a hassle to individually assign unique designators for every instance.
|
||||
|
||||
By default, when defining a connector, it will be generated once using the specified designator, and can be referenced multiple times, in different connection sets (see below).
|
||||
|
||||
If `autogenerate: true` is set, the connector will _not_ be generated at first. When defining the `connections` section (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: true` option 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 with `autogenerate: false` and a user-defined, unique designator needs to be used.
|
||||
|
||||
## Cable attributes
|
||||
|
||||
@ -133,7 +139,86 @@ additional_bom_items: # custom items to add to BOM
|
||||
|
||||
## Connection sets
|
||||
|
||||
<!-- TODO -->
|
||||
A connection set is used to connect multiple components together. Multiple connections can be easily created in parallel within one connection set, by specifying a list of individual pins (for `connectors`) or wires (for `cables`) for every component along the way.
|
||||
|
||||
```yaml
|
||||
connections:
|
||||
- # Each list entry is a connection set
|
||||
- <component> # Each connection set is itself a list of items
|
||||
- <component> # Items must alternatingly belong to the connectors and cables sections
|
||||
-...
|
||||
|
||||
- # example (single connection)
|
||||
- <connector>: <pin> # attach one pin of the connector
|
||||
- <cable>: <wire> # attach one wire of the cable
|
||||
- <connector> # for simple connectors, pin 1 is implicit
|
||||
- <cable>: s # for shielded wires, s attaches to the shield
|
||||
|
||||
- # example (multiple parallel connections)
|
||||
- <connector>: [<pin>, ..., <pin> ] # attach multiple pins in parallel
|
||||
- <cable>: [<wire>, ..., <wire>] # attach multiple wires in parallel
|
||||
- <connector> # auto-generate a new connector for every parallel connection
|
||||
- <cable>: [<wire>-<wire>] # specify a range of wires to attach in parallel
|
||||
- [<connector>, ..., <connector>] # specify multiple simple connectors to attach in parallel
|
||||
# these may be unique, auto-generated, or a mix of both
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
- Each connection set is a list of components.
|
||||
- The minimum number of items is two.
|
||||
- The maximum number of items is unlimited.
|
||||
- Items must alternatingly belong to the `connectors` and the `cables` sections.
|
||||
- When a connection set defines multiple parallel connections, the number of specified `<pin>`s and `<wire>`s for each component in the set must match. When specifying only one designator, one is auto-generated for each connection of the set.
|
||||
|
||||
### Single connections
|
||||
|
||||
#### Connectors
|
||||
|
||||
- `- <designator>: <int/string>` attaches a pin of the connector, referring to a pin number (from the connector's `pins` attribute) or a pin label (from its `pinlabels` attribute), provided the label is unique.
|
||||
|
||||
- `- <designator>` is allowed for simple connectors, since they have only one pin to connect.
|
||||
For connectors with `autogenerate: true`, a new instance, with auto-generated designator, is created.
|
||||
|
||||
#### Cables
|
||||
|
||||
- `<designator>: <wire>` attaches a specific wire of a cable, using its number.
|
||||
|
||||
### Multiple parallel connections
|
||||
|
||||
#### Connectors
|
||||
|
||||
- `- <designator>: [<pin>, ..., <pin>]`
|
||||
|
||||
Each `<pin>` may be:
|
||||
|
||||
- `<int/string>` to refer to a specific pin, using its number (from its `pins` attribute) or its label (from its `pinlabels` attribute, provided the label is unique for this connector)
|
||||
|
||||
- `<int>-<int>` auto-expands to a range. E.g. `1-4` auto-expands to `1,2,3,4`; `9-7` will auto-expand to `9,8,7`.
|
||||
|
||||
- Mixing types is allowed, e.g. `[<pin>, <pinlabel>, <pin>-<pin>, <pin>]`
|
||||
|
||||
- `- [<designator>, ..., <designator>]`
|
||||
|
||||
Attaches multiple different single pin connectors, one per connection in the set.
|
||||
For connectors with `autogenerate: true`, a new instance, with auto-generated designator, is created with every mention.
|
||||
Auto-generated and non-autogenerated connectors may be mixed.
|
||||
|
||||
- `- <designator>`
|
||||
|
||||
Attaches multiple instances of the same single pin connector, one per connectioin in the set.
|
||||
For connectors with `autogenerate: true`, a new instance, with auto-generated designator, is created for every connection in the set.
|
||||
Since only connectors with `pincount: 1` can be auto-generated, pin number 1 is implicit.
|
||||
|
||||
#### Cables
|
||||
|
||||
- `<designator>: [<wire>, ..., <wire>]`
|
||||
|
||||
Each `<wire>` may be:
|
||||
|
||||
- `<int>` to refer to a specific wire, using its number.
|
||||
- `<int>-<int>` auto-expands to a range.
|
||||
|
||||
|
||||
## BOM items
|
||||
|
||||
@ -142,8 +227,7 @@ unless the `ignore_in_bom` attribute is set to `true`.
|
||||
|
||||
Additional BOM entries can be generated in the sections marked `<bom-item>` above.
|
||||
|
||||
<!-- TODO -->
|
||||
:warning: BOM items inside connectors/cables are not implemented yet, but should be soon (#50)
|
||||
<!-- :warning: BOM items inside connectors/cables are not implemented yet, but should be soon (#50) -->
|
||||
|
||||
```yaml
|
||||
-
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user