## asm - manual assembly helper

The asm plugin provides an action called asm which pops up a dialog box that assists manual assembly of the current board. The plugin is useful only with a GUI HID.

The plugin lists, groups and sorts all subcircuits (parts) that are placed on the current board. The asm dialog presents all subcircuits in a tree of two levels. the first level is all part groups. In each part group, the second level is all parts that have the same grouping template. The list of groups is sorted by group properties and the lists of parts within each groups are sorted by the sorting template. While the assembly dialog is open, clicking a part or a group of parts will highlight (select) the parts in the main window.

### Intended use: rapid full board building

The intended use is configuring the plugin to group parts by assembly steps. Each group should contain parts that are "coming from the same bin". Within each group parts should be sorted by board side and location.

The user should click the first part in the first group, check the highlight, solder on the part and click the 'part done' button. This will skip to the next part, while the focus stays on the same button. From now on, simply pressing enter indicates the currently highlighted part is done, soldered on the board.

In this setup the grouping template should contain a height hint attribute of the subcircuits so that taller parts are built last.

### Intended use: build by functionality

It is also possible to configure the grouping/sorting templates to support a per functionality build, which is more useful in building and testing the first prototype.

In this scenario subcircuits shall have a dedicated attribute defining which functionality each part belongs to - preferably this attribute should be coming from the schematics. The group template shall contain this attribute as the first field, so groups are created and sorted by functionality.

### Templates

There are two configured templates under /plugins/asm1:

- group_template: for rendering the group string for each part
- sort_template: for rendering the sort string for each part

The group string is used for grouping parts and as the sorting function for the groups. If two parts have the same group string, they will end up in the same group. The sort string is used for sorting parts within their group.

A template is comma separated list of directives. A directive is one of the following:

directive | substituted with...
--- | ---
side | either "0/top" or "1/bottom" depending on which side the subcircuit is placed on
x | subcircuit origin X coordinate in mm, without unit
y | subcircuit origin X coordinate in mm, without unit
a.key | with the value of the subcircuit's attribute with matching key

For example the group template

    a.footprint, a.value, a.asm::group

will be executed by pasting the footprint attribute, a comma, the value attribute, a comma and the asm::group attribute. This will typically result in something like "1206,100nF,". The resulting group string is then used for grouping and sorting the groups alphabetically.

### Exclude

If the config node at /plugins/asm1/exclude_query is not empty, the value is interpreted as a query expression which is evaluated for each subcircuit (being the @ variable in the expression). When the expression evaluates to true, the subcircuit is omitted from the build schedule.

This feature can be used to implement DNP (do not populate) or optional builds.