Skip to content

Commit

Permalink
[Variants][Added] Local exclude_filter
Browse files Browse the repository at this point in the history
Is experimental and might help for cases like #721
  • Loading branch information
set-soft committed Nov 19, 2024
1 parent 5c6cb80 commit 1c966db
Show file tree
Hide file tree
Showing 47 changed files with 1,144 additions and 350 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [1.8.3] - UNRELEASED
### Added
- Workaround for people using backslashes (i.e. Windows+WSL) (#719) (#607)
More general than in previous versions.
- Variants and filters:
- Outputs with variants can now specify an `exclude_filter` in addition to the
variant. Like it was possible for transform and dnf
- Global options:
- `work_layer`: to choose the temporal layer for internal operations (#713)
- Workaround for people using backslashes (i.e. Windows+WSL) (#719) (#607)
More general than in previous versions.
- BoM:
- Field aliases ${QUANTITY} and ${ITEM_NUMBER} for compatibility with
KiCad's internal BoM.
Expand Down
400 changes: 320 additions & 80 deletions docs/samples/generic_plot.kibot.yaml

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions docs/source/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@ Versioning <https://semver.org/spec/v2.0.0.html>`__.
Added
~~~~~

- Workaround for people using backslashes (i.e. Windows+WSL) (#719)
(#607) More general than in previous versions.
- Variants and filters:

- Outputs with variants can now specify an ``exclude_filter`` in
addition to the variant. Like it was possible for transform and
dnf

- Global options:

- ``work_layer``: to choose the temporal layer for internal
operations (#713)

- Workaround for people using backslashes (i.e. Windows+WSL) (#719)
(#607) More general than in previous versions.
- BoM:

- Field aliases ${QUANTITY} and ${ITEM_NUMBER} for compatibility
Expand Down
10 changes: 8 additions & 2 deletions docs/source/configuration/outputs/BoardViewOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ BoardViewOptions parameters

- **output** :index:`: <pair: output - boardview - options; output>` [:ref:`string <string>`] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=boardview, %x=brd/brv). Affected by global options.
- ``dnf_filter`` :index:`: <pair: output - boardview - options; dnf_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to mark components as not fitted.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``exclude_filter`` :index:`: <pair: output - boardview - options; exclude_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to exclude components from processing.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``format`` :index:`: <pair: output - boardview - options; format>` [:ref:`string <string>`] (default: ``'BRD'``) (choices: "BRD", "BVR") Format used for the generated file. The BVR file format is bigger but keeps
more information, like alphanumeric pin names.
- ``pre_transform`` :index:`: <pair: output - boardview - options; pre_transform>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to transform fields before applying other filters.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``sorted`` :index:`: <pair: output - boardview - options; sorted>` [:ref:`boolean <boolean>`] (default: ``true``) Sort components by reference. Disable this option to get a file closer to what
kicad-boardview generates.
Expand Down
10 changes: 8 additions & 2 deletions docs/source/configuration/outputs/Copy_FilesOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,25 @@ Copy_FilesOptions parameters
- **files** :index:`: <pair: output - copy_files - options; files>` [:ref:`FilesListCopy parameters <FilesListCopy>`] [:ref:`list(dict) <list(dict)>`] (default: ``[]``) Which files will be included.
- **no_virtual** :index:`: <pair: output - copy_files - options; no_virtual>` [:ref:`boolean <boolean>`] (default: ``false``) Used to exclude 3D models for components with 'virtual' attribute.
- ``dnf_filter`` :index:`: <pair: output - copy_files - options; dnf_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to mark components as not fitted.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``download_lcsc`` :index:`: <pair: output - copy_files - options; download_lcsc>` [:ref:`boolean <boolean>`] (default: ``true``) In addition to try to download the 3D models from KiCad git also try to get
them from LCSC database. In order to work you'll need to provide the LCSC
part number. The field containing the LCSC part number is defined by the
`field_lcsc_part` global variable.
- ``exclude_filter`` :index:`: <pair: output - copy_files - options; exclude_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to exclude components from processing.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``follow_links`` :index:`: <pair: output - copy_files - options; follow_links>` [:ref:`boolean <boolean>`] (default: ``true``) Store the file pointed by symlinks, not the symlink.
- ``kicad_3d_url`` :index:`: <pair: output - copy_files - options; kicad_3d_url>` [:ref:`string <string>`] (default: ``'https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'``) Base URL for the KiCad 3D models.
- ``kicad_3d_url_suffix`` :index:`: <pair: output - copy_files - options; kicad_3d_url_suffix>` [:ref:`string <string>`] (default: ``''``) Text added to the end of the download URL.
Can be used to pass variables to the GET request, i.e. ?VAR1=VAL1&VAR2=VAL2.
- ``link_no_copy`` :index:`: <pair: output - copy_files - options; link_no_copy>` [:ref:`boolean <boolean>`] (default: ``false``) Create symlinks instead of copying files.
- ``pre_transform`` :index:`: <pair: output - copy_files - options; pre_transform>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to transform fields before applying other filters.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``variant`` :index:`: <pair: output - copy_files - options; variant>` [:ref:`string <string>`] (default: ``''``) Board variant to apply.

Expand Down
10 changes: 8 additions & 2 deletions docs/source/configuration/outputs/DXFOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ DXFOptions parameters
- **scaling** :index:`: <pair: output - dxf - options; scaling>` [:ref:`number <number>`] (default: ``1``) Scale factor (0 means autoscaling).
- ``custom_reports`` :index:`: <pair: output - dxf - options; custom_reports>` [:ref:`CustomReport parameters <CustomReport>`] [:ref:`list(dict) <list(dict)>`] (default: ``[]``) A list of customized reports for the manufacturer.
- ``dnf_filter`` :index:`: <pair: output - dxf - options; dnf_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to mark components as not fitted.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``drill_marks`` :index:`: <pair: output - dxf - options; drill_marks>` [:ref:`string <string>`] (default: ``'full'``) (choices: "none", "small", "full") What to use to indicate the drill places, can be none, small or full (for real scale).
- ``edge_cut_extension`` :index:`: <pair: output - dxf - options; edge_cut_extension>` [:ref:`string <string>`] (default: ``''``) Used to configure the edge cuts layer extension for Protel mode. Include the dot.
- ``exclude_edge_layer`` :index:`: <pair: output - dxf - options; exclude_edge_layer>` [:ref:`boolean <boolean>`] (default: ``true``) Do not include the PCB edge layer.
- ``exclude_filter`` :index:`: <pair: output - dxf - options; exclude_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to exclude components from processing.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``exclude_pads_from_silkscreen`` :index:`: <pair: output - dxf - options; exclude_pads_from_silkscreen>` [:ref:`boolean <boolean>`] (default: ``false``) Do not plot the component pads in the silk screen (KiCad 5.x only).
- ``force_plot_invisible_refs_vals`` :index:`: <pair: output - dxf - options; force_plot_invisible_refs_vals>` [:ref:`boolean <boolean>`] (default: ``false``) Include references and values even when they are marked as invisible.
- ``individual_page_scaling`` :index:`: <pair: output - dxf - options; individual_page_scaling>` [:ref:`boolean <boolean>`] (default: ``true``) Tell KiCad to apply the scaling for each layer as a separated entity.
Expand All @@ -32,7 +37,8 @@ DXFOptions parameters
- ``polygon_mode`` :index:`: <pair: output - dxf - options; polygon_mode>` [:ref:`boolean <boolean>`] (default: ``true``) Plot using the contour, instead of the center line.
You must disable it to get the dimensions (See https://gitlab.com/kicad/code/kicad/-/issues/11901).
- ``pre_transform`` :index:`: <pair: output - dxf - options; pre_transform>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to transform fields before applying other filters.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``sketch_pad_line_width`` :index:`: <pair: output - dxf - options; sketch_pad_line_width>` [:ref:`number <number>`] (default: ``0.1``) Line width for the sketched pads [mm], see `sketch_pads_on_fab_layers` (KiCad 6+)
Note that this value is currently ignored by KiCad (6.0.9).
Expand Down
10 changes: 8 additions & 2 deletions docs/source/configuration/outputs/DXF_SCH_PrintOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ DXF_SCH_PrintOptions parameters
- ``background_color`` :index:`: <pair: output - dxf_sch_print - options; background_color>` [:ref:`boolean <boolean>`] (default: ``false``) Use the background color from the `color_theme` (KiCad 6).
- ``color_theme`` :index:`: <pair: output - dxf_sch_print - options; color_theme>` [:ref:`string <string>`] (default: ``''``) Color theme used, this must exist in the KiCad config (KiCad 6).
- ``dnf_filter`` :index:`: <pair: output - dxf_sch_print - options; dnf_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to mark components as not fitted.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``exclude_filter`` :index:`: <pair: output - dxf_sch_print - options; exclude_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to exclude components from processing.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``monochrome`` :index:`: <pair: output - dxf_sch_print - options; monochrome>` [:ref:`boolean <boolean>`] (default: ``false``) Generate a monochromatic output.
- ``output`` :index:`: <pair: output - dxf_sch_print - options; output>` [:ref:`string <string>`] (default: ``'%f-%i%I%v.%x'``) Filename for the output DXF (%i=schematic, %x=dxf). Affected by global options.
- ``pre_transform`` :index:`: <pair: output - dxf_sch_print - options; pre_transform>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to transform fields before applying other filters.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``sheet_reference_layout`` :index:`: <pair: output - dxf_sch_print - options; sheet_reference_layout>` [:ref:`string <string>`] (default: ``''``) Worksheet file (.kicad_wks) to use. Leave empty to use the one specified in the project.
This option works only when you print the toplevel sheet of a project and the project
Expand Down
10 changes: 8 additions & 2 deletions docs/source/configuration/outputs/DiffOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ DiffOptions parameters
changes are red, but you can abort if the difference is bigger than certain threshold. |br|
The '2color' mode is like 'red_green', but you can customize the colors.
- ``dnf_filter`` :index:`: <pair: output - diff - options; dnf_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to mark components as not fitted.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``exclude_filter`` :index:`: <pair: output - diff - options; exclude_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to exclude components from processing.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``force_checkout`` :index:`: <pair: output - diff - options; force_checkout>` [:ref:`boolean <boolean>`] (default: ``false``) When `old_type` and/or `new_type` are `git` KiBot will checkout the indicated point.
Before doing it KiBot will stash any change. Under some circumstances git could fail
Expand Down Expand Up @@ -63,7 +68,8 @@ DiffOptions parameters
- ``pcb`` :index:`: <pair: output - diff - options; pcb>` [:ref:`boolean <boolean>`] (default: ``true``) Compare the PCB, otherwise compare the schematic.
- ``pre_transform`` :index:`: <pair: output - diff - options; pre_transform>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to transform fields before applying other filters.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``threshold`` :index:`: <pair: output - diff - options; threshold>` [:ref:`number <number>`] (default: ``0``) (range: 0 to 1000000) Error threshold for the `stats` mode, 0 is no error. When specified a
difference bigger than the indicated value will make the diff fail. |br|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ Download_Datasheets_Options parameters

- ``dnf`` :index:`: <pair: output - download_datasheets - options; dnf>` [:ref:`boolean <boolean>`] (default: ``false``) Include the DNF components.
- ``dnf_filter`` :index:`: <pair: output - download_datasheets - options; dnf_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to mark components as not fitted.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``exclude_filter`` :index:`: <pair: output - download_datasheets - options; exclude_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to exclude components from processing.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``link_repeated`` :index:`: <pair: output - download_datasheets - options; link_repeated>` [:ref:`boolean <boolean>`] (default: ``true``) Instead of download things we already downloaded use symlinks.
- ``output`` :index:`: <pair: output - download_datasheets - options; output>` [:ref:`string <string>`] (default: ``'${VALUE}.pdf'``) Name used for the downloaded datasheet.
`${FIELD}` will be replaced by the FIELD content.
- ``pre_transform`` :index:`: <pair: output - download_datasheets - options; pre_transform>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to transform fields before applying other filters.
A short-cut to use for simple cases where a variant is an overkill.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Can be used to fine-tune a variant for a particular output that needs extra filtering done before the variant.

- ``repeated`` :index:`: <pair: output - download_datasheets - options; repeated>` [:ref:`boolean <boolean>`] (default: ``false``) Download URLs that we already downloaded.
It only makes sense if the `output` field makes their output different.
Expand Down
Loading

0 comments on commit 1c966db

Please sign in to comment.