diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index c3ae14a04..acdff3e88 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -1,4 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python. +# This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Regression tests @@ -51,13 +51,19 @@ jobs: rm -f tests/.local ##### Experimental stuff: ## Remove KiAuto - dpkg --remove --force-all kiauto + #dpkg --remove --force-all kiauto ## Install KiAuto@master - curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip - unzip pp.zip - pip3 install ${PIP_OPS} KiAuto-master/ + #curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip + #unzip pp.zip + #pip3 install ${PIP_OPS} KiAuto-master/ + ## Clean the downloaded stuff + #rm -rf KiAuto-master/ pp.zip + ## Install KiDiff@master + #curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip + #unzip pp.zip + #pip3 install ${PIP_OPS} KiDiff-master/ ## Clean the downloaded stuff - rm -rf KiAuto-master/ pp.zip + #rm -rf KiDiff-master/ pp.zip ## Check what we got #echo $PATH #ls -la /usr/bin/*_do || true @@ -86,6 +92,7 @@ jobs: with: name: Test_Coverage_${{ matrix.ki_release }}_${{ matrix.w_tests }} path: .coverage.* + include-hidden-files: true - name: Collect coverage ${{ matrix.ki_release }} run: | python3-coverage combine @@ -100,6 +107,7 @@ jobs: name: Test_Output_${{ matrix.ki_release }}_${{ matrix.w_tests }} # Important! empty directories are skipped!!!! path: output + include-hidden-files: true - name: Upload Coverage # Don't mix stable coverage with development coverage # if: ${{ (github.ref == 'refs/heads/dev') && (matrix.ki_release != 'ki8') }} @@ -183,6 +191,7 @@ jobs: with: name: Test_Coverage_Independent path: .coverage.* + include-hidden-files: true - name: Collect coverage independent run: | python3-coverage combine @@ -195,6 +204,7 @@ jobs: name: Test_Output_Independent # Important! empty directories are skipped!!!! path: output + include-hidden-files: true - name: Upload Coverage # Don't mix stable coverage with development coverage # if: github.ref == 'refs/heads/dev' @@ -282,6 +292,7 @@ jobs: with: name: Test_Coverage_combined path: htmlcov + include-hidden-files: true coveralls: name: Finish Coveralls diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 687fbcf00..8dc8439ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: mv *.deb output - name: Store - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: package path: output @@ -69,7 +69,7 @@ jobs: uses: actions/checkout@v1 - name: Retrieve - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: package diff --git a/.github/workflows/test_nightly.yml b/.github/workflows/test_nightly.yml index 06370ba01..f5e8d909a 100644 --- a/.github/workflows/test_nightly.yml +++ b/.github/workflows/test_nightly.yml @@ -33,7 +33,7 @@ jobs: ./${{ matrix.w_tests }}.sh - name: Store results if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Test_Output_${{ matrix.ki_release }}_${{ matrix.w_tests }} # Important! empty directories are skipped!!!! diff --git a/.github/workflows/test_stable_nightly.yml b/.github/workflows/test_stable_nightly.yml index b0a4fece2..6259a9c09 100644 --- a/.github/workflows/test_stable_nightly.yml +++ b/.github/workflows/test_stable_nightly.yml @@ -33,7 +33,7 @@ jobs: ./${{ matrix.w_tests }}.sh - name: Store results if: ${{ always() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Test_Output_${{ matrix.ki_release }}_${{ matrix.w_tests }} # Important! empty directories are skipped!!!! diff --git a/CHANGELOG.md b/CHANGELOG.md index 992024c5f..5e512e8bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,106 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.8.0] - 2024-09-17 +### Added +- Experimental Altium PCB conversion (#625) +- Most places where a field is expected now support `_field_*` to fetch the + globally defined value. +- Preflights: + - check_fields: used to ensure conditions on desired fields (#643) + - e/drc: option to force english messages (needed for KiCad 8.0.4) +- Filters: + - `separate_pins`: used to create testpoint reports (#638) + - `_null` can be used to skip the filters processing +- Global options: + - `use_pcb_fields`: allows using fields defined in the PCB (and not + only in the schematic), enabled by default (#648 and #650) + - `field_current`: to specify the field used for current ratings +- Internal templates: + - Testpoints_by_attr, Testpoints_by_attr_CSV, Testpoints_by_attr_HTML, + Testpoints_by_value, Testpoints_by_value_CSV and Testpoints_by_value_HTML: + Used to generate testpoint reports (#638) +- Command line: + - Option to also list sub-PCBs found in variants +- BoardView: support for BVR format +- BoM: logo file name can contain env vars and/or ~ (#620) +- Datasheet: option to classify the datasheets by reference. +- KiCost: option to specify a configuration file (#615) +- Report: + - Solder paste usage stats (#616) + - Support for variants (See #616) + - Testpoints report (See #638) +- xDRC: configurable category (#647) +- Schematic: + - Support for text boxes inside symbols (#621) +- Worksheet: + - Support for KiCad 8 bitmaps (#623) +- Position: + - Support for panels repeating the same component (See #656) + +### Fixed: +- iBoM: *highlight_pin1* option didn't allow the use of the new choices. +- PCB2Blender_Tools: transform filters might make it fail. (#618) +- BoM: + - No color reference when using row colors but not column or kicost colors. + (#619) + - "0 pico" for "0" + - Use of `lcsc_link` as boolean + - User fields for components that are only in the PCB not filled (#656) +- Worksheet: Size of PNGs that specify its PPI resolution. +- Filters: + - Problems with filters that change fields for components that are + only in the PCB. (#628) + - Use of '_none' filter in lists of filters and _kf() +- Variants: + - Problems when remove_solder_paste_for_dnp and remove_adhesive_for_dnp are + both disabled (remove_solder_mask_for_dnp wrongly defined) (#632) + - Problems when using `set_text_variables_before_output` (#649) +- Draw Stackup: + - Dimension always drawn on User.Drawings layer (#629) + - Problems when the PCB wasn't loaded by another preflight +- Update XML: `check_pcb_parity` not usable for KiCad 8, must use the `drc` + preflight (#633) +- PCB Print: %ln and %ll substitution when using `repeat_for_layer` option +- Render_3D: bottom side components that doesn't rotate from its center got + displaced highlight (#659) +- QR Lib output and various preflights: might remove DRC exclusions. This is + a KiCad bug that we must workaround (#653) +- 3D outputs: temporal .kicad_dru file not removed (#655) +- Generated PCB files: problems with some big structures, like zone fills, + that could generate huge lines in the generated PCB, not supported by KiCad. + (#660) + +### Changed: +- KiCad 8.0.2: The behavior with hidden text changed in KiCad 8.0.2, it is + computed even for operations where it isn't really visible, like plotting + a layer where we don't have the hidden text. So currently KiBot is + experimentally disabling the "hidden text layer". + This is a bug in KiCad (https://gitlab.com/kicad/code/kicad/-/issues/17958) +- Render 3D: Modern versions of Image Magick no longer needs two trim passes + for auto-crop, so now we default to one and an option enables two. (See #644) +- Preflights: The definition of preflight plug-ins changed. They are slightly + different now. Currently they are Optionable and share more in common with + outputs. If you need assistance to migrate a preflight just open a GitHub + issue. +- Outputs: Now all options must declare its default. +- Global `invalidate_pcb_text_cache`: now it changes the PCB on disk, not just + on memory. This is needed for external tools like KiKit's panelize. +- In many cases now we allow empty lists and use some sort of default. + A warning is issued, but we continue. + - Layers: now the default for missing layers is all layers. + - Copy files: Now we don't stop when nothing to copy is specified + - Layers: now the default for missing layers is all layers. + - KiKit Present: Missing description is no longer fatal + - Any PCB Print/PCB Print: Missing pages/layers is no longer fatal + - Populate: Missing input file is no longer fatal + - QR Lib: Missing QR definition is no longer fatal (%p %r used) + - Blender Options outputs: Make a render when no outputs are specified + - PCB Print: repeat_layers defaults to inners + - Spec to Field: some simple defaults for the specs (voltage, current, power + and tolerance) + + ## [1.7.0] - 2024-04-23 ### Added - New preflights: diff --git a/Makefile b/Makefile index 702ef2728..9452636da 100644 --- a/Makefile +++ b/Makefile @@ -116,7 +116,7 @@ test_docker_local_1_ki7: docker run --rm -v $(CWD):$(CWD) --workdir="$(CWD)" ghcr.io/inti-cmnb/kicad_auto_test:ki7 \ /bin/bash -c "python3-coverage run src/kibot --help-outputs > /dev/null; pytest-3 --log-cli-level debug -k '$(SINGLE_TEST)' --test_dir=output ; $(PY_COV) html; chown -R $(USER_ID):$(GROUP_ID) output/ tests/ .coverage.* htmlcov/ .cache" -t1k7: single_test +t1k7: test_docker_local_1_ki7 # pip3 uninstall -y kiauto ; dpkg -i kiauto_2.2.5-1_all.deb ; test_docker_local_1_n: @@ -132,7 +132,7 @@ test_docker_local_1_sn: /bin/bash -c "export KIBOT_COPY_REF=$(KIBOT_COPY_REF); src/kibot --help-outputs > /dev/null ; pytest-3 --log-cli-level debug -k '$(SINGLE_TEST)' --test_dir=output ; chown -R $(USER_ID):$(GROUP_ID) output/ tests/ .coverage.* htmlcov/ .cache" # rm -R .cache/ ; KIBOT_COPY_REF="1" SINGLE_TEST=test_print_sch_variant_ni_2 make test_docker_local_1_sn -t1k8: test_docker_local_1_ki8 +t1k8: single_test t1n: test_docker_local_1_n @@ -201,7 +201,7 @@ t1k6: test_docker_local_1_ki6 single_test: rm -rf pp -$(PY_COV) run src/kibot --help-list-outputs > /dev/null - -$(PYTEST) --log-cli-level debug -k "$(SINGLE_TEST)" --test_dir=pp + -LANG=en $(PYTEST) --log-cli-level debug -k "$(SINGLE_TEST)" --test_dir=pp @echo "********************" Output #@cat pp/*/output.txt @echo "********************" Error diff --git a/debian/changelog b/debian/changelog index a5bd6e268..2acdde0fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,86 @@ +kibot (1.8.0-1) stable; urgency=medium + + * Added experimental Altium PCB conversion + * Now most places where a field is expected now support `_field_*` to fetch + the globally defined value. + * Added check_fields preflight: used to ensure conditions on desired fields + * Added option to e/drc to force english messages (needed for KiCad 8.0.4) + * Added `separate_pins` filter: used to create testpoint reports + * Added `_null` filter, can be used to skip the filters processing + * Added `use_pcb_fields` global options: allows using fields defined in the + PCB (and not only in the schematic), enabled by default + * Added `field_current` global options: to specify the field used for + current ratings + * New internal templates Testpoints_by_attr, Testpoints_by_attr_CSV, + Testpoints_by_attr_HTML, Testpoints_by_value, Testpoints_by_value_CSV and + Testpoints_by_value_HTML: Used to generate testpoint reports + * New command line option to also list sub-PCBs found in variants + * BoardView: added support for BVR format + * BoM: now the logo file name can contain env vars and/or ~ + * Datasheet: added option to classify the datasheets by reference. + * KiCost: added option to specify a configuration file + * Report: added solder paste usage stats, support for variants and testpoints + report + * xDRC: added configurable category + * Schematic: added support for text boxes inside symbols + * Worksheet: added support for KiCad 8 bitmaps + * Position: added support for panels repeating the same component + * iBoM: fixed `highlight_pin1` option didn't allow the use of the new choices. + * PCB2Blender_Tools: fixed that transform filters might make it fail. + * BoM: fixed no color reference when using row colors but not column or kicost + colors, "0 pico" for "0", use of `lcsc_link` as boolean and user fields for + components that are only in the PCB not filled. + * Worksheet: Fixed size of PNGs that specify its PPI resolution. + * Filters: fixed problems with filters that change fields for components that + are only in the PCB and the use of '_none' filter in lists of filters and + _kf() + * Variants: fixed problems when remove_solder_paste_for_dnp and + remove_adhesive_for_dnp are both disabled (remove_solder_mask_for_dnp + wrongly defined) and problems when using `set_text_variables_before_output` + * Draw Stackup: fixed dimension always drawn on User.Drawings layer and + problems when the PCB wasn't loaded by another preflight + * Update XML: fixed `check_pcb_parity` not usable for KiCad 8, must use the + `drc` preflight + * PCB Print: fixed the %ln and %ll substitution when using `repeat_for_layer` + option + * Render_3D: bottom side components that doesn't rotate from its center got + displaced highlight, now fixed + * QR Lib output and various preflights: might remove DRC exclusions. This is + a KiCad bug that we must workaround. + * 3D outputs: temporal .kicad_dru file not removed + * Generated PCB files: fixed problems with some big structures, like zone + fills, that could generate huge lines in the generated PCB, not supported + by KiCad. + * KiCad 8.0.2: changed the behavior with hidden text, it is computed even for + operations where it isn't really visible, like plotting a layer where we + don't have the hidden text. So currently KiBot is experimentally disabling + the "hidden text layer". + This is a bug in KiCad (https://gitlab.com/kicad/code/kicad/-/issues/17958) + * Render 3D: modern versions of Image Magick no longer needs two trim passes + for auto-crop, so now we default to one and an option enables two + * Preflights: the definition of preflight plug-ins changed. They are slightly + different now. Currently they are Optionable and share more in common with + outputs. If you need assistance to migrate a preflight just open a GitHub + issue. + * Outputs: Now all options must declare its default. + * Global `invalidate_pcb_text_cache`: now it changes the PCB on disk, not + just on memory. This is needed for external tools like KiKit's panelize. + * In many cases now we allow empty lists and use some sort of default. + A warning is issued, but we continue. + - Layers: now the default for missing layers is all layers. + - Copy files: Now we don't stop when nothing to copy is specified + - Layers: now the default for missing layers is all layers. + - KiKit Present: Missing description is no longer fatal + - Any PCB Print/PCB Print: Missing pages/layers is no longer fatal + - Populate: Missing input file is no longer fatal + - QR Lib: Missing QR definition is no longer fatal (%p %r used) + - Blender Options outputs: Make a render when no outputs are specified + - PCB Print: repeat_layers defaults to inners + - Spec to Field: some simple defaults for the specs (voltage, current, power + and tolerance) + + -- Salvador Eduardo Tropea Tue, 17 Sep 2024 10:09:33 -0300 + kibot (1.7.0-1) stable; urgency=medium * New preflights: erc, drc, update_footprint, draw_stackup, diff --git a/docs/Makefile b/docs/Makefile index cef2a99b8..f003ff036 100755 --- a/docs/Makefile +++ b/docs/Makefile @@ -33,13 +33,13 @@ source/usage.txt: ../kibot/__main__.py ../src/kibot --help > $@ source/configuration/sup_preflights.rst: ../kibot/pre_*.py ../kibot/config_reader.py - ../src/kibot --rst --help-preflights > $@ + ../src/kibot --rst --help-preflights -d source/configuration/preflights/ > $@ source/configuration/sup_filters.rst: ../kibot/fil_*.py ../kibot/config_reader.py - ../src/kibot --rst --help-filters > $@ + ../src/kibot --rst --help-filters -d source/configuration/filters/ > $@ source/configuration/sup_variants.rst: ../kibot/var_*.py ../kibot/config_reader.py - ../src/kibot --rst --help-variants > $@ + ../src/kibot --rst --help-variants -d source/configuration/variants/ > $@ source/configuration/sup_globals.rst: ../kibot/globals.py ../kibot/config_reader.py ../src/kibot --rst --help-global-options > $@ diff --git a/docs/RESOUCES.md b/docs/RESOUCES.md new file mode 100644 index 000000000..7fa1aee98 --- /dev/null +++ b/docs/RESOUCES.md @@ -0,0 +1,35 @@ +# Resources + +- GitHub site: [https://github.com/INTI-CMNB/KiBot](https://github.com/INTI-CMNB/KiBot) (525 stars 64 forks 6/2024) +- Documentation: [https://kibot.readthedocs.io/en/master/](https://kibot.readthedocs.io/en/master/) +- Issues: [https://github.com/INTI-CMNB/KiBot/issues](https://github.com/INTI-CMNB/KiBot/issues) +- Discussions: [https://github.com/INTI-CMNB/KiBot/discussions](https://github.com/INTI-CMNB/KiBot/discussions) +- KiCad Forum: [https://forum.kicad.info/t/kibot-fabrication-and-documentation-automation/24705](https://forum.kicad.info/t/kibot-fabrication-and-documentation-automation/24705) +- Download + - Releases: [https://github.com/INTI-CMNB/KiBot/releases](https://github.com/INTI-CMNB/KiBot/releases) + - PyPi: [https://pypi.org/project/kibot/](https://pypi.org/project/kibot/) + - Debian repo: [https://set-soft.github.io/debian/](https://set-soft.github.io/debian/) +- Docker images: + - Base image with KiCad and base tools: + - GitHub: [https://github.com/orgs/INTI-CMNB/packages?repo_name=kicad_debian](https://github.com/orgs/INTI-CMNB/packages?repo_name=kicad_debian) (20K+ 6/2024) + - Simple images + - DockerHub: [https://hub.docker.com/r/setsoft/kicad_auto](https://hub.docker.com/r/setsoft/kicad_auto) (50K+ 6/2024) + - GitHub: [https://github.com/orgs/INTI-CMNB/packages?repo_name=kicad_auto](https://github.com/orgs/INTI-CMNB/packages?repo_name=kicad_auto) (33K 6/2024) + - Full images (with Blender, PanDoc, etc.) + - DockerHub: [https://hub.docker.com/r/setsoft/kicad_auto_test](https://hub.docker.com/r/setsoft/kicad_auto_test) (9K+ 6/2024) + - GitHub: [https://github.com/orgs/INTI-CMNB/packages?repo_name=kicad_auto_test](https://github.com/orgs/INTI-CMNB/packages?repo_name=kicad_auto_test) (74K+ 6/2024) +- Examples: + - Variants: + - Repository: [https://github.com/INTI-CMNB/kibot_variants_arduprog]([https://github.com/INTI-CMNB/kibot_variants_arduprog) + - Site: [https://inti-cmnb.github.io/kibot_variants_arduprog/](https://inti-cmnb.github.io/kibot_variants_arduprog/) + - Quick-start example: [https://inti-cmnb.github.io/kibot_variants_arduprog_site/Browse/t1-navigate.html](https://inti-cmnb.github.io/kibot_variants_arduprog_site/Browse/t1-navigate.html) +- Satellite projects: + - KiAuto: [https://github.com/INTI-CMNB/KiAuto](https://github.com/INTI-CMNB/KiAuto) + - KiDiff: [https://github.com/INTI-CMNB/KiDiff](https://github.com/INTI-CMNB/KiDiff) +- Contributed projects: + - KiCost: [https://github.com/hildogjr/KiCost](https://github.com/hildogjr/KiCost) (2nd 487 commits 6/2024) + - KiBoM: [https://github.com/SchrodingersGat/KiBoM/](https://github.com/SchrodingersGat/KiBoM/) (2nd 34 commits 6/2024) + - PcbDraw: [https://github.com/yaqwsx/PcbDraw/](https://github.com/yaqwsx/PcbDraw/) (2nd 32 commits 6/2024) + - iBoM: [https://github.com/openscopeproject/InteractiveHtmlBom/](https://github.com/openscopeproject/InteractiveHtmlBom/) (3rd 9 commits 6/2024) + - pcbnewTransition: [https://github.com/yaqwsx/pcbnewTransition](https://github.com/yaqwsx/pcbnewTransition) (2nd 2 commits 6/2024) + - KiKit: [https://github.com/yaqwsx/KiKit/](https://github.com/yaqwsx/KiKit/) (2 commits 6/2024) diff --git a/docs/Types_and_defaults.md b/docs/Types_and_defaults.md new file mode 100644 index 000000000..c6cbac7d3 --- /dev/null +++ b/docs/Types_and_defaults.md @@ -0,0 +1,155 @@ +# Data types and their defaults + +Outputs, filters, globals, etc. are objects derived from Optionable. +They use the `with document:` macro to create some sort of docstrings for data members. +The macros creates members called `_help_MEMBER` containing the docstring found in the code. +This docstring is used to generate the documentation but also to validate the data from the YAML config file. +This document talks about the rules used for the validation. + + +## Simple datatypes + +The `number`, `boolean` and `string` datatypes are directly interpreted by the macros. So code like this: + +```python +with document: + self.v1 = 5 + """ A number """ + self.v2 = True + """ A boolean """ + self.v3 = 'Hello' + """ A string """ +``` + +Will automagically define: + +```python +self._help_v1 = "[number=5] A number" +self._help_v2 = "[boolean=true] A boolean" +self._help_v3 = "[string='Hello'] A string" +``` + +The type and default are automatically filled. + + +## Aliases + +To define an alias we use: + +```python +with document: + self.posx = 10 + """ Bla bla """ + self.pos_x = None + """ {posx} """ +``` + +In this case the real member is `posx` but the user can use `pos_x`. + + +## Important (basic) parameters + +When a member is very important we mark it using an asterisk: + +```python +with document: + self.posx = 10 + """ *Bla bla """ +``` + +This asterisk goes before any datatype indication: + +```python +self._help_posx = "*[number=10] Bla bla" +``` + + +## Multiple datatypes + +Some parameters can be defined using different data types, here is an example: + +```python +with document: + self.posx = 10 + """ [number|string=10] Bla bla """ +``` + +This means that we can use a *number* or a *string* in the YAML. +Note that in this case we must explicitly indicate the valid data types and the default. + + +## Complex datatypes + +They are *list*, *dict* and their combination, i.e.: + +- dict +- list(string) +- list(dict) +- list(list(string)) + +To handle them we always use a class. For the simplest cases we just use *Optionable*, like this: + +```python +with document: + self.v1 = Optionable + """ [list(string)=[]] Bla bla """ +``` + +Here we must specify the valid data types and the default. +This example says the default is an empty list, we use *{}* for a default *dict*, the one created instantiating the class. +For *dict* and *list(dict)* we must define a class with a *__init__* that uses `with document:` to define the valid keys. + + +## Complex defaults + +The complex datatypes might need a complex default, one that is complex to write in the help. +For this case we can leave the default undefined and define a data member *_default* in the class used for the member. + + +## Unknown defaults + +When the default will be created on-the-fly we use *?* for its value. + + +## Number ranges + +They are specified using *[min,max]*, like this: + +```python +with document: + self.texture_dpi = 1016.0 + """ [508,2032] Texture density in dots per inch """ + self.xxx = 20 + """ [number|string=20] [1,100] Bla bla """ +``` + + +## Choices + +They are specified using *[OPS1,OPS2,OPS3]*, like this: + + +```python +with document: + self.solder_joints = "SMART" + """ [NONE,SMART,ALL] The plug-in can add nice looking solder joints """ +``` + + +## Extended choices + +When we can also enter an arbitrary value we use an asterisk as the last option: + +```python +with document: + self.solder_joints = "SMART" + """ [NONE,SMART,ALL,*] The plug-in can add nice looking solder joints """ +``` + +## Random notes + +We edit the data from the YAML tree, but we also use the data from the actually created objects for things that aren't in the tree. + +Why not just the defaults? + +The classes are free to fill things from the data to fill the gaps. diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 20fb99e0a..b95713205 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -2,14 +2,17 @@ # You should take portions of this example and edit the options to make # them suitable for your use. # This file is useful to know all the available options. +# Try using `--quick-start` for a functional example. kibot: version: 1 preflight: - # [dict] Annotates the PCB according to physical coordinates. + # Annotate PCB + # Annotates the PCB according to physical coordinates. # This preflight modifies the PCB and schematic, use it only in revision control environments. # Used to assign references according to footprint coordinates. - # The project must be fully annotated first. + # The project must be fully annotated first . + # [dict={}] Options for the `annotate_pcb` preflight. annotate_pcb: top_main_axis: y top_main_ascending: true @@ -21,52 +24,85 @@ preflight: bottom_start: 101 use_position_of: 'footprint' grid: 1.0 - # [boolean=false] Annotates all power components. + # Annotate Power + # Annotates all power components. # This preflight modifies the schematic, use it only in revision control environments. - # Used to solve ERC problems when using filters that remove power reference numbers. + # Used to solve ERC problems when using filters that remove power reference numbers . + # [boolean=false] Enable this preflight. annotate_power: true - # [boolean=false] Zones are filled before doing any operation involving PCB layers. + # Check Fields + # Checks to apply to the schematic fields. + # You can define conditions that must be met by the fields. + # The checks are applied to every component in the schematic. + # When an error is hit execution is stopped. + # One use is to check that all components are suitable for a temperature range. + # In this case a field must declare the temperature range . + # [dict|list(dict)=[]] One or more check rules. + check_fields: + - field: 'temperature' + regex: '(-?\d+).+?(?:-?\d+).*' + numeric_condition: '<=' + numeric_reference: -10 + # Check Zone Fills + # Zones are filled before doing any operation involving PCB layers. # The original PCB remains unchanged. If you need to abort when the zone fill - # creates significant changes to a layer use the CheckZoneFill internal template. + # creates significant changes to a layer use the CheckZoneFill internal template . + # [boolean=false] Enable this preflight. check_zone_fills: true - # [boolean=False|dict] Draw the PCB stackup. Needs KiCad 7 or newer. + # Draw Stackup + # Draw the PCB stackup. Needs KiCad 7 or newer. # To specify the position and size of the drawing you can use two methods. # You can specify it using the *pos_x*, *pos_y*, *width*, *height* and *layer* options. # But you can also draw a rectangle in your PCB with the size and layer you want. # Then draw another thing inside the rectangle, select both and create a group # (right mouse button, then Grouping -> Group). Now edit the group and change its name # to *kibot_stackup*. After running this preflight the rectangle will contain the - # stackup. + # stackup . + # [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior. draw_stackup: true - # [boolean=false|dict] Runs the DRC (Distance Rules Check). To ensure we have a valid PCB. + # DRC + # Runs the DRC (Distance Rules Check) to ensure we have a valid PCB. # You need a valid *fp-lib-table* installed. If not KiBot will try to temporarily install the template. # This is a replacement for the *run_drc* preflight that needs KiCad 8 or newer. - # GUI exclusions and schematic parity are supported. + # GUI exclusions and schematic parity are supported . + # [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior. drc: true - # [boolean=false|dict] Runs the ERC (Electrical Rules Check). To ensure the schematic is electrically correct. + # ERC + # Runs the ERC (Electrical Rules Check). To ensure the schematic is electrically correct. # You need a valid *sym-lib-table* installed. If not KiBot will try to temporarily install the template. - # This is a replacement for the *run_erc* preflight that needs KiCad 8 or newer. + # This is a replacement for the *run_erc* preflight that needs KiCad 8 or newer . + # [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior. erc: true - # [boolean=false] **Deprecated**, use the `warnings_as_errors` option from `run_erc`/`erc`. + # ERC Warnings (**Deprecated**) # Option for `run_erc`. ERC warnings are considered errors. + # Use the `warnings_as_errors` option from `run_erc`/`erc` instead . + # [boolean=false] Enable this preflight. erc_warnings: false - # [boolean=false] Fill all zones again and save the PCB. + # Fill Zones + # Fill all zones again and save the PCB . + # [boolean=false] Enable this preflight. fill_zones: true - # [list(dict)] A list of entries to filter out ERC/DRC messages when using *run_erc*/*run_drc*. + # Filters + # A list of entries to filter out ERC/DRC messages when using *run_erc*/*run_drc*. # Avoid using it with the new *erc* and *drc* preflights. # Note that ignored errors will become KiBot warnings (i.e. `(W058) ...`). - # To farther ignore these warnings use the `filters` option in the `global` section. + # To farther ignore these warnings use the `filters` option in the `global` section . + # [list(dict)=[]] One or more filters. filters: - filter: 'Filter description' error: '10' regex: 'Regular expression to match' - # [boolean=false] **Deprecated**, use the `ignore_unconnected` option from `run_drc`/`drc`. + # Ignore Unconnected (**Deprecated**) # Option for `run_drc`. Ignores the unconnected nets. Useful if you didn't finish the routing. # It will also ignore KiCad 6 warnings when using `run_drc`. + # Use the `ignore_unconnected` option from `run_drc`/`drc` instead . + # [boolean=false] Enable this preflight. ignore_unconnected: false - # [dict] Replaces tags in the PCB. I.e. to insert the git hash or last revision date. + # PCB Replace (**Deprecated**) + # Replaces tags in the PCB. I.e. to insert the git hash or last revision date. # This is useful for KiCad 5, use `set_text_variables` when using KiCad 6. - # This preflight modifies the PCB. Even when a back-up is done use it carefully. + # This preflight modifies the PCB. Even when a back-up is done use it carefully . + # [dict={}] Options for the `pcb_replace` preflight. pcb_replace: date_command: 'git log -1 --format="%as" -- "$KIBOT_PCB_NAME"' replace_tags: @@ -74,21 +110,29 @@ preflight: command: 'git log -1 --format="%h" "$KIBOT_PCB_NAME"' before: 'Git hash: <' after: '>' - # [boolean=false|dict] Runs the DRC (Distance Rules Check). To ensure we have a valid PCB. + # Run DRC (**Deprecated for KiCad 8**) + # Runs the DRC (Distance Rules Check) to ensure we have a valid PCB. + # For KiCad 8 use *drc* # The report file name is controlled by the global output pattern (%i=drc %x=txt). # Note that the KiCad 6+ *Test for parity between PCB and schematic* option is not supported. # If you need to check the parity use the `update_xml` preflight. # KiCad 6 introduced `warnings` they are currently counted be the `unconnected` counter of KiBot. # This will change in the future. - # If you use DRC exclusions please consult the `drc_exclusions_workaround` global option. + # If you use DRC exclusions please consult the `drc_exclusions_workaround` global option . + # [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior. run_drc: true - # [boolean=false|dict] (Deprecated for KiCad 8, use *erc*) Runs the ERC (Electrical Rules Check). + # Run ERC (**Deprecated for KiCad 8**) + # Runs the ERC (Electrical Rules Check). + # For KiCad 8 use *erc* # To ensure the schematic is electrically correct. - # The report file name is controlled by the global output pattern (%i=erc %x=txt). + # The report file name is controlled by the global output pattern (%i=erc %x=txt) . + # [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior. run_erc: true - # [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date. + # SCH Replace (**Deprecated**) + # Replaces tags in the schematic. I.e. to insert the git hash or last revision date. # This is useful for KiCad 5, use `set_text_variables` when using KiCad 6. - # This preflight modifies the schematics. Even when a back-up is done use it carefully. + # This preflight modifies the schematics. Even when a back-up is done use it carefully . + # [dict={}] Options for the `sch_replace` preflight. sch_replace: date_command: 'git log -1 --format="%as" -- "$KIBOT_SCH_NAME"' replace_tags: @@ -96,39 +140,51 @@ preflight: command: 'git log -1 --format="%h" "$KIBOT_SCH_NAME"' before: 'Git hash: <' after: '>' - # [dict|list(dict)] Defines KiCad 6+ variables. + # Set Text Variables + # Defines KiCad 6+ variables. # They are expanded using `${VARIABLE}`, and stored in the project file. - # This preflight replaces `pcb_replace` and `sch_replace` when using KiCad 6. + # This preflight replaces `pcb_replace` and `sch_replace` when using KiCad 6 or newer. # The KiCad project file is modified. - # Warning: don't use `-s all` or this preflight will be skipped. + # Warning: don't use `-s all` or this preflight will be skipped . + # [dict|list(dict)=[]] One or more variable definition. set_text_variables: - name: 'git_hash' command: 'git log -1 --format="%h" "$KIBOT_PCB_NAME"' before: 'Git hash: <' after: '>' - # [string|list(string)=''] Updates footprints from the libs, you must provide one or more references to be updated. - # This is useful to replace logos using freshly created versions. - update_footprint: QR1, QR2 - # [boolean=False] Update the information in the Board Characteristics. + # Update Footprint + # Updates footprints from the libs, you must provide one or more + # references to be updated. This is useful to replace logos using freshly created versions . + # [string|list(string)=''] {comma_sep} One or more component references. + update_footprint: QR1,QR2 + # Update PCB Characteristics + # Update the information in the Board Characteristics. # Starting with KiCad 7 you can paste a block containing board information using - # *Place* -> *Add Board Characteristics*. But this information is static, so if + # Place* -> *Add Board Characteristics*. But this information is static, so if # you modify anything related to it the block will be obsolete. - # This preflight tries to refresh the information. + # This preflight tries to refresh the information . + # [boolean=false] Enable this preflight. update_pcb_characteristics: true - # [boolean=false] Update the QR codes. + # Update QR + # Update the QR codes. # Complements the `qr_lib` output. - # The KiCad 6 files and the KiCad 5 PCB needs manual update, generating a new library isn't enough. + # The KiCad 6 files and the KiCad 5 PCB needs manual update, generating a new library isn't enough . + # [boolean=false] Enable this preflight. update_qr: true - # [boolean=False] Update the information in the Stackup Table. + # Update Stackup + # Update the information in the Stackup Table. # Starting with KiCad 7 you can paste a block containing board information using # *Place* -> *Stackup Table*. But this information is static, so if # you modify anything related to it the block will be obsolete. - # This preflight tries to refresh the information. + # This preflight tries to refresh the information . + # [boolean=false] Enable this preflight. update_stackup: true - # [boolean=false|dict] Update the XML version of the BoM (Bill of Materials). + # Update XML + # Update the XML version of the BoM (Bill of Materials). # To ensure our generated BoM is up to date. # Note that this isn't needed when using the internal BoM generator (`bom`). - # You can compare the PCB and schematic netlists using it. + # You can compare the PCB and schematic netlists using it (KiCad 6 and 7 only) . + # [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior. update_xml: true outputs: @@ -152,7 +208,7 @@ outputs: # [number=1.1] Value to multiply the Z axis coordinate after computing the automatically generated camera. # Used to avoid collision of the camera and the object auto_camera_z_axis_factor: 1.1 - # [dict] Options for the camera. + # [dict={}] Options for the camera. # If none specified KiBot will create a suitable camera. # If no position is specified for the camera KiBot will look for a suitable position camera: @@ -164,11 +220,11 @@ outputs: clip_start: -1 # [string=''] Name for the camera name: '' - # [number|string] X position [m]. You can use `width`, `height` and `size` for PCB dimensions + # [number|string=0] X position [m]. You can use `width`, `height` and `size` for PCB dimensions pos_x: 0 - # [number|string] Y position [m]. You can use `width`, `height` and `size` for PCB dimensions + # [number|string=0] Y position [m]. You can use `width`, `height` and `size` for PCB dimensions pos_y: 0 - # [number|string] Z position [m]. You can use `width`, `height` and `size` for PCB dimensions + # [number|string=0] Z position [m]. You can use `width`, `height` and `size` for PCB dimensions pos_z: 0 # [string='perspective'] [perspective,orthographic,panoramic] Type of camera type: 'perspective' @@ -184,11 +240,11 @@ outputs: - energy: 0 # [string=''] Name for the light name: '' - # [number|string] X position [m]. You can use `width`, `height` and `size` for PCB dimensions + # [number|string=0] X position [m]. You can use `width`, `height` and `size` for PCB dimensions pos_x: 0 - # [number|string] Y position [m]. You can use `width`, `height` and `size` for PCB dimensions + # [number|string=0] Y position [m]. You can use `width`, `height` and `size` for PCB dimensions pos_y: 0 - # [number|string] Z position [m]. You can use `width`, `height` and `size` for PCB dimensions + # [number|string=0] Z position [m]. You can use `width`, `height` and `size` for PCB dimensions pos_z: 0 # [string='POINT'] [POINT,SUN,SPOT,HEMI,AREA] Type of light. SUN lights will illuminate more evenly type: 'POINT' @@ -207,13 +263,13 @@ outputs: # Note that some formats includes the light and camera and others are just the 3D model # (i.e. STL and PLY) type: 'render' - # [string|dict] Options to export the PCB to Blender. + # [string|dict={}] Options to export the PCB to Blender. # You can also specify the name of the output that generates the PCB3D file. # See the `PCB2Blender_2_1`, `PCB2Blender_2_7` and `PCB2Blender_2_1_haschtl` templates pcb3d: - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Downloads missing 3D models from KiCad git. # Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. # They are downloaded to a temporal directory and discarded. @@ -240,13 +296,13 @@ outputs: no_virtual: false # [string='%f-%i%I%v.%x'] Name for the generated PCB3D file (%i='blender_export' %x='pcb3d'). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' - # [list(string)|string=all] [none,all] List of components to draw, can be also a string for `none` or `all`. + pre_transform: '_null' + # [list(string)|string='all'] [none,all,*] List of components to draw, can be also a string for `none` or `all`. # Ranges like *R5-R10* are supported. # Unlike the `pcbdraw` output, the default is `all` - show_components: all + show_components: 'all' # [boolean=true] Add solder paste only for the populated components. # Populated components are the ones listed in `show_components` solder_paste_for_populated: true @@ -254,7 +310,7 @@ outputs: variant: '' # [string='2.7'] [2.1,2.1_haschtl,2.7] Variant of the format used version: '2.7' - # Options to configure how Blender imports the PCB. + # [dict={}] Options to configure how Blender imports the PCB. # The default values are good for most cases pcb_import: # [boolean=true] Center the PCB at the coordinates origin @@ -272,7 +328,7 @@ outputs: solder_joints: 'SMART' # [boolean=true] Move the sub-PCBs to their relative position stack_boards: true - # [number=1016.0] [508-2032] Texture density in dots per inch + # [number=1016.0] [508,2032] Texture density in dots per inch texture_dpi: 1016.0 # [dict|list(dict)] How the object is viewed by the camera point_of_view: @@ -285,7 +341,7 @@ outputs: rotate_y: 0 # [number=0] Angle to rotate the board in the Z axis, positive is clockwise [degrees] rotate_z: 0 - # [number=1] [1-1000] Generate this amount of steps using the rotation angles as increments. + # [number=1] [1,1000] Generate this amount of steps using the rotation angles as increments. # Use a value of 1 (default) to interpret the angles as absolute. # Used for animations. You should define the `default_file_id` to something like # '_%03d' to get the animation frames @@ -293,7 +349,7 @@ outputs: # [string='top'] [top,bottom,front,rear,right,left,z,Z,y,Y,x,X] Point of view. # Compatible with `render_3d` view: 'top' - # [dict] Controls how the render is done for the `render` output type + # [dict={}] Controls how the render is done for the `render` output type render_options: # [boolean=false] When enabled the image will be post-processed to remove the empty space around the image. # In this mode the `background2` is changed to be the same as `background1` @@ -324,14 +380,20 @@ outputs: type: 'boardview' dir: 'Example/boardview_dir' options: - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' - # [string='%f-%i%I%v.%x'] Filename for the output (%i=boardview, %x=brd). Affected by global options + dnf_filter: '_null' + # [string='BRD'] [BRD,BVR] Format used for the generated file. The BVR file format is bigger but keeps + # more information, like alphanumeric pin names + format: 'BRD' + # [string='%f-%i%I%v.%x'] Filename for the output (%i=boardview, %x=brd/brv). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' + # [boolean=true] Sort components by reference. Disable this option to get a file closer to what + # kicad-boardview generates + sorted: true # [string=''] Board variant to apply. # Used for sub-PCBs variant: '' @@ -348,7 +410,7 @@ outputs: type: 'bom' dir: 'Example/bom_dir' options: - # [list(dict)] Add components from other projects. + # [list(dict)=[]] Add components from other projects. # You can use CSV files, the first row must contain the names of the fields. # The `Reference` and `Value` are mandatory, in most cases `Part` is also needed. # The `Part` column should contain the name/type of the component. This is important for @@ -358,7 +420,7 @@ outputs: # [string=','] Delimiter used for CSV files - delimiter: ',' # [string=''] Name of the schematic to aggregate - file: '' + file: 'another_schematic.kicad_sch' # [string=''] Name to identify this source. If empty we use the name of the schematic name: '' # [number=1] Number of boards to build (components multiplier). Use negative to subtract @@ -369,7 +431,7 @@ outputs: angle_positive: true # [boolean=false] Use negative X coordinates for footprints on bottom layer (for XYRS) bottom_negative_x: false - # [list(dict)|list(string)] List of columns to display. + # [list(dict)|list(string)=computed for your project] List of columns to display. # Can be just the name of the field. # In addition to all user defined fields you have various special columns, consult :ref:`bom_columns` columns: @@ -380,7 +442,7 @@ outputs: field: 'Row' # [list(dict)|list(string)|string=''] List of fields to join to this column join: - # [string=''] Name of the field + # [string=''] {no_case} Name of the field - field: 'Voltage' # [string=''] Text to use instead of a field. This option is incompatible with the `field` option. # Any space to separate it should be added in the text. @@ -409,7 +471,7 @@ outputs: # - ['zener', 'zenersmall'] # - ['d', 'diode', 'd_small'] component_aliases: [['r', 'r_small', 'res', 'resistor'], ['l', 'l_small', 'inductor'], ['c', 'c_small', 'cap', 'capacitor'], ['sw', 'switch'], ['zener', 'zenersmall'], ['d', 'diode', 'd_small']] - # [list(dict)|list(string)] List of columns to add to the global section of the cost. + # [list(dict)|list(string)=[]] List of columns to add to the global section of the cost. # Can be just the name of the field cost_extra_columns: # [string=''] Used as explanation for this column. The XLSX output uses it @@ -419,7 +481,7 @@ outputs: field: 'Row' # [list(dict)|list(string)|string=''] List of fields to join to this column join: - # [string=''] Name of the field + # [string=''] {no_case} Name of the field - field: 'Voltage' # [string=''] Text to use instead of a field. This option is incompatible with the `field` option. # Any space to separate it should be added in the text. @@ -439,7 +501,7 @@ outputs: name: 'Line' # [boolean=false] Show the stats about how many of the components are SMD/THT. You must provide the PCB count_smd_tht: false - # [dict] Options for the CSV, TXT and TSV formats + # [dict={}] Options for the CSV, TXT and TSV formats csv: # [boolean=false] Hide the header line (names of the columns) hide_header: false @@ -452,16 +514,16 @@ outputs: # [string=','] CSV Separator. TXT and TSV always use tab as delimiter. # Only one character can be specified separator: ',' - # [string|list(string)] Include this distributors list. Default is all the available - distributors: - # [string|list(string)='_kibom_dnc'] Name of the filter to mark components as 'Do Not Change'. + # [string|list(string)=[]] {comma_sep} Include this distributors list. Default is all the available + distributors: [] + # [string|list(string)='_kibom_dnc_CONFIG_FIELD'] Name of the filter to mark components as 'Do Not Change'. # The default filter marks components with a DNC value or DNC in the Config field. # This option is for simple cases, consider using a full variant for complex cases - dnc_filter: '_kibom_dnc' - # [string|list(string)='_kibom_dnf'] Name of the filter to mark components as 'Do Not Fit'. + dnc_filter: '_kibom_dnc_CONFIG_FIELD' + # [string|list(string)='_kibom_dnf_CONFIG_FIELD'] Name of the filter to mark components as 'Do Not Fit'. # The default filter marks components with a DNF value or DNF in the Config field. # This option is for simple cases, consider using a full variant for complex cases - dnf_filter: '_kibom_dnf' + dnf_filter: '_kibom_dnf_CONFIG_FIELD' # [string|list(string)='_mechanical'] Name of the filter to exclude components from BoM processing. # The default filter (built-in filter '_mechanical') excludes test points, fiducial marks, mounting holes, etc. # Please consult the built-in filters explanation to fully understand what is excluded by default. @@ -478,19 +540,19 @@ outputs: # If you need to customize the filter, or apply it before, you can disable this option and # add a custom filter to the filter chain expand_text_vars: true - # [string='Config'] Field name used for internal filters (not for variants) - fit_field: 'Config' - # [string|list(string)='no,yes'] Values for the `Footprint Populate` column + # [string='config'] {no_case} Field name used for internal filters (not for variants) + fit_field: 'config' + # [string|list(string)='no,yes'] {comma_sep} {L:2} Values for the `Footprint Populate` column footprint_populate_values: 'no,yes' - # [string|list(string)='SMD,THT,VIRTUAL'] Values for the `Footprint Type` column + # [string|list(string)='SMD,THT,VIRTUAL'] {comma_sep} {L:3} Values for the `Footprint Type` column footprint_type_values: 'SMD,THT,VIRTUAL' - # [string=''] [HTML,CSV,TXT,TSV,XML,XLSX,HRTXT] format for the BoM. - # Defaults to CSV or a guess according to the options. + # [string='Auto'] [HTML,CSV,TXT,TSV,XML,XLSX,HRTXT,Auto] format for the BoM. + # `Auto` defaults to CSV or a guess according to the options. # HRTXT stands for Human Readable TeXT - format: 'CSV' + format: 'Auto' # [boolean=true] Connectors with the same footprints will be grouped together, independent of the name of the connector group_connectors: true - # [list(string)] List of fields used for sorting individual components into groups. + # [list(string)] {no_case} List of fields used for sorting individual components into groups. # Components which match (comparing *all* fields) will be grouped together. # Field names are case-insensitive. # For empty fields the behavior is defined by the `group_fields_fallbacks`, `merge_blank_fields` and @@ -501,10 +563,10 @@ outputs: # If empty: ['Part', 'Part Lib', 'Value', 'Footprint', 'Footprint Lib', # 'Voltage', 'Tolerance', 'Current', 'Power'] is used group_fields: ['part', 'part lib', 'value', 'footprint', 'footprint lib', 'voltage', 'tolerance', 'current', 'power'] - # [list(string)] List of fields to be used when the fields in `group_fields` are empty. + # [list(string)=[]] {no_case} List of fields to be used when the fields in `group_fields` are empty. # The first field in this list is the fallback for the first in `group_fields`, and so on - group_fields_fallbacks: - # [dict] Options for the HRTXT formats + group_fields_fallbacks: [] + # [dict={}] Options for the HRTXT formats hrtxt: # [string='-'] Separator between the header and the data header_sep: '-' @@ -518,13 +580,13 @@ outputs: justify: 'left' # [string='I'] Column Separator separator: 'I' - # [dict] Options for the HTML format + # [dict={}] Options for the HTML format html: # [boolean=true] Use colors to show the field type col_colors: true - # [string=''] Column with links to the datasheet + # [string=''] {no_case} Column with links to the datasheet datasheet_as_link: '' - # [string|list(string)=''] Column/s containing Digi-Key part numbers, will be linked to web page + # [string|list(string)=''] {no_case} Column/s containing Digi-Key part numbers, will be linked to web page digikey_link: '' # [string|list(string)=''] Information to put after the title and before the pcb and stats info extra_info: '' @@ -536,7 +598,7 @@ outputs: hide_stats_info: false # [boolean=true] Use a color for empty cells. Applies only when `col_colors` is `true` highlight_empty: true - # [boolean|string|list(string)=''] Column/s containing LCSC part numbers, will be linked to web page. + # [boolean|string|list(string)=''] {no_case} Column/s containing LCSC part numbers, will be linked to web page. # Use **true** to copy the value indicated by the `field_lcsc_part` global option lcsc_link: '' # [string|boolean=''] PNG/SVG file to use as logo, use false to remove. @@ -544,9 +606,9 @@ outputs: logo: '' # [number=370] Used when the logo is an SVG image. This width is used to render the SVG image logo_width: 370 - # [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page + # [string|list(string)=''] {no_case} Column/s containing Mouser part numbers, will be linked to web page mouser_link: '' - # [list(dict)] Used to highlight rows using filters. Rows that match a filter can be colored. + # [list(dict)=[]] Used to highlight rows using filters. Rows that match a filter can be colored. # Note that these rows won't have colored columns row_colors: # [string='#FF8080'] Color used for this category @@ -571,13 +633,14 @@ outputs: merge_blank_fields: true # [boolean=true] When creating groups two components with empty/missing field will be interpreted as with the same value merge_both_blank: true - # [list(string)] List of fields where we tolerate conflicts. + # [list(string)=computed for your project] {no_case} List of fields where we tolerate conflicts. # Use it to avoid undesired warnings. # By default the field indicated in `fit_field`, the field used for variants and # the field `part` are excluded no_conflict: ['Config', 'Part'] - # [string|list(string)] Exclude this distributors list. They are removed after computing `distributors` - no_distributors: + # [string|list(string)=[]] {comma_sep} Exclude this distributors list. + # They are removed after computing `distributors` + no_distributors: [] # [boolean=false] When normalizing values use the locale decimal point normalize_locale: false # [boolean=false] Try to normalize the R, L and C values, producing uniform units and prefixes @@ -591,9 +654,9 @@ outputs: # extra information split it in separated fields, add the fields to `group_fields` and disable # `merge_blank_fields` parse_value: true - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_null'] Name of the filter to transform fields before applying other filters. # This option is for simple cases, consider using a full variant for complex cases - pre_transform: '_none' + pre_transform: '_null' # [string=''] A prefix to add to all the references from this project. Used for multiple projects ref_id: '' # [string=' '] Separator used for the list of references @@ -609,16 +672,19 @@ outputs: use_alt: false # [boolean=true] Use the auxiliary axis as origin for coordinates (KiCad default) (for XYRS) use_aux_axis_as_origin: true - # [string=''] Board variant, used to determine which components - # are output to the BoM. - variant: '' - # [dict] Options for the XLSX format + # [string='_kibom_simple'] Board variant, used to determine which components are output to the BoM. + # The `_kibom_simple` variant is a KiBoM variant without any filters and it provides some basic + # compatibility with KiBoM. Note that this output has default filters that behaves like KiBoM. + # The combination between the default for this option and the defaults for the filters provides + # a behavior that mimics KiBoM default behavior + variant: '_kibom_simple' + # [dict={}] Options for the XLSX format xlsx: # [boolean=true] Use colors to show the field type col_colors: true - # [string=''] Column with links to the datasheet + # [string=''] {no_case} Column with links to the datasheet datasheet_as_link: '' - # [string|list(string)=''] Column/s containing Digi-Key part numbers, will be linked to web page + # [string|list(string)=''] {no_case} Column/s containing Digi-Key part numbers, will be linked to web page digikey_link: '' # [string|list(string)=''] Information to put after the title and before the pcb and stats info extra_info: '' @@ -633,9 +699,9 @@ outputs: # [boolean=false] Enable KiCost worksheet creation. # Note: an example of how to use it on CI/CD can be found [here](https://github.com/set-soft/kicost_ci_test) kicost: false - # [string|list(string)=''] List of KiCost APIs to disable + # [string|list(string)=''] {comma_sep} List of KiCost APIs to disable kicost_api_disable: '' - # [string|list(string)=''] List of KiCost APIs to enable + # [string|list(string)=''] {comma_sep} List of KiCost APIs to enable kicost_api_enable: '' # [string=''] KiCost configuration file. It contains the keys for the different distributors APIs. # The regular KiCost config is used when empty. @@ -645,7 +711,7 @@ outputs: kicost_config: '' # [boolean=false] Used to add a column with the distributor's description. So you can check this is the right component kicost_dist_desc: false - # [boolean|string|list(string)=''] Column/s containing LCSC part numbers, will be linked to web page. + # [boolean|string|list(string)=''] {no_case} Column/s containing LCSC part numbers, will be linked to web page. # Use **true** to copy the value indicated by the `field_lcsc_part` global option lcsc_link: '' # [string|boolean=''] PNG/SVG file to use as logo, use false to remove. @@ -657,9 +723,9 @@ outputs: logo_width: 370 # [number=60] [20,999] Maximum column width (characters) max_col_width: 60 - # [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page + # [string|list(string)=''] {no_case} Column/s containing Mouser part numbers, will be linked to web page mouser_link: '' - # [list(dict)] Used to highlight rows using filters. Rows that match a filter can be colored. + # [list(dict)=[]] Used to highlight rows using filters. Rows that match a filter can be colored. # Note that these rows won't have colored columns row_colors: # [string='#FF8080'] Color used for this category @@ -674,10 +740,11 @@ outputs: # [boolean=false] Enable Specs worksheet creation. Contains specifications for the components. # Works with only some KiCost APIs specs: false - # [list(dict)|list(string)] Which columns are included in the Specs worksheet. Use `References` for the + # [list(dict)|list(string)=[]] Which columns are included in the Specs worksheet. Use `References` for the # references, 'Row' for the order and 'Sep' to separate groups at the same level. By default all are included. # Column names are distributor specific, the following aren't: '_desc', '_value', '_tolerance', '_footprint', - # '_power', '_current', '_voltage', '_frequency', '_temp_coeff', '_manf', '_size' + # '_power', '_current', '_voltage', '_frequency', '_temp_coeff', '_manf', '_size'. + # Note that an empty list means all available specs, use `specs` options to disable it specs_columns: # [string=''] Used as explanation for this column. The XLSX output uses it - comment: '' @@ -686,7 +753,7 @@ outputs: field: 'Row' # [list(dict)|list(string)|string=''] List of fields to join to this column join: - # [string=''] Name of the field + # [string=''] {no_case} Name of the field - field: 'Voltage' # [string=''] Text to use instead of a field. This option is incompatible with the `field` option. # Any space to separate it should be added in the text. @@ -717,7 +784,7 @@ outputs: options: # [string='auto'] [auto,stored,deflated,bzip2,lzma] Compression algorithm. Use auto to let KiBot select a suitable one compression: 'auto' - # [list(dict)] Which files will be included + # [list(dict)=[]] Which files will be included files: # [string=''] Destination directory inside the archive, empty means the same of the file - dest: '' @@ -755,9 +822,9 @@ outputs: type: 'copy_files' dir: 'Example/copy_files_dir' options: - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Downloads missing 3D models from KiCad git. # Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. # They are downloaded to a temporal directory and discarded. @@ -769,7 +836,7 @@ outputs: # part number. The field containing the LCSC part number is defined by the # `field_lcsc_part` global variable download_lcsc: true - # [list(dict)] Which files will be included + # [list(dict)=[]] Which files will be included files: # [string=''] Destination directory inside the output dir, empty means the same of the file # relative to the source directory. @@ -808,9 +875,9 @@ outputs: link_no_copy: false # [boolean=false] Used to exclude 3D models for components with 'virtual' attribute no_virtual: false - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] Board variant to apply variant: '' # Diff: @@ -842,9 +909,9 @@ outputs: # changes are red, but you can abort if the difference is bigger than certain threshold. # The '2color' mode is like 'red_green', but you can customize the colors diff_mode: 'red_green' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=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 # to do a checkout, even after stashing, this option can workaround the problem. @@ -886,9 +953,9 @@ outputs: output: '%f-%i%I%v.%x' # [boolean=true] Compare the PCB, otherwise compare the schematic pcb: true - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [number=0] [0,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. # KiBot will return error level 29 and the diff generation will be aborted @@ -910,11 +977,17 @@ outputs: type: 'download_datasheets' dir: 'Example/download_datasheets_dir' options: + # [boolean=false] Use the reference to classify the components in different sub-dirs. + # In this way C7 will go into a Capacitors sub-dir, R3 into Resistors, etc + classify: false + # [string_dict={}] Extra reference associations used to classify the references. + # They are pairs `Reference prefix` -> `Sub-dir` + classify_extra: {} # [boolean=false] Include the DNF components dnf: false - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='Datasheet'] Name of the field containing the URL field: 'Datasheet' # [boolean=true] Instead of download things we already downloaded use symlinks @@ -922,9 +995,9 @@ outputs: # [string='${VALUE}.pdf'] Name used for the downloaded datasheet. # `${FIELD}` will be replaced by the FIELD content output: '${VALUE}.pdf' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [boolean=false] Download URLs that we already downloaded. # It only makes sense if the `output` field makes their output different repeated: false @@ -938,16 +1011,16 @@ outputs: type: 'dxf' dir: 'Example/dxf_dir' options: - # [list(dict)] A list of customized reports for the manufacturer + # [list(dict)=[]] A list of customized reports for the manufacturer custom_reports: # [string=''] Content for the report. Use ``${basename}`` for the project name without extension. # Use ``${filename(LAYER)}`` for the file corresponding to LAYER - content: '' # [string='Custom_report.txt'] File name for the custom report output: 'Custom_report.txt' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale) drill_marks: 'full' # [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot @@ -983,9 +1056,9 @@ outputs: # [boolean=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) polygon_mode: true - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [number=1] Scale factor (0 means autoscaling) scaling: 1 # [number=0.1] Line width for the sketched pads [mm], see `sketch_pads_on_fab_layers` (KiCad 6+) @@ -1018,18 +1091,18 @@ outputs: background_color: false # [string=''] Color theme used, this must exist in the KiCad config (KiCad 6) color_theme: '' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Include the frame and title block frame: true # [boolean=false] Generate a monochromatic output monochrome: false # [string='%f-%i%I%v.%x'] Filename for the output DXF (%i=schematic, %x=dxf). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] 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 # file is available @@ -1048,12 +1121,12 @@ outputs: type: 'excellon' dir: 'Example/excellon_dir' options: - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [number=0] number of digits for integer part of coordinates (0 is auto) left_digits: 0 - # [dict|string] [hpgl,ps,gerber,dxf,svg,pdf] Format for a graphical drill map. + # [dict|string='None'] [hpgl,ps,gerber,dxf,svg,pdf,None] Format for a graphical drill map. # Not generated unless a format is specified map: # [string='%f-%i%I%v.%x'] Name for the map file, KiCad defaults if empty (%i='PTH_drill_map'). Affected by global options @@ -1070,14 +1143,14 @@ outputs: npth_id: null # [string='%f-%i%I%v.%x'] name for the drill file, KiCad defaults if empty (%i='PTH_drill'). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [boolean=true] Generate one file for both, plated holes and non-plated holes, instead of two separated files pth_and_npth_single_file: true # [string] Force this replacement for %i when generating PTH and unified files pth_id: null - # [dict|string] Name of the drill report. Not generated unless a name is specified + # [dict|string=''] Name of the drill report. Not generated unless a name is specified report: # [string=''] Name of the drill report. Not generated unless a name is specified. # (%i='drill_report' %x='txt') @@ -1103,18 +1176,18 @@ outputs: options: # [boolean=false] Use auxiliary axis as origin aux_origin: false - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=false] Flip bottom footprint padstacks flip_bottom_padstacks: false # [boolean=false] Generate a new shape for each footprint instance (Do not reuse shapes) no_reuse_shapes: false # [string='%f-%i%I%v.%x'] Filename for the output (%i=gencad, %x=cad). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [boolean=false] Save the origin coordinates in the file save_origin: false # [boolean=false] Generate unique pin names @@ -1130,10 +1203,10 @@ outputs: type: 'gerb_drill' dir: 'Example/gerb_drill_dir' options: - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' - # [dict|string] [hpgl,ps,gerber,dxf,svg,pdf] Format for a graphical drill map. + dnf_filter: '_null' + # [dict|string='None'] [hpgl,ps,gerber,dxf,svg,pdf,None] Format for a graphical drill map. # Not generated unless a format is specified map: # [string='%f-%i%I%v.%x'] Name for the map file, KiCad defaults if empty (%i='PTH_drill_map'). Affected by global options @@ -1144,12 +1217,12 @@ outputs: npth_id: null # [string='%f-%i%I%v.%x'] name for the drill file, KiCad defaults if empty (%i='PTH_drill'). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string] Force this replacement for %i when generating PTH and unified files pth_id: null - # [dict|string] Name of the drill report. Not generated unless a name is specified + # [dict|string=''] Name of the drill report. Not generated unless a name is specified report: # [string=''] Name of the drill report. Not generated unless a name is specified. # (%i='drill_report' %x='txt') @@ -1170,7 +1243,7 @@ outputs: # [boolean=true] Creates a file with information about all the generated gerbers. # You can use it in gerbview to load all gerbers at once create_gerber_job_file: true - # [list(dict)] A list of customized reports for the manufacturer + # [list(dict)=[]] A list of customized reports for the manufacturer custom_reports: # [string=''] Content for the report. Use ``${basename}`` for the project name without extension. # Use ``${filename(LAYER)}`` for the file corresponding to LAYER @@ -1179,9 +1252,9 @@ outputs: output: 'Custom_report.txt' # [boolean=false] Disable aperture macros (workaround for buggy CAM software) (KiCad 6) disable_aperture_macros: false - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot edge_cut_extension: '' # [boolean=true] Do not include the PCB edge layer @@ -1192,7 +1265,7 @@ outputs: force_plot_invisible_refs_vals: false # [string='%f-%i%I%v.%x'] Name for the gerber job file (%i='job', %x='gbrjob'). Affected by global options gerber_job_file: '%f-%i%I%v.%x' - # [number=4.6] This the gerber coordinate format, can be 4.5 or 4.6 + # [number=4.6] [4.5;4.6] This is the gerber coordinate format, can be 4.5 or 4.6 gerber_precision: 4.6 # [string=''] Used to change the Protel style extensions for inner layers. # The replacement pattern can contain %n for the inner layer number and %N for the layer number. @@ -1213,9 +1286,9 @@ outputs: # (i.e. always the default worksheet style, also problems expanding text variables). # The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs plot_sheet_reference: false - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [number=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) sketch_pad_line_width: 0.1 @@ -1246,16 +1319,16 @@ outputs: type: 'hpgl' dir: 'Example/hpgl_dir' options: - # [list(dict)] A list of customized reports for the manufacturer + # [list(dict)=[]] A list of customized reports for the manufacturer custom_reports: # [string=''] Content for the report. Use ``${basename}`` for the project name without extension. # Use ``${filename(LAYER)}`` for the file corresponding to LAYER - content: '' # [string='Custom_report.txt'] File name for the custom report output: 'Custom_report.txt' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale) drill_marks: 'full' # [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot @@ -1294,9 +1367,9 @@ outputs: # (i.e. always the default worksheet style, also problems expanding text variables). # The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs plot_sheet_reference: false - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [number=0] Scale factor (0 means autoscaling) scaling: 0 # [number=0.1] Line width for the sketched pads [mm], see `sketch_pads_on_fab_layers` (KiCad 6+) @@ -1327,9 +1400,9 @@ outputs: background_color: false # [string=''] Color theme used, this must exist in the KiCad config (KiCad 6) color_theme: '' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Include the frame and title block frame: true # [boolean=false] Generate a monochromatic output @@ -1340,9 +1413,9 @@ outputs: output: '%f-%i%I%v.%x' # [number=0.4826] Pen size (diameter) [mm] pen_size: 0.4826 - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] 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 # file is available @@ -1375,10 +1448,10 @@ outputs: checkboxes: 'Sourced,Placed' # [boolean=false] Default to dark mode dark_mode: false - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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. # Avoid using it in conjunction with IBoM native filtering options - dnf_filter: '_none' + dnf_filter: '_null' # [string=''] Name of the extra field that indicates do not populate status. # Components with this field not empty will be blacklisted. # IBoM option, avoid using in conjunction with KiBot variants/filters @@ -1402,7 +1475,7 @@ outputs: hide_pads: false # [boolean=false] Hide silkscreen by default hide_silkscreen: false - # [boolean|none,all,selected] Highlight pin1 by default + # [boolean|string=false] [none,all,selected] Highlight pin1 by default highlight_pin1: false # [boolean=false] Include netlist information in output. include_nets: false @@ -1435,9 +1508,9 @@ outputs: offset_back_rotation: false # [string='%f-%i%I%v.%x'] Filename for the output, use '' to use the IBoM filename (%i=ibom, %x=html). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [boolean=false] Show fabrication layer by default show_fabrication: false # [string=''] Comma separated list of fields to show in the BOM. @@ -1482,10 +1555,10 @@ outputs: type: 'kibom' dir: 'Example/kibom_dir' options: - # [string|dict] BoM configuration file, relative to PCB. Environment variables and ~ allowed. + # [string|dict='bom.ini'] BoM configuration file, relative to PCB. Environment variables and ~ allowed. # You can also define the configuration here, will be stored in `config.kibom.ini` conf: - # [list(dict)|list(string)] List of columns to display. + # [list(dict)|list(string)=[]] List of columns to display. # Can be just the name of the field columns: # [string=''] Name of the field to use for this column. @@ -1510,10 +1583,10 @@ outputs: datasheet_as_link: '' # [string|list(string)=''] Column/s containing Digi-Key part numbers, will be linked to web page (HTML only) digikey_link: '' - # [list(dict)] A series of regular expressions used to exclude parts. + # [list(dict)=[]] A series of regular expressions used to exclude parts. # If a component matches ANY of these, it will be excluded. # Column names are case-insensitive. - # If empty the following list is used: + # If empty the following list is used by KiBoM: # - column: References # regex: '^TP[0-9]*' # - column: References @@ -1533,7 +1606,7 @@ outputs: exclude_any: # [string=''] Name of the column to apply the regular expression. # Use `_field_lcsc_part` to get the value defined in the global options - - column: '' + - column: 'References' # `field` is an alias for `column` # [string=''] Regular expression to match regex: '' @@ -1555,18 +1628,21 @@ outputs: html_generate_dnf: true # [boolean=true] Exclude DNF (Do Not Fit) components ignore_dnf: true - # [list(dict)] A series of regular expressions used to select included parts. + # [list(dict)=[]] A series of regular expressions used to select included parts. # If there are any regex defined here, only components that match against ANY of them will be included. # Column names are case-insensitive. # If empty all the components are included include_only: # [string=''] Name of the column to apply the regular expression. # Use `_field_lcsc_part` to get the value defined in the global options - - column: '' + - column: 'References' # `field` is an alias for `column` # [string=''] Regular expression to match regex: '' # `regexp` is an alias for `regex` + # [boolean|string|list(string)=''] Column/s containing LCSC part numbers, will be linked to web page. + # Use **true** to copy the value indicated by the `field_lcsc_part` global option + lcsc_link: '' # [boolean=true] Component groups with blank fields will be merged into the most compatible group, where possible merge_blank_fields: true # [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page (HTML only) @@ -1608,24 +1684,24 @@ outputs: options: # [string='full'] [full,basic,none] Which controls are displayed controls: 'full' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Show the download button download: true # [boolean=true] Download the script and use a copy local_script: true # [boolean=true] Show the overlay asking to click overlay: true - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string|list(string)] [schematic,pcb,project] Source to display source: 'schematic' # [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. # If it starts with `+` the text is concatenated title: '' - # URL for the KiCanvas script + # [string='https://kicanvas.org/kicanvas/kicanvas.js'] URL for the KiCanvas script url_script: 'https://kicanvas.org/kicanvas/kicanvas.js' # [string=''] Board variant to apply variant: '' @@ -1638,51 +1714,57 @@ outputs: type: 'kicost' dir: 'Example/kicost_dir' options: - # [list(dict)] Add components from other projects + # [list(dict)=[]] Add components from other projects aggregate: # `board_qty` is an alias for `number` # [string=''] Name of the XML to aggregate - - file: '' + - file: 'netlist.xml' # [number=100] Number of boards to build (components multiplier) number: 100 # [string=' '] Variant for this project variant: ' ' # `board_qty` is an alias for `number` - # [string|list(string)=USD] Currency priority. Use ISO4217 codes (i.e. USD, EUR) - currency: USD - # [string|list(string)] Include this distributors list. Default is all the available - distributors: - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='USD'] Currency priority. Use ISO4217 codes (i.e. USD, EUR) + currency: 'USD' + # [string|list(string)=[]] Include this distributors list. Default is all the available + distributors: [] + # [string|list(string)='_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. # Don't use the `kicost_variant` when using internal variants/filters - dnf_filter: '_none' - # [string|list(string)] List of fields to be added to the global data section - fields: - # [string|list(string)] List of fields that can be different for a group. + dnf_filter: '_null' + # [string|list(string)=[]] {comma_sep} List of fields to be added to the global data section + fields: [] + # [string|list(string)=[]] {comma_sep} List of fields that can be different for a group. # Parts with differences in these fields are grouped together, but displayed individually - group_fields: - # [string|list(string)] List of fields to be ignored - ignore_fields: + group_fields: [] + # [string|list(string)=[]] {comma_sep} List of fields to be ignored + ignore_fields: [] + # [string=''] KiCost configuration file. It contains the keys for the different distributors APIs. + # The regular KiCost config is used when empty. + # Important for CI/CD environments: avoid exposing your API secrets! + # To understand how to achieve this, and also how to make use of the cache please visit the + # [kicost_ci_test](https://github.com/set-soft/kicost_ci_test) repo + kicost_config: '' # [string=''] Regular expression to match the variant field (KiCost option, not internal variants) kicost_variant: '' # [boolean=false] Do not collapse the part references (collapse=R1-R4) no_collapse: false - # [string|list(string)] Exclude this distributors list. They are removed after computing `distributors` - no_distributors: + # [string|list(string)=[]] Exclude this distributors list. They are removed after computing `distributors` + no_distributors: [] # [boolean=false] Do not look for components price. For testing purposes no_price: false # [number=100] Number of boards to build (components multiplier) number: 100 # [string='%f-%i%I%v.%x'] Filename for the output (%i=kicost, %x=xlsx). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [boolean=false] Include the catalogue links in the catalogue code show_cat_url: false - # [string|list(string)] Declare part fields to include in multipart split process - split_extra_fields: - # [list(dict)] Fields to rename (KiCost option, not internal filters) + # [string|list(string)=[]] {comma_sep} Declare part fields to include in multipart split process + split_extra_fields: [] + # [list(dict)=[]] Fields to rename (KiCost option, not internal filters) translate_fields: # [string=''] Name of the field to rename - field: 'mpn' @@ -1699,7 +1781,7 @@ outputs: type: 'kikit_present' dir: 'Example/kikit_present_dir' options: - # [dict|list(dict)] One or more boards that compose your project. + # [dict|list(dict)=[{}]] One or more boards that compose your project. # When empty we will use only the main PCB for the current project boards: # [string=''] How to obtain the back view of the PCB. @@ -1754,7 +1836,8 @@ outputs: # [string=''] Name for a markdown file containing the main part of the page to be generated. # This is mandatory and is the description of your project. # You can embed the markdown code. If the text doesn't map to a file and contains - # more than one line KiBot will assume this is the markdown + # more than one line KiBot will assume this is the markdown. + # If empty KiBot will generate a silly text and a warning description: '' # [string=''] Name of the project. Will be passed to the template. # If empty we use the name of the KiCad project. @@ -1791,16 +1874,16 @@ outputs: # To use the KiCad 6 default colors select `_builtin_default`. # Usually user colors are stored as `user`, but you can give it another name color_theme: '_builtin_classic' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=false] Avoid PCB and SCH images regeneration. Useful for incremental usage keep_generated: false # [number=0] Maximum number of commits to include. Use 0 for all available commits max_commits: 0 - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string='HEAD'] Starting point for the commits, can be a branch, a hash, etc. # Note that this can be a revision-range, consult the gitrevisions manual for more information revision: 'HEAD' @@ -1848,18 +1931,18 @@ outputs: type: 'netlist' dir: 'Example/netlist_dir' options: - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='classic'] [classic,ipc] The `classic` format is the KiCad internal format, and is generated # from the schematic. The `ipc` format is the IPC-D-356 format, useful for PCB # testing, is generated from the PCB format: 'classic' # [string='%f-%i%I%v.%x'] Filename for the output (%i=netlist/IPC-D-356, %x=net/d356). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] Board variant to apply. # Used for sub-PCBs variant: '' @@ -1878,39 +1961,39 @@ outputs: type: 'panelize' dir: 'Example/panelize_dir' options: - # [list(dict)|list(string)|string] One or more configurations used to create the panel. + # [list(dict)|list(string)|string=[]] One or more configurations used to create the panel. # Use a string to include an external configuration, i.e. `myDefault.json`. # You can also include a preset using `:name`, i.e. `:vcuts`. # Use a dict to specify the options using the KiBot YAML file configs: - # [dict] Fill non-board areas of the panel with copper + # [dict=null] Fill non-board areas of the panel with copper - copperfill: - # [number|string] Extra clearance from the board perimeters. Suitable for, e.g., not filling the tabs with + # [number|string=0.5] Extra clearance from the board perimeters. Suitable for, e.g., not filling the tabs with # copper clearance: 0.5 - # [number|string] Diameter of hexagons + # [number|string=7] Diameter of hexagons diameter: 7 # `edge_clearance` is an alias for `edgeclearance` - # [number|string] Specifies clearance between the fill and panel perimeter + # [number|string=0.5] Specifies clearance between the fill and panel perimeter edgeclearance: 0.5 - # [string|list(string)] List of layers to fill. Can be a comma-separated string. + # [string|list(string)='F.Cu,B.Cu'] {comma_sep} List of layers to fill. Can be a comma-separated string. # Using *all* means all external copper layers layers: 'F.Cu,B.Cu' - # [number|string] The orientation of the hatched strokes + # [number|string=45] The orientation of the hatched strokes orientation: 45 - # [number|string] The space between the hatched strokes or hexagons + # [number|string=1] The space between the hatched strokes or hexagons spacing: 1 # [number=15] Remove fragments smaller than threshold. Expressed as a percentage threshold: 15 # [string='none'] [none,solid,hatched,hex] How to fill non-board areas of the panel with copper type: 'none' - # [number|string] The width of the hatched strokes + # [number|string=1] The width of the hatched strokes width: 1 - # [dict] Specify how to perform the cuts on the tabs separating the board + # [dict=null] Specify how to perform the cuts on the tabs separating the board cuts: # [string=''] Argument to pass to the plugin. Used for *plugin* arg: '' - # [number|string] Specify clearance for copper around V-cuts + # [number|string=0] Specify clearance for copper around V-cuts clearance: 0 # [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin* code: '' @@ -1918,23 +2001,23 @@ outputs: # [boolean=false] Specify if curves should be approximated by straight cuts (e.g., for cutting tabs on circular boards). # Used for *vcuts* cutcurves: false - # [number|string] Drill size used for the *mousebites* + # [number|string=0.5] Drill size used for the *mousebites* drill: 0.5 # `end_prolongation` is an alias for `endprolongation` - # [number|string] Prolongation on the end of V-CUT without text + # [number|string=3] Prolongation on the end of V-CUT without text endprolongation: 3 # [string='Cmts.User'] Specify the layer to render V-cuts on. Also used for the *layer* type layer: 'Cmts.User' # `line_width` is an alias for `linewidth` - # [number|string] Line width to plot cuts with + # [number|string=0.3] Line width to plot cuts with linewidth: 0.3 - # [number|string] Specify the *mousebites* and *vcuts* offset, positive offset puts the cuts into the board, + # [number|string=0] Specify the *mousebites* and *vcuts* offset, positive offset puts the cuts into the board, # negative puts the cuts into the tabs offset: 0 - # [number|string] Distance for tangential prolongation of the cuts (to cut through the internal corner fillets + # [number|string=0] Distance for tangential prolongation of the cuts (to cut through the internal corner fillets # caused by milling). Used for *mousebites* and *layer* prolong: 0 - # [number|string] The spacing of the holes used for the *mousebites* + # [number|string=0.8] The spacing of the holes used for the *mousebites* spacing: 0.8 # [string='V-CUT'] Text template for the V-CUT template: 'V-CUT' @@ -1942,18 +2025,18 @@ outputs: # `text_prolongation` is an alias for `textprolongation` # `text_size` is an alias for `textsize` # `text_thickness` is an alias for `textthickness` - # [number|string] Text offset from the V-CUT + # [number|string=3] Text offset from the V-CUT textoffset: 3 - # [number|string] Prolongation of the text size of V-CUT + # [number|string=3] Prolongation of the text size of V-CUT textprolongation: 3 # [number|string] Text size for vcuts textsize: 2 - # [number|string] Text thickness for width + # [number|string=0.3] Text thickness for width textthickness: 0.3 # [string='none'] [none,mousebites,vcuts,layer,plugin] Layer: When KiKit reports it cannot perform cuts, you can render the cuts # into a layer with this option to understand what's going on. Shouldn't be used for the final design type: 'none' - # [dict] Debug options + # [dict=null] Debug options debug: # [boolean=false] Deterministic deterministic: false @@ -1971,31 +2054,31 @@ outputs: expand_text: true # [string=''] A configuration to use as base for this one. Use the following format: `OUTPUT_NAME[CFG_NAME]` extends: '' - # [dict] Used to add fiducial marks to the (rail/frame of) the panel + # [dict=null] Used to add fiducial marks to the (rail/frame of) the panel fiducials: # `copper_size` is an alias for `coppersize` - # [number|string] Diameter of the copper spot + # [number|string=1] Diameter of the copper spot coppersize: 1 - # [number|string] Horizontal offset from panel edges + # [number|string=0] Horizontal offset from panel edges hoffset: 0 - # [number|string] Diameter of the solder mask opening + # [number|string=1] Diameter of the solder mask opening opening: 1 # [boolean=false] Include the fiducials in the paste layer (therefore they appear on the stencil) paste: false # [string='none'] [none,3fid,4fid,plugin] Add none, 3 or 4 fiducials to the (rail/frame of) the panel type: 'none' - # [number|string] Vertical offset from panel edges + # [number|string=0] Vertical offset from panel edges voffset: 0 - # [dict] Specify the frame around the boards + # [dict=null] Specify the frame around the boards framing: # [string=''] Argument to pass to the plugin. Used for *plugin* arg: '' - # [number|string] Specify the size of chamfer frame corners. You can also separately specify `chamferwidth` + # [number|string=0] Specify the size of chamfer frame corners. You can also separately specify `chamferwidth` # and `chamferheight` to create a non 45 degrees chamfer chamfer: 0 # `chamfer_height` is an alias for `chamferheight` # `chamfer_width` is an alias for `chamferwidth` - # [number|string] Height of the chamfer frame corners, used for non 45 degrees chamfer + # [number|string=0] Height of the chamfer frame corners, used for non 45 degrees chamfer chamferheight: 0 # [number|string] Width of the chamfer frame corners, used for non 45 degrees chamfer chamferwidth: 0 @@ -2004,29 +2087,29 @@ outputs: # [string='both'] [none,both,v,h] Specify whether to add cuts to the corners of the frame for easy removal. # Used for *frame* cuts: 'both' - # [number|string] Specify radius of fillet frame corners + # [number|string=0] Specify radius of fillet frame corners fillet: 0 - # [number|string] Specify the horizontal space between PCB and the frame/rail + # [number|string=2] Specify the horizontal space between PCB and the frame/rail hspace: 2 # `max_total_height` is an alias for `maxtotalheight` # `max_total_width` is an alias for `maxtotalwidth` - # [number|string] Maximal height of the panel + # [number|string=10000] Maximal height of the panel maxtotalheight: 10000 - # [number|string] Maximal width of the panel + # [number|string=10000] Maximal width of the panel maxtotalwidth: 10000 # `min_total_height` is an alias for `mintotalheight` # `min_total_width` is an alias for `mintotalwidth` - # [number|string] If needed, add extra material to the rail or frame to meet the minimal requested size. + # [number|string=0] If needed, add extra material to the rail or frame to meet the minimal requested size. # Useful for services that require minimal panel size mintotalheight: 0 - # [number|string] If needed, add extra material to the rail or frame to meet the minimal requested size. + # [number|string=0] If needed, add extra material to the rail or frame to meet the minimal requested size. # Useful for services that require minimal panel size mintotalwidth: 0 # `slot_width` is an alias for `slotwidth` - # [number|string] Width of the milled slot for *tightframe* + # [number|string=2] Width of the milled slot for *tightframe* slotwidth: 2 - # [number|string] Specify the space between PCB and the frame/rail. Overrides `hspace` and `vspace` - space: null + # [number|string=2] Specify the space between PCB and the frame/rail. Overrides `hspace` and `vspace` + space: 2 # [string='none'] [none,railstb,railslr,frame,tightframe,plugin] Railstb: Add rails on top and bottom. # Railslr: Add rails on left and right. # Frame: Add a frame around the board. @@ -2034,11 +2117,11 @@ outputs: # the boards have just a milled slot around their perimeter. # Plugin: Uses an external python function, only `code` and `arg` are relevant type: 'none' - # [number|string] Specify the vertical space between PCB and the frame/rail + # [number|string=2] Specify the vertical space between PCB and the frame/rail vspace: 2 - # [number|string] Specify with of the rails or frame + # [number|string=5] Specify with of the rails or frame width: 5 - # [dict] Layout used for the panel + # [dict=null] Layout used for the panel layout: # [string='none'] [none,rows,cols,rowsCols] Specify alternations of board rotation. # none: Do not alternate. @@ -2059,7 +2142,7 @@ outputs: # `h_bone_cut` is an alias for `hbonecut` # `h_bone_first` is an alias for `hbonefirst` # `h_bone_skip` is an alias for `hboneskip` - # [number|string] The width of horizontal backbone (0 means no backbone). The backbone does not increase the + # [number|string=0] The width of horizontal backbone (0 means no backbone). The backbone does not increase the # spacing of the boards hbackbone: 0 # [boolean=true] If there are both backbones specified, specifies if there should be a horizontal cut where the backbones @@ -2069,7 +2152,7 @@ outputs: hbonefirst: 0 # [number=0] Skip every n horizontal backbones. I.e., 1 means place only every other backbone hboneskip: 0 - # [number|string] Specify the horizontal gap between the boards + # [number|string=0] Specify the horizontal gap between the boards hspace: 0 # `rename_net` is an alias for `renamenet` # `rename_ref` is an alias for `renameref` @@ -2078,19 +2161,19 @@ outputs: # [string='{orig}'] A pattern by which to rename the references. You can use {n} and {orig} to get the board number and original # name renameref: '{orig}' - # [number|string] Rotate the boards before placing them in the panel + # [number|string=0] Rotate the boards before placing them in the panel rotation: 0 # [number=1] Specify the number of rows of boards in the grid pattern rows: 1 - # [number|string] Specify the gap between the boards, overwrites `hspace` and `vspace` - space: null + # [number|string=0] Specify the gap between the boards, overwrites `hspace` and `vspace` + space: 0 # [string='grid'] [grid,plugin] In the plugin type only `code` and `arg` are relevant type: 'grid' # `v_back_bone` is an alias for `vbackbone` # `v_bone_cut` is an alias for `vbonecut` # `v_bone_first` is an alias for `vbonefirst` # `v_bone_skip` is an alias for `vboneskip` - # [number|string] The width of vertical backbone (0 means no backbone). The backbone does not increase the + # [number|string=0] The width of vertical backbone (0 means no backbone). The backbone does not increase the # spacing of the boards vbackbone: 0 # [boolean=true] If there are both backbones specified, specifies if there should be a vertical cut where the backbones @@ -2100,24 +2183,24 @@ outputs: vbonefirst: 0 # [number=0] Skip every n vertical backbones. I.e., 1 means place only every other backbone vboneskip: 0 - # [number|string] Specify the vertical gap between the boards + # [number|string=0] Specify the vertical gap between the boards vspace: 0 # [string=''] A name to identify this configuration. If empty will be the order in the list, starting with 1. # Don't use just a number or it will be confused as an index name: '' - # [dict] Sets page size on the resulting panel and position the panel in the page + # [dict=null] Sets page size on the resulting panel and position the panel in the page page: # [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Point of the panel to be placed at given position. Can be one of tl, tr, bl, br # (corners), mt, mb, ml, mr (middle of sides), c (center). The anchors refer to the panel outline anchor: 'mt' - # [number|string] Height for the `custom` paper size + # [number|string=210] Height for the `custom` paper size height: 210 # `page_size` is an alias for `type` # `pos_x` is an alias for `posx` # `pos_y` is an alias for `posy` - # [number|string] The X position of the panel on the page. Can be expressed as a page size percentage + # [number|string='50%'] The X position of the panel on the page. Can be expressed as a page size percentage posx: '50%' - # [number|string] The Y position of the panel on the page. Can be expressed as a page size percentage + # [number|string=20] The Y position of the panel on the page. Can be expressed as a page size percentage posy: 20 # `size` is an alias for `type` # [string='inherit'] [inherit,custom,A0,A1,A2,A3,A4,A5,A,B,C,D,E,USLetter,USLegal,USLedger,A0-portrait,A1-portrait,A2-portrait, @@ -2125,23 +2208,23 @@ outputs: # USLetter-portrait,USLegal-portrait,USLedger-portrait] Paper size. The default `inherit` option inherits # paper size from the source board. This feature is not supported on KiCAD 5 type: 'inherit' - # [number|string] Width for the `custom` paper size + # [number|string=297] Width for the `custom` paper size width: 297 - # [dict] Finishing touches to the panel + # [dict=null] Finishing touches to the panel post: # [boolean=false] Fill tabs and frame with copper (e.g., to save etchant or to increase rigidity of flex-PCB panels) copperfill: false # [boolean=false] Draw dimensions with the panel size. dimensions: false # `edge_width` is an alias for `edgewidth` - # [number|string] Specify line width for the Edge.Cuts of the panel + # [number|string=0.1] Specify line width for the Edge.Cuts of the panel edgewidth: 0.1 # `mill_radius` is an alias for `millradius` # `mill_radius_outer` is an alias for `millradiusouter` - # [number|string] Simulate the milling operation (add fillets to the internal corners). + # [number|string=0] Simulate the milling operation (add fillets to the internal corners). # Specify mill radius (usually 1 mm). 0 radius disables the functionality millradius: 0 - # [number|string] Like `millradius`, but modifies only board outer counter. + # [number|string=0] Like `millradius`, but modifies only board outer counter. # No internal features of the board are affected millradiusouter: 0 # [string='tl'] [tl,tr,bl,br,mt,mb,ml,mr,c] Specify if the auxiliary origin an grid origin should be placed. @@ -2168,41 +2251,41 @@ outputs: scriptarg: '' # [string='auto'] [auto] Currently fixed type: 'auto' - # [dict] Used to adjust details of which part of the PCB is panelized + # [dict=null] Used to adjust details of which part of the PCB is panelized source: - # [number|string] Bottom right X coordinate of the rectangle used. Used for *rectangle* + # [number|string=0] Bottom right X coordinate of the rectangle used. Used for *rectangle* brx: 0 - # [number|string] Bottom right Y coordinate of the rectangle used. Used for *rectangle* + # [number|string=0] Bottom right Y coordinate of the rectangle used. Used for *rectangle* bry: 0 # [string=''] Reference for the kikit:Board footprint used to select the contour. Used for *annotation* ref: '' # [string='inherit'] [inherit,2layer,4layer,6layer] Used to reduce the number of layers used for the panel stack: 'inherit' - # [number|string] Top left X coordinate of the rectangle used. Used for *rectangle* + # [number|string=0] Top left X coordinate of the rectangle used. Used for *rectangle* tlx: 0 - # [number|string] Top left Y coordinate of the rectangle used. Used for *rectangle* + # [number|string=0] Top left Y coordinate of the rectangle used. Used for *rectangle* tly: 0 - # [number|string] Extra space around the PCB reported size to be included. Used for *auto* and *annotation* + # [number|string=1] Extra space around the PCB reported size to be included. Used for *auto* and *annotation* tolerance: 1 # [string='auto'] [auto,rectangle,annotation] How we select the area of the PCB used for the panelization. # *auto* uses all the area reported by KiCad, *rectangle* a specified rectangle and # *annotation* selects a contour marked by a kikit:Board footprint type: 'auto' - # [dict] Style of the tabs used to join the PCB copies + # [dict=null] Style of the tabs used to join the PCB copies tabs: # [string=''] Argument to pass to the plugin. Used for *plugin* arg: '' # [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin* code: '' - # [number|string] When your design features open pockets on the side, this parameter specifies extra cutout + # [number|string=1] When your design features open pockets on the side, this parameter specifies extra cutout # depth in order to ensure that a sharp corner of the pocket can be milled. Used for *full* cutout: 1 # [number=1] Number of tabs in the horizontal direction. Used for *fixed* hcount: 1 - # [number|string] The width of tabs in the horizontal direction. Used for *fixed* and *spacing* + # [number|string=3] The width of tabs in the horizontal direction. Used for *fixed* and *spacing* hwidth: 3 # `min_distance` is an alias for `mindistance` - # [number|string] Minimal spacing between the tabs. If there are too many tabs, their count is reduced. + # [number|string=0] Minimal spacing between the tabs. If there are too many tabs, their count is reduced. # Used for *fixed* mindistance: 0 # `patch_corners` is an alias for `patchcorners` @@ -2210,7 +2293,7 @@ outputs: # add patches of substrate to these corners. However, if the PCB has fillet or miter, you don't want to # apply the patches patchcorners: true - # [number|string] The maximum spacing of the tabs. Used for *spacing* + # [number|string=10] The maximum spacing of the tabs. Used for *spacing* spacing: 10 # `tab_footprints` is an alias for `tabfootprints` # [string='kikit:Tab'] The footprint/s used for the *annotation* type. You can specify a list of footprints separated by comma @@ -2224,25 +2307,25 @@ outputs: type: 'spacing' # [number=1] Number of tabs in the vertical direction. Used for *fixed* vcount: 1 - # [number|string] The width of tabs in the vertical direction. Used for *fixed* and *spacing* + # [number|string=3] The width of tabs in the vertical direction. Used for *fixed* and *spacing* vwidth: 3 - # [number|string] The width of tabs in both directions. Overrides both `vwidth` and `hwidth`. + # [number|string=3] The width of tabs in both directions. Overrides both `vwidth` and `hwidth`. # Used for *fixed*, *spacing*, *corner* and *annotation* - width: null - # [dict] Used to add text to the panel + width: 3 + # [dict=null] Used to add text to the panel text: # [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Origin of the text. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr # (middle of sides), c (center). The anchors refer to the panel outline anchor: 'mt' - # [number|string] Height of the characters (the same parameters as KiCAD uses) + # [number|string=1.5] Height of the characters (the same parameters as KiCAD uses) height: 1.5 # [string='center'] [left,right,center] Horizontal justification of the text hjustify: 'center' - # [number|string] Specify the horizontal offset from anchor. Respects KiCAD coordinate system + # [number|string=0] Specify the horizontal offset from anchor. Respects KiCAD coordinate system hoffset: 0 # [string='F.SilkS'] Specify text layer layer: 'F.SilkS' - # [number|string] Specify the orientation (angle) + # [number|string=0] Specify the orientation (angle) orientation: 0 # [string=''] Specify the plugin that provides extra variables for the text plugin: '' @@ -2255,30 +2338,30 @@ outputs: # *boardCompany* the company from the source board, # *boardComment1*-*boardComment9* comments from the source board text: '' - # [number|string] Stroke thickness + # [number|string=0.3] Stroke thickness thickness: 0.3 # [string='none'] [none,simple] Currently fixed. BTW: don't ask me about this ridiculous default, is how KiKit works type: 'none' # [string='center'] [left,right,center] Vertical justification of the text vjustify: 'center' - # [number|string] Specify the vertical offset from anchor. Respects KiCAD coordinate system + # [number|string=0] Specify the vertical offset from anchor. Respects KiCAD coordinate system voffset: 0 - # [number|string] Width of the characters (the same parameters as KiCAD uses) + # [number|string=1.5] Width of the characters (the same parameters as KiCAD uses) width: 1.5 - # [dict] Used to add text to the panel + # [dict=null] Used to add text to the panel text2: # [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Origin of the text. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr # (middle of sides), c (center). The anchors refer to the panel outline anchor: 'mt' - # [number|string] Height of the characters (the same parameters as KiCAD uses) + # [number|string=1.5] Height of the characters (the same parameters as KiCAD uses) height: 1.5 # [string='center'] [left,right,center] Horizontal justification of the text hjustify: 'center' - # [number|string] Specify the horizontal offset from anchor. Respects KiCAD coordinate system + # [number|string=0] Specify the horizontal offset from anchor. Respects KiCAD coordinate system hoffset: 0 # [string='F.SilkS'] Specify text layer layer: 'F.SilkS' - # [number|string] Specify the orientation (angle) + # [number|string=0] Specify the orientation (angle) orientation: 0 # [string=''] Specify the plugin that provides extra variables for the text plugin: '' @@ -2291,30 +2374,30 @@ outputs: # *boardCompany* the company from the source board, # *boardComment1*-*boardComment9* comments from the source board text: '' - # [number|string] Stroke thickness + # [number|string=0.3] Stroke thickness thickness: 0.3 # [string='none'] [none,simple] Currently fixed. BTW: don't ask me about this ridiculous default, is how KiKit works type: 'none' # [string='center'] [left,right,center] Vertical justification of the text vjustify: 'center' - # [number|string] Specify the vertical offset from anchor. Respects KiCAD coordinate system + # [number|string=0] Specify the vertical offset from anchor. Respects KiCAD coordinate system voffset: 0 - # [number|string] Width of the characters (the same parameters as KiCAD uses) + # [number|string=1.5] Width of the characters (the same parameters as KiCAD uses) width: 1.5 - # [dict] Used to add text to the panel + # [dict=null] Used to add text to the panel text3: # [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Origin of the text. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr # (middle of sides), c (center). The anchors refer to the panel outline anchor: 'mt' - # [number|string] Height of the characters (the same parameters as KiCAD uses) + # [number|string=1.5] Height of the characters (the same parameters as KiCAD uses) height: 1.5 # [string='center'] [left,right,center] Horizontal justification of the text hjustify: 'center' - # [number|string] Specify the horizontal offset from anchor. Respects KiCAD coordinate system + # [number|string=0] Specify the horizontal offset from anchor. Respects KiCAD coordinate system hoffset: 0 # [string='F.SilkS'] Specify text layer layer: 'F.SilkS' - # [number|string] Specify the orientation (angle) + # [number|string=0] Specify the orientation (angle) orientation: 0 # [string=''] Specify the plugin that provides extra variables for the text plugin: '' @@ -2327,30 +2410,30 @@ outputs: # *boardCompany* the company from the source board, # *boardComment1*-*boardComment9* comments from the source board text: '' - # [number|string] Stroke thickness + # [number|string=0.3] Stroke thickness thickness: 0.3 # [string='none'] [none,simple] Currently fixed. BTW: don't ask me about this ridiculous default, is how KiKit works type: 'none' # [string='center'] [left,right,center] Vertical justification of the text vjustify: 'center' - # [number|string] Specify the vertical offset from anchor. Respects KiCAD coordinate system + # [number|string=0] Specify the vertical offset from anchor. Respects KiCAD coordinate system voffset: 0 - # [number|string] Width of the characters (the same parameters as KiCAD uses) + # [number|string=1.5] Width of the characters (the same parameters as KiCAD uses) width: 1.5 - # [dict] Used to add text to the panel + # [dict=null] Used to add text to the panel text4: # [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Origin of the text. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr # (middle of sides), c (center). The anchors refer to the panel outline anchor: 'mt' - # [number|string] Height of the characters (the same parameters as KiCAD uses) + # [number|string=1.5] Height of the characters (the same parameters as KiCAD uses) height: 1.5 # [string='center'] [left,right,center] Horizontal justification of the text hjustify: 'center' - # [number|string] Specify the horizontal offset from anchor. Respects KiCAD coordinate system + # [number|string=0] Specify the horizontal offset from anchor. Respects KiCAD coordinate system hoffset: 0 # [string='F.SilkS'] Specify text layer layer: 'F.SilkS' - # [number|string] Specify the orientation (angle) + # [number|string=0] Specify the orientation (angle) orientation: 0 # [string=''] Specify the plugin that provides extra variables for the text plugin: '' @@ -2363,47 +2446,47 @@ outputs: # *boardCompany* the company from the source board, # *boardComment1*-*boardComment9* comments from the source board text: '' - # [number|string] Stroke thickness + # [number|string=0.3] Stroke thickness thickness: 0.3 # [string='none'] [none,simple] Currently fixed. BTW: don't ask me about this ridiculous default, is how KiKit works type: 'none' # [string='center'] [left,right,center] Vertical justification of the text vjustify: 'center' - # [number|string] Specify the vertical offset from anchor. Respects KiCAD coordinate system + # [number|string=0] Specify the vertical offset from anchor. Respects KiCAD coordinate system voffset: 0 - # [number|string] Width of the characters (the same parameters as KiCAD uses) + # [number|string=1.5] Width of the characters (the same parameters as KiCAD uses) width: 1.5 - # [dict] Used to add tooling holes to the (rail/frame of) the panel + # [dict=null] Used to add tooling holes to the (rail/frame of) the panel tooling: # [string=''] Argument to pass to the plugin. Used for *plugin* arg: '' # [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin* code: '' - # [number|string] Horizontal offset from panel edges + # [number|string=0] Horizontal offset from panel edges hoffset: 0 # [boolean=false] If True, the holes are included in the paste layer (therefore they appear on the stencil) paste: false - # [number|string] Diameter of the holes + # [number|string=1.152] Diameter of the holes size: 1.152 # `solder_mask_margin` is an alias for `soldermaskmargin` - # [number|string] Solder mask expansion/margin. Use 1.3mm for JLCPCB + # [number|string=0] Solder mask expansion/margin. Use 1.3mm for JLCPCB soldermaskmargin: 0 # [string='none'] [none,3hole,4hole,plugin] Add none, 3 or 4 holes to the (rail/frame of) the panel type: 'none' - # [number|string] Vertical offset from panel edges + # [number|string=0] Vertical offset from panel edges voffset: 0 # [boolean=false] Use PcbDraw to create a preview of the panel create_preview: false # [string='deg'] [deg,Ā°,rad] Angles used when omitted default_angles: 'deg' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='%f-%i%I%v.%x'] Filename for the output (%i=panel, %x=kicad_pcb). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. # If it starts with `+` the text is concatenated title: '' @@ -2430,22 +2513,21 @@ outputs: board_bounds_dir: 'layers' # [string='bounds'] Name of the bounds file board_bounds_file: 'bounds' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='%f-%i%I%v.%x'] Filename for the output (%i=pcb2blender, %x=pcb3d). Affected by global options output: '%f-%i%I%v.%x' # [boolean=true] Create the files containing the PCB pads information pads_info_create: true # [string='pads'] Sub-directory where the pads info files are stored pads_info_dir: 'pads' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' - # [list(string)|string=all] [none,all] List of components to include in the pads list, - # can be also a string for `none` or `all`. The default is `all`. - # Ranges like *R5-R10* are supported - show_components: all + pre_transform: '_null' + # [list(string)|string='all'] [none,all,*] List of components to include in the pads list, + # can be also a string for `none` or `all`. Ranges like *R5-R10* are supported + show_components: 'all' # [boolean=false] Create a file containing the board stackup stackup_create: false # [string='.'] Directory for the stackup file. Use 'layers' for 2.7+ @@ -2492,9 +2574,9 @@ outputs: colored_pads: true # [boolean=true] Plot vias in a different color. Like KiCad GUI does colored_vias: true - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [number=360] [36,1200] Resolution (Dots Per Inch) for the output file. Most objects are vectors, but thing # like the the solder mask are handled as images by the conversion tools dpi: 360 @@ -2542,12 +2624,14 @@ outputs: # [boolean=false] When enabled the %i is always `assembly`, the %x will be NN.FORMAT (i.e. 01.png). # Note: page numbers can be customized using the `page_id` option for each page page_number_as_extension: false - # [list(dict)] List of pages to include in the output document. + # [list(dict)=[]] List of pages to include in the output document. # Each page contains one or more layers of the PCB pages: - # [number=0] Horizontal margin used for the autoscaling mode [mm] + # [number=0] Horizontal margin used for the autoscaling mode [mm]. + # When not defined we use the default value for the output - autoscale_margin_x: 0 - # [number=0] Vertical margin used for the autoscaling mode [mm] + # [number=0] Vertical margin used for the autoscaling mode [mm]. + # When not defined we use the default value for the output autoscale_margin_y: 0 # [boolean=true] Change the drill holes to be colored instead of white colored_holes: true @@ -2558,7 +2642,8 @@ outputs: # [string='%ll'] Text to use for the `LAYER` in the title block. # All the expansions available for `sheet` are also available here layer_var: '%ll' - # [list(dict)|list(string)|string] List of layers printed in this page. + # [list(dict)|list(string)|string='all'] [all,selected,copper,technical,user,inners,outers,*] + # List of layers printed in this page. # Order is important, the last goes on top. # You can reuse other layers lists, some options aren't used here, but they are valid layers: @@ -2571,7 +2656,7 @@ outputs: # [boolean=false] Include references and values even when they are marked as invisible force_plot_invisible_refs_vals: false # [string=''] Name of the layer. As you see it in KiCad - layer: '' + layer: 'F.Cu' # [boolean=true] Include the footprint references plot_footprint_refs: true # [boolean=true] Include the footprint values @@ -2604,7 +2689,8 @@ outputs: # [boolean=true] If we will inherit the options of the layer we are replacing. # Disable it if you specify the options in `repeat_layers`, which is unlikely repeat_inherit: true - # [list(dict)|list(string)|string] List of layers to replace `repeat_for_layer`. + # [list(dict)|list(string)|string='inners'] [all,selected,copper,technical,user,inners,outers,*] + # List of layers to replace `repeat_for_layer`. # This can be used to generate a page for each copper layer, here you put `copper` repeat_layers: # [string=''] Color used for this layer. @@ -2616,7 +2702,7 @@ outputs: # [boolean=false] Include references and values even when they are marked as invisible force_plot_invisible_refs_vals: false # [string=''] Name of the layer. As you see it in KiCad - layer: '' + layer: 'F.Cu' # [boolean=true] Include the footprint references plot_footprint_refs: true # [boolean=true] Include the footprint values @@ -2627,7 +2713,7 @@ outputs: # [boolean=true] Use this layer for centering purposes. # You can invert the meaning using the `invert_use_for_center` option use_for_center: true - # [number=1.0] Scale factor (0 means autoscaling) + # [number=1.0] Scale factor (0 means autoscaling). When not defined we use the default value for the output scaling: 1.0 # [string='Assembly'] Text to use for the `SHEET` in the title block. # Pattern (%*) and text variables are expanded. @@ -2653,9 +2739,9 @@ outputs: plot_sheet_reference: true # [number=1280] [0,7680] Width of the PNG in pixels. Use 0 to use as many pixels as the DPI needs for the page size png_width: 1280 - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [boolean=true] Try to draw the solder mask as a real solder mask, not the negative used for fabrication. # In order to get a good looking select a color with transparency, i.e. '#14332440'. # PcbDraw must be installed in order to use this option @@ -2685,17 +2771,17 @@ outputs: options: # [boolean=true] Copy the KiCad project to the destination directory copy_project: true - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=false] Hide components in the Fab layer that are marked as excluded by a variant. # Affected by global options hide_excluded: false # [string='%f-%i%I%v.%x'] Filename for the output (%i=variant, %x=kicad_pcb). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. # If it starts with `+` the text is concatenated title: '' @@ -2722,9 +2808,9 @@ outputs: add_to_variant: true # [boolean=false] Render the bottom side of the board (default is top side) bottom: false - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [number=300] [10,1200] Dots per inch (resolution) of the generated image dpi: 300 # [string='svg'] [svg,png,jpg,bmp] Output format. Only used if no `output` is specified @@ -2732,9 +2818,9 @@ outputs: # [list(string)=[]] List of components to highlight. Filter expansion is also allowed here, # see `show_components` highlight: [] - # [list(string)=[]] List of libraries - libs: [] - # [number|dict] Margin around the generated image [mm]. + # [list(string)] List of libraries + libs: ['KiCAD-base'] + # [number|dict=0] Margin around the generated image [mm]. # Using a number the margin is the same in the four directions margin: # [number=0] Bottom margin [mm] @@ -2756,40 +2842,40 @@ outputs: output: '%f-%i%I%v.%x' # [boolean=false] Show placeholder for missing components placeholder: false - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' - # [dict|None] (DEPRECATED) Replacements for PCB references using specified components (lib:component). + pre_transform: '_null' + # [dict|string='None'] (DEPRECATED) Replacements for PCB references using specified components (lib:component). # Use `remap_components` instead remap: - # [list(dict)] Replacements for PCB references using specified components. + # [list(dict)=[]] Replacements for PCB references using specified components. # Replaces `remap` with type check remap_components: # [string=''] Component to use (from `lib`) - - comp: '' + - comp: 'LED-5MM_green' # `component` is an alias for `comp` # [string=''] Library to use - lib: '' + lib: 'LEDs' # `library` is an alias for `lib` # [string=''] Reference for the component to change - ref: '' + ref: 'D1' # `reference` is an alias for `ref` - # [string|list(string)=''] List of resistors to flip its bands + # [string|list(string)=''] {comma_sep} List of resistors to flip its bands resistor_flip: '' - # [list(dict)] List of resistors to be remapped. You can change the value of the resistors here + # [list(dict)=[]] List of resistors to be remapped. You can change the value of the resistors here resistor_remap: # [string=''] Reference for the resistor to change - - ref: '' + - ref: 'R1' # `reference` is an alias for `ref` # [string=''] Value to use for `ref` - val: '' + val: '10k' # `value` is an alias for `val` - # [list(string)|string=none] [none,all] List of components to draw, can be also a string for none or all. + # [list(string)|string='none'] [none,all,*] List of components to draw, can be also a string for none or all. # The default is none. # There two ways of using this option, please consult the `add_to_variant` option. # You can use `_kf(FILTER)` as an element in the list to get all the components that pass the filter. # You can even use `_kf(FILTER1;FILTER2)` to concatenate filters - show_components: none + show_components: 'none' # [boolean=true] Show the solder paste layers show_solderpaste: true # [string='kicad_edge'] [kicad_edge,kicad_all,svg_paths] Method used to detect the size of the resulting image. @@ -2800,7 +2886,7 @@ outputs: # The `svg_paths` uses all visible drawings in the image. To use this method you # must install the `numpy` Python module (may not be available in docker images) size_detection: 'kicad_edge' - # [string|dict] PCB style (colors). An internal name, the name of a JSON file or the style options + # [string|dict={}] PCB style (colors). An internal name, the name of a JSON file or the style options style: # [string='#208b47'] Color for the board without copper (covered by solder mask) board: '#208b47' @@ -2845,16 +2931,16 @@ outputs: type: 'pdf' dir: 'Example/pdf_dir' options: - # [list(dict)] A list of customized reports for the manufacturer + # [list(dict)=[]] A list of customized reports for the manufacturer custom_reports: # [string=''] Content for the report. Use ``${basename}`` for the project name without extension. # Use ``${filename(LAYER)}`` for the file corresponding to LAYER - content: '' # [string='Custom_report.txt'] File name for the custom report output: 'Custom_report.txt' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale) drill_marks: 'full' # [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot @@ -2891,9 +2977,9 @@ outputs: # (i.e. always the default worksheet style, also problems expanding text variables). # The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs plot_sheet_reference: false - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [number=1] Scale factor (0 means autoscaling) scaling: 1 # [number=0.1] Line width for the sketched pads [mm], see `sketch_pads_on_fab_layers` (KiCad 6+) @@ -2922,9 +3008,9 @@ outputs: # To use the KiCad 6 default colors select `_builtin_default`. # Usually user colors are stored as `user`, but you can give it another name color_theme: '_builtin_classic' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale) drill_marks: 'full' # [boolean=true] Only useful for KiCad 6 when printing in one page, you can disable the edge here. @@ -2943,9 +3029,9 @@ outputs: # `output_name` is an alias for `output` # [boolean=true] Include the title-block plot_sheet_reference: true - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [number=1.0] Scale factor (0 means autoscaling). You should disable `plot_sheet_reference` when using it scaling: 1.0 # [boolean=false] Print layers in separated pages @@ -2971,18 +3057,18 @@ outputs: background_color: false # [string=''] Color theme used, this must exist in the KiCad config (KiCad 6) color_theme: '' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Include the frame and title block frame: true # [boolean=false] Generate a monochromatic output monochrome: false # [string='%f-%i%I%v.%x'] Filename for the output PDF (%i=schematic, %x=pdf). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] 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 # file is available @@ -3002,7 +3088,7 @@ outputs: options: # [string='%f-%i%I%v.%x'] Name for the generated PDF (%i=name of the output %x=pdf). Affected by global options output: '%f-%i%I%v.%x' - # [list(dict)] Which files will be included + # [list(dict)=[]] Which files will be included outputs: # [string='.*\.pdf'] A regular expression that source files must match - filter: '.*\.pdf' @@ -3027,24 +3113,25 @@ outputs: type: 'populate' dir: 'Example/populate_dir' options: - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='html'] [html,md] Format for the generated output format: 'html' # [string='img/populating_%d.%x'] Pattern used for the image names. The `%d` is replaced by the image number. # The `%x` is replaced by the extension. Note that the format is selected by the # `renderer` imgname: 'img/populating_%d.%x' - # [string|list(string)=''] List of components soldered before the first step + # [string|list(string)=''] {comma_sep} List of components soldered before the first step initial_components: '' # [string=''] Name of the input file describing the assembly. Must be a markdown file. # Note that the YAML section of the file will be skipped, all the needed information - # comes from this output and the `renderer` output + # comes from this output and the `renderer` output, not from the YAML section. + # When empty we use a dummy template, you should provide something better input: '' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] Name of the output used to render the PCB steps. # Currently this must be a `pcbdraw` or `render_3d` output renderer: '' @@ -3065,14 +3152,10 @@ outputs: # [boolean=false] Use negative X coordinates for footprints on bottom layer bottom_negative_x: false # [list(dict)|list(string)] Which columns are included in the output - columns: - # [string=''] [Ref,Val,Package,PosX,PosY,Rot,Side] Internal name - - id: 'Ref' - # [string=''] Name to use in the output file. The id is used when empty - name: 'Reference' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + columns: ['Ref', 'Val', 'Package', 'PosX', 'PosY', 'Rot', 'Side'] + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='ASCII'] [ASCII,CSV,GBR] Format for the position file. # Note that the gerber format (GBR) needs KiCad 7+ and doesn't support most of the options. # Only the options that explicitly say the format is supported @@ -3088,9 +3171,9 @@ outputs: # [string='%f-%i%I%v.%x'] Output file name (%i='top_pos'|'bottom_pos'|'both_pos', %x='pos'|'csv'|'gbr'). # Important: when using separate files you must use `%i` to differentiate them. Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [boolean=false] When generating the CSV quote all values, even numbers quote_all: false # [number=4] number of digits for mantissa part of coordinates (0 is auto) @@ -3115,16 +3198,16 @@ outputs: options: # [boolean=true] Force A4 paper size a4_output: true - # [list(dict)] A list of customized reports for the manufacturer + # [list(dict)=[]] A list of customized reports for the manufacturer custom_reports: # [string=''] Content for the report. Use ``${basename}`` for the project name without extension. # Use ``${filename(LAYER)}`` for the file corresponding to LAYER - content: '' # [string='Custom_report.txt'] File name for the custom report output: 'Custom_report.txt' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale) drill_marks: 'full' # [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot @@ -3161,9 +3244,9 @@ outputs: # (i.e. always the default worksheet style, also problems expanding text variables). # The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs plot_sheet_reference: false - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [number=1.0] Fine grain adjust for the X scale (floating point multiplier) scale_adjust_x: 1.0 # [number=1.0] Fine grain adjust for the Y scale (floating point multiplier) @@ -3201,18 +3284,18 @@ outputs: background_color: false # [string=''] Color theme used, this must exist in the KiCad config (KiCad 6) color_theme: '' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Include the frame and title block frame: true # [boolean=false] Generate a monochromatic output monochrome: false # [string='%f-%i%I%v.%x'] Filename for the output postscript (%i=schematic, %x=ps). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] 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 # file is available @@ -3240,7 +3323,7 @@ outputs: # [string='%f-%i%I%v.%x'] Filename/dirname for the output library (%i=qr, %x=lib/kicad_sym/pretty). # You must use %x in the name to get a symbols lib and a footprints lib. Affected by global options output: '%f-%i%I%v.%x' - # [list(dict)] QR codes to include in the library + # [dict|list(dict)=[{}]] QR codes to include in the library qrs: # [string='low'] [low,medium,quartile,high] Error correction level - correction_level: 'low' @@ -3283,9 +3366,9 @@ outputs: clip_silk_on_via_annulus: true # [string='#8b898c'] Color for the copper copper: '#8b898c' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Downloads missing 3D models from KiCad git. # Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. # They are downloaded to a temporal directory and discarded. @@ -3297,6 +3380,9 @@ outputs: # part number. The field containing the LCSC part number is defined by the # `field_lcsc_part` global variable download_lcsc: true + # [boolean=false] Some versions of Image Magick (i.e. the one in Debian 11) needs two passes to crop. + # Enable it to force a double pass. It was the default in KiBot 1.7.0 and older + enable_crop_workaround: false # [boolean=false] Tell KiCad to use the colors from the stackup. They are better than the unified KiBot colors. # Needs KiCad 6 or newer force_stackup_colors: false @@ -3329,9 +3415,9 @@ outputs: orthographic: false # [string='%f-%i%I%v.%x'] Name for the generated image file (%i='3D_$VIEW' %x='png'). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [boolean=false] Enable the ray tracing. Much better result, but slow, and you'll need to adjust `wait_rt` ray_tracing: false # [boolean=true] When disabled we use the colors of the layers used by the GUI. Needs KiCad 6 or 7. @@ -3357,10 +3443,10 @@ outputs: # Also note that KiCad 5 ray tracer shows comments outside the PCB, but newer KiCad versions # doesn't show_comments: false - # [list(string)|string=all] [none,all] List of components to draw, can be also a string for `none` or `all`. + # [list(string)|string='all'] [none,all,*] List of components to draw, can be also a string for `none` or `all`. # Ranges like *R5-R10* are supported. # Unlike the `pcbdraw` output, the default is `all` - show_components: all + show_components: 'all' # [boolean=false] Show the content of the User.Drawings layer. Only available for KiCad 8 and newer. # Consult `show_comments` to learn when drawings are visible show_drawings: false @@ -3424,6 +3510,8 @@ outputs: type: 'report' dir: 'Example/report_dir' options: + # [number=7.4] Specific gravity of the alloy used for the solder paste, in g/cm3. Used to compute solder paste usage + alloy_specific_gravity: 7.4 # [string='markdown'] Original format for the report conversion. Current templates are `markdown`. See `do_convert` convert_from: 'markdown' # [string='pdf'] Target format for the report conversion. See `do_convert` @@ -3431,6 +3519,9 @@ outputs: # [string='%f-%i%I%v.%x'] Converted output file name (%i='report', %x=`convert_to`). # Note that the extension should match the `convert_to` value. Affected by global options converted_output: '%f-%i%I%v.%x' + # [string|list(string)='_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 + dnf_filter: '_null' # [boolean=false] Run `Pandoc` to convert the report. Note that Pandoc must be installed. # The conversion is done assuming the report is in `convert_from` format. # The output file will be in `convert_to` format. @@ -3444,12 +3535,24 @@ outputs: # diameter can be reduced to accommodate the correct annular ring values. # Use 0 to disable it eurocircuits_reduce_holes: 0.45 + # [number=1.0] Specific gravity of the flux used for the solder paste, in g/cm3. Used to compute solder paste usage + flux_specific_gravity: 1.0 # [string='%f-%i%I%v.%x'] Output file name (%i='report', %x='txt'). Affected by global options output: '%f-%i%I%v.%x' - # [string='full'] Name for one of the internal templates (full, full_svg, simple) or a custom template file. + # [string|list(string)='_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 + pre_transform: '_null' + # [number=87.75] [0,100] Amount of metal in the solder paste (percentage). Used to compute solder paste usage + solder_paste_metal_amount: 87.75 + # [number=0.12] Stencil thickness in mm. Used to compute solder paste usage + stencil_thickness: 0.12 + # [string='full'] [full,full_svg,simple,testpoints,*] Name for one of the internal templates or a custom template file. # Environment variables and ~ are allowed. - # Note: when converting to PDF PanDoc can fail on some Unicode values (use `simple_ASCII`) + # Note: when converting to PDF PanDoc can fail on some Unicode values (use `simple_ASCII`). + # Note: the testpoint variables uses the `testpoint` fabrication attribute of pads template: 'full' + # [string=''] Board variant to apply + variant: '' # Schematic with variant generator: # This copy isn't intended for development. # Is just a tweaked version of the original where you can look at the results. @@ -3461,12 +3564,12 @@ outputs: # [boolean=false] Copy the KiCad project to the destination directory. # Disabled by default for compatibility with older versions copy_project: false - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + dnf_filter: '_null' + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. # If it starts with `+` the text is concatenated title: '' @@ -3486,13 +3589,13 @@ outputs: options: # [boolean=true] Creates a PNG showing the generated 3D model create_preview: true - # [string|list(string)] List of components to add a cutout based on the component courtyard. + # [string|list(string)] {comma_sep} List of components to add a cutout based on the component courtyard. # This is useful when you have already pre-populated board and you want to populate more # components cutout: '' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # `enlarge_holes` is an alias for `enlarge_holes` # [number=0] Enlarge pad holes by x mm enlargeholes: 0 @@ -3511,9 +3614,9 @@ outputs: # `pcb_thickness` is an alias for `pcbthickness` # [number=0] PCB thickness [mm]. If 0 we will ask KiCad pcbthickness: 0 - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string='auto'] [top,bottom,auto,both] Which side of the PCB we want. Using `auto` will detect which # side contains solder paste side: 'auto' @@ -3533,13 +3636,13 @@ outputs: options: # [boolean=true] Creates a PNG showing the generated 3D model create_preview: true - # [string|list(string)] List of components to add a cutout based on the component courtyard. + # [string|list(string)] {comma_sep} List of components to add a cutout based on the component courtyard. # This is useful when you have already pre-populated board and you want to populate more # components cutout: '' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Include the generated OpenSCAD files include_scad: true # `jig_height` is an alias for `jigheight` @@ -3557,9 +3660,9 @@ outputs: # `pcb_thickness` is an alias for `pcbthickness` # [number=0] PCB thickness [mm]. If 0 we will ask KiCad pcbthickness: 0 - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # `register_border_inner` is an alias for `registerborderinner` # `register_border_outer` is an alias for `registerborderouter` # [number=1] Inner register border [mm] @@ -3581,9 +3684,9 @@ outputs: type: 'step' dir: 'Example/step_dir' options: - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Downloads missing 3D models from KiCad git. # Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. # They are downloaded to a temporal directory and discarded. @@ -3606,15 +3709,16 @@ outputs: min_distance: -1 # [boolean=false] Used to exclude 3D models for components with 'virtual' attribute no_virtual: false - # [string='grid'] Determines the coordinates origin. Using grid the coordinates are the same as you have in the design sheet. + # [string='grid'] [grid,drill,*] Determines the coordinates origin. Using grid the coordinates are the same as you have in the + # design sheet. # The drill option uses the auxiliary reference defined by the user. # You can define any other origin using the format 'X,Y', i.e. '3.2,-10' origin: 'grid' # [string='%f-%i%I%v.%x'] Name for the generated STEP file (%i='3D' %x='step'). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [boolean=true] Substitute STEP or IGS models with the same name in place of VRML models subst_models: true # [string=''] Board variant to apply @@ -3629,16 +3733,16 @@ outputs: type: 'svg' dir: 'Example/svg_dir' options: - # [list(dict)] A list of customized reports for the manufacturer + # [list(dict)=[]] A list of customized reports for the manufacturer custom_reports: # [string=''] Content for the report. Use ``${basename}`` for the project name without extension. # Use ``${filename(LAYER)}`` for the file corresponding to LAYER - content: '' # [string='Custom_report.txt'] File name for the custom report output: 'Custom_report.txt' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale) drill_marks: 'full' # [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot @@ -3661,7 +3765,7 @@ outputs: limit_viewbox: false # [number=0.25] [0.02,2] For objects without width [mm] (KiCad 5) line_width: 0.25 - # [number|dict] Margin around the view box [mm]. + # [number|dict=0] Margin around the view box [mm]. # Using a number the margin is the same in the four directions. # See `limit_viewbox` option margin: @@ -3690,9 +3794,9 @@ outputs: # (i.e. always the default worksheet style, also problems expanding text variables). # The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs plot_sheet_reference: false - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [number=1] Scale factor (0 means autoscaling) scaling: 1 # [string='kicad_edge'] [kicad_edge,kicad_all] Method used to detect the size of the view box. @@ -3731,9 +3835,9 @@ outputs: # To use the KiCad 6 default colors select `_builtin_default`. # Usually user colors are stored as `user`, but you can give it another name color_theme: '_builtin_classic' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale) drill_marks: 'full' # [boolean=true] Enable workaround for KiCad 5 bug @@ -3756,9 +3860,9 @@ outputs: # `output_name` is an alias for `output` # [boolean=true] Include the title-block plot_sheet_reference: true - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [number=1.0] Scale factor (0 means autoscaling). You should disable `plot_sheet_reference` when using it scaling: 1.0 # [boolean=false] Print layers in separated pages @@ -3784,18 +3888,18 @@ outputs: background_color: false # [string=''] Color theme used, this must exist in the KiCad config (KiCad 6) color_theme: '' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Include the frame and title block frame: true # [boolean=false] Generate a monochromatic output monochrome: false # [string='%f-%i%I%v.%x'] Filename for the output SVG (%i=schematic, %x=svg). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string=''] 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 # file is available @@ -3818,9 +3922,9 @@ outputs: # If you want to create a monolithic file just use '' here. # Note that the WRL file will contain relative paths to the models dir_models: 'shapes3D' - # [string|list(string)='_none'] Name of the filter to mark components as not fitted. + # [string|list(string)='_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 - dnf_filter: '_none' + dnf_filter: '_null' # [boolean=true] Downloads missing 3D models from KiCad git. # Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. # They are downloaded to a temporal directory and discarded. @@ -3849,19 +3953,19 @@ outputs: no_virtual: false # [string='%f-%i%I%v.%x'] Filename for the output (%i=vrml, %x=wrl). Affected by global options output: '%f-%i%I%v.%x' - # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + # [string|list(string)='_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 - pre_transform: '_none' + pre_transform: '_null' # [string='millimeters'] [millimeters,inches'] Units for `ref_x` and `ref_y` ref_units: 'millimeters' # [number=0] X coordinate to use as reference when `use_pcb_center_as_ref` and `use_pcb_center_as_ref` are disabled ref_x: 0 # [number=0] Y coordinate to use as reference when `use_pcb_center_as_ref` and `use_pcb_center_as_ref` are disabled ref_y: 0 - # [list(string)|string=all] [none,all] List of components to draw, can be also a string for `none` or `all`. + # [list(string)|string='all'] [none,all,*] List of components to draw, can be also a string for `none` or `all`. # Ranges like *R5-R10* are supported. # Unlike the `pcbdraw` output, the default is `all` - show_components: all + show_components: 'all' # [boolean=false] Use the auxiliary axis as origin for coordinates. # Has more precedence than `use_pcb_center_as_ref` use_aux_axis_as_origin: false diff --git a/docs/source/Changelog.rst b/docs/source/Changelog.rst index 7d7e8c293..ea91d6df2 100644 --- a/docs/source/Changelog.rst +++ b/docs/source/Changelog.rst @@ -13,9 +13,154 @@ Changelog `__, and this project adheres to `Semantic Versioning `__. +[1.8.0] - 2024-09-17 +-------------------- + +Added +~~~~~ + +- Experimental Altium PCB conversion (#625) +- Most places where a field is expected now support ``_field_*`` to + fetch the globally defined value. +- Preflights: + + - check_fields: used to ensure conditions on desired fields (#643) + - e/drc: option to force english messages (needed for KiCad 8.0.4) + +- Filters: + + - ``separate_pins``: used to create testpoint reports (#638) + - ``_null`` can be used to skip the filters processing + +- Global options: + + - ``use_pcb_fields``: allows using fields defined in the PCB (and + not only in the schematic), enabled by default (#648 and #650) + - ``field_current``: to specify the field used for current ratings + +- Internal templates: + + - Testpoints_by_attr, Testpoints_by_attr_CSV, + Testpoints_by_attr_HTML, Testpoints_by_value, + Testpoints_by_value_CSV and Testpoints_by_value_HTML: Used to + generate testpoint reports (#638) + +- Command line: + + - Option to also list sub-PCBs found in variants + +- BoardView: support for BVR format +- BoM: logo file name can contain env vars and/or ~ (#620) +- Datasheet: option to classify the datasheets by reference. +- KiCost: option to specify a configuration file (#615) +- Report: + + - Solder paste usage stats (#616) + - Support for variants (See #616) + - Testpoints report (See #638) + +- xDRC: configurable category (#647) +- Schematic: + + - Support for text boxes inside symbols (#621) + +- Worksheet: + + - Support for KiCad 8 bitmaps (#623) + +- Position: + + - Support for panels repeating the same component (See #656) + +Fixed: +~~~~~~ + +- iBoM: *highlight_pin1* option didnā€™t allow the use of the new + choices. +- PCB2Blender_Tools: transform filters might make it fail. (#618) +- BoM: + + - No color reference when using row colors but not column or kicost + colors. (#619) + - ā€œ0 picoā€ for ā€œ0ā€ + - Use of ``lcsc_link`` as boolean + - User fields for components that are only in the PCB not filled + (#656) + +- Worksheet: Size of PNGs that specify its PPI resolution. +- Filters: + + - Problems with filters that change fields for components that are + only in the PCB. (#628) + - Use of ā€™_noneā€™ filter in lists of filters and \_kf() + +- Variants: + + - Problems when remove_solder_paste_for_dnp and + remove_adhesive_for_dnp are both disabled + (remove_solder_mask_for_dnp wrongly defined) (#632) + - Problems when using ``set_text_variables_before_output`` (#649) + +- Draw Stackup: + + - Dimension always drawn on User.Drawings layer (#629) + - Problems when the PCB wasnā€™t loaded by another preflight + +- Update XML: ``check_pcb_parity`` not usable for KiCad 8, must use the + ``drc`` preflight (#633) +- PCB Print: %ln and %ll substitution when using ``repeat_for_layer`` + option +- Render_3D: bottom side components that doesnā€™t rotate from its center + got displaced highlight (#659) +- QR Lib output and various preflights: might remove DRC exclusions. + This is a KiCad bug that we must workaround (#653) +- 3D outputs: temporal .kicad_dru file not removed (#655) +- Generated PCB files: problems with some big structures, like zone + fills, that could generate huge lines in the generated PCB, not + supported by KiCad. (#660) + +Changed: +~~~~~~~~ + +- KiCad 8.0.2: The behavior with hidden text changed in KiCad 8.0.2, it + is computed even for operations where it isnā€™t really visible, like + plotting a layer where we donā€™t have the hidden text. So currently + KiBot is experimentally disabling the ā€œhidden text layerā€. This is a + bug in KiCad (https://gitlab.com/kicad/code/kicad/-/issues/17958) +- Render 3D: Modern versions of Image Magick no longer needs two trim + passes for auto-crop, so now we default to one and an option enables + two. (See #644) +- Preflights: The definition of preflight plug-ins changed. They are + slightly different now. Currently they are Optionable and share more + in common with outputs. If you need assistance to migrate a preflight + just open a GitHub issue. +- Outputs: Now all options must declare its default. +- Global ``invalidate_pcb_text_cache``: now it changes the PCB on disk, + not just on memory. This is needed for external tools like KiKitā€™s + panelize. +- In many cases now we allow empty lists and use some sort of default. + A warning is issued, but we continue. + + - Layers: now the default for missing layers is all layers. + - Copy files: Now we donā€™t stop when nothing to copy is specified + - Layers: now the default for missing layers is all layers. + - KiKit Present: Missing description is no longer fatal + - Any PCB Print/PCB Print: Missing pages/layers is no longer fatal + - Populate: Missing input file is no longer fatal + - QR Lib: Missing QR definition is no longer fatal (%p %r used) + - Blender Options outputs: Make a render when no outputs are + specified + - PCB Print: repeat_layers defaults to inners + - Spec to Field: some simple defaults for the specs (voltage, + current, power and tolerance) + +.. _section-1: + [1.7.0] - 2024-04-23 -------------------- +.. _added-1: + Added ~~~~~ @@ -77,6 +222,8 @@ Added - Added options to control Eco1/Eco2/Drawings individually on KiCad 8 (#614) +.. _fixed-1: + Fixed ~~~~~ @@ -101,6 +248,8 @@ Fixed - Expansion of variables in fields could fail if the KiCad config wasnā€™t initialized +.. _changed-1: + Changed ~~~~~~~ @@ -110,12 +259,12 @@ Changed - PcbDraw: Now handles panelized boards much faster. Previous code was really slow for panels and the time increased exponentially. -.. _section-1: +.. _section-2: [1.6.5] - 2024-03-31 -------------------- -.. _added-1: +.. _added-2: Added ~~~~~ @@ -129,7 +278,7 @@ Added - Navigate results: A header and navigation bar (#582) - BoM: support for SVG format in the logos (#383) -.. _changed-1: +.. _changed-2: Changed ~~~~~~~ @@ -143,7 +292,7 @@ Changed - BoardView: Skip footprints with no pads (not just REF**) (whitequark/kicad-boardview#14) -.. _fixed-1: +.. _fixed-2: Fixed ~~~~~ @@ -170,12 +319,12 @@ Fixed (#589) - Panelize: not able to use external JSON configs (#592) -.. _section-2: +.. _section-3: [1.6.4] - 2024-02-02 -------------------- -.. _added-2: +.. _added-3: Added ~~~~~ @@ -326,7 +475,7 @@ Added - Added a new mode where we can control the added/removed colors (#551) -.. _changed-2: +.. _changed-3: Changed ~~~~~~~ @@ -363,7 +512,7 @@ Changed - When *check_zone_fills* is enabled now we do a refill for the boards -.. _fixed-2: +.. _fixed-3: Fixed ~~~~~ @@ -451,12 +600,12 @@ Fixed - Problems when creating a colored resistor, but we didnā€™t have a cache yet (i.e.Ā no model downloaded) #553 -.. _section-3: +.. _section-4: [1.6.3] - 2023-06-26 -------------------- -.. _added-3: +.. _added-4: Added ~~~~~ @@ -551,7 +700,7 @@ Added - ``quote_all``: forces quotes to all values in the CSV output. (See #456) -.. _changed-3: +.. _changed-4: Changed ~~~~~~~ @@ -581,7 +730,7 @@ Changed - JLCPCB_stencil: Is now just like JLCPCB. The only difference is the added layers. -.. _fixed-3: +.. _fixed-4: Fixed ~~~~~ @@ -621,12 +770,12 @@ Fixed - KiCad user template directory autodetection for KiCad 7+ -.. _section-4: +.. _section-5: [1.6.2] - 2023-04-24 -------------------- -.. _added-4: +.. _added-5: Added ~~~~~ @@ -691,7 +840,7 @@ Added - Option to use the auxiliary origin as reference. (#420) -.. _fixed-4: +.. _fixed-5: Fixed ~~~~~ @@ -731,7 +880,7 @@ Fixed - ref_y coordinate not used. (#419) -.. _changed-4: +.. _changed-5: Changed: ~~~~~~~~ @@ -739,12 +888,12 @@ Changed: - Some R, L and C values that were rejected are accepted now. You just get a warning about what part of the value was discarded. -.. _section-5: +.. _section-6: [1.6.1] - 2023-03-16 -------------------- -.. _added-5: +.. _added-6: Added ~~~~~ @@ -778,7 +927,7 @@ Added - ``cross_using_kicad`` global option to use KiCad to cross DNP components in the schematic. Enabled by default. -.. _fixed-5: +.. _fixed-6: Fixed ~~~~~ @@ -788,12 +937,12 @@ Fixed conditions were met. - PCB Print: KiCad crashing on some complex filled zones (#396) -.. _section-6: +.. _section-7: [1.6.0] - 2023-02-06 -------------------- -.. _added-6: +.. _added-7: Added ~~~~~ @@ -907,24 +1056,24 @@ Added ~/.cache/kibot/3d You can change the directory using KIBOT_3D_MODELS - License is now AGPL v3, since we are incorporating AGPL code. -.. _section-7: +.. _section-8: [1.5.1] - 2022-12-16 -------------------- -.. _fixed-6: +.. _fixed-7: Fixed ~~~~~ - System level resources look-up -.. _section-8: +.. _section-9: [1.5.0] - 2022-12-16 -------------------- -.. _added-7: +.. _added-8: Added ~~~~~ @@ -986,7 +1135,7 @@ Added - Option to control the *SVG precision* (units scale) -.. _changed-5: +.. _changed-6: Changed ~~~~~~~ @@ -999,7 +1148,7 @@ Changed - loss tangent decimals, added one more. -.. _fixed-7: +.. _fixed-8: Fixed ~~~~~ @@ -1033,12 +1182,12 @@ Fixed - Makefile: outputs marked as not run by default were listed in the ``all`` target. -.. _section-9: +.. _section-10: [1.4.0] - 2022-10-12 -------------------- -.. _added-8: +.. _added-9: Added ~~~~~ @@ -1109,7 +1258,7 @@ Added - Position: option to set the resolution for floating values (#314) -.. _fixed-8: +.. _fixed-9: Fixed ~~~~~ @@ -1131,7 +1280,7 @@ Fixed - Position: Components wrongly separated by side when the side column wasnā€™t the last column (#313) -.. _changed-6: +.. _changed-7: Changed ~~~~~~~ @@ -1151,12 +1300,12 @@ Changed - When importing globals now options that are lists or dicts are merged, not just replaced. (#291) -.. _section-10: +.. _section-11: [1.3.0] - 2022-09-08 -------------------- -.. _added-9: +.. _added-10: Added ~~~~~ @@ -1199,7 +1348,7 @@ Added - Installation checker: option to show the tool paths. -.. _fixed-9: +.. _fixed-10: Fixed ~~~~~ @@ -1234,7 +1383,7 @@ Fixed when VAR isnā€™t defined. The old code tried to make it an absolute path. -.. _changed-7: +.. _changed-8: Changed ~~~~~~~ @@ -1251,12 +1400,12 @@ Changed - Fails to expand KiCad vars are reported once (not every time) - No more warnings about missing 3D models when we can download them -.. _section-11: +.. _section-12: [1.2.0] - 2022-06-15 -------------------- -.. _added-10: +.. _added-11: Added ~~~~~ @@ -1283,7 +1432,7 @@ Added - GitHub discussions are now enabled. Comment about your KiBot experience `here `__ -.. _fixed-10: +.. _fixed-11: Fixed ~~~~~ @@ -1297,7 +1446,7 @@ Fixed orientation. - svg_pcb_print: page orientation for portrait. -.. _changed-8: +.. _changed-9: Changed ~~~~~~~ @@ -1310,12 +1459,12 @@ Changed - ``navigate_results`` and ``compress`` outputs are created after others -.. _section-12: +.. _section-13: [1.1.0] - 2022-05-24 -------------------- -.. _added-11: +.. _added-12: Added ~~~~~ @@ -1331,7 +1480,7 @@ Added - Pattern and text variables expansion in the title (#198) - Customizable extra info after the title (#199) -.. _fixed-11: +.. _fixed-12: Fixed ~~~~~ @@ -1341,12 +1490,12 @@ Fixed - KiCost+Internal variants: problem with ``variant`` field capitalization -.. _section-13: +.. _section-14: [1.0.0] - 2022-05-10 -------------------- -.. _added-12: +.. _added-13: Added ~~~~~ @@ -1457,7 +1606,7 @@ Added - Support for ``--subst-models`` option for KiCad 6ā€™s kicad2step. (#137) -.. _changed-9: +.. _changed-10: Changed ~~~~~~~ @@ -1479,7 +1628,7 @@ Changed - The default output pattern now includes the ``output_id`` (%I) - The ``source`` path for ``compress`` now has pattern expansion (#152) -.. _fixed-12: +.. _fixed-13: Fixed ~~~~~ @@ -1519,12 +1668,12 @@ Fixed (not imported from KiCad 5) - Problems when using page layout files with relative paths. (#174) -.. _section-14: +.. _section-15: [0.11.0] - 2021-04-25 --------------------- -.. _added-13: +.. _added-14: Added ~~~~~ @@ -1548,7 +1697,7 @@ Added - Basic KiCost support (**experimental**). - Basic internal BoM and KiCost integration (**experimental**). -.. _changed-10: +.. _changed-11: Changed ~~~~~~~ @@ -1561,7 +1710,7 @@ Changed - Reference ranges of two elements no longer represented as ranges. Examples: ā€œR1-R2ā€ is now ā€œR1 R2ā€, ā€œR1-R3ā€ remains unchanged. -.. _fixed-13: +.. _fixed-14: Fixed ~~~~~ @@ -1575,12 +1724,12 @@ Fixed - The ā€œReferencesā€ (plural) column is now coloured as ā€œReferenceā€ (singular) -.. _section-15: +.. _section-16: [0.10.1] - 2021-02-22 --------------------- -.. _added-14: +.. _added-15: Added ~~~~~ @@ -1588,48 +1737,48 @@ Added - GitLab CI workaround - Verbosity level is now passed to KiAuto -.. _section-16: +.. _section-17: [0.10.0-4] - 2021-02-16 ----------------------- -.. _fixed-14: +.. _fixed-15: Fixed ~~~~~ - Problem using Python 3.6 (ZipFileā€™s compresslevel arg needs 3.7) -.. _section-17: +.. _section-18: [0.10.0-3] - 2021-02-16 ----------------------- -.. _fixed-15: +.. _fixed-16: Fixed ~~~~~ - Problem using Python 3.6 (StreamHandler.setStream introduced in 3.7) -.. _section-18: +.. _section-19: [0.10.0-2] - 2021-02-12 ----------------------- -.. _fixed-16: +.. _fixed-17: Fixed ~~~~~ - Missing python3-distutils dependency on Debian package. -.. _section-19: +.. _section-20: [0.10.0] - 2021-02-12 --------------------- -.. _added-15: +.. _added-16: Added ~~~~~ @@ -1660,7 +1809,7 @@ Added - KiAuto time-out control. - Now you can import outputs from another config file. -.. _changed-11: +.. _changed-12: Changed ~~~~~~~ @@ -1675,7 +1824,7 @@ Changed and error messages still use stderr. - Now InteractiveHtmlBom can be installed just as a plugin. -.. _fixed-17: +.. _fixed-18: Fixed ~~~~~ @@ -1687,12 +1836,12 @@ Fixed (i.e.Ā UTF-8). - Problems when using components with more than 10 subparts. -.. _section-20: +.. _section-21: [0.9.0] - 2021-01-04 -------------------- -.. _added-16: +.. _added-17: Added ~~~~~ @@ -1707,7 +1856,7 @@ Added - A filter to rotate footprints in the position file (#28). - The step output now can download missing 3D models. -.. _changed-12: +.. _changed-13: Changed ~~~~~~~ @@ -1716,7 +1865,7 @@ Changed - Position files in CSV format quotes only the columns that could contain an space. Just like KiCad does. -.. _fixed-18: +.. _fixed-19: Fixed ~~~~~ @@ -1725,12 +1874,12 @@ Fixed - Generic filter ``include_only`` option worked only when debug enabled. -.. _section-21: +.. _section-22: [0.8.1] - 2020-12-09 -------------------- -.. _added-17: +.. _added-18: Added ~~~~~ @@ -1738,7 +1887,7 @@ Added - Internal BoM HTML: highlight cell when hover. - Internal BoM HTML: allow to jump to REF of row number using anchors. -.. _fixed-19: +.. _fixed-20: Fixed ~~~~~ @@ -1746,12 +1895,12 @@ Fixed - Internal BoM separator wasnā€™t applied when using ``use_alt`` - Problems loading plug-ins when using ``pip``. -.. _section-22: +.. _section-23: [0.8.0] - 2020-11-06 -------------------- -.. _added-18: +.. _added-19: Added ~~~~~ @@ -1764,7 +1913,7 @@ Added - Columns in position files can be selected, renamed and sorted as you like. -.. _fixed-20: +.. _fixed-21: Fixed ~~~~~ @@ -1777,12 +1926,12 @@ Fixed - Excellon drill output when using unified output and not using default KiCad names. -.. _section-23: +.. _section-24: [0.7.0] - 2020-09-11 -------------------- -.. _added-19: +.. _added-20: Added ~~~~~ @@ -1807,7 +1956,7 @@ Added - Default output file name format and default variant can be specified from the command line. -.. _fixed-21: +.. _fixed-22: Fixed ~~~~~ @@ -1815,12 +1964,12 @@ Fixed - Virtual components are always excluded from position files. Note you can change it using the variants mechanism. -.. _section-24: +.. _section-25: [0.6.2] - 2020-08-25 -------------------- -.. _changed-13: +.. _changed-14: Changed ~~~~~~~ @@ -1829,7 +1978,7 @@ Changed creating the internal BoM. They are usually mistakes that prevents grouping components. -.. _fixed-22: +.. _fixed-23: Fixed ~~~~~ @@ -1841,26 +1990,26 @@ Fixed - Problems with PcbDraw when generating PNG and JPG outputs. Now we use a more reliable conversion method when available. -.. _section-25: +.. _section-26: [0.6.1] - 2020-08-20 -------------------- -.. _added-20: +.. _added-21: Added ~~~~~ - More robust behavior on GUI dependent commands. -.. _changed-14: +.. _changed-15: Changed ~~~~~~~ - Incorporated mcpy, no longer a dependency. -.. _fixed-23: +.. _fixed-24: Fixed ~~~~~ @@ -1868,12 +2017,12 @@ Fixed - Problems when using ``pip install`` without ā€“no-compile. At least for user level install. -.. _section-26: +.. _section-27: [0.6.0] - 2020-08-18 -------------------- -.. _added-21: +.. _added-22: Added ~~~~~ @@ -1905,7 +2054,7 @@ Added - ``error_number`` -> ``number`` - ``regexp`` -> ``regex`` -.. _changed-15: +.. _changed-16: Changed ~~~~~~~ @@ -1920,12 +2069,12 @@ Changed - pdf_sch_print: adds -schematic - IBoM: contains the project name. -.. _section-27: +.. _section-28: [0.5.0] - 2020-07-11 -------------------- -.. _changed-16: +.. _changed-17: Changed ~~~~~~~ @@ -1941,7 +2090,7 @@ Changed - Now we test the PCB and/or SCH only when we are doing something that needs them. -.. _added-22: +.. _added-23: Added ~~~~~ @@ -1996,7 +2145,7 @@ Added - variants_blacklist - dnp_field -.. _fixed-24: +.. _fixed-25: Fixed ~~~~~ @@ -2005,12 +2154,12 @@ Fixed - ā€˜ignore_unconnectedā€™ preflight wasnā€™t working. - The report of hwo many ERC/DRC errors we found. -.. _section-28: +.. _section-29: [0.4.0] - 2020-06-17 -------------------- -.. _added-23: +.. _added-24: Added ~~~~~ @@ -2018,12 +2167,12 @@ Added - STEP 3D model generation - Support for unpatched InteractiveHtmlBom -.. _section-29: +.. _section-30: [0.3.0] - 2020-06-14 -------------------- -.. _added-24: +.. _added-25: Added ~~~~~ @@ -2031,7 +2180,7 @@ Added - Better debug information when a BoM fails to be generated. - Support for compressed YAML files. -.. _changed-17: +.. _changed-18: Changed ~~~~~~~ @@ -2040,19 +2189,19 @@ Changed missing or corrupted. - The ā€˜check_zone_fillsā€™ option is now independent of ā€˜run_drcā€™ -.. _fixed-25: +.. _fixed-26: Fixed ~~~~~ - Error codes that overlapped. -.. _section-30: +.. _section-31: [0.2.5] - 2020-06-11 -------------------- -.. _added-25: +.. _added-26: Added ~~~~~ @@ -2060,7 +2209,7 @@ Added - Tolerate config files without outputs - Mechanism to filter ERC/DRC errors -.. _fixed-26: +.. _fixed-27: Fixed ~~~~~ @@ -2068,19 +2217,19 @@ Fixed - All pcbnew plot formats generated gerber job files - Most formats that needed layers didnā€™t complain when omitted -.. _section-31: +.. _section-32: [0.2.4] - 2020-05-19 -------------------- -.. _changed-18: +.. _changed-19: Changed ~~~~~~~ - Now kicad-automation-scripts 1.3.1 or newer is needed. -.. _fixed-27: +.. _fixed-28: Fixed ~~~~~ @@ -2088,24 +2237,24 @@ Fixed - Problems for kibom and print_sch outputs when the PCB name included a path. -.. _section-32: +.. _section-33: [0.2.3] - 2020-04-23 -------------------- -.. _added-26: +.. _added-27: Added ~~~~~ - List available targets -.. _section-33: +.. _section-34: [0.2.2] - 2020-04-20 -------------------- -.. _fixed-28: +.. _fixed-29: Fixed ~~~~~ @@ -2113,12 +2262,12 @@ Fixed - KiBoM temporal files, now removed - preflight tasks that didnā€™t honor ā€“out-dir -.. _section-34: +.. _section-35: [0.2.1] - 2020-04-18 -------------------- -.. _fixed-29: +.. _fixed-30: Fixed ~~~~~ @@ -2126,12 +2275,12 @@ Fixed - Problem when the excellon drill target directory didnā€™t exist (now created) -.. _section-35: +.. _section-36: [0.2.0] - 2020-03-28 -------------------- -.. _added-27: +.. _added-28: Added ~~~~~ @@ -2149,19 +2298,19 @@ Added - Progress information - ā€“version option -.. _fixed-30: +.. _fixed-31: Fixed ~~~~~ - Debian dependencies -.. _section-36: +.. _section-37: [0.1.1] - 2020-03-13 -------------------- -.. _added-28: +.. _added-29: Added ~~~~~ diff --git a/docs/source/KiPlotYAML.rst b/docs/source/KiPlotYAML.rst index a270c0cbf..3a4fc628e 100644 --- a/docs/source/KiPlotYAML.rst +++ b/docs/source/KiPlotYAML.rst @@ -31,6 +31,8 @@ We use three basic data types: - **boolean**: can take only two values *true* and *false*. - **string**: almost anything else. +.. _number: + Here are some examples for numbers: .. code:: yaml @@ -42,6 +44,8 @@ Here are some examples for numbers: Note that the decimal point is always a point, no matters what your locale settings indicate. +.. _boolean: + Here are some examples for booleans: .. code:: yaml @@ -49,6 +53,8 @@ Here are some examples for booleans: v1: true v2: false +.. _string: + And here are some examples for strings: .. code:: yaml @@ -57,9 +63,15 @@ And here are some examples for strings: v2: '3' v3: "true" v4: " I have spaces " + v5: '# I have special chars' Note that quotes are optional and can be used to disambiguate. +.. _no_case: + +Also note that most strings are case sensitive, but things like schematic field names aren't. +In this case using *value* or *Value* is the same. + Compound data types ------------------- @@ -70,6 +82,8 @@ We use two types: - **dict**: dictionaries or maps. Just a bunch of label with associated data. +.. _list(string): + Here is an example for a list of strings (**list(string)** in our case): .. code:: yaml @@ -79,6 +93,8 @@ Here is an example for a list of strings (**list(string)** in our case): - "true" - " I have spaces " +.. _dict: + And here an example for a dict: .. code:: yaml @@ -88,6 +104,8 @@ And here an example for a dict: v3: "true" v4: " I have spaces " +Here the dict is mapping "Hi!" to the "v1" key, "3" to the "v2" key, etc. + The list and dict elements can also be other lists and/or dicts. To understand how this is achieved we need one more thing. @@ -130,6 +148,8 @@ And here is a mix of both: The indentation shows that ``age`` and ``gender`` are attached to ``John``, not directly applied to ``people``. +.. _list(list(string)): + Note that lists can be nested, here is a list of lists (**list(list(string))**): @@ -147,6 +167,20 @@ Note that lists can be nested, here is a list of lists In this example we have a list with two elements, the first is a list with three elements and the second a list with four elements. +.. _list(dict): + +Here is an example of a list of dicts (**list(dict)**): + +.. code:: yaml + + list_of_lists: + - name: John + age: 25 + gender: male + - name: Cindy + age: 32 + gender: female + Compact notation ---------------- @@ -194,6 +228,27 @@ Can be defined as: - Luca - Laura +.. _comma_sep: + +Also note that some options supports comma separated strings. This is common +for options that can be a single string, or a list of strings. In this case +the following are equivalent: + +.. code:: yaml + + people: John,Cindy,Luca,Laura + +And: + +.. code:: yaml + + people: + - John + - Cindy + - Luca + - Laura + + Putting all together -------------------- @@ -287,3 +342,36 @@ list (``&pcb_draw_ops``) and then we copy the data with Here we choose another ``style`` (ridiculous example), the bottom side (good example), a different list of components to show and we eliminate the ``remap`` dict. + + +KiBot specific data types +------------------------- + +KiBot defines some data types that are derived from YAML basic data types. + +.. _string_dict: + +string_dict +........... + +This is a :ref:`dict ` with the restriction that all the values must be strings. +The following example is a valid `string_dict`: + +.. code:: yaml + + v1: Hi! + v2: '3' + v3: "true" + v4: " I have spaces " + +But the following isn't: + +.. code:: yaml + + v1: Hi! + v2: 3 + v3: "true" + v4: " I have spaces " + +This is because we assign a number to the `v2` key, not a string. +String dicts are used to define pairs of strings. diff --git a/docs/source/configuration/filters.rst b/docs/source/configuration/filters.rst index 4e8b733db..b7ea17b43 100644 --- a/docs/source/configuration/filters.rst +++ b/docs/source/configuration/filters.rst @@ -133,7 +133,14 @@ Built-in filters ā€˜fiducialā€™ - **_none** does nothing, useful when you want to remove a filter - with default value + with default value, but you want to keep the filters processing. + Can be used in a filter chain. + Note that an empty name will also create a **_none** filter +- **_null** does nothing, useful when you want to remove a filter + with default value, but you don't want to keep the filters processing. + Can't be used in a filter chain. + Note that inside a variant the filters processing will be triggered anyways, + by the variant itself, but **_null** is faster than **_none** - **_only_smd** is used to get only SMD parts - **_only_tht** is used to get only THT parts - **_only_virtual** is used to get only virtual parts diff --git a/docs/source/configuration/filters/BoMRegex.rst b/docs/source/configuration/filters/BoMRegex.rst new file mode 100644 index 000000000..935843dee --- /dev/null +++ b/docs/source/configuration/filters/BoMRegex.rst @@ -0,0 +1,16 @@ +.. _BoMRegex_fi: + + +BoMRegex parameters +~~~~~~~~~~~~~~~~~~~ + +- ``column`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the column to apply the regular expression. + Use `_field_lcsc_part` to get the value defined in the global options. +- *field* :index:`: ` Alias for column. +- ``invert`` :index:`: ` [:ref:`boolean `] (default: ``false``) Invert the regex match result. +- ``match_if_field`` :index:`: ` [:ref:`boolean `] (default: ``false``) Match if the field exists, no regex applied. Not affected by `invert`. +- ``match_if_no_field`` :index:`: ` [:ref:`boolean `] (default: ``false``) Match if the field doesn't exists, no regex applied. Not affected by `invert`. +- ``regex`` :index:`: ` [:ref:`string `] (default: ``''``) Regular expression to match. +- *regexp* :index:`: ` Alias for regex. +- ``skip_if_no_field`` :index:`: ` [:ref:`boolean `] (default: ``false``) Skip this test if the field doesn't exist. + diff --git a/docs/source/configuration/filters/FieldRename.rst b/docs/source/configuration/filters/FieldRename.rst new file mode 100644 index 000000000..d0cc91c19 --- /dev/null +++ b/docs/source/configuration/filters/FieldRename.rst @@ -0,0 +1,9 @@ +.. _FieldRename_fi: + + +FieldRename parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- ``field`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the field to rename. +- ``name`` :index:`: ` [:ref:`string `] (default: ``''``) New name. + diff --git a/docs/source/configuration/filters/Regex.rst b/docs/source/configuration/filters/Regex.rst new file mode 100644 index 000000000..9f72470c9 --- /dev/null +++ b/docs/source/configuration/filters/Regex.rst @@ -0,0 +1,18 @@ +.. _Regex_fi: + + +Regex parameters +~~~~~~~~~~~~~~~~ + +- ``angle`` :index:`: ` [:ref:`number `] (default: ``0.0``) Rotation offset to apply to the matched component. +- ``apply_angle`` :index:`: ` [:ref:`boolean `] (default: ``true``) Apply the angle offset. +- ``apply_offset`` :index:`: ` [:ref:`boolean `] (default: ``true``) Apply the position offset. +- ``field`` :index:`: ` [:ref:`string `] (default: ``'footprint'``) Name of field to apply the regular expression. + Use `_field_lcsc_part` to get the value defined in the global options. + Use `Footprint` for the name of the footprint without a library. + Use `Full Footprint` for the name of the footprint including the library. +- ``offset_x`` :index:`: ` [:ref:`number `] (default: ``0.0``) X position offset to apply to the matched component. +- ``offset_y`` :index:`: ` [:ref:`number `] (default: ``0.0``) Y position offset to apply to the matched component. +- ``regex`` :index:`: ` [:ref:`string `] (default: ``''``) Regular expression to match. +- *regexp* :index:`: ` Alias for regex. + diff --git a/docs/source/configuration/filters/SpecOptions.rst b/docs/source/configuration/filters/SpecOptions.rst new file mode 100644 index 000000000..12a3d65ce --- /dev/null +++ b/docs/source/configuration/filters/SpecOptions.rst @@ -0,0 +1,18 @@ +.. _SpecOptions_fi: + + +SpecOptions parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- **field** :index:`: ` [:ref:`string `] (default: ``''``) Name of the destination field. +- **spec** :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] Name/s of the source spec/s. + The following names are uniform across distributors: '_desc', '_value', '_tolerance', '_footprint', + '_power', '_current', '_voltage', '_frequency', '_temp_coeff', '_manf' and '_size'. + +- ``collision`` :index:`: ` [:ref:`string `] (default: ``'warning'``) (choices: "warning", "error", "ignore") How to report a collision between the current value and the new value. +- ``policy`` :index:`: ` [:ref:`string `] (default: ``'overwrite'``) (choices: "overwrite", "update", "new") Controls the behavior of the copy mechanism. + `overwrite` always copy the spec value, + `update` copy only if the field already exist, + `new` copy only if the field doesn't exist.. +- **type** :index:`: ` '' + diff --git a/docs/source/configuration/filters/expand_text_vars.rst b/docs/source/configuration/filters/expand_text_vars.rst new file mode 100644 index 000000000..824c7de7e --- /dev/null +++ b/docs/source/configuration/filters/expand_text_vars.rst @@ -0,0 +1,15 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Expand Text Variables; expand_text_vars + +Expand Text Variables +~~~~~~~~~~~~~~~~~~~~~ + + This filter expands KiCad 6 text variables (${VARIABLE}). + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``include_kicad_env`` :index:`: ` [:ref:`boolean `] (default: ``true``) Also expand KiCad environment variables. + - ``include_os_env`` :index:`: ` [:ref:`boolean `] (default: ``false``) Also expand system environment variables. + diff --git a/docs/source/configuration/filters/field_modify.rst b/docs/source/configuration/filters/field_modify.rst new file mode 100644 index 000000000..77c49ad16 --- /dev/null +++ b/docs/source/configuration/filters/field_modify.rst @@ -0,0 +1,24 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Field Modifier; field_modify + +Field Modifier +~~~~~~~~~~~~~~ + + Changes the content of one or more fields. + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``fields`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'Datasheet'``) [:ref:`comma separated `] Fields to convert. + + - ``include`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) Name of the filter to select which components will be affected. + Applied to all if nothing specified here. + + - ``regex`` :index:`: ` [:ref:`string `] (default: ``'(https?://\\S+)'``) Regular expression to match the field content. + Only fields that matches will be modified. + An empty regex will match anything. + The example matches an HTTP URL. + - ``replace`` :index:`: ` [:ref:`string `] (default: ``'\\1'``) Text to replace, can contain references to sub-expressions. + The example converts an HTTP URL into an HTML link, like the URLify filter. + diff --git a/docs/source/configuration/filters/field_rename.rst b/docs/source/configuration/filters/field_rename.rst new file mode 100644 index 000000000..9c9547a5e --- /dev/null +++ b/docs/source/configuration/filters/field_rename.rst @@ -0,0 +1,19 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Field Renamer; field_rename + +Field Renamer +~~~~~~~~~~~~~ + + This filter implements a field renamer. |br| + The internal `_kicost_rename` filter emulates the KiCost behavior. |br| + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``rename`` :index:`: ` [:ref:`FieldRename parameters `] [:ref:`list(dict) `] (default: ``[]``) Fields to rename. + +.. toctree:: + :caption: Used dicts + + FieldRename diff --git a/docs/source/configuration/filters/generic.rst b/docs/source/configuration/filters/generic.rst new file mode 100644 index 000000000..a7cf88cf5 --- /dev/null +++ b/docs/source/configuration/filters/generic.rst @@ -0,0 +1,52 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Generic filter; generic + +Generic filter +~~~~~~~~~~~~~~ + + This filter is based on regular expressions. |br| + It also provides some shortcuts for common situations. |br| + Note that matches aren't case sensitive and spaces at the beginning and the end are removed. |br| + The internal `_mechanical` filter emulates the KiBoM behavior for default exclusions. |br| + The internal `_kicost_dnp` filter emulates KiCost's `dnp` field. |br| + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``config_field`` :index:`: ` [:ref:`string `] (default: ``'Config'``) Name of the field used to classify components. + - ``config_separators`` :index:`: ` [:ref:`string `] (default: ``' ,'``) Characters used to separate options inside the config field. + - ``exclude_all_hash_ref`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude all components with a reference starting with #. + - ``exclude_any`` :index:`: ` [:ref:`BoMRegex parameters `] [:ref:`list(dict) `] (default: ``[]``) A series of regular expressions used to exclude parts. + If a component matches ANY of these, it will be excluded. + Column names are case-insensitive. + - ``exclude_bottom`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components on the bottom side of the PCB. + - ``exclude_config`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components containing a key value in the config field. + Separators are applied. + - ``exclude_empty_val`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components with empty 'Value'. + - ``exclude_field`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components if a field is named as any of the keys. + - ``exclude_not_in_bom`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components marked *Exclude from bill of materials* (KiCad 6+). + - ``exclude_not_on_board`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components marked *Exclude from board* (KiCad 6+). + - ``exclude_refs`` :index:`: ` [:ref:`list(string) `] (default: ``[]``) List of references to be excluded. + Use R* for all references with R prefix. + + - ``exclude_smd`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components marked as smd in the PCB. + - ``exclude_tht`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components marked as through-hole in the PCB. + - ``exclude_top`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components on the top side of the PCB. + - ``exclude_value`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components if their 'Value' is any of the keys. + - ``exclude_virtual`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components marked as virtual in the PCB. + - ``include_only`` :index:`: ` [:ref:`BoMRegex parameters `] [:ref:`list(dict) `] (default: ``[]``) A series of regular expressions used to include parts. + If there are any regex defined here, only components that match against ANY of them will be included. + Column/field names are case-insensitive. + If empty this rule is ignored. + - ``invert`` :index:`: ` [:ref:`boolean `] (default: ``false``) Invert the result of the filter. + - ``keys`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'dnf_list'``) (choices: "dnc_list", "dnf_list") (also accepts any string) List of keys to match. + The `dnf_list` and `dnc_list` internal lists can be specified as strings. + Use `dnf_list` for ['dnf', 'dnl', 'dnp', 'do not fit', 'do not load', 'do not place', 'no stuff', 'nofit', 'noload', 'noplace', 'nostuff', 'not fitted', 'not loaded', 'not placed']. + Use `dnc_list` for ['dnc', 'do not change', 'fixed', 'no change']. + + +.. toctree:: + :caption: Used dicts + + BoMRegex diff --git a/docs/source/configuration/filters/rot_footprint.rst b/docs/source/configuration/filters/rot_footprint.rst new file mode 100644 index 000000000..1bd7e4f13 --- /dev/null +++ b/docs/source/configuration/filters/rot_footprint.rst @@ -0,0 +1,57 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Footprint Rotator; rot_footprint + +Footprint Rotator +~~~~~~~~~~~~~~~~~ + + This filter can rotate footprints, used for the positions file generation. |br| + Some manufacturers use a different rotation than KiCad. |br| + The `JLCPCB Rotation Offset` and `JLCPCB Position Offset` fields can be used to adjust special cases. |br| + The internal `_rot_footprint` filter implements the simplest case. |br| + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``bennymeg_mode`` :index:`: ` [:ref:`boolean `] (default: ``true``) Implements the `rot_fields` and `offset_fields` in the same way that the bennymeg/JLC-Plugin-for-KiCad tool. + Note that the computation for bottom rotations is wrong, forcing the user to uses arbitrary rotations. + The correct computation is `(180 - component rot) + angle` but the plugin does `180 - (component rot + angle)`. + This option forces the wrong computation for compatibility. + This option also controls the way offset signs are interpreted. When enabled the offsets matches this plugin, + when disabled matches the interpretation used by the matthewlai/JLCKicadTools plugin. + Disabling this option you'll get better algorithms, but loose compatibility with this plugin. + - ``extend`` :index:`: ` [:ref:`boolean `] (default: ``true``) Extends the internal list of rotations with the one provided. + Otherwise just use the provided list. + Note that the provided list has more precedence than the internal list. + - ``invert_bottom`` :index:`: ` [:ref:`boolean `] (default: ``false``) Rotation for bottom components is negated, resulting in either: `(- component rot - angle)` + or when combined with `negative_bottom`, `(angle - component rot)`. + - ``mirror_bottom`` :index:`: ` [:ref:`boolean `] (default: ``false``) The original component rotation for components in the bottom is mirrored before applying + the adjust so you get `(180 - component rot + angle)`. This is used by JLCPCB. + - ``negative_bottom`` :index:`: ` [:ref:`boolean `] (default: ``true``) Rotation for bottom components is computed via subtraction as `(component rot - angle)`. + - ``offset_fields`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['JLCPCB Position Offset', 'JLCPosOffset']``) [:ref:`comma separated `] List of fields that can contain a position offset. + The optional fields can contain a comma separated x,y position offset. + This concept is from the bennymeg/JLC-Plugin-for-KiCad tool. + + - ``offsets`` :index:`: ` [:ref:`list(list(string)) `] (default: ``[]``) A list of pairs regular expression/offset. + Footprints matching the regular expression will be moved the specified offset. + The offset must be two numbers separated by a comma. The first is the X offset. + The signs matches the matthewlai/JLCKicadTools plugin specs. + + - ``rot_fields`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['JLCPCB Rotation Offset', 'JLCRotOffset']``) [:ref:`comma separated `] List of fields that can contain a rotation offset. + The optional fields can contain a counter-clockwise orientation offset in degrees. + This concept is from the bennymeg/JLC-Plugin-for-KiCad tool. + + - ``rotations`` :index:`: ` [:ref:`list(list(string)) `] (default: ``[]``) A list of pairs regular expression/rotation. + Footprints matching the regular expression will be rotated the indicated angle. + The angle matches the matthewlai/JLCKicadTools plugin specs. + + - ``rotations_and_offsets`` :index:`: ` [:ref:`Regex parameters `] [:ref:`list(dict) `] (default: ``[]``) A list of rules to match components and specify the rotation and offsets. + This is a more flexible version of the `rotations` and `offsets` options. + Note that this list has more precedence. + - ``skip_bottom`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not rotate components on the bottom. + - ``skip_top`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not rotate components on the top. + +.. toctree:: + :caption: Used dicts + + Regex diff --git a/docs/source/configuration/filters/separate_pins.rst b/docs/source/configuration/filters/separate_pins.rst new file mode 100644 index 000000000..a09afc2a2 --- /dev/null +++ b/docs/source/configuration/filters/separate_pins.rst @@ -0,0 +1,27 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Separate Pins; separate_pins + +Separate Pins +~~~~~~~~~~~~~ + + This filter can create pseudo-components from pins of the components. |br| + Is used to create special BoMs to perform electrical checks using nail of beds. |br| + Use it as a `pre_transform` filter for the `bom` output. |br| + +.. note:: + The pin coordinates aren't affected by the rotation filters. |br| + +.. note:: + Needs KiCad 6 or newer. |br| +.. + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``attribute`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['testpoint']``) (choices: "bga", "local_fiducial", "global_fiducial", "testpoint", "heatsink", "castellated", "none") Fabrication + attribute/s of the included pads. + + - ``keep_component`` :index:`: ` [:ref:`boolean `] (default: ``false``) If we also keep the original component or we just get the selected pads. + - ``ref_sep`` :index:`: ` [:ref:`string `] (default: ``'.'``) Separator used in the reference (i.e. R10.1). + diff --git a/docs/source/configuration/filters/spec_to_field.rst b/docs/source/configuration/filters/spec_to_field.rst new file mode 100644 index 000000000..fc8c6440c --- /dev/null +++ b/docs/source/configuration/filters/spec_to_field.rst @@ -0,0 +1,29 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Spec to Field; spec_to_field + +Spec to Field +~~~~~~~~~~~~~ + + This filter extracts information from the specs obtained from component distributors + and fills fields. |br| + I.e. create a field with the RoHS status of a component. |br| + In order to make it work you must be able to get prices using the KiCost options of + the `bom` output. Make sure you can do this before trying to use this filter. |br| + Usage `example `__. |br| + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **from_output** :index:`: ` [:ref:`string `] (default: ``''``) Name of the output used to collect the specs. + Currently this must be a `bom` output with KiCost enabled and a distributor that returns specs. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - **specs** :index:`: ` [:ref:`SpecOptions parameters `] [:ref:`list(dict) ` | :ref:`dict `] (default: ``[{'spec': '_voltage', 'field': '_field_voltage'}, {'spec': '_tolerance', 'field': '_field_tolerance'}, {'spec': '_power', 'field': '_field_power'}, {'spec': '_current', 'field': '_field_current'}]``) One or more specs to be copied. + - ``check_dist_coherence`` :index:`: ` [:ref:`boolean `] (default: ``true``) Check that the data we got from different distributors is equivalent. + - ``check_dist_fields`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['_value', '_tolerance', '_power', '_current', '_voltage', '_temp_coeff']``) [:ref:`comma separated `] List of fields to include in the check. + For a full list of fields consult the `specs` option. + + +.. toctree:: + :caption: Used dicts + + SpecOptions diff --git a/docs/source/configuration/filters/subparts.rst b/docs/source/configuration/filters/subparts.rst new file mode 100644 index 000000000..fa3a94941 --- /dev/null +++ b/docs/source/configuration/filters/subparts.rst @@ -0,0 +1,32 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Subparts; subparts + +Subparts +~~~~~~~~ + + This filter implements the KiCost subparts mechanism. |br| + It allows to have more than one part in the same schematic symbol. |br| + Some people use it to include connectors and cables related to a connector in the PCB. |br| + `KiCost docs `__. |br| + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``check_multiplier`` :index:`: ` [:ref:`list(string) `] (default: computed for your project) List of fields to include for multiplier computation. + If empty all fields in `split_fields` and `manf_pn_field` are used. + + - ``manf_field`` :index:`: ` [:ref:`string `] (default: ``'manf'``) Field for the manufacturer name. + - ``manf_pn_field`` :index:`: ` [:ref:`string `] (default: ``'manf#'``) Field for the manufacturer part number. + - ``modify_first_value`` :index:`: ` [:ref:`boolean `] (default: ``true``) Modify even the value for the first component in the list (KiCost behavior). + - ``modify_value`` :index:`: ` [:ref:`boolean `] (default: ``true``) Add '- p N/M' to the value. + - ``mult_separators`` :index:`: ` [:ref:`string `] (default: ``':'``) Separators used for the multiplier. Each character in this string is a valid separator. + - ``multiplier`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enables the subpart multiplier mechanism. + - ``ref_sep`` :index:`: ` [:ref:`string `] (default: ``'#'``) Separator used in the reference (i.e. R10#1). + - ``separators`` :index:`: ` [:ref:`string `] (default: ``';,'``) Separators used between subparts. Each character in this string is a valid separator. + - ``split_fields`` :index:`: ` [:ref:`list(string) `] (default: ``['arrow#', 'digikey#', 'farnell#', 'lcsc#', 'mouser#', 'newark#', 'rs#', 'tme#']``) List of fields to split, usually the distributors part numbers. + + - ``split_fields_expand`` :index:`: ` [:ref:`boolean `] (default: ``false``) When `true` the fields in `split_fields` are added to the internal names. + - ``use_ref_sep_for_first`` :index:`: ` [:ref:`boolean `] (default: ``true``) Force the reference separator use even for the first component in the list (KiCost behavior). + - ``value_alt_field`` :index:`: ` [:ref:`string `] (default: ``'value_subparts'``) Field containing replacements for the `Value` field. So we get real values for split parts. + diff --git a/docs/source/configuration/filters/urlify.rst b/docs/source/configuration/filters/urlify.rst new file mode 100644 index 000000000..5f3b8a846 --- /dev/null +++ b/docs/source/configuration/filters/urlify.rst @@ -0,0 +1,15 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: URLify; urlify + +URLify +~~~~~~ + + Converts URL text in fields to HTML URLs. + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``fields`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'Datasheet'``) [:ref:`comma separated `] Fields to convert. + + diff --git a/docs/source/configuration/filters/value_split.rst b/docs/source/configuration/filters/value_split.rst new file mode 100644 index 000000000..e05a779e0 --- /dev/null +++ b/docs/source/configuration/filters/value_split.rst @@ -0,0 +1,30 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Value Splitter; value_split + +Value Splitter +~~~~~~~~~~~~~~ + + This filter extracts information from the value and fills other fields. |br| + I.e. extracts the tolerance and puts it in the `tolerance` field. |br| + Usage `example `__. |br| + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``autoplace`` :index:`: ` [:ref:`boolean `] (default: ``true``) Try to figure out the position for the added fields. + - ``autoplace_mechanism`` :index:`: ` [:ref:`string `] (default: ``'bottom'``) (choices: "bottom", "top") Put the new field at the bottom/top of the last field. + - ``package`` :index:`: ` [:ref:`string `] (default: ``'yes'``) (choices: "yes", "no", "soft") Policy for the package. + yes = overwrite existing value, no = don't touch, soft = copy if not defined. + - ``power`` :index:`: ` [:ref:`string `] (default: ``'yes'``) (choices: "yes", "no", "soft") Policy for the power rating. + yes = overwrite existing value, no = don't touch, soft = copy if not defined. + - ``replace_source`` :index:`: ` [:ref:`boolean `] (default: ``true``) Replace the content of the source field using a normalized representation of the interpreted value. + - ``source`` :index:`: ` [:ref:`string `] (default: ``'Value'``) Name of the field to use as source of information. + - ``temp_coef`` :index:`: ` [:ref:`string `] (default: ``'yes'``) (choices: "yes", "no", "soft") Policy for the temperature coefficient. + yes = overwrite existing value, no = don't touch, soft = copy if not defined. + - ``tolerance`` :index:`: ` [:ref:`string `] (default: ``'yes'``) (choices: "yes", "no", "soft") Policy for the tolerance. + yes = overwrite existing value, no = don't touch, soft = copy if not defined. + - ``visible`` :index:`: ` [:ref:`boolean `] (default: ``false``) Make visible the modified fields. + - ``voltage`` :index:`: ` [:ref:`string `] (default: ``'yes'``) (choices: "yes", "no", "soft") Policy for the voltage rating. + yes = overwrite existing value, no = don't touch, soft = copy if not defined. + diff --git a/docs/source/configuration/filters/var_rename.rst b/docs/source/configuration/filters/var_rename.rst new file mode 100644 index 000000000..6c4935030 --- /dev/null +++ b/docs/source/configuration/filters/var_rename.rst @@ -0,0 +1,21 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Variant Renamer; var_rename + +Variant Renamer +~~~~~~~~~~~~~~~ + + This filter implements the VARIANT:FIELD=VALUE renamer to get FIELD=VALUE when VARIANT is in use. |br| + As an example: a field named *V1:MPN* with value *1N4001* will change the field *MPN* to be + *1N4001* when the variant in use is *V1*. |br| + Note that this mechanism can be used to change a footprint, i.e. *VARIANT:Footprint* assigned + with *Diode_SMD:D_0805_2012Metric* will change the footprint when *VARIANT* is in use. Of course the + footprints should be similar, or your PCB will become invalid. |br| + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``force_variant`` :index:`: ` [:ref:`string `] (default: ``''``) Use this variant instead of the current variant. Useful for IBoM variants. + - ``separator`` :index:`: ` [:ref:`string `] (default: ``':'``) Separator used between the variant and the field name. + - ``variant_to_value`` :index:`: ` [:ref:`boolean `] (default: ``false``) Rename fields matching the variant to the value of the component. + diff --git a/docs/source/configuration/filters/var_rename_kicost.rst b/docs/source/configuration/filters/var_rename_kicost.rst new file mode 100644 index 000000000..b7c49137e --- /dev/null +++ b/docs/source/configuration/filters/var_rename_kicost.rst @@ -0,0 +1,27 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Variant Renamer KiCost style; var_rename_kicost + +Variant Renamer KiCost style +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This filter implements the kicost.VARIANT:FIELD=VALUE renamer to get FIELD=VALUE when VARIANT is in use. |br| + It applies the KiCost concept of variants (a regex to match the VARIANT). |br| + As an example: a field named *kicost.V1:MPN* with value *1N4001* will change the field *MPN* to be + *1N4001* when a variant in use matches the *V1* string. |br| + Note that this mechanism can be used to change a footprint, i.e. *kicost.VARIANT:Footprint* assigned + with *Diode_SMD:D_0805_2012Metric* will change the footprint when *VARIANT* is matched. Of course the + footprints should be similar, or your PCB will become invalid. |br| + The internal `_var_rename_kicost` filter is configured to emulate the KiCost behavior. You can create + other filters to fine-tune the behavior, i.e. you can make the mechanism to be triggered by fields + like *kibot.VARIANT|FIELD*. |br| + + - **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular filter definition. + - ``prefix`` :index:`: ` [:ref:`string `] (default: ``'kicost.'``) A mandatory prefix. Is not case sensitive. + - ``separator`` :index:`: ` [:ref:`string `] (default: ``':'``) Separator used between the variant and the field name. + - ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Variant regex to match the VARIANT part. + When empty the currently selected variant is used. + - ``variant_to_value`` :index:`: ` [:ref:`boolean `] (default: ``false``) Rename fields matching the variant to the value of the component. + diff --git a/docs/source/configuration/imports.rst b/docs/source/configuration/imports.rst index 9fea4aa1e..525d01d36 100644 --- a/docs/source/configuration/imports.rst +++ b/docs/source/configuration/imports.rst @@ -312,6 +312,31 @@ Here is a list of currently defined templates and their outputs / groups: - `PCBWay_stencil `__: same as **PCBWay**, but also generates gerbers for *F.Paste* and *B.Paste* layers. +- **Testpoints_by_attr**: Creates a testpoints report in XLSX format. All pads with the testpoint fabrication attribute will be reported. + + - **_testpoints_attr**: The testpoint report + +- **Testpoints_by_attr_csv**: Creates a testpoints report in CSV format. All pads with the testpoint fabrication attribute will be reported. + + - **_testpoints_attr_csv**: The testpoint report + +- **Testpoints_by_attr_html**: Creates a testpoints report in HTML format. All pads with the testpoint fabrication attribute will be reported. + + - **_testpoints_attr_html**: The testpoint report + +- **Testpoints_by_value**: Creates a testpoints report in XLSX format. All components with value starting with *TestPoint* will be reported. + + - **_testpoints_value**: The testpoint report + +- **Testpoints_by_value_csv**: Creates a testpoints report in CSV format. All components with value starting with *TestPoint* will be reported. + + - **_testpoints_value_csv**: The testpoint report + +- **Testpoints_by_value_html**: Creates a testpoints report in HTML format. All components with value starting with *TestPoint* will be reported. + + - **_testpoints_value_html**: The testpoint report + + .. _templates-parameters: @@ -378,6 +403,17 @@ ExportProject: Note that manufacturer templates named *\*_stencil* are created using parameters. As an example: *Elecrow_stencil* is just *Elecrow* customized like this: +Tespoint reports: + +- **_KIBOT_IMPORT_ID**: Suffix used for the output (default: '', but used for the CSV and HTML versions) +- **_KIBOT_IMPORT_DIR**: Target directory for the output (default: 'Testpoints') +- **_KIBOT_TESTPOINTS_FORMAT**: Format for the report, the default is 'XLSX', the CSV and HTML templates defines it accordingly. +- **_KIBOT_PRE_TRANSFORM**: Pre-transform filter. The default always includes *_kicost_rename*. In the attribute version it also includes + a filter named *_separate_pins_for_tp* used to filter the pads with testpoint attribute. +- **_KIBOT_DNF_FILTER**: The filter used to mark things as Do Not Fit. The default is '_null'. We include the DNF components. +- **_KIBOT_EXCLUDE_FILTER**: The filter used to exclude components. In the attributes version this filter is `_null` and in the values + version is a filter named *_separate_testpoints* that matches components with a value starting with *TestPoint*. + .. code:: yaml diff --git a/docs/source/configuration/outputs.rst b/docs/source/configuration/outputs.rst index d38c86a82..edd4d5262 100644 --- a/docs/source/configuration/outputs.rst +++ b/docs/source/configuration/outputs.rst @@ -682,11 +682,14 @@ In addition to all the user defined fields you also have the following columns: - **Footprint Rot**: The rotation angle for the footprint. - **Footprint Side**: The side of the footprint, *bottom* or *top*. - **Footprint Type**: The type of the footprint, can be: *SMD*, *THT* or *VIRTUAL*. +- **Footprint Type NV**: The type of the footprint, can be: *SMD* or *THT*. Empty if not defined. Affected by the **footprint_type_values** option. - **Footprint Populate**: If the footprint is populated (soldered) or not, can be: *yes* or *no*. Affected by the **footprint_populate_values** option. - **Footprint X-Size**: The footprint width, no rotation computed. - **Footprint Y-Size**: The footprint height, no rotation computed. +- **Net Name**: Name of the nets associated with the footprint. Useful for testpoints. +- **Net Class**: Name of the net classes associated with the footprint. Useful for testpoints. - **Part**: The name of the symbol for the component, without the library name. - **Part Lib**: The name of the library for the symbol. - **Datasheet**: The datasheet from the standard field. diff --git a/docs/source/configuration/outputs/Aggregate.rst b/docs/source/configuration/outputs/Aggregate.rst new file mode 100644 index 000000000..c5d030ad8 --- /dev/null +++ b/docs/source/configuration/outputs/Aggregate.rst @@ -0,0 +1,11 @@ +.. _Aggregate: + + +Aggregate parameters +~~~~~~~~~~~~~~~~~~~~ + +- *board_qty* :index:`: ` Alias for number. +- **file** :index:`: ` [:ref:`string `] (default: ``''``) Name of the XML to aggregate. +- **number** :index:`: ` [:ref:`number `] (default: ``100``) Number of boards to build (components multiplier). +- ``variant`` :index:`: ` [:ref:`string `] (default: ``' '``) Variant for this project. + diff --git a/docs/source/configuration/outputs/BlenderCameraOptions.rst b/docs/source/configuration/outputs/BlenderCameraOptions.rst new file mode 100644 index 000000000..4d6a2bcd2 --- /dev/null +++ b/docs/source/configuration/outputs/BlenderCameraOptions.rst @@ -0,0 +1,17 @@ +.. _BlenderCameraOptions: + + +BlenderCameraOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``clip_start`` :index:`: ` [:ref:`number `] (default: ``-1``) Minimum distance for objects to the camera. Any object closer than this distance won't be visible. + Only positive values have effect. A negative value has a special meaning. + For a camera with defined position, a negative value means to use Blender defaults (i.e. 0.1 m). + For cameras without position KiBot will ask Blender to compute its position and the use a clip + distance that is 1/10th of the Z distance. +- ``name`` :index:`: ` [:ref:`string `] (default: ``''``) Name for the camera. +- ``pos_x`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) X position [m]. You can use `width`, `height` and `size` for PCB dimensions. +- ``pos_y`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Y position [m]. You can use `width`, `height` and `size` for PCB dimensions. +- ``pos_z`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Z position [m]. You can use `width`, `height` and `size` for PCB dimensions. +- **type** :index:`: ` '' + diff --git a/docs/source/configuration/outputs/BlenderLightOptions.rst b/docs/source/configuration/outputs/BlenderLightOptions.rst new file mode 100644 index 000000000..979e36901 --- /dev/null +++ b/docs/source/configuration/outputs/BlenderLightOptions.rst @@ -0,0 +1,13 @@ +.. _BlenderLightOptions: + + +BlenderLightOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``energy`` :index:`: ` [:ref:`number `] (default: ``0``) How powerful is the light. Using 0 for POINT and SUN KiBot will try to use something useful. +- ``name`` :index:`: ` [:ref:`string `] (default: ``''``) Name for the light. +- ``pos_x`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) X position [m]. You can use `width`, `height` and `size` for PCB dimensions. +- ``pos_y`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Y position [m]. You can use `width`, `height` and `size` for PCB dimensions. +- ``pos_z`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Z position [m]. You can use `width`, `height` and `size` for PCB dimensions. +- **type** :index:`: ` '' + diff --git a/docs/source/configuration/outputs/BlenderOutputOptions.rst b/docs/source/configuration/outputs/BlenderOutputOptions.rst new file mode 100644 index 000000000..467d05b2c --- /dev/null +++ b/docs/source/configuration/outputs/BlenderOutputOptions.rst @@ -0,0 +1,11 @@ +.. _BlenderOutputOptions: + + +BlenderOutputOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **type** :index:`: ` '' +- ``dir`` :index:`: ` [:ref:`string `] (default: ``''``) Subdirectory for this output. +- ``output`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the generated file (%i='3D_blender_$VIEW' %x=VARIABLE). + The extension is selected from the type. Affected by global options. + diff --git a/docs/source/configuration/outputs/BlenderPointOfViewOptions.rst b/docs/source/configuration/outputs/BlenderPointOfViewOptions.rst new file mode 100644 index 000000000..a068e3fc2 --- /dev/null +++ b/docs/source/configuration/outputs/BlenderPointOfViewOptions.rst @@ -0,0 +1,18 @@ +.. _BlenderPointOfViewOptions: + + +BlenderPointOfViewOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **view** :index:`: ` [:ref:`string `] (default: ``'top'``) (choices: "top", "bottom", "front", "rear", "right", "left", "z", "Z", "y", "Y", "x", "X") Point of view. + Compatible with `render_3d`. +- ``file_id`` :index:`: ` [:ref:`string `] (default: ``''``) String to differentiate the name of this point of view. + When empty we use the `default_file_id` or the `view`. +- ``rotate_x`` :index:`: ` [:ref:`number `] (default: ``0``) Angle to rotate the board in the X axis, positive is clockwise [degrees]. +- ``rotate_y`` :index:`: ` [:ref:`number `] (default: ``0``) Angle to rotate the board in the Y axis, positive is clockwise [degrees]. +- ``rotate_z`` :index:`: ` [:ref:`number `] (default: ``0``) Angle to rotate the board in the Z axis, positive is clockwise [degrees]. +- ``steps`` :index:`: ` [:ref:`number `] (default: ``1``) (range: 1 to 1000) Generate this amount of steps using the rotation angles as increments. + Use a value of 1 (default) to interpret the angles as absolute. + Used for animations. You should define the `default_file_id` to something like + '_%03d' to get the animation frames. + diff --git a/docs/source/configuration/outputs/BlenderRenderOptions.rst b/docs/source/configuration/outputs/BlenderRenderOptions.rst new file mode 100644 index 000000000..42de4d0c2 --- /dev/null +++ b/docs/source/configuration/outputs/BlenderRenderOptions.rst @@ -0,0 +1,20 @@ +.. _BlenderRenderOptions: + + +BlenderRenderOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **samples** :index:`: ` [:ref:`number `] (default: ``10``) How many samples we create. Each sample is a raytracing render. + Use 1 for a raw preview, 10 for a draft and 100 or more for the final render. +- **transparent_background** :index:`: ` [:ref:`boolean `] (default: ``false``) Make the background transparent. +- ``auto_crop`` :index:`: ` [:ref:`boolean `] (default: ``false``) When enabled the image will be post-processed to remove the empty space around the image. + In this mode the `background2` is changed to be the same as `background1`. +- ``background1`` :index:`: ` [:ref:`string `] (default: ``'#66667F'``) First color for the background gradient. +- ``background2`` :index:`: ` [:ref:`string `] (default: ``'#CCCCE5'``) Second color for the background gradient. +- *height* :index:`: ` Alias for resolution_y. +- ``no_denoiser`` :index:`: ` [:ref:`boolean `] (default: ``false``) Used to disable the render denoiser on old hardware, or when the functionality isn't compiled. + Note that the impact in quality is huge, you should increase the amount of samples 10 times. +- ``resolution_x`` :index:`: ` [:ref:`number `] (default: ``1280``) Width of the image. +- ``resolution_y`` :index:`: ` [:ref:`number `] (default: ``720``) Height of the image. +- *width* :index:`: ` Alias for resolution_x. + diff --git a/docs/source/configuration/outputs/Blender_ExportOptions.rst b/docs/source/configuration/outputs/Blender_ExportOptions.rst new file mode 100644 index 000000000..4e22b8b32 --- /dev/null +++ b/docs/source/configuration/outputs/Blender_ExportOptions.rst @@ -0,0 +1,37 @@ +.. _Blender_ExportOptions: + + +Blender_ExportOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **pcb3d** :index:`: ` [:ref:`PCB3DExportOptions parameters `] [:ref:`string ` | :ref:`dict `] (default: empty dict, default values used) Options to export the PCB to Blender. + You can also specify the name of the output that generates the PCB3D file. + See the `PCB2Blender_2_1`, `PCB2Blender_2_7` and `PCB2Blender_2_1_haschtl` templates. +- **point_of_view** :index:`: ` [:ref:`BlenderPointOfViewOptions parameters `] [:ref:`dict ` | :ref:`list(dict) `] (default: ``[{'view': 'top'}]``) How the object is viewed by the camera. +- **render_options** :index:`: ` [:ref:`BlenderRenderOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Controls how the render is done for the `render` output type. +- ``add_default_light`` :index:`: ` [:ref:`boolean `] (default: ``true``) Add a default light when none specified. + The default light is located at (-size*3.33, size*3.33, size*5) where size is max(width, height) of the PCB. +- ``auto_camera_z_axis_factor`` :index:`: ` [:ref:`number `] (default: ``1.1``) Value to multiply the Z axis coordinate after computing the automatically generated camera. + Used to avoid collision of the camera and the object. +- ``camera`` :index:`: ` [:ref:`BlenderCameraOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the camera. + If none specified KiBot will create a suitable camera. + If no position is specified for the camera KiBot will look for a suitable position. +- ``default_file_id`` :index:`: ` [:ref:`string `] (default: ``''``) Default value for the `file_id` in the `point_of_view` options. + Use something like '_%03d' for animations. +- ``fixed_auto_camera`` :index:`: ` [:ref:`boolean `] (default: ``false``) When using the automatically generated camera and multiple points of view this option computes the camera + position just once. Suitable for videos. +- ``light`` :index:`: ` [:ref:`BlenderLightOptions parameters `] [:ref:`dict ` | :ref:`list(dict) `] (default: ``[{'name': 'kibot_light', 'pos_x': '-size*3.33', 'pos_y': 'size*3.33', 'pos_z': 'size*5', 'energy': 0}]``) Options for the light/s. +- ``outputs`` :index:`: ` [:ref:`BlenderOutputOptions parameters `] [:ref:`dict ` | :ref:`list(dict) `] (default: ``[{'type': 'render'}]``) Outputs to generate in the same run. +- ``pcb_import`` :index:`: ` [:ref:`PCB2BlenderOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options to configure how Blender imports the PCB. + The default values are good for most cases. + +.. toctree:: + :caption: Used dicts + + BlenderCameraOptions + BlenderLightOptions + BlenderOutputOptions + BlenderPointOfViewOptions + BlenderRenderOptions + PCB2BlenderOptions + PCB3DExportOptions diff --git a/docs/source/configuration/outputs/BoMCSV.rst b/docs/source/configuration/outputs/BoMCSV.rst new file mode 100644 index 000000000..9d3bb60fa --- /dev/null +++ b/docs/source/configuration/outputs/BoMCSV.rst @@ -0,0 +1,13 @@ +.. _BoMCSV: + + +BoMCSV parameters +~~~~~~~~~~~~~~~~~ + +- **quote_all** :index:`: ` [:ref:`boolean `] (default: ``false``) Enclose all values using double quotes. +- **separator** :index:`: ` [:ref:`string `] (default: ``','``) CSV Separator. TXT and TSV always use tab as delimiter. + Only one character can be specified. +- ``hide_header`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide the header line (names of the columns). +- ``hide_pcb_info`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide project information. +- ``hide_stats_info`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide statistics information. + diff --git a/docs/source/configuration/outputs/BoMColumns.rst b/docs/source/configuration/outputs/BoMColumns.rst new file mode 100644 index 000000000..23441e983 --- /dev/null +++ b/docs/source/configuration/outputs/BoMColumns.rst @@ -0,0 +1,17 @@ +.. _BoMColumns: + + +BoMColumns parameters +~~~~~~~~~~~~~~~~~~~~~ + +- **field** :index:`: ` [:ref:`string `] (default: ``''``) Name of the field to use for this column. + Use `_field_lcsc_part` to get the value defined in the global options. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Name to display in the header. The field is used when empty. +- ``comment`` :index:`: ` [:ref:`string `] (default: ``''``) Used as explanation for this column. The XLSX output uses it. +- ``join`` :index:`: ` [:ref:`BoMJoinField parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``''``) List of fields to join to this column. +- ``level`` :index:`: ` [:ref:`number `] (default: ``0``) Used to group columns. The XLSX output uses it to collapse columns. + +.. toctree:: + :caption: Used dicts + + BoMJoinField diff --git a/docs/source/configuration/outputs/BoMHTML.rst b/docs/source/configuration/outputs/BoMHTML.rst new file mode 100644 index 000000000..5bfa12c29 --- /dev/null +++ b/docs/source/configuration/outputs/BoMHTML.rst @@ -0,0 +1,35 @@ +.. _BoMHTML: + + +BoMHTML parameters +~~~~~~~~~~~~~~~~~~ + +- **datasheet_as_link** :index:`: ` [:ref:`string `] (default: ``''``) [:ref:`case insensitive `]Column with links to the datasheet. +- **generate_dnf** :index:`: ` [:ref:`boolean `] (default: ``true``) Generate a separated section for DNF (Do Not Fit) components. +- **logo** :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) PNG/SVG file to use as logo, use false to remove. + Note that when using an SVG this is first converted to a PNG using `logo_width`. + +- **title** :index:`: ` [:ref:`string `] (default: ``'KiBot Bill of Materials'``) BoM title. +- ``col_colors`` :index:`: ` [:ref:`boolean `] (default: ``true``) Use colors to show the field type. +- ``digikey_link`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`case insensitive `]Column/s containing Digi-Key part numbers, will be linked to web page. + +- ``extra_info`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) Information to put after the title and before the pcb and stats info. + +- ``hide_pcb_info`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide project information. +- ``hide_stats_info`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide statistics information. +- ``highlight_empty`` :index:`: ` [:ref:`boolean `] (default: ``true``) Use a color for empty cells. Applies only when `col_colors` is `true`. +- ``lcsc_link`` :index:`: ` [:ref:`boolean ` | :ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`case insensitive `]Column/s containing LCSC part numbers, will be linked to web page. + Use **true** to copy the value indicated by the `field_lcsc_part` global option. + +- ``logo_width`` :index:`: ` [:ref:`number `] (default: ``370``) Used when the logo is an SVG image. This width is used to render the SVG image. +- ``mouser_link`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`case insensitive `]Column/s containing Mouser part numbers, will be linked to web page. + +- ``row_colors`` :index:`: ` [:ref:`RowColors parameters `] [:ref:`list(dict) `] (default: ``[]``) Used to highlight rows using filters. Rows that match a filter can be colored. + Note that these rows won't have colored columns. +- ``style`` :index:`: ` [:ref:`string `] (default: ``'modern-blue'``) Page style. Internal styles: modern-blue, modern-green, modern-red and classic. + Or you can provide a CSS file name. Please use .css as file extension.. + +.. toctree:: + :caption: Used dicts + + RowColors diff --git a/docs/source/configuration/outputs/BoMJoinField.rst b/docs/source/configuration/outputs/BoMJoinField.rst new file mode 100644 index 000000000..cd25b0ff3 --- /dev/null +++ b/docs/source/configuration/outputs/BoMJoinField.rst @@ -0,0 +1,17 @@ +.. _BoMJoinField: + + +BoMJoinField parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- **field** :index:`: ` [:ref:`string `] (default: ``''``) [:ref:`case insensitive `]Name of the field. +- ``text`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use instead of a field. This option is incompatible with the `field` option. + Any space to separate it should be added in the text. + Use \\n for newline and \\t for tab. +- ``text_after`` :index:`: ` [:ref:`string `] (default: ``''``) Text to add after the field content. Will be added only if the field isn't empty. + Any space to separate it should be added in the text. + Use \\n for newline and \\t for tab. +- ``text_before`` :index:`: ` [:ref:`string `] (default: ``''``) Text to add before the field content. Will be added only if the field isn't empty. + Any space to separate it should be added in the text. + Use \\n for newline and \\t for tab. + diff --git a/docs/source/configuration/outputs/BoMOptions.rst b/docs/source/configuration/outputs/BoMOptions.rst new file mode 100644 index 000000000..0f498a18c --- /dev/null +++ b/docs/source/configuration/outputs/BoMOptions.rst @@ -0,0 +1,128 @@ +.. _BoMOptions: + + +BoMOptions parameters +~~~~~~~~~~~~~~~~~~~~~ + +- **columns** :index:`: ` [:ref:`BoMColumns parameters `] [:ref:`list(dict) ` | :ref:`list(string) `] (default: computed for your project) List of columns to display. + Can be just the name of the field. + In addition to all user defined fields you have various special columns, consult :ref:`bom_columns`. +- **csv** :index:`: ` [:ref:`BoMCSV parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the CSV, TXT and TSV formats. +- **format** :index:`: ` [:ref:`string `] (default: ``'Auto'``) (choices: "HTML", "CSV", "TXT", "TSV", "XML", "XLSX", "HRTXT", "Auto") format for the BoM. + `Auto` defaults to CSV or a guess according to the options. + HRTXT stands for Human Readable TeXT. +- **group_fields** :index:`: ` [:ref:`list(string) `] (default: ``['part', 'part lib', 'value', 'footprint', 'footprint lib', 'voltage', 'tolerance', 'current', 'power']``) [:ref:`case insensitive `]List of fields used for sorting individual components into groups. + Components which match (comparing *all* fields) will be grouped together. + Field names are case-insensitive. + For empty fields the behavior is defined by the `group_fields_fallbacks`, `merge_blank_fields` and + `merge_both_blank` options. + Note that for resistors, capacitors and inductors the _Value_ field is parsed and qualifiers, like + tolerance, are discarded. Please use a separated field and disable `merge_blank_fields` if this + information is important. You can also disable `parse_value`. + If empty: ['Part', 'Part Lib', 'Value', 'Footprint', 'Footprint Lib', + 'Voltage', 'Tolerance', 'Current', 'Power'] is used. + +- **hrtxt** :index:`: ` [:ref:`BoMTXT parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the HRTXT formats. +- **html** :index:`: ` [:ref:`BoMHTML parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the HTML format. +- **ignore_dnf** :index:`: ` [:ref:`boolean `] (default: ``true``) Exclude DNF (Do Not Fit) components. +- **normalize_values** :index:`: ` [:ref:`boolean `] (default: ``false``) Try to normalize the R, L and C values, producing uniform units and prefixes. +- **number** :index:`: ` [:ref:`number `] (default: ``1``) Number of boards to build (components multiplier). +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) filename for the output (%i=bom). Affected by global options. +- **sort_style** :index:`: ` [:ref:`string `] (default: ``'type_value'``) (choices: "type_value", "type_value_ref", "ref") Sorting criteria. +- **units** :index:`: ` [:ref:`string `] (default: ``'millimeters'``) (choices: "millimeters", "inches", "mils") Units used for the positions ('Footprint X' and 'Footprint Y' columns). + Affected by global options. +- **xlsx** :index:`: ` [:ref:`BoMXLSX parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the XLSX format. +- ``aggregate`` :index:`: ` [:ref:`Aggregate parameters `] [:ref:`list(dict) `] (default: ``[]``) Add components from other projects. + You can use CSV files, the first row must contain the names of the fields. + The `Reference` and `Value` are mandatory, in most cases `Part` is also needed. + The `Part` column should contain the name/type of the component. This is important for + passive components (R, L, C, etc.). If this information isn't available consider + configuring the grouping to exclude the `Part`.. +- ``angle_positive`` :index:`: ` [:ref:`boolean `] (default: ``true``) Always use positive values for the footprint rotation. +- ``bottom_negative_x`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use negative X coordinates for footprints on bottom layer (for XYRS). +- ``component_aliases`` :index:`: ` [:ref:`list(list(string)) `] (default: ``[['r', 'r_small', 'res', 'resistor'], ['l', 'l_small', 'inductor'], ['c', 'c_small', 'cap', 'capacitor'], ['sw', 'switch'], ['zener', 'zenersmall'], ['d', 'diode', 'd_small']]``) A series of values which are considered to be equivalent for the part name. + Each entry is a list of equivalen names. Example: ['c', 'c_small', 'cap' ] + will ensure the equivalent capacitor symbols can be grouped together. + If empty the following aliases are used: + + - ['r', 'r_small', 'res', 'resistor'] + - ['l', 'l_small', 'inductor'] + - ['c', 'c_small', 'cap', 'capacitor'] + - ['sw', 'switch'] + - ['zener', 'zenersmall'] + - ['d', 'diode', 'd_small']. + +- ``cost_extra_columns`` :index:`: ` [:ref:`BoMColumns parameters `] [:ref:`list(dict) ` | :ref:`list(string) `] (default: ``[]``) List of columns to add to the global section of the cost. + Can be just the name of the field. +- ``count_smd_tht`` :index:`: ` [:ref:`boolean `] (default: ``false``) Show the stats about how many of the components are SMD/THT. You must provide the PCB. +- ``distributors`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) [:ref:`comma separated `] Include this distributors list. Default is all the available. + +- ``dnc_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_kibom_dnc_CONFIG_FIELD'``) Name of the filter to mark components as 'Do Not Change'. + The default filter marks components with a DNC value or DNC in the Config field. + This option is for simple cases, consider using a full variant for complex cases. + +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_kibom_dnf_CONFIG_FIELD'``) Name of the filter to mark components as 'Do Not Fit'. + The default filter marks components with a DNF value or DNF in the Config field. + This option is for simple cases, consider using a full variant for complex cases. + +- ``exclude_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_mechanical'``) Name of the filter to exclude components from BoM processing. + The default filter (built-in filter '_mechanical') excludes test points, fiducial marks, mounting holes, etc. + Please consult the built-in filters explanation to fully understand what is excluded by default. + This option is for simple cases, consider using a full variant for complex cases. + +- ``exclude_marked_in_pcb`` :index:`: ` [:ref:`boolean `] (default: ``false``) Exclude components marked with *Exclude from BOM* in the PCB. + This is a KiCad 6 option. +- ``exclude_marked_in_sch`` :index:`: ` [:ref:`boolean `] (default: ``true``) Exclude components marked with *Exclude from bill of materials* in the schematic. + This is a KiCad 6 option. +- ``expand_text_vars`` :index:`: ` [:ref:`boolean `] (default: ``true``) Expand KiCad 6 text variables after applying all filters and variants. + This is done using a **_expand_text_vars** filter. + If you need to customize the filter, or apply it before, you can disable this option and + add a custom filter to the filter chain. +- ``fit_field`` :index:`: ` [:ref:`string `] (default: ``'config'``) [:ref:`case insensitive `]Field name used for internal filters (not for variants). +- ``footprint_populate_values`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'no,yes'``) [:ref:`comma separated `] (must contain 2 elements) Values for the `Footprint Populate` column. + +- ``footprint_type_values`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'SMD,THT,VIRTUAL'``) [:ref:`comma separated `] (must contain 3 elements) Values for the `Footprint Type` column. + +- ``group_connectors`` :index:`: ` [:ref:`boolean `] (default: ``true``) Connectors with the same footprints will be grouped together, independent of the name of the connector. +- ``group_fields_fallbacks`` :index:`: ` [:ref:`list(string) `] (default: ``[]``) [:ref:`case insensitive `]List of fields to be used when the fields in `group_fields` are empty. + The first field in this list is the fallback for the first in `group_fields`, and so on. + +- ``int_qtys`` :index:`: ` [:ref:`boolean `] (default: ``true``) Component quantities are always expressed as integers. Using the ceil() function. +- ``merge_blank_fields`` :index:`: ` [:ref:`boolean `] (default: ``true``) Component groups with blank fields will be merged into the most compatible group, where possible. +- ``merge_both_blank`` :index:`: ` [:ref:`boolean `] (default: ``true``) When creating groups two components with empty/missing field will be interpreted as with the same value. +- ``no_conflict`` :index:`: ` [:ref:`list(string) `] (default: computed for your project) [:ref:`case insensitive `]List of fields where we tolerate conflicts. + Use it to avoid undesired warnings. + By default the field indicated in `fit_field`, the field used for variants and + the field `part` are excluded. + +- ``no_distributors`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) [:ref:`comma separated `] Exclude this distributors list. + They are removed after computing `distributors`. + +- ``normalize_locale`` :index:`: ` [:ref:`boolean `] (default: ``false``) When normalizing values use the locale decimal point. +- ``parse_value`` :index:`: ` [:ref:`boolean `] (default: ``true``) Parse the `Value` field so things like *1k* and *1000* are interpreted as equal. + Note that this implies that *1k 1%* is the same as *1k 5%*. If you really need to group using the + extra information split it in separated fields, add the fields to `group_fields` and disable + `merge_blank_fields`. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_null'``) Name of the filter to transform fields before applying other filters. + This option is for simple cases, consider using a full variant for complex cases. + +- ``ref_id`` :index:`: ` [:ref:`string `] (default: ``''``) A prefix to add to all the references from this project. Used for multiple projects. +- ``ref_separator`` :index:`: ` [:ref:`string `] (default: ``' '``) Separator used for the list of references. +- ``source_by_id`` :index:`: ` [:ref:`boolean `] (default: ``false``) Generate the `Source BoM` column using the reference ID instead of the project name. +- ``use_alt`` :index:`: ` [:ref:`boolean `] (default: ``false``) Print grouped references in the alternate compressed style eg: R1-R7,R18. +- ``use_aux_axis_as_origin`` :index:`: ` [:ref:`boolean `] (default: ``true``) Use the auxiliary axis as origin for coordinates (KiCad default) (for XYRS). +- ``variant`` :index:`: ` [:ref:`string `] (default: ``'_kibom_simple'``) Board variant, used to determine which components are output to the BoM. + The `_kibom_simple` variant is a KiBoM variant without any filters and it provides some basic + compatibility with KiBoM. Note that this output has default filters that behaves like KiBoM. + The combination between the default for this option and the defaults for the filters provides + a behavior that mimics KiBoM default behavior. + +.. toctree:: + :caption: Used dicts + + Aggregate + BoMCSV + BoMColumns + BoMHTML + BoMTXT + BoMXLSX diff --git a/docs/source/configuration/outputs/BoMTXT.rst b/docs/source/configuration/outputs/BoMTXT.rst new file mode 100644 index 000000000..a5d6aa088 --- /dev/null +++ b/docs/source/configuration/outputs/BoMTXT.rst @@ -0,0 +1,13 @@ +.. _BoMTXT: + + +BoMTXT parameters +~~~~~~~~~~~~~~~~~ + +- **separator** :index:`: ` [:ref:`string `] (default: ``'I'``) Column Separator. +- ``header_sep`` :index:`: ` [:ref:`string `] (default: ``'-'``) Separator between the header and the data. +- ``hide_header`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide the header line (names of the columns). +- ``hide_pcb_info`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide project information. +- ``hide_stats_info`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide statistics information. +- ``justify`` :index:`: ` [:ref:`string `] (default: ``'left'``) (choices: "left", "right", "center") Text justification. + diff --git a/docs/source/configuration/outputs/BoMXLSX.rst b/docs/source/configuration/outputs/BoMXLSX.rst new file mode 100644 index 000000000..585a59d7d --- /dev/null +++ b/docs/source/configuration/outputs/BoMXLSX.rst @@ -0,0 +1,56 @@ +.. _BoMXLSX: + + +BoMXLSX parameters +~~~~~~~~~~~~~~~~~~ + +- **datasheet_as_link** :index:`: ` [:ref:`string `] (default: ``''``) [:ref:`case insensitive `]Column with links to the datasheet. +- **generate_dnf** :index:`: ` [:ref:`boolean `] (default: ``true``) Generate a separated section for DNF (Do Not Fit) components. +- **kicost** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable KiCost worksheet creation. + Note: an example of how to use it on CI/CD can be found `here `__. +- **logo** :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) PNG/SVG file to use as logo, use false to remove. + Note that when using an SVG this is first converted to a PNG using `logo_width`. + +- **specs** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable Specs worksheet creation. Contains specifications for the components. + Works with only some KiCost APIs. +- **title** :index:`: ` [:ref:`string `] (default: ``'KiBot Bill of Materials'``) BoM title. +- ``col_colors`` :index:`: ` [:ref:`boolean `] (default: ``true``) Use colors to show the field type. +- ``digikey_link`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`case insensitive `]Column/s containing Digi-Key part numbers, will be linked to web page. + +- ``extra_info`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) Information to put after the title and before the pcb and stats info. + +- ``hide_pcb_info`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide project information. +- ``hide_stats_info`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide statistics information. +- ``highlight_empty`` :index:`: ` [:ref:`boolean `] (default: ``true``) Use a color for empty cells. Applies only when `col_colors` is `true`. +- ``kicost_api_disable`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] List of KiCost APIs to disable. + +- ``kicost_api_enable`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] List of KiCost APIs to enable. + +- ``kicost_config`` :index:`: ` [:ref:`string `] (default: ``''``) KiCost configuration file. It contains the keys for the different distributors APIs. + The regular KiCost config is used when empty. + Important for CI/CD environments: avoid exposing your API secrets! + To understand how to achieve this, and also how to make use of the cache please visit the + `kicost_ci_test `__ repo. +- ``kicost_dist_desc`` :index:`: ` [:ref:`boolean `] (default: ``false``) Used to add a column with the distributor's description. So you can check this is the right component. +- ``lcsc_link`` :index:`: ` [:ref:`boolean ` | :ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`case insensitive `]Column/s containing LCSC part numbers, will be linked to web page. + Use **true** to copy the value indicated by the `field_lcsc_part` global option. + +- ``logo_scale`` :index:`: ` [:ref:`number `] (default: ``2``) Scaling factor for the logo. Note that this value isn't honored by all spreadsheet software. +- ``logo_width`` :index:`: ` [:ref:`number `] (default: ``370``) Used when the logo is an SVG image. This width is used to render the SVG image. +- ``max_col_width`` :index:`: ` [:ref:`number `] (default: ``60``) (range: 20 to 999) Maximum column width (characters). +- ``mouser_link`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`case insensitive `]Column/s containing Mouser part numbers, will be linked to web page. + +- ``row_colors`` :index:`: ` [:ref:`RowColors parameters `] [:ref:`list(dict) `] (default: ``[]``) Used to highlight rows using filters. Rows that match a filter can be colored. + Note that these rows won't have colored columns. +- ``specs_columns`` :index:`: ` [:ref:`BoMColumns parameters `] [:ref:`list(dict) ` | :ref:`list(string) `] (default: ``[]``) Which columns are included in the Specs worksheet. Use `References` for the + references, 'Row' for the order and 'Sep' to separate groups at the same level. By default all are included. + Column names are distributor specific, the following aren't: '_desc', '_value', '_tolerance', '_footprint', + '_power', '_current', '_voltage', '_frequency', '_temp_coeff', '_manf', '_size'. + Note that an empty list means all available specs, use `specs` options to disable it. +- ``style`` :index:`: ` [:ref:`string `] (default: ``'modern-blue'``) Head style: modern-blue, modern-green, modern-red and classic. + +.. toctree:: + :caption: Used dicts + + BoMColumns + RowColors diff --git a/docs/source/configuration/outputs/BoardViewOptions.rst b/docs/source/configuration/outputs/BoardViewOptions.rst new file mode 100644 index 000000000..7b3f170ec --- /dev/null +++ b/docs/source/configuration/outputs/BoardViewOptions.rst @@ -0,0 +1,20 @@ +.. _BoardViewOptions: + + +BoardViewOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=boardview, %x=brd/brv). Affected by global options. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``format`` :index:`: ` [:ref:`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:`: ` [:ref:`string ` | :ref:`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. + +- ``sorted`` :index:`: ` [:ref:`boolean `] (default: ``true``) Sort components by reference. Disable this option to get a file closer to what + kicad-boardview generates. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Used for sub-PCBs. + diff --git a/docs/source/configuration/outputs/CompressOptions.rst b/docs/source/configuration/outputs/CompressOptions.rst new file mode 100644 index 000000000..256e856c7 --- /dev/null +++ b/docs/source/configuration/outputs/CompressOptions.rst @@ -0,0 +1,19 @@ +.. _CompressOptions: + + +CompressOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **files** :index:`: ` [:ref:`FilesList parameters `] [:ref:`list(dict) `] (default: ``[]``) Which files will be included. +- **format** :index:`: ` [:ref:`string `] (default: ``'ZIP'``) (choices: "ZIP", "TAR", "RAR") Output file format. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the generated archive (%i=name of the output %x=according to format). Affected by global options. +- ``compression`` :index:`: ` [:ref:`string `] (default: ``'auto'``) (choices: "auto", "stored", "deflated", "bzip2", "lzma") Compression algorithm. Use auto to let KiBot select a suitable one. +- ``follow_links`` :index:`: ` [:ref:`boolean `] (default: ``true``) Store the file pointed by symlinks, not the symlink. +- ``move_files`` :index:`: ` [:ref:`boolean `] (default: ``false``) Move the files to the archive. In other words: remove the files after adding them to the archive. +- *remove_files* :index:`: ` Alias for move_files. +- ``skip_not_run`` :index:`: ` [:ref:`boolean `] (default: ``false``) Skip outputs with `run_by_default: false`. + +.. toctree:: + :caption: Used dicts + + FilesList diff --git a/docs/source/configuration/outputs/Copy_FilesOptions.rst b/docs/source/configuration/outputs/Copy_FilesOptions.rst new file mode 100644 index 000000000..4d63bc4ff --- /dev/null +++ b/docs/source/configuration/outputs/Copy_FilesOptions.rst @@ -0,0 +1,34 @@ +.. _Copy_FilesOptions: + + +Copy_FilesOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **download** :index:`: ` [:ref:`boolean `] (default: ``true``) Downloads missing 3D models from KiCad git. + Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. + They are downloaded to a temporal directory and discarded. + If you want to cache the downloaded files specify a directory using the + KIBOT_3D_MODELS environment variable. +- **files** :index:`: ` [:ref:`FilesList parameters `] [:ref:`list(dict) `] (default: ``[]``) Which files will be included. +- **no_virtual** :index:`: ` [:ref:`boolean `] (default: ``false``) Used to exclude 3D models for components with 'virtual' attribute. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``download_lcsc`` :index:`: ` [:ref:`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. +- ``follow_links`` :index:`: ` [:ref:`boolean `] (default: ``true``) Store the file pointed by symlinks, not the symlink. +- ``kicad_3d_url`` :index:`: ` [:ref:`string `] (default: ``'https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'``) Base URL for the KiCad 3D models. +- ``kicad_3d_url_suffix`` :index:`: ` [:ref:`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:`: ` [:ref:`boolean `] (default: ``false``) Create symlinks instead of copying files. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + +.. toctree:: + :caption: Used dicts + + FilesList diff --git a/docs/source/configuration/outputs/CustomReport.rst b/docs/source/configuration/outputs/CustomReport.rst new file mode 100644 index 000000000..daa7d4d50 --- /dev/null +++ b/docs/source/configuration/outputs/CustomReport.rst @@ -0,0 +1,10 @@ +.. _CustomReport: + + +CustomReport parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- ``content`` :index:`: ` [:ref:`string `] (default: ``''``) Content for the report. Use ``${basename}`` for the project name without extension. + Use ``${filename(LAYER)}`` for the file corresponding to LAYER. +- ``output`` :index:`: ` [:ref:`string `] (default: ``'Custom_report.txt'``) File name for the custom report. + diff --git a/docs/source/configuration/outputs/DXFOptions.rst b/docs/source/configuration/outputs/DXFOptions.rst new file mode 100644 index 000000000..91d528880 --- /dev/null +++ b/docs/source/configuration/outputs/DXFOptions.rst @@ -0,0 +1,49 @@ +.. _DXFOptions: + + +DXFOptions parameters +~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Output file name, the default KiCad name if empty. + IMPORTANT! KiCad will always create the file using its own name and then we can rename it. + For this reason you must avoid generating two variants at the same directory when one of + them uses the default KiCad name. Affected by global options. +- **plot_sheet_reference** :index:`: ` [:ref:`boolean `] (default: ``false``) Include the frame and title block. Only available for KiCad 6+ and you get a poor result + (i.e. always the default worksheet style, also problems expanding text variables). + The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. +- **scaling** :index:`: ` [:ref:`number `] (default: ``1``) Scale factor (0 means autoscaling). +- ``custom_reports`` :index:`: ` [:ref:`CustomReport parameters `] [:ref:`list(dict) `] (default: ``[]``) A list of customized reports for the manufacturer. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``drill_marks`` :index:`: ` [:ref:`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:`: ` [:ref:`string `] (default: ``''``) Used to configure the edge cuts layer extension for Protel mode. Include the dot. +- ``exclude_edge_layer`` :index:`: ` [:ref:`boolean `] (default: ``true``) Do not include the PCB edge layer. +- ``exclude_pads_from_silkscreen`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not plot the component pads in the silk screen (KiCad 5.x only). +- ``force_plot_invisible_refs_vals`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include references and values even when they are marked as invisible. +- ``individual_page_scaling`` :index:`: ` [:ref:`boolean `] (default: ``true``) Tell KiCad to apply the scaling for each layer as a separated entity. + Disabling it the pages are coherent and can be superposed. +- ``inner_extension_pattern`` :index:`: ` [:ref:`string `] (default: ``''``) Used to change the Protel style extensions for inner layers. + The replacement pattern can contain %n for the inner layer number and %N for the layer number. + Example '.g%n'. +- ``metric_units`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use mm instead of inches. +- ``plot_footprint_refs`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint references. +- ``plot_footprint_values`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint values. +- ``polygon_mode`` :index:`: ` [:ref:`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:`: ` [:ref:`string ` | :ref:`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. + +- ``sketch_pad_line_width`` :index:`: ` [:ref:`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). +- ``sketch_pads_on_fab_layers`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). +- ``sketch_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Don't fill objects, just draw the outline. +- ``tent_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Cover the vias. +- ``uppercase_extensions`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use uppercase names for the extensions. +- ``use_aux_axis_as_origin`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the auxiliary axis as origin for coordinates. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + +.. toctree:: + :caption: Used dicts + + CustomReport diff --git a/docs/source/configuration/outputs/DXF_SCH_PrintOptions.rst b/docs/source/configuration/outputs/DXF_SCH_PrintOptions.rst new file mode 100644 index 000000000..ca2b16b5b --- /dev/null +++ b/docs/source/configuration/outputs/DXF_SCH_PrintOptions.rst @@ -0,0 +1,26 @@ +.. _DXF_SCH_PrintOptions: + + +DXF_SCH_PrintOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **frame** :index:`: ` [:ref:`boolean `] (default: ``true``) Include the frame and title block. +- ``all_pages`` :index:`: ` [:ref:`boolean `] (default: ``true``) Generate with all hierarchical sheets. +- ``background_color`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the background color from the `color_theme` (KiCad 6). +- ``color_theme`` :index:`: ` [:ref:`string `] (default: ``''``) Color theme used, this must exist in the KiCad config (KiCad 6). +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``monochrome`` :index:`: ` [:ref:`boolean `] (default: ``false``) Generate a monochromatic output. +- ``output`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output DXF (%i=schematic, %x=dxf). Affected by global options. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``sheet_reference_layout`` :index:`: ` [:ref:`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 + file is available. +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Not fitted components are crossed. + diff --git a/docs/source/configuration/outputs/DiffOptions.rst b/docs/source/configuration/outputs/DiffOptions.rst new file mode 100644 index 000000000..70dbf6fed --- /dev/null +++ b/docs/source/configuration/outputs/DiffOptions.rst @@ -0,0 +1,69 @@ +.. _DiffOptions: + + +DiffOptions parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=diff_pcb/diff_sch, %x=pdf). Affected by global options. +- ``add_link_id`` :index:`: ` [:ref:`boolean `] (default: ``false``) When enabled we create a symlink to the output file with a name that contains the + git hashes involved in the comparison. If you plan to compress the output don't + forget to disable the `follow_links` option. +- ``always_fail_if_missing`` :index:`: ` [:ref:`boolean `] (default: ``false``) Always fail if the old/new file doesn't exist. Currently we don't fail if they are from a repo. + So if you refer to a repo point where the file wasn't created KiBot will use an empty file. + Enabling this option KiBot will report an error. +- ``cache_dir`` :index:`: ` [:ref:`string `] (default: ``''``) Directory to cache the intermediate files. Leave it blank to disable the cache. +- ``color_added`` :index:`: ` [:ref:`string `] (default: ``'#00FF00'``) Color used for the added stuff in the '2color' mode. +- ``color_removed`` :index:`: ` [:ref:`string `] (default: ``'#FF0000'``) Color used for the removed stuff in the '2color' mode. +- ``copy_instead_of_link`` :index:`: ` [:ref:`boolean `] (default: ``false``) Modifies the behavior of `add_link_id` to create a copy of the file instead of a + symlink. Useful for some Windows setups. +- ``diff_mode`` :index:`: ` [:ref:`string `] (default: ``'red_green'``) (choices: "red_green", "stats", "2color") In the `red_green` mode added stuff is green and red when removed. + The `stats` mode is used to measure the amount of difference. In this mode all + changes are red, but you can abort if the difference is bigger than certain threshold. + The '2color' mode is like 'red_green', but you can customize the colors. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``force_checkout`` :index:`: ` [:ref:`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 + to do a checkout, even after stashing, this option can workaround the problem. + Note that using it you could potentially lose modified files. For more information + read https://stackoverflow.com/questions/1248029/git-pull-error-entry-foo-not-uptodate-cannot-merge. +- ``fuzz`` :index:`: ` [:ref:`number `] (default: ``5``) (range: 0 to 100) Color tolerance (fuzzyness) for the `stats` mode. +- ``new`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] The file you want to compare. Leave it blank for the current PCB/SCH. + A list is accepted only for the `multivar` type. Consult the `old` option for more information. +- ``new_type`` :index:`: ` [:ref:`string `] (default: ``'current'``) (choices: "git", "file", "output", "multivar", "current") How to interpret the `new` name. Use `git` for a git hash, branch, etc. + Use `current` for the currently loaded PCB/Schematic. + Use `file` for a file name. Use `output` to specify the name of a `pcb_variant`/`sch_variant` output. + Use `multivar` to compare a set of variants, in this mode `new` is the list of outputs for the variants. + This is an extension of the `output` mode. + If `old` is also `multivar` then it becomes the reference, otherwise we compare using pairs of variants. +- ``old`` :index:`: ` [:ref:`string `] (default: ``'HEAD'``) Reference file. When using git use `HEAD` to refer to the last commit. + Use `HEAD~` to refer the previous to the last commit. + As `HEAD` is for the whole repo you can use `KIBOT_LAST-n` to make + reference to the changes in the PCB/SCH. The `n` value is how many + changes in the history you want to go back. A 0 is the same as `HEAD`, + a 1 means the last time the PCB/SCH was changed, etc. + Use `KIBOT_TAG-n` to search for the last tag skipping `n` tags. + Important: when using the `checkout` GitHub action you just get the + last commit. To clone the full repo use `fetch-depth: '0'`. +- ``old_type`` :index:`: ` [:ref:`string `] (default: ``'git'``) (choices: "git", "file", "output", "multivar") How to interpret the `old` name. Use `git` for a git hash, branch, etc. + Use `file` for a file name. Use `output` to specify the name of a `pcb_variant`/`sch_variant` output. + Use `multivar` to specify a reference file when `new_type` is also `multivar`. +- ``only_different`` :index:`: ` [:ref:`boolean `] (default: ``false``) Only include the pages with differences in the output PDF. + Note that when no differences are found we get a page saying *No diff*. +- ``only_first_sch_page`` :index:`: ` [:ref:`boolean `] (default: ``false``) Compare only the main schematic page (root page). +- ``pcb`` :index:`: ` [:ref:`boolean `] (default: ``true``) Compare the PCB, otherwise compare the schematic. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``threshold`` :index:`: ` [:ref:`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. + KiBot will return error level 29 and the diff generation will be aborted. +- ``use_file_id`` :index:`: ` [:ref:`boolean `] (default: ``false``) When creating the link name of an output file related to a variant use the variant + `file_id` instead of its name. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. +- ``zones`` :index:`: ` [:ref:`string `] (default: ``'global'``) (choices: "global", "fill", "unfill", "none") How to handle PCB zones. The default is *global* and means that we + fill zones if the *check_zone_fills* preflight is enabled. The *fill* option always forces + a refill, *unfill* forces a zone removal and *none* lets the zones unchanged. + Be careful with the cache when changing this setting. + diff --git a/docs/source/configuration/outputs/Download_Datasheets_Options.rst b/docs/source/configuration/outputs/Download_Datasheets_Options.rst new file mode 100644 index 000000000..6bc818c92 --- /dev/null +++ b/docs/source/configuration/outputs/Download_Datasheets_Options.rst @@ -0,0 +1,26 @@ +.. _Download_Datasheets_Options: + + +Download_Datasheets_Options parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **field** :index:`: ` [:ref:`string `] (default: ``'Datasheet'``) Name of the field containing the URL. +- ``classify`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the reference to classify the components in different sub-dirs. + In this way C7 will go into a Capacitors sub-dir, R3 into Resistors, etc. +- ``classify_extra`` :index:`: ` [:ref:`string_dict `] (default: empty dict, default values used) Extra reference associations used to classify the references. + They are pairs `Reference prefix` -> `Sub-dir`. + +- ``dnf`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include the DNF components. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``link_repeated`` :index:`: ` [:ref:`boolean `] (default: ``true``) Instead of download things we already downloaded use symlinks. +- ``output`` :index:`: ` [:ref:`string `] (default: ``'${VALUE}.pdf'``) Name used for the downloaded datasheet. + `${FIELD}` will be replaced by the FIELD content. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``repeated`` :index:`: ` [:ref:`boolean `] (default: ``false``) Download URLs that we already downloaded. + It only makes sense if the `output` field makes their output different. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/DrillMap.rst b/docs/source/configuration/outputs/DrillMap.rst new file mode 100644 index 000000000..0d563158c --- /dev/null +++ b/docs/source/configuration/outputs/DrillMap.rst @@ -0,0 +1,9 @@ +.. _DrillMap: + + +DrillMap parameters +~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the map file, KiCad defaults if empty (%i='PTH_drill_map'). Affected by global options. +- **type** :index:`: ` '' + diff --git a/docs/source/configuration/outputs/DrillReport.rst b/docs/source/configuration/outputs/DrillReport.rst new file mode 100644 index 000000000..e8dda4221 --- /dev/null +++ b/docs/source/configuration/outputs/DrillReport.rst @@ -0,0 +1,9 @@ +.. _DrillReport: + + +DrillReport parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- ``filename`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the drill report. Not generated unless a name is specified. + (%i='drill_report' %x='txt'). + diff --git a/docs/source/configuration/outputs/ExcellonOptions.rst b/docs/source/configuration/outputs/ExcellonOptions.rst new file mode 100644 index 000000000..06279ffde --- /dev/null +++ b/docs/source/configuration/outputs/ExcellonOptions.rst @@ -0,0 +1,35 @@ +.. _ExcellonOptions: + + +ExcellonOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **metric_units** :index:`: ` [:ref:`boolean `] (default: ``true``) Use metric units instead of inches. +- **mirror_y_axis** :index:`: ` [:ref:`boolean `] (default: ``false``) Invert the Y axis. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) name for the drill file, KiCad defaults if empty (%i='PTH_drill'). Affected by global options. +- **pth_and_npth_single_file** :index:`: ` [:ref:`boolean `] (default: ``true``) Generate one file for both, plated holes and non-plated holes, instead of two separated files. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``left_digits`` :index:`: ` [:ref:`number `] (default: ``0``) number of digits for integer part of coordinates (0 is auto). +- ``map`` :index:`: ` [:ref:`DrillMap parameters `] [:ref:`dict ` | :ref:`string `] (default: ``'None'``) (choices: "hpgl", "ps", "gerber", "dxf", "svg", "pdf", "None") Format for a graphical drill map. + Not generated unless a format is specified. +- ``minimal_header`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use a minimal header in the file. +- ``npth_id`` :index:`: ` [:ref:`string `] Force this replacement for %i when generating NPTH files. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``pth_id`` :index:`: ` [:ref:`string `] Force this replacement for %i when generating PTH and unified files. +- ``report`` :index:`: ` [:ref:`DrillReport parameters `] [:ref:`dict ` | :ref:`string `] (default: ``''``) Name of the drill report. Not generated unless a name is specified. +- ``right_digits`` :index:`: ` [:ref:`number `] (default: ``0``) number of digits for mantissa part of coordinates (0 is auto). +- ``route_mode_for_oval_holes`` :index:`: ` [:ref:`boolean `] (default: ``true``) Use route command for oval holes (G00), otherwise use G85. +- ``use_aux_axis_as_origin`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the auxiliary axis as origin for coordinates. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Used for sub-PCBs. +- ``zeros_format`` :index:`: ` [:ref:`string `] (default: ``'DECIMAL_FORMAT'``) (choices: "DECIMAL_FORMAT", "SUPPRESS_LEADING", "SUPPRESS_TRAILING", "KEEP_ZEROS") How to handle the zeros. + +.. toctree:: + :caption: Used dicts + + DrillMap + DrillReport diff --git a/docs/source/configuration/outputs/FieldRename.rst b/docs/source/configuration/outputs/FieldRename.rst new file mode 100644 index 000000000..ae12e6f87 --- /dev/null +++ b/docs/source/configuration/outputs/FieldRename.rst @@ -0,0 +1,9 @@ +.. _FieldRename: + + +FieldRename parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- ``field`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the field to rename. +- ``name`` :index:`: ` [:ref:`string `] (default: ``''``) New name. + diff --git a/docs/source/configuration/outputs/FilesList.rst b/docs/source/configuration/outputs/FilesList.rst new file mode 100644 index 000000000..44ba004e3 --- /dev/null +++ b/docs/source/configuration/outputs/FilesList.rst @@ -0,0 +1,14 @@ +.. _FilesList: + + +FilesList parameters +~~~~~~~~~~~~~~~~~~~~ + +- **from_output** :index:`: ` [:ref:`string `] (default: ``''``) Collect files from the selected output. + When used the `source` option is ignored. +- **source** :index:`: ` [:ref:`string `] (default: ``'*.pdf'``) File names to add, wildcards allowed. Use ** for recursive match. + By default this pattern is applied to the output dir specified with `-d` command line option. + See the `from_cwd` option. +- ``filter`` :index:`: ` [:ref:`string `] (default: ``'.*\\.pdf'``) A regular expression that source files must match. +- ``from_cwd`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the current working directory instead of the dir specified by `-d`. + diff --git a/docs/source/configuration/outputs/GenCADOptions.rst b/docs/source/configuration/outputs/GenCADOptions.rst new file mode 100644 index 000000000..254bb732d --- /dev/null +++ b/docs/source/configuration/outputs/GenCADOptions.rst @@ -0,0 +1,21 @@ +.. _GenCADOptions: + + +GenCADOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=gencad, %x=cad). Affected by global options. +- ``aux_origin`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use auxiliary axis as origin. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``flip_bottom_padstacks`` :index:`: ` [:ref:`boolean `] (default: ``false``) Flip bottom footprint padstacks. +- ``no_reuse_shapes`` :index:`: ` [:ref:`boolean `] (default: ``false``) Generate a new shape for each footprint instance (Do not reuse shapes). +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``save_origin`` :index:`: ` [:ref:`boolean `] (default: ``false``) Save the origin coordinates in the file. +- ``unique_pin_names`` :index:`: ` [:ref:`boolean `] (default: ``false``) Generate unique pin names. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Used for sub-PCBs. + diff --git a/docs/source/configuration/outputs/Gerb_DrillOptions.rst b/docs/source/configuration/outputs/Gerb_DrillOptions.rst new file mode 100644 index 000000000..dfcfa5c34 --- /dev/null +++ b/docs/source/configuration/outputs/Gerb_DrillOptions.rst @@ -0,0 +1,27 @@ +.. _Gerb_DrillOptions: + + +Gerb_DrillOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) name for the drill file, KiCad defaults if empty (%i='PTH_drill'). Affected by global options. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``map`` :index:`: ` [:ref:`DrillMap parameters `] [:ref:`dict ` | :ref:`string `] (default: ``'None'``) (choices: "hpgl", "ps", "gerber", "dxf", "svg", "pdf", "None") Format for a graphical drill map. + Not generated unless a format is specified. +- ``npth_id`` :index:`: ` [:ref:`string `] Force this replacement for %i when generating NPTH files. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``pth_id`` :index:`: ` [:ref:`string `] Force this replacement for %i when generating PTH and unified files. +- ``report`` :index:`: ` [:ref:`DrillReport parameters `] [:ref:`dict ` | :ref:`string `] (default: ``''``) Name of the drill report. Not generated unless a name is specified. +- ``use_aux_axis_as_origin`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the auxiliary axis as origin for coordinates. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Used for sub-PCBs. + +.. toctree:: + :caption: Used dicts + + DrillMap + DrillReport diff --git a/docs/source/configuration/outputs/GerberOptions.rst b/docs/source/configuration/outputs/GerberOptions.rst new file mode 100644 index 000000000..2430c076d --- /dev/null +++ b/docs/source/configuration/outputs/GerberOptions.rst @@ -0,0 +1,51 @@ +.. _GerberOptions: + + +GerberOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- **create_gerber_job_file** :index:`: ` [:ref:`boolean `] (default: ``true``) Creates a file with information about all the generated gerbers. + You can use it in gerbview to load all gerbers at once. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Output file name, the default KiCad name if empty. + IMPORTANT! KiCad will always create the file using its own name and then we can rename it. + For this reason you must avoid generating two variants at the same directory when one of + them uses the default KiCad name. Affected by global options. +- **plot_sheet_reference** :index:`: ` [:ref:`boolean `] (default: ``false``) Include the frame and title block. Only available for KiCad 6+ and you get a poor result + (i.e. always the default worksheet style, also problems expanding text variables). + The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. +- **subtract_mask_from_silk** :index:`: ` [:ref:`boolean `] (default: ``false``) Subtract the solder mask from the silk screen. +- **use_gerber_net_attributes** :index:`: ` [:ref:`boolean `] (default: ``true``) Include netlist metadata. +- **use_gerber_x2_attributes** :index:`: ` [:ref:`boolean `] (default: ``true``) Use the extended X2 format (otherwise use X1 formerly RS-274X). +- **use_protel_extensions** :index:`: ` [:ref:`boolean `] (default: ``false``) Use legacy Protel file extensions. +- ``custom_reports`` :index:`: ` [:ref:`CustomReport parameters `] [:ref:`list(dict) `] (default: ``[]``) A list of customized reports for the manufacturer. +- ``disable_aperture_macros`` :index:`: ` [:ref:`boolean `] (default: ``false``) Disable aperture macros (workaround for buggy CAM software) (KiCad 6). +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``edge_cut_extension`` :index:`: ` [:ref:`string `] (default: ``''``) Used to configure the edge cuts layer extension for Protel mode. Include the dot. +- ``exclude_edge_layer`` :index:`: ` [:ref:`boolean `] (default: ``true``) Do not include the PCB edge layer. +- ``exclude_pads_from_silkscreen`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not plot the component pads in the silk screen (KiCad 5.x only). +- ``force_plot_invisible_refs_vals`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include references and values even when they are marked as invisible. +- ``gerber_job_file`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the gerber job file (%i='job', %x='gbrjob'). Affected by global options. +- ``gerber_precision`` :index:`: ` [:ref:`number `] (default: ``4.6``) (choices: 4.5, 4.6) This is the gerber coordinate format, can be 4.5 or 4.6. +- ``inner_extension_pattern`` :index:`: ` [:ref:`string `] (default: ``''``) Used to change the Protel style extensions for inner layers. + The replacement pattern can contain %n for the inner layer number and %N for the layer number. + Example '.g%n'. +- ``line_width`` :index:`: ` [:ref:`number `] (default: ``0.1``) (range: 0.02 to 2) Line_width for objects without width [mm] (KiCad 5). +- ``plot_footprint_refs`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint references. +- ``plot_footprint_values`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint values. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``sketch_pad_line_width`` :index:`: ` [:ref:`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). +- ``sketch_pads_on_fab_layers`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). +- ``tent_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Cover the vias. +- ``uppercase_extensions`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use uppercase names for the extensions. +- ``use_aux_axis_as_origin`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the auxiliary axis as origin for coordinates. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + +.. toctree:: + :caption: Used dicts + + CustomReport diff --git a/docs/source/configuration/outputs/HPGLOptions.rst b/docs/source/configuration/outputs/HPGLOptions.rst new file mode 100644 index 000000000..46693c184 --- /dev/null +++ b/docs/source/configuration/outputs/HPGLOptions.rst @@ -0,0 +1,49 @@ +.. _HPGLOptions: + + +HPGLOptions parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Output file name, the default KiCad name if empty. + IMPORTANT! KiCad will always create the file using its own name and then we can rename it. + For this reason you must avoid generating two variants at the same directory when one of + them uses the default KiCad name. Affected by global options. +- **plot_sheet_reference** :index:`: ` [:ref:`boolean `] (default: ``false``) Include the frame and title block. Only available for KiCad 6+ and you get a poor result + (i.e. always the default worksheet style, also problems expanding text variables). + The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. +- ``custom_reports`` :index:`: ` [:ref:`CustomReport parameters `] [:ref:`list(dict) `] (default: ``[]``) A list of customized reports for the manufacturer. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``drill_marks`` :index:`: ` [:ref:`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:`: ` [:ref:`string `] (default: ``''``) Used to configure the edge cuts layer extension for Protel mode. Include the dot. +- ``exclude_edge_layer`` :index:`: ` [:ref:`boolean `] (default: ``true``) Do not include the PCB edge layer. +- ``exclude_pads_from_silkscreen`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not plot the component pads in the silk screen (KiCad 5.x only). +- ``force_plot_invisible_refs_vals`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include references and values even when they are marked as invisible. +- ``individual_page_scaling`` :index:`: ` [:ref:`boolean `] (default: ``true``) Tell KiCad to apply the scaling for each layer as a separated entity. + Disabling it the pages are coherent and can be superposed. +- ``inner_extension_pattern`` :index:`: ` [:ref:`string `] (default: ``''``) Used to change the Protel style extensions for inner layers. + The replacement pattern can contain %n for the inner layer number and %N for the layer number. + Example '.g%n'. +- ``mirror_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Plot mirrored. +- ``pen_number`` :index:`: ` [:ref:`number `] (default: ``1``) (range: 1 to 16) Pen number. +- ``pen_speed`` :index:`: ` [:ref:`number `] (default: ``20``) (range: 1 to 99) Pen speed. +- ``pen_width`` :index:`: ` [:ref:`number `] (default: ``15``) (range: 0 to 100) Pen diameter in MILS, useful to fill areas. However, it is in mm in HPGL files. +- ``plot_footprint_refs`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint references. +- ``plot_footprint_values`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint values. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``scaling`` :index:`: ` [:ref:`number `] (default: ``0``) Scale factor (0 means autoscaling). +- ``sketch_pad_line_width`` :index:`: ` [:ref:`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). +- ``sketch_pads_on_fab_layers`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). +- ``sketch_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Don't fill objects, just draw the outline. +- ``tent_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Cover the vias. +- ``uppercase_extensions`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use uppercase names for the extensions. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + +.. toctree:: + :caption: Used dicts + + CustomReport diff --git a/docs/source/configuration/outputs/HPGL_SCH_PrintOptions.rst b/docs/source/configuration/outputs/HPGL_SCH_PrintOptions.rst new file mode 100644 index 000000000..7e410c125 --- /dev/null +++ b/docs/source/configuration/outputs/HPGL_SCH_PrintOptions.rst @@ -0,0 +1,28 @@ +.. _HPGL_SCH_PrintOptions: + + +HPGL_SCH_PrintOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **frame** :index:`: ` [:ref:`boolean `] (default: ``true``) Include the frame and title block. +- ``all_pages`` :index:`: ` [:ref:`boolean `] (default: ``true``) Generate with all hierarchical sheets. +- ``background_color`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the background color from the `color_theme` (KiCad 6). +- ``color_theme`` :index:`: ` [:ref:`string `] (default: ``''``) Color theme used, this must exist in the KiCad config (KiCad 6). +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``monochrome`` :index:`: ` [:ref:`boolean `] (default: ``false``) Generate a monochromatic output. +- ``origin`` :index:`: ` [:ref:`string `] (default: ``'bottom_left'``) (choices: "bottom_left", "centered", "page_fit", "content_fit") Origin and scale. +- ``output`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output HPGL (%i=schematic, %x=plt). Affected by global options. +- ``pen_size`` :index:`: ` [:ref:`number `] (default: ``0.4826``) Pen size (diameter) [mm]. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``sheet_reference_layout`` :index:`: ` [:ref:`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 + file is available. +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Not fitted components are crossed. + diff --git a/docs/source/configuration/outputs/IBoMOptions.rst b/docs/source/configuration/outputs/IBoMOptions.rst new file mode 100644 index 000000000..b184675d3 --- /dev/null +++ b/docs/source/configuration/outputs/IBoMOptions.rst @@ -0,0 +1,71 @@ +.. _IBoMOptions: + + +IBoMOptions parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- **board_rotation** :index:`: ` [:ref:`number `] (default: ``0``) Board rotation in degrees (-180 to 180). Will be rounded to multiple of 5. +- **bom_view** :index:`: ` [:ref:`string `] (default: ``'left-right'``) (choices: "bom-only", "left-right", "top-bottom") Default BOM view. +- **extra_fields** :index:`: ` [:ref:`string `] (default: ``''``) Comma separated list of extra fields to pull from netlist or xml file. + Using 'X,Y' is a shortcut for `show_fields` and `group_fields` with values 'Value,Footprint,X,Y'. +- **include_tracks** :index:`: ` [:ref:`boolean `] (default: ``false``) Include track/zone information in output. F.Cu and B.Cu layers only. +- **layer_view** :index:`: ` [:ref:`string `] (default: ``'FB'``) (choices: "F", "FB", "B") Default layer view. +- **normalize_field_case** :index:`: ` [:ref:`boolean `] (default: ``false``) Normalize extra field name case. E.g. 'MPN' and 'mpn' will be considered the same field. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output, use '' to use the IBoM filename (%i=ibom, %x=html). Affected by global options. +- **show_fields** :index:`: ` [:ref:`string `] (default: ``''``) Comma separated list of fields to show in the BOM. + Value and Footprint are displayed when nothing is specified. +- ``blacklist`` :index:`: ` [:ref:`string `] (default: ``''``) List of comma separated blacklisted components or prefixes with *. E.g. 'X1,MH*'. + IBoM option, avoid using in conjunction with KiBot variants/filters. +- ``blacklist_empty_val`` :index:`: ` [:ref:`boolean `] (default: ``false``) Blacklist components with empty value. + IBoM option, avoid using in conjunction with KiBot variants/filters. +- ``checkboxes`` :index:`: ` [:ref:`string `] (default: ``'Sourced,Placed'``) Comma separated list of checkbox columns. +- ``dark_mode`` :index:`: ` [:ref:`boolean `] (default: ``false``) Default to dark mode. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + Avoid using it in conjunction with IBoM native filtering options. + +- ``dnp_field`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the extra field that indicates do not populate status. + Components with this field not empty will be blacklisted. + IBoM option, avoid using in conjunction with KiBot variants/filters. +- ``extra_data_file`` :index:`: ` [:ref:`string `] (default: ``''``) Path to netlist or xml file. You can use '%F.xml' to avoid specifying the project name. + Leave it blank for most uses, data will be extracted from the PCB. +- ``forced_name`` :index:`: ` [:ref:`string `] (default: ``''``) Name to be used for the PCB/project (no file extension). + This will affect the name iBoM displays in the generated HTML. +- ``group_fields`` :index:`: ` [:ref:`string `] (default: ``''``) Comma separated list of fields that components will be grouped by. + Value and Footprint are used when nothing is specified. +- ``hide_excluded`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide components in the Fab layer that are marked as excluded by a variant. + Affected by global options. +- ``hide_pads`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide footprint pads by default. +- ``hide_silkscreen`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide silkscreen by default. +- ``highlight_pin1`` :index:`: ` [:ref:`boolean ` | :ref:`string `] (default: ``false``) (choices: "none", "all", "selected") Highlight pin1 by default. +- ``include_nets`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include netlist information in output.. +- ``name_format`` :index:`: ` [:ref:`string `] (default: ``'ibom'``) Output file name format supports substitutions: + %f : original pcb file name without extension. + %p : pcb/project title from pcb metadata. + %c : company from pcb metadata. + %r : revision from pcb metadata. + %d : pcb date from metadata if available, file modification date otherwise. + %D : bom generation date. + %T : bom generation time. + Extension .html will be added automatically. + Note that this name is used only when output is ''. +- *netlist_file* :index:`: ` Alias for extra_data_file. +- ``no_blacklist_virtual`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not blacklist virtual components. + IBoM option, avoid using in conjunction with KiBot variants/filters. +- ``no_compression`` :index:`: ` [:ref:`boolean `] (default: ``false``) Disable compression of pcb data. +- ``no_redraw_on_drag`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not redraw pcb on drag by default. +- ``offset_back_rotation`` :index:`: ` [:ref:`boolean `] (default: ``false``) Offset the back of the pcb by 180 degrees. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``show_fabrication`` :index:`: ` [:ref:`boolean `] (default: ``false``) Show fabrication layer by default. +- ``sort_order`` :index:`: ` [:ref:`string `] (default: ``'C,R,L,D,U,Y,X,F,SW,A,~,HS,CNN,J,P,NT,MH'``) Default sort order for components. Must contain '~' once. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Avoid using it in conjunction with IBoM native filtering options. +- ``variant_field`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the extra field that stores board variant for component. + IBoM option, avoid using in conjunction with KiBot variants/filters. +- ``variants_blacklist`` :index:`: ` [:ref:`string `] (default: ``''``) List of board variants to exclude from the BOM. + IBoM option, avoid using in conjunction with KiBot variants/filters. +- ``variants_whitelist`` :index:`: ` [:ref:`string `] (default: ``''``) List of board variants to include in the BOM. + IBoM option, avoid using in conjunction with KiBot variants/filters. + diff --git a/docs/source/configuration/outputs/InfoOptions.rst b/docs/source/configuration/outputs/InfoOptions.rst new file mode 100644 index 000000000..c8113ede9 --- /dev/null +++ b/docs/source/configuration/outputs/InfoOptions.rst @@ -0,0 +1,10 @@ +.. _InfoOptions: + + +InfoOptions parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=info, %x=txt). Affected by global options. +- ``environment`` :index:`: ` [:ref:`string `] (default: ``'names'``) (choices: "names", "none", "full") List environment variables. + IMPORTANT: Don't use `full` unless you know you are not leaking sensitive information. + diff --git a/docs/source/configuration/outputs/KiBoMColumns.rst b/docs/source/configuration/outputs/KiBoMColumns.rst new file mode 100644 index 000000000..193e1f368 --- /dev/null +++ b/docs/source/configuration/outputs/KiBoMColumns.rst @@ -0,0 +1,12 @@ +.. _KiBoMColumns: + + +KiBoMColumns parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- **field** :index:`: ` [:ref:`string `] (default: ``''``) Name of the field to use for this column. + Use `_field_lcsc_part` to get the value defined in the global options. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Name to display in the header. The field is used when empty. +- ``join`` :index:`: ` [:ref:`list(string) ` | :ref:`string `] (default: ``''``) List of fields to join to this column. + + diff --git a/docs/source/configuration/outputs/KiBoMConfig.rst b/docs/source/configuration/outputs/KiBoMConfig.rst new file mode 100644 index 000000000..b1c9391fe --- /dev/null +++ b/docs/source/configuration/outputs/KiBoMConfig.rst @@ -0,0 +1,75 @@ +.. _KiBoMConfig: + + +KiBoMConfig parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- **columns** :index:`: ` [:ref:`KiBoMColumns parameters `] [:ref:`list(dict) ` | :ref:`list(string) `] (default: ``[]``) List of columns to display. + Can be just the name of the field. +- **fit_field** :index:`: ` [:ref:`string `] (default: ``'Config'``) Field name used to determine if a particular part is to be fitted (also DNC and variants). +- **group_fields** :index:`: ` [:ref:`list(string) `] (default: ``['Part', 'Part Lib', 'Value', 'Footprint', 'Footprint Lib']``) List of fields used for sorting individual components into groups. + Components which match (comparing *all* fields) will be grouped together. + Field names are case-insensitive. + If empty: ['Part', 'Part Lib', 'Value', 'Footprint', 'Footprint Lib'] is used. + +- **ignore_dnf** :index:`: ` [:ref:`boolean `] (default: ``true``) Exclude DNF (Do Not Fit) components. +- **number_rows** :index:`: ` [:ref:`boolean `] (default: ``true``) First column is the row number. +- ``component_aliases`` :index:`: ` [:ref:`list(list(string)) `] (default: ``[['r', 'r_small', 'res', 'resistor'], ['l', 'l_small', 'inductor'], ['c', 'c_small', 'cap', 'capacitor'], ['sw', 'switch'], ['zener', 'zenersmall'], ['d', 'diode', 'd_small']]``) A series of values which are considered to be equivalent for the part name. + Each entry is a list of equivalen names. Example: ['c', 'c_small', 'cap' ] + will ensure the equivalent capacitor symbols can be grouped together. + If empty the following aliases are used: + + - ['r', 'r_small', 'res', 'resistor'] + - ['l', 'l_small', 'inductor'] + - ['c', 'c_small', 'cap', 'capacitor'] + - ['sw', 'switch'] + - ['zener', 'zenersmall'] + - ['d', 'diode', 'd_small']. + +- ``datasheet_as_link`` :index:`: ` [:ref:`string `] (default: ``''``) Column with links to the datasheet (HTML only). +- ``digikey_link`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) Column/s containing Digi-Key part numbers, will be linked to web page (HTML only). + +- ``exclude_any`` :index:`: ` [:ref:`KiBoMRegex parameters `] [:ref:`list(dict) `] (default: ``[]``) A series of regular expressions used to exclude parts. + If a component matches ANY of these, it will be excluded. + Column names are case-insensitive. + If empty the following list is used by KiBoM: + + - column: References |br| + regex: '^TP[0-9]*' + - column: References |br| + regex: '^FID' + - column: Part |br| + regex: 'mount.*hole' + - column: Part |br| + regex: 'solder.*bridge' + - column: Part |br| + regex: 'test.*point' + - column: Footprint |br| + regex 'test.*point' + - column: Footprint |br| + regex: 'mount.*hole' + - column: Footprint |br| + regex: 'fiducial'. +- ``group_connectors`` :index:`: ` [:ref:`boolean `] (default: ``true``) Connectors with the same footprints will be grouped together, independent of the name of the connector. +- ``hide_headers`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide column headers. +- ``hide_pcb_info`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide project information. +- ``html_generate_dnf`` :index:`: ` [:ref:`boolean `] (default: ``true``) Generate a separated section for DNF (Do Not Fit) components (HTML only). +- ``include_only`` :index:`: ` [:ref:`KiBoMRegex parameters `] [:ref:`list(dict) `] (default: ``[]``) A series of regular expressions used to select included parts. + If there are any regex defined here, only components that match against ANY of them will be included. + Column names are case-insensitive. + If empty all the components are included. +- ``lcsc_link`` :index:`: ` [:ref:`boolean ` | :ref:`string ` | :ref:`list(string) `] (default: ``''``) Column/s containing LCSC part numbers, will be linked to web page. + Use **true** to copy the value indicated by the `field_lcsc_part` global option. + +- ``merge_blank_fields`` :index:`: ` [:ref:`boolean `] (default: ``true``) Component groups with blank fields will be merged into the most compatible group, where possible. +- ``mouser_link`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) Column/s containing Mouser part numbers, will be linked to web page (HTML only). + +- ``ref_separator`` :index:`: ` [:ref:`string `] (default: ``' '``) Separator used for the list of references. +- ``test_regex`` :index:`: ` [:ref:`boolean `] (default: ``true``) Each component group will be tested against a number of regular-expressions. +- ``use_alt`` :index:`: ` [:ref:`boolean `] (default: ``false``) Print grouped references in the alternate compressed style eg: R1-R7,R18. + +.. toctree:: + :caption: Used dicts + + KiBoMColumns + KiBoMRegex diff --git a/docs/source/configuration/outputs/KiBoMOptions.rst b/docs/source/configuration/outputs/KiBoMOptions.rst new file mode 100644 index 000000000..61e8c4ded --- /dev/null +++ b/docs/source/configuration/outputs/KiBoMOptions.rst @@ -0,0 +1,22 @@ +.. _KiBoMOptions: + + +KiBoMOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- **format** :index:`: ` [:ref:`string `] (default: ``'HTML'``) (choices: "HTML", "CSV", "XML", "XLSX") Format for the BoM. +- **number** :index:`: ` [:ref:`number `] (default: ``1``) Number of boards to build (components multiplier). +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=bom). Affected by global options. +- ``conf`` :index:`: ` [:ref:`KiBoMConfig parameters `] [:ref:`string ` | :ref:`dict `] (default: ``'bom.ini'``) BoM configuration file, relative to PCB. Environment variables and ~ allowed. + You can also define the configuration here, will be stored in `config.kibom.ini`. +- ``separator`` :index:`: ` [:ref:`string `] (default: ``','``) CSV Separator. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant(s), used to determine which components + are output to the BoM. To specify multiple variants, + with a BOM file exported for each variant, separate + variants with the ';' (semicolon) character. + This isn't related to the KiBot concept of variants. + +.. toctree:: + :caption: Used dicts + + KiBoMConfig diff --git a/docs/source/configuration/outputs/KiBoMRegex.rst b/docs/source/configuration/outputs/KiBoMRegex.rst new file mode 100644 index 000000000..ff90a2bc8 --- /dev/null +++ b/docs/source/configuration/outputs/KiBoMRegex.rst @@ -0,0 +1,12 @@ +.. _KiBoMRegex: + + +KiBoMRegex parameters +~~~~~~~~~~~~~~~~~~~~~ + +- ``column`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the column to apply the regular expression. + Use `_field_lcsc_part` to get the value defined in the global options. +- *field* :index:`: ` Alias for column. +- ``regex`` :index:`: ` [:ref:`string `] (default: ``''``) Regular expression to match. +- *regexp* :index:`: ` Alias for regex. + diff --git a/docs/source/configuration/outputs/KiCanvasOptions.rst b/docs/source/configuration/outputs/KiCanvasOptions.rst new file mode 100644 index 000000000..12c5acbc1 --- /dev/null +++ b/docs/source/configuration/outputs/KiCanvasOptions.rst @@ -0,0 +1,22 @@ +.. _KiCanvasOptions: + + +KiCanvasOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **local_script** :index:`: ` [:ref:`boolean `] (default: ``true``) Download the script and use a copy. +- **source** :index:`: ` [:ref:`string ` | :ref:`list(string) `] (choices: "schematic", "pcb", "project") Source to display. +- ``controls`` :index:`: ` [:ref:`string `] (default: ``'full'``) (choices: "full", "basic", "none") Which controls are displayed. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``download`` :index:`: ` [:ref:`boolean `] (default: ``true``) Show the download button. +- ``overlay`` :index:`: ` [:ref:`boolean `] (default: ``true``) Show the overlay asking to click. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``url_script`` :index:`: ` [:ref:`string `] (default: ``'https://kicanvas.org/kicanvas/kicanvas.js'``) URL for the KiCanvas script. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/KiCostOptions.rst b/docs/source/configuration/outputs/KiCostOptions.rst new file mode 100644 index 000000000..1cb8a5683 --- /dev/null +++ b/docs/source/configuration/outputs/KiCostOptions.rst @@ -0,0 +1,50 @@ +.. _KiCostOptions: + + +KiCostOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- *board_qty* :index:`: ` Alias for number. +- **currency** :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'USD'``) Currency priority. Use ISO4217 codes (i.e. USD, EUR). + +- **distributors** :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) Include this distributors list. Default is all the available. + +- **no_distributors** :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) Exclude this distributors list. They are removed after computing `distributors`. + +- **no_price** :index:`: ` [:ref:`boolean `] (default: ``false``) Do not look for components price. For testing purposes. +- **number** :index:`: ` [:ref:`number `] (default: ``100``) Number of boards to build (components multiplier). +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=kicost, %x=xlsx). Affected by global options. +- ``aggregate`` :index:`: ` [:ref:`Aggregate parameters `] [:ref:`list(dict) `] (default: ``[]``) Add components from other projects. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + Don't use the `kicost_variant` when using internal variants/filters. + +- ``fields`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) [:ref:`comma separated `] List of fields to be added to the global data section. + +- ``group_fields`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) [:ref:`comma separated `] List of fields that can be different for a group. + Parts with differences in these fields are grouped together, but displayed individually. + +- ``ignore_fields`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) [:ref:`comma separated `] List of fields to be ignored. + +- ``kicost_config`` :index:`: ` [:ref:`string `] (default: ``''``) KiCost configuration file. It contains the keys for the different distributors APIs. + The regular KiCost config is used when empty. + Important for CI/CD environments: avoid exposing your API secrets! + To understand how to achieve this, and also how to make use of the cache please visit the + `kicost_ci_test `__ repo. +- ``kicost_variant`` :index:`: ` [:ref:`string `] (default: ``''``) Regular expression to match the variant field (KiCost option, not internal variants). +- ``no_collapse`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not collapse the part references (collapse=R1-R4). +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``show_cat_url`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include the catalogue links in the catalogue code. +- ``split_extra_fields`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) [:ref:`comma separated `] Declare part fields to include in multipart split process. + +- ``translate_fields`` :index:`: ` [:ref:`FieldRename parameters `] [:ref:`list(dict) `] (default: ``[]``) Fields to rename (KiCost option, not internal filters). +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Don't use the `kicost_variant` when using internal variants/filters. + +.. toctree:: + :caption: Used dicts + + Aggregate + FieldRename diff --git a/docs/source/configuration/outputs/KiKit_PresentOptions.rst b/docs/source/configuration/outputs/KiKit_PresentOptions.rst new file mode 100644 index 000000000..0213b9466 --- /dev/null +++ b/docs/source/configuration/outputs/KiKit_PresentOptions.rst @@ -0,0 +1,30 @@ +.. _KiKit_PresentOptions: + + +KiKit_PresentOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **description** :index:`: ` [:ref:`string `] (default: ``''``) Name for a markdown file containing the main part of the page to be generated. + This is mandatory and is the description of your project. + You can embed the markdown code. If the text doesn't map to a file and contains + more than one line KiBot will assume this is the markdown. + If empty KiBot will generate a silly text and a warning. +- ``boards`` :index:`: ` [:ref:`PresentBoards parameters `] [:ref:`dict ` | :ref:`list(dict) `] (default: list with one empty dict, default values used) One or more boards that compose your project. + When empty we will use only the main PCB for the current project. +- ``name`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the project. Will be passed to the template. + If empty we use the name of the KiCad project. + The default template uses it for things like the page title. +- ``repository`` :index:`: ` [:ref:`string `] (default: ``''``) URL of the repository. Will be passed to the template. + If empty we will try to find it using `git remote get-url origin`. + The default template uses it to create an URL for the current commit. +- ``resources`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) A list of file name patterns for additional resources to be included. + I.e. images referenced in description. + They will be copied relative to the output dir. + +- ``template`` :index:`: ` [:ref:`string `] (default: ``'default'``) Path to a template directory or a name of built-in one. + See KiKit's doc/present.md for template specification. + +.. toctree:: + :caption: Used dicts + + PresentBoards diff --git a/docs/source/configuration/outputs/KiRiOptions.rst b/docs/source/configuration/outputs/KiRiOptions.rst new file mode 100644 index 000000000..f7779d2ac --- /dev/null +++ b/docs/source/configuration/outputs/KiRiOptions.rst @@ -0,0 +1,26 @@ +.. _KiRiOptions: + + +KiRiOptions parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- **color_theme** :index:`: ` [:ref:`string `] (default: ``'_builtin_classic'``) Selects the color theme. Only applies to KiCad 6. + To use the KiCad 6 default colors select `_builtin_default`. + Usually user colors are stored as `user`, but you can give it another name. +- **keep_generated** :index:`: ` [:ref:`boolean `] (default: ``false``) Avoid PCB and SCH images regeneration. Useful for incremental usage. +- ``background_color`` :index:`: ` [:ref:`string `] (default: ``'#FFFFFF'``) Color used for the background of the diff canvas. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``max_commits`` :index:`: ` [:ref:`number `] (default: ``0``) Maximum number of commits to include. Use 0 for all available commits. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``revision`` :index:`: ` [:ref:`string `] (default: ``'HEAD'``) Starting point for the commits, can be a branch, a hash, etc. + Note that this can be a revision-range, consult the gitrevisions manual for more information. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. +- ``zones`` :index:`: ` [:ref:`string `] (default: ``'global'``) (choices: "global", "fill", "unfill", "none") How to handle PCB zones. The default is *global* and means that we + fill zones if the *check_zone_fills* preflight is enabled. The *fill* option always forces + a refill, *unfill* forces a zone removal and *none* lets the zones unchanged. + Be careful with the *keep_generated* option when changing this setting. + diff --git a/docs/source/configuration/outputs/Layer.rst b/docs/source/configuration/outputs/Layer.rst new file mode 100644 index 000000000..c1012cae3 --- /dev/null +++ b/docs/source/configuration/outputs/Layer.rst @@ -0,0 +1,12 @@ +.. _Layer: + + +Layer parameters +~~~~~~~~~~~~~~~~ + +- ``description`` :index:`: ` [:ref:`string `] (default: ``''``) A description for the layer, for documentation purposes. + A default can be specified using the `layer_defaults` global option. +- ``layer`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the layer. As you see it in KiCad. +- ``suffix`` :index:`: ` [:ref:`string `] (default: ``''``) Suffix used in file names related to this layer. Derived from the name if not specified. + A default can be specified using the `layer_defaults` global option. + diff --git a/docs/source/configuration/outputs/LayerOptions.rst b/docs/source/configuration/outputs/LayerOptions.rst new file mode 100644 index 000000000..3a6a593b9 --- /dev/null +++ b/docs/source/configuration/outputs/LayerOptions.rst @@ -0,0 +1,19 @@ +.. _LayerOptions: + + +LayerOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- ``color`` :index:`: ` [:ref:`string `] (default: ``''``) Color used for this layer. + KiCad 6+: don't forget the alpha channel for layers like the solder mask. +- ``description`` :index:`: ` [:ref:`string `] (default: ``''``) A description for the layer, for documentation purposes. + A default can be specified using the `layer_defaults` global option. +- ``force_plot_invisible_refs_vals`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include references and values even when they are marked as invisible. +- ``layer`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the layer. As you see it in KiCad. +- ``plot_footprint_refs`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint references. +- ``plot_footprint_values`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint values. +- ``suffix`` :index:`: ` [:ref:`string `] (default: ``''``) Suffix used in file names related to this layer. Derived from the name if not specified. + A default can be specified using the `layer_defaults` global option. +- ``use_for_center`` :index:`: ` [:ref:`boolean `] (default: ``true``) Use this layer for centering purposes. + You can invert the meaning using the `invert_use_for_center` option. + diff --git a/docs/source/configuration/outputs/Navigate_ResultsOptions.rst b/docs/source/configuration/outputs/Navigate_ResultsOptions.rst new file mode 100644 index 000000000..ee048d188 --- /dev/null +++ b/docs/source/configuration/outputs/Navigate_ResultsOptions.rst @@ -0,0 +1,22 @@ +.. _Navigate_ResultsOptions: + + +Navigate_ResultsOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **link_from_root** :index:`: ` [:ref:`string `] (default: ``''``) The name of a file to create at the main output directory linking to the home page. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=html, %x=navigate). Affected by global options. +- ``header`` :index:`: ` [:ref:`boolean `] (default: ``true``) Add a header containing information for the project. +- ``logo`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) PNG file to use as logo, use false to remove. + The KiBot logo is used by default. + +- ``logo_url`` :index:`: ` [:ref:`string `] (default: ``'https://github.com/INTI-CMNB/KiBot/'``) Target link when clicking the logo. +- ``nav_bar`` :index:`: ` [:ref:`boolean `] (default: ``true``) Add a side navigation bar to quickly access to the outputs. +- ``skip_not_run`` :index:`: ` [:ref:`boolean `] (default: ``false``) Skip outputs with `run_by_default: false`. +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Title for the page, when empty KiBot will try using the schematic or PCB title. + If they are empty the name of the project, schematic or PCB file is used. + You can use %X values and KiCad variables here. +- ``title_url`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Target link when clicking the title, use false to remove. + KiBot will try with the origin of the current git repo when empty. + + diff --git a/docs/source/configuration/outputs/NetlistOptions.rst b/docs/source/configuration/outputs/NetlistOptions.rst new file mode 100644 index 000000000..518d50b3f --- /dev/null +++ b/docs/source/configuration/outputs/NetlistOptions.rst @@ -0,0 +1,19 @@ +.. _NetlistOptions: + + +NetlistOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **format** :index:`: ` [:ref:`string `] (default: ``'classic'``) (choices: "classic", "ipc") The `classic` format is the KiCad internal format, and is generated + from the schematic. The `ipc` format is the IPC-D-356 format, useful for PCB + testing, is generated from the PCB. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=netlist/IPC-D-356, %x=net/d356). Affected by global options. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Used for sub-PCBs. + diff --git a/docs/source/configuration/outputs/PCB2BlenderOptions.rst b/docs/source/configuration/outputs/PCB2BlenderOptions.rst new file mode 100644 index 000000000..38dc1bab8 --- /dev/null +++ b/docs/source/configuration/outputs/PCB2BlenderOptions.rst @@ -0,0 +1,16 @@ +.. _PCB2BlenderOptions: + + +PCB2BlenderOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``center`` :index:`: ` [:ref:`boolean `] (default: ``true``) Center the PCB at the coordinates origin. +- ``components`` :index:`: ` [:ref:`boolean `] (default: ``true``) Import the components. +- ``cut_boards`` :index:`: ` [:ref:`boolean `] (default: ``true``) Separate the sub-PCBs in separated 3D models. +- ``enhance_materials`` :index:`: ` [:ref:`boolean `] (default: ``true``) Create good looking materials. +- ``merge_materials`` :index:`: ` [:ref:`boolean `] (default: ``true``) Reuse materials. +- ``solder_joints`` :index:`: ` [:ref:`string `] (default: ``'SMART'``) (choices: "NONE", "SMART", "ALL") The plug-in can add nice looking solder joints. + This option controls if we add it for none, all or only for THT/SMD pads with solder paste. +- ``stack_boards`` :index:`: ` [:ref:`boolean `] (default: ``true``) Move the sub-PCBs to their relative position. +- ``texture_dpi`` :index:`: ` [:ref:`number `] (default: ``1016.0``) (range: 508 to 2032) Texture density in dots per inch. + diff --git a/docs/source/configuration/outputs/PCB2Blender_ToolsOptions.rst b/docs/source/configuration/outputs/PCB2Blender_ToolsOptions.rst new file mode 100644 index 000000000..e242bba63 --- /dev/null +++ b/docs/source/configuration/outputs/PCB2Blender_ToolsOptions.rst @@ -0,0 +1,32 @@ +.. _PCB2Blender_ToolsOptions: + + +PCB2Blender_ToolsOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=pcb2blender, %x=pcb3d). Affected by global options. +- **show_components** :index:`: ` [:ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "none", "all") (also accepts any string) List of components to include in the pads list, + can be also a string for `none` or `all`. Ranges like *R5-R10* are supported. + +- ``board_bounds_create`` :index:`: ` [:ref:`boolean `] (default: ``true``) Create the file that informs the size of the used PCB area. + This is the bounding box reported by KiCad for the PCB edge with 1 mm of margin. +- ``board_bounds_dir`` :index:`: ` [:ref:`string `] (default: ``'layers'``) Sub-directory where the bounds file is stored. +- ``board_bounds_file`` :index:`: ` [:ref:`string `] (default: ``'bounds'``) Name of the bounds file. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``pads_info_create`` :index:`: ` [:ref:`boolean `] (default: ``true``) Create the files containing the PCB pads information. +- ``pads_info_dir`` :index:`: ` [:ref:`string `] (default: ``'pads'``) Sub-directory where the pads info files are stored. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``stackup_create`` :index:`: ` [:ref:`boolean `] (default: ``false``) Create a file containing the board stackup. +- ``stackup_dir`` :index:`: ` [:ref:`string `] (default: ``'.'``) Directory for the stackup file. Use 'layers' for 2.7+. +- ``stackup_file`` :index:`: ` [:ref:`string `] (default: ``'board.yaml'``) Name for the stackup file. Use 'stackup' for 2.7+. +- ``stackup_format`` :index:`: ` [:ref:`string `] (default: ``'JSON'``) (choices: "JSON", "BIN") Format for the stackup file. Use 'BIN' for 2.7+. +- ``sub_boards_bounds_file`` :index:`: ` [:ref:`string `] (default: ``'bounds'``) File name for the sub-PCBs bounds. +- ``sub_boards_create`` :index:`: ` [:ref:`boolean `] (default: ``true``) Extract sub-PCBs and their Z axis position. +- ``sub_boards_dir`` :index:`: ` [:ref:`string `] (default: ``'boards'``) Directory for the boards definitions. +- ``sub_boards_stacked_prefix`` :index:`: ` [:ref:`string `] (default: ``'stacked\_'``) Prefix used for the stack files. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/PCB3DExportOptions.rst b/docs/source/configuration/outputs/PCB3DExportOptions.rst new file mode 100644 index 000000000..b96a3f124 --- /dev/null +++ b/docs/source/configuration/outputs/PCB3DExportOptions.rst @@ -0,0 +1,39 @@ +.. _PCB3DExportOptions: + + +PCB3DExportOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **download** :index:`: ` [:ref:`boolean `] (default: ``true``) Downloads missing 3D models from KiCad git. + Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. + They are downloaded to a temporal directory and discarded. + If you want to cache the downloaded files specify a directory using the + KIBOT_3D_MODELS environment variable. +- **no_virtual** :index:`: ` [:ref:`boolean `] (default: ``false``) Used to exclude 3D models for components with 'virtual' attribute. +- **show_components** :index:`: ` [:ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "none", "all") (also accepts any string) List of components to draw, can be also a string for `none` or `all`. + Ranges like *R5-R10* are supported. + Unlike the `pcbdraw` output, the default is `all`. + +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``download_lcsc`` :index:`: ` [:ref:`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. +- ``highlight`` :index:`: ` [:ref:`list(string) `] (default: ``[]``) List of components to highlight. Ranges like *R5-R10* are supported. + +- ``highlight_on_top`` :index:`: ` [:ref:`boolean `] (default: ``false``) Highlight over the component (not under). +- ``highlight_padding`` :index:`: ` [:ref:`number `] (default: ``1.5``) (range: 0 to 1000) How much the highlight extends around the component [mm]. +- ``kicad_3d_url`` :index:`: ` [:ref:`string `] (default: ``'https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'``) Base URL for the KiCad 3D models. +- ``kicad_3d_url_suffix`` :index:`: ` [:ref:`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. +- ``output`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the generated PCB3D file (%i='blender_export' %x='pcb3d'). Affected by global options. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``solder_paste_for_populated`` :index:`: ` [:ref:`boolean `] (default: ``true``) Add solder paste only for the populated components. + Populated components are the ones listed in `show_components`. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. +- ``version`` :index:`: ` [:ref:`string `] (default: ``'2.7'``) (choices: "2.1", "2.1_haschtl", "2.7") Variant of the format used. + diff --git a/docs/source/configuration/outputs/PCB_PrintOptions.rst b/docs/source/configuration/outputs/PCB_PrintOptions.rst new file mode 100644 index 000000000..c9ba97bf1 --- /dev/null +++ b/docs/source/configuration/outputs/PCB_PrintOptions.rst @@ -0,0 +1,76 @@ +.. _PCB_PrintOptions: + + +PCB_PrintOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **color_theme** :index:`: ` [:ref:`string `] (default: ``'_builtin_classic'``) Selects the color theme. Only applies to KiCad 6. + To use the KiCad 6 default colors select `_builtin_default`. + Usually user colors are stored as `user`, but you can give it another name. +- **force_edge_cuts** :index:`: ` [:ref:`boolean `] (default: ``false``) Add the `Edge.Cuts` to all the pages. +- **format** :index:`: ` [:ref:`string `] (default: ``'PDF'``) (choices: "PDF", "SVG", "PNG", "EPS", "PS") Format for the output file/s. + Note that for PS you need `ghostscript` which isn't part of the default docker images. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=assembly, %x=pdf/ps)/(%i=assembly_page_NN, %x=svg/png/eps). + Consult the `page_number_as_extension` and `page_id` options. Affected by global options. +- *output_name* :index:`: ` Alias for output. +- **pages** :index:`: ` [:ref:`PagesOptions parameters `] [:ref:`list(dict) `] (default: ``[]``) List of pages to include in the output document. + Each page contains one or more layers of the PCB. +- **plot_sheet_reference** :index:`: ` [:ref:`boolean `] (default: ``true``) Include the title-block (worksheet, frame, etc.). +- **scaling** :index:`: ` [:ref:`number `] (default: ``1.0``) Default scale factor (0 means autoscaling). +- ``add_background`` :index:`: ` [:ref:`boolean `] (default: ``false``) Add a background to the pages, see `background_color`. +- ``autoscale_margin_x`` :index:`: ` [:ref:`number `] (default: ``0``) Default horizontal margin used for the autoscaling mode [mm]. +- ``autoscale_margin_y`` :index:`: ` [:ref:`number `] (default: ``0``) Default vertical margin used for the autoscaling mode [mm]. +- ``background_color`` :index:`: ` [:ref:`string `] (default: ``'#FFFFFF'``) Color for the background when `add_background` is enabled. +- ``background_image`` :index:`: ` [:ref:`string `] (default: ``''``) Background image, must be an SVG, only when `add_background` is enabled. +- ``blind_via_color`` :index:`: ` [:ref:`string `] (default: ``''``) Color used for blind/buried `colored_vias`. +- ``colored_pads`` :index:`: ` [:ref:`boolean `] (default: ``true``) Plot through-hole in a different color. Like KiCad GUI does. +- ``colored_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Plot vias in a different color. Like KiCad GUI does. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``dpi`` :index:`: ` [:ref:`number `] (default: ``360``) (range: 36 to 1200) Resolution (Dots Per Inch) for the output file. Most objects are vectors, but thing + like the the solder mask are handled as images by the conversion tools. +- ``drill_marks`` :index:`: ` [:ref:`string `] (default: ``'full'``) (choices: "none", "small", "full") What to use to indicate the drill places, can be none, small or full (for real scale). +- ``forced_edge_cuts_color`` :index:`: ` [:ref:`string `] (default: ``''``) Color used for the `force_edge_cuts` option. +- ``forced_edge_cuts_use_for_center`` :index:`: ` [:ref:`boolean `] (default: ``true``) Used when enabling the `force_edge_cuts`, in this case this is the `use_for_center` option of the forced + layer. +- ``frame_plot_mechanism`` :index:`: ` [:ref:`string `] (default: ``'internal'``) (choices: "gui", "internal", "plot") Plotting the frame from Python is problematic. + This option selects a workaround strategy. + gui: uses KiCad GUI to do it. Is slow but you get the correct frame. + But it can't keep track of page numbers. + internal: KiBot loads the `.kicad_wks` and does the drawing work. + Best option, but some details are different from what the GUI generates. + plot: uses KiCad Python API. Not available for KiCad 5. + You get the default frame and some substitutions doesn't work. +- ``hide_excluded`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide components in the Fab layer that are marked as excluded by a variant. + Affected by global options. +- ``individual_page_scaling`` :index:`: ` [:ref:`boolean `] (default: ``true``) Tell KiCad to apply the scaling for each page as a separated entity. + Disabling it the pages are coherent and can be superposed. +- ``invert_use_for_center`` :index:`: ` [:ref:`boolean `] (default: ``false``) Invert the meaning of the `use_for_center` layer option. + This can be used to just select the edge cuts for centering, in this case enable this option + and disable the `use_for_center` option of the edge cuts layer. +- ``keep_temporal_files`` :index:`: ` [:ref:`boolean `] (default: ``false``) Store the temporal page and layer files in the output dir and don't delete them. +- ``micro_via_color`` :index:`: ` [:ref:`string `] (default: ``''``) Color used for micro `colored_vias`. +- ``pad_color`` :index:`: ` [:ref:`string `] (default: ``''``) Color used for `colored_pads`. +- ``page_number_as_extension`` :index:`: ` [:ref:`boolean `] (default: ``false``) When enabled the %i is always `assembly`, the %x will be NN.FORMAT (i.e. 01.png). + Note: page numbers can be customized using the `page_id` option for each page. +- ``png_width`` :index:`: ` [:ref:`number `] (default: ``1280``) (range: 0 to 7680) Width of the PNG in pixels. Use 0 to use as many pixels as the DPI needs for the page size. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``realistic_solder_mask`` :index:`: ` [:ref:`boolean `] (default: ``true``) Try to draw the solder mask as a real solder mask, not the negative used for fabrication. + In order to get a good looking select a color with transparency, i.e. '#14332440'. + PcbDraw must be installed in order to use this option. +- ``sheet_reference_layout`` :index:`: ` [:ref:`string `] (default: ``''``) Worksheet file (.kicad_wks) to use. Leave empty to use the one specified in the project. +- ``svg_precision`` :index:`: ` [:ref:`number `] (default: ``4``) (range: 0 to 6) Scale factor used to represent 1 mm in the SVG (KiCad 6). + The value is how much zeros has the multiplier (1 mm = 10 power `svg_precision` units). + Note that for an A4 paper Firefox 91 and Chrome 105 can't handle more than 5. +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. +- ``via_color`` :index:`: ` [:ref:`string `] (default: ``''``) Color used for through-hole `colored_vias`. + +.. toctree:: + :caption: Used dicts + + PagesOptions diff --git a/docs/source/configuration/outputs/PCB_Variant_Options.rst b/docs/source/configuration/outputs/PCB_Variant_Options.rst new file mode 100644 index 000000000..7355540b6 --- /dev/null +++ b/docs/source/configuration/outputs/PCB_Variant_Options.rst @@ -0,0 +1,20 @@ +.. _PCB_Variant_Options: + + +PCB_Variant_Options parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=variant, %x=kicad_pcb). Affected by global options. +- ``copy_project`` :index:`: ` [:ref:`boolean `] (default: ``true``) Copy the KiCad project to the destination directory. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``hide_excluded`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide components in the Fab layer that are marked as excluded by a variant. + Affected by global options. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/PDFOptions.rst b/docs/source/configuration/outputs/PDFOptions.rst new file mode 100644 index 000000000..74860e4be --- /dev/null +++ b/docs/source/configuration/outputs/PDFOptions.rst @@ -0,0 +1,47 @@ +.. _PDFOptions: + + +PDFOptions parameters +~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Output file name, the default KiCad name if empty. + IMPORTANT! KiCad will always create the file using its own name and then we can rename it. + For this reason you must avoid generating two variants at the same directory when one of + them uses the default KiCad name. Affected by global options. +- **plot_sheet_reference** :index:`: ` [:ref:`boolean `] (default: ``false``) Include the frame and title block. Only available for KiCad 6+ and you get a poor result + (i.e. always the default worksheet style, also problems expanding text variables). + The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. +- **scaling** :index:`: ` [:ref:`number `] (default: ``1``) Scale factor (0 means autoscaling). +- ``custom_reports`` :index:`: ` [:ref:`CustomReport parameters `] [:ref:`list(dict) `] (default: ``[]``) A list of customized reports for the manufacturer. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``drill_marks`` :index:`: ` [:ref:`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:`: ` [:ref:`string `] (default: ``''``) Used to configure the edge cuts layer extension for Protel mode. Include the dot. +- ``exclude_edge_layer`` :index:`: ` [:ref:`boolean `] (default: ``true``) Do not include the PCB edge layer. +- ``exclude_pads_from_silkscreen`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not plot the component pads in the silk screen (KiCad 5.x only). +- ``force_plot_invisible_refs_vals`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include references and values even when they are marked as invisible. +- ``individual_page_scaling`` :index:`: ` [:ref:`boolean `] (default: ``true``) Tell KiCad to apply the scaling for each layer as a separated entity. + Disabling it the pages are coherent and can be superposed. +- ``inner_extension_pattern`` :index:`: ` [:ref:`string `] (default: ``''``) Used to change the Protel style extensions for inner layers. + The replacement pattern can contain %n for the inner layer number and %N for the layer number. + Example '.g%n'. +- ``line_width`` :index:`: ` [:ref:`number `] (default: ``0.1``) (range: 0.02 to 2) For objects without width [mm] (KiCad 5). +- ``mirror_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Plot mirrored. +- ``negative_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Invert black and white. +- ``plot_footprint_refs`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint references. +- ``plot_footprint_values`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint values. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``sketch_pad_line_width`` :index:`: ` [:ref:`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). +- ``sketch_pads_on_fab_layers`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). +- ``tent_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Cover the vias. +- ``uppercase_extensions`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use uppercase names for the extensions. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + +.. toctree:: + :caption: Used dicts + + CustomReport diff --git a/docs/source/configuration/outputs/PDFUniteOptions.rst b/docs/source/configuration/outputs/PDFUniteOptions.rst new file mode 100644 index 000000000..6cb2d8710 --- /dev/null +++ b/docs/source/configuration/outputs/PDFUniteOptions.rst @@ -0,0 +1,14 @@ +.. _PDFUniteOptions: + + +PDFUniteOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the generated PDF (%i=name of the output %x=pdf). Affected by global options. +- **outputs** :index:`: ` [:ref:`FilesList parameters `] [:ref:`list(dict) `] (default: ``[]``) Which files will be included. +- ``use_external_command`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the `pdfunite` tool instead of PyPDF2 Python module. + +.. toctree:: + :caption: Used dicts + + FilesList diff --git a/docs/source/configuration/outputs/PDF_PCB_PrintOptions.rst b/docs/source/configuration/outputs/PDF_PCB_PrintOptions.rst new file mode 100644 index 000000000..bc59ae2cb --- /dev/null +++ b/docs/source/configuration/outputs/PDF_PCB_PrintOptions.rst @@ -0,0 +1,32 @@ +.. _PDF_PCB_PrintOptions: + + +PDF_PCB_PrintOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **plot_sheet_reference** :index:`: ` [:ref:`boolean `] (default: ``true``) Include the title-block. +- **scaling** :index:`: ` [:ref:`number `] (default: ``1.0``) Scale factor (0 means autoscaling). You should disable `plot_sheet_reference` when using it. +- **separated** :index:`: ` [:ref:`boolean `] (default: ``false``) Print layers in separated pages. +- ``color_theme`` :index:`: ` [:ref:`string `] (default: ``'_builtin_classic'``) Selects the color theme. Onlyu applies to KiCad 6. + To use the KiCad 6 default colors select `_builtin_default`. + Usually user colors are stored as `user`, but you can give it another name. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``drill_marks`` :index:`: ` [:ref:`string `] (default: ``'full'``) (choices: "none", "small", "full") What to use to indicate the drill places, can be none, small or full (for real scale). +- ``force_edge_cuts`` :index:`: ` [:ref:`boolean `] (default: ``true``) Only useful for KiCad 6 when printing in one page, you can disable the edge here. + KiCad 5 forces it by default, and you can't control it from config files. + Same for KiCad 6 when printing to separated pages. +- ``hide_excluded`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide components in the Fab layer that are marked as excluded by a variant. + Affected by global options. +- ``mirror`` :index:`: ` [:ref:`boolean `] (default: ``false``) Print mirrored (X axis inverted). ONLY for KiCad 6. +- ``monochrome`` :index:`: ` [:ref:`boolean `] (default: ``false``) Print in black and white. +- ``output`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output PDF (%i=layers, %x=pdf). Affected by global options. +- *output_name* :index:`: ` Alias for output. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/PDF_SCH_PrintOptions.rst b/docs/source/configuration/outputs/PDF_SCH_PrintOptions.rst new file mode 100644 index 000000000..cefb42660 --- /dev/null +++ b/docs/source/configuration/outputs/PDF_SCH_PrintOptions.rst @@ -0,0 +1,26 @@ +.. _PDF_SCH_PrintOptions: + + +PDF_SCH_PrintOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **frame** :index:`: ` [:ref:`boolean `] (default: ``true``) Include the frame and title block. +- ``all_pages`` :index:`: ` [:ref:`boolean `] (default: ``true``) Generate with all hierarchical sheets. +- ``background_color`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the background color from the `color_theme` (KiCad 6). +- ``color_theme`` :index:`: ` [:ref:`string `] (default: ``''``) Color theme used, this must exist in the KiCad config (KiCad 6). +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``monochrome`` :index:`: ` [:ref:`boolean `] (default: ``false``) Generate a monochromatic output. +- ``output`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output PDF (%i=schematic, %x=pdf). Affected by global options. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``sheet_reference_layout`` :index:`: ` [:ref:`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 + file is available. +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Not fitted components are crossed. + diff --git a/docs/source/configuration/outputs/PSOptions.rst b/docs/source/configuration/outputs/PSOptions.rst new file mode 100644 index 000000000..7b571145e --- /dev/null +++ b/docs/source/configuration/outputs/PSOptions.rst @@ -0,0 +1,53 @@ +.. _PSOptions: + + +PSOptions parameters +~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Output file name, the default KiCad name if empty. + IMPORTANT! KiCad will always create the file using its own name and then we can rename it. + For this reason you must avoid generating two variants at the same directory when one of + them uses the default KiCad name. Affected by global options. +- **plot_sheet_reference** :index:`: ` [:ref:`boolean `] (default: ``false``) Include the frame and title block. Only available for KiCad 6+ and you get a poor result + (i.e. always the default worksheet style, also problems expanding text variables). + The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. +- **scaling** :index:`: ` [:ref:`number `] (default: ``1``) Scale factor (0 means autoscaling). +- ``a4_output`` :index:`: ` [:ref:`boolean `] (default: ``true``) Force A4 paper size. +- ``custom_reports`` :index:`: ` [:ref:`CustomReport parameters `] [:ref:`list(dict) `] (default: ``[]``) A list of customized reports for the manufacturer. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``drill_marks`` :index:`: ` [:ref:`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:`: ` [:ref:`string `] (default: ``''``) Used to configure the edge cuts layer extension for Protel mode. Include the dot. +- ``exclude_edge_layer`` :index:`: ` [:ref:`boolean `] (default: ``true``) Do not include the PCB edge layer. +- ``exclude_pads_from_silkscreen`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not plot the component pads in the silk screen (KiCad 5.x only). +- ``force_plot_invisible_refs_vals`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include references and values even when they are marked as invisible. +- ``individual_page_scaling`` :index:`: ` [:ref:`boolean `] (default: ``true``) Tell KiCad to apply the scaling for each layer as a separated entity. + Disabling it the pages are coherent and can be superposed. +- ``inner_extension_pattern`` :index:`: ` [:ref:`string `] (default: ``''``) Used to change the Protel style extensions for inner layers. + The replacement pattern can contain %n for the inner layer number and %N for the layer number. + Example '.g%n'. +- ``line_width`` :index:`: ` [:ref:`number `] (default: ``0.15``) (range: 0.02 to 2) For objects without width [mm] (KiCad 5). +- ``mirror_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Plot mirrored. +- ``negative_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Invert black and white. +- ``plot_footprint_refs`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint references. +- ``plot_footprint_values`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint values. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``scale_adjust_x`` :index:`: ` [:ref:`number `] (default: ``1.0``) Fine grain adjust for the X scale (floating point multiplier). +- ``scale_adjust_y`` :index:`: ` [:ref:`number `] (default: ``1.0``) Fine grain adjust for the Y scale (floating point multiplier). +- ``sketch_pad_line_width`` :index:`: ` [:ref:`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). +- ``sketch_pads_on_fab_layers`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). +- ``sketch_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Don't fill objects, just draw the outline. +- ``tent_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Cover the vias. +- ``uppercase_extensions`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use uppercase names for the extensions. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. +- ``width_adjust`` :index:`: ` [:ref:`number `] (default: ``0``) This width factor is intended to compensate PS printers/plotters that do not strictly obey line width settings. + Only used to plot pads and tracks. + +.. toctree:: + :caption: Used dicts + + CustomReport diff --git a/docs/source/configuration/outputs/PS_SCH_PrintOptions.rst b/docs/source/configuration/outputs/PS_SCH_PrintOptions.rst new file mode 100644 index 000000000..3ff185b0b --- /dev/null +++ b/docs/source/configuration/outputs/PS_SCH_PrintOptions.rst @@ -0,0 +1,26 @@ +.. _PS_SCH_PrintOptions: + + +PS_SCH_PrintOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **frame** :index:`: ` [:ref:`boolean `] (default: ``true``) Include the frame and title block. +- ``all_pages`` :index:`: ` [:ref:`boolean `] (default: ``true``) Generate with all hierarchical sheets. +- ``background_color`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the background color from the `color_theme` (KiCad 6). +- ``color_theme`` :index:`: ` [:ref:`string `] (default: ``''``) Color theme used, this must exist in the KiCad config (KiCad 6). +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``monochrome`` :index:`: ` [:ref:`boolean `] (default: ``false``) Generate a monochromatic output. +- ``output`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output postscript (%i=schematic, %x=ps). Affected by global options. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``sheet_reference_layout`` :index:`: ` [:ref:`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 + file is available. +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Not fitted components are crossed. + diff --git a/docs/source/configuration/outputs/PagesOptions.rst b/docs/source/configuration/outputs/PagesOptions.rst new file mode 100644 index 000000000..0935f4029 --- /dev/null +++ b/docs/source/configuration/outputs/PagesOptions.rst @@ -0,0 +1,49 @@ +.. _PagesOptions: + + +PagesOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- **layers** :index:`: ` [:ref:`LayerOptions parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string). +- **scaling** :index:`: ` [:ref:`number `] (default: ``1.0``) Scale factor (0 means autoscaling). When not defined we use the default value for the output. +- **sort_layers** :index:`: ` [:ref:`boolean `] (default: ``false``) Try to sort the layers in the same order that uses KiCad for printing. +- ``autoscale_margin_x`` :index:`: ` [:ref:`number `] (default: ``0``) Horizontal margin used for the autoscaling mode [mm]. + When not defined we use the default value for the output. +- ``autoscale_margin_y`` :index:`: ` [:ref:`number `] (default: ``0``) Vertical margin used for the autoscaling mode [mm]. + When not defined we use the default value for the output. +- ``colored_holes`` :index:`: ` [:ref:`boolean `] (default: ``true``) Change the drill holes to be colored instead of white. +- ``exclude_pads_from_silkscreen`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not plot the component pads in the silk screen (KiCad 5.x only). +- ``holes_color`` :index:`: ` [:ref:`string `] (default: ``'#000000'``) Color used for the holes when `colored_holes` is enabled. +- ``layer_var`` :index:`: ` [:ref:`string `] (default: ``'%ll'``) Text to use for the `LAYER` in the title block. + All the expansions available for `sheet` are also available here. +- ``line_width`` :index:`: ` [:ref:`number `] (default: ``0.1``) (range: 0.02 to 2) For objects without width [mm] (KiCad 5). +- ``mirror`` :index:`: ` [:ref:`boolean `] (default: ``false``) Print mirrored (X axis inverted). +- ``mirror_footprint_text`` :index:`: ` [:ref:`boolean `] (default: ``true``) Mirror text in the footprints when mirror option is enabled and we plot a user layer. +- ``mirror_pcb_text`` :index:`: ` [:ref:`boolean `] (default: ``true``) Mirror text in the PCB when mirror option is enabled and we plot a user layer. +- ``monochrome`` :index:`: ` [:ref:`boolean `] (default: ``false``) Print in gray scale. +- ``negative_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Invert black and white. Only useful for a single layer. +- ``page_id`` :index:`: ` [:ref:`string `] (default: ``'%02d'``) Text to differentiate the pages. Use %d (like in C) to get the page number. +- ``repeat_for_layer`` :index:`: ` [:ref:`string `] (default: ``''``) Use this page as a pattern to create more pages. + The other pages will change the layer mentioned here. + This can be used to generate a page for each copper layer, here you put `F.Cu`. + See `repeat_layers`. +- ``repeat_inherit`` :index:`: ` [:ref:`boolean `] (default: ``true``) If we will inherit the options of the layer we are replacing. + Disable it if you specify the options in `repeat_layers`, which is unlikely. +- ``repeat_layers`` :index:`: ` [:ref:`LayerOptions parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'inners'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string). +- ``sheet`` :index:`: ` [:ref:`string `] (default: ``'Assembly'``) Text to use for the `SHEET` in the title block. + Pattern (%*) and text variables are expanded. + The %ll is the list of layers included in this page. + In addition when you use `repeat_for_layer` the following patterns are available: + %ln layer name, %ls layer suffix and %ld layer description. +- ``sheet_reference_color`` :index:`: ` [:ref:`string `] (default: ``''``) Color to use for the frame and title block. +- ``sketch_pad_line_width`` :index:`: ` [:ref:`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). +- ``sketch_pads_on_fab_layers`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). +- ``tent_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Cover the vias. +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. + +.. toctree:: + :caption: Used dicts + + LayerOptions diff --git a/docs/source/configuration/outputs/PanelizeConfig.rst b/docs/source/configuration/outputs/PanelizeConfig.rst new file mode 100644 index 000000000..bd052c798 --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeConfig.rst @@ -0,0 +1,41 @@ +.. _PanelizeConfig: + + +PanelizeConfig parameters +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **cuts** :index:`: ` [:ref:`PanelizeCuts parameters `] [:ref:`dict `] (default: ``null``) Specify how to perform the cuts on the tabs separating the board. +- **fiducials** :index:`: ` [:ref:`PanelizeFiducials parameters `] [:ref:`dict `] (default: ``null``) Used to add fiducial marks to the (rail/frame of) the panel. +- **framing** :index:`: ` [:ref:`PanelizeFraming parameters `] [:ref:`dict `] (default: ``null``) Specify the frame around the boards. +- **layout** :index:`: ` [:ref:`PanelizeLayout parameters `] [:ref:`dict `] (default: ``null``) Layout used for the panel. +- **page** :index:`: ` [:ref:`PanelizePage parameters `] [:ref:`dict `] (default: ``null``) Sets page size on the resulting panel and position the panel in the page. +- **tabs** :index:`: ` [:ref:`PanelizeTabs parameters `] [:ref:`dict `] (default: ``null``) Style of the tabs used to join the PCB copies. +- **tooling** :index:`: ` [:ref:`PanelizeTooling parameters `] [:ref:`dict `] (default: ``null``) Used to add tooling holes to the (rail/frame of) the panel. +- ``copperfill`` :index:`: ` [:ref:`PanelizeCopperfill parameters `] [:ref:`dict `] (default: ``null``) Fill non-board areas of the panel with copper. +- ``debug`` :index:`: ` [:ref:`PanelizeDebug parameters `] [:ref:`dict `] (default: ``null``) Debug options. +- ``expand_text`` :index:`: ` [:ref:`boolean `] (default: ``true``) Expand text variables and KiBot %X markers in text objects. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) A configuration to use as base for this one. Use the following format: `OUTPUT_NAME[CFG_NAME]`. +- ``name`` :index:`: ` [:ref:`string `] (default: ``''``) A name to identify this configuration. If empty will be the order in the list, starting with 1. + Don't use just a number or it will be confused as an index. +- ``post`` :index:`: ` [:ref:`PanelizePost parameters `] [:ref:`dict `] (default: ``null``) Finishing touches to the panel. +- ``source`` :index:`: ` [:ref:`PanelizeSource parameters `] [:ref:`dict `] (default: ``null``) Used to adjust details of which part of the PCB is panelized. +- ``text`` :index:`: ` [:ref:`PanelizeText parameters `] [:ref:`dict `] (default: ``null``) Used to add text to the panel. +- ``text2`` :index:`: ` [:ref:`PanelizeText parameters `] [:ref:`dict `] (default: ``null``) Used to add text to the panel. +- ``text3`` :index:`: ` [:ref:`PanelizeText parameters `] [:ref:`dict `] (default: ``null``) Used to add text to the panel. +- ``text4`` :index:`: ` [:ref:`PanelizeText parameters `] [:ref:`dict `] (default: ``null``) Used to add text to the panel. + +.. toctree:: + :caption: Used dicts + + PanelizeCopperfill + PanelizeCuts + PanelizeDebug + PanelizeFiducials + PanelizeFraming + PanelizeLayout + PanelizePage + PanelizePost + PanelizeSource + PanelizeTabs + PanelizeText + PanelizeTooling diff --git a/docs/source/configuration/outputs/PanelizeCopperfill.rst b/docs/source/configuration/outputs/PanelizeCopperfill.rst new file mode 100644 index 000000000..03d85ffc9 --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeCopperfill.rst @@ -0,0 +1,20 @@ +.. _PanelizeCopperfill: + + +PanelizeCopperfill parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **type** :index:`: ` '' +- ``clearance`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0.5``) Extra clearance from the board perimeters. Suitable for, e.g., not filling the tabs with + copper. +- ``diameter`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``7``) Diameter of hexagons. +- *edge_clearance* :index:`: ` Alias for edgeclearance. +- ``edgeclearance`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0.5``) Specifies clearance between the fill and panel perimeter. +- ``layers`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'F.Cu,B.Cu'``) [:ref:`comma separated `] List of layers to fill. Can be a comma-separated string. + Using *all* means all external copper layers. + +- ``orientation`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``45``) The orientation of the hatched strokes. +- ``spacing`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``1``) The space between the hatched strokes or hexagons. +- ``threshold`` :index:`: ` [:ref:`number `] (default: ``15``) Remove fragments smaller than threshold. Expressed as a percentage. +- ``width`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``1``) The width of the hatched strokes. + diff --git a/docs/source/configuration/outputs/PanelizeCuts.rst b/docs/source/configuration/outputs/PanelizeCuts.rst new file mode 100644 index 000000000..de8292c22 --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeCuts.rst @@ -0,0 +1,34 @@ +.. _PanelizeCuts: + + +PanelizeCuts parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- **type** :index:`: ` '' +- ``arg`` :index:`: ` [:ref:`string `] (default: ``''``) Argument to pass to the plugin. Used for *plugin*. +- ``clearance`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Specify clearance for copper around V-cuts. +- ``code`` :index:`: ` [:ref:`string `] (default: ``''``) Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. +- *cut_curves* :index:`: ` Alias for cutcurves. +- ``cutcurves`` :index:`: ` [:ref:`boolean `] (default: ``false``) Specify if curves should be approximated by straight cuts (e.g., for cutting tabs on circular boards). + Used for *vcuts*. +- ``drill`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0.5``) Drill size used for the *mousebites*. +- *end_prolongation* :index:`: ` Alias for endprolongation. +- ``endprolongation`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``3``) Prolongation on the end of V-CUT without text. +- ``layer`` :index:`: ` [:ref:`string `] (default: ``'Cmts.User'``) Specify the layer to render V-cuts on. Also used for the *layer* type. +- *line_width* :index:`: ` Alias for linewidth. +- ``linewidth`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0.3``) Line width to plot cuts with. +- ``offset`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Specify the *mousebites* and *vcuts* offset, positive offset puts the cuts into the board, + negative puts the cuts into the tabs. +- ``prolong`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Distance for tangential prolongation of the cuts (to cut through the internal corner fillets + caused by milling). Used for *mousebites* and *layer*. +- ``spacing`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0.8``) The spacing of the holes used for the *mousebites*. +- ``template`` :index:`: ` [:ref:`string `] (default: ``'V-CUT'``) Text template for the V-CUT. +- *text_offset* :index:`: ` Alias for textoffset. +- *text_prolongation* :index:`: ` Alias for textprolongation. +- *text_size* :index:`: ` Alias for textsize. +- *text_thickness* :index:`: ` Alias for textthickness. +- ``textoffset`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``3``) Text offset from the V-CUT. +- ``textprolongation`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``3``) Prolongation of the text size of V-CUT. +- ``textsize`` :index:`: ` [:ref:`number ` | :ref:`string `] Text size for vcuts. +- ``textthickness`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0.3``) Text thickness for width. + diff --git a/docs/source/configuration/outputs/PanelizeDebug.rst b/docs/source/configuration/outputs/PanelizeDebug.rst new file mode 100644 index 000000000..09fe6951c --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeDebug.rst @@ -0,0 +1,13 @@ +.. _PanelizeDebug: + + +PanelizeDebug parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``deterministic`` :index:`: ` [:ref:`boolean `] (default: ``false``) Deterministic. +- ``drawBackboneLines`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw backbone lines. +- ``drawPartitionLines`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw partition lines. +- ``drawboxes`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw boxes. +- ``drawtabfail`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw tab fail. +- ``trace`` :index:`: ` [:ref:`boolean `] (default: ``false``) Trace. + diff --git a/docs/source/configuration/outputs/PanelizeFiducials.rst b/docs/source/configuration/outputs/PanelizeFiducials.rst new file mode 100644 index 000000000..53d5547c8 --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeFiducials.rst @@ -0,0 +1,14 @@ +.. _PanelizeFiducials: + + +PanelizeFiducials parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **type** :index:`: ` '' +- *copper_size* :index:`: ` Alias for coppersize. +- ``coppersize`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``1``) Diameter of the copper spot. +- ``hoffset`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Horizontal offset from panel edges. +- ``opening`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``1``) Diameter of the solder mask opening. +- ``paste`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include the fiducials in the paste layer (therefore they appear on the stencil). +- ``voffset`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Vertical offset from panel edges. + diff --git a/docs/source/configuration/outputs/PanelizeFraming.rst b/docs/source/configuration/outputs/PanelizeFraming.rst new file mode 100644 index 000000000..4a6e01b26 --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeFraming.rst @@ -0,0 +1,35 @@ +.. _PanelizeFraming: + + +PanelizeFraming parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **type** :index:`: ` '' +- ``arg`` :index:`: ` [:ref:`string `] (default: ``''``) Argument to pass to the plugin. Used for *plugin*. +- ``chamfer`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Specify the size of chamfer frame corners. You can also separately specify `chamferwidth` + and `chamferheight` to create a non 45 degrees chamfer. +- *chamfer_height* :index:`: ` Alias for chamferheight. +- *chamfer_width* :index:`: ` Alias for chamferwidth. +- ``chamferheight`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Height of the chamfer frame corners, used for non 45 degrees chamfer. +- ``chamferwidth`` :index:`: ` [:ref:`number ` | :ref:`string `] Width of the chamfer frame corners, used for non 45 degrees chamfer. +- ``code`` :index:`: ` [:ref:`string `] (default: ``''``) Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. +- ``cuts`` :index:`: ` [:ref:`string `] (default: ``'both'``) (choices: "none", "both", "v", "h") Specify whether to add cuts to the corners of the frame for easy removal. + Used for *frame*. +- ``fillet`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Specify radius of fillet frame corners. +- ``hspace`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``2``) Specify the horizontal space between PCB and the frame/rail. +- *max_total_height* :index:`: ` Alias for maxtotalheight. +- *max_total_width* :index:`: ` Alias for maxtotalwidth. +- ``maxtotalheight`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``10000``) Maximal height of the panel. +- ``maxtotalwidth`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``10000``) Maximal width of the panel. +- *min_total_height* :index:`: ` Alias for mintotalheight. +- *min_total_width* :index:`: ` Alias for mintotalwidth. +- ``mintotalheight`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) If needed, add extra material to the rail or frame to meet the minimal requested size. + Useful for services that require minimal panel size. +- ``mintotalwidth`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) If needed, add extra material to the rail or frame to meet the minimal requested size. + Useful for services that require minimal panel size. +- *slot_width* :index:`: ` Alias for slotwidth. +- ``slotwidth`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``2``) Width of the milled slot for *tightframe*. +- ``space`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``2``) Specify the space between PCB and the frame/rail. Overrides `hspace` and `vspace`. +- ``vspace`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``2``) Specify the vertical space between PCB and the frame/rail. +- ``width`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``5``) Specify with of the rails or frame. + diff --git a/docs/source/configuration/outputs/PanelizeLayout.rst b/docs/source/configuration/outputs/PanelizeLayout.rst new file mode 100644 index 000000000..0eb19b09b --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeLayout.rst @@ -0,0 +1,48 @@ +.. _PanelizeLayout: + + +PanelizeLayout parameters +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **cols** :index:`: ` [:ref:`number `] (default: ``1``) Specify the number of columns of boards in the grid pattern. +- **rows** :index:`: ` [:ref:`number `] (default: ``1``) Specify the number of rows of boards in the grid pattern. +- ``alternation`` :index:`: ` [:ref:`string `] (default: ``'none'``) (choices: "none", "rows", "cols", "rowsCols") Specify alternations of board rotation. + none: Do not alternate. + rows: Rotate boards by 180Ā° on every next row. + cols: Rotate boards by 180Ā° on every next column. + rowsCols: Rotate boards by 180Ā° based on a chessboard pattern. +- ``arg`` :index:`: ` [:ref:`string `] (default: ``''``) Argument to pass to the plugin. Used for *plugin*. +- *bake_text* :index:`: ` Alias for baketext. +- ``baketext`` :index:`: ` [:ref:`boolean `] (default: ``true``) A flag that indicates if text variables should be substituted or not. +- ``code`` :index:`: ` [:ref:`string `] (default: ``''``) Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. +- *h_back_bone* :index:`: ` Alias for hbackbone. +- *h_bone_cut* :index:`: ` Alias for hbonecut. +- *h_bone_first* :index:`: ` Alias for hbonefirst. +- *h_bone_skip* :index:`: ` Alias for hboneskip. +- ``hbackbone`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) The width of horizontal backbone (0 means no backbone). The backbone does not increase the + spacing of the boards. +- ``hbonecut`` :index:`: ` [:ref:`boolean `] (default: ``true``) If there are both backbones specified, specifies if there should be a horizontal cut where the backbones + cross. +- ``hbonefirst`` :index:`: ` [:ref:`number `] (default: ``0``) Specify first horizontal backbone to render. +- ``hboneskip`` :index:`: ` [:ref:`number `] (default: ``0``) Skip every n horizontal backbones. I.e., 1 means place only every other backbone. +- ``hspace`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Specify the horizontal gap between the boards. +- *rename_net* :index:`: ` Alias for renamenet. +- *rename_ref* :index:`: ` Alias for renameref. +- ``renamenet`` :index:`: ` [:ref:`string `] (default: ``'Board_{n}-{orig}'``) A pattern by which to rename the nets. You can use {n} and {orig} to get the board number and original name. +- ``renameref`` :index:`: ` [:ref:`string `] (default: ``'{orig}'``) A pattern by which to rename the references. You can use {n} and {orig} to get the board number and original + name. +- ``rotation`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Rotate the boards before placing them in the panel. +- ``space`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Specify the gap between the boards, overwrites `hspace` and `vspace`. +- **type** :index:`: ` '' +- *v_back_bone* :index:`: ` Alias for vbackbone. +- *v_bone_cut* :index:`: ` Alias for vbonecut. +- *v_bone_first* :index:`: ` Alias for vbonefirst. +- *v_bone_skip* :index:`: ` Alias for vboneskip. +- ``vbackbone`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) The width of vertical backbone (0 means no backbone). The backbone does not increase the + spacing of the boards. +- ``vbonecut`` :index:`: ` [:ref:`boolean `] (default: ``true``) If there are both backbones specified, specifies if there should be a vertical cut where the backbones + cross. +- ``vbonefirst`` :index:`: ` [:ref:`number `] (default: ``0``) Specify first vertical backbone to render. +- ``vboneskip`` :index:`: ` [:ref:`number `] (default: ``0``) Skip every n vertical backbones. I.e., 1 means place only every other backbone. +- ``vspace`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Specify the vertical gap between the boards. + diff --git a/docs/source/configuration/outputs/PanelizeOptions.rst b/docs/source/configuration/outputs/PanelizeOptions.rst new file mode 100644 index 000000000..379aebd0f --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeOptions.rst @@ -0,0 +1,28 @@ +.. _PanelizeOptions: + + +PanelizeOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **configs** :index:`: ` [:ref:`PanelizeConfig parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``[]``) One or more configurations used to create the panel. + Use a string to include an external configuration, i.e. `myDefault.json`. + You can also include a preset using `:name`, i.e. `:vcuts`. + Use a dict to specify the options using the KiBot YAML file. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=panel, %x=kicad_pcb). Affected by global options. +- ``create_preview`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use PcbDraw to create a preview of the panel. +- ``default_angles`` :index:`: ` [:ref:`string `] (default: ``'deg'``) (choices: "deg", "Ā°", "rad") Angles used when omitted. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``units`` :index:`: ` [:ref:`string `] (default: ``'mm'``) (choices: "millimeters", "inches", "mils", "mm", "cm", "dm", "m", "mil", "inch", "in") Units used when omitted. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + +.. toctree:: + :caption: Used dicts + + PanelizeConfig diff --git a/docs/source/configuration/outputs/PanelizePage.rst b/docs/source/configuration/outputs/PanelizePage.rst new file mode 100644 index 000000000..46d44921d --- /dev/null +++ b/docs/source/configuration/outputs/PanelizePage.rst @@ -0,0 +1,18 @@ +.. _PanelizePage: + + +PanelizePage parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- *page_size* :index:`: ` Alias for type. +- *size* :index:`: ` Alias for type. +- **type** :index:`: ` '' +- ``anchor`` :index:`: ` [:ref:`string `] (default: ``'mt'``) (choices: "tl", "tr", "bl", "br", "mt", "mb", "ml", "mr", "c") Point of the panel to be placed at given position. Can be one of tl, tr, bl, br + (corners), mt, mb, ml, mr (middle of sides), c (center). The anchors refer to the panel outline. +- ``height`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``210``) Height for the `custom` paper size. +- *pos_x* :index:`: ` Alias for posx. +- *pos_y* :index:`: ` Alias for posy. +- ``posx`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``'50%'``) The X position of the panel on the page. Can be expressed as a page size percentage. +- ``posy`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``20``) The Y position of the panel on the page. Can be expressed as a page size percentage. +- ``width`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``297``) Width for the `custom` paper size. + diff --git a/docs/source/configuration/outputs/PanelizePost.rst b/docs/source/configuration/outputs/PanelizePost.rst new file mode 100644 index 000000000..f686ec4f7 --- /dev/null +++ b/docs/source/configuration/outputs/PanelizePost.rst @@ -0,0 +1,35 @@ +.. _PanelizePost: + + +PanelizePost parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- ``copperfill`` :index:`: ` [:ref:`boolean `] (default: ``false``) Fill tabs and frame with copper (e.g., to save etchant or to increase rigidity of flex-PCB panels). +- ``dimensions`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw dimensions with the panel size.. +- *edge_width* :index:`: ` Alias for edgewidth. +- ``edgewidth`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0.1``) Specify line width for the Edge.Cuts of the panel. +- *mill_radius* :index:`: ` Alias for millradius. +- *mill_radius_outer* :index:`: ` Alias for millradiusouter. +- ``millradius`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Simulate the milling operation (add fillets to the internal corners). + Specify mill radius (usually 1 mm). 0 radius disables the functionality. +- ``millradiusouter`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Like `millradius`, but modifies only board outer counter. + No internal features of the board are affected. +- ``origin`` :index:`: ` [:ref:`string `] (default: ``'tl'``) (choices: "tl", "tr", "bl", "br", "mt", "mb", "ml", "mr", "c") Specify if the auxiliary origin an grid origin should be placed. + Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr (middle of sides), c (center). + Empty string does not changes the origin. +- *reconstruct_arcs* :index:`: ` Alias for reconstructarcs. +- ``reconstructarcs`` :index:`: ` [:ref:`boolean `] (default: ``false``) The panelization process works on top of a polygonal representation of the board. + This options allows to reconstruct the arcs in the design before saving the panel. +- *refill_zones* :index:`: ` Alias for refillzones. +- ``refillzones`` :index:`: ` [:ref:`boolean `] (default: ``false``) Refill the user zones after the panel is build. + This is only necessary when you want your zones to avoid cuts in panel. +- ``script`` :index:`: ` [:ref:`string `] (default: ``''``) A path to custom Python file. The file should contain a function kikitPostprocess(panel, args) that + receives the prepared panel as the kikit.panelize.Panel object and the user-supplied arguments as a + string - see `scriptarg`. The function can make arbitrary changes to the panel - you can append text, + footprints, alter labels, etc. The function is invoked after the whole panel is constructed + (including all other postprocessing). If you try to add a functionality for a common fabrication + houses via scripting, consider submitting PR for KiKit. +- *script_arg* :index:`: ` Alias for scriptarg. +- ``scriptarg`` :index:`: ` [:ref:`string `] (default: ``''``) An arbitrary string passed to the user post-processing script specified in script. +- **type** :index:`: ` '' + diff --git a/docs/source/configuration/outputs/PanelizeSource.rst b/docs/source/configuration/outputs/PanelizeSource.rst new file mode 100644 index 000000000..04c0bc678 --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeSource.rst @@ -0,0 +1,15 @@ +.. _PanelizeSource: + + +PanelizeSource parameters +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **type** :index:`: ` '' +- ``brx`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Bottom right X coordinate of the rectangle used. Used for *rectangle*. +- ``bry`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Bottom right Y coordinate of the rectangle used. Used for *rectangle*. +- ``ref`` :index:`: ` [:ref:`string `] (default: ``''``) Reference for the kikit:Board footprint used to select the contour. Used for *annotation*. +- ``stack`` :index:`: ` [:ref:`string `] (default: ``'inherit'``) (choices: "inherit", "2layer", "4layer", "6layer") Used to reduce the number of layers used for the panel. +- ``tlx`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Top left X coordinate of the rectangle used. Used for *rectangle*. +- ``tly`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Top left Y coordinate of the rectangle used. Used for *rectangle*. +- ``tolerance`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``1``) Extra space around the PCB reported size to be included. Used for *auto* and *annotation*. + diff --git a/docs/source/configuration/outputs/PanelizeTabs.rst b/docs/source/configuration/outputs/PanelizeTabs.rst new file mode 100644 index 000000000..8ae814a2f --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeTabs.rst @@ -0,0 +1,28 @@ +.. _PanelizeTabs: + + +PanelizeTabs parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- **type** :index:`: ` '' +- ``arg`` :index:`: ` [:ref:`string `] (default: ``''``) Argument to pass to the plugin. Used for *plugin*. +- ``code`` :index:`: ` [:ref:`string `] (default: ``''``) Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. +- ``cutout`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``1``) When your design features open pockets on the side, this parameter specifies extra cutout + depth in order to ensure that a sharp corner of the pocket can be milled. Used for *full*. +- ``hcount`` :index:`: ` [:ref:`number `] (default: ``1``) Number of tabs in the horizontal direction. Used for *fixed*. +- ``hwidth`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``3``) The width of tabs in the horizontal direction. Used for *fixed* and *spacing*. +- *min_distance* :index:`: ` Alias for mindistance. +- ``mindistance`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Minimal spacing between the tabs. If there are too many tabs, their count is reduced. + Used for *fixed*. +- *patch_corners* :index:`: ` Alias for patchcorners. +- ``patchcorners`` :index:`: ` [:ref:`boolean `] (default: ``true``) The full tabs are appended to the nearest flat face of the PCB. If the PCB has sharp corners, you want to + add patches of substrate to these corners. However, if the PCB has fillet or miter, you don't want to + apply the patches. +- ``spacing`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``10``) The maximum spacing of the tabs. Used for *spacing*. +- *tab_footprints* :index:`: ` Alias for tabfootprints. +- ``tabfootprints`` :index:`: ` [:ref:`string `] (default: ``'kikit:Tab'``) The footprint/s used for the *annotation* type. You can specify a list of footprints separated by comma. +- ``vcount`` :index:`: ` [:ref:`number `] (default: ``1``) Number of tabs in the vertical direction. Used for *fixed*. +- ``vwidth`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``3``) The width of tabs in the vertical direction. Used for *fixed* and *spacing*. +- ``width`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``3``) The width of tabs in both directions. Overrides both `vwidth` and `hwidth`. + Used for *fixed*, *spacing*, *corner* and *annotation*. + diff --git a/docs/source/configuration/outputs/PanelizeText.rst b/docs/source/configuration/outputs/PanelizeText.rst new file mode 100644 index 000000000..1feb684fe --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeText.rst @@ -0,0 +1,28 @@ +.. _PanelizeText: + + +PanelizeText parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- **text** :index:`: ` [:ref:`string `] (default: ``''``) The text to be displayed. Note that you can escape ; via \\. + Available variables in text: *date* formats current date as --, + *time24* formats current time in 24-hour format, + *boardTitle* the title from the source board, + *boardDate* the date from the source board, + *boardRevision* the revision from the source board, + *boardCompany* the company from the source board, + *boardComment1*-*boardComment9* comments from the source board. +- **type** :index:`: ` '' +- ``anchor`` :index:`: ` [:ref:`string `] (default: ``'mt'``) (choices: "tl", "tr", "bl", "br", "mt", "mb", "ml", "mr", "c") Origin of the text. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr + (middle of sides), c (center). The anchors refer to the panel outline. +- ``height`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``1.5``) Height of the characters (the same parameters as KiCAD uses). +- ``hjustify`` :index:`: ` [:ref:`string `] (default: ``'center'``) (choices: "left", "right", "center") Horizontal justification of the text. +- ``hoffset`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Specify the horizontal offset from anchor. Respects KiCAD coordinate system. +- ``layer`` :index:`: ` [:ref:`string `] (default: ``'F.SilkS'``) Specify text layer. +- ``orientation`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Specify the orientation (angle). +- ``plugin`` :index:`: ` [:ref:`string `] (default: ``''``) Specify the plugin that provides extra variables for the text. +- ``thickness`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0.3``) Stroke thickness. +- ``vjustify`` :index:`: ` [:ref:`string `] (default: ``'center'``) (choices: "left", "right", "center") Vertical justification of the text. +- ``voffset`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Specify the vertical offset from anchor. Respects KiCAD coordinate system. +- ``width`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``1.5``) Width of the characters (the same parameters as KiCAD uses). + diff --git a/docs/source/configuration/outputs/PanelizeTooling.rst b/docs/source/configuration/outputs/PanelizeTooling.rst new file mode 100644 index 000000000..dbe87787f --- /dev/null +++ b/docs/source/configuration/outputs/PanelizeTooling.rst @@ -0,0 +1,16 @@ +.. _PanelizeTooling: + + +PanelizeTooling parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **type** :index:`: ` '' +- ``arg`` :index:`: ` [:ref:`string `] (default: ``''``) Argument to pass to the plugin. Used for *plugin*. +- ``code`` :index:`: ` [:ref:`string `] (default: ``''``) Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. +- ``hoffset`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Horizontal offset from panel edges. +- ``paste`` :index:`: ` [:ref:`boolean `] (default: ``false``) If True, the holes are included in the paste layer (therefore they appear on the stencil). +- ``size`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``1.152``) Diameter of the holes. +- *solder_mask_margin* :index:`: ` Alias for soldermaskmargin. +- ``soldermaskmargin`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Solder mask expansion/margin. Use 1.3mm for JLCPCB. +- ``voffset`` :index:`: ` [:ref:`number ` | :ref:`string `] (default: ``0``) Vertical offset from panel edges. + diff --git a/docs/source/configuration/outputs/PcbDrawOptions.rst b/docs/source/configuration/outputs/PcbDrawOptions.rst new file mode 100644 index 000000000..a8ebc18d0 --- /dev/null +++ b/docs/source/configuration/outputs/PcbDrawOptions.rst @@ -0,0 +1,73 @@ +.. _PcbDrawOptions: + + +PcbDrawOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **bottom** :index:`: ` [:ref:`boolean `] (default: ``false``) Render the bottom side of the board (default is top side). +- **format** :index:`: ` [:ref:`string `] (default: ``'svg'``) (choices: "svg", "png", "jpg", "bmp") Output format. Only used if no `output` is specified. +- **mirror** :index:`: ` [:ref:`boolean `] (default: ``false``) Mirror the board. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the generated file. Affected by global options. +- **show_components** :index:`: ` [:ref:`list(string) ` | :ref:`string `] (default: ``'none'``) (choices: "none", "all") (also accepts any string) List of components to draw, can be also a string for none or all. + The default is none. + There two ways of using this option, please consult the `add_to_variant` option. + You can use `_kf(FILTER)` as an element in the list to get all the components that pass the filter. + You can even use `_kf(FILTER1;FILTER2)` to concatenate filters. + +- **style** :index:`: ` [:ref:`PcbDrawStyle parameters `] [:ref:`string ` | :ref:`dict `] (default: empty dict, default values used) PCB style (colors). An internal name, the name of a JSON file or the style options. +- ``add_to_variant`` :index:`: ` [:ref:`boolean `] (default: ``true``) The `show_components` list is added to the list of components indicated by the variant (fitted and not + excluded). + This is the old behavior, but isn't intuitive because the `show_components` meaning changes when a variant + is used. In this mode you should avoid using `show_components` and variants. + To get a more coherent behavior disable this option, and `none` will always be `none`. + Also `all` will be what the variant says. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``dpi`` :index:`: ` [:ref:`number `] (default: ``300``) (range: 10 to 1200) Dots per inch (resolution) of the generated image. +- ``highlight`` :index:`: ` [:ref:`list(string) `] (default: ``[]``) List of components to highlight. Filter expansion is also allowed here, + see `show_components`. + +- ``libs`` :index:`: ` [:ref:`list(string) `] (default: ``['KiCAD-base']``) List of libraries. + +- ``margin`` :index:`: ` [:ref:`PcbMargin parameters `] [:ref:`number ` | :ref:`dict `] (default: ``0``) Margin around the generated image [mm]. + Using a number the margin is the same in the four directions. +- ``no_drillholes`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not make holes transparent. +- ``outline_width`` :index:`: ` [:ref:`number `] (default: ``0.15``) (range: 0 to 10) Width of the trace to draw the PCB border [mm]. + Note this also affects the drill holes. +- ``placeholder`` :index:`: ` [:ref:`boolean `] (default: ``false``) Show placeholder for missing components. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``remap`` :index:`: ` [:ref:`PcbDrawRemap parameters `] [:ref:`dict ` | :ref:`string `] (default: ``'None'``) (DEPRECATED) Replacements for PCB references using specified components (lib:component). + Use `remap_components` instead. +- ``remap_components`` :index:`: ` [:ref:`PcbDrawRemapComponents parameters `] [:ref:`list(dict) `] (default: ``[]``) Replacements for PCB references using specified components. + Replaces `remap` with type check. +- ``resistor_flip`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] List of resistors to flip its bands. + +- ``resistor_remap`` :index:`: ` [:ref:`PcbDrawResistorRemap parameters `] [:ref:`list(dict) `] (default: ``[]``) List of resistors to be remapped. You can change the value of the resistors here. +- ``show_solderpaste`` :index:`: ` [:ref:`boolean `] (default: ``true``) Show the solder paste layers. +- ``size_detection`` :index:`: ` [:ref:`string `] (default: ``'kicad_edge'``) (choices: "kicad_edge", "kicad_all", "svg_paths") Method used to detect the size of the resulting image. + The `kicad_edge` method uses the size of the board as reported by KiCad, + components that extend beyond the PCB limit will be cropped. You can manually + adjust the margins to make them visible. + The `kicad_all` method uses the whole size reported by KiCad. Usually includes extra space. + The `svg_paths` uses all visible drawings in the image. To use this method you + must install the `numpy` Python module (may not be available in docker images). +- ``svg_precision`` :index:`: ` [:ref:`number `] (default: ``4``) (range: 3 to 6) Scale factor used to represent 1 mm in the SVG (KiCad 6). + The value is how much zeros has the multiplier (1 mm = 10 power `svg_precision` units). + Note that for an A4 paper Firefox 91 and Chrome 105 can't handle more than 5. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. +- ``vcuts`` :index:`: ` [:ref:`boolean `] (default: ``false``) Render V-CUTS on the `vcuts_layer` layer. +- ``vcuts_layer`` :index:`: ` [:ref:`string `] (default: ``'Cmts.User'``) Layer to render the V-CUTS, only used when `vcuts` is enabled. + Note that any other content from this layer will be included. +- ``warnings`` :index:`: ` [:ref:`string `] (default: ``'visible'``) (choices: "visible", "all", "none") Using visible only the warnings about components in the visible side are generated. + +.. toctree:: + :caption: Used dicts + + PcbDrawRemap + PcbDrawRemapComponents + PcbDrawResistorRemap + PcbDrawStyle + PcbMargin diff --git a/docs/source/configuration/outputs/PcbDrawRemap.rst b/docs/source/configuration/outputs/PcbDrawRemap.rst new file mode 100644 index 000000000..83f39fe0a --- /dev/null +++ b/docs/source/configuration/outputs/PcbDrawRemap.rst @@ -0,0 +1,7 @@ +.. _PcbDrawRemap: + + +PcbDrawRemap parameters +~~~~~~~~~~~~~~~~~~~~~~~ + + diff --git a/docs/source/configuration/outputs/PcbDrawRemapComponents.rst b/docs/source/configuration/outputs/PcbDrawRemapComponents.rst new file mode 100644 index 000000000..33f5f5016 --- /dev/null +++ b/docs/source/configuration/outputs/PcbDrawRemapComponents.rst @@ -0,0 +1,13 @@ +.. _PcbDrawRemapComponents: + + +PcbDrawRemapComponents parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **comp** :index:`: ` [:ref:`string `] (default: ``''``) Component to use (from `lib`). +- *component* :index:`: ` Alias for comp. +- **lib** :index:`: ` [:ref:`string `] (default: ``''``) Library to use. +- *library* :index:`: ` Alias for lib. +- **ref** :index:`: ` [:ref:`string `] (default: ``''``) Reference for the component to change. +- *reference* :index:`: ` Alias for ref. + diff --git a/docs/source/configuration/outputs/PcbDrawResistorRemap.rst b/docs/source/configuration/outputs/PcbDrawResistorRemap.rst new file mode 100644 index 000000000..586e4d6d3 --- /dev/null +++ b/docs/source/configuration/outputs/PcbDrawResistorRemap.rst @@ -0,0 +1,11 @@ +.. _PcbDrawResistorRemap: + + +PcbDrawResistorRemap parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **ref** :index:`: ` [:ref:`string `] (default: ``''``) Reference for the resistor to change. +- *reference* :index:`: ` Alias for ref. +- **val** :index:`: ` [:ref:`string `] (default: ``''``) Value to use for `ref`. +- *value* :index:`: ` Alias for val. + diff --git a/docs/source/configuration/outputs/PcbDrawStyle.rst b/docs/source/configuration/outputs/PcbDrawStyle.rst new file mode 100644 index 000000000..f4d9f9683 --- /dev/null +++ b/docs/source/configuration/outputs/PcbDrawStyle.rst @@ -0,0 +1,17 @@ +.. _PcbDrawStyle: + + +PcbDrawStyle parameters +~~~~~~~~~~~~~~~~~~~~~~~ + +- **board** :index:`: ` [:ref:`string `] (default: ``'#208b47'``) Color for the board without copper (covered by solder mask). +- **clad** :index:`: ` [:ref:`string `] (default: ``'#cabb3e'``) Color for the PCB core (not covered by solder mask). +- **copper** :index:`: ` [:ref:`string `] (default: ``'#285e3a'``) Color for the copper zones (covered by solder mask). +- **outline** :index:`: ` [:ref:`string `] (default: ``'#000000'``) Color for the outline. +- **pads** :index:`: ` [:ref:`string `] (default: ``'#8b898c'``) Color for the exposed pads (metal finish). +- **silk** :index:`: ` [:ref:`string `] (default: ``'#d5dce4'``) Color for the silk screen. +- ``highlight_on_top`` :index:`: ` [:ref:`boolean `] (default: ``false``) Highlight over the component (not under). +- ``highlight_padding`` :index:`: ` [:ref:`number `] (default: ``1.5``) (range: 0 to 1000) How much the highlight extends around the component [mm]. +- ``highlight_style`` :index:`: ` [:ref:`string `] (default: ``'stroke:none;fill:#ff0000;opacity:0.5;'``) SVG code for the highlight style. +- ``vcut`` :index:`: ` [:ref:`string `] (default: ``'#bf2600'``) Color for the V-CUTS. + diff --git a/docs/source/configuration/outputs/PcbMargin.rst b/docs/source/configuration/outputs/PcbMargin.rst new file mode 100644 index 000000000..6244ee737 --- /dev/null +++ b/docs/source/configuration/outputs/PcbMargin.rst @@ -0,0 +1,11 @@ +.. _PcbMargin: + + +PcbMargin parameters +~~~~~~~~~~~~~~~~~~~~ + +- ``bottom`` :index:`: ` [:ref:`number `] (default: ``0``) Bottom margin [mm]. +- ``left`` :index:`: ` [:ref:`number `] (default: ``0``) Left margin [mm]. +- ``right`` :index:`: ` [:ref:`number `] (default: ``0``) Right margin [mm]. +- ``top`` :index:`: ` [:ref:`number `] (default: ``0``) Top margin [mm]. + diff --git a/docs/source/configuration/outputs/PopulateOptions.rst b/docs/source/configuration/outputs/PopulateOptions.rst new file mode 100644 index 000000000..8287aac81 --- /dev/null +++ b/docs/source/configuration/outputs/PopulateOptions.rst @@ -0,0 +1,29 @@ +.. _PopulateOptions: + + +PopulateOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **format** :index:`: ` [:ref:`string `] (default: ``'html'``) (choices: "html", "md") Format for the generated output. +- **input** :index:`: ` [:ref:`string `] (default: ``''``) Name of the input file describing the assembly. Must be a markdown file. + Note that the YAML section of the file will be skipped, all the needed information + comes from this output and the `renderer` output, not from the YAML section. + When empty we use a dummy template, you should provide something better. +- **renderer** :index:`: ` [:ref:`string `] (default: ``''``) Name of the output used to render the PCB steps. + Currently this must be a `pcbdraw` or `render_3d` output. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``imgname`` :index:`: ` [:ref:`string `] (default: ``'img/populating_%d.%x'``) Pattern used for the image names. The `%d` is replaced by the image number. + The `%x` is replaced by the extension. Note that the format is selected by the + `renderer`. +- ``initial_components`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] List of components soldered before the first step. + +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``template`` :index:`: ` [:ref:`string `] The name of the handlebars template used for the HTML output. + The extension must be `.handlebars`, it will be added when missing. + The `simple.handlebars` template is a built-in template. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/PosColumns.rst b/docs/source/configuration/outputs/PosColumns.rst new file mode 100644 index 000000000..eb0068612 --- /dev/null +++ b/docs/source/configuration/outputs/PosColumns.rst @@ -0,0 +1,9 @@ +.. _PosColumns: + + +PosColumns parameters +~~~~~~~~~~~~~~~~~~~~~ + +- **id** :index:`: ` [:ref:`string `] (default: ``''``) (choices: "Ref", "Val", "Package", "PosX", "PosY", "Rot", "Side") Internal name. +- ``name`` :index:`: ` [:ref:`string `] (default: ``''``) Name to use in the output file. The id is used when empty. + diff --git a/docs/source/configuration/outputs/PositionOptions.rst b/docs/source/configuration/outputs/PositionOptions.rst new file mode 100644 index 000000000..6f7b0fb67 --- /dev/null +++ b/docs/source/configuration/outputs/PositionOptions.rst @@ -0,0 +1,36 @@ +.. _PositionOptions: + + +PositionOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **format** :index:`: ` [:ref:`string `] (default: ``'ASCII'``) (choices: "ASCII", "CSV", "GBR") Format for the position file. + Note that the gerber format (GBR) needs KiCad 7+ and doesn't support most of the options. + Only the options that explicitly say the format is supported. +- **only_smd** :index:`: ` [:ref:`boolean `] (default: ``true``) Only include the surface mount components. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Output file name (%i='top_pos'|'bottom_pos'|'both_pos', %x='pos'|'csv'|'gbr'). + Important: when using separate files you must use `%i` to differentiate them. Affected by global options. +- **separate_files_for_front_and_back** :index:`: ` [:ref:`boolean `] (default: ``true``) Generate two separated files, one for the top and another for the bottom. +- **units** :index:`: ` [:ref:`string `] (default: ``'millimeters'``) (choices: "millimeters", "inches", "mils") Units used for the positions. Affected by global options. +- ``bottom_negative_x`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use negative X coordinates for footprints on bottom layer. +- ``columns`` :index:`: ` [:ref:`PosColumns parameters `] [:ref:`list(dict) ` | :ref:`list(string) `] (default: ``['Ref', 'Val', 'Package', 'PosX', 'PosY', 'Rot', 'Side']``) Which columns are included in the output. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``gerber_board_edge`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include the board edge in the gerber output. +- ``include_virtual`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include virtual components. For special purposes, not pick & place. + Note that virtual components is a KiCad 5 concept. + For KiCad 6+ we replace this concept by the option to exclude from position file. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``quote_all`` :index:`: ` [:ref:`boolean `] (default: ``false``) When generating the CSV quote all values, even numbers. +- ``right_digits`` :index:`: ` [:ref:`number `] (default: ``4``) number of digits for mantissa part of coordinates (0 is auto). +- ``use_aux_axis_as_origin`` :index:`: ` [:ref:`boolean `] (default: ``true``) Use the auxiliary axis as origin for coordinates (KiCad default). + Supported by the gerber format. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + +.. toctree:: + :caption: Used dicts + + PosColumns diff --git a/docs/source/configuration/outputs/PresentBoards.rst b/docs/source/configuration/outputs/PresentBoards.rst new file mode 100644 index 000000000..ba5cbcc0d --- /dev/null +++ b/docs/source/configuration/outputs/PresentBoards.rst @@ -0,0 +1,47 @@ +.. _PresentBoards: + + +PresentBoards parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Name for this board. If empty we use the name of the PCB. + Applies to all modes. +- ``back_image`` :index:`: ` [:ref:`string `] (default: ``''``) How to obtain the back view of the PCB. + *local*: the name of an output to render it. + If empty we use the first renderer. + *file*: the name of the rendered image. + *external*: ignored, we use `extrenal_config`. +- ``comment`` :index:`: ` [:ref:`string `] (default: ``''``) A comment or description for this board. + Applies to all modes. +- ``external_config`` :index:`: ` [:ref:`string `] (default: ``''``) Name of an external KiBot configuration. + Only used in the *external* mode. +- ``front_image`` :index:`: ` [:ref:`string `] (default: ``''``) How to obtain the front view of the PCB. + *local*: the name of an output to render it. + If empty we use the first renderer. + *file*: the name of the rendered image. + *external*: ignored, we use `extrenal_config`. +- ``gerbers`` :index:`: ` [:ref:`string `] (default: ``''``) How to obtain an archive with the gerbers. + *local*: the name of a `gerber` output. + If empty we use the first `gerber` output. + *file*: the name of a compressed archive. + *external*: ignored, we use `extrenal_config`. +- ``mode`` :index:`: ` [:ref:`string `] (default: ``'local'``) (choices: "local", "file", "external") How images and gerbers are obtained. + *local*: Only applies to the currently selected PCB. + You must provide the names of the outputs used to render + the images and compress the gerbers. + When empty KiBot will use the first render/gerber output + it finds. + To apply variants use `pcb_from_output` and a `pcb_variant` + output. + *file*: You must specify the file names used for the images and + the gerbers. + *external*: You must specify an external KiBot configuration. + It will be applied to the selected PCB to create the images and + the gerbers. The front image must be generated in a dir called + *front*, the back image in a dir called *back* and the gerbers + in a dir called *gerbers*. +- ``pcb_file`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the KiCad PCB file. When empty we use the current PCB. + Is ignored for the *local* mode. +- ``pcb_from_output`` :index:`: ` [:ref:`string `] (default: ``''``) Use the PCB generated by another output. + Is ignored for the *file* mode. + diff --git a/docs/source/configuration/outputs/QRCodeOptions.rst b/docs/source/configuration/outputs/QRCodeOptions.rst new file mode 100644 index 000000000..4f651e91d --- /dev/null +++ b/docs/source/configuration/outputs/QRCodeOptions.rst @@ -0,0 +1,15 @@ +.. _QRCodeOptions: + + +QRCodeOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- **layer** :index:`: ` [:ref:`string `] (default: ``'silk'``) (choices: "silk", "copper") Layer for the footprint. +- **name** :index:`: ` [:ref:`string `] (default: ``'QR'``) Name for the symbol/footprint. +- **size_pcb** :index:`: ` [:ref:`number `] (default: ``15``) Size of the QR footprint. +- **size_sch** :index:`: ` [:ref:`number `] (default: ``15``) Size of the QR symbol. +- **text** :index:`: ` [:ref:`string `] (default: ``'%p %r'``) Text to encode as QR. +- ``correction_level`` :index:`: ` [:ref:`string `] (default: ``'low'``) (choices: "low", "medium", "quartile", "high") Error correction level. +- ``pcb_negative`` :index:`: ` [:ref:`boolean `] (default: ``false``) Generate a negative image for the PCB. +- ``size_units`` :index:`: ` [:ref:`string `] (default: ``'millimeters'``) (choices: "millimeters", "inches") Units used for the size. + diff --git a/docs/source/configuration/outputs/QR_LibOptions.rst b/docs/source/configuration/outputs/QR_LibOptions.rst new file mode 100644 index 000000000..2a37bf6d5 --- /dev/null +++ b/docs/source/configuration/outputs/QR_LibOptions.rst @@ -0,0 +1,17 @@ +.. _QR_LibOptions: + + +QR_LibOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- **lib** :index:`: ` [:ref:`string `] (default: ``'QR'``) Short name for the library. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename/dirname for the output library (%i=qr, %x=lib/kicad_sym/pretty). + You must use %x in the name to get a symbols lib and a footprints lib. Affected by global options. +- **qrs** :index:`: ` [:ref:`QRCodeOptions parameters `] [:ref:`dict ` | :ref:`list(dict) `] (default: list with one empty dict, default values used) QR codes to include in the library. +- ``reference`` :index:`: ` [:ref:`string `] (default: ``'QR'``) The reference prefix. +- ``use_sch_dir`` :index:`: ` [:ref:`boolean `] (default: ``true``) Generate the libs relative to the schematic/PCB dir. + +.. toctree:: + :caption: Used dicts + + QRCodeOptions diff --git a/docs/source/configuration/outputs/Render3DOptions.rst b/docs/source/configuration/outputs/Render3DOptions.rst new file mode 100644 index 000000000..db7fcaed1 --- /dev/null +++ b/docs/source/configuration/outputs/Render3DOptions.rst @@ -0,0 +1,105 @@ +.. _Render3DOptions: + + +Render3DOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **download** :index:`: ` [:ref:`boolean `] (default: ``true``) Downloads missing 3D models from KiCad git. + Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. + They are downloaded to a temporal directory and discarded. + If you want to cache the downloaded files specify a directory using the + KIBOT_3D_MODELS environment variable. +- **move_x** :index:`: ` [:ref:`number `] (default: ``0``) Steps to move in the X axis, positive is to the right. + Just like pressing the right arrow in the 3D viewer. +- **move_y** :index:`: ` [:ref:`number `] (default: ``0``) Steps to move in the Y axis, positive is up. + Just like pressing the up arrow in the 3D viewer. +- **no_virtual** :index:`: ` [:ref:`boolean `] (default: ``false``) Used to exclude 3D models for components with 'virtual' attribute. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the generated image file (%i='3D_$VIEW' %x='png'). Affected by global options. +- **ray_tracing** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable the ray tracing. Much better result, but slow, and you'll need to adjust `wait_rt`. +- **rotate_x** :index:`: ` [:ref:`number `] (default: ``0``) Steps to rotate around the X axis, positive is clockwise. + Each step is currently 10 degrees. Only for KiCad 6 or newer. +- **rotate_y** :index:`: ` [:ref:`number `] (default: ``0``) Steps to rotate around the Y axis, positive is clockwise. + Each step is currently 10 degrees. Only for KiCad 6 or newer. +- **rotate_z** :index:`: ` [:ref:`number `] (default: ``0``) Steps to rotate around the Z axis, positive is clockwise. + Each step is currently 10 degrees. Only for KiCad 6 or newer. +- **show_components** :index:`: ` [:ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "none", "all") (also accepts any string) List of components to draw, can be also a string for `none` or `all`. + Ranges like *R5-R10* are supported. + Unlike the `pcbdraw` output, the default is `all`. + +- **view** :index:`: ` [:ref:`string `] (default: ``'top'``) (choices: "top", "bottom", "front", "rear", "right", "left", "z", "Z", "y", "Y", "x", "X") Point of view. +- **zoom** :index:`: ` [:ref:`number `] (default: ``0``) Zoom steps. Use positive to enlarge, get closer, and negative to reduce. + Same result as using the mouse wheel in the 3D viewer. + Note that KiCad 8 starts with a zoom to fit, so you might not even need it. +- ``auto_crop`` :index:`: ` [:ref:`boolean `] (default: ``false``) When enabled the image will be post-processed to remove the empty space around the image. + In this mode the `background2` is changed to be the same as `background1`. +- ``background1`` :index:`: ` [:ref:`string `] (default: ``'#66667F'``) First color for the background gradient. +- ``background2`` :index:`: ` [:ref:`string `] (default: ``'#CCCCE5'``) Second color for the background gradient. +- ``board`` :index:`: ` [:ref:`string `] (default: ``'#332B16'``) Color for the board without copper or solder mask. +- ``clip_silk_on_via_annulus`` :index:`: ` [:ref:`boolean `] (default: ``true``) Clip silkscreen at via annuli (KiCad 6+). +- ``copper`` :index:`: ` [:ref:`string `] (default: ``'#8b898c'``) Color for the copper. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``download_lcsc`` :index:`: ` [:ref:`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. +- ``enable_crop_workaround`` :index:`: ` [:ref:`boolean `] (default: ``false``) Some versions of Image Magick (i.e. the one in Debian 11) needs two passes to crop. + Enable it to force a double pass. It was the default in KiBot 1.7.0 and older. +- ``force_stackup_colors`` :index:`: ` [:ref:`boolean `] (default: ``false``) Tell KiCad to use the colors from the stackup. They are better than the unified KiBot colors. + Needs KiCad 6 or newer. +- ``height`` :index:`: ` [:ref:`number `] (default: ``720``) Image height (aprox.). +- ``highlight`` :index:`: ` [:ref:`list(string) `] (default: ``[]``) List of components to highlight. Ranges like *R5-R10* are supported. + +- ``highlight_on_top`` :index:`: ` [:ref:`boolean `] (default: ``false``) Highlight over the component (not under). +- ``highlight_padding`` :index:`: ` [:ref:`number `] (default: ``1.5``) (range: 0 to 1000) How much the highlight extends around the component [mm]. +- ``kicad_3d_url`` :index:`: ` [:ref:`string `] (default: ``'https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'``) Base URL for the KiCad 3D models. +- ``kicad_3d_url_suffix`` :index:`: ` [:ref:`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. +- ``no_smd`` :index:`: ` [:ref:`boolean `] (default: ``false``) Used to exclude 3D models for surface mount components. +- ``no_tht`` :index:`: ` [:ref:`boolean `] (default: ``false``) Used to exclude 3D models for through hole components. +- ``orthographic`` :index:`: ` [:ref:`boolean `] (default: ``false``) Enable the orthographic projection mode (top view looks flat). +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``realistic`` :index:`: ` [:ref:`boolean `] (default: ``true``) When disabled we use the colors of the layers used by the GUI. Needs KiCad 6 or 7. + Is emulated on KiCad 8. +- ``show_adhesive`` :index:`: ` [:ref:`boolean `] (default: ``false``) Show the content of F.Adhesive/B.Adhesive layers. KiCad 6 or newer. +- ``show_board_body`` :index:`: ` [:ref:`boolean `] (default: ``true``) Show the PCB core material. KiCad 6 or newer. +- ``show_comments`` :index:`: ` [:ref:`boolean `] (default: ``false``) Show the content of the User.Comments and User.Drawings layer for KiCad 5, 6 and 7. + On KiCad 8 this option controls only the User.Comments and you have a separated option for the + User.Drawings called `show_drawings` + Note that KiCad 5/6/7 doesn't show it when `realistic` is enabled, but KiCad 8 does it. + Also note that KiCad 5 ray tracer shows comments outside the PCB, but newer KiCad versions + doesn't. +- ``show_drawings`` :index:`: ` [:ref:`boolean `] (default: ``false``) Show the content of the User.Drawings layer. Only available for KiCad 8 and newer. + Consult `show_comments` to learn when drawings are visible. +- ``show_eco`` :index:`: ` [:ref:`boolean `] (default: ``false``) Show the content of the Eco1.User/Eco2.User layers. + For KiCad 8 `show_eco1` and `show_eco2` are available. + Consult `show_comments` to learn when drawings are visible. +- ``show_eco1`` :index:`: ` [:ref:`boolean `] (default: ``false``) Show the content of the Eco1.User layer. KiCad 8 supports individual Eco layer options, for 6 and 7 + use the `show_eco` option. + Consult `show_comments` to learn when drawings are visible. +- ``show_eco2`` :index:`: ` [:ref:`boolean `] (default: ``false``) Show the content of the Eco1.User layer. KiCad 8 supports individual Eco layer options, for 6 and 7 + use the `show_eco` option. + Consult `show_comments` to learn when drawings are visible. +- ``show_silkscreen`` :index:`: ` [:ref:`boolean `] (default: ``true``) Show the silkscreen layers (KiCad 6+). +- ``show_soldermask`` :index:`: ` [:ref:`boolean `] (default: ``true``) Show the solder mask layers (KiCad 6+). +- ``show_solderpaste`` :index:`: ` [:ref:`boolean `] (default: ``true``) Show the solder paste layers (KiCad 6+). +- ``show_zones`` :index:`: ` [:ref:`boolean `] (default: ``true``) Show filled areas in zones (KiCad 6+). +- ``silk`` :index:`: ` [:ref:`string `] (default: ``'#d5dce4'``) Color for the silk screen. +- ``solder_mask`` :index:`: ` [:ref:`string `] (default: ``'#208b47'``) Color for the solder mask. +- ``solder_paste`` :index:`: ` [:ref:`string `] (default: ``'#808080'``) Color for the solder paste. +- ``subtract_mask_from_silk`` :index:`: ` [:ref:`boolean `] (default: ``true``) Clip silkscreen at solder mask edges (KiCad 6+). +- ``transparent_background`` :index:`: ` [:ref:`boolean `] (default: ``false``) When enabled the image will be post-processed to make the background transparent. + In this mode the `background1` and `background2` colors are ignored. +- ``transparent_background_color`` :index:`: ` [:ref:`string `] (default: ``'#00ff00'``) Color used for the chroma key. Adjust it if some regions of the board becomes transparent. +- ``transparent_background_fuzz`` :index:`: ` [:ref:`number `] (default: ``15``) (range: 0 to 100) Chroma key tolerance (percent). Bigger values will remove more pixels. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. +- *wait_ray_tracing* :index:`: ` Alias for wait_render. +- ``wait_render`` :index:`: ` [:ref:`number `] (default: ``-600``) How many seconds we must wait before capturing the render (ray tracing or normal). + Lamentably KiCad can save an unfinished image. Enlarge it if your image looks partially rendered. + Use negative values to enable the auto-detect using CPU load. + In this case the value is interpreted as a time-out.. +- ``width`` :index:`: ` [:ref:`number `] (default: ``1280``) Image width (aprox.). + diff --git a/docs/source/configuration/outputs/ReportOptions.rst b/docs/source/configuration/outputs/ReportOptions.rst new file mode 100644 index 000000000..15e06a671 --- /dev/null +++ b/docs/source/configuration/outputs/ReportOptions.rst @@ -0,0 +1,37 @@ +.. _ReportOptions: + + +ReportOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- **convert_to** :index:`: ` [:ref:`string `] (default: ``'pdf'``) Target format for the report conversion. See `do_convert`. +- **do_convert** :index:`: ` [:ref:`boolean `] (default: ``false``) Run `Pandoc` to convert the report. Note that Pandoc must be installed. + The conversion is done assuming the report is in `convert_from` format. + The output file will be in `convert_to` format. + The available formats depends on the `Pandoc` installation. + In CI/CD environments: the `kicad_auto_test` docker image contains it. + In Debian/Ubuntu environments: install `pandoc`, `texlive`, `texlive-latex-base` and `texlive-latex-recommended`. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Output file name (%i='report', %x='txt'). Affected by global options. +- **template** :index:`: ` [:ref:`string `] (default: ``'full'``) (choices: "full", "full_svg", "simple", "testpoints") (also accepts any string) Name for one of the internal templates or a custom template file. + Environment variables and ~ are allowed. + Note: when converting to PDF PanDoc can fail on some Unicode values (use `simple_ASCII`). + Note: the testpoint variables uses the `testpoint` fabrication attribute of pads. +- ``alloy_specific_gravity`` :index:`: ` [:ref:`number `] (default: ``7.4``) Specific gravity of the alloy used for the solder paste, in g/cm3. Used to compute solder paste usage. +- ``convert_from`` :index:`: ` [:ref:`string `] (default: ``'markdown'``) Original format for the report conversion. Current templates are `markdown`. See `do_convert`. +- ``converted_output`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Converted output file name (%i='report', %x=`convert_to`). + Note that the extension should match the `convert_to` value. Affected by global options. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``eurocircuits_class_target`` :index:`: ` [:ref:`string `] (default: ``'10F'``) Which Eurocircuits class are we aiming at. +- ``eurocircuits_reduce_holes`` :index:`: ` [:ref:`number `] (default: ``0.45``) When computing the Eurocircuits category: Final holes sizes smaller or equal to this given + diameter can be reduced to accommodate the correct annular ring values. + Use 0 to disable it. +- ``flux_specific_gravity`` :index:`: ` [:ref:`number `] (default: ``1.0``) Specific gravity of the flux used for the solder paste, in g/cm3. Used to compute solder paste usage. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``solder_paste_metal_amount`` :index:`: ` [:ref:`number `] (default: ``87.75``) (range: 0 to 100) Amount of metal in the solder paste (percentage). Used to compute solder paste usage. +- ``stencil_thickness`` :index:`: ` [:ref:`number `] (default: ``0.12``) Stencil thickness in mm. Used to compute solder paste usage. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/RowColors.rst b/docs/source/configuration/outputs/RowColors.rst new file mode 100644 index 000000000..02f3995f4 --- /dev/null +++ b/docs/source/configuration/outputs/RowColors.rst @@ -0,0 +1,14 @@ +.. _RowColors: + + +RowColors parameters +~~~~~~~~~~~~~~~~~~~~ + +- **color** :index:`: ` [:ref:`string `] (default: ``'#FF8080'``) Color used for this category. +- **description** :index:`: ` [:ref:`string `] (default: ``''``) A description for this color, must be filled. +- **filter** :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_none'``) Name of the filter to match. + Be careful because this filter should be coherent with the grouping fields. + KiBot will assume that all the components grouped in the same group will + return the same value when applying this filter. + + diff --git a/docs/source/configuration/outputs/STEPOptions.rst b/docs/source/configuration/outputs/STEPOptions.rst new file mode 100644 index 000000000..fe6b056cf --- /dev/null +++ b/docs/source/configuration/outputs/STEPOptions.rst @@ -0,0 +1,35 @@ +.. _STEPOptions: + + +STEPOptions parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- **download** :index:`: ` [:ref:`boolean `] (default: ``true``) Downloads missing 3D models from KiCad git. + Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. + They are downloaded to a temporal directory and discarded. + If you want to cache the downloaded files specify a directory using the + KIBOT_3D_MODELS environment variable. +- **no_virtual** :index:`: ` [:ref:`boolean `] (default: ``false``) Used to exclude 3D models for components with 'virtual' attribute. +- **origin** :index:`: ` [:ref:`string `] (default: ``'grid'``) (choices: "grid", "drill") (also accepts any string) Determines the coordinates origin. Using grid the coordinates are the same as you have in the + design sheet. + The drill option uses the auxiliary reference defined by the user. + You can define any other origin using the format 'X,Y', i.e. '3.2,-10'. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the generated STEP file (%i='3D' %x='step'). Affected by global options. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``download_lcsc`` :index:`: ` [:ref:`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. +- ``kicad_3d_url`` :index:`: ` [:ref:`string `] (default: ``'https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'``) Base URL for the KiCad 3D models. +- ``kicad_3d_url_suffix`` :index:`: ` [:ref:`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. +- ``metric_units`` :index:`: ` [:ref:`boolean `] (default: ``true``) Use metric units instead of inches. +- ``min_distance`` :index:`: ` [:ref:`number `] (default: ``-1``) The minimum distance between points to treat them as separate ones (-1 is KiCad default: 0.01 mm). +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``subst_models`` :index:`: ` [:ref:`boolean `] (default: ``true``) Substitute STEP or IGS models with the same name in place of VRML models. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/SVGOptions.rst b/docs/source/configuration/outputs/SVGOptions.rst new file mode 100644 index 000000000..07254fc2d --- /dev/null +++ b/docs/source/configuration/outputs/SVGOptions.rst @@ -0,0 +1,62 @@ +.. _SVGOptions: + + +SVGOptions parameters +~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Output file name, the default KiCad name if empty. + IMPORTANT! KiCad will always create the file using its own name and then we can rename it. + For this reason you must avoid generating two variants at the same directory when one of + them uses the default KiCad name. Affected by global options. +- **plot_sheet_reference** :index:`: ` [:ref:`boolean `] (default: ``false``) Include the frame and title block. Only available for KiCad 6+ and you get a poor result + (i.e. always the default worksheet style, also problems expanding text variables). + The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. +- **scaling** :index:`: ` [:ref:`number `] (default: ``1``) Scale factor (0 means autoscaling). +- ``custom_reports`` :index:`: ` [:ref:`CustomReport parameters `] [:ref:`list(dict) `] (default: ``[]``) A list of customized reports for the manufacturer. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``drill_marks`` :index:`: ` [:ref:`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:`: ` [:ref:`string `] (default: ``''``) Used to configure the edge cuts layer extension for Protel mode. Include the dot. +- ``exclude_edge_layer`` :index:`: ` [:ref:`boolean `] (default: ``true``) Do not include the PCB edge layer. +- ``exclude_pads_from_silkscreen`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not plot the component pads in the silk screen (KiCad 5.x only). +- ``force_plot_invisible_refs_vals`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include references and values even when they are marked as invisible. +- ``individual_page_scaling`` :index:`: ` [:ref:`boolean `] (default: ``true``) Tell KiCad to apply the scaling for each layer as a separated entity. + Disabling it the pages are coherent and can be superposed. +- ``inner_extension_pattern`` :index:`: ` [:ref:`string `] (default: ``''``) Used to change the Protel style extensions for inner layers. + The replacement pattern can contain %n for the inner layer number and %N for the layer number. + Example '.g%n'. +- ``limit_viewbox`` :index:`: ` [:ref:`boolean `] (default: ``false``) When enabled the view box is limited to a selected area. + This option can't be enabled when using a scale. +- ``line_width`` :index:`: ` [:ref:`number `] (default: ``0.25``) (range: 0.02 to 2) For objects without width [mm] (KiCad 5). +- ``margin`` :index:`: ` [:ref:`PcbMargin parameters `] [:ref:`number ` | :ref:`dict `] (default: ``0``) Margin around the view box [mm]. + Using a number the margin is the same in the four directions. + See `limit_viewbox` option. +- ``mirror_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Plot mirrored. +- ``negative_plot`` :index:`: ` [:ref:`boolean `] (default: ``false``) Invert black and white. +- ``plot_footprint_refs`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint references. +- ``plot_footprint_values`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint values. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``size_detection`` :index:`: ` [:ref:`string `] (default: ``'kicad_edge'``) (choices: "kicad_edge", "kicad_all") Method used to detect the size of the view box. + The `kicad_edge` method uses the size of the board as reported by KiCad, + components that extend beyond the PCB limit will be cropped. You can manually + adjust the margin to make them visible. + The `kicad_all` method uses the whole size reported by KiCad. Usually includes extra space. + See `limit_viewbox` option. +- ``sketch_pad_line_width`` :index:`: ` [:ref:`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). +- ``sketch_pads_on_fab_layers`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). +- ``svg_precision`` :index:`: ` [:ref:`number `] (default: ``4``) (range: 0 to 6) Scale factor used to represent 1 mm in the SVG (KiCad 6). + The value is how much zeros has the multiplier (1 mm = 10 power `svg_precision` units). + Note that for an A4 paper Firefox 91 and Chrome 105 can't handle more than 5. +- ``tent_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Cover the vias. +- ``uppercase_extensions`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use uppercase names for the extensions. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + +.. toctree:: + :caption: Used dicts + + CustomReport + PcbMargin diff --git a/docs/source/configuration/outputs/SVG_PCB_PrintOptions.rst b/docs/source/configuration/outputs/SVG_PCB_PrintOptions.rst new file mode 100644 index 000000000..44503de01 --- /dev/null +++ b/docs/source/configuration/outputs/SVG_PCB_PrintOptions.rst @@ -0,0 +1,34 @@ +.. _SVG_PCB_PrintOptions: + + +SVG_PCB_PrintOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output SVG (%i=layers, %x=svg). Affected by global options. +- *output_name* :index:`: ` Alias for output. +- **plot_sheet_reference** :index:`: ` [:ref:`boolean `] (default: ``true``) Include the title-block. +- **scaling** :index:`: ` [:ref:`number `] (default: ``1.0``) Scale factor (0 means autoscaling). You should disable `plot_sheet_reference` when using it. +- **separated** :index:`: ` [:ref:`boolean `] (default: ``false``) Print layers in separated pages. +- ``color_theme`` :index:`: ` [:ref:`string `] (default: ``'_builtin_classic'``) Selects the color theme. Onlyu applies to KiCad 6. + To use the KiCad 6 default colors select `_builtin_default`. + Usually user colors are stored as `user`, but you can give it another name. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``drill_marks`` :index:`: ` [:ref:`string `] (default: ``'full'``) (choices: "none", "small", "full") What to use to indicate the drill places, can be none, small or full (for real scale). +- ``enable_ki5_page_fix`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable workaround for KiCad 5 bug. +- ``enable_ki6_page_fix`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable workaround for KiCad 6 bug #11033. +- ``force_edge_cuts`` :index:`: ` [:ref:`boolean `] (default: ``true``) Only useful for KiCad 6 when printing in one page, you can disable the edge here. + KiCad 5 forces it by default, and you can't control it from config files. + Same for KiCad 6 when printing to separated pages. +- ``hide_excluded`` :index:`: ` [:ref:`boolean `] (default: ``false``) Hide components in the Fab layer that are marked as excluded by a variant. + Affected by global options. +- ``mirror`` :index:`: ` [:ref:`boolean `] (default: ``false``) Print mirrored (X axis inverted). ONLY for KiCad 6. +- ``monochrome`` :index:`: ` [:ref:`boolean `] (default: ``false``) Print in black and white. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/SVG_SCH_PrintOptions.rst b/docs/source/configuration/outputs/SVG_SCH_PrintOptions.rst new file mode 100644 index 000000000..93a1286e1 --- /dev/null +++ b/docs/source/configuration/outputs/SVG_SCH_PrintOptions.rst @@ -0,0 +1,26 @@ +.. _SVG_SCH_PrintOptions: + + +SVG_SCH_PrintOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **frame** :index:`: ` [:ref:`boolean `] (default: ``true``) Include the frame and title block. +- ``all_pages`` :index:`: ` [:ref:`boolean `] (default: ``true``) Generate with all hierarchical sheets. +- ``background_color`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the background color from the `color_theme` (KiCad 6). +- ``color_theme`` :index:`: ` [:ref:`string `] (default: ``''``) Color theme used, this must exist in the KiCad config (KiCad 6). +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``monochrome`` :index:`: ` [:ref:`boolean `] (default: ``false``) Generate a monochromatic output. +- ``output`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output SVG (%i=schematic, %x=svg). Affected by global options. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``sheet_reference_layout`` :index:`: ` [:ref:`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 + file is available. +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + Not fitted components are crossed. + diff --git a/docs/source/configuration/outputs/Sch_Variant_Options.rst b/docs/source/configuration/outputs/Sch_Variant_Options.rst new file mode 100644 index 000000000..c481cc7bd --- /dev/null +++ b/docs/source/configuration/outputs/Sch_Variant_Options.rst @@ -0,0 +1,18 @@ +.. _Sch_Variant_Options: + + +Sch_Variant_Options parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``copy_project`` :index:`: ` [:ref:`boolean `] (default: ``false``) Copy the KiCad project to the destination directory. + Disabled by default for compatibility with older versions. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``title`` :index:`: ` [:ref:`string `] (default: ``''``) Text used to replace the sheet title. %VALUE expansions are allowed. + If it starts with `+` the text is concatenated. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/Stencil_3D_Options.rst b/docs/source/configuration/outputs/Stencil_3D_Options.rst new file mode 100644 index 000000000..ce1e57f50 --- /dev/null +++ b/docs/source/configuration/outputs/Stencil_3D_Options.rst @@ -0,0 +1,33 @@ +.. _Stencil_3D_Options: + + +Stencil_3D_Options parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i='stencil_3d_top'|'stencil_3d_bottom'|'stencil_3d_edge', + %x='stl'|'scad'|'dxf'|'png'). Affected by global options. +- **thickness** :index:`: ` [:ref:`number `] (default: ``0.15``) Stencil thickness [mm]. Defines amount of paste dispensed. +- ``create_preview`` :index:`: ` [:ref:`boolean `] (default: ``true``) Creates a PNG showing the generated 3D model. +- ``cutout`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] [:ref:`comma separated `] List of components to add a cutout based on the component courtyard. + This is useful when you have already pre-populated board and you want to populate more + components. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- *enlarge_holes* :index:`: ` Alias for enlarge_holes. +- ``enlargeholes`` :index:`: ` [:ref:`number `] (default: ``0``) Enlarge pad holes by x mm. +- *frame_clearance* :index:`: ` Alias for frameclearance. +- *frame_width* :index:`: ` Alias for framewidth. +- ``frameclearance`` :index:`: ` [:ref:`number `] (default: ``0``) Clearance for the stencil register [mm]. +- ``framewidth`` :index:`: ` [:ref:`number `] (default: ``1``) Register frame width. +- ``include_scad`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the generated OpenSCAD files. + Note that this also includes the DXF files. +- *pcb_thickness* :index:`: ` Alias for pcbthickness. +- ``pcbthickness`` :index:`: ` [:ref:`number `] (default: ``0``) PCB thickness [mm]. If 0 we will ask KiCad. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``side`` :index:`: ` [:ref:`string `] (default: ``'auto'``) (choices: "top", "bottom", "auto", "both") Which side of the PCB we want. Using `auto` will detect which + side contains solder paste. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/Stencil_For_Jig_Options.rst b/docs/source/configuration/outputs/Stencil_For_Jig_Options.rst new file mode 100644 index 000000000..85e79f412 --- /dev/null +++ b/docs/source/configuration/outputs/Stencil_For_Jig_Options.rst @@ -0,0 +1,36 @@ +.. _Stencil_For_Jig_Options: + + +Stencil_For_Jig_Options parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- *jig_height* :index:`: ` Alias for jigheight. +- *jig_thickness* :index:`: ` Alias for jigthickness. +- *jig_width* :index:`: ` Alias for jigwidth. +- **jigheight** :index:`: ` [:ref:`number `] (default: ``100``) Jig frame height [mm]. +- **jigthickness** :index:`: ` [:ref:`number `] (default: ``3``) Jig thickness [mm]. +- **jigwidth** :index:`: ` [:ref:`number `] (default: ``100``) Jig frame width [mm]. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i='stencil_for_jig_top'|'stencil_for_jig_bottom', + %x='stl'|'scad'|'gbp'|'gtp'|'gbrjob'|'png'). Affected by global options. +- ``create_preview`` :index:`: ` [:ref:`boolean `] (default: ``true``) Creates a PNG showing the generated 3D model. +- ``cutout`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] [:ref:`comma separated `] List of components to add a cutout based on the component courtyard. + This is useful when you have already pre-populated board and you want to populate more + components. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``include_scad`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the generated OpenSCAD files. +- *pcb_thickness* :index:`: ` Alias for pcbthickness. +- ``pcbthickness`` :index:`: ` [:ref:`number `] (default: ``0``) PCB thickness [mm]. If 0 we will ask KiCad. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- *register_border_inner* :index:`: ` Alias for registerborderinner. +- *register_border_outer* :index:`: ` Alias for registerborderouter. +- ``registerborderinner`` :index:`: ` [:ref:`number `] (default: ``1``) Inner register border [mm]. +- ``registerborderouter`` :index:`: ` [:ref:`number `] (default: ``3``) Outer register border [mm]. +- ``side`` :index:`: ` [:ref:`string `] (default: ``'auto'``) (choices: "top", "bottom", "auto", "both") Which side of the PCB we want. Using `auto` will detect which + side contains solder paste. +- ``tolerance`` :index:`: ` [:ref:`number `] (default: ``0.05``) Enlarges the register by the tolerance value [mm]. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/VRMLOptions.rst b/docs/source/configuration/outputs/VRMLOptions.rst new file mode 100644 index 000000000..a76b5ad75 --- /dev/null +++ b/docs/source/configuration/outputs/VRMLOptions.rst @@ -0,0 +1,47 @@ +.. _VRMLOptions: + + +VRMLOptions parameters +~~~~~~~~~~~~~~~~~~~~~~ + +- **download** :index:`: ` [:ref:`boolean `] (default: ``true``) Downloads missing 3D models from KiCad git. + Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. + They are downloaded to a temporal directory and discarded. + If you want to cache the downloaded files specify a directory using the + KIBOT_3D_MODELS environment variable. +- **no_virtual** :index:`: ` [:ref:`boolean `] (default: ``false``) Used to exclude 3D models for components with 'virtual' attribute. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=vrml, %x=wrl). Affected by global options. +- **show_components** :index:`: ` [:ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "none", "all") (also accepts any string) List of components to draw, can be also a string for `none` or `all`. + Ranges like *R5-R10* are supported. + Unlike the `pcbdraw` output, the default is `all`. + +- ``dir_models`` :index:`: ` [:ref:`string `] (default: ``'shapes3D'``) Subdirectory used to store the 3D models for the components. + If you want to create a monolithic file just use '' here. + Note that the WRL file will contain relative paths to the models. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``download_lcsc`` :index:`: ` [:ref:`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. +- ``highlight`` :index:`: ` [:ref:`list(string) `] (default: ``[]``) List of components to highlight. Ranges like *R5-R10* are supported. + +- ``highlight_on_top`` :index:`: ` [:ref:`boolean `] (default: ``false``) Highlight over the component (not under). +- ``highlight_padding`` :index:`: ` [:ref:`number `] (default: ``1.5``) (range: 0 to 1000) How much the highlight extends around the component [mm]. +- ``kicad_3d_url`` :index:`: ` [:ref:`string `] (default: ``'https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'``) Base URL for the KiCad 3D models. +- ``kicad_3d_url_suffix`` :index:`: ` [:ref:`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. +- ``model_units`` :index:`: ` [:ref:`string `] (default: ``'millimeters'``) (choices: "millimeters", "meters", "deciinches", "inches") Units used for the VRML (1 deciinch = 0.1 inches). +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. + +- ``ref_units`` :index:`: ` [:ref:`string `] (default: ``'millimeters'``) (choices: "millimeters", "inches'") Units for `ref_x` and `ref_y`. +- ``ref_x`` :index:`: ` [:ref:`number `] (default: ``0``) X coordinate to use as reference when `use_pcb_center_as_ref` and `use_pcb_center_as_ref` are disabled. +- ``ref_y`` :index:`: ` [:ref:`number `] (default: ``0``) Y coordinate to use as reference when `use_pcb_center_as_ref` and `use_pcb_center_as_ref` are disabled. +- ``use_aux_axis_as_origin`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use the auxiliary axis as origin for coordinates. + Has more precedence than `use_pcb_center_as_ref`. +- ``use_pcb_center_as_ref`` :index:`: ` [:ref:`boolean `] (default: ``true``) The center of the PCB will be used as reference point. + When disabled the `ref_x`, `ref_y` and `ref_units` will be used. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + diff --git a/docs/source/configuration/outputs/blender_export.rst b/docs/source/configuration/outputs/blender_export.rst index f0f6891ea..cfa471587 100644 --- a/docs/source/configuration/outputs/blender_export.rst +++ b/docs/source/configuration/outputs/blender_export.rst @@ -22,171 +22,33 @@ Category: **PCB/3D** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `blender_export` output. - - - Valid keys: - - - **pcb3d** :index:`: ` [string|dict] Options to export the PCB to Blender. - You can also specify the name of the output that generates the PCB3D file. - See the `PCB2Blender_2_1`, `PCB2Blender_2_7` and `PCB2Blender_2_1_haschtl` templates. - - - Valid keys: - - - **download** :index:`: ` [boolean=true] Downloads missing 3D models from KiCad git. - Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. - They are downloaded to a temporal directory and discarded. - If you want to cache the downloaded files specify a directory using the - KIBOT_3D_MODELS environment variable. - - **no_virtual** :index:`: ` [boolean=false] Used to exclude 3D models for components with 'virtual' attribute. - - **show_components** :index:`: ` [list(string)|string=all] [none,all] List of components to draw, can be also a string for `none` or `all`. - Ranges like *R5-R10* are supported. - Unlike the `pcbdraw` output, the default is `all`. - - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``download_lcsc`` :index:`: ` [boolean=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. - - ``highlight`` :index:`: ` [list(string)=[]] List of components to highlight. Ranges like *R5-R10* are supported. - - - ``highlight_on_top`` :index:`: ` [boolean=false] Highlight over the component (not under). - - ``highlight_padding`` :index:`: ` [number=1.5] [0,1000] How much the highlight extends around the component [mm]. - - ``kicad_3d_url`` :index:`: ` [string='https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'] Base URL for the KiCad 3D models. - - ``kicad_3d_url_suffix`` :index:`: ` [string=''] 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. - - ``output`` :index:`: ` [string='%f-%i%I%v.%x'] Name for the generated PCB3D file (%i='blender_export' %x='pcb3d'). Affected by global options. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``solder_paste_for_populated`` :index:`: ` [boolean=true] Add solder paste only for the populated components. - Populated components are the ones listed in `show_components`. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - - ``version`` :index:`: ` [string='2.7'] [2.1,2.1_haschtl,2.7] Variant of the format used. - - - **point_of_view** :index:`: ` [dict|list(dict)] How the object is viewed by the camera. - - - Valid keys: - - - **view** :index:`: ` [string='top'] [top,bottom,front,rear,right,left,z,Z,y,Y,x,X] Point of view. - Compatible with `render_3d`. - - ``file_id`` :index:`: ` [string=''] String to differentiate the name of this point of view. - When empty we use the `default_file_id` or the `view`. - - ``rotate_x`` :index:`: ` [number=0] Angle to rotate the board in the X axis, positive is clockwise [degrees]. - - ``rotate_y`` :index:`: ` [number=0] Angle to rotate the board in the Y axis, positive is clockwise [degrees]. - - ``rotate_z`` :index:`: ` [number=0] Angle to rotate the board in the Z axis, positive is clockwise [degrees]. - - ``steps`` :index:`: ` [number=1] [1-1000] Generate this amount of steps using the rotation angles as increments. - Use a value of 1 (default) to interpret the angles as absolute. - Used for animations. You should define the `default_file_id` to something like - '_%03d' to get the animation frames. - - - **render_options** :index:`: ` [dict] Controls how the render is done for the `render` output type. - - - Valid keys: - - - **samples** :index:`: ` [number=10] How many samples we create. Each sample is a raytracing render. - Use 1 for a raw preview, 10 for a draft and 100 or more for the final render. - - **transparent_background** :index:`: ` [boolean=false] Make the background transparent. - - ``auto_crop`` :index:`: ` [boolean=false] When enabled the image will be post-processed to remove the empty space around the image. - In this mode the `background2` is changed to be the same as `background1`. - - ``background1`` :index:`: ` [string='#66667F'] First color for the background gradient. - - ``background2`` :index:`: ` [string='#CCCCE5'] Second color for the background gradient. - - *height* :index:`: ` Alias for resolution_y. - - ``no_denoiser`` :index:`: ` [boolean=false] Used to disable the render denoiser on old hardware, or when the functionality isn't compiled. - Note that the impact in quality is huge, you should increase the amount of samples 10 times. - - ``resolution_x`` :index:`: ` [number=1280] Width of the image. - - ``resolution_y`` :index:`: ` [number=720] Height of the image. - - *width* :index:`: ` Alias for resolution_x. - - - ``add_default_light`` :index:`: ` [boolean=true] Add a default light when none specified. - The default light is located at (-size*3.33, size*3.33, size*5) where size is max(width, height) of the PCB. - - ``auto_camera_z_axis_factor`` :index:`: ` [number=1.1] Value to multiply the Z axis coordinate after computing the automatically generated camera. - Used to avoid collision of the camera and the object. - - ``camera`` :index:`: ` [dict] Options for the camera. - If none specified KiBot will create a suitable camera. - If no position is specified for the camera KiBot will look for a suitable position. - - - Valid keys: - - - ``clip_start`` :index:`: ` [number=-1] Minimum distance for objects to the camera. Any object closer than this distance won't be visible. - Only positive values have effect. A negative value has a special meaning. - For a camera with defined position, a negative value means to use Blender defaults (i.e. 0.1 m). - For cameras without position KiBot will ask Blender to compute its position and the use a clip - distance that is 1/10th of the Z distance. - - ``name`` :index:`: ` [string=''] Name for the camera. - - ``pos_x`` :index:`: ` [number|string] X position [m]. You can use `width`, `height` and `size` for PCB dimensions. - - ``pos_y`` :index:`: ` [number|string] Y position [m]. You can use `width`, `height` and `size` for PCB dimensions. - - ``pos_z`` :index:`: ` [number|string] Z position [m]. You can use `width`, `height` and `size` for PCB dimensions. - - ``type`` :index:`: ` [string='perspective'] [perspective,orthographic,panoramic] Type of camera. - - - ``default_file_id`` :index:`: ` [string=''] Default value for the `file_id` in the `point_of_view` options. - Use something like '_%03d' for animations. - - ``fixed_auto_camera`` :index:`: ` [boolean=false] When using the automatically generated camera and multiple points of view this option computes the camera - position just once. Suitable for videos. - - ``light`` :index:`: ` [dict|list(dict)] Options for the light/s. - - - Valid keys: - - - ``energy`` :index:`: ` [number=0] How powerful is the light. Using 0 for POINT and SUN KiBot will try to use something useful. - - ``name`` :index:`: ` [string=''] Name for the light. - - ``pos_x`` :index:`: ` [number|string] X position [m]. You can use `width`, `height` and `size` for PCB dimensions. - - ``pos_y`` :index:`: ` [number|string] Y position [m]. You can use `width`, `height` and `size` for PCB dimensions. - - ``pos_z`` :index:`: ` [number|string] Z position [m]. You can use `width`, `height` and `size` for PCB dimensions. - - ``type`` :index:`: ` [string='POINT'] [POINT,SUN,SPOT,HEMI,AREA] Type of light. SUN lights will illuminate more evenly. - - - ``outputs`` :index:`: ` [dict|list(dict)] Outputs to generate in the same run. - - - Valid keys: - - - **type** :index:`: ` [string='render'] [fbx,obj,x3d,gltf,stl,ply,blender,render] The format for the output. - The `render` type will generate a PNG image of the render result. - `fbx` is Kaydara's Filmbox, 'obj' is the Wavefront, 'x3d' is the new ISO/IEC standard - that replaced VRML, `gltf` is the standardized GL format, `stl` is the 3D printing - format, 'ply' is Polygon File Format (Stanford). - Note that some formats includes the light and camera and others are just the 3D model - (i.e. STL and PLY). - - ``dir`` :index:`: ` [string=''] Subdirectory for this output. - - ``output`` :index:`: ` [string='%f-%i%I%v.%x'] Name for the generated file (%i='3D_blender_$VIEW' %x=VARIABLE). - The extension is selected from the type. Affected by global options. - - - ``pcb_import`` :index:`: ` Options to configure how Blender imports the PCB. - The default values are good for most cases. - - - Valid keys: - - - ``center`` :index:`: ` [boolean=true] Center the PCB at the coordinates origin. - - ``components`` :index:`: ` [boolean=true] Import the components. - - ``cut_boards`` :index:`: ` [boolean=true] Separate the sub-PCBs in separated 3D models. - - ``enhance_materials`` :index:`: ` [boolean=true] Create good looking materials. - - ``merge_materials`` :index:`: ` [boolean=true] Reuse materials. - - ``solder_joints`` :index:`: ` [string='SMART'] [NONE,SMART,ALL] The plug-in can add nice looking solder joints. - This option controls if we add it for none, all or only for THT/SMD pads with solder paste. - - ``stack_boards`` :index:`: ` [boolean=true] Move the sub-PCBs to their relative position. - - ``texture_dpi`` :index:`: ` [number=1016.0] [508-2032] Texture density in dots per inch. - - +- **options** :index:`: ` [:ref:`Blender_ExportOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `blender_export` output. - **type** :index:`: ` 'blender_export' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Blender_ExportOptions diff --git a/docs/source/configuration/outputs/boardview.rst b/docs/source/configuration/outputs/boardview.rst index 6b8763775..319cc16c1 100644 --- a/docs/source/configuration/outputs/boardview.rst +++ b/docs/source/configuration/outputs/boardview.rst @@ -16,41 +16,33 @@ Categories: **PCB/repair**, **PCB/fabrication/assembly** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `boardview` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=boardview, %x=brd). Affected by global options. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Used for sub-PCBs. - +- **options** :index:`: ` [:ref:`BoardViewOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `boardview` output. - **type** :index:`: ` 'boardview' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + BoardViewOptions diff --git a/docs/source/configuration/outputs/bom.rst b/docs/source/configuration/outputs/bom.rst index 9b64d39e5..1fb125bc1 100644 --- a/docs/source/configuration/outputs/bom.rst +++ b/docs/source/configuration/outputs/bom.rst @@ -23,338 +23,33 @@ Category: **Schematic/BoM** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `bom` output. - - - Valid keys: - - - **columns** :index:`: ` [list(dict)|list(string)] List of columns to display. - Can be just the name of the field. - In addition to all user defined fields you have various special columns, consult :ref:`bom_columns`. - - - Valid keys: - - - **field** :index:`: ` [string=''] Name of the field to use for this column. - Use `_field_lcsc_part` to get the value defined in the global options. - - **name** :index:`: ` [string=''] Name to display in the header. The field is used when empty. - - ``comment`` :index:`: ` [string=''] Used as explanation for this column. The XLSX output uses it. - - ``join`` :index:`: ` [list(dict)|list(string)|string=''] List of fields to join to this column. - - - Valid keys: - - - **field** :index:`: ` [string=''] Name of the field. - - ``text`` :index:`: ` [string=''] Text to use instead of a field. This option is incompatible with the `field` option. - Any space to separate it should be added in the text. - Use \\n for newline and \\t for tab. - - ``text_after`` :index:`: ` [string=''] Text to add after the field content. Will be added only if the field isn't empty. - Any space to separate it should be added in the text. - Use \\n for newline and \\t for tab. - - ``text_before`` :index:`: ` [string=''] Text to add before the field content. Will be added only if the field isn't empty. - Any space to separate it should be added in the text. - Use \\n for newline and \\t for tab. - - - ``level`` :index:`: ` [number=0] Used to group columns. The XLSX output uses it to collapse columns. - - - **csv** :index:`: ` [dict] Options for the CSV, TXT and TSV formats. - - - Valid keys: - - - **quote_all** :index:`: ` [boolean=false] Enclose all values using double quotes. - - **separator** :index:`: ` [string=','] CSV Separator. TXT and TSV always use tab as delimiter. - Only one character can be specified. - - ``hide_header`` :index:`: ` [boolean=false] Hide the header line (names of the columns). - - ``hide_pcb_info`` :index:`: ` [boolean=false] Hide project information. - - ``hide_stats_info`` :index:`: ` [boolean=false] Hide statistics information. - - - **format** :index:`: ` [string=''] [HTML,CSV,TXT,TSV,XML,XLSX,HRTXT] format for the BoM. - Defaults to CSV or a guess according to the options. - HRTXT stands for Human Readable TeXT. - - **group_fields** :index:`: ` [list(string)] List of fields used for sorting individual components into groups. - Components which match (comparing *all* fields) will be grouped together. - Field names are case-insensitive. - For empty fields the behavior is defined by the `group_fields_fallbacks`, `merge_blank_fields` and - `merge_both_blank` options. - Note that for resistors, capacitors and inductors the _Value_ field is parsed and qualifiers, like - tolerance, are discarded. Please use a separated field and disable `merge_blank_fields` if this - information is important. You can also disable `parse_value`. - If empty: ['Part', 'Part Lib', 'Value', 'Footprint', 'Footprint Lib', - 'Voltage', 'Tolerance', 'Current', 'Power'] is used. - - - **hrtxt** :index:`: ` [dict] Options for the HRTXT formats. - - - Valid keys: - - - **separator** :index:`: ` [string='I'] Column Separator. - - ``header_sep`` :index:`: ` [string='-'] Separator between the header and the data. - - ``hide_header`` :index:`: ` [boolean=false] Hide the header line (names of the columns). - - ``hide_pcb_info`` :index:`: ` [boolean=false] Hide project information. - - ``hide_stats_info`` :index:`: ` [boolean=false] Hide statistics information. - - ``justify`` :index:`: ` [string='left'] [left,right,center] Text justification. - - - **html** :index:`: ` [dict] Options for the HTML format. - - - Valid keys: - - - **datasheet_as_link** :index:`: ` [string=''] Column with links to the datasheet. - - **generate_dnf** :index:`: ` [boolean=true] Generate a separated section for DNF (Do Not Fit) components. - - **logo** :index:`: ` [string|boolean=''] PNG/SVG file to use as logo, use false to remove. - Note that when using an SVG this is first converted to a PNG using `logo_width`. - - - **title** :index:`: ` [string='KiBot Bill of Materials'] BoM title. - - ``col_colors`` :index:`: ` [boolean=true] Use colors to show the field type. - - ``digikey_link`` :index:`: ` [string|list(string)=''] Column/s containing Digi-Key part numbers, will be linked to web page. - - - ``extra_info`` :index:`: ` [string|list(string)=''] Information to put after the title and before the pcb and stats info. - - - ``hide_pcb_info`` :index:`: ` [boolean=false] Hide project information. - - ``hide_stats_info`` :index:`: ` [boolean=false] Hide statistics information. - - ``highlight_empty`` :index:`: ` [boolean=true] Use a color for empty cells. Applies only when `col_colors` is `true`. - - ``lcsc_link`` :index:`: ` [boolean|string|list(string)=''] Column/s containing LCSC part numbers, will be linked to web page. - Use **true** to copy the value indicated by the `field_lcsc_part` global option. - - - ``logo_width`` :index:`: ` [number=370] Used when the logo is an SVG image. This width is used to render the SVG image. - - ``mouser_link`` :index:`: ` [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page. - - - ``row_colors`` :index:`: ` [list(dict)] Used to highlight rows using filters. Rows that match a filter can be colored. - Note that these rows won't have colored columns. - - - Valid keys: - - - **color** :index:`: ` [string='#FF8080'] Color used for this category. - - **description** :index:`: ` [string=''] A description for this color, must be filled. - - **filter** :index:`: ` [string|list(string)='_none'] Name of the filter to match. - Be careful because this filter should be coherent with the grouping fields. - KiBot will assume that all the components grouped in the same group will - return the same value when applying this filter. - - - - ``style`` :index:`: ` [string='modern-blue'] Page style. Internal styles: modern-blue, modern-green, modern-red and classic. - Or you can provide a CSS file name. Please use .css as file extension.. - - - **ignore_dnf** :index:`: ` [boolean=true] Exclude DNF (Do Not Fit) components. - - **normalize_values** :index:`: ` [boolean=false] Try to normalize the R, L and C values, producing uniform units and prefixes. - - **number** :index:`: ` [number=1] Number of boards to build (components multiplier). - - **output** :index:`: ` [string='%f-%i%I%v.%x'] filename for the output (%i=bom). Affected by global options. - - **sort_style** :index:`: ` [string='type_value'] [type_value,type_value_ref,ref] Sorting criteria. - - **units** :index:`: ` [string='millimeters'] [millimeters,inches,mils] Units used for the positions ('Footprint X' and 'Footprint Y' columns). - Affected by global options. - - **xlsx** :index:`: ` [dict] Options for the XLSX format. - - - Valid keys: - - - **datasheet_as_link** :index:`: ` [string=''] Column with links to the datasheet. - - **generate_dnf** :index:`: ` [boolean=true] Generate a separated section for DNF (Do Not Fit) components. - - **kicost** :index:`: ` [boolean=false] Enable KiCost worksheet creation. - Note: an example of how to use it on CI/CD can be found `here `__. - - **logo** :index:`: ` [string|boolean=''] PNG/SVG file to use as logo, use false to remove. - Note that when using an SVG this is first converted to a PNG using `logo_width`. - - - **specs** :index:`: ` [boolean=false] Enable Specs worksheet creation. Contains specifications for the components. - Works with only some KiCost APIs. - - **title** :index:`: ` [string='KiBot Bill of Materials'] BoM title. - - ``col_colors`` :index:`: ` [boolean=true] Use colors to show the field type. - - ``digikey_link`` :index:`: ` [string|list(string)=''] Column/s containing Digi-Key part numbers, will be linked to web page. - - - ``extra_info`` :index:`: ` [string|list(string)=''] Information to put after the title and before the pcb and stats info. - - - ``hide_pcb_info`` :index:`: ` [boolean=false] Hide project information. - - ``hide_stats_info`` :index:`: ` [boolean=false] Hide statistics information. - - ``highlight_empty`` :index:`: ` [boolean=true] Use a color for empty cells. Applies only when `col_colors` is `true`. - - ``kicost_api_disable`` :index:`: ` [string|list(string)=''] List of KiCost APIs to disable. - - - ``kicost_api_enable`` :index:`: ` [string|list(string)=''] List of KiCost APIs to enable. - - - ``kicost_config`` :index:`: ` [string=''] KiCost configuration file. It contains the keys for the different distributors APIs. - The regular KiCost config is used when empty. - Important for CI/CD environments: avoid exposing your API secrets! - To understand how to achieve this, and also how to make use of the cache please visit the - `kicost_ci_test `__ repo. - - ``kicost_dist_desc`` :index:`: ` [boolean=false] Used to add a column with the distributor's description. So you can check this is the right component. - - ``lcsc_link`` :index:`: ` [boolean|string|list(string)=''] Column/s containing LCSC part numbers, will be linked to web page. - Use **true** to copy the value indicated by the `field_lcsc_part` global option. - - - ``logo_scale`` :index:`: ` [number=2] Scaling factor for the logo. Note that this value isn't honored by all spreadsheet software. - - ``logo_width`` :index:`: ` [number=370] Used when the logo is an SVG image. This width is used to render the SVG image. - - ``max_col_width`` :index:`: ` [number=60] [20,999] Maximum column width (characters). - - ``mouser_link`` :index:`: ` [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page. - - - ``row_colors`` :index:`: ` [list(dict)] Used to highlight rows using filters. Rows that match a filter can be colored. - Note that these rows won't have colored columns. - - - Valid keys: - - - **color** :index:`: ` [string='#FF8080'] Color used for this category. - - **description** :index:`: ` [string=''] A description for this color, must be filled. - - **filter** :index:`: ` [string|list(string)='_none'] Name of the filter to match. - Be careful because this filter should be coherent with the grouping fields. - KiBot will assume that all the components grouped in the same group will - return the same value when applying this filter. - - - - ``specs_columns`` :index:`: ` [list(dict)|list(string)] Which columns are included in the Specs worksheet. Use `References` for the - references, 'Row' for the order and 'Sep' to separate groups at the same level. By default all are included. - Column names are distributor specific, the following aren't: '_desc', '_value', '_tolerance', '_footprint', - '_power', '_current', '_voltage', '_frequency', '_temp_coeff', '_manf', '_size'. - - - Valid keys: - - - **field** :index:`: ` [string=''] Name of the field to use for this column. - Use `_field_lcsc_part` to get the value defined in the global options. - - **name** :index:`: ` [string=''] Name to display in the header. The field is used when empty. - - ``comment`` :index:`: ` [string=''] Used as explanation for this column. The XLSX output uses it. - - ``join`` :index:`: ` [list(dict)|list(string)|string=''] List of fields to join to this column. - - - Valid keys: - - - **field** :index:`: ` [string=''] Name of the field. - - ``text`` :index:`: ` [string=''] Text to use instead of a field. This option is incompatible with the `field` option. - Any space to separate it should be added in the text. - Use \\n for newline and \\t for tab. - - ``text_after`` :index:`: ` [string=''] Text to add after the field content. Will be added only if the field isn't empty. - Any space to separate it should be added in the text. - Use \\n for newline and \\t for tab. - - ``text_before`` :index:`: ` [string=''] Text to add before the field content. Will be added only if the field isn't empty. - Any space to separate it should be added in the text. - Use \\n for newline and \\t for tab. - - - ``level`` :index:`: ` [number=0] Used to group columns. The XLSX output uses it to collapse columns. - - - ``style`` :index:`: ` [string='modern-blue'] Head style: modern-blue, modern-green, modern-red and classic. - - - ``aggregate`` :index:`: ` [list(dict)] Add components from other projects. - You can use CSV files, the first row must contain the names of the fields. - The `Reference` and `Value` are mandatory, in most cases `Part` is also needed. - The `Part` column should contain the name/type of the component. This is important for - passive components (R, L, C, etc.). If this information isn't available consider - configuring the grouping to exclude the `Part`.. - - - Valid keys: - - - ``delimiter`` :index:`: ` [string=','] Delimiter used for CSV files. - - ``file`` :index:`: ` [string=''] Name of the schematic to aggregate. - - ``name`` :index:`: ` [string=''] Name to identify this source. If empty we use the name of the schematic. - - ``number`` :index:`: ` [number=1] Number of boards to build (components multiplier). Use negative to subtract. - - ``ref_id`` :index:`: ` [string=''] A prefix to add to all the references from this project. - - - ``angle_positive`` :index:`: ` [boolean=true] Always use positive values for the footprint rotation. - - ``bottom_negative_x`` :index:`: ` [boolean=false] Use negative X coordinates for footprints on bottom layer (for XYRS). - - ``component_aliases`` :index:`: ` [list(list(string))] A series of values which are considered to be equivalent for the part name. - Each entry is a list of equivalen names. Example: ['c', 'c_small', 'cap' ] - will ensure the equivalent capacitor symbols can be grouped together. - If empty the following aliases are used: - - - ['r', 'r_small', 'res', 'resistor'] - - ['l', 'l_small', 'inductor'] - - ['c', 'c_small', 'cap', 'capacitor'] - - ['sw', 'switch'] - - ['zener', 'zenersmall'] - - ['d', 'diode', 'd_small']. - - - ``cost_extra_columns`` :index:`: ` [list(dict)|list(string)] List of columns to add to the global section of the cost. - Can be just the name of the field. - - - Valid keys: - - - **field** :index:`: ` [string=''] Name of the field to use for this column. - Use `_field_lcsc_part` to get the value defined in the global options. - - **name** :index:`: ` [string=''] Name to display in the header. The field is used when empty. - - ``comment`` :index:`: ` [string=''] Used as explanation for this column. The XLSX output uses it. - - ``join`` :index:`: ` [list(dict)|list(string)|string=''] List of fields to join to this column. - - - Valid keys: - - - **field** :index:`: ` [string=''] Name of the field. - - ``text`` :index:`: ` [string=''] Text to use instead of a field. This option is incompatible with the `field` option. - Any space to separate it should be added in the text. - Use \\n for newline and \\t for tab. - - ``text_after`` :index:`: ` [string=''] Text to add after the field content. Will be added only if the field isn't empty. - Any space to separate it should be added in the text. - Use \\n for newline and \\t for tab. - - ``text_before`` :index:`: ` [string=''] Text to add before the field content. Will be added only if the field isn't empty. - Any space to separate it should be added in the text. - Use \\n for newline and \\t for tab. - - - ``level`` :index:`: ` [number=0] Used to group columns. The XLSX output uses it to collapse columns. - - - ``count_smd_tht`` :index:`: ` [boolean=false] Show the stats about how many of the components are SMD/THT. You must provide the PCB. - - ``distributors`` :index:`: ` [string|list(string)] Include this distributors list. Default is all the available. - - - ``dnc_filter`` :index:`: ` [string|list(string)='_kibom_dnc'] Name of the filter to mark components as 'Do Not Change'. - The default filter marks components with a DNC value or DNC in the Config field. - This option is for simple cases, consider using a full variant for complex cases. - - - ``dnf_filter`` :index:`: ` [string|list(string)='_kibom_dnf'] Name of the filter to mark components as 'Do Not Fit'. - The default filter marks components with a DNF value or DNF in the Config field. - This option is for simple cases, consider using a full variant for complex cases. - - - ``exclude_filter`` :index:`: ` [string|list(string)='_mechanical'] Name of the filter to exclude components from BoM processing. - The default filter (built-in filter '_mechanical') excludes test points, fiducial marks, mounting holes, etc. - Please consult the built-in filters explanation to fully understand what is excluded by default. - This option is for simple cases, consider using a full variant for complex cases. - - - ``exclude_marked_in_pcb`` :index:`: ` [boolean=false] Exclude components marked with *Exclude from BOM* in the PCB. - This is a KiCad 6 option. - - ``exclude_marked_in_sch`` :index:`: ` [boolean=true] Exclude components marked with *Exclude from bill of materials* in the schematic. - This is a KiCad 6 option. - - ``expand_text_vars`` :index:`: ` [boolean=true] Expand KiCad 6 text variables after applying all filters and variants. - This is done using a **_expand_text_vars** filter. - If you need to customize the filter, or apply it before, you can disable this option and - add a custom filter to the filter chain. - - ``fit_field`` :index:`: ` [string='Config'] Field name used for internal filters (not for variants). - - ``footprint_populate_values`` :index:`: ` [string|list(string)='no,yes'] Values for the `Footprint Populate` column. - - - ``footprint_type_values`` :index:`: ` [string|list(string)='SMD,THT,VIRTUAL'] Values for the `Footprint Type` column. - - - ``group_connectors`` :index:`: ` [boolean=true] Connectors with the same footprints will be grouped together, independent of the name of the connector. - - ``group_fields_fallbacks`` :index:`: ` [list(string)] List of fields to be used when the fields in `group_fields` are empty. - The first field in this list is the fallback for the first in `group_fields`, and so on. - - - ``int_qtys`` :index:`: ` [boolean=true] Component quantities are always expressed as integers. Using the ceil() function. - - ``merge_blank_fields`` :index:`: ` [boolean=true] Component groups with blank fields will be merged into the most compatible group, where possible. - - ``merge_both_blank`` :index:`: ` [boolean=true] When creating groups two components with empty/missing field will be interpreted as with the same value. - - ``no_conflict`` :index:`: ` [list(string)] List of fields where we tolerate conflicts. - Use it to avoid undesired warnings. - By default the field indicated in `fit_field`, the field used for variants and - the field `part` are excluded. - - - ``no_distributors`` :index:`: ` [string|list(string)] Exclude this distributors list. They are removed after computing `distributors`. - - - ``normalize_locale`` :index:`: ` [boolean=false] When normalizing values use the locale decimal point. - - ``parse_value`` :index:`: ` [boolean=true] Parse the `Value` field so things like *1k* and *1000* are interpreted as equal. - Note that this implies that *1k 1%* is the same as *1k 5%*. If you really need to group using the - extra information split it in separated fields, add the fields to `group_fields` and disable - `merge_blank_fields`. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. - This option is for simple cases, consider using a full variant for complex cases. - - - ``ref_id`` :index:`: ` [string=''] A prefix to add to all the references from this project. Used for multiple projects. - - ``ref_separator`` :index:`: ` [string=' '] Separator used for the list of references. - - ``source_by_id`` :index:`: ` [boolean=false] Generate the `Source BoM` column using the reference ID instead of the project name. - - ``use_alt`` :index:`: ` [boolean=false] Print grouped references in the alternate compressed style eg: R1-R7,R18. - - ``use_aux_axis_as_origin`` :index:`: ` [boolean=true] Use the auxiliary axis as origin for coordinates (KiCad default) (for XYRS). - - ``variant`` :index:`: ` [string=''] Board variant, used to determine which components - are output to the BoM.. - +- **options** :index:`: ` [:ref:`BoMOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `bom` output. - **type** :index:`: ` 'bom' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + BoMOptions diff --git a/docs/source/configuration/outputs/compress.rst b/docs/source/configuration/outputs/compress.rst index 598fc3f24..7d72a3dd6 100644 --- a/docs/source/configuration/outputs/compress.rst +++ b/docs/source/configuration/outputs/compress.rst @@ -14,55 +14,33 @@ Type: ``compress`` Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `compress` output. - - - Valid keys: - - - **files** :index:`: ` [list(dict)] Which files will be included. - - - Valid keys: - - - **from_output** :index:`: ` [string=''] Collect files from the selected output. - When used the `source` option is ignored. - - **source** :index:`: ` [string='*'] File names to add, wildcards allowed. Use ** for recursive match. - By default this pattern is applied to the output dir specified with `-d` command line option. - See the `from_cwd` and `from_output_dir` options. - - ``dest`` :index:`: ` [string=''] Destination directory inside the archive, empty means the same of the file. - - ``filter`` :index:`: ` [string='.*'] A regular expression that source files must match. - - ``from_cwd`` :index:`: ` [boolean=false] Use the current working directory instead of the dir specified by `-d`. - - ``from_output_dir`` :index:`: ` [boolean=false] Use the current directory specified by the output instead of the dir specified by `-d`. - Note that it only applies when using `from_output` and no `dest` is specified. - It has more prescedence than `from_cwd`. - - - **format** :index:`: ` [string='ZIP'] [ZIP,TAR,RAR] Output file format. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Name for the generated archive (%i=name of the output %x=according to format). Affected by global options. - - ``compression`` :index:`: ` [string='auto'] [auto,stored,deflated,bzip2,lzma] Compression algorithm. Use auto to let KiBot select a suitable one. - - ``follow_links`` :index:`: ` [boolean=true] Store the file pointed by symlinks, not the symlink. - - ``move_files`` :index:`: ` [boolean=false] Move the files to the archive. In other words: remove the files after adding them to the archive. - - *remove_files* :index:`: ` Alias for move_files. - - ``skip_not_run`` :index:`: ` [boolean=false] Skip outputs with `run_by_default: false`. - +- **options** :index:`: ` [:ref:`CompressOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `compress` output. - **type** :index:`: ` 'compress' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=10] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``10``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + CompressOptions diff --git a/docs/source/configuration/outputs/copy_files.rst b/docs/source/configuration/outputs/copy_files.rst index 039854d5a..aa226e78e 100644 --- a/docs/source/configuration/outputs/copy_files.rst +++ b/docs/source/configuration/outputs/copy_files.rst @@ -16,80 +16,33 @@ Categories: **PCB/docs**, **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `copy_files` output. - - - Valid keys: - - - **download** :index:`: ` [boolean=true] Downloads missing 3D models from KiCad git. - Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. - They are downloaded to a temporal directory and discarded. - If you want to cache the downloaded files specify a directory using the - KIBOT_3D_MODELS environment variable. - - **files** :index:`: ` [list(dict)] Which files will be included. - - - Valid keys: - - - **source** :index:`: ` [string='*'] For the `files` and `out_files` mode this is th file names to add, - wildcards allowed. Use ** for recursive match. - For the `output` mode this is the name of the output. - For the `3d_models` is a pattern to match the name of the 3D models extracted from the PCB. - Not used for the `project` mode. - - **source_type** :index:`: ` [string='files'] [files,out_files,output,3d_models,project] From where do we get the files to be copied. - `files`: files relative to the current working directory. - `out_files`: files relative to output dir specified with `-d` command line option. - `output`: files generated by the output specified by `source`. - `3d_models`: 3D models used in the project. - `project`: schematic, PCB, footprints, symbols, 3D models and project files (KiCad 6+). - - ``dest`` :index:`: ` [string=''] Destination directory inside the output dir, empty means the same of the file - relative to the source directory. - Note that when you specify a name here files are copied to this destination - without creating subdirs. The `project` mode is an exception. - For the `3d_models` type you can use DIR+ to create subdirs under DIR. - - ``filter`` :index:`: ` [string='.*'] A regular expression that source files must match. - Not used for the `project` mode. - - ``save_pcb`` :index:`: ` [boolean=false] Only usable for the `3d_models` mode. - Save a PCB copy modified to use the copied 3D models. - You don't need to specify it for `project` mode. - - - **no_virtual** :index:`: ` [boolean=false] Used to exclude 3D models for components with 'virtual' attribute. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``download_lcsc`` :index:`: ` [boolean=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. - - ``follow_links`` :index:`: ` [boolean=true] Store the file pointed by symlinks, not the symlink. - - ``kicad_3d_url`` :index:`: ` [string='https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'] Base URL for the KiCad 3D models. - - ``kicad_3d_url_suffix`` :index:`: ` [string=''] 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:`: ` [boolean=false] Create symlinks instead of copying files. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`Copy_FilesOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `copy_files` output. - **type** :index:`: ` 'copy_files' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=11] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``11``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Copy_FilesOptions diff --git a/docs/source/configuration/outputs/diff.rst b/docs/source/configuration/outputs/diff.rst index 6b4e612d4..407ee8a77 100644 --- a/docs/source/configuration/outputs/diff.rst +++ b/docs/source/configuration/outputs/diff.rst @@ -15,106 +15,38 @@ Categories: **PCB/docs**, **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **layers** :index:`: ` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to use. When empty all available layers are used. +- **layers** :index:`: ` [:ref:`Layer parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string) List + of PCB layers to use. When empty all available layers are used. + If the list is empty all layers will be included. Note that if you want to support adding/removing layers you should specify a list here. - - - Valid keys: - - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `diff` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=diff_pcb/diff_sch, %x=pdf). Affected by global options. - - ``add_link_id`` :index:`: ` [boolean=false] When enabled we create a symlink to the output file with a name that contains the - git hashes involved in the comparison. If you plan to compress the output don't - forget to disable the `follow_links` option. - - ``always_fail_if_missing`` :index:`: ` [boolean=false] Always fail if the old/new file doesn't exist. Currently we don't fail if they are from a repo. - So if you refer to a repo point where the file wasn't created KiBot will use an empty file. - Enabling this option KiBot will report an error. - - ``cache_dir`` :index:`: ` [string=''] Directory to cache the intermediate files. Leave it blank to disable the cache. - - ``color_added`` :index:`: ` [string='#00FF00'] Color used for the added stuff in the '2color' mode. - - ``color_removed`` :index:`: ` [string='#FF0000'] Color used for the removed stuff in the '2color' mode. - - ``copy_instead_of_link`` :index:`: ` [boolean=false] Modifies the behavior of `add_link_id` to create a copy of the file instead of a - symlink. Useful for some Windows setups. - - ``diff_mode`` :index:`: ` [string='red_green'] [red_green,stats,2color] In the `red_green` mode added stuff is green and red when removed. - The `stats` mode is used to measure the amount of difference. In this mode all - changes are red, but you can abort if the difference is bigger than certain threshold. - The '2color' mode is like 'red_green', but you can customize the colors. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``force_checkout`` :index:`: ` [boolean=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 - to do a checkout, even after stashing, this option can workaround the problem. - Note that using it you could potentially lose modified files. For more information - read https://stackoverflow.com/questions/1248029/git-pull-error-entry-foo-not-uptodate-cannot-merge. - - ``fuzz`` :index:`: ` [number=5] [0,100] Color tolerance (fuzzyness) for the `stats` mode. - - ``new`` :index:`: ` [string|list(string)] The file you want to compare. Leave it blank for the current PCB/SCH. - A list is accepted only for the `multivar` type. Consult the `old` option for more information. - - ``new_type`` :index:`: ` [string='current'] [git,file,output,multivar,current] How to interpret the `new` name. Use `git` for a git hash, branch, etc. - Use `current` for the currently loaded PCB/Schematic. - Use `file` for a file name. Use `output` to specify the name of a `pcb_variant`/`sch_variant` output. - Use `multivar` to compare a set of variants, in this mode `new` is the list of outputs for the variants. - This is an extension of the `output` mode. - If `old` is also `multivar` then it becomes the reference, otherwise we compare using pairs of variants. - - ``old`` :index:`: ` [string='HEAD'] Reference file. When using git use `HEAD` to refer to the last commit. - Use `HEAD~` to refer the previous to the last commit. - As `HEAD` is for the whole repo you can use `KIBOT_LAST-n` to make - reference to the changes in the PCB/SCH. The `n` value is how many - changes in the history you want to go back. A 0 is the same as `HEAD`, - a 1 means the last time the PCB/SCH was changed, etc. - Use `KIBOT_TAG-n` to search for the last tag skipping `n` tags. - Important: when using the `checkout` GitHub action you just get the - last commit. To clone the full repo use `fetch-depth: '0'`. - - ``old_type`` :index:`: ` [string='git'] [git,file,output,multivar] How to interpret the `old` name. Use `git` for a git hash, branch, etc. - Use `file` for a file name. Use `output` to specify the name of a `pcb_variant`/`sch_variant` output. - Use `multivar` to specify a reference file when `new_type` is also `multivar`. - - ``only_different`` :index:`: ` [boolean=false] Only include the pages with differences in the output PDF. - Note that when no differences are found we get a page saying *No diff*. - - ``only_first_sch_page`` :index:`: ` [boolean=false] Compare only the main schematic page (root page). - - ``pcb`` :index:`: ` [boolean=true] Compare the PCB, otherwise compare the schematic. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``threshold`` :index:`: ` [number=0] [0,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. - KiBot will return error level 29 and the diff generation will be aborted. - - ``use_file_id`` :index:`: ` [boolean=false] When creating the link name of an output file related to a variant use the variant - `file_id` instead of its name. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - - ``zones`` :index:`: ` [string='global'] [global,fill,unfill,none] How to handle PCB zones. The default is *global* and means that we - fill zones if the *check_zone_fills* preflight is enabled. The *fill* option always forces - a refill, *unfill* forces a zone removal and *none* lets the zones unchanged. - Be careful with the cache when changing this setting. - +- **options** :index:`: ` [:ref:`DiffOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `diff` output. - **type** :index:`: ` 'diff' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + DiffOptions + Layer diff --git a/docs/source/configuration/outputs/download_datasheets.rst b/docs/source/configuration/outputs/download_datasheets.rst index bd95c7b10..3895f8dd0 100644 --- a/docs/source/configuration/outputs/download_datasheets.rst +++ b/docs/source/configuration/outputs/download_datasheets.rst @@ -15,46 +15,33 @@ Category: **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `download_datasheets` output. - - - Valid keys: - - - **field** :index:`: ` [string='Datasheet'] Name of the field containing the URL. - - ``dnf`` :index:`: ` [boolean=false] Include the DNF components. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``link_repeated`` :index:`: ` [boolean=true] Instead of download things we already downloaded use symlinks. - - ``output`` :index:`: ` [string='${VALUE}.pdf'] Name used for the downloaded datasheet. - `${FIELD}` will be replaced by the FIELD content. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``repeated`` :index:`: ` [boolean=false] Download URLs that we already downloaded. - It only makes sense if the `output` field makes their output different. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`Download_Datasheets_Options parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `download_datasheets` output. - **type** :index:`: ` 'download_datasheets' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Download_Datasheets_Options diff --git a/docs/source/configuration/outputs/dxf.rst b/docs/source/configuration/outputs/dxf.rst index 4a2edb8b3..169843a88 100644 --- a/docs/source/configuration/outputs/dxf.rst +++ b/docs/source/configuration/outputs/dxf.rst @@ -16,88 +16,36 @@ Category: **PCB/export** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **layers** :index:`: ` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to plot. - - - Valid keys: - - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **layers** :index:`: ` [:ref:`Layer parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string) List + of PCB layers to plot. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `dxf` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Output file name, the default KiCad name if empty. - IMPORTANT! KiCad will always create the file using its own name and then we can rename it. - For this reason you must avoid generating two variants at the same directory when one of - them uses the default KiCad name. Affected by global options. - - **plot_sheet_reference** :index:`: ` [boolean=false] Include the frame and title block. Only available for KiCad 6+ and you get a poor result - (i.e. always the default worksheet style, also problems expanding text variables). - The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. - - **scaling** :index:`: ` [number=1] Scale factor (0 means autoscaling). - - ``custom_reports`` :index:`: ` [list(dict)] A list of customized reports for the manufacturer. - - - Valid keys: - - - ``content`` :index:`: ` [string=''] Content for the report. Use ``${basename}`` for the project name without extension. - Use ``${filename(LAYER)}`` for the file corresponding to LAYER. - - ``output`` :index:`: ` [string='Custom_report.txt'] File name for the custom report. - - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``drill_marks`` :index:`: ` [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale). - - ``edge_cut_extension`` :index:`: ` [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot. - - ``exclude_edge_layer`` :index:`: ` [boolean=true] Do not include the PCB edge layer. - - ``exclude_pads_from_silkscreen`` :index:`: ` [boolean=false] Do not plot the component pads in the silk screen (KiCad 5.x only). - - ``force_plot_invisible_refs_vals`` :index:`: ` [boolean=false] Include references and values even when they are marked as invisible. - - ``individual_page_scaling`` :index:`: ` [boolean=true] Tell KiCad to apply the scaling for each layer as a separated entity. - Disabling it the pages are coherent and can be superposed. - - ``inner_extension_pattern`` :index:`: ` [string=''] Used to change the Protel style extensions for inner layers. - The replacement pattern can contain %n for the inner layer number and %N for the layer number. - Example '.g%n'. - - ``metric_units`` :index:`: ` [boolean=false] Use mm instead of inches. - - ``plot_footprint_refs`` :index:`: ` [boolean=true] Include the footprint references. - - ``plot_footprint_values`` :index:`: ` [boolean=true] Include the footprint values. - - ``polygon_mode`` :index:`: ` [boolean=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:`: ` [string|list(string)='_none'] 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. - - - ``sketch_pad_line_width`` :index:`: ` [number=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). - - ``sketch_pads_on_fab_layers`` :index:`: ` [boolean=false] Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). - - ``sketch_plot`` :index:`: ` [boolean=false] Don't fill objects, just draw the outline. - - ``tent_vias`` :index:`: ` [boolean=true] Cover the vias. - - ``uppercase_extensions`` :index:`: ` [boolean=false] Use uppercase names for the extensions. - - ``use_aux_axis_as_origin`` :index:`: ` [boolean=false] Use the auxiliary axis as origin for coordinates. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`DXFOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `dxf` output. - **type** :index:`: ` 'dxf' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + DXFOptions + Layer diff --git a/docs/source/configuration/outputs/dxf_sch_print.rst b/docs/source/configuration/outputs/dxf_sch_print.rst index d29de3884..557cc67d2 100644 --- a/docs/source/configuration/outputs/dxf_sch_print.rst +++ b/docs/source/configuration/outputs/dxf_sch_print.rst @@ -16,51 +16,33 @@ Category: **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `dxf_sch_print` output. - - - Valid keys: - - - **frame** :index:`: ` [boolean=true] Include the frame and title block. - - ``all_pages`` :index:`: ` [boolean=true] Generate with all hierarchical sheets. - - ``background_color`` :index:`: ` [boolean=false] Use the background color from the `color_theme` (KiCad 6). - - ``color_theme`` :index:`: ` [string=''] Color theme used, this must exist in the KiCad config (KiCad 6). - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``monochrome`` :index:`: ` [boolean=false] Generate a monochromatic output. - - ``output`` :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output DXF (%i=schematic, %x=dxf). Affected by global options. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``sheet_reference_layout`` :index:`: ` [string=''] 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 - file is available. - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Not fitted components are crossed. - +- **options** :index:`: ` [:ref:`DXF_SCH_PrintOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `dxf_sch_print` output. - **type** :index:`: ` 'dxf_sch_print' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + DXF_SCH_PrintOptions diff --git a/docs/source/configuration/outputs/excellon.rst b/docs/source/configuration/outputs/excellon.rst index 8466ecffe..0117286c3 100644 --- a/docs/source/configuration/outputs/excellon.rst +++ b/docs/source/configuration/outputs/excellon.rst @@ -16,67 +16,33 @@ Category: **PCB/fabrication/drill** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `excellon` output. - - - Valid keys: - - - **metric_units** :index:`: ` [boolean=true] Use metric units instead of inches. - - **mirror_y_axis** :index:`: ` [boolean=false] Invert the Y axis. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] name for the drill file, KiCad defaults if empty (%i='PTH_drill'). Affected by global options. - - **pth_and_npth_single_file** :index:`: ` [boolean=true] Generate one file for both, plated holes and non-plated holes, instead of two separated files. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``left_digits`` :index:`: ` [number=0] number of digits for integer part of coordinates (0 is auto). - - ``map`` :index:`: ` [dict|string] [hpgl,ps,gerber,dxf,svg,pdf] Format for a graphical drill map. - Not generated unless a format is specified. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Name for the map file, KiCad defaults if empty (%i='PTH_drill_map'). Affected by global options. - - ``type`` :index:`: ` [string='pdf'] [hpgl,ps,gerber,dxf,svg,pdf] Format for a graphical drill map. - - - ``minimal_header`` :index:`: ` [boolean=false] Use a minimal header in the file. - - ``npth_id`` :index:`: ` [string] Force this replacement for %i when generating NPTH files. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``pth_id`` :index:`: ` [string] Force this replacement for %i when generating PTH and unified files. - - ``report`` :index:`: ` [dict|string] Name of the drill report. Not generated unless a name is specified. - - - Valid keys: - - - ``filename`` :index:`: ` [string=''] Name of the drill report. Not generated unless a name is specified. - (%i='drill_report' %x='txt'). - - - ``right_digits`` :index:`: ` [number=0] number of digits for mantissa part of coordinates (0 is auto). - - ``route_mode_for_oval_holes`` :index:`: ` [boolean=true] Use route command for oval holes (G00), otherwise use G85. - - ``use_aux_axis_as_origin`` :index:`: ` [boolean=false] Use the auxiliary axis as origin for coordinates. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Used for sub-PCBs. - - ``zeros_format`` :index:`: ` [string='DECIMAL_FORMAT'] [DECIMAL_FORMAT,SUPPRESS_LEADING,SUPPRESS_TRAILING,KEEP_ZEROS] How to handle the zeros. - +- **options** :index:`: ` [:ref:`ExcellonOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `excellon` output. - **type** :index:`: ` 'excellon' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + ExcellonOptions diff --git a/docs/source/configuration/outputs/gencad.rst b/docs/source/configuration/outputs/gencad.rst index c63bbec45..9b92c68e4 100644 --- a/docs/source/configuration/outputs/gencad.rst +++ b/docs/source/configuration/outputs/gencad.rst @@ -16,46 +16,33 @@ Category: **PCB/export** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `gencad` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=gencad, %x=cad). Affected by global options. - - ``aux_origin`` :index:`: ` [boolean=false] Use auxiliary axis as origin. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``flip_bottom_padstacks`` :index:`: ` [boolean=false] Flip bottom footprint padstacks. - - ``no_reuse_shapes`` :index:`: ` [boolean=false] Generate a new shape for each footprint instance (Do not reuse shapes). - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``save_origin`` :index:`: ` [boolean=false] Save the origin coordinates in the file. - - ``unique_pin_names`` :index:`: ` [boolean=false] Generate unique pin names. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Used for sub-PCBs. - +- **options** :index:`: ` [:ref:`GenCADOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `gencad` output. - **type** :index:`: ` 'gencad' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + GenCADOptions diff --git a/docs/source/configuration/outputs/gerb_drill.rst b/docs/source/configuration/outputs/gerb_drill.rst index 92a3e0238..3945e5f23 100644 --- a/docs/source/configuration/outputs/gerb_drill.rst +++ b/docs/source/configuration/outputs/gerb_drill.rst @@ -16,59 +16,33 @@ Category: **PCB/fabrication/drill** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `gerb_drill` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] name for the drill file, KiCad defaults if empty (%i='PTH_drill'). Affected by global options. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``map`` :index:`: ` [dict|string] [hpgl,ps,gerber,dxf,svg,pdf] Format for a graphical drill map. - Not generated unless a format is specified. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Name for the map file, KiCad defaults if empty (%i='PTH_drill_map'). Affected by global options. - - ``type`` :index:`: ` [string='pdf'] [hpgl,ps,gerber,dxf,svg,pdf] Format for a graphical drill map. - - - ``npth_id`` :index:`: ` [string] Force this replacement for %i when generating NPTH files. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``pth_id`` :index:`: ` [string] Force this replacement for %i when generating PTH and unified files. - - ``report`` :index:`: ` [dict|string] Name of the drill report. Not generated unless a name is specified. - - - Valid keys: - - - ``filename`` :index:`: ` [string=''] Name of the drill report. Not generated unless a name is specified. - (%i='drill_report' %x='txt'). - - - ``use_aux_axis_as_origin`` :index:`: ` [boolean=false] Use the auxiliary axis as origin for coordinates. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Used for sub-PCBs. - +- **options** :index:`: ` [:ref:`Gerb_DrillOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `gerb_drill` output. - **type** :index:`: ` 'gerb_drill' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Gerb_DrillOptions diff --git a/docs/source/configuration/outputs/gerber.rst b/docs/source/configuration/outputs/gerber.rst index 19463ade3..953f259eb 100644 --- a/docs/source/configuration/outputs/gerber.rst +++ b/docs/source/configuration/outputs/gerber.rst @@ -16,90 +16,36 @@ Category: **PCB/fabrication/gerber** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **layers** :index:`: ` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to plot. - - - Valid keys: - - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **layers** :index:`: ` [:ref:`Layer parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string) List + of PCB layers to plot. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `gerber` output. - - - Valid keys: - - - **create_gerber_job_file** :index:`: ` [boolean=true] Creates a file with information about all the generated gerbers. - You can use it in gerbview to load all gerbers at once. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Output file name, the default KiCad name if empty. - IMPORTANT! KiCad will always create the file using its own name and then we can rename it. - For this reason you must avoid generating two variants at the same directory when one of - them uses the default KiCad name. Affected by global options. - - **plot_sheet_reference** :index:`: ` [boolean=false] Include the frame and title block. Only available for KiCad 6+ and you get a poor result - (i.e. always the default worksheet style, also problems expanding text variables). - The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. - - **subtract_mask_from_silk** :index:`: ` [boolean=false] Subtract the solder mask from the silk screen. - - **use_gerber_net_attributes** :index:`: ` [boolean=true] Include netlist metadata. - - **use_gerber_x2_attributes** :index:`: ` [boolean=true] Use the extended X2 format (otherwise use X1 formerly RS-274X). - - **use_protel_extensions** :index:`: ` [boolean=false] Use legacy Protel file extensions. - - ``custom_reports`` :index:`: ` [list(dict)] A list of customized reports for the manufacturer. - - - Valid keys: - - - ``content`` :index:`: ` [string=''] Content for the report. Use ``${basename}`` for the project name without extension. - Use ``${filename(LAYER)}`` for the file corresponding to LAYER. - - ``output`` :index:`: ` [string='Custom_report.txt'] File name for the custom report. - - - ``disable_aperture_macros`` :index:`: ` [boolean=false] Disable aperture macros (workaround for buggy CAM software) (KiCad 6). - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``edge_cut_extension`` :index:`: ` [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot. - - ``exclude_edge_layer`` :index:`: ` [boolean=true] Do not include the PCB edge layer. - - ``exclude_pads_from_silkscreen`` :index:`: ` [boolean=false] Do not plot the component pads in the silk screen (KiCad 5.x only). - - ``force_plot_invisible_refs_vals`` :index:`: ` [boolean=false] Include references and values even when they are marked as invisible. - - ``gerber_job_file`` :index:`: ` [string='%f-%i%I%v.%x'] Name for the gerber job file (%i='job', %x='gbrjob'). Affected by global options. - - ``gerber_precision`` :index:`: ` [number=4.6] This the gerber coordinate format, can be 4.5 or 4.6. - - ``inner_extension_pattern`` :index:`: ` [string=''] Used to change the Protel style extensions for inner layers. - The replacement pattern can contain %n for the inner layer number and %N for the layer number. - Example '.g%n'. - - ``line_width`` :index:`: ` [number=0.1] [0.02,2] Line_width for objects without width [mm] (KiCad 5). - - ``plot_footprint_refs`` :index:`: ` [boolean=true] Include the footprint references. - - ``plot_footprint_values`` :index:`: ` [boolean=true] Include the footprint values. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``sketch_pad_line_width`` :index:`: ` [number=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). - - ``sketch_pads_on_fab_layers`` :index:`: ` [boolean=false] Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). - - ``tent_vias`` :index:`: ` [boolean=true] Cover the vias. - - ``uppercase_extensions`` :index:`: ` [boolean=false] Use uppercase names for the extensions. - - ``use_aux_axis_as_origin`` :index:`: ` [boolean=false] Use the auxiliary axis as origin for coordinates. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`GerberOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `gerber` output. - **type** :index:`: ` 'gerber' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + GerberOptions + Layer diff --git a/docs/source/configuration/outputs/hpgl.rst b/docs/source/configuration/outputs/hpgl.rst index 40fea85ab..146a0c8ca 100644 --- a/docs/source/configuration/outputs/hpgl.rst +++ b/docs/source/configuration/outputs/hpgl.rst @@ -16,88 +16,36 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **layers** :index:`: ` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to plot. - - - Valid keys: - - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **layers** :index:`: ` [:ref:`Layer parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string) List + of PCB layers to plot. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `hpgl` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Output file name, the default KiCad name if empty. - IMPORTANT! KiCad will always create the file using its own name and then we can rename it. - For this reason you must avoid generating two variants at the same directory when one of - them uses the default KiCad name. Affected by global options. - - **plot_sheet_reference** :index:`: ` [boolean=false] Include the frame and title block. Only available for KiCad 6+ and you get a poor result - (i.e. always the default worksheet style, also problems expanding text variables). - The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. - - ``custom_reports`` :index:`: ` [list(dict)] A list of customized reports for the manufacturer. - - - Valid keys: - - - ``content`` :index:`: ` [string=''] Content for the report. Use ``${basename}`` for the project name without extension. - Use ``${filename(LAYER)}`` for the file corresponding to LAYER. - - ``output`` :index:`: ` [string='Custom_report.txt'] File name for the custom report. - - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``drill_marks`` :index:`: ` [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale). - - ``edge_cut_extension`` :index:`: ` [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot. - - ``exclude_edge_layer`` :index:`: ` [boolean=true] Do not include the PCB edge layer. - - ``exclude_pads_from_silkscreen`` :index:`: ` [boolean=false] Do not plot the component pads in the silk screen (KiCad 5.x only). - - ``force_plot_invisible_refs_vals`` :index:`: ` [boolean=false] Include references and values even when they are marked as invisible. - - ``individual_page_scaling`` :index:`: ` [boolean=true] Tell KiCad to apply the scaling for each layer as a separated entity. - Disabling it the pages are coherent and can be superposed. - - ``inner_extension_pattern`` :index:`: ` [string=''] Used to change the Protel style extensions for inner layers. - The replacement pattern can contain %n for the inner layer number and %N for the layer number. - Example '.g%n'. - - ``mirror_plot`` :index:`: ` [boolean=false] Plot mirrored. - - ``pen_number`` :index:`: ` [number=1] [1,16] Pen number. - - ``pen_speed`` :index:`: ` [number=20] [1,99] Pen speed. - - ``pen_width`` :index:`: ` [number=15] [0,100] Pen diameter in MILS, useful to fill areas. However, it is in mm in HPGL files. - - ``plot_footprint_refs`` :index:`: ` [boolean=true] Include the footprint references. - - ``plot_footprint_values`` :index:`: ` [boolean=true] Include the footprint values. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``scaling`` :index:`: ` [number=0] Scale factor (0 means autoscaling). - - ``sketch_pad_line_width`` :index:`: ` [number=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). - - ``sketch_pads_on_fab_layers`` :index:`: ` [boolean=false] Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). - - ``sketch_plot`` :index:`: ` [boolean=false] Don't fill objects, just draw the outline. - - ``tent_vias`` :index:`: ` [boolean=true] Cover the vias. - - ``uppercase_extensions`` :index:`: ` [boolean=false] Use uppercase names for the extensions. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`HPGLOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `hpgl` output. - **type** :index:`: ` 'hpgl' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + HPGLOptions + Layer diff --git a/docs/source/configuration/outputs/hpgl_sch_print.rst b/docs/source/configuration/outputs/hpgl_sch_print.rst index 60079dbdb..d833b1829 100644 --- a/docs/source/configuration/outputs/hpgl_sch_print.rst +++ b/docs/source/configuration/outputs/hpgl_sch_print.rst @@ -16,53 +16,33 @@ Category: **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `hpgl_sch_print` output. - - - Valid keys: - - - **frame** :index:`: ` [boolean=true] Include the frame and title block. - - ``all_pages`` :index:`: ` [boolean=true] Generate with all hierarchical sheets. - - ``background_color`` :index:`: ` [boolean=false] Use the background color from the `color_theme` (KiCad 6). - - ``color_theme`` :index:`: ` [string=''] Color theme used, this must exist in the KiCad config (KiCad 6). - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``monochrome`` :index:`: ` [boolean=false] Generate a monochromatic output. - - ``origin`` :index:`: ` [string='bottom_left'] [bottom_left,centered,page_fit,content_fit] Origin and scale. - - ``output`` :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output HPGL (%i=schematic, %x=plt). Affected by global options. - - ``pen_size`` :index:`: ` [number=0.4826] Pen size (diameter) [mm]. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``sheet_reference_layout`` :index:`: ` [string=''] 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 - file is available. - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Not fitted components are crossed. - +- **options** :index:`: ` [:ref:`HPGL_SCH_PrintOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `hpgl_sch_print` output. - **type** :index:`: ` 'hpgl_sch_print' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + HPGL_SCH_PrintOptions diff --git a/docs/source/configuration/outputs/ibom.rst b/docs/source/configuration/outputs/ibom.rst index 3caa3e7e6..971c25988 100644 --- a/docs/source/configuration/outputs/ibom.rst +++ b/docs/source/configuration/outputs/ibom.rst @@ -16,96 +16,33 @@ Categories: **Schematic/BoM**, **PCB/fabrication/assembly** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `ibom` output. - - - Valid keys: - - - **board_rotation** :index:`: ` [number=0] Board rotation in degrees (-180 to 180). Will be rounded to multiple of 5. - - **bom_view** :index:`: ` [string='left-right'] [bom-only,left-right,top-bottom] Default BOM view. - - **extra_fields** :index:`: ` [string=''] Comma separated list of extra fields to pull from netlist or xml file. - Using 'X,Y' is a shortcut for `show_fields` and `group_fields` with values 'Value,Footprint,X,Y'. - - **include_tracks** :index:`: ` [boolean=false] Include track/zone information in output. F.Cu and B.Cu layers only. - - **layer_view** :index:`: ` [string='FB'] [F,FB,B] Default layer view. - - **normalize_field_case** :index:`: ` [boolean=false] Normalize extra field name case. E.g. 'MPN' and 'mpn' will be considered the same field. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output, use '' to use the IBoM filename (%i=ibom, %x=html). Affected by global options. - - **show_fields** :index:`: ` [string=''] Comma separated list of fields to show in the BOM. - Value and Footprint are displayed when nothing is specified. - - ``blacklist`` :index:`: ` [string=''] List of comma separated blacklisted components or prefixes with *. E.g. 'X1,MH*'. - IBoM option, avoid using in conjunction with KiBot variants/filters. - - ``blacklist_empty_val`` :index:`: ` [boolean=false] Blacklist components with empty value. - IBoM option, avoid using in conjunction with KiBot variants/filters. - - ``checkboxes`` :index:`: ` [string='Sourced,Placed'] Comma separated list of checkbox columns. - - ``dark_mode`` :index:`: ` [boolean=false] Default to dark mode. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - Avoid using it in conjunction with IBoM native filtering options. - - - ``dnp_field`` :index:`: ` [string=''] Name of the extra field that indicates do not populate status. - Components with this field not empty will be blacklisted. - IBoM option, avoid using in conjunction with KiBot variants/filters. - - ``extra_data_file`` :index:`: ` [string=''] Path to netlist or xml file. You can use '%F.xml' to avoid specifying the project name. - Leave it blank for most uses, data will be extracted from the PCB. - - ``forced_name`` :index:`: ` [string=''] Name to be used for the PCB/project (no file extension). - This will affect the name iBoM displays in the generated HTML. - - ``group_fields`` :index:`: ` [string=''] Comma separated list of fields that components will be grouped by. - Value and Footprint are used when nothing is specified. - - ``hide_excluded`` :index:`: ` [boolean=false] Hide components in the Fab layer that are marked as excluded by a variant. - Affected by global options. - - ``hide_pads`` :index:`: ` [boolean=false] Hide footprint pads by default. - - ``hide_silkscreen`` :index:`: ` [boolean=false] Hide silkscreen by default. - - ``highlight_pin1`` :index:`: ` [boolean|none,all,selected] Highlight pin1 by default. - - ``include_nets`` :index:`: ` [boolean=false] Include netlist information in output.. - - ``name_format`` :index:`: ` [string='ibom'] Output file name format supports substitutions: - %f : original pcb file name without extension. - %p : pcb/project title from pcb metadata. - %c : company from pcb metadata. - %r : revision from pcb metadata. - %d : pcb date from metadata if available, file modification date otherwise. - %D : bom generation date. - %T : bom generation time. - Extension .html will be added automatically. - Note that this name is used only when output is ''. - - *netlist_file* :index:`: ` Alias for extra_data_file. - - ``no_blacklist_virtual`` :index:`: ` [boolean=false] Do not blacklist virtual components. - IBoM option, avoid using in conjunction with KiBot variants/filters. - - ``no_compression`` :index:`: ` [boolean=false] Disable compression of pcb data. - - ``no_redraw_on_drag`` :index:`: ` [boolean=false] Do not redraw pcb on drag by default. - - ``offset_back_rotation`` :index:`: ` [boolean=false] Offset the back of the pcb by 180 degrees. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``show_fabrication`` :index:`: ` [boolean=false] Show fabrication layer by default. - - ``sort_order`` :index:`: ` [string='C,R,L,D,U,Y,X,F,SW,A,~,HS,CNN,J,P,NT,MH'] Default sort order for components. Must contain '~' once. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Avoid using it in conjunction with IBoM native filtering options. - - ``variant_field`` :index:`: ` [string=''] Name of the extra field that stores board variant for component. - IBoM option, avoid using in conjunction with KiBot variants/filters. - - ``variants_blacklist`` :index:`: ` [string=''] List of board variants to exclude from the BOM. - IBoM option, avoid using in conjunction with KiBot variants/filters. - - ``variants_whitelist`` :index:`: ` [string=''] List of board variants to include in the BOM. - IBoM option, avoid using in conjunction with KiBot variants/filters. - +- **options** :index:`: ` [:ref:`IBoMOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `ibom` output. - **type** :index:`: ` 'ibom' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + IBoMOptions diff --git a/docs/source/configuration/outputs/info.rst b/docs/source/configuration/outputs/info.rst index af632fb81..39761e404 100644 --- a/docs/source/configuration/outputs/info.rst +++ b/docs/source/configuration/outputs/info.rst @@ -17,35 +17,33 @@ Categories: **PCB/docs**, **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `info` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=info, %x=txt). Affected by global options. - - ``environment`` :index:`: ` [string='names'] [names,none,full] List environment variables. - IMPORTANT: Don't use `full` unless you know you are not leaking sensitive information. - +- **options** :index:`: ` [:ref:`InfoOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `info` output. - **type** :index:`: ` 'info' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + InfoOptions diff --git a/docs/source/configuration/outputs/kibom.rst b/docs/source/configuration/outputs/kibom.rst index f9972ec3c..5b99153cf 100644 --- a/docs/source/configuration/outputs/kibom.rst +++ b/docs/source/configuration/outputs/kibom.rst @@ -18,134 +18,33 @@ Type: ``kibom`` Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `kibom` output. - - - Valid keys: - - - **format** :index:`: ` [string='HTML'] [HTML,CSV,XML,XLSX] Format for the BoM. - - **number** :index:`: ` [number=1] Number of boards to build (components multiplier). - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=bom). Affected by global options. - - ``conf`` :index:`: ` [string|dict] BoM configuration file, relative to PCB. Environment variables and ~ allowed. - You can also define the configuration here, will be stored in `config.kibom.ini`. - - - Valid keys: - - - **columns** :index:`: ` [list(dict)|list(string)] List of columns to display. - Can be just the name of the field. - - - Valid keys: - - - **field** :index:`: ` [string=''] Name of the field to use for this column. - Use `_field_lcsc_part` to get the value defined in the global options. - - **name** :index:`: ` [string=''] Name to display in the header. The field is used when empty. - - ``join`` :index:`: ` [list(string)|string=''] List of fields to join to this column. - - - - **fit_field** :index:`: ` [string='Config'] Field name used to determine if a particular part is to be fitted (also DNC and variants). - - **group_fields** :index:`: ` [list(string)] List of fields used for sorting individual components into groups. - Components which match (comparing *all* fields) will be grouped together. - Field names are case-insensitive. - If empty: ['Part', 'Part Lib', 'Value', 'Footprint', 'Footprint Lib'] is used. - - - **ignore_dnf** :index:`: ` [boolean=true] Exclude DNF (Do Not Fit) components. - - **number_rows** :index:`: ` [boolean=true] First column is the row number. - - ``component_aliases`` :index:`: ` [list(list(string))] A series of values which are considered to be equivalent for the part name. - Each entry is a list of equivalen names. Example: ['c', 'c_small', 'cap' ] - will ensure the equivalent capacitor symbols can be grouped together. - If empty the following aliases are used: - - - ['r', 'r_small', 'res', 'resistor'] - - ['l', 'l_small', 'inductor'] - - ['c', 'c_small', 'cap', 'capacitor'] - - ['sw', 'switch'] - - ['zener', 'zenersmall'] - - ['d', 'diode', 'd_small']. - - - ``datasheet_as_link`` :index:`: ` [string=''] Column with links to the datasheet (HTML only). - - ``digikey_link`` :index:`: ` [string|list(string)=''] Column/s containing Digi-Key part numbers, will be linked to web page (HTML only). - - - ``exclude_any`` :index:`: ` [list(dict)] A series of regular expressions used to exclude parts. - If a component matches ANY of these, it will be excluded. - Column names are case-insensitive. - If empty the following list is used: - - - column: References |br| - regex: '^TP[0-9]*' - - column: References |br| - regex: '^FID' - - column: Part |br| - regex: 'mount.*hole' - - column: Part |br| - regex: 'solder.*bridge' - - column: Part |br| - regex: 'test.*point' - - column: Footprint |br| - regex 'test.*point' - - column: Footprint |br| - regex: 'mount.*hole' - - column: Footprint |br| - regex: 'fiducial'. - - - Valid keys: - - - ``column`` :index:`: ` [string=''] Name of the column to apply the regular expression. - Use `_field_lcsc_part` to get the value defined in the global options. - - *field* :index:`: ` Alias for column. - - ``regex`` :index:`: ` [string=''] Regular expression to match. - - *regexp* :index:`: ` Alias for regex. - - - ``group_connectors`` :index:`: ` [boolean=true] Connectors with the same footprints will be grouped together, independent of the name of the connector. - - ``hide_headers`` :index:`: ` [boolean=false] Hide column headers. - - ``hide_pcb_info`` :index:`: ` [boolean=false] Hide project information. - - ``html_generate_dnf`` :index:`: ` [boolean=true] Generate a separated section for DNF (Do Not Fit) components (HTML only). - - ``include_only`` :index:`: ` [list(dict)] A series of regular expressions used to select included parts. - If there are any regex defined here, only components that match against ANY of them will be included. - Column names are case-insensitive. - If empty all the components are included. - - - Valid keys: - - - ``column`` :index:`: ` [string=''] Name of the column to apply the regular expression. - Use `_field_lcsc_part` to get the value defined in the global options. - - *field* :index:`: ` Alias for column. - - ``regex`` :index:`: ` [string=''] Regular expression to match. - - *regexp* :index:`: ` Alias for regex. - - - ``merge_blank_fields`` :index:`: ` [boolean=true] Component groups with blank fields will be merged into the most compatible group, where possible. - - ``mouser_link`` :index:`: ` [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page (HTML only). - - - ``ref_separator`` :index:`: ` [string=' '] Separator used for the list of references. - - ``test_regex`` :index:`: ` [boolean=true] Each component group will be tested against a number of regular-expressions. - - ``use_alt`` :index:`: ` [boolean=false] Print grouped references in the alternate compressed style eg: R1-R7,R18. - - - ``separator`` :index:`: ` [string=','] CSV Separator. - - ``variant`` :index:`: ` [string=''] Board variant(s), used to determine which components - are output to the BoM. To specify multiple variants, - with a BOM file exported for each variant, separate - variants with the ';' (semicolon) character. - This isn't related to the KiBot concept of variants. - +- **options** :index:`: ` [:ref:`KiBoMOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `kibom` output. - **type** :index:`: ` 'kibom' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + KiBoMOptions diff --git a/docs/source/configuration/outputs/kicanvas.rst b/docs/source/configuration/outputs/kicanvas.rst index 36fed3fbe..824228121 100644 --- a/docs/source/configuration/outputs/kicanvas.rst +++ b/docs/source/configuration/outputs/kicanvas.rst @@ -20,48 +20,34 @@ Categories: **PCB/docs**, **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the KiCanvas output. - - - Valid keys: - - - **local_script** :index:`: ` [boolean=true] Download the script and use a copy. - - **source** :index:`: ` [string|list(string)] [schematic,pcb,project] Source to display. - - ``controls`` :index:`: ` [string='full'] [full,basic,none] Which controls are displayed. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``download`` :index:`: ` [boolean=true] Show the download button. - - ``overlay`` :index:`: ` [boolean=true] Show the overlay asking to click. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``url_script`` :index:`: ` URL for the KiCanvas script. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - -- **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=kicanvas, %x=html). Affected by global options. +- **options** :index:`: ` [:ref:`KiCanvasOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the KiCanvas output. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Filename for the output (%i=kicanvas, %x=html). Affected by global options. - **type** :index:`: ` 'kicanvas' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + KiCanvasOptions diff --git a/docs/source/configuration/outputs/kicost.rst b/docs/source/configuration/outputs/kicost.rst index bdadd16c3..051c618f8 100644 --- a/docs/source/configuration/outputs/kicost.rst +++ b/docs/source/configuration/outputs/kicost.rst @@ -16,79 +16,33 @@ Type: ``kicost`` Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `kicost` output. - - - Valid keys: - - - *board_qty* :index:`: ` Alias for number. - - **currency** :index:`: ` [string|list(string)=USD] Currency priority. Use ISO4217 codes (i.e. USD, EUR). - - - **distributors** :index:`: ` [string|list(string)] Include this distributors list. Default is all the available. - - - **no_distributors** :index:`: ` [string|list(string)] Exclude this distributors list. They are removed after computing `distributors`. - - - **no_price** :index:`: ` [boolean=false] Do not look for components price. For testing purposes. - - **number** :index:`: ` [number=100] Number of boards to build (components multiplier). - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=kicost, %x=xlsx). Affected by global options. - - ``aggregate`` :index:`: ` [list(dict)] Add components from other projects. - - - Valid keys: - - - *board_qty* :index:`: ` Alias for number. - - **file** :index:`: ` [string=''] Name of the XML to aggregate. - - **number** :index:`: ` [number=100] Number of boards to build (components multiplier). - - ``variant`` :index:`: ` [string=' '] Variant for this project. - - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - Don't use the `kicost_variant` when using internal variants/filters. - - - ``fields`` :index:`: ` [string|list(string)] List of fields to be added to the global data section. - - - ``group_fields`` :index:`: ` [string|list(string)] List of fields that can be different for a group. - Parts with differences in these fields are grouped together, but displayed individually. - - - ``ignore_fields`` :index:`: ` [string|list(string)] List of fields to be ignored. - - - ``kicost_variant`` :index:`: ` [string=''] Regular expression to match the variant field (KiCost option, not internal variants). - - ``no_collapse`` :index:`: ` [boolean=false] Do not collapse the part references (collapse=R1-R4). - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``show_cat_url`` :index:`: ` [boolean=false] Include the catalogue links in the catalogue code. - - ``split_extra_fields`` :index:`: ` [string|list(string)] Declare part fields to include in multipart split process. - - - ``translate_fields`` :index:`: ` [list(dict)] Fields to rename (KiCost option, not internal filters). - - - Valid keys: - - - ``field`` :index:`: ` [string=''] Name of the field to rename. - - ``name`` :index:`: ` [string=''] New name. - - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Don't use the `kicost_variant` when using internal variants/filters. - +- **options** :index:`: ` [:ref:`KiCostOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `kicost` output. - **type** :index:`: ` 'kicost' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + KiCostOptions diff --git a/docs/source/configuration/outputs/kikit_present.rst b/docs/source/configuration/outputs/kikit_present.rst index e246ff815..d8f3b08fe 100644 --- a/docs/source/configuration/outputs/kikit_present.rst +++ b/docs/source/configuration/outputs/kikit_present.rst @@ -16,94 +16,33 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `kikit_present` output. - - - Valid keys: - - - **description** :index:`: ` [string=''] Name for a markdown file containing the main part of the page to be generated. - This is mandatory and is the description of your project. - You can embed the markdown code. If the text doesn't map to a file and contains - more than one line KiBot will assume this is the markdown. - - ``boards`` :index:`: ` [dict|list(dict)] One or more boards that compose your project. - When empty we will use only the main PCB for the current project. - - - Valid keys: - - - **name** :index:`: ` [string=''] Name for this board. If empty we use the name of the PCB. - Applies to all modes. - - ``back_image`` :index:`: ` [string=''] How to obtain the back view of the PCB. - *local*: the name of an output to render it. - If empty we use the first renderer. - *file*: the name of the rendered image. - *external*: ignored, we use `extrenal_config`. - - ``comment`` :index:`: ` [string=''] A comment or description for this board. - Applies to all modes. - - ``external_config`` :index:`: ` [string=''] Name of an external KiBot configuration. - Only used in the *external* mode. - - ``front_image`` :index:`: ` [string=''] How to obtain the front view of the PCB. - *local*: the name of an output to render it. - If empty we use the first renderer. - *file*: the name of the rendered image. - *external*: ignored, we use `extrenal_config`. - - ``gerbers`` :index:`: ` [string=''] How to obtain an archive with the gerbers. - *local*: the name of a `gerber` output. - If empty we use the first `gerber` output. - *file*: the name of a compressed archive. - *external*: ignored, we use `extrenal_config`. - - ``mode`` :index:`: ` [string='local'] [local,file,external] How images and gerbers are obtained. - *local*: Only applies to the currently selected PCB. - You must provide the names of the outputs used to render - the images and compress the gerbers. - When empty KiBot will use the first render/gerber output - it finds. - To apply variants use `pcb_from_output` and a `pcb_variant` - output. - *file*: You must specify the file names used for the images and - the gerbers. - *external*: You must specify an external KiBot configuration. - It will be applied to the selected PCB to create the images and - the gerbers. The front image must be generated in a dir called - *front*, the back image in a dir called *back* and the gerbers - in a dir called *gerbers*. - - ``pcb_file`` :index:`: ` [string=''] Name of the KiCad PCB file. When empty we use the current PCB. - Is ignored for the *local* mode. - - ``pcb_from_output`` :index:`: ` [string=''] Use the PCB generated by another output. - Is ignored for the *file* mode. - - - ``name`` :index:`: ` [string=''] Name of the project. Will be passed to the template. - If empty we use the name of the KiCad project. - The default template uses it for things like the page title. - - ``repository`` :index:`: ` [string=''] URL of the repository. Will be passed to the template. - If empty we will try to find it using `git remote get-url origin`. - The default template uses it to create an URL for the current commit. - - ``resources`` :index:`: ` [string|list(string)=''] A list of file name patterns for additional resources to be included. - I.e. images referenced in description. - They will be copied relative to the output dir. - - - ``template`` :index:`: ` [string='default'] Path to a template directory or a name of built-in one. - See KiKit's doc/present.md for template specification. - +- **options** :index:`: ` [:ref:`KiKit_PresentOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `kikit_present` output. - **type** :index:`: ` 'kikit_present' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + KiKit_PresentOptions diff --git a/docs/source/configuration/outputs/kiri.rst b/docs/source/configuration/outputs/kiri.rst index 17416c535..58bc96628 100644 --- a/docs/source/configuration/outputs/kiri.rst +++ b/docs/source/configuration/outputs/kiri.rst @@ -22,63 +22,37 @@ Categories: **PCB/docs**, **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **layers** :index:`: ` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to use. When empty all available layers are used. +- **layers** :index:`: ` [:ref:`Layer parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string) List + of PCB layers to use. When empty all available layers are used. Note that if you want to support adding/removing layers you should specify a list here. - - - Valid keys: - - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `diff` output. - - - Valid keys: - - - **color_theme** :index:`: ` [string='_builtin_classic'] Selects the color theme. Only applies to KiCad 6. - To use the KiCad 6 default colors select `_builtin_default`. - Usually user colors are stored as `user`, but you can give it another name. - - **keep_generated** :index:`: ` [boolean=false] Avoid PCB and SCH images regeneration. Useful for incremental usage. - - ``background_color`` :index:`: ` [string='#FFFFFF'] Color used for the background of the diff canvas. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``max_commits`` :index:`: ` [number=0] Maximum number of commits to include. Use 0 for all available commits. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``revision`` :index:`: ` [string='HEAD'] Starting point for the commits, can be a branch, a hash, etc. - Note that this can be a revision-range, consult the gitrevisions manual for more information. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - - ``zones`` :index:`: ` [string='global'] [global,fill,unfill,none] How to handle PCB zones. The default is *global* and means that we - fill zones if the *check_zone_fills* preflight is enabled. The *fill* option always forces - a refill, *unfill* forces a zone removal and *none* lets the zones unchanged. - Be careful with the *keep_generated* option when changing this setting. - +- **options** :index:`: ` [:ref:`KiRiOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `diff` output. - **type** :index:`: ` 'kiri' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + KiRiOptions + Layer diff --git a/docs/source/configuration/outputs/navigate_results.rst b/docs/source/configuration/outputs/navigate_results.rst index 647f2436a..3896e6746 100644 --- a/docs/source/configuration/outputs/navigate_results.rst +++ b/docs/source/configuration/outputs/navigate_results.rst @@ -14,47 +14,33 @@ Type: ``navigate_results`` Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `navigate_results` output. - - - Valid keys: - - - **link_from_root** :index:`: ` [string=''] The name of a file to create at the main output directory linking to the home page. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=html, %x=navigate). Affected by global options. - - ``header`` :index:`: ` [boolean=true] Add a header containing information for the project. - - ``logo`` :index:`: ` [string|boolean=''] PNG file to use as logo, use false to remove. - The KiBot logo is used by default. - - - ``logo_url`` :index:`: ` [string='https://github.com/INTI-CMNB/KiBot/'] Target link when clicking the logo. - - ``nav_bar`` :index:`: ` [boolean=true] Add a side navigation bar to quickly access to the outputs. - - ``skip_not_run`` :index:`: ` [boolean=false] Skip outputs with `run_by_default: false`. - - ``title`` :index:`: ` [string=''] Title for the page, when empty KiBot will try using the schematic or PCB title. - If they are empty the name of the project, schematic or PCB file is used. - You can use %X values and KiCad variables here. - - ``title_url`` :index:`: ` [string|boolean=''] Target link when clicking the title, use false to remove. - KiBot will try with the origin of the current git repo when empty. - - +- **options** :index:`: ` [:ref:`Navigate_ResultsOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `navigate_results` output. - **type** :index:`: ` 'navigate_results' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=10] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``10``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Navigate_ResultsOptions diff --git a/docs/source/configuration/outputs/netlist.rst b/docs/source/configuration/outputs/netlist.rst index 1bd59c9c8..dabf02868 100644 --- a/docs/source/configuration/outputs/netlist.rst +++ b/docs/source/configuration/outputs/netlist.rst @@ -15,44 +15,33 @@ Type: ``netlist`` Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `netlist` output. - - - Valid keys: - - - **format** :index:`: ` [string='classic'] [classic,ipc] The `classic` format is the KiCad internal format, and is generated - from the schematic. The `ipc` format is the IPC-D-356 format, useful for PCB - testing, is generated from the PCB. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=netlist/IPC-D-356, %x=net/d356). Affected by global options. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Used for sub-PCBs. - +- **options** :index:`: ` [:ref:`NetlistOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `netlist` output. - **type** :index:`: ` 'netlist' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + NetlistOptions diff --git a/docs/source/configuration/outputs/panelize.rst b/docs/source/configuration/outputs/panelize.rst index e2d03d32a..34e532f30 100644 --- a/docs/source/configuration/outputs/panelize.rst +++ b/docs/source/configuration/outputs/panelize.rst @@ -23,430 +23,33 @@ Category: **PCB/fabrication** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `Panelize` output. - - - Valid keys: - - - **configs** :index:`: ` [list(dict)|list(string)|string] One or more configurations used to create the panel. - Use a string to include an external configuration, i.e. `myDefault.json`. - You can also include a preset using `:name`, i.e. `:vcuts`. - Use a dict to specify the options using the KiBot YAML file. - - - Valid keys: - - - **cuts** :index:`: ` [dict] Specify how to perform the cuts on the tabs separating the board. - - - Valid keys: - - - **type** :index:`: ` [string='none'] [none,mousebites,vcuts,layer,plugin] Layer: When KiKit reports it cannot perform cuts, you can render the cuts - into a layer with this option to understand what's going on. Shouldn't be used for the final design. - - ``arg`` :index:`: ` [string=''] Argument to pass to the plugin. Used for *plugin*. - - ``clearance`` :index:`: ` [number|string] Specify clearance for copper around V-cuts. - - ``code`` :index:`: ` [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. - - *cut_curves* :index:`: ` Alias for cutcurves. - - ``cutcurves`` :index:`: ` [boolean=false] Specify if curves should be approximated by straight cuts (e.g., for cutting tabs on circular boards). - Used for *vcuts*. - - ``drill`` :index:`: ` [number|string] Drill size used for the *mousebites*. - - *end_prolongation* :index:`: ` Alias for endprolongation. - - ``endprolongation`` :index:`: ` [number|string] Prolongation on the end of V-CUT without text. - - ``layer`` :index:`: ` [string='Cmts.User'] Specify the layer to render V-cuts on. Also used for the *layer* type. - - *line_width* :index:`: ` Alias for linewidth. - - ``linewidth`` :index:`: ` [number|string] Line width to plot cuts with. - - ``offset`` :index:`: ` [number|string] Specify the *mousebites* and *vcuts* offset, positive offset puts the cuts into the board, - negative puts the cuts into the tabs. - - ``prolong`` :index:`: ` [number|string] Distance for tangential prolongation of the cuts (to cut through the internal corner fillets - caused by milling). Used for *mousebites* and *layer*. - - ``spacing`` :index:`: ` [number|string] The spacing of the holes used for the *mousebites*. - - ``template`` :index:`: ` [string='V-CUT'] Text template for the V-CUT. - - *text_offset* :index:`: ` Alias for textoffset. - - *text_prolongation* :index:`: ` Alias for textprolongation. - - *text_size* :index:`: ` Alias for textsize. - - *text_thickness* :index:`: ` Alias for textthickness. - - ``textoffset`` :index:`: ` [number|string] Text offset from the V-CUT. - - ``textprolongation`` :index:`: ` [number|string] Prolongation of the text size of V-CUT. - - ``textsize`` :index:`: ` [number|string] Text size for vcuts. - - ``textthickness`` :index:`: ` [number|string] Text thickness for width. - - - **fiducials** :index:`: ` [dict] Used to add fiducial marks to the (rail/frame of) the panel. - - - Valid keys: - - - **type** :index:`: ` [string='none'] [none,3fid,4fid,plugin] Add none, 3 or 4 fiducials to the (rail/frame of) the panel. - - *copper_size* :index:`: ` Alias for coppersize. - - ``coppersize`` :index:`: ` [number|string] Diameter of the copper spot. - - ``hoffset`` :index:`: ` [number|string] Horizontal offset from panel edges. - - ``opening`` :index:`: ` [number|string] Diameter of the solder mask opening. - - ``paste`` :index:`: ` [boolean=false] Include the fiducials in the paste layer (therefore they appear on the stencil). - - ``voffset`` :index:`: ` [number|string] Vertical offset from panel edges. - - - **framing** :index:`: ` [dict] Specify the frame around the boards. - - - Valid keys: - - - **type** :index:`: ` [string='none'] [none,railstb,railslr,frame,tightframe,plugin] Railstb: Add rails on top and bottom. - Railslr: Add rails on left and right. - Frame: Add a frame around the board. - Tighframe: Add a frame around the board which fills the whole area of the panel - - the boards have just a milled slot around their perimeter. - Plugin: Uses an external python function, only `code` and `arg` are relevant. - - ``arg`` :index:`: ` [string=''] Argument to pass to the plugin. Used for *plugin*. - - ``chamfer`` :index:`: ` [number|string] Specify the size of chamfer frame corners. You can also separately specify `chamferwidth` - and `chamferheight` to create a non 45 degrees chamfer. - - *chamfer_height* :index:`: ` Alias for chamferheight. - - *chamfer_width* :index:`: ` Alias for chamferwidth. - - ``chamferheight`` :index:`: ` [number|string] Height of the chamfer frame corners, used for non 45 degrees chamfer. - - ``chamferwidth`` :index:`: ` [number|string] Width of the chamfer frame corners, used for non 45 degrees chamfer. - - ``code`` :index:`: ` [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. - - ``cuts`` :index:`: ` [string='both'] [none,both,v,h] Specify whether to add cuts to the corners of the frame for easy removal. - Used for *frame*. - - ``fillet`` :index:`: ` [number|string] Specify radius of fillet frame corners. - - ``hspace`` :index:`: ` [number|string] Specify the horizontal space between PCB and the frame/rail. - - *max_total_height* :index:`: ` Alias for maxtotalheight. - - *max_total_width* :index:`: ` Alias for maxtotalwidth. - - ``maxtotalheight`` :index:`: ` [number|string] Maximal height of the panel. - - ``maxtotalwidth`` :index:`: ` [number|string] Maximal width of the panel. - - *min_total_height* :index:`: ` Alias for mintotalheight. - - *min_total_width* :index:`: ` Alias for mintotalwidth. - - ``mintotalheight`` :index:`: ` [number|string] If needed, add extra material to the rail or frame to meet the minimal requested size. - Useful for services that require minimal panel size. - - ``mintotalwidth`` :index:`: ` [number|string] If needed, add extra material to the rail or frame to meet the minimal requested size. - Useful for services that require minimal panel size. - - *slot_width* :index:`: ` Alias for slotwidth. - - ``slotwidth`` :index:`: ` [number|string] Width of the milled slot for *tightframe*. - - ``space`` :index:`: ` [number|string] Specify the space between PCB and the frame/rail. Overrides `hspace` and `vspace`. - - ``vspace`` :index:`: ` [number|string] Specify the vertical space between PCB and the frame/rail. - - ``width`` :index:`: ` [number|string] Specify with of the rails or frame. - - - **layout** :index:`: ` [dict] Layout used for the panel. - - - Valid keys: - - - **cols** :index:`: ` [number=1] Specify the number of columns of boards in the grid pattern. - - **rows** :index:`: ` [number=1] Specify the number of rows of boards in the grid pattern. - - ``alternation`` :index:`: ` [string='none'] [none,rows,cols,rowsCols] Specify alternations of board rotation. - none: Do not alternate. - rows: Rotate boards by 180Ā° on every next row. - cols: Rotate boards by 180Ā° on every next column. - rowsCols: Rotate boards by 180Ā° based on a chessboard pattern. - - ``arg`` :index:`: ` [string=''] Argument to pass to the plugin. Used for *plugin*. - - *bake_text* :index:`: ` Alias for baketext. - - ``baketext`` :index:`: ` [boolean=true] A flag that indicates if text variables should be substituted or not. - - ``code`` :index:`: ` [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. - - *h_back_bone* :index:`: ` Alias for hbackbone. - - *h_bone_cut* :index:`: ` Alias for hbonecut. - - *h_bone_first* :index:`: ` Alias for hbonefirst. - - *h_bone_skip* :index:`: ` Alias for hboneskip. - - ``hbackbone`` :index:`: ` [number|string] The width of horizontal backbone (0 means no backbone). The backbone does not increase the - spacing of the boards. - - ``hbonecut`` :index:`: ` [boolean=true] If there are both backbones specified, specifies if there should be a horizontal cut where the backbones - cross. - - ``hbonefirst`` :index:`: ` [number=0] Specify first horizontal backbone to render. - - ``hboneskip`` :index:`: ` [number=0] Skip every n horizontal backbones. I.e., 1 means place only every other backbone. - - ``hspace`` :index:`: ` [number|string] Specify the horizontal gap between the boards. - - *rename_net* :index:`: ` Alias for renamenet. - - *rename_ref* :index:`: ` Alias for renameref. - - ``renamenet`` :index:`: ` [string='Board_{n}-{orig}'] A pattern by which to rename the nets. You can use {n} and {orig} to get the board number and original name. - - ``renameref`` :index:`: ` [string='{orig}'] A pattern by which to rename the references. You can use {n} and {orig} to get the board number and original - name. - - ``rotation`` :index:`: ` [number|string] Rotate the boards before placing them in the panel. - - ``space`` :index:`: ` [number|string] Specify the gap between the boards, overwrites `hspace` and `vspace`. - - ``type`` :index:`: ` [string='grid'] [grid,plugin] In the plugin type only `code` and `arg` are relevant. - - *v_back_bone* :index:`: ` Alias for vbackbone. - - *v_bone_cut* :index:`: ` Alias for vbonecut. - - *v_bone_first* :index:`: ` Alias for vbonefirst. - - *v_bone_skip* :index:`: ` Alias for vboneskip. - - ``vbackbone`` :index:`: ` [number|string] The width of vertical backbone (0 means no backbone). The backbone does not increase the - spacing of the boards. - - ``vbonecut`` :index:`: ` [boolean=true] If there are both backbones specified, specifies if there should be a vertical cut where the backbones - cross. - - ``vbonefirst`` :index:`: ` [number=0] Specify first vertical backbone to render. - - ``vboneskip`` :index:`: ` [number=0] Skip every n vertical backbones. I.e., 1 means place only every other backbone. - - ``vspace`` :index:`: ` [number|string] Specify the vertical gap between the boards. - - - **page** :index:`: ` [dict] Sets page size on the resulting panel and position the panel in the page. - - - Valid keys: - - - *page_size* :index:`: ` Alias for type. - - *size* :index:`: ` Alias for type. - - **type** :index:`: ` [string='inherit'] [inherit,custom,A0,A1,A2,A3,A4,A5,A,B,C,D,E,USLetter,USLegal,USLedger,A0-portrait,A1-portrait,A2-portrait, - A3-portrait,A4-portrait,A5-portrait,A-portrait,B-portrait,C-portrait,D-portrait,E-portrait, - USLetter-portrait,USLegal-portrait,USLedger-portrait] Paper size. The default `inherit` option inherits - paper size from the source board. This feature is not supported on KiCAD 5. - - ``anchor`` :index:`: ` [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Point of the panel to be placed at given position. Can be one of tl, tr, bl, br - (corners), mt, mb, ml, mr (middle of sides), c (center). The anchors refer to the panel outline. - - ``height`` :index:`: ` [number|string] Height for the `custom` paper size. - - *pos_x* :index:`: ` Alias for posx. - - *pos_y* :index:`: ` Alias for posy. - - ``posx`` :index:`: ` [number|string] The X position of the panel on the page. Can be expressed as a page size percentage. - - ``posy`` :index:`: ` [number|string] The Y position of the panel on the page. Can be expressed as a page size percentage. - - ``width`` :index:`: ` [number|string] Width for the `custom` paper size. - - - **tabs** :index:`: ` [dict] Style of the tabs used to join the PCB copies. - - - Valid keys: - - - **type** :index:`: ` [string='spacing'] [fixed,spacing,full,annotation,plugin] Fixed: Place given number of tabs on the PCB edge. - Spacing: Place tabs on the PCB edges based on spacing. - Full: Create tabs that are full width of the PCB. - Corner: Create tabs in the corners of the PCB. - Annotation: Add tabs based on PCB annotations. - Plugin: Uses an external python function, only `code` and `arg` are relevant. - - ``arg`` :index:`: ` [string=''] Argument to pass to the plugin. Used for *plugin*. - - ``code`` :index:`: ` [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. - - ``cutout`` :index:`: ` [number|string] When your design features open pockets on the side, this parameter specifies extra cutout - depth in order to ensure that a sharp corner of the pocket can be milled. Used for *full*. - - ``hcount`` :index:`: ` [number=1] Number of tabs in the horizontal direction. Used for *fixed*. - - ``hwidth`` :index:`: ` [number|string] The width of tabs in the horizontal direction. Used for *fixed* and *spacing*. - - *min_distance* :index:`: ` Alias for mindistance. - - ``mindistance`` :index:`: ` [number|string] Minimal spacing between the tabs. If there are too many tabs, their count is reduced. - Used for *fixed*. - - *patch_corners* :index:`: ` Alias for patchcorners. - - ``patchcorners`` :index:`: ` [boolean=true] The full tabs are appended to the nearest flat face of the PCB. If the PCB has sharp corners, you want to - add patches of substrate to these corners. However, if the PCB has fillet or miter, you don't want to - apply the patches. - - ``spacing`` :index:`: ` [number|string] The maximum spacing of the tabs. Used for *spacing*. - - *tab_footprints* :index:`: ` Alias for tabfootprints. - - ``tabfootprints`` :index:`: ` [string='kikit:Tab'] The footprint/s used for the *annotation* type. You can specify a list of footprints separated by comma. - - ``vcount`` :index:`: ` [number=1] Number of tabs in the vertical direction. Used for *fixed*. - - ``vwidth`` :index:`: ` [number|string] The width of tabs in the vertical direction. Used for *fixed* and *spacing*. - - ``width`` :index:`: ` [number|string] The width of tabs in both directions. Overrides both `vwidth` and `hwidth`. - Used for *fixed*, *spacing*, *corner* and *annotation*. - - - **tooling** :index:`: ` [dict] Used to add tooling holes to the (rail/frame of) the panel. - - - Valid keys: - - - **type** :index:`: ` [string='none'] [none,3hole,4hole,plugin] Add none, 3 or 4 holes to the (rail/frame of) the panel. - - ``arg`` :index:`: ` [string=''] Argument to pass to the plugin. Used for *plugin*. - - ``code`` :index:`: ` [string=''] Plugin specification (PACKAGE.FUNCTION or PYTHON_FILE.FUNCTION). Used for *plugin*. - - ``hoffset`` :index:`: ` [number|string] Horizontal offset from panel edges. - - ``paste`` :index:`: ` [boolean=false] If True, the holes are included in the paste layer (therefore they appear on the stencil). - - ``size`` :index:`: ` [number|string] Diameter of the holes. - - *solder_mask_margin* :index:`: ` Alias for soldermaskmargin. - - ``soldermaskmargin`` :index:`: ` [number|string] Solder mask expansion/margin. Use 1.3mm for JLCPCB. - - ``voffset`` :index:`: ` [number|string] Vertical offset from panel edges. - - - ``copperfill`` :index:`: ` [dict] Fill non-board areas of the panel with copper. - - - Valid keys: - - - **type** :index:`: ` [string='none'] [none,solid,hatched,hex] How to fill non-board areas of the panel with copper. - - ``clearance`` :index:`: ` [number|string] Extra clearance from the board perimeters. Suitable for, e.g., not filling the tabs with - copper. - - ``diameter`` :index:`: ` [number|string] Diameter of hexagons. - - *edge_clearance* :index:`: ` Alias for edgeclearance. - - ``edgeclearance`` :index:`: ` [number|string] Specifies clearance between the fill and panel perimeter. - - ``layers`` :index:`: ` [string|list(string)] List of layers to fill. Can be a comma-separated string. - Using *all* means all external copper layers. - - ``orientation`` :index:`: ` [number|string] The orientation of the hatched strokes. - - ``spacing`` :index:`: ` [number|string] The space between the hatched strokes or hexagons. - - ``threshold`` :index:`: ` [number=15] Remove fragments smaller than threshold. Expressed as a percentage. - - ``width`` :index:`: ` [number|string] The width of the hatched strokes. - - - ``debug`` :index:`: ` [dict] Debug options. - - - Valid keys: - - - ``deterministic`` :index:`: ` [boolean=false] Deterministic. - - ``drawBackboneLines`` :index:`: ` [boolean=false] Draw backbone lines. - - ``drawPartitionLines`` :index:`: ` [boolean=false] Draw partition lines. - - ``drawboxes`` :index:`: ` [boolean=false] Draw boxes. - - ``drawtabfail`` :index:`: ` [boolean=false] Draw tab fail. - - ``trace`` :index:`: ` [boolean=false] Trace. - - - ``expand_text`` :index:`: ` [boolean=true] Expand text variables and KiBot %X markers in text objects. - - ``extends`` :index:`: ` [string=''] A configuration to use as base for this one. Use the following format: `OUTPUT_NAME[CFG_NAME]`. - - ``name`` :index:`: ` [string=''] A name to identify this configuration. If empty will be the order in the list, starting with 1. - Don't use just a number or it will be confused as an index. - - ``post`` :index:`: ` [dict] Finishing touches to the panel. - - - Valid keys: - - - ``copperfill`` :index:`: ` [boolean=false] Fill tabs and frame with copper (e.g., to save etchant or to increase rigidity of flex-PCB panels). - - ``dimensions`` :index:`: ` [boolean=false] Draw dimensions with the panel size.. - - *edge_width* :index:`: ` Alias for edgewidth. - - ``edgewidth`` :index:`: ` [number|string] Specify line width for the Edge.Cuts of the panel. - - *mill_radius* :index:`: ` Alias for millradius. - - *mill_radius_outer* :index:`: ` Alias for millradiusouter. - - ``millradius`` :index:`: ` [number|string] Simulate the milling operation (add fillets to the internal corners). - Specify mill radius (usually 1 mm). 0 radius disables the functionality. - - ``millradiusouter`` :index:`: ` [number|string] Like `millradius`, but modifies only board outer counter. - No internal features of the board are affected. - - ``origin`` :index:`: ` [string='tl'] [tl,tr,bl,br,mt,mb,ml,mr,c] Specify if the auxiliary origin an grid origin should be placed. - Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr (middle of sides), c (center). - Empty string does not changes the origin. - - *reconstruct_arcs* :index:`: ` Alias for reconstructarcs. - - ``reconstructarcs`` :index:`: ` [boolean=false] The panelization process works on top of a polygonal representation of the board. - This options allows to reconstruct the arcs in the design before saving the panel. - - *refill_zones* :index:`: ` Alias for refillzones. - - ``refillzones`` :index:`: ` [boolean=false] Refill the user zones after the panel is build. - This is only necessary when you want your zones to avoid cuts in panel. - - ``script`` :index:`: ` [string=''] A path to custom Python file. The file should contain a function kikitPostprocess(panel, args) that - receives the prepared panel as the kikit.panelize.Panel object and the user-supplied arguments as a - string - see `scriptarg`. The function can make arbitrary changes to the panel - you can append text, - footprints, alter labels, etc. The function is invoked after the whole panel is constructed - (including all other postprocessing). If you try to add a functionality for a common fabrication - houses via scripting, consider submitting PR for KiKit. - - *script_arg* :index:`: ` Alias for scriptarg. - - ``scriptarg`` :index:`: ` [string=''] An arbitrary string passed to the user post-processing script specified in script. - - ``type`` :index:`: ` [string='auto'] [auto] Currently fixed. - - - ``source`` :index:`: ` [dict] Used to adjust details of which part of the PCB is panelized. - - - Valid keys: - - - **type** :index:`: ` [string='auto'] [auto,rectangle,annotation] How we select the area of the PCB used for the panelization. - *auto* uses all the area reported by KiCad, *rectangle* a specified rectangle and - *annotation* selects a contour marked by a kikit:Board footprint. - - ``brx`` :index:`: ` [number|string] Bottom right X coordinate of the rectangle used. Used for *rectangle*. - - ``bry`` :index:`: ` [number|string] Bottom right Y coordinate of the rectangle used. Used for *rectangle*. - - ``ref`` :index:`: ` [string=''] Reference for the kikit:Board footprint used to select the contour. Used for *annotation*. - - ``stack`` :index:`: ` [string='inherit'] [inherit,2layer,4layer,6layer] Used to reduce the number of layers used for the panel. - - ``tlx`` :index:`: ` [number|string] Top left X coordinate of the rectangle used. Used for *rectangle*. - - ``tly`` :index:`: ` [number|string] Top left Y coordinate of the rectangle used. Used for *rectangle*. - - ``tolerance`` :index:`: ` [number|string] Extra space around the PCB reported size to be included. Used for *auto* and *annotation*. - - - ``text`` :index:`: ` [dict] Used to add text to the panel. - - - Valid keys: - - - **text** :index:`: ` [string=''] The text to be displayed. Note that you can escape ; via \\. - Available variables in text: *date* formats current date as --, - *time24* formats current time in 24-hour format, - *boardTitle* the title from the source board, - *boardDate* the date from the source board, - *boardRevision* the revision from the source board, - *boardCompany* the company from the source board, - *boardComment1*-*boardComment9* comments from the source board. - - **type** :index:`: ` [string='none'] [none,simple] Currently fixed. BTW: don't ask me about this ridiculous default, is how KiKit works. - - ``anchor`` :index:`: ` [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Origin of the text. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr - (middle of sides), c (center). The anchors refer to the panel outline. - - ``height`` :index:`: ` [number|string] Height of the characters (the same parameters as KiCAD uses). - - ``hjustify`` :index:`: ` [string='center'] [left,right,center] Horizontal justification of the text. - - ``hoffset`` :index:`: ` [number|string] Specify the horizontal offset from anchor. Respects KiCAD coordinate system. - - ``layer`` :index:`: ` [string='F.SilkS'] Specify text layer. - - ``orientation`` :index:`: ` [number|string] Specify the orientation (angle). - - ``plugin`` :index:`: ` [string=''] Specify the plugin that provides extra variables for the text. - - ``thickness`` :index:`: ` [number|string] Stroke thickness. - - ``vjustify`` :index:`: ` [string='center'] [left,right,center] Vertical justification of the text. - - ``voffset`` :index:`: ` [number|string] Specify the vertical offset from anchor. Respects KiCAD coordinate system. - - ``width`` :index:`: ` [number|string] Width of the characters (the same parameters as KiCAD uses). - - - ``text2`` :index:`: ` [dict] Used to add text to the panel. - - - Valid keys: - - - **text** :index:`: ` [string=''] The text to be displayed. Note that you can escape ; via \\. - Available variables in text: *date* formats current date as --, - *time24* formats current time in 24-hour format, - *boardTitle* the title from the source board, - *boardDate* the date from the source board, - *boardRevision* the revision from the source board, - *boardCompany* the company from the source board, - *boardComment1*-*boardComment9* comments from the source board. - - **type** :index:`: ` [string='none'] [none,simple] Currently fixed. BTW: don't ask me about this ridiculous default, is how KiKit works. - - ``anchor`` :index:`: ` [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Origin of the text. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr - (middle of sides), c (center). The anchors refer to the panel outline. - - ``height`` :index:`: ` [number|string] Height of the characters (the same parameters as KiCAD uses). - - ``hjustify`` :index:`: ` [string='center'] [left,right,center] Horizontal justification of the text. - - ``hoffset`` :index:`: ` [number|string] Specify the horizontal offset from anchor. Respects KiCAD coordinate system. - - ``layer`` :index:`: ` [string='F.SilkS'] Specify text layer. - - ``orientation`` :index:`: ` [number|string] Specify the orientation (angle). - - ``plugin`` :index:`: ` [string=''] Specify the plugin that provides extra variables for the text. - - ``thickness`` :index:`: ` [number|string] Stroke thickness. - - ``vjustify`` :index:`: ` [string='center'] [left,right,center] Vertical justification of the text. - - ``voffset`` :index:`: ` [number|string] Specify the vertical offset from anchor. Respects KiCAD coordinate system. - - ``width`` :index:`: ` [number|string] Width of the characters (the same parameters as KiCAD uses). - - - ``text3`` :index:`: ` [dict] Used to add text to the panel. - - - Valid keys: - - - **text** :index:`: ` [string=''] The text to be displayed. Note that you can escape ; via \\. - Available variables in text: *date* formats current date as --, - *time24* formats current time in 24-hour format, - *boardTitle* the title from the source board, - *boardDate* the date from the source board, - *boardRevision* the revision from the source board, - *boardCompany* the company from the source board, - *boardComment1*-*boardComment9* comments from the source board. - - **type** :index:`: ` [string='none'] [none,simple] Currently fixed. BTW: don't ask me about this ridiculous default, is how KiKit works. - - ``anchor`` :index:`: ` [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Origin of the text. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr - (middle of sides), c (center). The anchors refer to the panel outline. - - ``height`` :index:`: ` [number|string] Height of the characters (the same parameters as KiCAD uses). - - ``hjustify`` :index:`: ` [string='center'] [left,right,center] Horizontal justification of the text. - - ``hoffset`` :index:`: ` [number|string] Specify the horizontal offset from anchor. Respects KiCAD coordinate system. - - ``layer`` :index:`: ` [string='F.SilkS'] Specify text layer. - - ``orientation`` :index:`: ` [number|string] Specify the orientation (angle). - - ``plugin`` :index:`: ` [string=''] Specify the plugin that provides extra variables for the text. - - ``thickness`` :index:`: ` [number|string] Stroke thickness. - - ``vjustify`` :index:`: ` [string='center'] [left,right,center] Vertical justification of the text. - - ``voffset`` :index:`: ` [number|string] Specify the vertical offset from anchor. Respects KiCAD coordinate system. - - ``width`` :index:`: ` [number|string] Width of the characters (the same parameters as KiCAD uses). - - - ``text4`` :index:`: ` [dict] Used to add text to the panel. - - - Valid keys: - - - **text** :index:`: ` [string=''] The text to be displayed. Note that you can escape ; via \\. - Available variables in text: *date* formats current date as --, - *time24* formats current time in 24-hour format, - *boardTitle* the title from the source board, - *boardDate* the date from the source board, - *boardRevision* the revision from the source board, - *boardCompany* the company from the source board, - *boardComment1*-*boardComment9* comments from the source board. - - **type** :index:`: ` [string='none'] [none,simple] Currently fixed. BTW: don't ask me about this ridiculous default, is how KiKit works. - - ``anchor`` :index:`: ` [string='mt'] [tl,tr,bl,br,mt,mb,ml,mr,c] Origin of the text. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr - (middle of sides), c (center). The anchors refer to the panel outline. - - ``height`` :index:`: ` [number|string] Height of the characters (the same parameters as KiCAD uses). - - ``hjustify`` :index:`: ` [string='center'] [left,right,center] Horizontal justification of the text. - - ``hoffset`` :index:`: ` [number|string] Specify the horizontal offset from anchor. Respects KiCAD coordinate system. - - ``layer`` :index:`: ` [string='F.SilkS'] Specify text layer. - - ``orientation`` :index:`: ` [number|string] Specify the orientation (angle). - - ``plugin`` :index:`: ` [string=''] Specify the plugin that provides extra variables for the text. - - ``thickness`` :index:`: ` [number|string] Stroke thickness. - - ``vjustify`` :index:`: ` [string='center'] [left,right,center] Vertical justification of the text. - - ``voffset`` :index:`: ` [number|string] Specify the vertical offset from anchor. Respects KiCAD coordinate system. - - ``width`` :index:`: ` [number|string] Width of the characters (the same parameters as KiCAD uses). - - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=panel, %x=kicad_pcb). Affected by global options. - - ``create_preview`` :index:`: ` [boolean=false] Use PcbDraw to create a preview of the panel. - - ``default_angles`` :index:`: ` [string='deg'] [deg,Ā°,rad] Angles used when omitted. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``units`` :index:`: ` [string='mm'] [millimeters,inches,mils,mm,cm,dm,m,mil,inch,in] Units used when omitted. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`PanelizeOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `Panelize` output. - **type** :index:`: ` 'panelize' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + PanelizeOptions diff --git a/docs/source/configuration/outputs/pcb2blender_tools.rst b/docs/source/configuration/outputs/pcb2blender_tools.rst index 599063aae..92d61ca10 100644 --- a/docs/source/configuration/outputs/pcb2blender_tools.rst +++ b/docs/source/configuration/outputs/pcb2blender_tools.rst @@ -20,58 +20,33 @@ Category: **PCB/3D/Auxiliar** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `pcb2blender_tools` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=pcb2blender, %x=pcb3d). Affected by global options. - - **show_components** :index:`: ` [list(string)|string=all] [none,all] List of components to include in the pads list, - can be also a string for `none` or `all`. The default is `all`. - Ranges like *R5-R10* are supported. - - - ``board_bounds_create`` :index:`: ` [boolean=true] Create the file that informs the size of the used PCB area. - This is the bounding box reported by KiCad for the PCB edge with 1 mm of margin. - - ``board_bounds_dir`` :index:`: ` [string='layers'] Sub-directory where the bounds file is stored. - - ``board_bounds_file`` :index:`: ` [string='bounds'] Name of the bounds file. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``pads_info_create`` :index:`: ` [boolean=true] Create the files containing the PCB pads information. - - ``pads_info_dir`` :index:`: ` [string='pads'] Sub-directory where the pads info files are stored. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``stackup_create`` :index:`: ` [boolean=false] Create a file containing the board stackup. - - ``stackup_dir`` :index:`: ` [string='.'] Directory for the stackup file. Use 'layers' for 2.7+. - - ``stackup_file`` :index:`: ` [string='board.yaml'] Name for the stackup file. Use 'stackup' for 2.7+. - - ``stackup_format`` :index:`: ` [string='JSON'] [JSON,BIN] Format for the stackup file. Use 'BIN' for 2.7+. - - ``sub_boards_bounds_file`` :index:`: ` [string='bounds'] File name for the sub-PCBs bounds. - - ``sub_boards_create`` :index:`: ` [boolean=true] Extract sub-PCBs and their Z axis position. - - ``sub_boards_dir`` :index:`: ` [string='boards'] Directory for the boards definitions. - - ``sub_boards_stacked_prefix`` :index:`: ` [string='stacked\_'] Prefix used for the stack files. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`PCB2Blender_ToolsOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `pcb2blender_tools` output. - **type** :index:`: ` 'pcb2blender_tools' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + PCB2Blender_ToolsOptions diff --git a/docs/source/configuration/outputs/pcb_print.rst b/docs/source/configuration/outputs/pcb_print.rst index a975686bb..beded81ae 100644 --- a/docs/source/configuration/outputs/pcb_print.rst +++ b/docs/source/configuration/outputs/pcb_print.rst @@ -16,172 +16,33 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `pcb_print` output. - - - Valid keys: - - - **color_theme** :index:`: ` [string='_builtin_classic'] Selects the color theme. Only applies to KiCad 6. - To use the KiCad 6 default colors select `_builtin_default`. - Usually user colors are stored as `user`, but you can give it another name. - - **force_edge_cuts** :index:`: ` [boolean=false] Add the `Edge.Cuts` to all the pages. - - **format** :index:`: ` [string='PDF'] [PDF,SVG,PNG,EPS,PS] Format for the output file/s. - Note that for PS you need `ghostscript` which isn't part of the default docker images. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=assembly, %x=pdf/ps)/(%i=assembly_page_NN, %x=svg/png/eps). - Consult the `page_number_as_extension` and `page_id` options. Affected by global options. - - *output_name* :index:`: ` Alias for output. - - **pages** :index:`: ` [list(dict)] List of pages to include in the output document. - Each page contains one or more layers of the PCB. - - - Valid keys: - - - **layers** :index:`: ` [list(dict)|list(string)|string] List of layers printed in this page. - Order is important, the last goes on top. - You can reuse other layers lists, some options aren't used here, but they are valid. - - - Valid keys: - - - ``color`` :index:`: ` [string=''] Color used for this layer. - KiCad 6+: don't forget the alpha channel for layers like the solder mask. - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``force_plot_invisible_refs_vals`` :index:`: ` [boolean=false] Include references and values even when they are marked as invisible. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``plot_footprint_refs`` :index:`: ` [boolean=true] Include the footprint references. - - ``plot_footprint_values`` :index:`: ` [boolean=true] Include the footprint values. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - - ``use_for_center`` :index:`: ` [boolean=true] Use this layer for centering purposes. - You can invert the meaning using the `invert_use_for_center` option. - - - **scaling** :index:`: ` [number=1.0] Scale factor (0 means autoscaling). - - **sort_layers** :index:`: ` [boolean=false] Try to sort the layers in the same order that uses KiCad for printing. - - ``autoscale_margin_x`` :index:`: ` [number=0] Horizontal margin used for the autoscaling mode [mm]. - - ``autoscale_margin_y`` :index:`: ` [number=0] Vertical margin used for the autoscaling mode [mm]. - - ``colored_holes`` :index:`: ` [boolean=true] Change the drill holes to be colored instead of white. - - ``exclude_pads_from_silkscreen`` :index:`: ` [boolean=false] Do not plot the component pads in the silk screen (KiCad 5.x only). - - ``holes_color`` :index:`: ` [string='#000000'] Color used for the holes when `colored_holes` is enabled. - - ``layer_var`` :index:`: ` [string='%ll'] Text to use for the `LAYER` in the title block. - All the expansions available for `sheet` are also available here. - - ``line_width`` :index:`: ` [number=0.1] [0.02,2] For objects without width [mm] (KiCad 5). - - ``mirror`` :index:`: ` [boolean=false] Print mirrored (X axis inverted). - - ``mirror_footprint_text`` :index:`: ` [boolean=true] Mirror text in the footprints when mirror option is enabled and we plot a user layer. - - ``mirror_pcb_text`` :index:`: ` [boolean=true] Mirror text in the PCB when mirror option is enabled and we plot a user layer. - - ``monochrome`` :index:`: ` [boolean=false] Print in gray scale. - - ``negative_plot`` :index:`: ` [boolean=false] Invert black and white. Only useful for a single layer. - - ``page_id`` :index:`: ` [string='%02d'] Text to differentiate the pages. Use %d (like in C) to get the page number. - - ``repeat_for_layer`` :index:`: ` [string=''] Use this page as a pattern to create more pages. - The other pages will change the layer mentioned here. - This can be used to generate a page for each copper layer, here you put `F.Cu`. - See `repeat_layers`. - - ``repeat_inherit`` :index:`: ` [boolean=true] If we will inherit the options of the layer we are replacing. - Disable it if you specify the options in `repeat_layers`, which is unlikely. - - ``repeat_layers`` :index:`: ` [list(dict)|list(string)|string] List of layers to replace `repeat_for_layer`. - This can be used to generate a page for each copper layer, here you put `copper`. - - - Valid keys: - - - ``color`` :index:`: ` [string=''] Color used for this layer. - KiCad 6+: don't forget the alpha channel for layers like the solder mask. - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``force_plot_invisible_refs_vals`` :index:`: ` [boolean=false] Include references and values even when they are marked as invisible. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``plot_footprint_refs`` :index:`: ` [boolean=true] Include the footprint references. - - ``plot_footprint_values`` :index:`: ` [boolean=true] Include the footprint values. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - - ``use_for_center`` :index:`: ` [boolean=true] Use this layer for centering purposes. - You can invert the meaning using the `invert_use_for_center` option. - - - ``sheet`` :index:`: ` [string='Assembly'] Text to use for the `SHEET` in the title block. - Pattern (%*) and text variables are expanded. - The %ll is the list of layers included in this page. - In addition when you use `repeat_for_layer` the following patterns are available: - %ln layer name, %ls layer suffix and %ld layer description. - - ``sheet_reference_color`` :index:`: ` [string=''] Color to use for the frame and title block. - - ``sketch_pad_line_width`` :index:`: ` [number=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). - - ``sketch_pads_on_fab_layers`` :index:`: ` [boolean=false] Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). - - ``tent_vias`` :index:`: ` [boolean=true] Cover the vias. - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - - **plot_sheet_reference** :index:`: ` [boolean=true] Include the title-block (worksheet, frame, etc.). - - **scaling** :index:`: ` [number=1.0] Default scale factor (0 means autoscaling). - - ``add_background`` :index:`: ` [boolean=false] Add a background to the pages, see `background_color`. - - ``autoscale_margin_x`` :index:`: ` [number=0] Default horizontal margin used for the autoscaling mode [mm]. - - ``autoscale_margin_y`` :index:`: ` [number=0] Default vertical margin used for the autoscaling mode [mm]. - - ``background_color`` :index:`: ` [string='#FFFFFF'] Color for the background when `add_background` is enabled. - - ``background_image`` :index:`: ` [string=''] Background image, must be an SVG, only when `add_background` is enabled. - - ``blind_via_color`` :index:`: ` [string=''] Color used for blind/buried `colored_vias`. - - ``colored_pads`` :index:`: ` [boolean=true] Plot through-hole in a different color. Like KiCad GUI does. - - ``colored_vias`` :index:`: ` [boolean=true] Plot vias in a different color. Like KiCad GUI does. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``dpi`` :index:`: ` [number=360] [36,1200] Resolution (Dots Per Inch) for the output file. Most objects are vectors, but thing - like the the solder mask are handled as images by the conversion tools. - - ``drill_marks`` :index:`: ` [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale). - - ``forced_edge_cuts_color`` :index:`: ` [string=''] Color used for the `force_edge_cuts` option. - - ``forced_edge_cuts_use_for_center`` :index:`: ` [boolean=true] Used when enabling the `force_edge_cuts`, in this case this is the `use_for_center` option of the forced - layer. - - ``frame_plot_mechanism`` :index:`: ` [string='internal'] [gui,internal,plot] Plotting the frame from Python is problematic. - This option selects a workaround strategy. - gui: uses KiCad GUI to do it. Is slow but you get the correct frame. - But it can't keep track of page numbers. - internal: KiBot loads the `.kicad_wks` and does the drawing work. - Best option, but some details are different from what the GUI generates. - plot: uses KiCad Python API. Not available for KiCad 5. - You get the default frame and some substitutions doesn't work. - - ``hide_excluded`` :index:`: ` [boolean=false] Hide components in the Fab layer that are marked as excluded by a variant. - Affected by global options. - - ``individual_page_scaling`` :index:`: ` [boolean=true] Tell KiCad to apply the scaling for each page as a separated entity. - Disabling it the pages are coherent and can be superposed. - - ``invert_use_for_center`` :index:`: ` [boolean=false] Invert the meaning of the `use_for_center` layer option. - This can be used to just select the edge cuts for centering, in this case enable this option - and disable the `use_for_center` option of the edge cuts layer. - - ``keep_temporal_files`` :index:`: ` [boolean=false] Store the temporal page and layer files in the output dir and don't delete them. - - ``micro_via_color`` :index:`: ` [string=''] Color used for micro `colored_vias`. - - ``pad_color`` :index:`: ` [string=''] Color used for `colored_pads`. - - ``page_number_as_extension`` :index:`: ` [boolean=false] When enabled the %i is always `assembly`, the %x will be NN.FORMAT (i.e. 01.png). - Note: page numbers can be customized using the `page_id` option for each page. - - ``png_width`` :index:`: ` [number=1280] [0,7680] Width of the PNG in pixels. Use 0 to use as many pixels as the DPI needs for the page size. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``realistic_solder_mask`` :index:`: ` [boolean=true] Try to draw the solder mask as a real solder mask, not the negative used for fabrication. - In order to get a good looking select a color with transparency, i.e. '#14332440'. - PcbDraw must be installed in order to use this option. - - ``sheet_reference_layout`` :index:`: ` [string=''] Worksheet file (.kicad_wks) to use. Leave empty to use the one specified in the project. - - ``svg_precision`` :index:`: ` [number=4] [0,6] Scale factor used to represent 1 mm in the SVG (KiCad 6). - The value is how much zeros has the multiplier (1 mm = 10 power `svg_precision` units). - Note that for an A4 paper Firefox 91 and Chrome 105 can't handle more than 5. - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - - ``via_color`` :index:`: ` [string=''] Color used for through-hole `colored_vias`. - +- **options** :index:`: ` [:ref:`PCB_PrintOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `pcb_print` output. - **type** :index:`: ` 'pcb_print' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + PCB_PrintOptions diff --git a/docs/source/configuration/outputs/pcb_variant.rst b/docs/source/configuration/outputs/pcb_variant.rst index f18daae04..142b475d6 100644 --- a/docs/source/configuration/outputs/pcb_variant.rst +++ b/docs/source/configuration/outputs/pcb_variant.rst @@ -15,45 +15,33 @@ Type: ``pcb_variant`` Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `pcb_variant` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=variant, %x=kicad_pcb). Affected by global options. - - ``copy_project`` :index:`: ` [boolean=true] Copy the KiCad project to the destination directory. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``hide_excluded`` :index:`: ` [boolean=false] Hide components in the Fab layer that are marked as excluded by a variant. - Affected by global options. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`PCB_Variant_Options parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `pcb_variant` output. - **type** :index:`: ` 'pcb_variant' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + PCB_Variant_Options diff --git a/docs/source/configuration/outputs/pcbdraw.rst b/docs/source/configuration/outputs/pcbdraw.rst index fa6002aab..747edbd76 100644 --- a/docs/source/configuration/outputs/pcbdraw.rst +++ b/docs/source/configuration/outputs/pcbdraw.rst @@ -20,131 +20,33 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `pcbdraw` output. - - - Valid keys: - - - **bottom** :index:`: ` [boolean=false] Render the bottom side of the board (default is top side). - - **format** :index:`: ` [string='svg'] [svg,png,jpg,bmp] Output format. Only used if no `output` is specified. - - **mirror** :index:`: ` [boolean=false] Mirror the board. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Name for the generated file. Affected by global options. - - **show_components** :index:`: ` [list(string)|string=none] [none,all] List of components to draw, can be also a string for none or all. - The default is none. - There two ways of using this option, please consult the `add_to_variant` option. - You can use `_kf(FILTER)` as an element in the list to get all the components that pass the filter. - You can even use `_kf(FILTER1;FILTER2)` to concatenate filters. - - - **style** :index:`: ` [string|dict] PCB style (colors). An internal name, the name of a JSON file or the style options. - - - Valid keys: - - - **board** :index:`: ` [string='#208b47'] Color for the board without copper (covered by solder mask). - - **clad** :index:`: ` [string='#cabb3e'] Color for the PCB core (not covered by solder mask). - - **copper** :index:`: ` [string='#285e3a'] Color for the copper zones (covered by solder mask). - - **outline** :index:`: ` [string='#000000'] Color for the outline. - - **pads** :index:`: ` [string='#8b898c'] Color for the exposed pads (metal finish). - - **silk** :index:`: ` [string='#d5dce4'] Color for the silk screen. - - ``highlight_on_top`` :index:`: ` [boolean=false] Highlight over the component (not under). - - ``highlight_padding`` :index:`: ` [number=1.5] [0,1000] How much the highlight extends around the component [mm]. - - ``highlight_style`` :index:`: ` [string='stroke:none;fill:#ff0000;opacity:0.5;'] SVG code for the highlight style. - - ``vcut`` :index:`: ` [string='#bf2600'] Color for the V-CUTS. - - - ``add_to_variant`` :index:`: ` [boolean=true] The `show_components` list is added to the list of components indicated by the variant (fitted and not - excluded). - This is the old behavior, but isn't intuitive because the `show_components` meaning changes when a variant - is used. In this mode you should avoid using `show_components` and variants. - To get a more coherent behavior disable this option, and `none` will always be `none`. - Also `all` will be what the variant says. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``dpi`` :index:`: ` [number=300] [10,1200] Dots per inch (resolution) of the generated image. - - ``highlight`` :index:`: ` [list(string)=[]] List of components to highlight. Filter expansion is also allowed here, - see `show_components`. - - - ``libs`` :index:`: ` [list(string)=[]] List of libraries. - - - ``margin`` :index:`: ` [number|dict] Margin around the generated image [mm]. - Using a number the margin is the same in the four directions. - - - Valid keys: - - - ``bottom`` :index:`: ` [number=0] Bottom margin [mm]. - - ``left`` :index:`: ` [number=0] Left margin [mm]. - - ``right`` :index:`: ` [number=0] Right margin [mm]. - - ``top`` :index:`: ` [number=0] Top margin [mm]. - - - ``no_drillholes`` :index:`: ` [boolean=false] Do not make holes transparent. - - ``outline_width`` :index:`: ` [number=0.15] [0,10] Width of the trace to draw the PCB border [mm]. - Note this also affects the drill holes. - - ``placeholder`` :index:`: ` [boolean=false] Show placeholder for missing components. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``remap`` :index:`: ` [dict|None] (DEPRECATED) Replacements for PCB references using specified components (lib:component). - Use `remap_components` instead. - - - ``remap_components`` :index:`: ` [list(dict)] Replacements for PCB references using specified components. - Replaces `remap` with type check. - - - Valid keys: - - - **comp** :index:`: ` [string=''] Component to use (from `lib`). - - *component* :index:`: ` Alias for comp. - - **lib** :index:`: ` [string=''] Library to use. - - *library* :index:`: ` Alias for lib. - - **ref** :index:`: ` [string=''] Reference for the component to change. - - *reference* :index:`: ` Alias for ref. - - - ``resistor_flip`` :index:`: ` [string|list(string)=''] List of resistors to flip its bands. - - - ``resistor_remap`` :index:`: ` [list(dict)] List of resistors to be remapped. You can change the value of the resistors here. - - - Valid keys: - - - **ref** :index:`: ` [string=''] Reference for the resistor to change. - - *reference* :index:`: ` Alias for ref. - - **val** :index:`: ` [string=''] Value to use for `ref`. - - *value* :index:`: ` Alias for val. - - - ``show_solderpaste`` :index:`: ` [boolean=true] Show the solder paste layers. - - ``size_detection`` :index:`: ` [string='kicad_edge'] [kicad_edge,kicad_all,svg_paths] Method used to detect the size of the resulting image. - The `kicad_edge` method uses the size of the board as reported by KiCad, - components that extend beyond the PCB limit will be cropped. You can manually - adjust the margins to make them visible. - The `kicad_all` method uses the whole size reported by KiCad. Usually includes extra space. - The `svg_paths` uses all visible drawings in the image. To use this method you - must install the `numpy` Python module (may not be available in docker images). - - ``svg_precision`` :index:`: ` [number=4] [3,6] Scale factor used to represent 1 mm in the SVG (KiCad 6). - The value is how much zeros has the multiplier (1 mm = 10 power `svg_precision` units). - Note that for an A4 paper Firefox 91 and Chrome 105 can't handle more than 5. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - - ``vcuts`` :index:`: ` [boolean=false] Render V-CUTS on the `vcuts_layer` layer. - - ``vcuts_layer`` :index:`: ` [string='Cmts.User'] Layer to render the V-CUTS, only used when `vcuts` is enabled. - Note that any other content from this layer will be included. - - ``warnings`` :index:`: ` [string='visible'] [visible,all,none] Using visible only the warnings about components in the visible side are generated. - +- **options** :index:`: ` [:ref:`PcbDrawOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `pcbdraw` output. - **type** :index:`: ` 'pcbdraw' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + PcbDrawOptions diff --git a/docs/source/configuration/outputs/pdf.rst b/docs/source/configuration/outputs/pdf.rst index a077438ab..fa45c6b35 100644 --- a/docs/source/configuration/outputs/pdf.rst +++ b/docs/source/configuration/outputs/pdf.rst @@ -18,126 +18,70 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **layers** :index:`: ` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to plot. - - - Valid keys: - - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **layers** :index:`: ` [:ref:`Layer parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string) List + of PCB layers to plot. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `pdf` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Output file name, the default KiCad name if empty. - IMPORTANT! KiCad will always create the file using its own name and then we can rename it. - For this reason you must avoid generating two variants at the same directory when one of - them uses the default KiCad name. Affected by global options. - - **plot_sheet_reference** :index:`: ` [boolean=false] Include the frame and title block. Only available for KiCad 6+ and you get a poor result - (i.e. always the default worksheet style, also problems expanding text variables). - The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. - - **scaling** :index:`: ` [number=1] Scale factor (0 means autoscaling). - - ``custom_reports`` :index:`: ` [list(dict)] A list of customized reports for the manufacturer. - - - Valid keys: - - - ``content`` :index:`: ` [string=''] Content for the report. Use ``${basename}`` for the project name without extension. - Use ``${filename(LAYER)}`` for the file corresponding to LAYER. - - ``output`` :index:`: ` [string='Custom_report.txt'] File name for the custom report. - - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``drill_marks`` :index:`: ` [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale). - - ``edge_cut_extension`` :index:`: ` [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot. - - ``exclude_edge_layer`` :index:`: ` [boolean=true] Do not include the PCB edge layer. - - ``exclude_pads_from_silkscreen`` :index:`: ` [boolean=false] Do not plot the component pads in the silk screen (KiCad 5.x only). - - ``force_plot_invisible_refs_vals`` :index:`: ` [boolean=false] Include references and values even when they are marked as invisible. - - ``individual_page_scaling`` :index:`: ` [boolean=true] Tell KiCad to apply the scaling for each layer as a separated entity. - Disabling it the pages are coherent and can be superposed. - - ``inner_extension_pattern`` :index:`: ` [string=''] Used to change the Protel style extensions for inner layers. - The replacement pattern can contain %n for the inner layer number and %N for the layer number. - Example '.g%n'. - - ``line_width`` :index:`: ` [number=0.1] [0.02,2] For objects without width [mm] (KiCad 5). - - ``mirror_plot`` :index:`: ` [boolean=false] Plot mirrored. - - ``negative_plot`` :index:`: ` [boolean=false] Invert black and white. - - ``plot_footprint_refs`` :index:`: ` [boolean=true] Include the footprint references. - - ``plot_footprint_values`` :index:`: ` [boolean=true] Include the footprint values. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``sketch_pad_line_width`` :index:`: ` [number=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). - - ``sketch_pads_on_fab_layers`` :index:`: ` [boolean=false] Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). - - ``tent_vias`` :index:`: ` [boolean=true] Cover the vias. - - ``uppercase_extensions`` :index:`: ` [boolean=false] Use uppercase names for the extensions. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - -- **output** :index:`: ` [string='%f-%i%I%v.%x'] Output file name, the default KiCad name if empty. +- **options** :index:`: ` [:ref:`PDFOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `pdf` output. +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Output file name, the default KiCad name if empty. IMPORTANT! KiCad will always create the file using its own name and then we can rename it. For this reason you must avoid generating two variants at the same directory when one of them uses the default KiCad name. Affected by global options. -- **plot_sheet_reference** :index:`: ` [boolean=false] Include the frame and title block. Only available for KiCad 6+ and you get a poor result +- **plot_sheet_reference** :index:`: ` [:ref:`boolean `] (default: ``false``) Include the frame and title block. Only available for KiCad 6+ and you get a poor result (i.e. always the default worksheet style, also problems expanding text variables). The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. -- **scaling** :index:`: ` [number=1] Scale factor (0 means autoscaling). +- **scaling** :index:`: ` [:ref:`number `] (default: ``1``) Scale factor (0 means autoscaling). - **type** :index:`: ` 'pdf' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``custom_reports`` :index:`: ` [list(dict)] A list of customized reports for the manufacturer. - - - Valid keys: - - - ``content`` :index:`: ` [string=''] Content for the report. Use ``${basename}`` for the project name without extension. - Use ``${filename(LAYER)}`` for the file corresponding to LAYER. - - ``output`` :index:`: ` [string='Custom_report.txt'] File name for the custom report. - -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``custom_reports`` :index:`: ` [:ref:`CustomReport parameters `] [:ref:`list(dict) `] (default: ``[]``) A list of customized reports for the manufacturer. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. +- ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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. -- ``drill_marks`` :index:`: ` [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale). -- ``edge_cut_extension`` :index:`: ` [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot. -- ``exclude_edge_layer`` :index:`: ` [boolean=true] Do not include the PCB edge layer. -- ``exclude_pads_from_silkscreen`` :index:`: ` [boolean=false] Do not plot the component pads in the silk screen (KiCad 5.x only). -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``drill_marks`` :index:`: ` [:ref:`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:`: ` [:ref:`string `] (default: ``''``) Used to configure the edge cuts layer extension for Protel mode. Include the dot. +- ``exclude_edge_layer`` :index:`: ` [:ref:`boolean `] (default: ``true``) Do not include the PCB edge layer. +- ``exclude_pads_from_silkscreen`` :index:`: ` [:ref:`boolean `] (default: ``false``) Do not plot the component pads in the silk screen (KiCad 5.x only). +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``force_plot_invisible_refs_vals`` :index:`: ` [boolean=false] Include references and values even when they are marked as invisible. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``force_plot_invisible_refs_vals`` :index:`: ` [:ref:`boolean `] (default: ``false``) Include references and values even when they are marked as invisible. +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``individual_page_scaling`` :index:`: ` [boolean=true] Tell KiCad to apply the scaling for each layer as a separated entity. +- ``individual_page_scaling`` :index:`: ` [:ref:`boolean `] (default: ``true``) Tell KiCad to apply the scaling for each layer as a separated entity. Disabling it the pages are coherent and can be superposed. -- ``inner_extension_pattern`` :index:`: ` [string=''] Used to change the Protel style extensions for inner layers. +- ``inner_extension_pattern`` :index:`: ` [:ref:`string `] (default: ``''``) Used to change the Protel style extensions for inner layers. The replacement pattern can contain %n for the inner layer number and %N for the layer number. Example '.g%n'. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``plot_footprint_refs`` :index:`: ` [boolean=true] Include the footprint references. -- ``plot_footprint_values`` :index:`: ` [boolean=true] Include the footprint values. -- ``pre_transform`` :index:`: ` [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``plot_footprint_refs`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint references. +- ``plot_footprint_values`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include the footprint values. +- ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`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. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. -- ``sketch_pad_line_width`` :index:`: ` [number=0.1] Line width for the sketched pads [mm], see `sketch_pads_on_fab_layers` (KiCad 6+) +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. +- ``sketch_pad_line_width`` :index:`: ` [:ref:`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). -- ``sketch_pads_on_fab_layers`` :index:`: ` [boolean=false] Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). -- ``tent_vias`` :index:`: ` [boolean=true] Cover the vias. -- ``uppercase_extensions`` :index:`: ` [boolean=false] Use uppercase names for the extensions. -- ``variant`` :index:`: ` [string=''] Board variant to apply. +- ``sketch_pads_on_fab_layers`` :index:`: ` [:ref:`boolean `] (default: ``false``) Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). +- ``tent_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Cover the vias. +- ``uppercase_extensions`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use uppercase names for the extensions. +- ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Board variant to apply. + +.. toctree:: + :caption: Used dicts + CustomReport + Layer + PDFOptions diff --git a/docs/source/configuration/outputs/pdf_pcb_print.rst b/docs/source/configuration/outputs/pdf_pcb_print.rst index 0dba3602b..60f89cbdb 100644 --- a/docs/source/configuration/outputs/pdf_pcb_print.rst +++ b/docs/source/configuration/outputs/pdf_pcb_print.rst @@ -18,68 +18,36 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **layers** :index:`: ` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to include in the PDF. - - - Valid keys: - - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **layers** :index:`: ` [:ref:`Layer parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string) List + of PCB layers to include in the PDF. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `pdf_pcb_print` output. - - - Valid keys: - - - **plot_sheet_reference** :index:`: ` [boolean=true] Include the title-block. - - **scaling** :index:`: ` [number=1.0] Scale factor (0 means autoscaling). You should disable `plot_sheet_reference` when using it. - - **separated** :index:`: ` [boolean=false] Print layers in separated pages. - - ``color_theme`` :index:`: ` [string='_builtin_classic'] Selects the color theme. Onlyu applies to KiCad 6. - To use the KiCad 6 default colors select `_builtin_default`. - Usually user colors are stored as `user`, but you can give it another name. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``drill_marks`` :index:`: ` [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale). - - ``force_edge_cuts`` :index:`: ` [boolean=true] Only useful for KiCad 6 when printing in one page, you can disable the edge here. - KiCad 5 forces it by default, and you can't control it from config files. - Same for KiCad 6 when printing to separated pages. - - ``hide_excluded`` :index:`: ` [boolean=false] Hide components in the Fab layer that are marked as excluded by a variant. - Affected by global options. - - ``mirror`` :index:`: ` [boolean=false] Print mirrored (X axis inverted). ONLY for KiCad 6. - - ``monochrome`` :index:`: ` [boolean=false] Print in black and white. - - ``output`` :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output PDF (%i=layers, %x=pdf). Affected by global options. - - *output_name* :index:`: ` Alias for output. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`PDF_PCB_PrintOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `pdf_pcb_print` output. - **type** :index:`: ` 'pdf_pcb_print' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Layer + PDF_PCB_PrintOptions diff --git a/docs/source/configuration/outputs/pdf_sch_print.rst b/docs/source/configuration/outputs/pdf_sch_print.rst index 737a738b2..619af5f41 100644 --- a/docs/source/configuration/outputs/pdf_sch_print.rst +++ b/docs/source/configuration/outputs/pdf_sch_print.rst @@ -17,51 +17,33 @@ Category: **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `pdf_sch_print` output. - - - Valid keys: - - - **frame** :index:`: ` [boolean=true] Include the frame and title block. - - ``all_pages`` :index:`: ` [boolean=true] Generate with all hierarchical sheets. - - ``background_color`` :index:`: ` [boolean=false] Use the background color from the `color_theme` (KiCad 6). - - ``color_theme`` :index:`: ` [string=''] Color theme used, this must exist in the KiCad config (KiCad 6). - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``monochrome`` :index:`: ` [boolean=false] Generate a monochromatic output. - - ``output`` :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output PDF (%i=schematic, %x=pdf). Affected by global options. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``sheet_reference_layout`` :index:`: ` [string=''] 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 - file is available. - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Not fitted components are crossed. - +- **options** :index:`: ` [:ref:`PDF_SCH_PrintOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `pdf_sch_print` output. - **type** :index:`: ` 'pdf_sch_print' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + PDF_SCH_PrintOptions diff --git a/docs/source/configuration/outputs/pdfunite.rst b/docs/source/configuration/outputs/pdfunite.rst index 9b0d21515..2482a3bca 100644 --- a/docs/source/configuration/outputs/pdfunite.rst +++ b/docs/source/configuration/outputs/pdfunite.rst @@ -14,46 +14,33 @@ Type: ``pdfunite`` Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `pdfunite` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Name for the generated PDF (%i=name of the output %x=pdf). Affected by global options. - - **outputs** :index:`: ` [list(dict)] Which files will be included. - - - Valid keys: - - - **from_output** :index:`: ` [string=''] Collect files from the selected output. - When used the `source` option is ignored. - - **source** :index:`: ` [string='*.pdf'] File names to add, wildcards allowed. Use ** for recursive match. - By default this pattern is applied to the output dir specified with `-d` command line option. - See the `from_cwd` option. - - ``filter`` :index:`: ` [string='.*\\.pdf'] A regular expression that source files must match. - - ``from_cwd`` :index:`: ` [boolean=false] Use the current working directory instead of the dir specified by `-d`. - - - ``use_external_command`` :index:`: ` [boolean=false] Use the `pdfunite` tool instead of PyPDF2 Python module. - +- **options** :index:`: ` [:ref:`PDFUniteOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `pdfunite` output. - **type** :index:`: ` 'pdfunite' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + PDFUniteOptions diff --git a/docs/source/configuration/outputs/populate.rst b/docs/source/configuration/outputs/populate.rst index f56b952c0..bc281affd 100644 --- a/docs/source/configuration/outputs/populate.rst +++ b/docs/source/configuration/outputs/populate.rst @@ -18,53 +18,33 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `populate` output. - - - Valid keys: - - - **format** :index:`: ` [string='html'] [html,md] Format for the generated output. - - **input** :index:`: ` [string=''] Name of the input file describing the assembly. Must be a markdown file. - Note that the YAML section of the file will be skipped, all the needed information - comes from this output and the `renderer` output. - - **renderer** :index:`: ` [string=''] Name of the output used to render the PCB steps. - Currently this must be a `pcbdraw` or `render_3d` output. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``imgname`` :index:`: ` [string='img/populating_%d.%x'] Pattern used for the image names. The `%d` is replaced by the image number. - The `%x` is replaced by the extension. Note that the format is selected by the - `renderer`. - - ``initial_components`` :index:`: ` [string|list(string)=''] List of components soldered before the first step. - - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``template`` :index:`: ` [string] The name of the handlebars template used for the HTML output. - The extension must be `.handlebars`, it will be added when missing. - The `simple.handlebars` template is a built-in template. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`PopulateOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `populate` output. - **type** :index:`: ` 'populate' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + PopulateOptions diff --git a/docs/source/configuration/outputs/position.rst b/docs/source/configuration/outputs/position.rst index 9bfcbf2f2..a6a1b9178 100644 --- a/docs/source/configuration/outputs/position.rst +++ b/docs/source/configuration/outputs/position.rst @@ -16,63 +16,33 @@ Category: **PCB/fabrication/assembly** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `position` output. - - - Valid keys: - - - **format** :index:`: ` [string='ASCII'] [ASCII,CSV,GBR] Format for the position file. - Note that the gerber format (GBR) needs KiCad 7+ and doesn't support most of the options. - Only the options that explicitly say the format is supported. - - **only_smd** :index:`: ` [boolean=true] Only include the surface mount components. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Output file name (%i='top_pos'|'bottom_pos'|'both_pos', %x='pos'|'csv'|'gbr'). - Important: when using separate files you must use `%i` to differentiate them. Affected by global options. - - **separate_files_for_front_and_back** :index:`: ` [boolean=true] Generate two separated files, one for the top and another for the bottom. - - **units** :index:`: ` [string='millimeters'] [millimeters,inches,mils] Units used for the positions. Affected by global options. - - ``bottom_negative_x`` :index:`: ` [boolean=false] Use negative X coordinates for footprints on bottom layer. - - ``columns`` :index:`: ` [list(dict)|list(string)] Which columns are included in the output. - - - Valid keys: - - - **id** :index:`: ` [string=''] [Ref,Val,Package,PosX,PosY,Rot,Side] Internal name. - - ``name`` :index:`: ` [string=''] Name to use in the output file. The id is used when empty. - - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``gerber_board_edge`` :index:`: ` [boolean=false] Include the board edge in the gerber output. - - ``include_virtual`` :index:`: ` [boolean=false] Include virtual components. For special purposes, not pick & place. - Note that virtual components is a KiCad 5 concept. - For KiCad 6+ we replace this concept by the option to exclude from position file. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``quote_all`` :index:`: ` [boolean=false] When generating the CSV quote all values, even numbers. - - ``right_digits`` :index:`: ` [number=4] number of digits for mantissa part of coordinates (0 is auto). - - ``use_aux_axis_as_origin`` :index:`: ` [boolean=true] Use the auxiliary axis as origin for coordinates (KiCad default). - Supported by the gerber format. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`PositionOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `position` output. - **type** :index:`: ` 'position' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + PositionOptions diff --git a/docs/source/configuration/outputs/ps.rst b/docs/source/configuration/outputs/ps.rst index 186edf874..0fbf25b42 100644 --- a/docs/source/configuration/outputs/ps.rst +++ b/docs/source/configuration/outputs/ps.rst @@ -17,92 +17,36 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **layers** :index:`: ` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to plot. - - - Valid keys: - - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **layers** :index:`: ` [:ref:`Layer parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string) List + of PCB layers to plot. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `ps` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Output file name, the default KiCad name if empty. - IMPORTANT! KiCad will always create the file using its own name and then we can rename it. - For this reason you must avoid generating two variants at the same directory when one of - them uses the default KiCad name. Affected by global options. - - **plot_sheet_reference** :index:`: ` [boolean=false] Include the frame and title block. Only available for KiCad 6+ and you get a poor result - (i.e. always the default worksheet style, also problems expanding text variables). - The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. - - **scaling** :index:`: ` [number=1] Scale factor (0 means autoscaling). - - ``a4_output`` :index:`: ` [boolean=true] Force A4 paper size. - - ``custom_reports`` :index:`: ` [list(dict)] A list of customized reports for the manufacturer. - - - Valid keys: - - - ``content`` :index:`: ` [string=''] Content for the report. Use ``${basename}`` for the project name without extension. - Use ``${filename(LAYER)}`` for the file corresponding to LAYER. - - ``output`` :index:`: ` [string='Custom_report.txt'] File name for the custom report. - - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``drill_marks`` :index:`: ` [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale). - - ``edge_cut_extension`` :index:`: ` [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot. - - ``exclude_edge_layer`` :index:`: ` [boolean=true] Do not include the PCB edge layer. - - ``exclude_pads_from_silkscreen`` :index:`: ` [boolean=false] Do not plot the component pads in the silk screen (KiCad 5.x only). - - ``force_plot_invisible_refs_vals`` :index:`: ` [boolean=false] Include references and values even when they are marked as invisible. - - ``individual_page_scaling`` :index:`: ` [boolean=true] Tell KiCad to apply the scaling for each layer as a separated entity. - Disabling it the pages are coherent and can be superposed. - - ``inner_extension_pattern`` :index:`: ` [string=''] Used to change the Protel style extensions for inner layers. - The replacement pattern can contain %n for the inner layer number and %N for the layer number. - Example '.g%n'. - - ``line_width`` :index:`: ` [number=0.15] [0.02,2] For objects without width [mm] (KiCad 5). - - ``mirror_plot`` :index:`: ` [boolean=false] Plot mirrored. - - ``negative_plot`` :index:`: ` [boolean=false] Invert black and white. - - ``plot_footprint_refs`` :index:`: ` [boolean=true] Include the footprint references. - - ``plot_footprint_values`` :index:`: ` [boolean=true] Include the footprint values. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``scale_adjust_x`` :index:`: ` [number=1.0] Fine grain adjust for the X scale (floating point multiplier). - - ``scale_adjust_y`` :index:`: ` [number=1.0] Fine grain adjust for the Y scale (floating point multiplier). - - ``sketch_pad_line_width`` :index:`: ` [number=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). - - ``sketch_pads_on_fab_layers`` :index:`: ` [boolean=false] Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). - - ``sketch_plot`` :index:`: ` [boolean=false] Don't fill objects, just draw the outline. - - ``tent_vias`` :index:`: ` [boolean=true] Cover the vias. - - ``uppercase_extensions`` :index:`: ` [boolean=false] Use uppercase names for the extensions. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - - ``width_adjust`` :index:`: ` [number=0] This width factor is intended to compensate PS printers/plotters that do not strictly obey line width settings. - Only used to plot pads and tracks. - +- **options** :index:`: ` [:ref:`PSOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `ps` output. - **type** :index:`: ` 'ps' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Layer + PSOptions diff --git a/docs/source/configuration/outputs/ps_sch_print.rst b/docs/source/configuration/outputs/ps_sch_print.rst index 89535ce4c..805848e56 100644 --- a/docs/source/configuration/outputs/ps_sch_print.rst +++ b/docs/source/configuration/outputs/ps_sch_print.rst @@ -16,51 +16,33 @@ Category: **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `ps_sch_print` output. - - - Valid keys: - - - **frame** :index:`: ` [boolean=true] Include the frame and title block. - - ``all_pages`` :index:`: ` [boolean=true] Generate with all hierarchical sheets. - - ``background_color`` :index:`: ` [boolean=false] Use the background color from the `color_theme` (KiCad 6). - - ``color_theme`` :index:`: ` [string=''] Color theme used, this must exist in the KiCad config (KiCad 6). - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``monochrome`` :index:`: ` [boolean=false] Generate a monochromatic output. - - ``output`` :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output postscript (%i=schematic, %x=ps). Affected by global options. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``sheet_reference_layout`` :index:`: ` [string=''] 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 - file is available. - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Not fitted components are crossed. - +- **options** :index:`: ` [:ref:`PS_SCH_PrintOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `ps_sch_print` output. - **type** :index:`: ` 'ps_sch_print' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + PS_SCH_PrintOptions diff --git a/docs/source/configuration/outputs/qr_lib.rst b/docs/source/configuration/outputs/qr_lib.rst index 2ea90668c..ef338ad9b 100644 --- a/docs/source/configuration/outputs/qr_lib.rst +++ b/docs/source/configuration/outputs/qr_lib.rst @@ -20,50 +20,33 @@ Type: ``qr_lib`` Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `boardview` output. - - - Valid keys: - - - **lib** :index:`: ` [string='QR'] Short name for the library. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename/dirname for the output library (%i=qr, %x=lib/kicad_sym/pretty). - You must use %x in the name to get a symbols lib and a footprints lib. Affected by global options. - - **qrs** :index:`: ` [list(dict)] QR codes to include in the library. - - - Valid keys: - - - **layer** :index:`: ` [string='silk'] [silk,copper] Layer for the footprint. - - **name** :index:`: ` [string='QR'] Name for the symbol/footprint. - - **size_pcb** :index:`: ` [number=15] Size of the QR footprint. - - **size_sch** :index:`: ` [number=15] Size of the QR symbol. - - **text** :index:`: ` [string='%p %r'] Text to encode as QR. - - ``correction_level`` :index:`: ` [string='low'] [low,medium,quartile,high] Error correction level. - - ``pcb_negative`` :index:`: ` [boolean=false] Generate a negative image for the PCB. - - ``size_units`` :index:`: ` [string='millimeters'] [millimeters,inches] Units used for the size. - - - ``reference`` :index:`: ` [string='QR'] The reference prefix. - - ``use_sch_dir`` :index:`: ` [boolean=true] Generate the libs relative to the schematic/PCB dir. - +- **options** :index:`: ` [:ref:`QR_LibOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `boardview` output. - **type** :index:`: ` 'qr_lib' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=90] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``90``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + QR_LibOptions diff --git a/docs/source/configuration/outputs/render_3d.rst b/docs/source/configuration/outputs/render_3d.rst index e6f93dfd3..d38f15f9f 100644 --- a/docs/source/configuration/outputs/render_3d.rst +++ b/docs/source/configuration/outputs/render_3d.rst @@ -16,128 +16,33 @@ Category: **PCB/3D** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `render_3d` output. - - - Valid keys: - - - **download** :index:`: ` [boolean=true] Downloads missing 3D models from KiCad git. - Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. - They are downloaded to a temporal directory and discarded. - If you want to cache the downloaded files specify a directory using the - KIBOT_3D_MODELS environment variable. - - **move_x** :index:`: ` [number=0] Steps to move in the X axis, positive is to the right. - Just like pressing the right arrow in the 3D viewer. - - **move_y** :index:`: ` [number=0] Steps to move in the Y axis, positive is up. - Just like pressing the up arrow in the 3D viewer. - - **no_virtual** :index:`: ` [boolean=false] Used to exclude 3D models for components with 'virtual' attribute. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Name for the generated image file (%i='3D_$VIEW' %x='png'). Affected by global options. - - **ray_tracing** :index:`: ` [boolean=false] Enable the ray tracing. Much better result, but slow, and you'll need to adjust `wait_rt`. - - **rotate_x** :index:`: ` [number=0] Steps to rotate around the X axis, positive is clockwise. - Each step is currently 10 degrees. Only for KiCad 6 or newer. - - **rotate_y** :index:`: ` [number=0] Steps to rotate around the Y axis, positive is clockwise. - Each step is currently 10 degrees. Only for KiCad 6 or newer. - - **rotate_z** :index:`: ` [number=0] Steps to rotate around the Z axis, positive is clockwise. - Each step is currently 10 degrees. Only for KiCad 6 or newer. - - **show_components** :index:`: ` [list(string)|string=all] [none,all] List of components to draw, can be also a string for `none` or `all`. - Ranges like *R5-R10* are supported. - Unlike the `pcbdraw` output, the default is `all`. - - - **view** :index:`: ` [string='top'] [top,bottom,front,rear,right,left,z,Z,y,Y,x,X] Point of view. - - **zoom** :index:`: ` [number=0] Zoom steps. Use positive to enlarge, get closer, and negative to reduce. - Same result as using the mouse wheel in the 3D viewer. - Note that KiCad 8 starts with a zoom to fit, so you might not even need it. - - ``auto_crop`` :index:`: ` [boolean=false] When enabled the image will be post-processed to remove the empty space around the image. - In this mode the `background2` is changed to be the same as `background1`. - - ``background1`` :index:`: ` [string='#66667F'] First color for the background gradient. - - ``background2`` :index:`: ` [string='#CCCCE5'] Second color for the background gradient. - - ``board`` :index:`: ` [string='#332B16'] Color for the board without copper or solder mask. - - ``clip_silk_on_via_annulus`` :index:`: ` [boolean=true] Clip silkscreen at via annuli (KiCad 6+). - - ``copper`` :index:`: ` [string='#8b898c'] Color for the copper. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``download_lcsc`` :index:`: ` [boolean=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. - - ``force_stackup_colors`` :index:`: ` [boolean=false] Tell KiCad to use the colors from the stackup. They are better than the unified KiBot colors. - Needs KiCad 6 or newer. - - ``height`` :index:`: ` [number=720] Image height (aprox.). - - ``highlight`` :index:`: ` [list(string)=[]] List of components to highlight. Ranges like *R5-R10* are supported. - - - ``highlight_on_top`` :index:`: ` [boolean=false] Highlight over the component (not under). - - ``highlight_padding`` :index:`: ` [number=1.5] [0,1000] How much the highlight extends around the component [mm]. - - ``kicad_3d_url`` :index:`: ` [string='https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'] Base URL for the KiCad 3D models. - - ``kicad_3d_url_suffix`` :index:`: ` [string=''] 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. - - ``no_smd`` :index:`: ` [boolean=false] Used to exclude 3D models for surface mount components. - - ``no_tht`` :index:`: ` [boolean=false] Used to exclude 3D models for through hole components. - - ``orthographic`` :index:`: ` [boolean=false] Enable the orthographic projection mode (top view looks flat). - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``realistic`` :index:`: ` [boolean=true] When disabled we use the colors of the layers used by the GUI. Needs KiCad 6 or 7. - Is emulated on KiCad 8. - - ``show_adhesive`` :index:`: ` [boolean=false] Show the content of F.Adhesive/B.Adhesive layers. KiCad 6 or newer. - - ``show_board_body`` :index:`: ` [boolean=true] Show the PCB core material. KiCad 6 or newer. - - ``show_comments`` :index:`: ` [boolean=false] Show the content of the User.Comments and User.Drawings layer for KiCad 5, 6 and 7. - On KiCad 8 this option controls only the User.Comments and you have a separated option for the - User.Drawings called `show_drawings` - Note that KiCad 5/6/7 doesn't show it when `realistic` is enabled, but KiCad 8 does it. - Also note that KiCad 5 ray tracer shows comments outside the PCB, but newer KiCad versions - doesn't. - - ``show_drawings`` :index:`: ` [boolean=false] Show the content of the User.Drawings layer. Only available for KiCad 8 and newer. - Consult `show_comments` to learn when drawings are visible. - - ``show_eco`` :index:`: ` [boolean=false] Show the content of the Eco1.User/Eco2.User layers. - For KiCad 8 `show_eco1` and `show_eco2` are available. - Consult `show_comments` to learn when drawings are visible. - - ``show_eco1`` :index:`: ` [boolean=false] Show the content of the Eco1.User layer. KiCad 8 supports individual Eco layer options, for 6 and 7 - use the `show_eco` option. - Consult `show_comments` to learn when drawings are visible. - - ``show_eco2`` :index:`: ` [boolean=false] Show the content of the Eco1.User layer. KiCad 8 supports individual Eco layer options, for 6 and 7 - use the `show_eco` option. - Consult `show_comments` to learn when drawings are visible. - - ``show_silkscreen`` :index:`: ` [boolean=true] Show the silkscreen layers (KiCad 6+). - - ``show_soldermask`` :index:`: ` [boolean=true] Show the solder mask layers (KiCad 6+). - - ``show_solderpaste`` :index:`: ` [boolean=true] Show the solder paste layers (KiCad 6+). - - ``show_zones`` :index:`: ` [boolean=true] Show filled areas in zones (KiCad 6+). - - ``silk`` :index:`: ` [string='#d5dce4'] Color for the silk screen. - - ``solder_mask`` :index:`: ` [string='#208b47'] Color for the solder mask. - - ``solder_paste`` :index:`: ` [string='#808080'] Color for the solder paste. - - ``subtract_mask_from_silk`` :index:`: ` [boolean=true] Clip silkscreen at solder mask edges (KiCad 6+). - - ``transparent_background`` :index:`: ` [boolean=false] When enabled the image will be post-processed to make the background transparent. - In this mode the `background1` and `background2` colors are ignored. - - ``transparent_background_color`` :index:`: ` [string='#00ff00'] Color used for the chroma key. Adjust it if some regions of the board becomes transparent. - - ``transparent_background_fuzz`` :index:`: ` [number=15] [0,100] Chroma key tolerance (percent). Bigger values will remove more pixels. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - - *wait_ray_tracing* :index:`: ` Alias for wait_render. - - ``wait_render`` :index:`: ` [number=-600] How many seconds we must wait before capturing the render (ray tracing or normal). - Lamentably KiCad can save an unfinished image. Enlarge it if your image looks partially rendered. - Use negative values to enable the auto-detect using CPU load. - In this case the value is interpreted as a time-out.. - - ``width`` :index:`: ` [number=1280] Image width (aprox.). - +- **options** :index:`: ` [:ref:`Render3DOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `render_3d` output. - **type** :index:`: ` 'render_3d' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Render3DOptions diff --git a/docs/source/configuration/outputs/report.rst b/docs/source/configuration/outputs/report.rst index 655f05d12..644879105 100644 --- a/docs/source/configuration/outputs/report.rst +++ b/docs/source/configuration/outputs/report.rst @@ -17,50 +17,33 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `report` output. - - - Valid keys: - - - **convert_to** :index:`: ` [string='pdf'] Target format for the report conversion. See `do_convert`. - - **do_convert** :index:`: ` [boolean=false] Run `Pandoc` to convert the report. Note that Pandoc must be installed. - The conversion is done assuming the report is in `convert_from` format. - The output file will be in `convert_to` format. - The available formats depends on the `Pandoc` installation. - In CI/CD environments: the `kicad_auto_test` docker image contains it. - In Debian/Ubuntu environments: install `pandoc`, `texlive`, `texlive-latex-base` and `texlive-latex-recommended`. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Output file name (%i='report', %x='txt'). Affected by global options. - - **template** :index:`: ` [string='full'] Name for one of the internal templates (full, full_svg, simple) or a custom template file. - Environment variables and ~ are allowed. - Note: when converting to PDF PanDoc can fail on some Unicode values (use `simple_ASCII`). - - ``convert_from`` :index:`: ` [string='markdown'] Original format for the report conversion. Current templates are `markdown`. See `do_convert`. - - ``converted_output`` :index:`: ` [string='%f-%i%I%v.%x'] Converted output file name (%i='report', %x=`convert_to`). - Note that the extension should match the `convert_to` value. Affected by global options. - - ``eurocircuits_class_target`` :index:`: ` [string='10F'] Which Eurocircuits class are we aiming at. - - ``eurocircuits_reduce_holes`` :index:`: ` [number=0.45] When computing the Eurocircuits category: Final holes sizes smaller or equal to this given - diameter can be reduced to accommodate the correct annular ring values. - Use 0 to disable it. - +- **options** :index:`: ` [:ref:`ReportOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `report` output. - **type** :index:`: ` 'report' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + ReportOptions diff --git a/docs/source/configuration/outputs/sch_variant.rst b/docs/source/configuration/outputs/sch_variant.rst index dfcc40aa1..17e385201 100644 --- a/docs/source/configuration/outputs/sch_variant.rst +++ b/docs/source/configuration/outputs/sch_variant.rst @@ -15,43 +15,33 @@ Type: ``sch_variant`` Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `sch_variant` output. - - - Valid keys: - - - ``copy_project`` :index:`: ` [boolean=false] Copy the KiCad project to the destination directory. - Disabled by default for compatibility with older versions. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`Sch_Variant_Options parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `sch_variant` output. - **type** :index:`: ` 'sch_variant' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Sch_Variant_Options diff --git a/docs/source/configuration/outputs/stencil_3d.rst b/docs/source/configuration/outputs/stencil_3d.rst index 718bda62b..d2587e1da 100644 --- a/docs/source/configuration/outputs/stencil_3d.rst +++ b/docs/source/configuration/outputs/stencil_3d.rst @@ -20,58 +20,33 @@ Category: **PCB/fabrication/assembly** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `stencil_3d` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i='stencil_3d_top'|'stencil_3d_bottom'|'stencil_3d_edge', - %x='stl'|'scad'|'dxf'|'png'). Affected by global options. - - **thickness** :index:`: ` [number=0.15] Stencil thickness [mm]. Defines amount of paste dispensed. - - ``create_preview`` :index:`: ` [boolean=true] Creates a PNG showing the generated 3D model. - - ``cutout`` :index:`: ` [string|list(string)] List of components to add a cutout based on the component courtyard. - This is useful when you have already pre-populated board and you want to populate more - components. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - *enlarge_holes* :index:`: ` Alias for enlarge_holes. - - ``enlargeholes`` :index:`: ` [number=0] Enlarge pad holes by x mm. - - *frame_clearance* :index:`: ` Alias for frameclearance. - - *frame_width* :index:`: ` Alias for framewidth. - - ``frameclearance`` :index:`: ` [number=0] Clearance for the stencil register [mm]. - - ``framewidth`` :index:`: ` [number=1] Register frame width. - - ``include_scad`` :index:`: ` [boolean=true] Include the generated OpenSCAD files. - Note that this also includes the DXF files. - - *pcb_thickness* :index:`: ` Alias for pcbthickness. - - ``pcbthickness`` :index:`: ` [number=0] PCB thickness [mm]. If 0 we will ask KiCad. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``side`` :index:`: ` [string='auto'] [top,bottom,auto,both] Which side of the PCB we want. Using `auto` will detect which - side contains solder paste. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`Stencil_3D_Options parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `stencil_3d` output. - **type** :index:`: ` 'stencil_3d' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Stencil_3D_Options diff --git a/docs/source/configuration/outputs/stencil_for_jig.rst b/docs/source/configuration/outputs/stencil_for_jig.rst index a0120f5b7..3747564e2 100644 --- a/docs/source/configuration/outputs/stencil_for_jig.rst +++ b/docs/source/configuration/outputs/stencil_for_jig.rst @@ -18,61 +18,33 @@ Category: **PCB/fabrication/assembly** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `stencil_for_jig` output. - - - Valid keys: - - - *jig_height* :index:`: ` Alias for jigheight. - - *jig_thickness* :index:`: ` Alias for jigthickness. - - *jig_width* :index:`: ` Alias for jigwidth. - - **jigheight** :index:`: ` [number=100] Jig frame height [mm]. - - **jigthickness** :index:`: ` [number=3] Jig thickness [mm]. - - **jigwidth** :index:`: ` [number=100] Jig frame width [mm]. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i='stencil_for_jig_top'|'stencil_for_jig_bottom', - %x='stl'|'scad'|'gbp'|'gtp'|'gbrjob'|'png'). Affected by global options. - - ``create_preview`` :index:`: ` [boolean=true] Creates a PNG showing the generated 3D model. - - ``cutout`` :index:`: ` [string|list(string)] List of components to add a cutout based on the component courtyard. - This is useful when you have already pre-populated board and you want to populate more - components. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``include_scad`` :index:`: ` [boolean=true] Include the generated OpenSCAD files. - - *pcb_thickness* :index:`: ` Alias for pcbthickness. - - ``pcbthickness`` :index:`: ` [number=0] PCB thickness [mm]. If 0 we will ask KiCad. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - *register_border_inner* :index:`: ` Alias for registerborderinner. - - *register_border_outer* :index:`: ` Alias for registerborderouter. - - ``registerborderinner`` :index:`: ` [number=1] Inner register border [mm]. - - ``registerborderouter`` :index:`: ` [number=3] Outer register border [mm]. - - ``side`` :index:`: ` [string='auto'] [top,bottom,auto,both] Which side of the PCB we want. Using `auto` will detect which - side contains solder paste. - - ``tolerance`` :index:`: ` [number=0.05] Enlarges the register by the tolerance value [mm]. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`Stencil_For_Jig_Options parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `stencil_for_jig` output. - **type** :index:`: ` 'stencil_for_jig' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Stencil_For_Jig_Options diff --git a/docs/source/configuration/outputs/step.rst b/docs/source/configuration/outputs/step.rst index 3d7f42a25..1b6dcee27 100644 --- a/docs/source/configuration/outputs/step.rst +++ b/docs/source/configuration/outputs/step.rst @@ -16,59 +16,33 @@ Category: **PCB/3D** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `step` output. - - - Valid keys: - - - **download** :index:`: ` [boolean=true] Downloads missing 3D models from KiCad git. - Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. - They are downloaded to a temporal directory and discarded. - If you want to cache the downloaded files specify a directory using the - KIBOT_3D_MODELS environment variable. - - **no_virtual** :index:`: ` [boolean=false] Used to exclude 3D models for components with 'virtual' attribute. - - **origin** :index:`: ` [string='grid'] Determines the coordinates origin. Using grid the coordinates are the same as you have in the design sheet. - The drill option uses the auxiliary reference defined by the user. - You can define any other origin using the format 'X,Y', i.e. '3.2,-10'. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Name for the generated STEP file (%i='3D' %x='step'). Affected by global options. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``download_lcsc`` :index:`: ` [boolean=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. - - ``kicad_3d_url`` :index:`: ` [string='https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'] Base URL for the KiCad 3D models. - - ``kicad_3d_url_suffix`` :index:`: ` [string=''] 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. - - ``metric_units`` :index:`: ` [boolean=true] Use metric units instead of inches. - - ``min_distance`` :index:`: ` [number=-1] The minimum distance between points to treat them as separate ones (-1 is KiCad default: 0.01 mm). - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``subst_models`` :index:`: ` [boolean=true] Substitute STEP or IGS models with the same name in place of VRML models. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`STEPOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `step` output. - **type** :index:`: ` 'step' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + STEPOptions diff --git a/docs/source/configuration/outputs/svg.rst b/docs/source/configuration/outputs/svg.rst index 33bb80e06..5703622ee 100644 --- a/docs/source/configuration/outputs/svg.rst +++ b/docs/source/configuration/outputs/svg.rst @@ -18,108 +18,36 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **layers** :index:`: ` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to plot. - - - Valid keys: - - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **layers** :index:`: ` [:ref:`Layer parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string) List + of PCB layers to plot. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `svg` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Output file name, the default KiCad name if empty. - IMPORTANT! KiCad will always create the file using its own name and then we can rename it. - For this reason you must avoid generating two variants at the same directory when one of - them uses the default KiCad name. Affected by global options. - - **plot_sheet_reference** :index:`: ` [boolean=false] Include the frame and title block. Only available for KiCad 6+ and you get a poor result - (i.e. always the default worksheet style, also problems expanding text variables). - The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs. - - **scaling** :index:`: ` [number=1] Scale factor (0 means autoscaling). - - ``custom_reports`` :index:`: ` [list(dict)] A list of customized reports for the manufacturer. - - - Valid keys: - - - ``content`` :index:`: ` [string=''] Content for the report. Use ``${basename}`` for the project name without extension. - Use ``${filename(LAYER)}`` for the file corresponding to LAYER. - - ``output`` :index:`: ` [string='Custom_report.txt'] File name for the custom report. - - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``drill_marks`` :index:`: ` [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale). - - ``edge_cut_extension`` :index:`: ` [string=''] Used to configure the edge cuts layer extension for Protel mode. Include the dot. - - ``exclude_edge_layer`` :index:`: ` [boolean=true] Do not include the PCB edge layer. - - ``exclude_pads_from_silkscreen`` :index:`: ` [boolean=false] Do not plot the component pads in the silk screen (KiCad 5.x only). - - ``force_plot_invisible_refs_vals`` :index:`: ` [boolean=false] Include references and values even when they are marked as invisible. - - ``individual_page_scaling`` :index:`: ` [boolean=true] Tell KiCad to apply the scaling for each layer as a separated entity. - Disabling it the pages are coherent and can be superposed. - - ``inner_extension_pattern`` :index:`: ` [string=''] Used to change the Protel style extensions for inner layers. - The replacement pattern can contain %n for the inner layer number and %N for the layer number. - Example '.g%n'. - - ``limit_viewbox`` :index:`: ` [boolean=false] When enabled the view box is limited to a selected area. - This option can't be enabled when using a scale. - - ``line_width`` :index:`: ` [number=0.25] [0.02,2] For objects without width [mm] (KiCad 5). - - ``margin`` :index:`: ` [number|dict] Margin around the view box [mm]. - Using a number the margin is the same in the four directions. - See `limit_viewbox` option. - - - Valid keys: - - - ``bottom`` :index:`: ` [number=0] Bottom margin [mm]. - - ``left`` :index:`: ` [number=0] Left margin [mm]. - - ``right`` :index:`: ` [number=0] Right margin [mm]. - - ``top`` :index:`: ` [number=0] Top margin [mm]. - - - ``mirror_plot`` :index:`: ` [boolean=false] Plot mirrored. - - ``negative_plot`` :index:`: ` [boolean=false] Invert black and white. - - ``plot_footprint_refs`` :index:`: ` [boolean=true] Include the footprint references. - - ``plot_footprint_values`` :index:`: ` [boolean=true] Include the footprint values. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``size_detection`` :index:`: ` [string='kicad_edge'] [kicad_edge,kicad_all] Method used to detect the size of the view box. - The `kicad_edge` method uses the size of the board as reported by KiCad, - components that extend beyond the PCB limit will be cropped. You can manually - adjust the margin to make them visible. - The `kicad_all` method uses the whole size reported by KiCad. Usually includes extra space. - See `limit_viewbox` option. - - ``sketch_pad_line_width`` :index:`: ` [number=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). - - ``sketch_pads_on_fab_layers`` :index:`: ` [boolean=false] Draw only the outline of the pads on the \\*.Fab layers (KiCad 6+). - - ``svg_precision`` :index:`: ` [number=4] [0,6] Scale factor used to represent 1 mm in the SVG (KiCad 6). - The value is how much zeros has the multiplier (1 mm = 10 power `svg_precision` units). - Note that for an A4 paper Firefox 91 and Chrome 105 can't handle more than 5. - - ``tent_vias`` :index:`: ` [boolean=true] Cover the vias. - - ``uppercase_extensions`` :index:`: ` [boolean=false] Use uppercase names for the extensions. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`SVGOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `svg` output. - **type** :index:`: ` 'svg' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Layer + SVGOptions diff --git a/docs/source/configuration/outputs/svg_pcb_print.rst b/docs/source/configuration/outputs/svg_pcb_print.rst index a50f61b27..64e4b174b 100644 --- a/docs/source/configuration/outputs/svg_pcb_print.rst +++ b/docs/source/configuration/outputs/svg_pcb_print.rst @@ -17,70 +17,36 @@ Category: **PCB/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **layers** :index:`: ` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to include in the PDF. - - - Valid keys: - - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. - A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. - A default can be specified using the `layer_defaults` global option. - -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **layers** :index:`: ` [:ref:`Layer parameters `] [:ref:`list(dict) ` | :ref:`list(string) ` | :ref:`string `] (default: ``'all'``) (choices: "all", "selected", "copper", "technical", "user", "inners", "outers") (also accepts any string) List + of PCB layers to include in the PDF. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `pdf_pcb_print` output. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output SVG (%i=layers, %x=svg). Affected by global options. - - *output_name* :index:`: ` Alias for output. - - **plot_sheet_reference** :index:`: ` [boolean=true] Include the title-block. - - **scaling** :index:`: ` [number=1.0] Scale factor (0 means autoscaling). You should disable `plot_sheet_reference` when using it. - - **separated** :index:`: ` [boolean=false] Print layers in separated pages. - - ``color_theme`` :index:`: ` [string='_builtin_classic'] Selects the color theme. Onlyu applies to KiCad 6. - To use the KiCad 6 default colors select `_builtin_default`. - Usually user colors are stored as `user`, but you can give it another name. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``drill_marks`` :index:`: ` [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale). - - ``enable_ki5_page_fix`` :index:`: ` [boolean=true] Enable workaround for KiCad 5 bug. - - ``enable_ki6_page_fix`` :index:`: ` [boolean=true] Enable workaround for KiCad 6 bug #11033. - - ``force_edge_cuts`` :index:`: ` [boolean=true] Only useful for KiCad 6 when printing in one page, you can disable the edge here. - KiCad 5 forces it by default, and you can't control it from config files. - Same for KiCad 6 when printing to separated pages. - - ``hide_excluded`` :index:`: ` [boolean=false] Hide components in the Fab layer that are marked as excluded by a variant. - Affected by global options. - - ``mirror`` :index:`: ` [boolean=false] Print mirrored (X axis inverted). ONLY for KiCad 6. - - ``monochrome`` :index:`: ` [boolean=false] Print in black and white. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`SVG_PCB_PrintOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `pdf_pcb_print` output. - **type** :index:`: ` 'svg_pcb_print' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + Layer + SVG_PCB_PrintOptions diff --git a/docs/source/configuration/outputs/svg_sch_print.rst b/docs/source/configuration/outputs/svg_sch_print.rst index f58125f10..22b1da9f5 100644 --- a/docs/source/configuration/outputs/svg_sch_print.rst +++ b/docs/source/configuration/outputs/svg_sch_print.rst @@ -17,51 +17,33 @@ Category: **Schematic/docs** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `svg_sch_print` output. - - - Valid keys: - - - **frame** :index:`: ` [boolean=true] Include the frame and title block. - - ``all_pages`` :index:`: ` [boolean=true] Generate with all hierarchical sheets. - - ``background_color`` :index:`: ` [boolean=false] Use the background color from the `color_theme` (KiCad 6). - - ``color_theme`` :index:`: ` [string=''] Color theme used, this must exist in the KiCad config (KiCad 6). - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``monochrome`` :index:`: ` [boolean=false] Generate a monochromatic output. - - ``output`` :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output SVG (%i=schematic, %x=svg). Affected by global options. - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``sheet_reference_layout`` :index:`: ` [string=''] 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 - file is available. - - ``title`` :index:`: ` [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. - If it starts with `+` the text is concatenated. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - Not fitted components are crossed. - +- **options** :index:`: ` [:ref:`SVG_SCH_PrintOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `svg_sch_print` output. - **type** :index:`: ` 'svg_sch_print' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + SVG_SCH_PrintOptions diff --git a/docs/source/configuration/outputs/vrml.rst b/docs/source/configuration/outputs/vrml.rst index 2e68a9a00..8df5cdbfa 100644 --- a/docs/source/configuration/outputs/vrml.rst +++ b/docs/source/configuration/outputs/vrml.rst @@ -16,72 +16,33 @@ Category: **PCB/3D** Parameters: -- **comment** :index:`: ` [string=''] A comment for documentation purposes. It helps to identify the output. -- **dir** :index:`: ` [string='./'] Output directory for the generated files. +- **comment** :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. It helps to identify the output. +- **dir** :index:`: ` [:ref:`string `] (default: ``'./'``) Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir. -- **name** :index:`: ` [string=''] Used to identify this particular output definition. +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular output definition. Avoid using `_` as first character. These names are reserved for KiBot. -- **options** :index:`: ` [dict] Options for the `vrml` output. - - - Valid keys: - - - **download** :index:`: ` [boolean=true] Downloads missing 3D models from KiCad git. - Only applies to models in KISYS3DMOD and KICAD6_3DMODEL_DIR. - They are downloaded to a temporal directory and discarded. - If you want to cache the downloaded files specify a directory using the - KIBOT_3D_MODELS environment variable. - - **no_virtual** :index:`: ` [boolean=false] Used to exclude 3D models for components with 'virtual' attribute. - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Filename for the output (%i=vrml, %x=wrl). Affected by global options. - - **show_components** :index:`: ` [list(string)|string=all] [none,all] List of components to draw, can be also a string for `none` or `all`. - Ranges like *R5-R10* are supported. - Unlike the `pcbdraw` output, the default is `all`. - - - ``dir_models`` :index:`: ` [string='shapes3D'] Subdirectory used to store the 3D models for the components. - If you want to create a monolithic file just use '' here. - Note that the WRL file will contain relative paths to the models. - - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. - A short-cut to use for simple cases where a variant is an overkill. - - - ``download_lcsc`` :index:`: ` [boolean=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. - - ``highlight`` :index:`: ` [list(string)=[]] List of components to highlight. Ranges like *R5-R10* are supported. - - - ``highlight_on_top`` :index:`: ` [boolean=false] Highlight over the component (not under). - - ``highlight_padding`` :index:`: ` [number=1.5] [0,1000] How much the highlight extends around the component [mm]. - - ``kicad_3d_url`` :index:`: ` [string='https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'] Base URL for the KiCad 3D models. - - ``kicad_3d_url_suffix`` :index:`: ` [string=''] 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. - - ``model_units`` :index:`: ` [string='millimeters'] [millimeters,meters,deciinches,inches] Units used for the VRML (1 deciinch = 0.1 inches). - - ``pre_transform`` :index:`: ` [string|list(string)='_none'] 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. - - - ``ref_units`` :index:`: ` [string='millimeters'] [millimeters,inches'] Units for `ref_x` and `ref_y`. - - ``ref_x`` :index:`: ` [number=0] X coordinate to use as reference when `use_pcb_center_as_ref` and `use_pcb_center_as_ref` are disabled. - - ``ref_y`` :index:`: ` [number=0] Y coordinate to use as reference when `use_pcb_center_as_ref` and `use_pcb_center_as_ref` are disabled. - - ``use_aux_axis_as_origin`` :index:`: ` [boolean=false] Use the auxiliary axis as origin for coordinates. - Has more precedence than `use_pcb_center_as_ref`. - - ``use_pcb_center_as_ref`` :index:`: ` [boolean=true] The center of the PCB will be used as reference point. - When disabled the `ref_x`, `ref_y` and `ref_units` will be used. - - ``variant`` :index:`: ` [string=''] Board variant to apply. - +- **options** :index:`: ` [:ref:`VRMLOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `vrml` output. - **type** :index:`: ` 'vrml' -- ``category`` :index:`: ` [string|list(string)=''] The category for this output. If not specified an internally defined category is used. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. -- ``disable_run_by_default`` :index:`: ` [string|boolean] Use it to disable the `run_by_default` status of other output. +- ``disable_run_by_default`` :index:`: ` [:ref:`string ` | :ref:`boolean `] (default: ``''``) Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending. -- ``extends`` :index:`: ` [string=''] Copy the `options` section from the indicated output. +- ``extends`` :index:`: ` [:ref:`string `] (default: ``''``) Copy the `options` section from the indicated output. Used to inherit options from another output of the same type. -- ``groups`` :index:`: ` [string|list(string)=''] One or more groups to add this output. In order to catch typos +- ``groups`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) One or more groups to add this output. In order to catch typos we recommend to add outputs only to existing groups. You can create an empty group if needed. -- ``output_id`` :index:`: ` [string=''] Text to use for the %I expansion content. To differentiate variations of this output. -- ``priority`` :index:`: ` [number=50] [0,100] Priority for this output. High priority outputs are created first. +- ``output_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use for the %I expansion content. To differentiate variations of this output. +- ``priority`` :index:`: ` [:ref:`number `] (default: ``50``) (range: 0 to 100) Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. -- ``run_by_default`` :index:`: ` [boolean=true] When enabled this output will be created when no specific outputs are requested. +- ``run_by_default`` :index:`: ` [:ref:`boolean `] (default: ``true``) When enabled this output will be created when no specific outputs are requested. + +.. toctree:: + :caption: Used dicts + VRMLOptions diff --git a/docs/source/configuration/preflight.rst b/docs/source/configuration/preflight.rst index a702aeb89..bfa637c76 100644 --- a/docs/source/configuration/preflight.rst +++ b/docs/source/configuration/preflight.rst @@ -18,11 +18,9 @@ Here is an example of a *preflight* section: .. code:: yaml preflight: - run_erc: true - update_xml: true - run_drc: true + erc: true + drc: true check_zone_fills: true - ignore_unconnected: false @@ -57,10 +55,16 @@ that doesnā€™t want to take the extra effort to solve some errors that arenā€™t in fact errors, just small violations made on purpose. In this case you could exclude some known errors. -For this you must declare ``filters`` entry in the ``preflight`` -section. Then you can add as many ``filter`` entries as you want. Each +KiCad 5 didn't have a mechanism to exclude errors. KiCad 6 introduced +exclusion, but they failed to be honred when using the Python API. +Starting with KiCad 8 you can use KiCad exclusions, but in some cases +they fail, this is because they are very specific. KiBot filters are +more generic and can solve cases where KiCad exclusions aren't enough. + +For this you must declare ``filters`` entry in the ``drc`` and/or ``erc`` +sections. Then you can add as many ``filter`` entries as you want. Each filter entry has an optional description and defines to which error type -is applied (``number``) and a regular expression that the error must +is applied (``error``) and a regular expression that the error must match to be ignored (``regex``). Like this: .. code:: yaml @@ -114,5 +118,12 @@ Note that this will ignore the errors, but they will be reported as warnings. If you want to suppress these warnings take a look at :ref:`filter-kibot-warnings` -**Important note**: this will create a file named *kibot_errors.filter* -in the output directory. +.. note:: + The old ``run_drc`` and ``run_erc`` preflights used a + separated ``filters`` preflight. Avoid using it with the new ``drc`` and + ``erc`` preflights, they have its own ``filters`` option. + +.. note:: + When using the old ``run_drc`` and ``run_erc`` + preflights the ``filters`` preflight will create a file named + *kibot_errors.filter* in the output directory. diff --git a/docs/source/configuration/preflights/Annotate_PCBOptions.rst b/docs/source/configuration/preflights/Annotate_PCBOptions.rst new file mode 100644 index 000000000..a900354c4 --- /dev/null +++ b/docs/source/configuration/preflights/Annotate_PCBOptions.rst @@ -0,0 +1,22 @@ +.. _Annotate_PCBOptions: + + +Annotate_PCBOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``bottom_main_ascending`` :index:`: ` [:ref:`boolean `] (default: ``true``) Sort the main axis in ascending order for the bottom layer. + For X this is left to right and for Y top to bottom. +- ``bottom_main_axis`` :index:`: ` [:ref:`string `] (default: ``'y'``) (choices: "x", "y") Use this axis as main sorting criteria for the bottom layer. +- ``bottom_secondary_ascending`` :index:`: ` [:ref:`boolean `] (default: ``true``) Sort the secondary axis in ascending order for the bottom layer. + For X this is left to right and for Y top to bottom. +- ``bottom_start`` :index:`: ` [:ref:`number `] (default: ``101``) First number for references at the bottom layer. + Use -1 to continue from the last top reference. +- ``grid`` :index:`: ` [:ref:`number `] (default: ``1.0``) Grid size in millimeters. +- ``top_main_ascending`` :index:`: ` [:ref:`boolean `] (default: ``true``) Sort the main axis in ascending order for the top layer. + For X this is left to right and for Y top to bottom. +- ``top_main_axis`` :index:`: ` [:ref:`string `] (default: ``'y'``) (choices: "x", "y") Use this axis as main sorting criteria for the top layer. +- ``top_secondary_ascending`` :index:`: ` [:ref:`boolean `] (default: ``true``) Sort the secondary axis in ascending order for the top layer. + For X this is left to right and for Y top to bottom. +- ``top_start`` :index:`: ` [:ref:`number `] (default: ``1``) First number for references at the top layer. +- ``use_position_of`` :index:`: ` [:ref:`string `] (default: ``'footprint'``) (choices: "footprint", "reference") Which coordinate is used. + diff --git a/docs/source/configuration/preflights/DRCOptions.rst b/docs/source/configuration/preflights/DRCOptions.rst new file mode 100644 index 000000000..7703bcb38 --- /dev/null +++ b/docs/source/configuration/preflights/DRCOptions.rst @@ -0,0 +1,31 @@ +.. _DRCOptions: + + +DRCOptions parameters +~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the generated archive (%i=drc %x=according to format). Affected by global options. +- ``all_track_errors`` :index:`: ` [:ref:`boolean `] (default: ``false``) Report all the errors for all the tracks, not just the first. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this preflight. If not specified an internally defined + category is used. + Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. + The categories are currently used for `navigate_results`. + +- ``dir`` :index:`: ` [:ref:`string `] (default: ``''``) Sub-directory for the report. +- ``dont_stop`` :index:`: ` [:ref:`boolean `] (default: ``false``) Continue even if we detect errors. +- ``enabled`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable the check. This is the replacement for the boolean value. +- ``filters`` :index:`: ` [:ref:`FilterOptionsXRC parameters `] [:ref:`list(dict) `] (default: ``[]``) Used to manipulate the violations. Avoid using the *filters* preflight. +- ``force_english`` :index:`: ` [:ref:`boolean `] (default: ``true``) Force english messages. KiCad 8.0.4 introduced translation, breaking filters for previous versions. + Disable it if you prefer using the system wide language. +- ``format`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'HTML'``) (choices: "RPT", "HTML", "CSV", "JSON") [:ref:`comma separated `] Format/s used for the report. + You can specify multiple formats. + +- ``ignore_unconnected`` :index:`: ` [:ref:`boolean `] (default: ``false``) Ignores the unconnected nets. Useful if you didn't finish the routing. +- ``schematic_parity`` :index:`: ` [:ref:`boolean `] (default: ``true``) Check if the PCB and the schematic are coincident. +- ``units`` :index:`: ` [:ref:`string `] (default: ``'millimeters'``) (choices: "millimeters", "inches", "mils") Units used for the positions. Affected by global options. +- ``warnings_as_errors`` :index:`: ` [:ref:`boolean `] (default: ``false``) Warnings are considered errors, they still reported as warnings. + +.. toctree:: + :caption: Used dicts + + FilterOptionsXRC diff --git a/docs/source/configuration/preflights/DrawStackupOptions.rst b/docs/source/configuration/preflights/DrawStackupOptions.rst new file mode 100644 index 000000000..31bdbc395 --- /dev/null +++ b/docs/source/configuration/preflights/DrawStackupOptions.rst @@ -0,0 +1,31 @@ +.. _DrawStackupOptions: + + +DrawStackupOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **columns** :index:`: ` [:ref:`SUColumns parameters `] [:ref:`list(dict) ` | :ref:`list(string) `] (default: computed for your project) List of columns to display. + Can be just the name of the column. + Available columns are *gerber*, *drawing*, *thickness* and *description*. + When empty KiBot will add them in the above order, skipping the *gerber* if not available. +- **gerber** :index:`: ` [:ref:`string `] (default: ``''``) Name of the output used to generate the gerbers. This is needed only when you + want to include the *gerber* column, containing the gerber file names. +- ``border`` :index:`: ` [:ref:`number `] (default: ``0.1``) Line width for the border box. Use 0 to eliminate it. +- ``enabled`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable the check. This is the replacement for the boolean value. +- ``group_name`` :index:`: ` [:ref:`string `] (default: ``'kibot_stackup'``) Name for the group containing the drawings. If KiBot can't find it will create + a new group at the specified coordinates for the indicated layer. +- ``height`` :index:`: ` [:ref:`number `] (default: ``200``) Height for the drawing. The units are defined by the global *units* variable. + Only used when the group can't be found. +- ``layer`` :index:`: ` [:ref:`string `] (default: ``'Cmts.User'``) Layer used for the stackup. Only used when the group can't be found. + Otherwise we use the layer for the first object in the group. +- ``pos_x`` :index:`: ` [:ref:`number `] (default: ``19``) X position in the PCB. The units are defined by the global *units* variable. + Only used when the group can't be found. +- ``pos_y`` :index:`: ` [:ref:`number `] (default: ``100``) Y position in the PCB. The units are defined by the global *units* variable. + Only used when the group can't be found. +- ``width`` :index:`: ` [:ref:`number `] (default: ``120``) Width for the drawing. The units are defined by the global *units* variable. + Only used when the group can't be found. + +.. toctree:: + :caption: Used dicts + + SUColumns diff --git a/docs/source/configuration/preflights/ERCOptions.rst b/docs/source/configuration/preflights/ERCOptions.rst new file mode 100644 index 000000000..949b5e70a --- /dev/null +++ b/docs/source/configuration/preflights/ERCOptions.rst @@ -0,0 +1,28 @@ +.. _ERCOptions: + + +ERCOptions parameters +~~~~~~~~~~~~~~~~~~~~~ + +- **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Name for the generated archive (%i=erc %x=according to format). Affected by global options. +- ``category`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] The category for this preflight. If not specified an internally defined + category is used. + Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. + The categories are currently used for `navigate_results`. + +- ``dir`` :index:`: ` [:ref:`string `] (default: ``''``) Sub-directory for the report. +- ``dont_stop`` :index:`: ` [:ref:`boolean `] (default: ``false``) Continue even if we detect errors. +- ``enabled`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable the check. This is the replacement for the boolean value. +- ``filters`` :index:`: ` [:ref:`FilterOptionsXRC parameters `] [:ref:`list(dict) `] (default: ``[]``) Used to manipulate the violations. Avoid using the *filters* preflight. +- ``force_english`` :index:`: ` [:ref:`boolean `] (default: ``true``) Force english messages. KiCad 8.0.4 introduced translation, breaking filters for previous versions. + Disable it if you prefer using the system wide language. +- ``format`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'HTML'``) (choices: "RPT", "HTML", "CSV", "JSON") [:ref:`comma separated `] Format/s used for the report. + You can specify multiple formats. + +- ``units`` :index:`: ` [:ref:`string `] (default: ``'millimeters'``) (choices: "millimeters", "inches", "mils") Units used for the positions. Affected by global options. +- ``warnings_as_errors`` :index:`: ` [:ref:`boolean `] (default: ``false``) Warnings are considered errors, they still reported as warnings. + +.. toctree:: + :caption: Used dicts + + FilterOptionsXRC diff --git a/docs/source/configuration/preflights/FieldCheck.rst b/docs/source/configuration/preflights/FieldCheck.rst new file mode 100644 index 000000000..ffdfdaaf3 --- /dev/null +++ b/docs/source/configuration/preflights/FieldCheck.rst @@ -0,0 +1,26 @@ +.. _FieldCheck: + + +FieldCheck parameters +~~~~~~~~~~~~~~~~~~~~~ + +- **field** :index:`: ` [:ref:`string `] (default: ``''``) Name of field to check. +- **regex** :index:`: ` [:ref:`string `] (default: ``''``) Regular expression to match the field content. Note that technically we do a search, not a match. +- *regexp* :index:`: ` Alias for regex. +- ``numeric_condition`` :index:`: ` [:ref:`string `] (default: ``'none'``) (choices: ">", ">=", "<", "<=", "=", "none") Convert the group 1 of the regular expression to a number and apply this operation + to the *numeric_reference* value. +- ``numeric_reference`` :index:`: ` [:ref:`number `] (default: ``0``) Value to compare using *numeric_condition*. +- ``severity`` :index:`: ` [:ref:`string `] (default: ``'error'``) (choices: "error", "warning", "info", "skip", "continue") Default severity applied to various situations. + The *error* will stop execution. + The *warning* and *info* will generate a message and continue with the rest of the tests. + In the *skip* case we jump to the next component. + Use *continue* to just skip this test and apply the rest. +- ``severity_fail_condition`` :index:`: ` [:ref:`string `] (default: ``'default'``) (choices: "error", "warning", "info", "skip", "continue", "default") What to do when the *numeric_condition* isn't met. + Default means to use the *severity* option. +- ``severity_missing`` :index:`: ` [:ref:`string `] (default: ``'continue'``) (choices: "error", "warning", "info", "skip", "continue", "default") What to do if the field isn't defined. + Default means to use the *severity* option. +- ``severity_no_match`` :index:`: ` [:ref:`string `] (default: ``'default'``) (choices: "error", "warning", "info", "skip", "continue", "default") What to do when the regex doesn't match. + Default means to use the *severity* option. +- ``severity_no_number`` :index:`: ` [:ref:`string `] (default: ``'default'``) (choices: "error", "warning", "info", "skip", "continue", "default") What to do if we don't get a number for a *numeric_condition*. + Default means to use the *severity* option. + diff --git a/docs/source/configuration/preflights/FilterOptions.rst b/docs/source/configuration/preflights/FilterOptions.rst new file mode 100644 index 000000000..5f9e67219 --- /dev/null +++ b/docs/source/configuration/preflights/FilterOptions.rst @@ -0,0 +1,16 @@ +.. _FilterOptions: + + +FilterOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``error`` :index:`: ` [:ref:`string `] (default: ``''``) Error id we want to exclude. + A name for KiCad 6 or a number for KiCad 5, but always a string. +- *error_number* :index:`: ` Alias for number. +- ``filter`` :index:`: ` [:ref:`string `] (default: ``''``) Name for the filter, for documentation purposes. +- *filter_msg* :index:`: ` Alias for filter. +- ``number`` :index:`: ` [:ref:`number `] (default: ``0``) Error number we want to exclude. + KiCad 5 only. +- ``regex`` :index:`: ` [:ref:`string `] (default: ``''``) Regular expression to match the text for the error we want to exclude. +- *regexp* :index:`: ` Alias for regex. + diff --git a/docs/source/configuration/preflights/FilterOptionsXRC.rst b/docs/source/configuration/preflights/FilterOptionsXRC.rst new file mode 100644 index 000000000..022bc95f4 --- /dev/null +++ b/docs/source/configuration/preflights/FilterOptionsXRC.rst @@ -0,0 +1,16 @@ +.. _FilterOptionsXRC: + + +FilterOptionsXRC parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``change_to`` :index:`: ` [:ref:`string `] (default: ``'ignore'``) (choices: "error", "warning", "ignore") The action of the filter. + Changing to *ignore* is the default and is used to suppress a violation, but you can also change + it to be an *error* or a *warning*. Note that violations excluded by KiCad are also analyzed, + so you can revert a GUI exclusion. +- ``error`` :index:`: ` [:ref:`string `] (default: ``''``) Error id we want to exclude. +- ``filter`` :index:`: ` [:ref:`string `] (default: ``''``) Name for the filter, for documentation purposes. +- *filter_msg* :index:`: ` Alias for filter. +- ``regex`` :index:`: ` [:ref:`string `] (default: ``''``) Regular expression to match the text for the error we want to exclude. +- *regexp* :index:`: ` Alias for regex. + diff --git a/docs/source/configuration/preflights/KiCadVariable.rst b/docs/source/configuration/preflights/KiCadVariable.rst new file mode 100644 index 000000000..192701773 --- /dev/null +++ b/docs/source/configuration/preflights/KiCadVariable.rst @@ -0,0 +1,18 @@ +.. _KiCadVariable: + + +KiCadVariable parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``after`` :index:`: ` [:ref:`string `] (default: ``''``) Text to add after the output of `command`. +- ``before`` :index:`: ` [:ref:`string `] (default: ``''``) Text to add before the output of `command`. +- ``command`` :index:`: ` [:ref:`string `] (default: ``''``) Command to execute to get the text, will be used only if `text` is empty. + This command will be executed using the Bash shell. + Be careful about spaces in file names (i.e. use "$KIBOT_PCB_NAME"). + The `KIBOT_PCB_NAME` environment variable is the PCB file and the + `KIBOT_SCH_NAME` environment variable is the schematic file. +- ``expand_kibot_patterns`` :index:`: ` [:ref:`boolean `] (default: ``true``) Expand %X patterns. The context is `schematic`. +- ``name`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the variable. The `version` variable will be expanded using `${version}`. +- ``text`` :index:`: ` [:ref:`string `] (default: ``''``) Text to insert instead of the variable. +- *variable* :index:`: ` Alias for name. + diff --git a/docs/source/configuration/preflights/PCB_ReplaceOptions.rst b/docs/source/configuration/preflights/PCB_ReplaceOptions.rst new file mode 100644 index 000000000..0eb181c24 --- /dev/null +++ b/docs/source/configuration/preflights/PCB_ReplaceOptions.rst @@ -0,0 +1,19 @@ +.. _PCB_ReplaceOptions: + + +PCB_ReplaceOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``date_command`` :index:`: ` [:ref:`string `] (default: ``''``) Command to get the date to use in the PCB.\\ + ```git log -1 --format='%as' -- "$KIBOT_PCB_NAME"```\\ + Will return the date in YYYY-MM-DD format.\\ + ```date -d @`git log -1 --format='%at' -- "$KIBOT_PCB_NAME"` +%Y-%m-%d_%H-%M-%S```\\ + Will return the date in YYYY-MM-DD_HH-MM-SS format.\\ + Important: on KiCad 6 the title block data is optional. + This command will work only if you have a date in the PCB/Schematic. +- ``replace_tags`` :index:`: ` [:ref:`TagReplacePCB parameters `] [:ref:`dict ` | :ref:`list(dict) `] (default: ``[]``) Tag or tags to replace. + +.. toctree:: + :caption: Used dicts + + TagReplacePCB diff --git a/docs/source/configuration/preflights/Run_DRCOptions.rst b/docs/source/configuration/preflights/Run_DRCOptions.rst new file mode 100644 index 000000000..164d690a1 --- /dev/null +++ b/docs/source/configuration/preflights/Run_DRCOptions.rst @@ -0,0 +1,11 @@ +.. _Run_DRCOptions: + + +Run_DRCOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``dir`` :index:`: ` [:ref:`string `] (default: ``''``) Sub-directory for the report. +- ``enabled`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable the DRC. This is the replacement for the boolean value. +- ``ignore_unconnected`` :index:`: ` [:ref:`boolean `] (default: ``false``) Ignores the unconnected nets. Useful if you didn't finish the routing. + It will also ignore KiCad 6 warnings. + diff --git a/docs/source/configuration/preflights/Run_ERCOptions.rst b/docs/source/configuration/preflights/Run_ERCOptions.rst new file mode 100644 index 000000000..cbc1c8525 --- /dev/null +++ b/docs/source/configuration/preflights/Run_ERCOptions.rst @@ -0,0 +1,10 @@ +.. _Run_ERCOptions: + + +Run_ERCOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``dir`` :index:`: ` [:ref:`string `] (default: ``''``) Sub-directory for the report. +- ``enabled`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable the ERC. This is the replacement for the boolean value. +- ``warnings_as_errors`` :index:`: ` [:ref:`boolean `] (default: ``false``) ERC warnings are considered errors. + diff --git a/docs/source/configuration/preflights/SCH_ReplaceOptions.rst b/docs/source/configuration/preflights/SCH_ReplaceOptions.rst new file mode 100644 index 000000000..89f35a8e4 --- /dev/null +++ b/docs/source/configuration/preflights/SCH_ReplaceOptions.rst @@ -0,0 +1,19 @@ +.. _SCH_ReplaceOptions: + + +SCH_ReplaceOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``date_command`` :index:`: ` [:ref:`string `] (default: ``''``) Command to get the date to use in the SCH.\\ + ```git log -1 --format='%as' -- "$KIBOT_SCH_NAME"```\\ + Will return the date in YYYY-MM-DD format.\\ + ```date -d @`git log -1 --format='%at' -- "$KIBOT_SCH_NAME"` +%Y-%m-%d_%H-%M-%S```\\ + Will return the date in YYYY-MM-DD_HH-MM-SS format.\\ + Important: on KiCad 6 the title block data is optional. + This command will work only if you have a date in the SCH/Schematic. +- ``replace_tags`` :index:`: ` [:ref:`TagReplaceSCH parameters `] [:ref:`dict ` | :ref:`list(dict) `] (default: ``[]``) Tag or tags to replace. + +.. toctree:: + :caption: Used dicts + + TagReplaceSCH diff --git a/docs/source/configuration/preflights/SUColumns.rst b/docs/source/configuration/preflights/SUColumns.rst new file mode 100644 index 000000000..ba905c0bd --- /dev/null +++ b/docs/source/configuration/preflights/SUColumns.rst @@ -0,0 +1,14 @@ +.. _SUColumns: + + +SUColumns parameters +~~~~~~~~~~~~~~~~~~~~ + +- **separator** :index:`: ` [:ref:`string `] (default: ``' '``) Text used as separator, usually one or more spaces. +- **type** :index:`: ` '' +- **width** :index:`: ` [:ref:`number `] (default: ``10``) Relative width. We first compute the total width and then distribute it according + to the relative width of each column. The absolute width depends on the area + assigned for the whole drawing. +- ``side`` :index:`: ` [:ref:`string `] (default: ``'auto'``) (choices: "auto", "right", "left") Side for the dimension used for the *thickness* type. + When using *auto* the side is detected looking for a *drawing* column. + diff --git a/docs/source/configuration/preflights/TagReplacePCB.rst b/docs/source/configuration/preflights/TagReplacePCB.rst new file mode 100644 index 000000000..8fb692dba --- /dev/null +++ b/docs/source/configuration/preflights/TagReplacePCB.rst @@ -0,0 +1,15 @@ +.. _TagReplacePCB: + + +TagReplacePCB parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``after`` :index:`: ` [:ref:`string `] (default: ``''``) Text to add after the output of `command`. +- ``before`` :index:`: ` [:ref:`string `] (default: ``''``) Text to add before the output of `command`. +- ``command`` :index:`: ` [:ref:`string `] (default: ``''``) Command to execute to get the text, will be used only if `text` is empty. + KIBOT_PCB_NAME variable is the name of the current PCB. +- ``tag`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the tag to replace. Use `version` for a tag named `@version@`. +- ``tag_delimiter`` :index:`: ` [:ref:`string `] (default: ``'@'``) Character used to indicate the beginning and the end of a tag. + Don't change it unless you really know about KiCad's file formats. +- ``text`` :index:`: ` [:ref:`string `] (default: ``''``) Text to insert instead of the tag. + diff --git a/docs/source/configuration/preflights/TagReplaceSCH.rst b/docs/source/configuration/preflights/TagReplaceSCH.rst new file mode 100644 index 000000000..3474ca143 --- /dev/null +++ b/docs/source/configuration/preflights/TagReplaceSCH.rst @@ -0,0 +1,16 @@ +.. _TagReplaceSCH: + + +TagReplaceSCH parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``after`` :index:`: ` [:ref:`string `] (default: ``''``) Text to add after the output of `command`. +- ``before`` :index:`: ` [:ref:`string `] (default: ``''``) Text to add before the output of `command`. +- ``command`` :index:`: ` [:ref:`string `] (default: ``''``) Command to execute to get the text, will be used only if `text` is empty. + KIBOT_SCH_NAME variable is the name of the current sheet. + KIBOT_TOP_SCH_NAME variable is the name of the top sheet. +- ``tag`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the tag to replace. Use `version` for a tag named `@version@`. +- ``tag_delimiter`` :index:`: ` [:ref:`string `] (default: ``'@'``) Character used to indicate the beginning and the end of a tag. + Don't change it unless you really know about KiCad's file formats. +- ``text`` :index:`: ` [:ref:`string `] (default: ``''``) Text to insert instead of the tag. + diff --git a/docs/source/configuration/preflights/Update_XMLOptions.rst b/docs/source/configuration/preflights/Update_XMLOptions.rst new file mode 100644 index 000000000..ae91201f5 --- /dev/null +++ b/docs/source/configuration/preflights/Update_XMLOptions.rst @@ -0,0 +1,13 @@ +.. _Update_XMLOptions: + + +Update_XMLOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- **check_pcb_parity** :index:`: ` [:ref:`boolean `] (default: ``false``) Check if the PCB and Schematic are synchronized. + This is equivalent to the *Test for parity between PCB and schematic* of the DRC dialog. + Only for KiCad 6 and 7. **Important**: when using KiCad 6 and the *Exclude from BoM* attribute + these components won't be included in the generated XML, so we can't check its parity. +- ``as_warnings`` :index:`: ` [:ref:`boolean `] (default: ``false``) Inform the problems as warnings and don't stop. +- ``enabled`` :index:`: ` [:ref:`boolean `] (default: ``true``) Enable the update. This is the replacement for the boolean value. + diff --git a/docs/source/configuration/preflights/annotate_pcb.rst b/docs/source/configuration/preflights/annotate_pcb.rst new file mode 100644 index 000000000..a49892ca8 --- /dev/null +++ b/docs/source/configuration/preflights/annotate_pcb.rst @@ -0,0 +1,19 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Annotate PCB; annotate_pcb + +Annotate PCB +~~~~~~~~~~~~ + +Annotates the PCB according to physical coordinates. +This preflight modifies the PCB and schematic, use it only in revision control environments. |br| +Used to assign references according to footprint coordinates. |br| +The project must be fully annotated first + + - **annotate_pcb** :index:`: ` [:ref:`Annotate_PCBOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `annotate_pcb` preflight. + +.. toctree:: + :caption: Used dicts + + Annotate_PCBOptions diff --git a/docs/source/configuration/preflights/annotate_power.rst b/docs/source/configuration/preflights/annotate_power.rst new file mode 100644 index 000000000..1b606ed2e --- /dev/null +++ b/docs/source/configuration/preflights/annotate_power.rst @@ -0,0 +1,14 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Annotate Power; annotate_power + +Annotate Power +~~~~~~~~~~~~~~ + +Annotates all power components. +This preflight modifies the schematic, use it only in revision control environments. |br| +Used to solve ERC problems when using filters that remove power reference numbers + + - **annotate_power** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable this preflight. + diff --git a/docs/source/configuration/preflights/check_fields.rst b/docs/source/configuration/preflights/check_fields.rst new file mode 100644 index 000000000..aacfa37f2 --- /dev/null +++ b/docs/source/configuration/preflights/check_fields.rst @@ -0,0 +1,21 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Check Fields; check_fields + +Check Fields +~~~~~~~~~~~~ + +Checks to apply to the schematic fields. +You can define conditions that must be met by the fields. |br| +The checks are applied to every component in the schematic. |br| +When an error is hit execution is stopped. |br| +One use is to check that all components are suitable for a temperature range. |br| +In this case a field must declare the temperature range + + - **check_fields** :index:`: ` [:ref:`FieldCheck parameters `] [:ref:`dict ` | :ref:`list(dict) `] (default: ``[]``) One or more check rules. + +.. toctree:: + :caption: Used dicts + + FieldCheck diff --git a/docs/source/configuration/preflights/check_zone_fills.rst b/docs/source/configuration/preflights/check_zone_fills.rst new file mode 100644 index 000000000..ac431e931 --- /dev/null +++ b/docs/source/configuration/preflights/check_zone_fills.rst @@ -0,0 +1,14 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Check Zone Fills; check_zone_fills + +Check Zone Fills +~~~~~~~~~~~~~~~~ + +Zones are filled before doing any operation involving PCB layers. +The original PCB remains unchanged. If you need to abort when the zone fill +creates significant changes to a layer use the CheckZoneFill internal template + + - **check_zone_fills** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable this preflight. + diff --git a/docs/source/configuration/preflights/draw_stackup.rst b/docs/source/configuration/preflights/draw_stackup.rst new file mode 100644 index 000000000..ad03c3948 --- /dev/null +++ b/docs/source/configuration/preflights/draw_stackup.rst @@ -0,0 +1,23 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Draw Stackup; draw_stackup + +Draw Stackup +~~~~~~~~~~~~ + +Draw the PCB stackup. Needs KiCad 7 or newer. +To specify the position and size of the drawing you can use two methods. |br| +You can specify it using the *pos_x*, *pos_y*, *width*, *height* and *layer* options. |br| +But you can also draw a rectangle in your PCB with the size and layer you want. |br| +Then draw another thing inside the rectangle, select both and create a group +(right mouse button, then Grouping -> Group). Now edit the group and change its name +to *kibot_stackup*. After running this preflight the rectangle will contain the +stackup + + - **draw_stackup** :index:`: ` [:ref:`DrawStackupOptions parameters `] [:ref:`boolean ` | :ref:`dict `] (default: ``false``) Use a boolean for simple cases or fine-tune its behavior. + +.. toctree:: + :caption: Used dicts + + DrawStackupOptions diff --git a/docs/source/configuration/preflights/drc.rst b/docs/source/configuration/preflights/drc.rst new file mode 100644 index 000000000..b58873d1b --- /dev/null +++ b/docs/source/configuration/preflights/drc.rst @@ -0,0 +1,19 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: DRC; drc + +DRC +~~~ + +Runs the DRC (Distance Rules Check) to ensure we have a valid PCB. +You need a valid *fp-lib-table* installed. If not KiBot will try to temporarily install the template. |br| +This is a replacement for the *run_drc* preflight that needs KiCad 8 or newer. |br| +GUI exclusions and schematic parity are supported + + - **drc** :index:`: ` [:ref:`DRCOptions parameters `] [:ref:`boolean ` | :ref:`dict `] (default: ``false``) Use a boolean for simple cases or fine-tune its behavior. + +.. toctree:: + :caption: Used dicts + + DRCOptions diff --git a/docs/source/configuration/preflights/erc.rst b/docs/source/configuration/preflights/erc.rst new file mode 100644 index 000000000..2ca1b321d --- /dev/null +++ b/docs/source/configuration/preflights/erc.rst @@ -0,0 +1,18 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: ERC; erc + +ERC +~~~ + +Runs the ERC (Electrical Rules Check). To ensure the schematic is electrically correct. +You need a valid *sym-lib-table* installed. If not KiBot will try to temporarily install the template. |br| +This is a replacement for the *run_erc* preflight that needs KiCad 8 or newer + + - **erc** :index:`: ` [:ref:`ERCOptions parameters `] [:ref:`boolean ` | :ref:`dict `] (default: ``false``) Use a boolean for simple cases or fine-tune its behavior. + +.. toctree:: + :caption: Used dicts + + ERCOptions diff --git a/docs/source/configuration/preflights/erc_warnings.rst b/docs/source/configuration/preflights/erc_warnings.rst new file mode 100644 index 000000000..9534279a9 --- /dev/null +++ b/docs/source/configuration/preflights/erc_warnings.rst @@ -0,0 +1,13 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: ERC Warnings (**Deprecated**); erc_warnings + +ERC Warnings (**Deprecated**) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Option for `run_erc`. ERC warnings are considered errors. +Use the `warnings_as_errors` option from `run_erc`/`erc` instead + + - **erc_warnings** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable this preflight. + diff --git a/docs/source/configuration/preflights/fill_zones.rst b/docs/source/configuration/preflights/fill_zones.rst new file mode 100644 index 000000000..cd00b6445 --- /dev/null +++ b/docs/source/configuration/preflights/fill_zones.rst @@ -0,0 +1,13 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Fill Zones; fill_zones + +Fill Zones +~~~~~~~~~~ + +Fill all zones again and save the PCB + + + - **fill_zones** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable this preflight. + diff --git a/docs/source/configuration/preflights/filters.rst b/docs/source/configuration/preflights/filters.rst new file mode 100644 index 000000000..d8f394bd6 --- /dev/null +++ b/docs/source/configuration/preflights/filters.rst @@ -0,0 +1,19 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Filters; filters + +Filters +~~~~~~~ + +A list of entries to filter out ERC/DRC messages when using *run_erc*/*run_drc*. +Avoid using it with the new *erc* and *drc* preflights. |br| +Note that ignored errors will become KiBot warnings (i.e. `(W058) ...`). |br| +To farther ignore these warnings use the `filters` option in the `global` section + + - **filters** :index:`: ` [:ref:`FilterOptions parameters `] [:ref:`list(dict) `] (default: ``[]``) One or more filters. + +.. toctree:: + :caption: Used dicts + + FilterOptions diff --git a/docs/source/configuration/preflights/ignore_unconnected.rst b/docs/source/configuration/preflights/ignore_unconnected.rst new file mode 100644 index 000000000..7e840d79a --- /dev/null +++ b/docs/source/configuration/preflights/ignore_unconnected.rst @@ -0,0 +1,14 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Ignore Unconnected (**Deprecated**); ignore_unconnected + +Ignore Unconnected (**Deprecated**) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Option for `run_drc`. Ignores the unconnected nets. Useful if you didn't finish the routing. +It will also ignore KiCad 6 warnings when using `run_drc`. |br| +Use the `ignore_unconnected` option from `run_drc`/`drc` instead + + - **ignore_unconnected** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable this preflight. + diff --git a/docs/source/configuration/preflights/pcb_replace.rst b/docs/source/configuration/preflights/pcb_replace.rst new file mode 100644 index 000000000..61712522f --- /dev/null +++ b/docs/source/configuration/preflights/pcb_replace.rst @@ -0,0 +1,18 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: PCB Replace (**Deprecated**); pcb_replace + +PCB Replace (**Deprecated**) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Replaces tags in the PCB. I.e. to insert the git hash or last revision date. +This is useful for KiCad 5, use `set_text_variables` when using KiCad 6. |br| +This preflight modifies the PCB. Even when a back-up is done use it carefully + + - **pcb_replace** :index:`: ` [:ref:`PCB_ReplaceOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `pcb_replace` preflight. + +.. toctree:: + :caption: Used dicts + + PCB_ReplaceOptions diff --git a/docs/source/configuration/preflights/run_drc.rst b/docs/source/configuration/preflights/run_drc.rst new file mode 100644 index 000000000..40a77ca26 --- /dev/null +++ b/docs/source/configuration/preflights/run_drc.rst @@ -0,0 +1,23 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Run DRC (**Deprecated for KiCad 8**); run_drc + +Run DRC (**Deprecated for KiCad 8**) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Runs the DRC (Distance Rules Check) to ensure we have a valid PCB. +For KiCad 8 use *drc* +The report file name is controlled by the global output pattern (%i=drc %x=txt). |br| +Note that the KiCad 6+ *Test for parity between PCB and schematic* option is not supported. |br| +If you need to check the parity use the `update_xml` preflight. |br| +KiCad 6 introduced `warnings` they are currently counted be the `unconnected` counter of KiBot. |br| +This will change in the future. |br| +If you use DRC exclusions please consult the `drc_exclusions_workaround` global option + + - **run_drc** :index:`: ` [:ref:`Run_DRCOptions parameters `] [:ref:`boolean ` | :ref:`dict `] (default: ``false``) Use a boolean for simple cases or fine-tune its behavior. + +.. toctree:: + :caption: Used dicts + + Run_DRCOptions diff --git a/docs/source/configuration/preflights/run_erc.rst b/docs/source/configuration/preflights/run_erc.rst new file mode 100644 index 000000000..094dbe85d --- /dev/null +++ b/docs/source/configuration/preflights/run_erc.rst @@ -0,0 +1,19 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Run ERC (**Deprecated for KiCad 8**); run_erc + +Run ERC (**Deprecated for KiCad 8**) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Runs the ERC (Electrical Rules Check). +For KiCad 8 use *erc* +To ensure the schematic is electrically correct. |br| +The report file name is controlled by the global output pattern (%i=erc %x=txt) + + - **run_erc** :index:`: ` [:ref:`Run_ERCOptions parameters `] [:ref:`boolean ` | :ref:`dict `] (default: ``false``) Use a boolean for simple cases or fine-tune its behavior. + +.. toctree:: + :caption: Used dicts + + Run_ERCOptions diff --git a/docs/source/configuration/preflights/sch_replace.rst b/docs/source/configuration/preflights/sch_replace.rst new file mode 100644 index 000000000..ef6ec24c3 --- /dev/null +++ b/docs/source/configuration/preflights/sch_replace.rst @@ -0,0 +1,18 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: SCH Replace (**Deprecated**); sch_replace + +SCH Replace (**Deprecated**) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Replaces tags in the schematic. I.e. to insert the git hash or last revision date. +This is useful for KiCad 5, use `set_text_variables` when using KiCad 6. |br| +This preflight modifies the schematics. Even when a back-up is done use it carefully + + - **sch_replace** :index:`: ` [:ref:`SCH_ReplaceOptions parameters `] [:ref:`dict `] (default: empty dict, default values used) Options for the `sch_replace` preflight. + +.. toctree:: + :caption: Used dicts + + SCH_ReplaceOptions diff --git a/docs/source/configuration/preflights/set_text_variables.rst b/docs/source/configuration/preflights/set_text_variables.rst new file mode 100644 index 000000000..17a78ea2b --- /dev/null +++ b/docs/source/configuration/preflights/set_text_variables.rst @@ -0,0 +1,23 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Set Text Variables; set_text_variables + +Set Text Variables +~~~~~~~~~~~~~~~~~~ + +Defines KiCad 6+ variables. +They are expanded using `${VARIABLE}`, and stored in the project file. |br| +This preflight replaces `pcb_replace` and `sch_replace` when using KiCad 6 or newer. |br| +The KiCad project file is modified. |br| + +.. warning:: + don't use `-s all` or this preflight will be skipped +.. + + - **set_text_variables** :index:`: ` [:ref:`KiCadVariable parameters `] [:ref:`dict ` | :ref:`list(dict) `] (default: ``[]``) One or more variable definition. + +.. toctree:: + :caption: Used dicts + + KiCadVariable diff --git a/docs/source/configuration/preflights/update_footprint.rst b/docs/source/configuration/preflights/update_footprint.rst new file mode 100644 index 000000000..faa40f87b --- /dev/null +++ b/docs/source/configuration/preflights/update_footprint.rst @@ -0,0 +1,14 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Update Footprint; update_footprint + +Update Footprint +~~~~~~~~~~~~~~~~ + +Updates footprints from the libs, you must provide one or more +references to be updated. This is useful to replace logos using freshly created versions + + - **update_footprint** :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``''``) [:ref:`comma separated `] One or more component references. + + diff --git a/docs/source/configuration/preflights/update_pcb_characteristics.rst b/docs/source/configuration/preflights/update_pcb_characteristics.rst new file mode 100644 index 000000000..ff1174fa1 --- /dev/null +++ b/docs/source/configuration/preflights/update_pcb_characteristics.rst @@ -0,0 +1,16 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Update PCB Characteristics; update_pcb_characteristics + +Update PCB Characteristics +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Update the information in the Board Characteristics. +Starting with KiCad 7 you can paste a block containing board information using +Place* -> *Add Board Characteristics*. But this information is static, so if +you modify anything related to it the block will be obsolete. |br| +This preflight tries to refresh the information + + - **update_pcb_characteristics** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable this preflight. + diff --git a/docs/source/configuration/preflights/update_qr.rst b/docs/source/configuration/preflights/update_qr.rst new file mode 100644 index 000000000..b552036af --- /dev/null +++ b/docs/source/configuration/preflights/update_qr.rst @@ -0,0 +1,14 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Update QR; update_qr + +Update QR +~~~~~~~~~ + +Update the QR codes. +Complements the `qr_lib` output. |br| +The KiCad 6 files and the KiCad 5 PCB needs manual update, generating a new library isn't enough + + - **update_qr** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable this preflight. + diff --git a/docs/source/configuration/preflights/update_stackup.rst b/docs/source/configuration/preflights/update_stackup.rst new file mode 100644 index 000000000..d1a7d9634 --- /dev/null +++ b/docs/source/configuration/preflights/update_stackup.rst @@ -0,0 +1,16 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Update Stackup; update_stackup + +Update Stackup +~~~~~~~~~~~~~~ + +Update the information in the Stackup Table. +Starting with KiCad 7 you can paste a block containing board information using +*Place* -> *Stackup Table*. But this information is static, so if +you modify anything related to it the block will be obsolete. |br| +This preflight tries to refresh the information + + - **update_stackup** :index:`: ` [:ref:`boolean `] (default: ``false``) Enable this preflight. + diff --git a/docs/source/configuration/preflights/update_xml.rst b/docs/source/configuration/preflights/update_xml.rst new file mode 100644 index 000000000..89d3c3d1b --- /dev/null +++ b/docs/source/configuration/preflights/update_xml.rst @@ -0,0 +1,19 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: Update XML; update_xml + +Update XML +~~~~~~~~~~ + +Update the XML version of the BoM (Bill of Materials). +To ensure our generated BoM is up to date. |br| +Note that this isn't needed when using the internal BoM generator (`bom`). |br| +You can compare the PCB and schematic netlists using it (KiCad 6 and 7 only) + + - **update_xml** :index:`: ` [:ref:`Update_XMLOptions parameters `] [:ref:`boolean ` | :ref:`dict `] (default: ``false``) Use a boolean for simple cases or fine-tune its behavior. + +.. toctree:: + :caption: Used dicts + + Update_XMLOptions diff --git a/docs/source/configuration/sup_filters.rst b/docs/source/configuration/sup_filters.rst index 6627161fa..f4e503717 100644 --- a/docs/source/configuration/sup_filters.rst +++ b/docs/source/configuration/sup_filters.rst @@ -3,313 +3,18 @@ Supported filters ^^^^^^^^^^^^^^^^^ -- **expand_text_vars**: (**Expand Text Variables**) - This filter expands KiCad 6 text variables (${VARIABLE}). - - - Valid keys: - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``include_kicad_env`` :index:`: ` [boolean=true] Also expand KiCad environment variables. - - ``include_os_env`` :index:`: ` [boolean=false] Also expand system environment variables. - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - -- **field_modify**: (**Field Modifier**) - Changes the content of one or more fields. - - - Valid keys: - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``fields`` :index:`: ` [string|list(string)='Datasheet'] Fields to convert. - - - ``include`` :index:`: ` [string|list(string)=''] Name of the filter to select which components will be affected. - Applied to all if nothing specified here. - - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - - ``regex`` :index:`: ` [string='(https?://\\S+)'] Regular expression to match the field content. - Only fields that matches will be modified. - An empty regex will match anything. - The example matches an HTTP URL. - - ``replace`` :index:`: ` [string='\\1'] Text to replace, can contain references to sub-expressions. - The example converts an HTTP URL into an HTML link, like the URLify filter. - -- **field_rename**: (**Field Renamer**) - This filter implements a field renamer. |br| - The internal `_kicost_rename` filter emulates the KiCost behavior. - - - Valid keys: - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - - ``rename`` :index:`: ` [list(dict)] Fields to rename. - - - Valid keys: - - - ``field`` :index:`: ` [string=''] Name of the field to rename. - - ``name`` :index:`: ` [string=''] New name. - - -- **generic**: (**Generic filter**) - This filter is based on regular expressions. |br| - It also provides some shortcuts for common situations. |br| - Note that matches aren't case sensitive and spaces at the beginning and the end are removed. |br| - The internal `_mechanical` filter emulates the KiBoM behavior for default exclusions. |br| - The internal `_kicost_dnp` filter emulates KiCost's `dnp` field. - - - Valid keys: - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``config_field`` :index:`: ` [string='Config'] Name of the field used to classify components. - - ``config_separators`` :index:`: ` [string=' ,'] Characters used to separate options inside the config field. - - ``exclude_all_hash_ref`` :index:`: ` [boolean=false] Exclude all components with a reference starting with #. - - ``exclude_any`` :index:`: ` [list(dict)] A series of regular expressions used to exclude parts. - If a component matches ANY of these, it will be excluded. - Column names are case-insensitive. - - - Valid keys: - - - ``column`` :index:`: ` [string=''] Name of the column to apply the regular expression. - Use `_field_lcsc_part` to get the value defined in the global options. - - *field* :index:`: ` Alias for column. - - ``invert`` :index:`: ` [boolean=false] Invert the regex match result. - - ``match_if_field`` :index:`: ` [boolean=false] Match if the field exists, no regex applied. Not affected by `invert`. - - ``match_if_no_field`` :index:`: ` [boolean=false] Match if the field doesn't exists, no regex applied. Not affected by `invert`. - - ``regex`` :index:`: ` [string=''] Regular expression to match. - - *regexp* :index:`: ` Alias for regex. - - ``skip_if_no_field`` :index:`: ` [boolean=false] Skip this test if the field doesn't exist. - - - ``exclude_bottom`` :index:`: ` [boolean=false] Exclude components on the bottom side of the PCB. - - ``exclude_config`` :index:`: ` [boolean=false] Exclude components containing a key value in the config field. - Separators are applied. - - ``exclude_empty_val`` :index:`: ` [boolean=false] Exclude components with empty 'Value'. - - ``exclude_field`` :index:`: ` [boolean=false] Exclude components if a field is named as any of the keys. - - ``exclude_not_in_bom`` :index:`: ` [boolean=false] Exclude components marked *Exclude from bill of materials* (KiCad 6+). - - ``exclude_not_on_board`` :index:`: ` [boolean=false] Exclude components marked *Exclude from board* (KiCad 6+). - - ``exclude_refs`` :index:`: ` [list(string)] List of references to be excluded. - Use R* for all references with R prefix. - - - ``exclude_smd`` :index:`: ` [boolean=false] Exclude components marked as smd in the PCB. - - ``exclude_tht`` :index:`: ` [boolean=false] Exclude components marked as through-hole in the PCB. - - ``exclude_top`` :index:`: ` [boolean=false] Exclude components on the top side of the PCB. - - ``exclude_value`` :index:`: ` [boolean=false] Exclude components if their 'Value' is any of the keys. - - ``exclude_virtual`` :index:`: ` [boolean=false] Exclude components marked as virtual in the PCB. - - ``include_only`` :index:`: ` [list(dict)] A series of regular expressions used to include parts. - If there are any regex defined here, only components that match against ANY of them will be included. - Column/field names are case-insensitive. - If empty this rule is ignored. - - - Valid keys: - - - ``column`` :index:`: ` [string=''] Name of the column to apply the regular expression. - Use `_field_lcsc_part` to get the value defined in the global options. - - *field* :index:`: ` Alias for column. - - ``invert`` :index:`: ` [boolean=false] Invert the regex match result. - - ``match_if_field`` :index:`: ` [boolean=false] Match if the field exists, no regex applied. Not affected by `invert`. - - ``match_if_no_field`` :index:`: ` [boolean=false] Match if the field doesn't exists, no regex applied. Not affected by `invert`. - - ``regex`` :index:`: ` [string=''] Regular expression to match. - - *regexp* :index:`: ` Alias for regex. - - ``skip_if_no_field`` :index:`: ` [boolean=false] Skip this test if the field doesn't exist. - - - ``invert`` :index:`: ` [boolean=false] Invert the result of the filter. - - ``keys`` :index:`: ` [string|list(string)=dnf_list] [dnc_list,dnf_list] List of keys to match. - The `dnf_list` and `dnc_list` internal lists can be specified as strings. - Use `dnf_list` for ['dnf', 'dnl', 'dnp', 'do not fit', 'do not load', 'do not place', 'no stuff', 'nofit', 'noload', 'noplace', 'nostuff', 'not fitted', 'not loaded', 'not placed']. - Use `dnc_list` for ['dnc', 'do not change', 'fixed', 'no change']. - - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - -- **rot_footprint**: (**Footprint Rotator**) - This filter can rotate footprints, used for the positions file generation. |br| - Some manufacturers use a different rotation than KiCad. |br| - The `JLCPCB Rotation Offset` and `JLCPCB Position Offset` fields can be used to adjust special cases. |br| - The internal `_rot_footprint` filter implements the simplest case. - - - Valid keys: - - - ``bennymeg_mode`` :index:`: ` [boolean=true] Implements the `rot_fields` and `offset_fields` in the same way that the bennymeg/JLC-Plugin-for-KiCad tool. - Note that the computation for bottom rotations is wrong, forcing the user to uses arbitrary rotations. - The correct computation is `(180 - component rot) + angle` but the plugin does `180 - (component rot + angle)`. - This option forces the wrong computation for compatibility. - This option also controls the way offset signs are interpreted. When enabled the offsets matches this plugin, - when disabled matches the interpretation used by the matthewlai/JLCKicadTools plugin. - Disabling this option you'll get better algorithms, but loose compatibility with this plugin. - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``extend`` :index:`: ` [boolean=true] Extends the internal list of rotations with the one provided. - Otherwise just use the provided list. - Note that the provided list has more precedence than the internal list. - - ``invert_bottom`` :index:`: ` [boolean=false] Rotation for bottom components is negated, resulting in either: `(- component rot - angle)` - or when combined with `negative_bottom`, `(angle - component rot)`. - - ``mirror_bottom`` :index:`: ` [boolean=false] The original component rotation for components in the bottom is mirrored before applying - the adjust so you get `(180 - component rot + angle)`. This is used by JLCPCB. - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - - ``negative_bottom`` :index:`: ` [boolean=true] Rotation for bottom components is computed via subtraction as `(component rot - angle)`. - - ``offset_fields`` :index:`: ` [string|list(string)='JLCPCB Position Offset,JLCPosOffset'] List of fields that can contain a position offset. - The optional fields can contain a comma separated x,y position offset. - This concept is from the bennymeg/JLC-Plugin-for-KiCad tool. - - - ``offsets`` :index:`: ` [list(list(string))] A list of pairs regular expression/offset. - Footprints matching the regular expression will be moved the specified offset. - The offset must be two numbers separated by a comma. The first is the X offset. - The signs matches the matthewlai/JLCKicadTools plugin specs. - - - ``rot_fields`` :index:`: ` [string|list(string)='JLCPCB Rotation Offset,JLCRotOffset'] List of fields that can contain a rotation offset. - The optional fields can contain a counter-clockwise orientation offset in degrees. - This concept is from the bennymeg/JLC-Plugin-for-KiCad tool. - - - ``rotations`` :index:`: ` [list(list(string))] A list of pairs regular expression/rotation. - Footprints matching the regular expression will be rotated the indicated angle. - The angle matches the matthewlai/JLCKicadTools plugin specs. - - - ``rotations_and_offsets`` :index:`: ` [list(dict)] A list of rules to match components and specify the rotation and offsets. - This is a more flexible version of the `rotations` and `offsets` options. - Note that this list has more precedence. - - - Valid keys: - - - ``angle`` :index:`: ` [number=0.0] Rotation offset to apply to the matched component. - - ``apply_angle`` :index:`: ` [boolean=true] Apply the angle offset. - - ``apply_offset`` :index:`: ` [boolean=true] Apply the position offset. - - ``field`` :index:`: ` [string='footprint'] Name of field to apply the regular expression. - Use `_field_lcsc_part` to get the value defined in the global options. - Use `Footprint` for the name of the footprint without a library. - Use `Full Footprint` for the name of the footprint including the library. - - ``offset_x`` :index:`: ` [number=0.0] X position offset to apply to the matched component. - - ``offset_y`` :index:`: ` [number=0.0] Y position offset to apply to the matched component. - - ``regex`` :index:`: ` [string=''] Regular expression to match. - - *regexp* :index:`: ` Alias for regex. - - - ``skip_bottom`` :index:`: ` [boolean=false] Do not rotate components on the bottom. - - ``skip_top`` :index:`: ` [boolean=false] Do not rotate components on the top. - -- **spec_to_field**: (**Spec to Field**) - This filter extracts information from the specs obtained from component distributors - and fills fields. |br| - I.e. create a field with the RoHS status of a component. |br| - In order to make it work you must be able to get prices using the KiCost options of - the `bom` output. Make sure you can do this before trying to use this filter. |br| - Usage `example `__. - - - Valid keys: - - - **from_output** :index:`: ` [string=''] Name of the output used to collect the specs. - Currently this must be a `bom` output with KiCost enabled and a distributor that returns specs. - - **specs** :index:`: ` [list(dict)|dict] One or more specs to be copied. - - - Valid keys: - - - **field** :index:`: ` [string=''] Name of the destination field. - - **spec** :index:`: ` [string|list(string)=''] Name/s of the source spec/s. - The following names are uniform across distributors: '_desc', '_value', '_tolerance', '_footprint', - '_power', '_current', '_voltage', '_frequency', '_temp_coeff', '_manf' and '_size'. - - - ``collision`` :index:`: ` [string='warning'] [warning,error,ignore] How to report a collision between the current value and the new value. - - ``policy`` :index:`: ` [string='overwrite'] [overwrite,update,new] Controls the behavior of the copy mechanism. - `overwrite` always copy the spec value, - `update` copy only if the field already exist, - `new` copy only if the field doesn't exist.. - - ``type`` :index:`: ` [string='string'] [percent,voltage,power,current,value,string] How we compare the current value to determine a collision. - `value` is the component value i.e. resistance for R*. - - - ``check_dist_coherence`` :index:`: ` [boolean=true] Check that the data we got from different distributors is equivalent. - - ``check_dist_fields`` :index:`: ` [string|list(string)=''] List of fields to include in the check. - For a full list of fields consult the `specs` option. - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - -- **subparts**: (**Subparts**) - This filter implements the KiCost subparts mechanism. - - - Valid keys: - - - ``check_multiplier`` :index:`: ` [list(string)] List of fields to include for multiplier computation. - If empty all fields in `split_fields` and `manf_pn_field` are used. - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``manf_field`` :index:`: ` [string='manf'] Field for the manufacturer name. - - ``manf_pn_field`` :index:`: ` [string='manf#'] Field for the manufacturer part number. - - ``modify_first_value`` :index:`: ` [boolean=true] Modify even the value for the first component in the list (KiCost behavior). - - ``modify_value`` :index:`: ` [boolean=true] Add '- p N/M' to the value. - - ``mult_separators`` :index:`: ` [string=':'] Separators used for the multiplier. Each character in this string is a valid separator. - - ``multiplier`` :index:`: ` [boolean=true] Enables the subpart multiplier mechanism. - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - - ``ref_sep`` :index:`: ` [string='#'] Separator used in the reference (i.e. R10#1). - - ``separators`` :index:`: ` [string=';,'] Separators used between subparts. Each character in this string is a valid separator. - - ``split_fields`` :index:`: ` [list(string)] List of fields to split, usually the distributors part numbers. - - - ``split_fields_expand`` :index:`: ` [boolean=false] When `true` the fields in `split_fields` are added to the internal names. - - ``use_ref_sep_for_first`` :index:`: ` [boolean=true] Force the reference separator use even for the first component in the list (KiCost behavior). - - ``value_alt_field`` :index:`: ` [string='value_subparts'] Field containing replacements for the `Value` field. So we get real values for split parts. - -- **urlify**: (**URLify**) - Converts URL text in fields to HTML URLs. - - - Valid keys: - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``fields`` :index:`: ` [string|list(string)='Datasheet'] Fields to convert. - - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - -- **value_split**: (**Value Splitter**) - This filter extracts information from the value and fills other fields. |br| - I.e. extracts the tolerance and puts it in the `tolerance` field. |br| - Usage `example `__. - - - Valid keys: - - - ``autoplace`` :index:`: ` [boolean=true] Try to figure out the position for the added fields. - - ``autoplace_mechanism`` :index:`: ` [string='bottom'] [bottom,top] Put the new field at the bottom/top of the last field. - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - - ``package`` :index:`: ` [string='yes'] [yes,no,soft] Policy for the package. - yes = overwrite existing value, no = don't touch, soft = copy if not defined. - - ``power`` :index:`: ` [string='yes'] [yes,no,soft] Policy for the power rating. - yes = overwrite existing value, no = don't touch, soft = copy if not defined. - - ``replace_source`` :index:`: ` [boolean=true] Replace the content of the source field using a normalized representation of the interpreted value. - - ``source`` :index:`: ` [string='Value'] Name of the field to use as source of information. - - ``temp_coef`` :index:`: ` [string='yes'] [yes,no,soft] Policy for the temperature coefficient. - yes = overwrite existing value, no = don't touch, soft = copy if not defined. - - ``tolerance`` :index:`: ` [string='yes'] [yes,no,soft] Policy for the tolerance. - yes = overwrite existing value, no = don't touch, soft = copy if not defined. - - ``visible`` :index:`: ` [boolean=false] Make visible the modified fields. - - ``voltage`` :index:`: ` [string='yes'] [yes,no,soft] Policy for the voltage rating. - yes = overwrite existing value, no = don't touch, soft = copy if not defined. - -- **var_rename**: (**Variant Renamer**) - This filter implements the VARIANT:FIELD=VALUE renamer to get FIELD=VALUE when VARIANT is in use. |br| - As an example: a field named *V1:MPN* with value *1N4001* will change the field *MPN* to be - *1N4001* when the variant in use is *V1*. |br| - Note that this mechanism can be used to change a footprint, i.e. *VARIANT:Footprint* assigned - with *Diode_SMD:D_0805_2012Metric* will change the footprint when *VARIANT* is in use. Of course the - footprints should be similar, or your PCB will become invalid. - - - Valid keys: - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``force_variant`` :index:`: ` [string=''] Use this variant instead of the current variant. Useful for IBoM variants. - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - - ``separator`` :index:`: ` [string=':'] Separator used between the variant and the field name. - - ``variant_to_value`` :index:`: ` [boolean=false] Rename fields matching the variant to the value of the component. - -- **var_rename_kicost**: (**Variant Renamer KiCost style**) - This filter implements the kicost.VARIANT:FIELD=VALUE renamer to get FIELD=VALUE when VARIANT is in use. |br| - It applies the KiCost concept of variants (a regex to match the VARIANT). |br| - As an example: a field named *kicost.V1:MPN* with value *1N4001* will change the field *MPN* to be - *1N4001* when a variant in use matches the *V1* string. |br| - Note that this mechanism can be used to change a footprint, i.e. *kicost.VARIANT:Footprint* assigned - with *Diode_SMD:D_0805_2012Metric* will change the footprint when *VARIANT* is matched. Of course the - footprints should be similar, or your PCB will become invalid. |br| - The internal `_var_rename_kicost` filter is configured to emulate the KiCost behavior. You can create - other filters to fine-tune the behavior, i.e. you can make the mechanism to be triggered by fields - like *kibot.VARIANT|FIELD*. - - - Valid keys: - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``name`` :index:`: ` [string=''] Used to identify this particular filter definition. - - ``prefix`` :index:`: ` [string='kicost.'] A mandatory prefix. Is not case sensitive. - - ``separator`` :index:`: ` [string=':'] Separator used between the variant and the field name. - - ``variant`` :index:`: ` [string=''] Variant regex to match the VARIANT part. - When empty the currently selected variant is used. - - ``variant_to_value`` :index:`: ` [boolean=false] Rename fields matching the variant to the value of the component. - +.. toctree:: + :maxdepth: 1 + + filters/expand_text_vars + filters/field_modify + filters/field_rename + filters/generic + filters/rot_footprint + filters/separate_pins + filters/spec_to_field + filters/subparts + filters/urlify + filters/value_split + filters/var_rename + filters/var_rename_kicost diff --git a/docs/source/configuration/sup_globals.rst b/docs/source/configuration/sup_globals.rst index 67892c5cd..37442a9a0 100644 --- a/docs/source/configuration/sup_globals.rst +++ b/docs/source/configuration/sup_globals.rst @@ -4,7 +4,7 @@ - Valid keys: - - ``aliases_for_3d_models`` :index:`: ` [list(dict)] List of aliases for the 3D models (KiCad 6). + - ``aliases_for_3d_models`` :index:`: ` [:ref:`list(dict) `] (default: ``[]``) List of aliases for the 3D models (KiCad 6). KiCad stores 3D aliases with the user settings, not locally. This makes impossible to create self contained projects. You can define aliases here to workaround this problem. @@ -14,51 +14,51 @@ - Valid keys: - *alias* :index:`: ` Alias for name. - - ``name`` :index:`: ` [string=''] Name of the alias. + - ``name`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the alias. - *text* :index:`: ` Alias for value. - - ``value`` :index:`: ` [string=''] Path to the 3D model. + - ``value`` :index:`: ` [:ref:`string `] (default: ``''``) Path to the 3D model. - *variable* :index:`: ` Alias for name. - - ``allow_blind_buried_vias`` :index:`: ` [boolean=true] Allow the use of buried vias. This value is only used for KiCad 7+. + - ``allow_blind_buried_vias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Allow the use of buried vias. This value is only used for KiCad 7+. For KiCad 5 and 6 use the design rules settings, stored in the project. - - ``allow_component_ranges`` :index:`: ` [boolean=true] Allow using ranges like *R5-R20* in the `show_components` and `highlight` options. + - ``allow_component_ranges`` :index:`: ` [:ref:`boolean `] (default: ``true``) Allow using ranges like *R5-R20* in the `show_components` and `highlight` options. If you have references that looks like a range you should disable this option. - - ``allow_microvias`` :index:`: ` [boolean=true] Allow the use of micro vias. This value is only used for KiCad 7+. + - ``allow_microvias`` :index:`: ` [:ref:`boolean `] (default: ``true``) Allow the use of micro vias. This value is only used for KiCad 7+. For KiCad 5 and 6 use the design rules settings, stored in the project. - - ``always_warn_about_paste_pads`` :index:`: ` [boolean=false] Used to detect the use of pads just for paste. - - ``cache_3d_resistors`` :index:`: ` [boolean=false] Use a cache for the generated 3D models of colored resistors. + - ``always_warn_about_paste_pads`` :index:`: ` [:ref:`boolean `] (default: ``false``) Used to detect the use of pads just for paste. + - ``cache_3d_resistors`` :index:`: ` [:ref:`boolean `] (default: ``false``) Use a cache for the generated 3D models of colored resistors. Will save time, but you could need to remove the cache if you need to regenerate them. - - ``castellated_pads`` :index:`: ` [boolean=false] Has the PCB castellated pads? + - ``castellated_pads`` :index:`: ` [:ref:`boolean `] (default: ``false``) Has the PCB castellated pads? KiCad 6: you should set this in the Board Setup -> Board Finish -> Has castellated pads. - - ``colored_tht_resistors`` :index:`: ` [boolean=true] Try to add color bands to the 3D models of KiCad THT resistors. + - ``colored_tht_resistors`` :index:`: ` [:ref:`boolean `] (default: ``true``) Try to add color bands to the 3D models of KiCad THT resistors. - *copper_finish* :index:`: ` Alias for pcb_finish. - - ``copper_thickness`` :index:`: ` [number|string] Copper thickness in micrometers (1 Oz is 35 micrometers). + - ``copper_thickness`` :index:`: ` [:ref:`number ` | :ref:`string `] Copper thickness in micrometers (1 Oz is 35 micrometers). KiCad 6: you should set this in the Board Setup -> Physical Stackup. - - ``cross_footprints_for_dnp`` :index:`: ` [boolean=true] Draw a cross for excluded components in the `Fab` layer. - - ``cross_no_body`` :index:`: ` [boolean=false] Cross components even when they don't have a body. Only for KiCad 6 and internal cross. - - ``cross_using_kicad`` :index:`: ` [boolean=true] When using KiCad 7+ let KiCad cross the components. - - ``csv_accept_no_ref`` :index:`: ` [boolean=false] Accept aggregating CSV files without references (Experimental). - - ``date_format`` :index:`: ` [string='%Y-%m-%d'] Format used for the day we started the script. + - ``cross_footprints_for_dnp`` :index:`: ` [:ref:`boolean `] (default: ``true``) Draw a cross for excluded components in the `Fab` layer. + - ``cross_no_body`` :index:`: ` [:ref:`boolean `] (default: ``false``) Cross components even when they don't have a body. Only for KiCad 6 and internal cross. + - ``cross_using_kicad`` :index:`: ` [:ref:`boolean `] (default: ``true``) When using KiCad 7+ let KiCad cross the components. + - ``csv_accept_no_ref`` :index:`: ` [:ref:`boolean `] (default: ``false``) Accept aggregating CSV files without references (Experimental). + - ``date_format`` :index:`: ` [:ref:`string `] (default: ``'%Y-%m-%d'``) Format used for the day we started the script. Is also used for the PCB/SCH date formatting when `time_reformat` is enabled (default behavior). Uses the `strftime` format. - - ``date_time_format`` :index:`: ` [string='%Y-%m-%d_%H-%M-%S'] Format used for the PCB and schematic date when using the file timestamp. Uses the `strftime` format. - - ``default_resistor_tolerance`` :index:`: ` [number=20] When no tolerance is specified we use this value. + - ``date_time_format`` :index:`: ` [:ref:`string `] (default: ``'%Y-%m-%d_%H-%M-%S'``) Format used for the PCB and schematic date when using the file timestamp. Uses the `strftime` format. + - ``default_resistor_tolerance`` :index:`: ` [:ref:`number `] (default: ``20``) When no tolerance is specified we use this value. Note that I know 5% is a common default, but technically speaking 20% is the default. Used while creating colored resistors. - - ``dir`` :index:`: ` [string=''] Default pattern for the output directories. It also applies to the preflights, unless + - ``dir`` :index:`: ` [:ref:`string `] (default: ``''``) Default pattern for the output directories. It also applies to the preflights, unless `use_dir_for_preflights` is disabled. - - ``disable_3d_alias_as_env`` :index:`: ` [boolean=false] Disable the use of environment and text variables as 3D models aliases. - - ``drc_exclusions_workaround`` :index:`: ` [boolean=false] KiCad 6 introduced DRC exclusions. They are stored in the project but ignored by the Python API. - This is reported as bug number 11562 (https://gitlab.com/kicad/code/kicad/-/issues/11562). + - ``disable_3d_alias_as_env`` :index:`: ` [:ref:`boolean `] (default: ``false``) Disable the use of environment and text variables as 3D models aliases. + - ``drc_exclusions_workaround`` :index:`: ` [:ref:`boolean `] (default: ``false``) KiCad 6 introduced DRC exclusions. They are stored in the project but ignored by the Python API. + This problem affects KiCad 6 and 7. If you really need exclusions enable this option, this will use the GUI version of the DRC (slower). - Current KiCad version is 6.0.7 and the bug is still there. - - ``drill_size_increment`` :index:`: ` [number=0.05] This is the difference between drill tools in millimeters. + Note that this isn't needed for KiCad 8 and the `drc` preflight. + - ``drill_size_increment`` :index:`: ` [:ref:`number `] (default: ``0.05``) This is the difference between drill tools in millimeters. A manufacturer with 0.05 of increment has drills for 0.1, 0.15, 0.2, 0.25, etc.. - - ``edge_connector`` :index:`: ` [string='no'] [yes,no,bevelled] Has the PCB edge connectors? + - ``edge_connector`` :index:`: ` [:ref:`string `] (default: ``'no'``) (choices: "yes", "no", "bevelled") Has the PCB edge connectors? KiCad 6: you should set this in the Board Setup -> Board Finish -> Edge card connectors. - - ``edge_plating`` :index:`: ` [boolean=false] Has the PCB a plated board edge? + - ``edge_plating`` :index:`: ` [:ref:`boolean `] (default: ``false``) Has the PCB a plated board edge? KiCad 6: you should set this in the Board Setup -> Board Finish -> Plated board edge. - - ``environment`` :index:`: ` [dict] Used to define environment variables used by KiCad. + - ``environment`` :index:`: ` [:ref:`dict `] (default: empty dict, default values used) Used to define environment variables used by KiCad. The values defined here are exported as environment variables and has more precedence than KiCad paths defined in the GUI. You can make reference to any OS environment variable using `${VARIABLE}`. @@ -66,140 +66,147 @@ - Valid keys: - - ``define_old`` :index:`: ` [boolean=false] Also define legacy versions of the variables. + - ``define_old`` :index:`: ` [:ref:`boolean `] (default: ``false``) Also define legacy versions of the variables. Useful when using KiCad 6+ and some libs uses old KiCad 5 names. - - ``extra_os`` :index:`: ` [list(dict)] Extra variables to export as OS environment variables. + - ``extra_os`` :index:`: ` [:ref:`list(dict) `] (default: ``[]``) Extra variables to export as OS environment variables. Note that you can also define them using `- NAME: VALUE`. - Valid keys: - - **name** :index:`: ` [string=''] Name of the variable. - - **value** :index:`: ` [string=''] Value for the variable. + - **name** :index:`: ` [:ref:`string `] (default: ``''``) Name of the variable. + - **value** :index:`: ` [:ref:`string `] (default: ``''``) Value for the variable. - - ``footprints`` :index:`: ` [string=''] System level footprints (aka modules) dir. KiCad 5: KICAD_FOOTPRINT_DIR and KISYSMOD. + - ``footprints`` :index:`: ` [:ref:`string `] (default: ``''``) System level footprints (aka modules) dir. KiCad 5: KICAD_FOOTPRINT_DIR and KISYSMOD. KiCad 6: KICAD6_FOOTPRINT_DIR. - - ``models_3d`` :index:`: ` [string=''] System level 3D models dir. KiCad 5: KISYS3DMOD. KiCad 6: KICAD6_3DMODEL_DIR. - - ``symbols`` :index:`: ` [string=''] System level symbols dir. KiCad 5: KICAD_SYMBOL_DIR. KiCad 6: KICAD6_SYMBOL_DIR. - - ``templates`` :index:`: ` [string=''] System level templates dir. KiCad 5: KICAD_TEMPLATE_DIR. KiCad 6: KICAD6_TEMPLATE_DIR. - - ``third_party`` :index:`: ` [string=''] 3rd party dir. KiCad 6: KICAD6_3RD_PARTY. - - ``user_templates`` :index:`: ` [string=''] User level templates dir. KiCad 5/6: KICAD_USER_TEMPLATE_DIR. + - ``models_3d`` :index:`: ` [:ref:`string `] (default: ``''``) System level 3D models dir. KiCad 5: KISYS3DMOD. KiCad 6: KICAD6_3DMODEL_DIR. + - ``symbols`` :index:`: ` [:ref:`string `] (default: ``''``) System level symbols dir. KiCad 5: KICAD_SYMBOL_DIR. KiCad 6: KICAD6_SYMBOL_DIR. + - ``templates`` :index:`: ` [:ref:`string `] (default: ``''``) System level templates dir. KiCad 5: KICAD_TEMPLATE_DIR. KiCad 6: KICAD6_TEMPLATE_DIR. + - ``third_party`` :index:`: ` [:ref:`string `] (default: ``''``) 3rd party dir. KiCad 6: KICAD6_3RD_PARTY. + - ``user_templates`` :index:`: ` [:ref:`string `] (default: ``''``) User level templates dir. KiCad 5/6: KICAD_USER_TEMPLATE_DIR. - - ``erc_grid`` :index:`: ` [number=50] Grid size used for the ERC. This value must be in mils. + - ``erc_grid`` :index:`: ` [:ref:`number `] (default: ``50``) Grid size used for the ERC. This value must be in mils. This is needed for KiCad 7 in order to run the off grid check. This value is stored in the project for KiCad 8, no need to specify it. - - ``extra_pth_drill`` :index:`: ` [number=0.1] How many millimeters the manufacturer will add to plated holes. + - ``extra_pth_drill`` :index:`: ` [:ref:`number `] (default: ``0.1``) How many millimeters the manufacturer will add to plated holes. This is because the plating reduces the hole, so you need to use a bigger drill. For more information consult: https://www.eurocircuits.com/pcb-design-guidelines/drilled-holes/. - - ``field_3D_model`` :index:`: ` [string='_3D_model'] Name for the field controlling the 3D models used for a component. - - ``field_lcsc_part`` :index:`: ` [string=''] The name of the schematic field that contains the part number for the LCSC/JLCPCB distributor. + - ``field_3D_model`` :index:`: ` [:ref:`string `] (default: ``'_3D_model'``) Name for the field controlling the 3D models used for a component. + - ``field_current`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['current', 'i']``) Name/s of the field/s used for the current raiting. + You can use `_field_current` as field name to use it in most places. + + - ``field_lcsc_part`` :index:`: ` [:ref:`string `] (default: ``''``) The name of the schematic field that contains the part number for the LCSC/JLCPCB distributor. When empty KiBot will try to discover it. - - ``field_package`` :index:`: ` [string|list(string)] Name/s of the field/s used for the package, not footprint. + You can use `_field_lcsc_part` as field name to use it in most places. + - ``field_package`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['package', 'pkg']``) Name/s of the field/s used for the package, not footprint. I.e. 0805, SOT-23, etc. Used for the value split filter. - The default is ['package', 'pkg']. + You can use `_field_package` as field name to use it in most places. - - ``field_power`` :index:`: ` [string|list(string)] Name/s of the field/s used for the power raiting. + - ``field_power`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['power', 'pow']``) Name/s of the field/s used for the power raiting. Used for the value split filter. - The default is ['power', 'pow']. + You can use `_field_power` as field name to use it in most places. - - ``field_temp_coef`` :index:`: ` [string|list(string)] Name/s of the field/s used for the temperature coefficient. + - ``field_temp_coef`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['temp_coef', 'tmp_coef']``) Name/s of the field/s used for the temperature coefficient. I.e. X7R, NP0, etc. Used for the value split filter. - The default is ['temp_coef', 'tmp_coef']. + You can use `_field_temp_coef` as field name to use it in most places. - - ``field_tolerance`` :index:`: ` [string|list(string)] Name/s of the field/s used for the tolerance. + - ``field_tolerance`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['tolerance', 'tol']``) Name/s of the field/s used for the tolerance. Used while creating colored resistors and for the value split filter. - The default is ['tolerance', 'tol']. + You can use `_field_tolerance` as field name to use it in most places. - - ``field_voltage`` :index:`: ` [string|list(string)] Name/s of the field/s used for the voltage raiting. + - ``field_voltage`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['voltage', 'v']``) Name/s of the field/s used for the voltage raiting. Used for the value split filter. - The default is ['voltage', 'v']. + You can use `_field_voltage` as field name to use it in most places. - - ``filters`` :index:`: ` [list(dict)] KiBot warnings to be ignored. + - ``filters`` :index:`: ` [:ref:`list(dict) `] (default: ``[]``) KiBot warnings to be ignored. - Valid keys: - - ``error`` :index:`: ` [string=''] Error id we want to exclude. + - ``error`` :index:`: ` [:ref:`string `] (default: ``''``) Error id we want to exclude. - *error_number* :index:`: ` Alias for number. - - ``filter`` :index:`: ` [string=''] Name for the filter, for documentation purposes. + - ``filter`` :index:`: ` [:ref:`string `] (default: ``''``) Name for the filter, for documentation purposes. - *filter_msg* :index:`: ` Alias for filter. - - ``number`` :index:`: ` [number=0] Error number we want to exclude. - - ``regex`` :index:`: ` [string=''] Regular expression to match the text for the error we want to exclude. + - ``number`` :index:`: ` [:ref:`number `] (default: ``0``) Error number we want to exclude. + - ``regex`` :index:`: ` [:ref:`string `] (default: ``''``) Regular expression to match the text for the error we want to exclude. - *regexp* :index:`: ` Alias for regex. - - ``git_diff_strategy`` :index:`: ` [string='worktree'] [worktree,stash] When computing a PCB/SCH diff it configures how do we preserve the current + - ``git_diff_strategy`` :index:`: ` [:ref:`string `] (default: ``'worktree'``) (choices: "worktree", "stash") When computing a PCB/SCH diff it configures how do we preserve the current working state. The *worktree* mechanism creates a separated worktree, that then is just removed. The *stash* mechanism uses *git stash push/pop* to save the current changes. Using *worktree* is the preferred mechanism. - - ``hide_excluded`` :index:`: ` [boolean=false] Default value for the `hide_excluded` option of various PCB outputs. - - ``impedance_controlled`` :index:`: ` [boolean=false] The PCB needs specific dielectric characteristics. + - ``hide_excluded`` :index:`: ` [:ref:`boolean `] (default: ``false``) Default value for the `hide_excluded` option of various PCB outputs. + - ``impedance_controlled`` :index:`: ` [:ref:`boolean `] (default: ``false``) The PCB needs specific dielectric characteristics. KiCad 6: you should set this in the Board Setup -> Physical Stackup. - - ``include_components_from_pcb`` :index:`: ` [boolean=true] Include components that are only in the PCB, not in the schematic, for filter and variants processing. + - ``include_components_from_pcb`` :index:`: ` [:ref:`boolean `] (default: ``true``) Include components that are only in the PCB, not in the schematic, for filter and variants processing. Note that version 1.6.3 and older ignored them. - - ``invalidate_pcb_text_cache`` :index:`: ` [string='auto'] [auto,yes,no] Remove any cached text variable in the PCB. This is needed in order to force a text + - ``invalidate_pcb_text_cache`` :index:`: ` [:ref:`string `] (default: ``'auto'``) (choices: "auto", "yes", "no") Remove any cached text variable in the PCB. This is needed in order to force a text variables update when using `set_text_variables`. You might want to disable it when applying some changes to the PCB and create a new copy to send to somebody without changing the cached values. + Note that it will save the PCB with the cache erased. The `auto` value will remove the cached values only when using `set_text_variables`. - - ``kiauto_time_out_scale`` :index:`: ` [number=0.0] Time-out multiplier for KiAuto operations. - - ``kiauto_wait_start`` :index:`: ` [number=0] Time to wait for KiCad in KiAuto operations. - - ``kicad_dnp_applied`` :index:`: ` [boolean=true] The KiCad v7 PCB flag *Do Not Populate* is applied to our fitted flag before running any filter. - - ``kicad_dnp_applies_to_3D`` :index:`: ` [boolean=true] The KiCad v7 PCB flag *Do Not Populate* is applied to our fitted flag for 3D models, + - ``kiauto_time_out_scale`` :index:`: ` [:ref:`number `] (default: ``0.0``) Time-out multiplier for KiAuto operations. + - ``kiauto_wait_start`` :index:`: ` [:ref:`number `] (default: ``0``) Time to wait for KiCad in KiAuto operations. + - ``kicad_dnp_applied`` :index:`: ` [:ref:`boolean `] (default: ``true``) The KiCad v7 PCB flag *Do Not Populate* is applied to our fitted flag before running any filter. + - ``kicad_dnp_applies_to_3D`` :index:`: ` [:ref:`boolean `] (default: ``true``) The KiCad v7 PCB flag *Do Not Populate* is applied to our fitted flag for 3D models, even when no filter/variant is specified. Disabling `kicad_dnp_applied` also disables this flag. - - ``layer_defaults`` :index:`: ` [list(dict)] Used to indicate the default suffix and description for the layers. + - ``layer_defaults`` :index:`: ` [:ref:`list(dict) `] (default: ``[]``) Used to indicate the default suffix and description for the layers. Note that the name for the layer must match exactly, no aliases. - Valid keys: - - ``description`` :index:`: ` [string=''] A description for the layer, for documentation purposes. + - ``description`` :index:`: ` [:ref:`string `] (default: ``''``) A description for the layer, for documentation purposes. A default can be specified using the `layer_defaults` global option. - - ``layer`` :index:`: ` [string=''] Name of the layer. As you see it in KiCad. - - ``suffix`` :index:`: ` [string=''] Suffix used in file names related to this layer. Derived from the name if not specified. + - ``layer`` :index:`: ` [:ref:`string `] (default: ``''``) Name of the layer. As you see it in KiCad. + - ``suffix`` :index:`: ` [:ref:`string `] (default: ``''``) Suffix used in file names related to this layer. Derived from the name if not specified. A default can be specified using the `layer_defaults` global option. - - ``out_dir`` :index:`: ` [string=''] Base output dir, same as command line `--out-dir`. - - ``output`` :index:`: ` [string='%f-%i%I%v.%x'] Default pattern for output file names. Affected by global options. - - ``pcb_finish`` :index:`: ` [string='HAL'] Finishing used to protect pads. Currently used for documentation and to choose default colors. + - ``out_dir`` :index:`: ` [:ref:`string `] (default: ``''``) Base output dir, same as command line `--out-dir`. + - ``output`` :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) Default pattern for output file names. Affected by global options. + - ``pcb_finish`` :index:`: ` [:ref:`string `] (default: ``'HAL'``) Finishing used to protect pads. Currently used for documentation and to choose default colors. KiCad 6: you should set this in the Board Setup -> Board Finish -> Copper Finish option. Currently known are None, HAL, HASL, HAL SnPb, HAL lead-free, ENIG, ENEPIG, Hard gold, ImAg, Immersion Silver, Immersion Ag, ImAu, Immersion Gold, Immersion Au, Immersion Tin, Immersion Nickel, OSP and HT_OSP. - - ``pcb_material`` :index:`: ` [string='FR4'] PCB core material. Currently used for documentation and to choose default colors. + - ``pcb_material`` :index:`: ` [:ref:`string `] (default: ``'FR4'``) PCB core material. Currently used for documentation and to choose default colors. Currently known are FR1 to FR5. - - ``remove_adhesive_for_dnp`` :index:`: ` [boolean=true] When applying filters and variants remove the adhesive (glue) for components that won't be included. - - ``remove_solder_mask_for_dnp`` :index:`: ` [boolean=false] When applying filters and variants remove the solder mask apertures for components that won't be included. - - ``remove_solder_paste_for_dnp`` :index:`: ` [boolean=true] When applying filters and variants remove the solder paste for components that won't be included. - - ``resources_dir`` :index:`: ` [string='kibot_resources'] Directory where various resources are stored. Currently we support colors and fonts. + - ``remove_adhesive_for_dnp`` :index:`: ` [:ref:`boolean `] (default: ``true``) When applying filters and variants remove the adhesive (glue) for components that won't be included. + - ``remove_solder_mask_for_dnp`` :index:`: ` [:ref:`boolean `] (default: ``false``) When applying filters and variants remove the solder mask apertures for components that won't be included. + - ``remove_solder_paste_for_dnp`` :index:`: ` [:ref:`boolean `] (default: ``true``) When applying filters and variants remove the solder paste for components that won't be included. + - ``resources_dir`` :index:`: ` [:ref:`string `] (default: ``'kibot_resources'``) Directory where various resources are stored. Currently we support colors and fonts. They must be stored in sub-dirs. I.e. kibot_resources/fonts/MyFont.ttf Note this is mainly useful for CI/CD, so you can store fonts and colors in your repo. Also note that the fonts are installed using a mechanism known to work on Debian, which is used by the KiBot docker images, on other OSs *your mileage may vary*. - - ``restore_project`` :index:`: ` [boolean=false] Restore the KiCad project after execution. + - ``restore_project`` :index:`: ` [:ref:`boolean `] (default: ``false``) Restore the KiCad project after execution. Note that this option will undo operations like `set_text_variables`. Starting with 1.6.4 it also restores the PRL (Project Local Settings) and DRU (Design RUles) files. - - ``set_text_variables_before_output`` :index:`: ` [boolean=false] Run the `set_text_variables` preflight before running each output that involves variants. + - ``set_text_variables_before_output`` :index:`: ` [:ref:`boolean `] (default: ``false``) Run the `set_text_variables` preflight before running each output that involves variants. This can be used when a text variable uses the variant and you want to create more than one variant in the same run. Note that this could be slow because it forces a board reload each time you run an output that uses variants. - - ``silk_screen_color`` :index:`: ` [string='white'] Color for the markings. Currently used for documentation and to choose default colors. + - ``silk_screen_color`` :index:`: ` [:ref:`string `] (default: ``'white'``) Color for the markings. Currently used for documentation and to choose default colors. KiCad 6: you should set this in the Board Setup -> Physical Stackup. Currently known are black and white. - - ``silk_screen_color_bottom`` :index:`: ` [string=''] Color for the bottom silk screen. When not defined `silk_screen_color` is used. + - ``silk_screen_color_bottom`` :index:`: ` [:ref:`string `] (default: ``''``) Color for the bottom silk screen. When not defined `silk_screen_color` is used. Read `silk_screen_color` help. - - ``silk_screen_color_top`` :index:`: ` [string=''] Color for the top silk screen. When not defined `silk_screen_color` is used. + - ``silk_screen_color_top`` :index:`: ` [:ref:`string `] (default: ``''``) Color for the top silk screen. When not defined `silk_screen_color` is used. Read `silk_screen_color` help. - - ``solder_mask_color`` :index:`: ` [string='green'] Color for the solder mask. Currently used for documentation and to choose default colors. + - ``solder_mask_color`` :index:`: ` [:ref:`string `] (default: ``'green'``) Color for the solder mask. Currently used for documentation and to choose default colors. KiCad 6: you should set this in the Board Setup -> Physical Stackup. Currently known are green, black, white, yellow, purple, blue and red. - - ``solder_mask_color_bottom`` :index:`: ` [string=''] Color for the bottom solder mask. When not defined `solder_mask_color` is used. + - ``solder_mask_color_bottom`` :index:`: ` [:ref:`string `] (default: ``''``) Color for the bottom solder mask. When not defined `solder_mask_color` is used. Read `solder_mask_color` help. - - ``solder_mask_color_top`` :index:`: ` [string=''] Color for the top solder mask. When not defined `solder_mask_color` is used. + - ``solder_mask_color_top`` :index:`: ` [:ref:`string `] (default: ``''``) Color for the top solder mask. When not defined `solder_mask_color` is used. Read `solder_mask_color` help. - - ``str_no`` :index:`: ` [string='no'] String used for *no*. Currently used by the **update_pcb_characteristics** preflight. - - ``str_yes`` :index:`: ` [string='yes'] String used for *yes*. Currently used by the **update_pcb_characteristics** preflight. - - ``time_format`` :index:`: ` [string='%H-%M-%S'] Format used for the time we started the script. Uses the `strftime` format. - - ``time_reformat`` :index:`: ` [boolean=true] Tries to reformat the PCB/SCH date using the `date_format`. + - ``str_no`` :index:`: ` [:ref:`string `] (default: ``'no'``) String used for *no*. Currently used by the **update_pcb_characteristics** preflight. + - ``str_yes`` :index:`: ` [:ref:`string `] (default: ``'yes'``) String used for *yes*. Currently used by the **update_pcb_characteristics** preflight. + - ``time_format`` :index:`: ` [:ref:`string `] (default: ``'%H-%M-%S'``) Format used for the time we started the script. Uses the `strftime` format. + - ``time_reformat`` :index:`: ` [:ref:`boolean `] (default: ``true``) Tries to reformat the PCB/SCH date using the `date_format`. This assumes you let KiCad fill this value and hence the time is in ISO format (YY-MM-DD). - - ``units`` :index:`: ` [string=''] [millimeters,inches,mils] Default units. Affects `position`, `bom` and `panelize` outputs and + - ``units`` :index:`: ` [:ref:`string `] (default: ``''``) (choices: "millimeters", "inches", "mils") Default units. Affects `position`, `bom` and `panelize` outputs and the `erc` and `drc` preflights. Also KiCad 6 dimensions. - - ``use_dir_for_preflights`` :index:`: ` [boolean=true] Use the global `dir` as subdir for the preflights. - - ``use_os_env_for_expand`` :index:`: ` [boolean=true] In addition to KiCad text variables also use the OS environment variables when expanding `${VARIABLE}`. - - ``variant`` :index:`: ` [string=''] Default variant to apply to all outputs. + - ``use_dir_for_preflights`` :index:`: ` [:ref:`boolean `] (default: ``true``) Use the global `dir` as subdir for the preflights. + - ``use_os_env_for_expand`` :index:`: ` [:ref:`boolean `] (default: ``true``) In addition to KiCad text variables also use the OS environment variables when expanding `${VARIABLE}`. + - ``use_pcb_fields`` :index:`: ` [:ref:`boolean `] (default: ``true``) When a PCB is processed also use fields defined in the PCB, for filter and variants processing. + This is available for KiCad 8 and newer. + - ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Default variant to apply to all outputs. diff --git a/docs/source/configuration/sup_outputs.rst b/docs/source/configuration/sup_outputs.rst index 570a70210..f473fc16c 100644 --- a/docs/source/configuration/sup_outputs.rst +++ b/docs/source/configuration/sup_outputs.rst @@ -9,7 +9,7 @@ Notes: 2. Aliases are listed in *italics*. .. toctree:: - :maxdepth: 2 + :maxdepth: 1 outputs/blender_export outputs/boardview diff --git a/docs/source/configuration/sup_preflights.rst b/docs/source/configuration/sup_preflights.rst index f0c95461c..6e40b4bf5 100644 --- a/docs/source/configuration/sup_preflights.rst +++ b/docs/source/configuration/sup_preflights.rst @@ -3,259 +3,34 @@ Supported preflights ^^^^^^^^^^^^^^^^^^^^ -- **annotate_pcb**: :index:`: ` [dict] Annotates the PCB according to physical coordinates. - This preflight modifies the PCB and schematic, use it only in revision control environments. |br| - Used to assign references according to footprint coordinates. |br| - The project must be fully annotated first. - - - Valid keys: - - - ``bottom_main_ascending`` :index:`: ` [boolean=true] Sort the main axis in ascending order for the bottom layer. - For X this is left to right and for Y top to bottom. - - ``bottom_main_axis`` :index:`: ` [string='y'] [x,y] Use this axis as main sorting criteria for the bottom layer. - - ``bottom_secondary_ascending`` :index:`: ` [boolean=true] Sort the secondary axis in ascending order for the bottom layer. - For X this is left to right and for Y top to bottom. - - ``bottom_start`` :index:`: ` [number=101] First number for references at the bottom layer. - Use -1 to continue from the last top reference. - - ``grid`` :index:`: ` [number=1.0] Grid size in millimeters. - - ``top_main_ascending`` :index:`: ` [boolean=true] Sort the main axis in ascending order for the top layer. - For X this is left to right and for Y top to bottom. - - ``top_main_axis`` :index:`: ` [string='y'] [x,y] Use this axis as main sorting criteria for the top layer. - - ``top_secondary_ascending`` :index:`: ` [boolean=true] Sort the secondary axis in ascending order for the top layer. - For X this is left to right and for Y top to bottom. - - ``top_start`` :index:`: ` [number=1] First number for references at the top layer. - - ``use_position_of`` :index:`: ` [string='footprint'] [footprint,reference] Which coordinate is used. - -- **annotate_power**: :index:`: ` [boolean=false] Annotates all power components. - This preflight modifies the schematic, use it only in revision control environments. |br| - Used to solve ERC problems when using filters that remove power reference numbers. -- **check_zone_fills**: :index:`: ` [boolean=false] Zones are filled before doing any operation involving PCB layers. - The original PCB remains unchanged. If you need to abort when the zone fill - creates significant changes to a layer use the CheckZoneFill internal template. -- **draw_stackup**: :index:`: ` [boolean=False|dict] Draw the PCB stackup. Needs KiCad 7 or newer. - To specify the position and size of the drawing you can use two methods. |br| - You can specify it using the *pos_x*, *pos_y*, *width*, *height* and *layer* options. |br| - But you can also draw a rectangle in your PCB with the size and layer you want. |br| - Then draw another thing inside the rectangle, select both and create a group - (right mouse button, then Grouping -> Group). Now edit the group and change its name - to *kibot_stackup*. After running this preflight the rectangle will contain the - stackup. -- **drc**: :index:`: ` [boolean=false|dict] Runs the DRC (Distance Rules Check). To ensure we have a valid PCB. - You need a valid *fp-lib-table* installed. If not KiBot will try to temporarily install the template. |br| - This is a replacement for the *run_drc* preflight that needs KiCad 8 or newer. |br| - GUI exclusions and schematic parity are supported. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Name for the generated archive (%i=drc %x=according to format). Affected by global options. - - ``all_track_errors`` :index:`: ` [boolean=false] Report all the errors for all the tracks, not just the first. - - ``dir`` :index:`: ` [string=''] Sub-directory for the report. - - ``dont_stop`` :index:`: ` [boolean=false] Continue even if we detect errors. - - ``enabled`` :index:`: ` [boolean=true] Enable the check. This is the replacement for the boolean value. - - ``filters`` :index:`: ` [list(dict)] Used to manipulate the violations. Avoid using the *filters* preflight. - - - Valid keys: - - - ``change_to`` :index:`: ` [string='ignore'] [error,warning,ignore] The action of the filter. - Changing to *ignore* is the default and is used to suppress a violation, but you can also change - it to be an *error* or a *warning*. Note that violations excluded by KiCad are also analyzed, - so you can revert a GUI exclusion. - - ``error`` :index:`: ` [string=''] Error id we want to exclude. - - ``filter`` :index:`: ` [string=''] Name for the filter, for documentation purposes. - - *filter_msg* :index:`: ` Alias for filter. - - ``regex`` :index:`: ` [string=''] Regular expression to match the text for the error we want to exclude. - - *regexp* :index:`: ` Alias for regex. - - - ``format`` :index:`: ` [string|list(string)='HTML'][RPT,HTML,CSV,JSON] Format/s used for the report. - You can specify multiple formats. - - - ``ignore_unconnected`` :index:`: ` [boolean=false] Ignores the unconnected nets. Useful if you didn't finish the routing. - - ``schematic_parity`` :index:`: ` [boolean=true] Check if the PCB and the schematic are coincident. - - ``units`` :index:`: ` [string='millimeters'] [millimeters,inches,mils] Units used for the positions. Affected by global options. - - ``warnings_as_errors`` :index:`: ` [boolean=false] Warnings are considered errors, they still reported as errors, but consider it an error. - -- **erc**: :index:`: ` [boolean=false|dict] Runs the ERC (Electrical Rules Check). To ensure the schematic is electrically correct. - You need a valid *sym-lib-table* installed. If not KiBot will try to temporarily install the template. |br| - This is a replacement for the *run_erc* preflight that needs KiCad 8 or newer. - - - Valid keys: - - - **output** :index:`: ` [string='%f-%i%I%v.%x'] Name for the generated archive (%i=erc %x=according to format). Affected by global options. - - ``dir`` :index:`: ` [string=''] Sub-directory for the report. - - ``dont_stop`` :index:`: ` [boolean=false] Continue even if we detect errors. - - ``enabled`` :index:`: ` [boolean=true] Enable the check. This is the replacement for the boolean value. - - ``filters`` :index:`: ` [list(dict)] Used to manipulate the violations. Avoid using the *filters* preflight. - - - Valid keys: - - - ``change_to`` :index:`: ` [string='ignore'] [error,warning,ignore] The action of the filter. - Changing to *ignore* is the default and is used to suppress a violation, but you can also change - it to be an *error* or a *warning*. Note that violations excluded by KiCad are also analyzed, - so you can revert a GUI exclusion. - - ``error`` :index:`: ` [string=''] Error id we want to exclude. - - ``filter`` :index:`: ` [string=''] Name for the filter, for documentation purposes. - - *filter_msg* :index:`: ` Alias for filter. - - ``regex`` :index:`: ` [string=''] Regular expression to match the text for the error we want to exclude. - - *regexp* :index:`: ` Alias for regex. - - - ``format`` :index:`: ` [string|list(string)='HTML'][RPT,HTML,CSV,JSON] Format/s used for the report. - You can specify multiple formats. - - - ``units`` :index:`: ` [string='millimeters'] [millimeters,inches,mils] Units used for the positions. Affected by global options. - - ``warnings_as_errors`` :index:`: ` [boolean=false] Warnings are considered errors, they still reported as errors, but consider it an error. - -- **erc_warnings**: :index:`: ` [boolean=false] **Deprecated**, use the `warnings_as_errors` option from `run_erc`/`erc`. - Option for `run_erc`. ERC warnings are considered errors. -- **fill_zones**: :index:`: ` [boolean=false] Fill all zones again and save the PCB. -- **filters**: :index:`: ` [list(dict)] A list of entries to filter out ERC/DRC messages when using *run_erc*/*run_drc*. - Avoid using it with the new *erc* and *drc* preflights. |br| - Note that ignored errors will become KiBot warnings (i.e. `(W058) ...`). |br| - To farther ignore these warnings use the `filters` option in the `global` section. - - - Valid keys: - - - ``error`` :index:`: ` [string=''] Error id we want to exclude. - A name for KiCad 6 or a number for KiCad 5, but always a string. - - *error_number* :index:`: ` Alias for number. - - ``filter`` :index:`: ` [string=''] Name for the filter, for documentation purposes. - - *filter_msg* :index:`: ` Alias for filter. - - ``number`` :index:`: ` [number=0] Error number we want to exclude. - KiCad 5 only. - - ``regex`` :index:`: ` [string=''] Regular expression to match the text for the error we want to exclude. - - *regexp* :index:`: ` Alias for regex. - -- **ignore_unconnected**: :index:`: ` [boolean=false] **Deprecated**, use the `ignore_unconnected` option from `run_drc`/`drc`. - Option for `run_drc`. Ignores the unconnected nets. Useful if you didn't finish the routing. |br| - It will also ignore KiCad 6 warnings when using `run_drc`. -- **pcb_replace**: :index:`: ` [dict] Replaces tags in the PCB. I.e. to insert the git hash or last revision date. - This is useful for KiCad 5, use `set_text_variables` when using KiCad 6. |br| - This preflight modifies the PCB. Even when a back-up is done use it carefully. - - - Valid keys: - - - ``date_command`` :index:`: ` [string=''] Command to get the date to use in the PCB.\\ - ```git log -1 --format='%as' -- "$KIBOT_PCB_NAME"```\\ - Will return the date in YYYY-MM-DD format.\\ - ```date -d @`git log -1 --format='%at' -- "$KIBOT_PCB_NAME"` +%Y-%m-%d_%H-%M-%S```\\ - Will return the date in YYYY-MM-DD_HH-MM-SS format.\\ - Important: on KiCad 6 the title block data is optional. - This command will work only if you have a date in the PCB/Schematic. - - ``replace_tags`` :index:`: ` [dict|list(dict)] Tag or tags to replace. - - - Valid keys: - - - ``after`` :index:`: ` [string=''] Text to add after the output of `command`. - - ``before`` :index:`: ` [string=''] Text to add before the output of `command`. - - ``command`` :index:`: ` [string=''] Command to execute to get the text, will be used only if `text` is empty. - KIBOT_PCB_NAME variable is the name of the current PCB. - - ``tag`` :index:`: ` [string=''] Name of the tag to replace. Use `version` for a tag named `@version@`. - - ``tag_delimiter`` :index:`: ` [string='@'] Character used to indicate the beginning and the end of a tag. - Don't change it unless you really know about KiCad's file formats. - - ``text`` :index:`: ` [string=''] Text to insert instead of the tag. - - -- **run_drc**: :index:`: ` [boolean=false|dict] Runs the DRC (Distance Rules Check). To ensure we have a valid PCB. - The report file name is controlled by the global output pattern (%i=drc %x=txt). |br| - Note that the KiCad 6+ *Test for parity between PCB and schematic* option is not supported. |br| - If you need to check the parity use the `update_xml` preflight. |br| - KiCad 6 introduced `warnings` they are currently counted be the `unconnected` counter of KiBot. |br| - This will change in the future. |br| - If you use DRC exclusions please consult the `drc_exclusions_workaround` global option. - - - Valid keys: - - - ``dir`` :index:`: ` [string=''] Sub-directory for the report. - - ``enabled`` :index:`: ` [boolean=true] Enable the DRC. This is the replacement for the boolean value. - - ``ignore_unconnected`` :index:`: ` [boolean=false] Ignores the unconnected nets. Useful if you didn't finish the routing. - It will also ignore KiCad 6 warnings. - -- **run_erc**: :index:`: ` [boolean=false|dict] (Deprecated for KiCad 8, use *erc*) Runs the ERC (Electrical Rules Check). - To ensure the schematic is electrically correct. |br| - The report file name is controlled by the global output pattern (%i=erc %x=txt). - - - Valid keys: - - - ``dir`` :index:`: ` [string=''] Sub-directory for the report. - - ``enabled`` :index:`: ` [boolean=true] Enable the ERC. This is the replacement for the boolean value. - - ``warnings_as_errors`` :index:`: ` [boolean=false] ERC warnings are considered errors. - -- **sch_replace**: :index:`: ` [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date. - This is useful for KiCad 5, use `set_text_variables` when using KiCad 6. |br| - This preflight modifies the schematics. Even when a back-up is done use it carefully. - - - Valid keys: - - - ``date_command`` :index:`: ` [string=''] Command to get the date to use in the SCH.\\ - ```git log -1 --format='%as' -- "$KIBOT_SCH_NAME"```\\ - Will return the date in YYYY-MM-DD format.\\ - ```date -d @`git log -1 --format='%at' -- "$KIBOT_SCH_NAME"` +%Y-%m-%d_%H-%M-%S```\\ - Will return the date in YYYY-MM-DD_HH-MM-SS format.\\ - Important: on KiCad 6 the title block data is optional. - This command will work only if you have a date in the SCH/Schematic. - - ``replace_tags`` :index:`: ` [dict|list(dict)] Tag or tags to replace. - - - Valid keys: - - - ``after`` :index:`: ` [string=''] Text to add after the output of `command`. - - ``before`` :index:`: ` [string=''] Text to add before the output of `command`. - - ``command`` :index:`: ` [string=''] Command to execute to get the text, will be used only if `text` is empty. - KIBOT_SCH_NAME variable is the name of the current sheet. - KIBOT_TOP_SCH_NAME variable is the name of the top sheet. - - ``tag`` :index:`: ` [string=''] Name of the tag to replace. Use `version` for a tag named `@version@`. - - ``tag_delimiter`` :index:`: ` [string='@'] Character used to indicate the beginning and the end of a tag. - Don't change it unless you really know about KiCad's file formats. - - ``text`` :index:`: ` [string=''] Text to insert instead of the tag. - - -- **set_text_variables**: :index:`: ` [dict|list(dict)] Defines KiCad 6+ variables. - They are expanded using `${VARIABLE}`, and stored in the project file. |br| - This preflight replaces `pcb_replace` and `sch_replace` when using KiCad 6. |br| - The KiCad project file is modified. |br| - -.. warning:: - don't use `-s all` or this preflight will be skipped -.. . - - - Valid keys: - - - ``after`` :index:`: ` [string=''] Text to add after the output of `command`. - - ``before`` :index:`: ` [string=''] Text to add before the output of `command`. - - ``command`` :index:`: ` [string=''] Command to execute to get the text, will be used only if `text` is empty. - This command will be executed using the Bash shell. - Be careful about spaces in file names (i.e. use "$KIBOT_PCB_NAME"). - The `KIBOT_PCB_NAME` environment variable is the PCB file and the - `KIBOT_SCH_NAME` environment variable is the schematic file. - - ``expand_kibot_patterns`` :index:`: ` [boolean=true] Expand %X patterns. The context is `schematic`. - - ``name`` :index:`: ` [string=''] Name of the variable. The `version` variable will be expanded using `${version}`. - - ``text`` :index:`: ` [string=''] Text to insert instead of the variable. - - *variable* :index:`: ` Alias for name. - -- **update_footprint**: :index:`: ` [string|list(string)=''] Updates footprints from the libs, you must provide one or more references to be updated. - This is useful to replace logos using freshly created versions. -- **update_pcb_characteristics**: :index:`: ` [boolean=False] Update the information in the Board Characteristics. - Starting with KiCad 7 you can paste a block containing board information using - *Place* -> *Add Board Characteristics*. But this information is static, so if - you modify anything related to it the block will be obsolete. |br| - This preflight tries to refresh the information. -- **update_qr**: :index:`: ` [boolean=false] Update the QR codes. - Complements the `qr_lib` output. |br| - The KiCad 6 files and the KiCad 5 PCB needs manual update, generating a new library isn't enough. -- **update_stackup**: :index:`: ` [boolean=False] Update the information in the Stackup Table. - Starting with KiCad 7 you can paste a block containing board information using - *Place* -> *Stackup Table*. But this information is static, so if - you modify anything related to it the block will be obsolete. |br| - This preflight tries to refresh the information. -- **update_xml**: :index:`: ` [boolean=false|dict] Update the XML version of the BoM (Bill of Materials). - To ensure our generated BoM is up to date. |br| - Note that this isn't needed when using the internal BoM generator (`bom`). |br| - You can compare the PCB and schematic netlists using it. - - - Valid keys: - - - **check_pcb_parity** :index:`: ` [boolean=false] Check if the PCB and Schematic are synchronized. - This is equivalent to the *Test for parity between PCB and schematic* of the DRC dialog. - Not available for KiCad 5. **Important**: when using KiCad 6 and the *Exclude from BoM* attribute - these components won't be included in the generated XML, so we can't check its parity. - - ``as_warnings`` :index:`: ` [boolean=false] Inform the problems as warnings and don't stop. - - ``enabled`` :index:`: ` [boolean=true] Enable the update. This is the replacement for the boolean value. - +.. toctree:: + :maxdepth: 1 + + preflights/annotate_pcb + preflights/annotate_power + preflights/check_fields + preflights/check_zone_fills + preflights/draw_stackup + preflights/drc + preflights/erc + preflights/fill_zones + preflights/filters + preflights/set_text_variables + preflights/update_footprint + preflights/update_pcb_characteristics + preflights/update_qr + preflights/update_stackup + preflights/update_xml + +Supported deprecated preflights +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. toctree:: + :maxdepth: 1 + + preflights/erc_warnings + preflights/ignore_unconnected + preflights/pcb_replace + preflights/run_drc + preflights/run_erc + preflights/sch_replace diff --git a/docs/source/configuration/sup_variants.rst b/docs/source/configuration/sup_variants.rst index 2b4e6ae7a..47c590d28 100644 --- a/docs/source/configuration/sup_variants.rst +++ b/docs/source/configuration/sup_variants.rst @@ -3,202 +3,9 @@ Supported variants ^^^^^^^^^^^^^^^^^^ -- **ibom**: (**IBoM variant style**) :index:`. ` - - The Config field (configurable) contains a value. |br| - If this value matches with a value in the whitelist is included. |br| - If this value matches with a value in the blacklist is excluded. - - - Valid keys: - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``dnc_filter`` :index:`: ` [string|list(string)=''] Name of the filter to mark components as 'Do Not Change'. - Use '_kibom_dnc' for the default KiBoM behavior. - - - ``dnf_filter`` :index:`: ` [string|list(string)=''] Name of the filter to mark components as 'Do Not Fit'. - Use '_kibom_dnf' for the default KiBoM behavior. - Use '_kicost_dnp'' for the default KiCost behavior. - - - ``exclude_filter`` :index:`: ` [string|list(string)=''] Name of the filter to exclude components from BoM processing. - Use '_mechanical' for the default KiBoM behavior. - - - ``file_id`` :index:`: ` [string=''] Text to use as the replacement for %v expansion. - - ``name`` :index:`: ` [string=''] Used to identify this particular variant definition. - - ``pre_transform`` :index:`: ` [string|list(string)=''] Name of the filter to transform fields before applying other filters. - Use '_var_rename' to transform VARIANT:FIELD fields. - Use '_var_rename_kicost' to transform kicost.VARIANT:FIELD fields. - Use '_kicost_rename' to apply KiCost field rename rules. - - - ``sub_pcbs`` :index:`: ` [list(dict)] Used for multi-board workflows as defined by KiKit. - I don't recommend using it, for detail read - `this `__. - But if you really need it you can define the sub-PCBs here. - Then you just use *VARIANT[SUB_PCB_NAME]* instead of just *VARIANT*. - - - Valid keys: - - - **name** :index:`: ` [string=''] Name for this sub-pcb. - - *ref* :index:`: ` Alias for reference. - - **reference** :index:`: ` [string=''] Use it for the annotations method. - This is the reference for the `kikit:Board` footprint used to identify the sub-PCB. - Note that you can use any footprint as long as its position is inside the PCB outline. - When empty the sub-PCB is specified using a rectangle. - - *bottom_right_x* :index:`: ` Alias for brx. - - *bottom_right_y* :index:`: ` Alias for bry. - - ``brx`` :index:`: ` [number|string] The X position of the bottom right corner for the rectangle that contains the sub-PCB. - - ``bry`` :index:`: ` [number|string] The Y position of the bottom right corner for the rectangle that contains the sub-PCB. - - ``center_result`` :index:`: ` [boolean=true] Move the resulting PCB to the center of the page. - You can disable it only for the internal tool, KiKit should always do it. - - ``file_id`` :index:`: ` [string=''] Text to use as the replacement for %v expansion. - When empty we use the parent `file_id` plus the `name` of the sub-PCB. - - ``strip_annotation`` :index:`: ` [boolean=false] Remove the annotation footprint. Note that KiKit will remove all annotations, - but the internal implementation just the one indicated by `ref`. - If you need to remove other annotations use an exclude filter. - - ``tlx`` :index:`: ` [number|string] The X position of the top left corner for the rectangle that contains the sub-PCB. - - ``tly`` :index:`: ` [number|string] The Y position of the top left corner for the rectangle that contains the sub-PCB. - - ``tolerance`` :index:`: ` [number|string] Used to enlarge the selected rectangle to include elements outside the board. - KiCad 5: To avoid rounding issues this value is set to 0.000002 mm when 0 is specified. - - ``tool`` :index:`: ` [string='internal'] [internal,kikit] Tool used to extract the sub-PCB.. - - *top_left_x* :index:`: ` Alias for tlx. - - *top_left_y* :index:`: ` Alias for tly. - - ``units`` :index:`: ` [string='mm'] [millimeters,inches,mils,mm,cm,dm,m,mil,inch,in] Units used when omitted. - - - ``variant_field`` :index:`: ` [string='Config'] Name of the field that stores board variant for component. - - ``variants_blacklist`` :index:`: ` [string|list(string)=''] List of board variants to exclude from the BOM. - - - ``variants_whitelist`` :index:`: ` [string|list(string)=''] List of board variants to include in the BOM. - - -- **kibom**: (**KiBoM variant style**) :index:`. ` - - The Config field (configurable) contains a comma separated list of variant directives. |br| - -VARIANT excludes a component from VARIANT. |br| - +VARIANT includes the component only if we are using this variant. - - - Valid keys: - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``config_field`` :index:`: ` [string='Config'] Name of the field used to classify components. - - ``dnc_filter`` :index:`: ` [string|list(string)='_kibom_dnc_CONFIG_FIELD'] Name of the filter to mark components as 'Do Not Change'. - Use '_kibom_dnc' for the default KiBoM behavior. - - - ``dnf_filter`` :index:`: ` [string|list(string)='_kibom_dnf_CONFIG_FIELD'] Name of the filter to mark components as 'Do Not Fit'. - Use '_kibom_dnf' for the default KiBoM behavior. - Use '_kicost_dnp'_kibom_dnf_CONFIG_FIELD' for the default KiCost behavior. - - - ``exclude_filter`` :index:`: ` [string|list(string)='_mechanical'] Name of the filter to exclude components from BoM processing. - Use '_mechanical' for the default KiBoM behavior. - - - ``file_id`` :index:`: ` [string=''] Text to use as the replacement for %v expansion. - - ``name`` :index:`: ` [string=''] Used to identify this particular variant definition. - - ``pre_transform`` :index:`: ` [string|list(string)=''] Name of the filter to transform fields before applying other filters. - Use '_var_rename' to transform VARIANT:FIELD fields. - Use '_var_rename_kicost' to transform kicost.VARIANT:FIELD fields. - Use '_kicost_rename' to apply KiCost field rename rules. - - - ``sub_pcbs`` :index:`: ` [list(dict)] Used for multi-board workflows as defined by KiKit. - I don't recommend using it, for detail read - `this `__. - But if you really need it you can define the sub-PCBs here. - Then you just use *VARIANT[SUB_PCB_NAME]* instead of just *VARIANT*. - - - Valid keys: - - - **name** :index:`: ` [string=''] Name for this sub-pcb. - - *ref* :index:`: ` Alias for reference. - - **reference** :index:`: ` [string=''] Use it for the annotations method. - This is the reference for the `kikit:Board` footprint used to identify the sub-PCB. - Note that you can use any footprint as long as its position is inside the PCB outline. - When empty the sub-PCB is specified using a rectangle. - - *bottom_right_x* :index:`: ` Alias for brx. - - *bottom_right_y* :index:`: ` Alias for bry. - - ``brx`` :index:`: ` [number|string] The X position of the bottom right corner for the rectangle that contains the sub-PCB. - - ``bry`` :index:`: ` [number|string] The Y position of the bottom right corner for the rectangle that contains the sub-PCB. - - ``center_result`` :index:`: ` [boolean=true] Move the resulting PCB to the center of the page. - You can disable it only for the internal tool, KiKit should always do it. - - ``file_id`` :index:`: ` [string=''] Text to use as the replacement for %v expansion. - When empty we use the parent `file_id` plus the `name` of the sub-PCB. - - ``strip_annotation`` :index:`: ` [boolean=false] Remove the annotation footprint. Note that KiKit will remove all annotations, - but the internal implementation just the one indicated by `ref`. - If you need to remove other annotations use an exclude filter. - - ``tlx`` :index:`: ` [number|string] The X position of the top left corner for the rectangle that contains the sub-PCB. - - ``tly`` :index:`: ` [number|string] The Y position of the top left corner for the rectangle that contains the sub-PCB. - - ``tolerance`` :index:`: ` [number|string] Used to enlarge the selected rectangle to include elements outside the board. - KiCad 5: To avoid rounding issues this value is set to 0.000002 mm when 0 is specified. - - ``tool`` :index:`: ` [string='internal'] [internal,kikit] Tool used to extract the sub-PCB.. - - *top_left_x* :index:`: ` Alias for tlx. - - *top_left_y* :index:`: ` Alias for tly. - - ``units`` :index:`: ` [string='mm'] [millimeters,inches,mils,mm,cm,dm,m,mil,inch,in] Units used when omitted. - - - ``variant`` :index:`: ` [string|list(string)=''] Board variant(s). - - -- **kicost**: (**KiCost variant style**) :index:`. ` - - The `variant` field (configurable) contains one or more values. |br| - If any of these values matches the variant regex the component is included. |br| - By default a pre-transform filter is applied to support kicost.VARIANT:FIELD and - field name aliases used by KiCost. |br| - Also a default `dnf_filter` implements the KiCost DNP mechanism. - - - Valid keys: - - - ``comment`` :index:`: ` [string=''] A comment for documentation purposes. - - ``dnc_filter`` :index:`: ` [string|list(string)=''] Name of the filter to mark components as 'Do Not Change'. - Use '_kibom_dnc' for the default KiBoM behavior. - - - ``dnf_filter`` :index:`: ` [string|list(string)=''] Name of the filter to mark components as 'Do Not Fit'. - Use '_kibom_dnf' for the default KiBoM behavior. - Use '_kicost_dnp'' for the default KiCost behavior. - - - ``exclude_filter`` :index:`: ` [string|list(string)=''] Name of the filter to exclude components from BoM processing. - Use '_mechanical' for the default KiBoM behavior. - - - ``file_id`` :index:`: ` [string=''] Text to use as the replacement for %v expansion. - - ``name`` :index:`: ` [string=''] Used to identify this particular variant definition. - - ``pre_transform`` :index:`: ` [string|list(string)=''] Name of the filter to transform fields before applying other filters. - Use '_var_rename' to transform VARIANT:FIELD fields. - Use '_var_rename_kicost' to transform kicost.VARIANT:FIELD fields. - Use '_kicost_rename' to apply KiCost field rename rules. - - - ``separators`` :index:`: ` [string=',;/ '] Valid separators for variants in the variant field. - Each character is a valid separator. - Only supported internally, don't use it if you plan to use KiCost. - - ``sub_pcbs`` :index:`: ` [list(dict)] Used for multi-board workflows as defined by KiKit. - I don't recommend using it, for detail read - `this `__. - But if you really need it you can define the sub-PCBs here. - Then you just use *VARIANT[SUB_PCB_NAME]* instead of just *VARIANT*. - - - Valid keys: - - - **name** :index:`: ` [string=''] Name for this sub-pcb. - - *ref* :index:`: ` Alias for reference. - - **reference** :index:`: ` [string=''] Use it for the annotations method. - This is the reference for the `kikit:Board` footprint used to identify the sub-PCB. - Note that you can use any footprint as long as its position is inside the PCB outline. - When empty the sub-PCB is specified using a rectangle. - - *bottom_right_x* :index:`: ` Alias for brx. - - *bottom_right_y* :index:`: ` Alias for bry. - - ``brx`` :index:`: ` [number|string] The X position of the bottom right corner for the rectangle that contains the sub-PCB. - - ``bry`` :index:`: ` [number|string] The Y position of the bottom right corner for the rectangle that contains the sub-PCB. - - ``center_result`` :index:`: ` [boolean=true] Move the resulting PCB to the center of the page. - You can disable it only for the internal tool, KiKit should always do it. - - ``file_id`` :index:`: ` [string=''] Text to use as the replacement for %v expansion. - When empty we use the parent `file_id` plus the `name` of the sub-PCB. - - ``strip_annotation`` :index:`: ` [boolean=false] Remove the annotation footprint. Note that KiKit will remove all annotations, - but the internal implementation just the one indicated by `ref`. - If you need to remove other annotations use an exclude filter. - - ``tlx`` :index:`: ` [number|string] The X position of the top left corner for the rectangle that contains the sub-PCB. - - ``tly`` :index:`: ` [number|string] The Y position of the top left corner for the rectangle that contains the sub-PCB. - - ``tolerance`` :index:`: ` [number|string] Used to enlarge the selected rectangle to include elements outside the board. - KiCad 5: To avoid rounding issues this value is set to 0.000002 mm when 0 is specified. - - ``tool`` :index:`: ` [string='internal'] [internal,kikit] Tool used to extract the sub-PCB.. - - *top_left_x* :index:`: ` Alias for tlx. - - *top_left_y* :index:`: ` Alias for tly. - - ``units`` :index:`: ` [string='mm'] [millimeters,inches,mils,mm,cm,dm,m,mil,inch,in] Units used when omitted. - - - ``variant`` :index:`: ` [string=''] Variants to match (regex). - - ``variant_field`` :index:`: ` [string='variant'] Name of the field that stores board variant/s for component. - Only supported internally, don't use it if you plan to use KiCost. +.. toctree:: + :maxdepth: 1 + variants/ibom + variants/kibom + variants/kicost diff --git a/docs/source/configuration/variants/SubPCBOptions.rst b/docs/source/configuration/variants/SubPCBOptions.rst new file mode 100644 index 000000000..e1c1b7a6f --- /dev/null +++ b/docs/source/configuration/variants/SubPCBOptions.rst @@ -0,0 +1,32 @@ +.. _SubPCBOptions: + + +SubPCBOptions parameters +~~~~~~~~~~~~~~~~~~~~~~~~ + +- **name** :index:`: ` [:ref:`string `] (default: ``''``) Name for this sub-pcb. +- *ref* :index:`: ` Alias for reference. +- **reference** :index:`: ` [:ref:`string `] (default: ``''``) Use it for the annotations method. + This is the reference for the `kikit:Board` footprint used to identify the sub-PCB. + Note that you can use any footprint as long as its position is inside the PCB outline. + When empty the sub-PCB is specified using a rectangle. +- *bottom_right_x* :index:`: ` Alias for brx. +- *bottom_right_y* :index:`: ` Alias for bry. +- ``brx`` :index:`: ` [:ref:`number ` | :ref:`string `] The X position of the bottom right corner for the rectangle that contains the sub-PCB. +- ``bry`` :index:`: ` [:ref:`number ` | :ref:`string `] The Y position of the bottom right corner for the rectangle that contains the sub-PCB. +- ``center_result`` :index:`: ` [:ref:`boolean `] (default: ``true``) Move the resulting PCB to the center of the page. + You can disable it only for the internal tool, KiKit should always do it. +- ``file_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use as the replacement for %v expansion. + When empty we use the parent `file_id` plus the `name` of the sub-PCB. +- ``strip_annotation`` :index:`: ` [:ref:`boolean `] (default: ``false``) Remove the annotation footprint. Note that KiKit will remove all annotations, + but the internal implementation just the one indicated by `ref`. + If you need to remove other annotations use an exclude filter. +- ``tlx`` :index:`: ` [:ref:`number ` | :ref:`string `] The X position of the top left corner for the rectangle that contains the sub-PCB. +- ``tly`` :index:`: ` [:ref:`number ` | :ref:`string `] The Y position of the top left corner for the rectangle that contains the sub-PCB. +- ``tolerance`` :index:`: ` [:ref:`number ` | :ref:`string `] Used to enlarge the selected rectangle to include elements outside the board. + KiCad 5: To avoid rounding issues this value is set to 0.000002 mm when 0 is specified. +- ``tool`` :index:`: ` [:ref:`string `] (default: ``'internal'``) (choices: "internal", "kikit") Tool used to extract the sub-PCB.. +- *top_left_x* :index:`: ` Alias for tlx. +- *top_left_y* :index:`: ` Alias for tly. +- ``units`` :index:`: ` [:ref:`string `] (default: ``'mm'``) (choices: "millimeters", "inches", "mils", "mm", "cm", "dm", "m", "mil", "inch", "in") Units used when omitted. + diff --git a/docs/source/configuration/variants/ibom.rst b/docs/source/configuration/variants/ibom.rst new file mode 100644 index 000000000..96f84df54 --- /dev/null +++ b/docs/source/configuration/variants/ibom.rst @@ -0,0 +1,45 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: **ibom** (**IBoM variant style**) :index:`. `; ibom + +**ibom** (**IBoM variant style**) :index:`. ` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + The Config field (configurable) contains a value. |br| + If this value matches with a value in the whitelist is included. |br| + If this value matches with a value in the blacklist is excluded + + - ``comment`` :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - ``dnc_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_null'``) Name of the filter to mark components as 'Do Not Change'. + Use '_kibom_dnc' for the default KiBoM behavior. + + - ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_null'``) Name of the filter to mark components as 'Do Not Fit'. + Use '_kibom_dnf' for the default KiBoM behavior. + Use '_kicost_dnp'' for the default KiCost behavior. + + - ``exclude_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_mechanical'``) Name of the filter to exclude components from BoM processing. + Use '_mechanical' for the default KiBoM behavior. + + - ``file_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use as the replacement for %v expansion. + - ``name`` :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular variant definition. + - ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_null'``) Name of the filter to transform fields before applying other filters. + Use '_var_rename' to transform VARIANT:FIELD fields. + Use '_var_rename_kicost' to transform kicost.VARIANT:FIELD fields. + Use '_kicost_rename' to apply KiCost field rename rules. + + - ``sub_pcbs`` :index:`: ` [:ref:`SubPCBOptions parameters `] [:ref:`list(dict) `] (default: ``[]``) Used for multi-board workflows as defined by KiKit. + I don't recommend using it, for detail read + `this `__. + But if you really need it you can define the sub-PCBs here. + Then you just use *VARIANT[SUB_PCB_NAME]* instead of just *VARIANT*. + - ``variant_field`` :index:`: ` [:ref:`string `] (default: ``'Config'``) Name of the field that stores board variant for component. + - ``variants_blacklist`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) [:ref:`comma separated `] List of board variants to exclude from the BOM. + + - ``variants_whitelist`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) [:ref:`comma separated `] List of board variants to include in the BOM. + + +.. toctree:: + :caption: Used dicts + + SubPCBOptions diff --git a/docs/source/configuration/variants/kibom.rst b/docs/source/configuration/variants/kibom.rst new file mode 100644 index 000000000..debe5fece --- /dev/null +++ b/docs/source/configuration/variants/kibom.rst @@ -0,0 +1,43 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: **kibom** (**KiBoM variant style**) :index:`. `; kibom + +**kibom** (**KiBoM variant style**) :index:`. ` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + The Config field (configurable) contains a comma separated list of variant directives. |br| + -VARIANT excludes a component from VARIANT. |br| + +VARIANT includes the component only if we are using this variant + + - ``comment`` :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - ``config_field`` :index:`: ` [:ref:`string `] (default: ``'Config'``) Name of the field used to classify components. + - ``dnc_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_kibom_dnc_CONFIG_FIELD'``) Name of the filter to mark components as 'Do Not Change'. + Use '_kibom_dnc' for the default KiBoM behavior. + + - ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_kibom_dnf_CONFIG_FIELD'``) Name of the filter to mark components as 'Do Not Fit'. + Use '_kibom_dnf' for the default KiBoM behavior. + Use '_kicost_dnp'' for the default KiCost behavior. + + - ``exclude_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_mechanical'``) Name of the filter to exclude components from BoM processing. + Use '_mechanical' for the default KiBoM behavior. + + - ``file_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use as the replacement for %v expansion. + - ``name`` :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular variant definition. + - ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_null'``) Name of the filter to transform fields before applying other filters. + Use '_var_rename' to transform VARIANT:FIELD fields. + Use '_var_rename_kicost' to transform kicost.VARIANT:FIELD fields. + Use '_kicost_rename' to apply KiCost field rename rules. + + - ``sub_pcbs`` :index:`: ` [:ref:`SubPCBOptions parameters `] [:ref:`list(dict) `] (default: ``[]``) Used for multi-board workflows as defined by KiKit. + I don't recommend using it, for detail read + `this `__. + But if you really need it you can define the sub-PCBs here. + Then you just use *VARIANT[SUB_PCB_NAME]* instead of just *VARIANT*. + - ``variant`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``[]``) [:ref:`comma separated `] Board variant(s). + + +.. toctree:: + :caption: Used dicts + + SubPCBOptions diff --git a/docs/source/configuration/variants/kicost.rst b/docs/source/configuration/variants/kicost.rst new file mode 100644 index 000000000..a0629f4e7 --- /dev/null +++ b/docs/source/configuration/variants/kicost.rst @@ -0,0 +1,48 @@ +.. Automatically generated by KiBot, please don't edit this file + +.. index:: + pair: **kicost** (**KiCost variant style**) :index:`. `; kicost + +**kicost** (**KiCost variant style**) :index:`. ` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + The `variant` field (configurable) contains one or more values. |br| + If any of these values matches the variant regex the component is included. |br| + By default a pre-transform filter is applied to support kicost.VARIANT:FIELD and + field name aliases used by KiCost. |br| + Also a default `dnf_filter` implements the KiCost DNP mechanism + + - ``comment`` :index:`: ` [:ref:`string `] (default: ``''``) A comment for documentation purposes. + - ``dnc_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_null'``) Name of the filter to mark components as 'Do Not Change'. + Use '_kibom_dnc' for the default KiBoM behavior. + + - ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_kicost_dnp'``) Name of the filter to mark components as 'Do Not Fit'. + Use '_kibom_dnf' for the default KiBoM behavior. + Use '_kicost_dnp'' for the default KiCost behavior. + + - ``exclude_filter`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``'_null'``) Name of the filter to exclude components from BoM processing. + Use '_mechanical' for the default KiBoM behavior. + + - ``file_id`` :index:`: ` [:ref:`string `] (default: ``''``) Text to use as the replacement for %v expansion. + - ``name`` :index:`: ` [:ref:`string `] (default: ``''``) Used to identify this particular variant definition. + - ``pre_transform`` :index:`: ` [:ref:`string ` | :ref:`list(string) `] (default: ``['_var_rename_kicost', '_kicost_rename']``) Name of the filter to transform fields before applying other filters. + Use '_var_rename' to transform VARIANT:FIELD fields. + Use '_var_rename_kicost' to transform kicost.VARIANT:FIELD fields. + Use '_kicost_rename' to apply KiCost field rename rules. + + - ``separators`` :index:`: ` [:ref:`string `] (default: ``',;/ '``) Valid separators for variants in the variant field. + Each character is a valid separator. + Only supported internally, don't use it if you plan to use KiCost. + - ``sub_pcbs`` :index:`: ` [:ref:`SubPCBOptions parameters `] [:ref:`list(dict) `] (default: ``[]``) Used for multi-board workflows as defined by KiKit. + I don't recommend using it, for detail read + `this `__. + But if you really need it you can define the sub-PCBs here. + Then you just use *VARIANT[SUB_PCB_NAME]* instead of just *VARIANT*. + - ``variant`` :index:`: ` [:ref:`string `] (default: ``''``) Variants to match (regex). + - ``variant_field`` :index:`: ` [:ref:`string `] (default: ``'variant'``) Name of the field that stores board variant/s for component. + Only supported internally, don't use it if you plan to use KiCost. + +.. toctree:: + :caption: Used dicts + + SubPCBOptions diff --git a/docs/source/credits.rst b/docs/source/credits.rst index 75fc66f52..0380750ac 100644 --- a/docs/source/credits.rst +++ b/docs/source/credits.rst @@ -44,6 +44,7 @@ Credits - **KiCad Gerber Zipper**: @g200kg - **pimpmykicadbom**: Anton Savov (@antto) - **electro-grammar**: Kaspar Emanuel (@kasbah) + - **kicad-testpoints**: Simon Hobbs (@snhobbs) - **Others**: diff --git a/docs/source/dependencies.rst b/docs/source/dependencies.rst index c7d788327..700471cbe 100644 --- a/docs/source/dependencies.rst +++ b/docs/source/dependencies.rst @@ -12,9 +12,9 @@ - Mandatory -`KiCad Automation tools `__ :index:`: ` v2.3.1 |image10| |PyPi dependency| |Auto-download| +`KiCad Automation tools `__ :index:`: ` v2.3.2 |image10| |PyPi dependency| |Auto-download| -- Mandatory for: `dxf_sch_print`, `gencad`, `hpgl_sch_print`, `netlist`, `pdf_pcb_print`, `pdf_sch_print`, `ps_sch_print`, `render_3d`, `run_drc`, `run_erc`, `step`, `svg_pcb_print`, `svg_sch_print`, `update_xml`, `vrml` +- Mandatory for: `convert_pcb`, `dxf_sch_print`, `gencad`, `hpgl_sch_print`, `netlist`, `pdf_pcb_print`, `pdf_sch_print`, `ps_sch_print`, `render_3d`, `run_drc`, `run_erc`, `step`, `svg_pcb_print`, `svg_sch_print`, `update_xml`, `vrml` - Optional to: - Compare schematics for `diff` (v2.2.0) @@ -63,7 +63,7 @@ - Mandatory for `ibom` -`KiBoM `__ :index:`: ` v1.8.0 |image25| |Auto-download| +`KiBoM `__ :index:`: ` v1.9.1 |image25| |Auto-download| - Mandatory for `kibom` diff --git a/docs/source/errors.rst b/docs/source/errors.rst index 7d677b945..902aab7de 100644 --- a/docs/source/errors.rst +++ b/docs/source/errors.rst @@ -40,3 +40,4 @@ Supported error levels - 34: CORRUPTED_PRO - 35: BLENDER_ERROR - 36: WARN_AS_ERROR +- 37: CHECK_FIELD diff --git a/docs/source/index.rst b/docs/source/index.rst index 4c025f968..7d783d6ca 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -14,12 +14,13 @@ KiBot (formerly KiPlot) - If you are looking for the GitHub Actions documentation, and you already know how to use KiBot, or want a quick start, read: :ref:`usage-of-github-actions` -**New on v1.7.0** +**New on v1.8.0** -- New preflights: erc, drc, update_footprint, draw_stackup, update_pcb_characteristics and update_stackup -- New global variables: str_yes/str_no -- New internal template: ExportProject -- Now the *var_rename* and *var_rename_kicost* filters can be used to change footprints using variants. +- New preflight: check_fields +- New filters: separate_pins and _null +- New global variables: use_pcb_fields and field_current +- New internal templates: Testpoints_by_attr, Testpoints_by_attr_CSV, Testpoints_by_attr_HTML, Testpoints_by_value, Testpoints_by_value_CSV and Testpoints_by_value_HTML +- Testpoints report - Better KiCad 8 support .. toctree:: diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst index d42a4f83c..acdb195f6 100644 --- a/docs/source/introduction.rst +++ b/docs/source/introduction.rst @@ -13,6 +13,9 @@ For example, itā€™s common that you might want for each board rev to create/do: - Check ERC/DRC one last time (using `KiCad Automation Scripts `__) +- Generate and/or update QR codes embedded in the PCB/SCH, the drawing + of the stack-up, etc. +- Create assembly variants of the product - Gerbers, drills and drill maps for a fab in their favourite format - Fab docs for the assembler, including the BoM (Bill of Materials), costs spreadsheet and board view diff --git a/docs/source/notes_position.rst b/docs/source/notes_position.rst index ef704153a..0375960db 100644 --- a/docs/source/notes_position.rst +++ b/docs/source/notes_position.rst @@ -476,6 +476,7 @@ The following fields contains the needed information: Additionally we support: - ``Footprint Type`` (SMD, THT, VIRTUAL) +- ``Footprint Type NV`` (SMD, THT) - ``Footprint X-Size`` - ``Footprint Y-Size`` - ``Footprint Populate`` diff --git a/docs/source/usage.txt b/docs/source/usage.txt index efc4a6ea2..b6e5b31bc 100644 --- a/docs/source/usage.txt +++ b/docs/source/usage.txt @@ -9,11 +9,11 @@ Usage: [-E DEF] ... [--defs-from-env] [--config-outs] [--only-pre|--only-groups] [--only-names] [--output-name-first] --list kibot [-v...] [-c PLOT_CONFIG] [--banner N] [-E DEF] ... [--only-names] - --list-variants + [--sub-pcbs] --list-variants kibot [-v...] [-b BOARD] [-d OUT_DIR] [-p | -P] [--banner N] --example kibot [-v...] [--start PATH] [-d OUT_DIR] [--dry] [--banner N] [-t, --type TYPE]... --quick-start - kibot [-v...] [--rst] --help-filters + kibot [-v...] [--rst] [-d OUT_DIR] --help-filters kibot [-v...] [--markdown|--json|--rst] --help-dependencies kibot [-v...] [--rst] --help-global-options kibot [-v...] --help-list-offsets @@ -21,8 +21,8 @@ Usage: kibot [-v...] --help-list-rotations kibot [-v...] --help-output=HELP_OUTPUT kibot [-v...] [--rst] [-d OUT_DIR] --help-outputs - kibot [-v...] [--rst] --help-preflights - kibot [-v...] [--rst] --help-variants + kibot [-v...] [--rst] [-d OUT_DIR] --help-preflights + kibot [-v...] [--rst] [-d OUT_DIR] --help-variants kibot [-v...] --help-banners kibot [-v...] [--rst] --help-errors kibot -h | --help @@ -65,6 +65,7 @@ Options: -P, --copy-and-expand As -p but expand the list of layers -q, --quiet Remove information logs -s PRE, --skip-pre PRE Skip preflights, comma separated or `all` + --sub-pcbs When listing variants also include sub-PCBs -v, --verbose Show debugging information -V, --version Show program's version number and exit -w, --no-warn LIST Exclude the mentioned warnings (comma sep) diff --git a/docs/source/usage_with_ci_cd.rst b/docs/source/usage_with_ci_cd.rst index 5197e8d49..6b318f6bb 100644 --- a/docs/source/usage_with_ci_cd.rst +++ b/docs/source/usage_with_ci_cd.rst @@ -84,6 +84,10 @@ ghcr.io/inti-cmnb/kicad5_auto_full:dev git code 5.1.9 ghcr.io/inti-cmnb/kicad6_auto_full:dev git code 6.0.11 ghcr.io/inti-cmnb/kicad7_auto_full:dev git code 7.0.11 ghcr.io/inti-cmnb/kicad8_auto_full:dev git code 8.x +ghcr.io/inti-cmnb/kicad5_auto_full:1.7.0 1.7.0 5.1.9 +ghcr.io/inti-cmnb/kicad6_auto_full:1.7.0 1.7.0 6.0.11 +ghcr.io/inti-cmnb/kicad7_auto_full:1.7.0 1.7.0 7.0.11 +ghcr.io/inti-cmnb/kicad8_auto_full:1.7.0 1.7.0 8.0.4 ghcr.io/inti-cmnb/kicad5_auto_full:1.6.5 1.6.5 5.1.9 ghcr.io/inti-cmnb/kicad6_auto_full:1.6.5 1.6.5 6.0.11 ghcr.io/inti-cmnb/kicad7_auto_full:1.6.5 1.6.5 7.0.11 @@ -257,6 +261,10 @@ v2_1_6_5 2 1.6.5 5.1.9 v2_k6_1_6_5 2 1.6.5 6.0.11 v2_k7_1_6_5 2 1.6.5 7.0.11 v2_k8_1_6_5 2 1.6.5 8.0.1 +v2_1_7_0 2 1.7.0 5.1.9 +v2_k6_1_7_0 2 1.7.0 6.0.11 +v2_k7_1_7_0 2 1.7.0 7.0.11 +v2_k8_1_7_0 2 1.7.0 8.0.4 v2 2 last release 5.1.9 v2_k6 2 last release 6.0.11 v2_k7 2 last release 7.0.11 diff --git a/kibot/__init__.py b/kibot/__init__.py index 4386c9bb1..36e215c60 100644 --- a/kibot/__init__.py +++ b/kibot/__init__.py @@ -5,5 +5,5 @@ __email__ = 'stropea@inti.gob.ar' __url__ = 'https://github.com/INTI-CMNB/KiBot/' __status__ = 'stable' -__version__ = '1.7.0' +__version__ = '1.8.0' __pypi_deps__ = ['kiauto', 'pyyaml', 'xlsxwriter', 'colorama', 'requests', 'qrcodegen', 'markdown2', 'lark'] diff --git a/kibot/__main__.py b/kibot/__main__.py index eda492439..21720f593 100644 --- a/kibot/__main__.py +++ b/kibot/__main__.py @@ -16,11 +16,11 @@ [-E DEF] ... [--defs-from-env] [--config-outs] [--only-pre|--only-groups] [--only-names] [--output-name-first] --list kibot [-v...] [-c PLOT_CONFIG] [--banner N] [-E DEF] ... [--only-names] - --list-variants + [--sub-pcbs] --list-variants kibot [-v...] [-b BOARD] [-d OUT_DIR] [-p | -P] [--banner N] --example kibot [-v...] [--start PATH] [-d OUT_DIR] [--dry] [--banner N] [-t, --type TYPE]... --quick-start - kibot [-v...] [--rst] --help-filters + kibot [-v...] [--rst] [-d OUT_DIR] --help-filters kibot [-v...] [--markdown|--json|--rst] --help-dependencies kibot [-v...] [--rst] --help-global-options kibot [-v...] --help-list-offsets @@ -28,8 +28,8 @@ kibot [-v...] --help-list-rotations kibot [-v...] --help-output=HELP_OUTPUT kibot [-v...] [--rst] [-d OUT_DIR] --help-outputs - kibot [-v...] [--rst] --help-preflights - kibot [-v...] [--rst] --help-variants + kibot [-v...] [--rst] [-d OUT_DIR] --help-preflights + kibot [-v...] [--rst] [-d OUT_DIR] --help-variants kibot [-v...] --help-banners kibot [-v...] [--rst] --help-errors kibot -h | --help @@ -72,6 +72,7 @@ -P, --copy-and-expand As -p but expand the list of layers -q, --quiet Remove information logs -s PRE, --skip-pre PRE Skip preflights, comma separated or `all` + --sub-pcbs When listing variants also include sub-PCBs -v, --verbose Show debugging information -V, --version Show program's version number and exit -w, --no-warn LIST Exclude the mentioned warnings (comma sep) @@ -104,7 +105,6 @@ """ from datetime import datetime from glob import glob -import gzip import locale import os import platform @@ -133,14 +133,14 @@ from .banner import get_banner, BANNERS from .gs import GS from . import dep_downloader -from .misc import EXIT_BAD_ARGS, W_VARCFG, NO_PCBNEW_MODULE, W_NOKIVER, hide_stderr, TRY_INSTALL_CHECK, W_ONWIN +from .misc import (EXIT_BAD_ARGS, W_VARCFG, NO_PCBNEW_MODULE, W_NOKIVER, hide_stderr, TRY_INSTALL_CHECK, W_ONWIN, + FAILED_EXECUTE, W_ONMAC) from .pre_base import BasePreFlight -from .error import KiPlotConfigurationError, config_error -from .config_reader import (CfgYamlReader, print_outputs_help, print_output_help, print_preflights_help, create_example, - print_filters_help, print_global_options_help, print_dependencies, print_variants_help, - print_errors, print_list_rotations, print_list_offsets) +from .config_reader import (print_outputs_help, print_output_help, print_preflights_help, create_example, print_filters_help, + print_global_options_help, print_dependencies, print_variants_help, print_errors, + print_list_rotations, print_list_offsets) from .kiplot import (generate_outputs, load_actions, config_output, generate_makefile, generate_examples, solve_schematic, - solve_board_file, solve_project_file, check_board_file) + solve_board_file, solve_project_file, check_board_file, exec_with_retry, load_config) from .registrable import RegOutput GS.kibot_version = __version__ @@ -168,6 +168,7 @@ def list_pre_and_outs(logger, outputs, do_config, only_names, only_pre, only_gro pf = BasePreFlight.get_in_use_objs() groups = RegOutput.get_groups() if pf and not only_groups: + BasePreFlight.configure_all() logger.info('Available pre-flights:') for c in pf: logger.info('- '+str(c)) @@ -203,7 +204,7 @@ def list_pre_and_outs(logger, outputs, do_config, only_names, only_pre, only_gro logger.info("") -def list_variants(logger, only_names): +def list_variants(logger, only_names, sub_pcbs): variants = RegOutput.get_variants() if not variants: if not only_names: @@ -211,11 +212,20 @@ def list_variants(logger, only_names): return if only_names: for name in sorted(variants.keys()): - logger.info(name) + v = variants[name] + if sub_pcbs and v.sub_pcbs: + for s in v.sub_pcbs: + logger.info(f'{name}[{s.name}]') + else: + logger.info(name) return logger.info("Available variants: 'comment/description' (name) [type]") for name in sorted(variants.keys()): logger.info('- '+str(variants[name])) + v = variants[name] + if sub_pcbs and v.sub_pcbs: + for s in v.sub_pcbs: + logger.info(f' - {s.name}') def solve_config(a_plot_config, quiet=False): @@ -329,14 +339,17 @@ def detect_kicad(): GS.kicad_plugins_dirs.append(os.path.join(GS.kicad_conf_path, 'scripting')) GS.kicad_plugins_dirs.append(os.path.join(GS.kicad_conf_path, 'scripting', 'plugins')) # ~/.kicad_plugins and ~/.kicad - if 'HOME' in os.environ: - home = os.environ['HOME'] + home = os.path.expanduser('~') + if home: GS.kicad_plugins_dirs.append(os.path.join(home, '.kicad_plugins')) GS.kicad_plugins_dirs.append(os.path.join(home, '.kicad', 'scripting')) GS.kicad_plugins_dirs.append(os.path.join(home, '.kicad', 'scripting', 'plugins')) if GS.kicad_version_major >= 6: ver_dir = str(GS.kicad_version_major)+'.'+str(GS.kicad_version_minor) - local_share = os.path.join(home, '.local', 'share', 'kicad', ver_dir) + if GS.on_macos or GS.on_windows: + local_share = os.path.join(home, 'Documents', 'KiCad', ver_dir) + else: + local_share = os.path.join(home, '.local', 'share', 'kicad', ver_dir) GS.kicad_plugins_dirs.append(os.path.join(local_share, 'scripting')) GS.kicad_plugins_dirs.append(os.path.join(local_share, 'scripting', 'plugins')) GS.kicad_plugins_dirs.append(os.path.join(local_share, '3rdparty', 'plugins')) # KiCad 6.0 PCM @@ -365,7 +378,8 @@ def parse_global_redef(args): class SimpleFilter(object): def __init__(self, num, regex=''): self.number = num - self.regex = re.compile(regex) + self._regex = re.compile(regex) + self.regex = regex self.error = '' @@ -402,6 +416,31 @@ def detect_windows(): # pragma: no cover (Windows) logger.warning(W_ONWIN+'Running on Windows, this is experimental, please report any problem') +def detect_macos(): # pragma: no cover (Darwin) + if platform.system() != 'Darwin': + return + # Note: We assume this is the Python from KiCad, but we should check it ... + GS.on_macos = True + logger.warning(W_ONMAC+'Running on macOS, this is experimental, please report any problem') + + +def check_needs_convert(): + """ Try to convert Altium PCBs to KiCad. + If successful just use the converted file. """ + if GS.pcb_file is None: + return False + ext = os.path.splitext(GS.pcb_fname)[1] + if ext.lower() != '.pcbdoc': + return False + command = GS.check_tool_dep('convert_pcb', 'KiAuto') + new_name = GS.pcb_basename+'.kicad_pcb' + cmd = [command, 'convert', '-o', new_name, GS.pcb_file, GS.pcb_dir] + cmd, _ = GS.add_extra_options(cmd) + exec_with_retry(cmd, FAILED_EXECUTE) + GS.set_pcb(os.path.join(GS.pcb_dir, new_name)) + return True + + def main(): set_locale() ver = 'KiBot '+__version__+' - '+__copyright__+' - License: '+__license__ @@ -424,8 +463,9 @@ def main(): apply_warning_filter(args) log.stop_on_warnings = args.stop_on_warnings # Now we have the debug level set we can check (and optionally inform) KiCad info - detect_kicad() detect_windows() + detect_macos() + detect_kicad() debug_arguments(args) # Force iBoM to avoid the use of graphical stuff @@ -508,28 +548,13 @@ def main(): GS.set_pcb(solve_board_file('.', args.board_file)) # Determine the project file GS.set_pro(solve_project_file()) + check_needs_convert() # Parse preprocessor defines parse_defines(args) # Read the config file - cr = CfgYamlReader() - outputs = None - try: - # The Python way ... - with gzip.open(plot_config, mode='rt') as cf_file: - try: - outputs = cr.read(cf_file) - except KiPlotConfigurationError as e: - config_error(str(e)) - except OSError: - pass - if outputs is None: - with open(plot_config) as cf_file: - try: - outputs = cr.read(cf_file) - except KiPlotConfigurationError as e: - config_error(str(e)) + outputs = load_config(plot_config) # Is just "list the available targets"? if args.list: @@ -538,7 +563,7 @@ def main(): sys.exit(0) if args.list_variants: - list_variants(logger, args.only_names) + list_variants(logger, args.only_names, args.sub_pcbs) sys.exit(0) if args.makefile: @@ -546,7 +571,7 @@ def main(): generate_makefile(args.makefile, plot_config, outputs) else: # Do all the job (preflight + outputs) - generate_outputs(outputs, args.target, args.invert_sel, args.skip_pre, args.cli_order, args.no_priority, + generate_outputs(args.target, args.invert_sel, args.skip_pre, args.cli_order, args.no_priority, dont_stop=args.dont_stop) # Print total warnings logger.log_totals() diff --git a/kibot/bom/bom.py b/kibot/bom/bom.py index f8bbd0a63..ccc29dc5d 100644 --- a/kibot/bom/bom.py +++ b/kibot/bom/bom.py @@ -92,7 +92,7 @@ def compare_components(c1, c2, cfg): for i, field in enumerate(cfg.group_fields): # Check if we have a fallback field_alt = cfg.group_fields_fallbacks[i] - if field_alt is not None: + if field_alt: # Check if we have an empty field c1_value = c1.get_field_value(field) c2_value = c2.get_field_value(field) @@ -295,7 +295,7 @@ def update_field(self, field, value, ref=None): else: # Config contains variant information, which is different for each component # Part can be one of the defined aliases - if field not in self.cfg.no_conflict: + if field not in self.cfg._no_conflict: logger.warning(W_FIELDCONF + "Field conflict: ({refs}) [{name}] : '{flds}' <- '{fld}' (in {ref})".format( refs=self.get_refs(), name=field, @@ -350,6 +350,13 @@ def update_fields(self, conv, bottom_negative_x, x_origin, y_origin, angle_posit if comp.virtual: type = 2 self.fields[ColumnList.COL_FP_TYPE_L] = footprint_type_values[type] + if comp.smd: + type = footprint_type_values[0] + elif comp.tht: + type = footprint_type_values[1] + else: + type = '' + self.fields[ColumnList.COL_FP_TYPE_NV_L] = type self.fields[ColumnList.COL_FP_FIT_L] = footprint_populate_values[comp.fitted] self.fields[ColumnList.COL_FP_XS_L] = "{:.4f}".format(comp.footprint_w * conv) self.fields[ColumnList.COL_FP_YS_L] = "{:.4f}".format(comp.footprint_h * conv) @@ -357,6 +364,8 @@ def update_fields(self, conv, bottom_negative_x, x_origin, y_origin, angle_posit self.fields[ColumnList.COL_SHEETPATH_L] = comp.sheet_path_h if not self.fields[ColumnList.COL_DESCRIPTION_L]: self.fields[ColumnList.COL_DESCRIPTION_L] = comp.desc + self.fields[ColumnList.COL_NET_NAME_L] = comp.net_name + self.fields[ColumnList.COL_NET_CLASS_L] = comp.net_class def get_row(self, columns): """ Return a dict of the KiCad data based on the supplied columns """ @@ -364,7 +373,7 @@ def get_row(self, columns): for key in columns: val = self.get_field(key) # Join fields (appending to current value) - for join_l in self.cfg.join: + for join_l in self.cfg._join: # Each list is "target, source..." so we need at least 2 elements elements = len(join_l) target = join_l[0] @@ -454,7 +463,7 @@ def group_components(cfg, components): if decimal_point == '.': decimal_point = None # Determine if we need information from the PCB - uses_fp_info = len(set(ColumnList.COLUMNS_FP_L).intersection({c.lower() for c in cfg.columns})) != 0 + uses_fp_info = len(set(ColumnList.COLUMNS_FP_L).intersection({c.lower() for c in cfg._columns})) != 0 # Coordinates origin for XYRS x_origin = 0.0 y_origin = 0.0 @@ -542,5 +551,5 @@ def do_bom(file_name, ext, comps, cfg): prj.total_str = smd_tht(cfg, prj.comp_total, prj.comp_total_smd, prj.comp_total_tht) prj.fitted_str = smd_tht(cfg, prj.comp_fitted, prj.comp_fitted_smd, prj.comp_fitted_tht) # Create the BoM - write_bom(file_name, ext, groups, cfg.columns, cfg) + write_bom(file_name, ext, groups, cfg._columns, cfg) cfg.number = number diff --git a/kibot/bom/bom_writer.py b/kibot/bom/bom_writer.py index 4f393c270..21d0a289f 100644 --- a/kibot/bom/bom_writer.py +++ b/kibot/bom/bom_writer.py @@ -32,7 +32,7 @@ def write_bom(filename, ext, groups, headings, cfg): cfg = configuration data """ # Allow renaming the columns - head_names = [h if h.lower() not in cfg.column_rename else cfg.column_rename[h.lower()] for h in headings] + head_names = [h if h.lower() not in cfg._column_rename else cfg._column_rename[h.lower()] for h in headings] headings = [h.lower() for h in headings] result = False # CSV file writing diff --git a/kibot/bom/columnlist.py b/kibot/bom/columnlist.py index 4e7394c0e..5da38fdbb 100644 --- a/kibot/bom/columnlist.py +++ b/kibot/bom/columnlist.py @@ -41,6 +41,8 @@ class ColumnList: COL_FP_SIDE_L = COL_FP_SIDE.lower() COL_FP_TYPE = 'Footprint Type' COL_FP_TYPE_L = COL_FP_TYPE.lower() + COL_FP_TYPE_NV = 'Footprint Type NV' + COL_FP_TYPE_NV_L = COL_FP_TYPE_NV.lower() COL_FP_FIT = 'Footprint Populate' COL_FP_FIT_L = COL_FP_FIT.lower() COL_FP_XS = 'Footprint X-Size' @@ -59,6 +61,10 @@ class ColumnList: COL_ROW_NUMBER_L = COL_ROW_NUMBER.lower() COL_STATUS = 'Status' COL_STATUS_L = COL_STATUS.lower() + COL_NET_NAME = 'Net Name' + COL_NET_NAME_L = COL_NET_NAME.lower() + COL_NET_CLASS = 'Net Class' + COL_NET_CLASS_L = COL_NET_CLASS.lower() # Default columns for groups COL_GRP_QUANTITY = 'Quantity Per PCB' @@ -114,9 +120,12 @@ class ColumnList: COL_FP_ROT, COL_FP_SIDE, COL_FP_TYPE, + COL_FP_TYPE_NV, COL_FP_FIT, COL_FP_XS, COL_FP_YS, + COL_NET_NAME, + COL_NET_CLASS, ] # Default columns diff --git a/kibot/bom/csv_writer.py b/kibot/bom/csv_writer.py index 7d3b03523..989afada4 100644 --- a/kibot/bom/csv_writer.py +++ b/kibot/bom/csv_writer.py @@ -67,7 +67,7 @@ def write_stats(writer, cfg, ops, write_sep): writer.writerow(["Project info:"]) write_sep() writer.writerow(["Schematic:", prj.name]) - writer.writerow(["Variant:", cfg.variant.name]) + writer.writerow(["Variant:", cfg.variant.name if cfg.variant else 'default']) writer.writerow(["Revision:", prj.sch.revision]) writer.writerow(["Date:", prj.sch.date]) writer.writerow(["KiCad Version:", cfg.kicad_version]) @@ -87,7 +87,7 @@ def write_stats(writer, cfg, ops, write_sep): prj = cfg.aggregate[0] writer.writerow(["Project info:"]) write_sep() - writer.writerow(["Variant:", cfg.variant.name]) + writer.writerow(["Variant:", cfg.variant.name if cfg.variant else 'default']) writer.writerow(["KiCad Version:", cfg.kicad_version]) write_sep() if not ops.hide_stats_info: diff --git a/kibot/bom/html_writer.py b/kibot/bom/html_writer.py index ea0ab2f0e..81ce71890 100644 --- a/kibot/bom/html_writer.py +++ b/kibot/bom/html_writer.py @@ -239,7 +239,7 @@ def write_stats(html, cfg): if not cfg.html.hide_pcb_info: prj = cfg.aggregate[0] html.write(" Schematic: {}
\n".format(prj.name)) - html.write(" Variant: {}
\n".format(cfg.variant.name)) + html.write(" Variant: {}
\n".format(cfg.variant.name if cfg.variant else 'default')) html.write(" Revision: {}
\n".format(prj.sch.revision)) html.write(" Date: {}
\n".format(prj.sch.date)) html.write(" KiCad Version: {}
\n".format(cfg.kicad_version)) @@ -259,7 +259,7 @@ def write_stats(html, cfg): html.write('\n') html.write(' \n') if not cfg.html.hide_pcb_info: - html.write(" Variant: {}
\n".format(cfg.variant.name)) + html.write(" Variant: {}
\n".format(cfg.variant.name if cfg.variant else 'default')) html.write(" KiCad Version: {}
\n".format(cfg.kicad_version)) html.write(' \n') html.write(' \n') diff --git a/kibot/bom/units.py b/kibot/bom/units.py index 1314098c4..6484b3d74 100644 --- a/kibot/bom/units.py +++ b/kibot/bom/units.py @@ -135,6 +135,8 @@ def get_prefix_simple(prefix): def get_prefix(val, prefix): + if val == 0: + return 0, 0 pow = get_prefix_simple(prefix) # Try to normalize it while val >= 1000.0 and pow < MAX_POW_PREFIX: diff --git a/kibot/bom/xlsx_writer.py b/kibot/bom/xlsx_writer.py index 4db5e524f..0f8365933 100644 --- a/kibot/bom/xlsx_writer.py +++ b/kibot/bom/xlsx_writer.py @@ -372,13 +372,14 @@ def adjust_heights(worksheet, rows, max_width, head_size): def write_info(cfg, r_info_start, worksheet, column_widths, col1, fmt_info, fmt_subtitle, compact=False): + vname = cfg.variant.name if cfg.variant else 'default' if len(cfg.aggregate) == 1: # Only one project rc = r_info_start if not cfg.xlsx.hide_pcb_info: prj = cfg.aggregate[0] rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Schematic:", prj.name) - rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Variant:", cfg.variant.name) + rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Variant:", vname) rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Revision:", prj.sch.revision) rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Date:", prj.sch.date) rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "KiCad Version:", cfg.kicad_version) @@ -396,7 +397,7 @@ def write_info(cfg, r_info_start, worksheet, column_widths, col1, fmt_info, fmt_ old_col1 = col1 rc = r_info_start if not cfg.xlsx.hide_pcb_info: - rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Variant:", cfg.variant.name) + rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "Variant:", vname) rc = add_info(worksheet, column_widths, rc, col1, fmt_info, "KiCad Version:", cfg.kicad_version) col1 += 2 rc = r_info_start @@ -440,15 +441,15 @@ def adapt_extra_cost_columns(cfg): user_fields = [] for i, col in enumerate(cfg.columns_ce): data = {'field': col} - comment = cfg.column_comments_ce[i] + comment = cfg._column_comments_ce[i] if comment: data['comment'] = comment - level = cfg.column_levels_ce[i] + level = cfg._column_levels_ce[i] if level: data['level'] = level col = col.lower() - if col in cfg.column_rename_ce: - data['label'] = cfg.column_rename_ce[col] + if col in cfg._column_rename_ce: + data['label'] = cfg._column_rename_ce[col] user_fields.append(data) Spreadsheet.USER_FIELDS = user_fields @@ -556,8 +557,8 @@ def adapt_column_names(cfg): new_id = KICOST_COLUMNS[id] v['label'] = new_id id = new_id.lower() - if id in cfg.column_rename: - v['label'] = cfg.column_rename[id] + if id in cfg._column_rename: + v['label'] = cfg._column_rename[id] def dis_enable_apis(api_options, cfg): @@ -677,7 +678,7 @@ def _create_kicost_sheet(workbook, groups, image_data, fmt_title, fmt_info, fmt_ part.kibot_group = g parts.append(part) # Process any "join" request - apply_join_requests(cfg.join_ce, part.fields, g.fields) + apply_join_requests(cfg._join_ce, part.fields, g.fields) # Fill the quantity members of the parts solve_parts_qtys(parts, multi_prj, prj_info) # Distributors @@ -805,8 +806,8 @@ def write_xlsx(filename, groups, col_fields, head_names, cfg): # Title for this column column_widths[i] = len(row_headings[i]) + 10 worksheet.write_string(row_count, i, row_headings[i], fmt_head) - if cfg.column_comments[i]: - worksheet.write_comment(row_count, i, cfg.column_comments[i]) + if cfg._column_comments[i]: + worksheet.write_comment(row_count, i, cfg._column_comments[i]) # Body row_count += 1 @@ -865,7 +866,7 @@ def write_xlsx(filename, groups, col_fields, head_names, cfg): write_info(cfg, r_info_start, worksheet, column_widths, col1, fmt_info, fmt_subtitle) # Adjust cols and rows - adjust_widths(worksheet, column_widths, max_width, cfg.column_levels) + adjust_widths(worksheet, column_widths, max_width, cfg._column_levels) adjust_heights(worksheet, rows, max_width, head_size) worksheet.freeze_panes(head_size+1, 0) diff --git a/kibot/bom/xml_writer.py b/kibot/bom/xml_writer.py index eb6466e56..de3db0e4f 100644 --- a/kibot/bom/xml_writer.py +++ b/kibot/bom/xml_writer.py @@ -23,7 +23,7 @@ def write_xml(filename, groups, headings, head_names, cfg): cfg = BoMOptions object with all the configuration """ attrib = {} - attrib['PCB_Variant'] = cfg.variant.name + attrib['PCB_Variant'] = cfg.variant.name if cfg.variant else 'default' attrib['KiCad_Version'] = cfg.kicad_version attrib['Component_Groups'] = str(cfg.n_groups) attrib['Component_Count'] = str(cfg.total_str) diff --git a/kibot/config_reader.py b/kibot/config_reader.py index 31209d14b..c3053f8c0 100644 --- a/kibot/config_reader.py +++ b/kibot/config_reader.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2023 Salvador E. Tropea -# Copyright (c) 2020-2023 Instituto Nacional de TecnologĆ­a Industrial +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial # Copyright (c) 2018 John Beard -# License: GPL-3.0 +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Adapted from: https://github.com/johnbeard/kiplot """ @@ -24,7 +24,7 @@ from .error import KiPlotConfigurationError, config_error from .misc import (NO_YAML_MODULE, EXIT_BAD_ARGS, EXAMPLE_CFG, WONT_OVERWRITE, W_NOOUTPUTS, W_UNKOUT, W_NOFILTERS, W_NOVARIANTS, W_NOGLOBALS, TRY_INSTALL_CHECK, W_NOPREFLIGHTS, W_NOGROUPS, W_NEWGROUP, error_level_to_name, - DEFAULT_ROTATIONS, DEFAULT_OFFSETS, W_EXTRADOCS) + DEFAULT_ROTATIONS, DEFAULT_OFFSETS, W_EXTRADOCS, RE_LEN) from .gs import GS from .registrable import RegOutput, RegVariant, RegFilter, RegDependency from .pre_base import BasePreFlight @@ -273,7 +273,7 @@ def _parse_preflights(self, pf): raise KiPlotConfigurationError("Unknown preflight: `{}`".format(k)) try: logger.debug("Parsing preflight "+k) - o_pre = BasePreFlight.get_class_for(k)(k, v) + o_pre = BasePreFlight.get_object_for(k, v) except KiPlotConfigurationError as e: raise KiPlotConfigurationError("In preflight '"+k+"': "+str(e)) preflights.append(o_pre) @@ -292,8 +292,7 @@ def _parse_global(self, gb): update_dict(gb, self.imported_globals) logger.debug("Global options + imported: {}".format(gb)) # Parse all keys inside it - glb = GS.class_for_global_opts() - glb.set_tree(gb) + glb = GS.set_global_options_tree(gb) try: glb.config(None) except KiPlotConfigurationError as e: @@ -355,9 +354,9 @@ def _parse_import_preflights(self, pre, explicit_pres, fn_rel, data, imported): i_pres += self._parse_preflights(data['preflight']) if pre is not None: for p in i_pres: - if p._name in pre: + if p.type in pre: sel_pres.append(p) - pre.remove(p._name) + pre.remove(p.type) for p in pre: logger.warning(W_UNKOUT+"can't import `{}` preflight from `{}` (missing)".format(p, fn_rel)) else: @@ -366,7 +365,7 @@ def _parse_import_preflights(self, pre, explicit_pres, fn_rel, data, imported): if explicit_pres: logger.warning(W_NOPREFLIGHTS+"No preflights found in `{}`".format(fn_rel)) else: - logger.debug('Preflights loaded from `{}`: {}'.format(fn_rel, [c._name for c in sel_pres])) + logger.debug('Preflights loaded from `{}`: {}'.format(fn_rel, [c.type for c in sel_pres])) if pre is None and explicit_pres and 'preflight' not in data: logger.warning(W_NOPREFLIGHTS+"No preflights found in `{}`".format(fn_rel)) return sel_pres @@ -691,6 +690,8 @@ def read(self, fstream): """ collected_definitions = [{}] data = self.load_yaml(fstream, collected_definitions) + if not isinstance(data, dict): + raise KiPlotConfigurationError(f"Wrong configuration, must be a dict, not {type(data)}") # Analyze the version # Currently just checks for v1 v1 = data.get('kiplot', None) @@ -753,7 +754,8 @@ def read(self, fstream): outs = RegOutput.get_outputs() for o in outs: for g in o._groups: - if not RegOutput.add_to_group(o.name, g): + existing, _ = RegOutput.add_out_to_group(o, g) + if not existing: grps = list(RegOutput.get_group_names()) grps.remove(g) best_matches = difflib.get_close_matches(g, grps) @@ -792,9 +794,62 @@ def trim(docstring): return trimmed -def print_output_options(name, cl, indent, context=None, skip_keys=False): +def process_help_data_type(obj, help, v): + valid, validations, def_val, real_help = obj.get_valid_types(help) + if rst_mode: + new_data_type = '['+' | '.join((f':ref:`{v} <{v}>`' for v in valid))+']' + else: + new_data_type = '['+' | '.join(valid)+']' + if def_val: + if def_val == '?': + new_data_type += ' (default: computed for your project)' + elif def_val == '{}': + new_data_type += ' (default: empty dict, default values used)' + elif def_val == '[{}]': + new_data_type += ' (default: list with one empty dict, default values used)' + else: + new_data_type += f' (default: ``{def_val}``)' + elif isinstance(v, type): + def_val = v.get_default() + if def_val: + new_data_type += f' (default: ``{def_val}``)' + real_help = real_help.replace('{comma_sep}', '[:ref:`comma separated `]') + real_help = real_help.replace('{no_case} ', '[:ref:`case insensitive `]') + real_help = re.sub(RE_LEN, r'(must contain \1 elements)', real_help, count=1) + string_added = False + number_added = False + for tp, validation in zip(valid, validations): + if validation is None: + continue + if not string_added and 'string' in tp: + string_added = True + any_str = False + if validation[-1] == '*': + validation = validation[:-1] + any_str = True + new_data_type += ' (choices: "'+'", "'.join(validation)+'")' + if any_str: + new_data_type += ' (also accepts any string)' + elif not number_added and 'number' in tp: + number_added = True + if validation[0] == 'C': + new_data_type += ' (choices: '+', '.join(validation[1])+')' + else: + new_data_type += f' (range: {validation[0]} to {validation[1]})' + help = new_data_type+real_help + return help, 'dict' in valid or 'list(dict)' in valid + + +def print_output_options(name, cl, indent, context=None, skip_keys=False, skip_options=None, force_is_basic=False, + separate_files=False, id=''): ind_str = indent*' ' - obj = cl() + sub_pages = set() + try: + obj = cl() + except TypeError as e: + if re.search(r'missing 2 required(.*)name(.*)value', str(e)): + config_error(f"Wong constructor for `{name}`, please migrate any plug-in ({e})") + raise num_opts = 0 if not skip_keys else 1 ind_size = 3 if rst_mode else 2 ind_base_sp = '- ' @@ -802,11 +857,13 @@ def print_output_options(name, cl, indent, context=None, skip_keys=False): ind_base_sp = ' '*ind_size+ind_base_sp if rst_mode: ind_base_sp += ' ' - for k, v in sorted(obj.get_attrs_gen(), key=lambda x: not obj.is_basic_option(x[0])): + for k, v in sorted(obj.get_attrs_gen(), key=lambda x: (not obj.is_basic_option(x[0]), x[0])): if k == 'type': if indent == ind_size: # Type is fixed for an output continue + if skip_options and k in skip_options: + continue if not num_opts: # We found one, put the title if rst_mode: @@ -820,7 +877,7 @@ def print_output_options(name, cl, indent, context=None, skip_keys=False): if k == 'type' and not indent: help = f"*'{name}'" dot = False - is_basic = False + is_basic = force_is_basic if help and help[0] == '*': help = help[1:] is_basic = True @@ -832,16 +889,21 @@ def print_output_options(name, cl, indent, context=None, skip_keys=False): else: entry = '``{}``: ' if rst_mode else '`{}`: ' entry = ind_base_sp+entry - if help is None: - help = 'Undocumented' - logger.non_critical_error(f'Undocumented option: `{k}`') + assert help is not None, f'Undocumented option: `{k}`' + if not is_alias and k != 'type': + assert help[0] == '[', f'Missing option data type: `{k}`: {help}' + help, has_dict = process_help_data_type(obj, help, v) + else: + has_dict = False lines = help.split('\n') preface = ind_str+entry.format(k) if rst_mode and context: # Index entry preface = preface[:-2] + f' :index:`: ` ' + if separate_files and isinstance(v, type) and has_dict: + preface += f" [:ref:`{v.__name__} parameters <{v.__name__+id}>`] " clines = len(lines) - print('{}{}{}'.format(preface, adapt_text(lines[0].strip()), '.' if clines == 1 and dot else '')) + print(preface+adapt_text(lines[0].strip()+('.' if clines == 1 and dot else ''))) if rst_mode: if skip_keys: ind_help = (indent+ind_size)*' ' @@ -872,7 +934,7 @@ def print_output_options(name, cl, indent, context=None, skip_keys=False): if in_list: in_list = False print() - print('{}{}'.format(ind_help+adapt_text(text), '.' if ln+1 == clines else '')) + print(ind_help+adapt_text(text+('.' if ln+1 == clines else ''))) num_opts = num_opts+1 if isinstance(v, type): new_context = context @@ -881,9 +943,28 @@ def print_output_options(name, cl, indent, context=None, skip_keys=False): i = indent+ind_size if not skip_keys: i += ind_size - print_output_options('', v, i, new_context) + if separate_files and has_dict: + dest = os.path.relpath(os.path.join(GS.out_dir, f'{v.__name__}.rst')) + f = open(dest, 'wt') + ori = sys.stdout + sys.stdout = f + i = 0 + title = f'{v.__name__} parameters' + sub_pages.add(v.__name__) + print(f".. _{v.__name__+id}:\n\n") + print(title) + print('~'*len(title)+'\n') + print_output_options('', v, i, new_context, separate_files=separate_files, skip_keys=separate_files) + if separate_files and has_dict: + sys.stdout = ori + f.close() if rst_mode: print() + if sub_pages: + print('.. toctree::') + print(' :caption: Used dicts\n') + for p in sorted(sub_pages): + print(' '+p) # if num_opts == 0: # print(ind_str+' - No available options') @@ -918,7 +999,7 @@ def print_one_out_help(details, n, o): f.write('\nParameters:\n\n') ori = sys.stdout sys.stdout = f - print_output_options(n, o, 0, 'output - '+n, skip_keys=True) + print_output_options(n, o, 0, 'output - '+n, skip_keys=True, separate_files=True) sys.stdout = ori elif details: print('- '+lines[0]) @@ -949,7 +1030,7 @@ def print_outputs_help(rst, details=False): print('2. Aliases are listed in *italics*.') if split: print('\n.. toctree::') - print(' :maxdepth: 2\n') + print(' :maxdepth: 1\n') for n, o in OrderedDict(sorted(outs.items())).items(): if details: if split: @@ -965,11 +1046,11 @@ def print_output_help(name): print_one_out_help(True, name, RegOutput.get_class_for(name)) -def make_title(rst, tp, n, sub='^'): +def make_title(rst, tp, n, sub='^', skip_warning=False): global rst_mode rst_mode = rst logger.debug('{} supported {}'.format(n, tp)) - if rst: + if rst and not skip_warning: print(RST_WARNING) title = 'Supported '+tp print(title) @@ -980,39 +1061,102 @@ def make_title(rst, tp, n, sub='^'): return 2, '' -def print_preflights_help(rst): - prefs = BasePreFlight.get_registered() - ind_size, extra = make_title(rst, 'preflights', len(prefs)) - for n, o in OrderedDict(sorted(prefs.items())).items(): - help, options = o.get_doc() - if help is None: - help = 'Undocumented' +def _print_preflights_help(rst, deprecated=False): + prefs = list(BasePreFlight.get_registered().keys()) + name = 'preflights' + if deprecated: + name = 'deprecated '+name + ind_size, extra = make_title(rst, name, len(prefs), skip_warning=deprecated) + split = GS.out_dir_in_cmd_line and rst_mode + ind = ' '*ind_size + if split: + print('.. toctree::') + print(' :maxdepth: 1\n') + for n in sorted(prefs): + o = BasePreFlight.get_class_for(n) + if deprecated and 'Deprecated' not in o.__doc__: + continue + elif not deprecated and 'Deprecated' in o.__doc__: + continue + lines = trim(o.__doc__) + if split: + print(f' preflights/{n}') + dest = os.path.relpath(os.path.join(GS.out_dir, f'{n}.rst')) + f = open(dest, 'wt') + ori = sys.stdout + sys.stdout = f + print(RST_WARNING) + name2 = n.replace('_', ' ').capitalize() if not len(lines) else lines[0] + print(f'.. index::\n pair: {name2}; {n}\n') + print(name2) + print('~'*len(name2)) + print() + if len(lines): + t, r = reformat_text('\n'.join(lines[1:]), 0) + print(t) + print(r) + print() else: - help, rest = reformat_text(help, ind_size) - if rest: - help += '\n'+rest - index = f':index:`: ` ' if rst else '' - print(f'- {extra}**{n}**: {index}{help}.') - if options: - print_output_options(n, options, ind_size, 'preflight - '+n) + print(f'- {lines[0]}') + print(f'{ind}- {extra}Description: '+adapt_text(lines[1])) + if rst_mode: + f, r = reformat_text('\n'.join(lines[1:]), ind_size*2) + print(r) + else: + for ln in range(2, len(lines)): + print(' '+adapt_text(lines[ln])) + print_output_options(n, o, ind_size, 'preflight - '+n, skip_options={'comment', 'name'}, skip_keys=True, + force_is_basic=True, separate_files=split) + if split: + sys.stdout = ori + f.close() + + +def print_preflights_help(rst): + _print_preflights_help(rst) + print() + _print_preflights_help(rst, deprecated=True) def print_variants_help(rst): from .var_base import BaseVariant vars = BaseVariant.get_registered() ind_size, extra = make_title(rst, 'variants', len(vars)) + split = GS.out_dir_in_cmd_line and rst_mode + if split: + print('.. toctree::') + print(' :maxdepth: 1\n') for n, o in OrderedDict(sorted(vars.items())).items(): help = o.__doc__ if help is None: - help = 'Undocumented' - title = '' + help = '' + title = 'Undocumented' else: title, help = reformat_text(help, ind_size) title = f'(**{title}**)' if rst: title = f'{title} :index:`. `' - print(f'- {extra}**{n}**: {title}\n\n{help}.') - print_output_options(n, o, ind_size, 'variant - '+n) + if split: + print(f' variants/{n}') + dest = os.path.relpath(os.path.join(GS.out_dir, f'{n}.rst')) + f = open(dest, 'wt') + ori = sys.stdout + sys.stdout = f + print(RST_WARNING) + name2 = n.replace('_', ' ').capitalize() if not help else f'**{n}** {title}' + print(f'.. index::\n pair: {name2}; {n}\n') + print(name2) + print('~'*len(name2)) + print() + if help: + print(help) + print() + else: + print(f'- {extra}**{n}**: {title}\n\n{help}.') + print_output_options(n, o, ind_size, 'variant - '+n, separate_files=split, skip_keys=True) + if split: + sys.stdout = ori + f.close() def adapt_text(text): @@ -1041,6 +1185,12 @@ def adapt_text(text): t.append('.. warning::') in_warning = True ln = ln[:indent]+ln[indent+9:] + if 'Important: ' in ln: + indent = ln.index('Important: ') + t.append('') + t.append('.. note::') + in_warning = True + ln = ln[:indent]+ln[indent+11:] t.append(ln) if in_warning: t.append('.. ') @@ -1069,19 +1219,41 @@ def reformat_text(txt, ind_size): def print_filters_help(rst): filters = RegFilter.get_registered() ind_size, extra = make_title(rst, 'filters', len(filters)) + split = GS.out_dir_in_cmd_line and rst_mode + ' '*ind_size + if split: + print('.. toctree::') + print(' :maxdepth: 1\n') for n, o in OrderedDict(sorted(filters.items())).items(): help = o.__doc__ if help is None: help = '' title = 'Undocumented' else: - title, help = reformat_text(help, ind_size) - title = f'(**{title}**)' - - print(f'- {extra}**{n}**: {title}') - if help: - print(f'{help}.') - print_output_options(n, o, ind_size, 'filter - '+n) + title, help = reformat_text(help.strip()+'.', ind_size) + if split: + print(f' filters/{n}') + dest = os.path.relpath(os.path.join(GS.out_dir, f'{n}.rst')) + f = open(dest, 'wt') + ori = sys.stdout + sys.stdout = f + print(RST_WARNING) + name2 = n.replace('_', ' ').capitalize() if not help else title + print(f'.. index::\n pair: {name2}; {n}\n') + print(name2) + print('~'*len(name2)) + print() + if help: + print(help) + print() + else: + print(f'- {extra}**{n}**: {title}') + if help: + print(help) + print_output_options(n, o, ind_size, 'filter - '+n, separate_files=split, id='_fi', skip_keys=True) + if split: + sys.stdout = ori + f.close() def print_global_options_help(rst): @@ -1105,7 +1277,7 @@ def print_example_options(f, cls, name, indent, po, is_list=False): first = True if po: obj.read_vals_from_po(po) - for k, _ in obj.get_attrs_gen(): + for k, _ in sorted(obj.get_attrs_gen(), key=lambda x: x[0]): help, alias, is_alias = obj.get_doc(k, no_basic=True) if is_alias: f.write(ind_str+'# `{}` is an alias for `{}`\n'.format(k, alias)) @@ -1115,7 +1287,7 @@ def print_example_options(f, cls, name, indent, po, is_list=False): for hl in help_lines: # Dots at the beginning are replaced by spaces. # Used to keep indentation. - hl = hl.strip() + hl = hl.strip().replace('=?]', '=computed for your project]') if hl[0] == '.': for i in range(1, len(hl)): if hl[i] != '.': @@ -1132,13 +1304,15 @@ def print_example_options(f, cls, name, indent, po, is_list=False): elif isinstance(val, bool): val = str(val).lower() if isinstance(val, type): + default = val.get_default() if val.__name__ == 'Optionable' and help and '=' in help_lines[0]: # Get the text after = txt = help_lines[0].split('=')[1] # Get the text before the space, without the ] txt = txt.split()[0][:-1] f.write(ind_str+'{}: {}\n'.format(k, txt)) - elif val.get_default(): + elif default and not (isinstance(default, dict) or + (isinstance(default, list) and isinstance(default[0], dict))): f.write(ind_str+'{}: {}\n'.format(k, val.get_default())) else: if is_list and first: @@ -1173,13 +1347,19 @@ def create_example(pcb_file, out_dir, copy_options, copy_expand): f.write("# You should take portions of this example and edit the options to make\n") f.write("# them suitable for your use.\n") f.write("# This file is useful to know all the available options.\n") + f.write("# Try using `--quick-start` for a functional example.\n") f.write('kibot:\n version: 1\n') # Preflights f.write('\npreflight:\n') prefs = BasePreFlight.get_registered() for n, o in OrderedDict(sorted(prefs.items())).items(): - if o.__doc__: - lines = trim(o.__doc__.rstrip()+'.') + lines = trim(o.__doc__+'.') + for ln in lines: + f.write(' # '+ln.rstrip()+'\n') + obj = BasePreFlight.get_object_for(n) + help, _, _ = obj.get_doc(n) + if help: + lines = trim(help.rstrip()+'.') for ln in lines: f.write(' # '+ln.rstrip()+'\n') example = o.get_example() diff --git a/kibot/fil_base.py b/kibot/fil_base.py index fa17c1544..e5e07d249 100644 --- a/kibot/fil_base.py +++ b/kibot/fil_base.py @@ -96,15 +96,15 @@ class DummyFilter(Registrable): """ A filter that allows all """ - def __init__(self): + def __init__(self, is_transform=False): super().__init__() self.name = 'Dummy' self.type = 'dummy' self.comment = 'A filter that does nothing' - self._is_transform = False + self._is_transform = is_transform def filter(self, comp): - return True + return None if self._is_transform else True class MultiFilter(Registrable): @@ -188,6 +188,8 @@ def apply_exclude_filter(comps, filter): for c in comps: if c.included: c.included = filter.filter(c) + if not c.included: + logger.debugl(3, f'- {c.ref} excluded') def reset_filters(comps): @@ -231,15 +233,15 @@ def __init__(self): self._is_transform = False with document: self.name = '' - """ Used to identify this particular filter definition """ + """ *Used to identify this particular filter definition """ self.type = '' """ Type of filter """ self.comment = '' - """ A comment for documentation purposes """ + """ *A comment for documentation purposes """ def config(self, parent): super().config(parent) - if self.name[0] == '_' and not self._internal: + if self.name and self.name.startswith('_') and not self._internal: raise KiPlotConfigurationError('Filter names starting with `_` are reserved ({})'.format(self.name)) @staticmethod @@ -303,7 +305,11 @@ def _create_kicost_dnp(name): return o_tree @staticmethod - def _create_internal_filter(name): + def _create_internal_filter(name, is_transform): + if name == '_null': + raise KiPlotConfigurationError("The `_null` filter can't be used in a filter chain") + if name == '_none': + return DummyFilter(is_transform) if name == IFILT_MECHANICAL: tree = BaseFilter._create_mechanical(name) elif name.startswith('_kibom_dn') and len(name) >= 10: @@ -342,7 +348,9 @@ def solve_filter(names, target_name, default=None, is_transform=False): elif isinstance(names, str): # User provided, but only one, make a list if names == '_none': - return DummyFilter() + return DummyFilter(is_transform) + if names == '_null': + return None names = [names] # Here we should have a list of strings filters = [] @@ -358,7 +366,7 @@ def solve_filter(names, target_name, default=None, is_transform=False): name = name[1:] # '!' => always False if not name: - filters.append(NotFilter(DummyFilter())) + filters.append(NotFilter(DummyFilter(is_transform))) continue else: invert = False @@ -366,7 +374,7 @@ def solve_filter(names, target_name, default=None, is_transform=False): if RegOutput.is_filter(name): fil = RegOutput.get_filter(name) else: # Nope, can be created? - fil = BaseFilter._create_internal_filter(name) + fil = BaseFilter._create_internal_filter(name, is_transform) if fil is None: raise KiPlotConfigurationError("Unknown filter `{}` used for `{}`".format(name, target_name)) if invert: @@ -378,7 +386,7 @@ def solve_filter(names, target_name, default=None, is_transform=False): filters.append(fil) # Finished collecting filters if not filters: - return DummyFilter() + return DummyFilter(is_transform) # If we need a `Logic` filter ensure that at least one in the list is `Logic` if not is_transform and not next(filter(lambda x: not x._is_transform, filters), False): raise KiPlotConfigurationError("At least one logic filter is needed for `{}`".format(target_name)) @@ -407,3 +415,6 @@ def config(self, parent): if not self.name: raise KiPlotConfigurationError("Missing or empty `name` in rename list ({})".format(str(self._tree))) self.field = self.field.lower() + + def __str__(self): + return f'{self.field} -> {self.name}' diff --git a/kibot/fil_field_modify.py b/kibot/fil_field_modify.py index ffb549afd..868228531 100644 --- a/kibot/fil_field_modify.py +++ b/kibot/fil_field_modify.py @@ -24,7 +24,7 @@ def __init__(self): self._is_transform = True with document: self.fields = Optionable - """ [string|list(string)='Datasheet'] Fields to convert """ + """ [string|list(string)='Datasheet'] {comma_sep} Fields to convert """ self.regex = r'(https?://\S+)' """ Regular expression to match the field content. Only fields that matches will be modified. @@ -36,14 +36,10 @@ def __init__(self): self.include = Optionable """ [string|list(string)=''] Name of the filter to select which components will be affected. Applied to all if nothing specified here """ - self._fields_example = 'Datasheet' self._include_solved = False def config(self, parent): super().config(parent) - if isinstance(self.fields, type): - self.fields = ['Datasheet'] - self.fields = Optionable.force_list(self.fields) try: self._regex = re.compile(self.regex) except Exception as e: diff --git a/kibot/fil_field_rename.py b/kibot/fil_field_rename.py index f0f4d4b4b..936aaf18e 100644 --- a/kibot/fil_field_rename.py +++ b/kibot/fil_field_rename.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2021 Salvador E. Tropea -# Copyright (c) 2021 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2021-2024 Salvador E. Tropea +# Copyright (c) 2021-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Description: Implements a field renamer from .gs import GS @@ -23,18 +23,17 @@ def __init__(self): self._is_transform = True with document: self.rename = FieldRename - """ [list(dict)] Fields to rename """ + """ [list(dict)=[]] Fields to rename """ def config(self, parent): super().config(parent) - if isinstance(self.rename, type): - self.rename = [] - if not self.rename: - logger.warning(W_EMPTYREN+'Nothing to rename in filter `{}`'.format(self.name)) self.rename = {f.field: f.name for f in self.rename} def filter(self, comp): """ Change the names of the specified fields """ + if not self.rename: + logger.warning(W_EMPTYREN+'Nothing to rename in filter `{}`'.format(self.name)) + return for f in set(comp.get_field_names()).intersection(self.rename): new_name = self.rename[f] if GS.debug_level > 2: diff --git a/kibot/fil_generic.py b/kibot/fil_generic.py index b765b70d4..c63c6f16c 100644 --- a/kibot/fil_generic.py +++ b/kibot/fil_generic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2023 Salvador E. Tropea -# Copyright (c) 2020-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Description: Implements the KiBoM and IBoM filters. from re import compile, IGNORECASE @@ -16,13 +16,6 @@ logger = log.get_logger() -class DNFList(Optionable): - _default = DNF - -# def __init__(self): -# super().__init__() - - @filter_class class Generic(BaseFilter): # noqa: F821 """ Generic filter @@ -37,16 +30,16 @@ def __init__(self): self.invert = False """ Invert the result of the filter """ self.include_only = BoMRegex - """ [list(dict)] A series of regular expressions used to include parts. + """ [list(dict)=[]] A series of regular expressions used to include parts. If there are any regex defined here, only components that match against ANY of them will be included. Column/field names are case-insensitive. If empty this rule is ignored """ self.exclude_any = BoMRegex - """ [list(dict)] A series of regular expressions used to exclude parts. + """ [list(dict)=[]] A series of regular expressions used to exclude parts. If a component matches ANY of these, it will be excluded. Column names are case-insensitive """ - self.keys = DNFList - """ [string|list(string)=dnf_list] [dnc_list,dnf_list] List of keys to match. + self.keys = Optionable + """ [string|list(string)='dnf_list'] [dnc_list,dnf_list,*] List of keys to match. The `dnf_list` and `dnc_list` internal lists can be specified as strings """ self.exclude_value = False """ Exclude components if their 'Value' is any of the keys """ @@ -62,7 +55,7 @@ def __init__(self): self.exclude_empty_val = False """ Exclude components with empty 'Value' """ self.exclude_refs = Optionable - """ [list(string)] List of references to be excluded. + """ [list(string)=[]] List of references to be excluded. Use R* for all references with R prefix """ self.exclude_all_hash_ref = False """ Exclude all components with a reference starting with # """ @@ -94,32 +87,21 @@ def _fix_field(field): def config(self, parent): super().config(parent) # include_only - if isinstance(self.include_only, type): - self.include_only = None - else: - for r in self.include_only: - r.column = self._fix_field(r.column) - r.regex = compile(r.regex, flags=IGNORECASE) + for r in self.include_only: + r.column = self._fix_field(r.column) + r.regex = compile(r.regex, flags=IGNORECASE) # exclude_any - if isinstance(self.exclude_any, type): - self.exclude_any = None - else: - for r in self.exclude_any: - r.column = self._fix_field(r.column) - r.regex = compile(r.regex, flags=IGNORECASE) + for r in self.exclude_any: + r.column = self._fix_field(r.column) + r.regex = compile(r.regex, flags=IGNORECASE) # keys - if isinstance(self.keys, type): - self.keys = DNF - elif isinstance(self.keys, str): - self.keys = DNF if self.keys == 'dnf_list' else DNC + if len(self.keys) == 1 and self.keys[0] in {'dnf_list', 'dnc_list'}: + self._keys = DNF if self.keys[0] == 'dnf_list' else DNC else: # Ensure lowercase - self.keys = [v.lower() for v in self.keys] + self._keys = [v.lower() for v in self.keys] # Config field must be lowercase self.config_field = self.config_field.lower() - # exclude_refs - if isinstance(self.exclude_refs, type): - self.exclude_refs = None def test_reg_include(self, c): """ Reject components that doesn't match the provided regex. @@ -141,7 +123,7 @@ def test_reg_include(self, c): res = not res if res: if GS.debug_level > 1: - logger.debug("Including '{ref}': Field '{field}' ({value}) matched '{re}'".format( + logger.debug("- Including '{ref}': Field '{field}' ({value}) matched '{re}'".format( ref=c.ref, field=reg.column, value=field_value, re=reg.regex)) # Found a match return True @@ -202,13 +184,13 @@ def filter(self, comp): if self.exclude_refs and (comp.ref in self.exclude_refs or comp.ref_prefix+'*' in self.exclude_refs): return exclude # All stuff where keys are involved - if self.keys: + if self._keys: # Exclude components if their 'Value' is any of the keys - if self.exclude_value and value in self.keys: + if self.exclude_value and value in self._keys: return exclude # Exclude components if a field is named as any of the keys if self.exclude_field: - for k in self.keys: + for k in self._keys: if k in comp.dfields: return exclude # Exclude components containing a key value in the config field. @@ -220,10 +202,10 @@ def filter(self, comp): opts = config.split(sep) # Try with all the extracted values for opt in opts: - if opt.strip() in self.keys: + if opt.strip() in self._keys: return exclude else: # No separator - if config in self.keys: + if config in self._keys: return exclude # Regular expressions if not self.test_reg_include(comp): diff --git a/kibot/fil_rot_footprint.py b/kibot/fil_rot_footprint.py index f338872aa..4d44950e6 100644 --- a/kibot/fil_rot_footprint.py +++ b/kibot/fil_rot_footprint.py @@ -64,6 +64,7 @@ def __init__(self, regex=None, angle=None, offset_x=None, offset_y=None): self.offset_x = offset_x if offset_y is not None: self.offset_y = offset_y + self._regex_example = '^TSSOP-' def __str__(self): res = f'{self.field} matches {self.regex} =>' @@ -85,6 +86,14 @@ def config(self, parent): self.field = self.solve_field_name(self.field).lower() +class RotFields(Optionable): + _default = DEFAULT_ROT_FIELDS + + +class OffsetFields(Optionable): + _default = DEFAULT_OFFSET_FIELDS + + @filter_class class Rot_Footprint(BaseFilter): # noqa: F821 """ Footprint Rotator @@ -109,28 +118,28 @@ def __init__(self): """ The original component rotation for components in the bottom is mirrored before applying the adjust so you get `(180 - component rot + angle)`. This is used by JLCPCB """ self.rotations = Optionable - """ [list(list(string))] A list of pairs regular expression/rotation. + """ [list(list(string))=[]] A list of pairs regular expression/rotation. Footprints matching the regular expression will be rotated the indicated angle. The angle matches the matthewlai/JLCKicadTools plugin specs """ self.offsets = Optionable - """ [list(list(string))] A list of pairs regular expression/offset. + """ [list(list(string))=[]] A list of pairs regular expression/offset. Footprints matching the regular expression will be moved the specified offset. The offset must be two numbers separated by a comma. The first is the X offset. The signs matches the matthewlai/JLCKicadTools plugin specs """ self.rotations_and_offsets = Regex - """ [list(dict)] A list of rules to match components and specify the rotation and offsets. + """ [list(dict)=[]] A list of rules to match components and specify the rotation and offsets. This is a more flexible version of the `rotations` and `offsets` options. Note that this list has more precedence """ self.skip_bottom = False """ Do not rotate components on the bottom """ self.skip_top = False """ Do not rotate components on the top """ - self.rot_fields = Optionable - """ [string|list(string)='JLCPCB Rotation Offset,JLCRotOffset'] List of fields that can contain a rotation offset. + self.rot_fields = RotFields + """ [string|list(string)] {comma_sep} List of fields that can contain a rotation offset. The optional fields can contain a counter-clockwise orientation offset in degrees. This concept is from the bennymeg/JLC-Plugin-for-KiCad tool """ - self.offset_fields = Optionable - """ [string|list(string)='JLCPCB Position Offset,JLCPosOffset'] List of fields that can contain a position offset. + self.offset_fields = OffsetFields + """ [string|list(string)] {comma_sep} List of fields that can contain a position offset. The optional fields can contain a comma separated x,y position offset. This concept is from the bennymeg/JLC-Plugin-for-KiCad tool """ self.bennymeg_mode = True @@ -147,38 +156,35 @@ def config(self, parent): self._rot = [] self._offset = [] # The main list first - if isinstance(self.rotations_and_offsets, list): - for v in self.rotations_and_offsets: - v.regex = compile(v.regex) - if v.apply_angle: - self._rot.append(v) - if v.apply_offset: - self._offset.append(v) + for v in self.rotations_and_offsets: + v.regex = compile(v.regex) + if v.apply_angle: + self._rot.append(v) + if v.apply_offset: + self._offset.append(v) # List of rotations - if isinstance(self.rotations, list): - for r in self.rotations: - if len(r) != 2: - raise KiPlotConfigurationError("Each regex/angle pair must contain exactly two values, not {} ({})". - format(len(r), r)) - try: - angle = float(r[1]) - except ValueError: - raise KiPlotConfigurationError("The second value in the regex/angle pairs must be a number, not {}". - format(r[1])) - self._rot.append(Regex(regex=compile(r[0]), angle=angle)) + for r in self.rotations: + if len(r) != 2: + raise KiPlotConfigurationError("Each regex/angle pair must contain exactly two values, not {} ({})". + format(len(r), r)) + try: + angle = float(r[1]) + except ValueError: + raise KiPlotConfigurationError("The second value in the regex/angle pairs must be a number, not {}". + format(r[1])) + self._rot.append(Regex(regex=compile(r[0]), angle=angle)) # List of offsets - if isinstance(self.offsets, list): - for r in self.offsets: - if len(r) != 2: - raise KiPlotConfigurationError("Each regex/offset pair must contain exactly two values, not {} ({})". - format(len(r), r)) - try: - offset_x = float(r[1].split(",")[0]) - offset_y = float(r[1].split(",")[1]) - except ValueError: - raise KiPlotConfigurationError("The second value in the regex/offset pairs must be two numbers " - f"separated by a comma, not {r[1]}") - self._offset.append(Regex(regex=compile(r[0]), offset_x=offset_x, offset_y=offset_y)) + for r in self.offsets: + if len(r) != 2: + raise KiPlotConfigurationError("Each regex/offset pair must contain exactly two values, not {} ({})". + format(len(r), r)) + try: + offset_x = float(r[1].split(",")[0]) + offset_y = float(r[1].split(",")[1]) + except ValueError: + raise KiPlotConfigurationError("The second value in the regex/offset pairs must be two numbers " + f"separated by a comma, not {r[1]}") + self._offset.append(Regex(regex=compile(r[0]), offset_x=offset_x, offset_y=offset_y)) if self.extend: for regex_str, angle in DEFAULT_ROTATIONS: self._rot.append(Regex(regex=compile(regex_str), angle=angle)) @@ -193,8 +199,6 @@ def config(self, parent): logger.debug('Final offsets list:') for r in self._offset: logger.debug(r) - self.rot_fields = self.force_list(self.rot_fields, default=DEFAULT_ROT_FIELDS) - self.offset_fields = self.force_list(self.offset_fields, default=DEFAULT_OFFSET_FIELDS) def apply_rotation_angle(self, comp, angle, bennymeg_mode=False): old_footprint_rot = comp.footprint_rot diff --git a/kibot/fil_separate_pins.py b/kibot/fil_separate_pins.py new file mode 100644 index 000000000..ae3f10be3 --- /dev/null +++ b/kibot/fil_separate_pins.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2024 Salvador E. Tropea +# Copyright (c) 2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 +# Project: KiBot (formerly KiPlot) +# This filter takes ideas from https://github.com/snhobbs/kicad-testpoints by Simon Hobbs +import pcbnew +from copy import deepcopy +from .gs import GS +from .optionable import Optionable +from .misc import MISSING_TOOL +from .macros import macros, document, filter_class # noqa: F401 +from . import log +logger = log.get_logger() + + +class PadAttribute(Optionable): + _default = ['testpoint'] + + +@filter_class +class Separate_Pins(BaseFilter): # noqa: F821 + """ Separate Pins + This filter can create pseudo-components from pins of the components. + Is used to create special BoMs to perform electrical checks using nail of beds. + Use it as a `pre_transform` filter for the `bom` output. + Important: The pin coordinates aren't affected by the rotation filters. + Important: Needs KiCad 6 or newer """ + def __init__(self): + super().__init__() + self._is_transform = True + with document: + self.ref_sep = '.' + """ Separator used in the reference (i.e. R10.1) """ + self.attribute = PadAttribute + """ [string|list(string)] [bga,local_fiducial,global_fiducial,testpoint,heatsink,castellated,none] Fabrication + attribute/s of the included pads """ + self.keep_component = False + """ If we also keep the original component or we just get the selected pads """ + + def config(self, parent): + super().config(parent) + if not GS.ki5: + STR2ATTR = {'bga': pcbnew.PAD_PROP_BGA, + 'local_fiducial': pcbnew.PAD_PROP_FIDUCIAL_LOCAL, + 'global_fiducial': pcbnew.PAD_PROP_FIDUCIAL_GLBL, + 'testpoint': pcbnew.PAD_PROP_TESTPOINT, + 'heatsink': pcbnew.PAD_PROP_HEATSINK, + 'castellated': pcbnew.PAD_PROP_CASTELLATED, + 'none': pcbnew.PAD_PROP_NONE} + self._attribute = {STR2ATTR[v] for v in self.attribute} + + def filter(self, comp): + """ Separate the selected pins as pseudo-components """ + if GS.ki5: + GS.exit_with_error("`separate_pins` needs KiCad 6+", MISSING_TOOL) + res = [] + if self.keep_component: + res.append(comp) + if GS.ki5 or not comp.has_pcb_info: + # No information from the PCB + logger.error('No PCB info') + return res + id = 1 + for name, v in comp.pad_properties.items(): + if v.fab_property in self._attribute: + c = deepcopy(comp) + c.ref += self.ref_sep+name + # Adjust the suffix to be "sort friendly" + # Currently useless, but could help in the future + c.ref_suffix = str(int(c.ref_suffix)*100+id) + c.footprint_x = v.x + c.footprint_y = v.y + c.net_name = v.net + c.net_class = v.net_class + c.virtual = False + c.tht = v.has_hole + c.smd = not v.has_hole + res.append(c) + return res diff --git a/kibot/fil_spec_to_field.py b/kibot/fil_spec_to_field.py index 4d4830e3c..5b4e1ca08 100644 --- a/kibot/fil_spec_to_field.py +++ b/kibot/fil_spec_to_field.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2023 Salvador E. Tropea -# Copyright (c) 2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2023-2024 Salvador E. Tropea +# Copyright (c) 2023-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Description: Extracts information from the distributor spec and fills fields import re @@ -9,7 +9,7 @@ from .bom.xlsx_writer import get_spec from .error import KiPlotConfigurationError from .kiplot import look_for_output, run_output -from .misc import W_FLDCOLLISION +from .misc import W_FLDCOLLISION, pretty_list # from .gs import GS from .optionable import Optionable from .macros import macros, document, filter_class # noqa: F401 @@ -24,12 +24,15 @@ class SpecOptions(Optionable): """ A spec to copy """ + _default = [{'spec': '_voltage', 'field': '_field_voltage'}, {'spec': '_tolerance', 'field': '_field_tolerance'}, + {'spec': '_power', 'field': '_field_power'}, {'spec': '_current', 'field': '_field_current'}] + def __init__(self): super().__init__() self._unknown_is_error = True with document: self.spec = Optionable - """ *[string|list(string)=''] Name/s of the source spec/s. + """ *[string|list(string)=''] {comma_sep} Name/s of the source spec/s. The following names are uniform across distributors: '_desc', '_value', '_tolerance', '_footprint', '_power', '_current', '_voltage', '_frequency', '_temp_coeff', '_manf' and '_size' """ self.field = '' @@ -53,7 +56,13 @@ def config(self, parent): raise KiPlotConfigurationError("Missing or empty `field` in spec_to_field filter ({})".format(str(self._tree))) if not self.spec: raise KiPlotConfigurationError("Missing or empty `spec` in spec_to_field filter ({})".format(str(self._tree))) - self.spec = self.force_list(self.spec) + + def __str__(self): + return pretty_list(self.spec)+' -> '+self.field + + +class CheckDistFields(Optionable): + _default = DEF_CHECK @filter_class @@ -76,24 +85,19 @@ def __init__(self): """ *[list(dict)|dict] One or more specs to be copied """ self.check_dist_coherence = True """ Check that the data we got from different distributors is equivalent """ - self.check_dist_fields = Optionable - """ [string|list(string)=''] List of fields to include in the check. + self.check_dist_fields = CheckDistFields + """ [string|list(string)] {comma_sep} List of fields to include in the check. For a full list of fields consult the `specs` option """ self._from = None self._check_dist_fields_example = DEF_CHECK + self._from_output_example = 'bom_output_name' def config(self, parent): super().config(parent) if not self.from_output: raise KiPlotConfigurationError("You must specify an output that collected the specs") - if isinstance(self.specs, type): + if not self.specs: raise KiPlotConfigurationError("At least one spec must be provided ({})".format(str(self._tree))) - if isinstance(self.specs, SpecOptions): - self.specs = [self.specs] - if isinstance(self.check_dist_fields, type): - self.check_dist_fields = DEF_CHECK - else: - self.check_dist_fields = self.force_list(self.check_dist_fields) def _normalize(self, val, kind, comp): val = val.strip() @@ -214,7 +218,8 @@ def filter(self, comp): self.solve_from() self.check_coherent(comp) for s in self.specs: - field = s.field.lower() + field_solved = Optionable.solve_field_name(s.field) + field = field_solved.lower() spec_name = [] spec_val = set() for sp in s.spec: @@ -238,11 +243,11 @@ def filter(self, comp): continue if not self.compare(cur_val, spec_val): # Collision - desc = "{} field `{}` collision, has `{}`, found `{}`".format(comp.ref, s.field, cur_val, spec_val) + desc = "{} field `{}` collision, has `{}`, found `{}`".format(comp.ref, field_solved, cur_val, spec_val) if s.collision == 'warning': logger.warning(W_FLDCOLLISION+desc) elif s.collision == 'error': raise KiPlotConfigurationError(desc) if s.policy == 'overwrite' or (self.p == 'update' and has_field) or (s.policy == 'new' and not has_field): - comp.set_field(s.field, spec_val) - logger.debugl(2, "- {} {}: {} ({})".format(comp.ref, s.field, spec_val, spec_name)) + comp.set_field(field_solved, spec_val) + logger.debugl(2, "- {} {}: {} ({})".format(comp.ref, field_solved, spec_val, spec_name)) diff --git a/kibot/fil_subparts.py b/kibot/fil_subparts.py index 9955a6c31..54b022d57 100644 --- a/kibot/fil_subparts.py +++ b/kibot/fil_subparts.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2021 Salvador E. Tropea -# Copyright (c) 2021 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2021-2024 Salvador E. Tropea +# Copyright (c) 2021-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Description: Implements the KiCost subparts mechanism. # The 'manf#' field can contain more than one value separated by ; @@ -25,13 +25,16 @@ class DistributorsList(Optionable): @filter_class class Subparts(BaseFilter): # noqa: F821 """ Subparts - This filter implements the KiCost subparts mechanism """ + This filter implements the KiCost subparts mechanism. + It allows to have more than one part in the same schematic symbol. + Some people use it to include connectors and cables related to a connector in the PCB. + [KiCost docs](https://hildogjr.github.io/KiCost/docs/_build/singlehtml/index.html) """ def __init__(self): super().__init__() self._is_transform = True with document: self.check_multiplier = Optionable - """ [list(string)] List of fields to include for multiplier computation. + """ [list(string)=?] List of fields to include for multiplier computation. If empty all fields in `split_fields` and `manf_pn_field` are used """ self.manf_field = 'manf' """ Field for the manufacturer name """ @@ -66,11 +69,9 @@ def config(self, parent): self.mult_separators = ':' if not self.ref_sep: self.ref_sep = '#' - if isinstance(self.split_fields, type): - self.split_fields = DISTRIBUTORS_F - else: - if self.split_fields_expand: - self.split_fields.extend(DISTRIBUTORS_F) + self._split_fields = self.split_fields + if self.split_fields_expand: + self._split_fields += DISTRIBUTORS_F # (?L4s', s[offset:offset+8]) + logger.debugl(2, f'- Chunk {type} ({size})') + if type == b'IHDR': + w, h = unpack('>LL', s[offset+8:offset+16]) + logger.debugl(2, f' - Size {w}x{h}') + elif type == b'pHYs': + dpi_w, dpi_h, units = unpack('>LLB', s[offset+8:offset+17]) + if dpi_w != dpi_h: + raise WksError(f'PNG with different resolution for X and Y ({dpi_w} {dpi_h})') + if units != 1: + raise WksError(f'PNG with unknown units ({units})') + ppi = dpi_w/(100/2.54) + logger.debugl(2, f' - PPI {ppi} ({dpi_w} {dpi_h} {units})') + break + elif type == b'IEND': + break + offset += size+12 + if w == -1: + raise WksError('Broken PNG, no IHDR chunk') + return w, h, ppi + def add_to_svg(e, svg, p, svg_precision): # Note: we compute all in KiCad IUs, and then apply a scale for the SVG + w, h, ppi = e.parse_png() s = e.data - w, h = unpack('>LL', s[16:24]) # For KiCad 300 dpi is 1:1 scale - dpi = 300/e.scale + dpi = ppi/e.scale # Convert pixels to mm and then to KiCad units w = FromMM(w/dpi*25.4) h = FromMM(h/dpi*25.4) diff --git a/kibot/kiplot.py b/kibot/kiplot.py index 3e16d6397..9bf7d97bd 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -10,6 +10,7 @@ """ from copy import deepcopy from collections import OrderedDict +import gzip import os import re from sys import path as sys_path @@ -25,7 +26,7 @@ MOD_VIRTUAL, W_PCBNOSCH, W_NONEEDSKIP, W_WRONGCHAR, name2make, W_TIMEOUT, W_KIAUTO, W_VARSCH, NO_SCH_FILE, NO_PCB_FILE, W_VARPCB, NO_YAML_MODULE, WRONG_ARGUMENTS, FAILED_EXECUTE, W_VALMISMATCH, MOD_EXCLUDE_FROM_POS_FILES, MOD_EXCLUDE_FROM_BOM, MOD_BOARD_ONLY, hide_stderr, W_MAXDEPTH, DONT_STOP, - W_BADREF) + W_BADREF, W_MULTIREF) from .error import PlotError, KiPlotConfigurationError, config_error, KiPlotError from .config_reader import CfgYamlReader from .pre_base import BasePreFlight @@ -208,9 +209,13 @@ def load_board(pcb_file=None, forced=False): with hide_stderr(): board = pcbnew.LoadBoard(pcb_file) if GS.global_invalidate_pcb_text_cache == 'yes' and GS.ki6: + # Workaround for unexpected KiCad behavior: + # https://gitlab.com/kicad/code/kicad/-/issues/14360 logger.debug('Current PCB text variables cache: {}'.format(board.GetProperties().items())) logger.debug('Removing cached text variables') board.SetProperties(pcbnew.MAP_STRING_STRING()) + # Save the PCB, so external tools also gets the reset, i.e. panelize, see #652 + GS.save_pcb(pcb_file, board) if BasePreFlight.get_option('check_zone_fills'): GS.fill_zones(board) if GS.global_units and GS.ki6: @@ -226,6 +231,12 @@ def load_board(pcb_file=None, forced=False): if dr.GetClass().startswith('PCB_DIM_') and dr.GetUnitsMode() == pcbnew.DIM_UNITS_MODE_AUTOMATIC: dr.SetUnitsMode(forced_units) dr.Update() + if GS.ki8: + # KiCad 8.0.2 crazyness: hidden text affects scaling, even when not plotted + # So a PRL can affect the plot mechanism + # https://gitlab.com/kicad/code/kicad/-/issues/17958 + # https://gitlab.com/kicad/code/kicad/-/commit/8184ed64e732ed0812831a13ebc04bd12e8d1d19 + board.SetElementVisibility(pcbnew.LAYER_HIDDEN_TEXT, False) GS.board = board except OSError as e: GS.exit_with_error(['Error loading PCB file. Corrupted?', str(e)], CORRUPTED_PCB) @@ -266,11 +277,13 @@ def load_any_sch(file, project, fatal=True, extra_msg=None): return sch -def load_sch(): - if GS.sch: # Already loaded +def load_sch(sch_file=None, forced=False): + if GS.sch is not None and not forced: # Already loaded return - GS.check_sch() - GS.sch = load_any_sch(GS.sch_file, GS.sch_basename) + if not sch_file: + GS.check_sch() + sch_file = GS.sch_file + GS.sch = load_any_sch(sch_file, os.path.splitext(os.path.basename(sch_file))[0]) def create_component_from_footprint(m, ref): @@ -307,13 +320,7 @@ def create_component_from_footprint(m, ref): f.number = 3 c.add_field(f) # Other fields - for name, val in GS.get_fields(m).items(): - f = SchematicField() - f.name = name - f.value = val - f.number = -1 - f.visible(False) - c.add_field(f) + copy_fields(c, m) c._solve_fields(None) try: c.split_ref() @@ -324,6 +331,24 @@ def create_component_from_footprint(m, ref): return c +class PadProperty(object): + pass + + +def copy_fields(c, m): + for name, value in GS.get_fields(m).items(): + if c.is_field(name.lower()): + # Already there + old = c.get_field_value(name) + if value and old != value: + logger.warning(f"{W_VALMISMATCH}{name} field mismatch for `{c.ref}` (SCH: `{old}` PCB: `{value}`)") + c.set_field(name, value) + else: + # New one + logger.debug(f'Adding {name} field to {c.ref} ({value})') + c.set_field(name, value) + + def get_board_comps_data(comps): """ Add information from the PCB to the list of components from the schematic. Note that we do it every time the function is called to reset transformation filters like rot_footprint. """ @@ -340,9 +365,13 @@ def get_board_comps_data(comps): for m in GS.get_modules(): ref = m.GetReference() attrs = m.GetAttributes() - if ref not in comps_hash: + ref_in_hash = ref in comps_hash + if not ref_in_hash or not len(comps_hash[ref]): if not (attrs & MOD_BOARD_ONLY) and not ref.startswith('KiKit_'): - logger.warning(W_PCBNOSCH + '`{}` component in board, but not in schematic'.format(ref)) + if not ref_in_hash: + logger.warning(W_PCBNOSCH+f'`{ref}` component in board, but not in schematic') + else: + logger.warning(W_MULTIREF+f'multiple `{ref}` components, not all operations will work') if not GS.global_include_components_from_pcb: # v1.6.3 behavior continue @@ -350,44 +379,77 @@ def get_board_comps_data(comps): c = create_component_from_footprint(m, ref) if c is None: continue - comps_hash[ref] = [c] comps.append(c) - for c in comps_hash[ref]: - new_value = m.GetValue() - if new_value != c.value and '${' not in c.value: - logger.warning(f"{W_VALMISMATCH}Value field mismatch for `{ref}` (SCH: `{c.value}` PCB: `{new_value}`)") - c.value = new_value - c.bottom = m.IsFlipped() - c.footprint_rot = m.GetOrientationDegrees() - center = GS.get_center(m) - c.footprint_x = center.x - c.footprint_y = center.y - (c.footprint_w, c.footprint_h) = GS.get_fp_size(m) - c.has_pcb_info = True - if GS.ki5: - # KiCad 5 - if attrs == UI_SMD: - c.smd = True - elif attrs == UI_VIRTUAL: - c.virtual = True - else: - c.tht = True + else: + # Take one with this ref. Note that more than one is not a normal situation + c = comps_hash[ref].pop() + new_value = m.GetValue() + if new_value != c.value and '${' not in c.value: + logger.warning(f"{W_VALMISMATCH}Value field mismatch for `{ref}` (SCH: `{c.value}` PCB: `{new_value}`)") + c.value = new_value + c.bottom = m.IsFlipped() + c.footprint_rot = m.GetOrientationDegrees() + center = GS.get_center(m) + c.footprint_x = center.x + c.footprint_y = center.y + (c.footprint_w, c.footprint_h) = GS.get_fp_size(m) + c.has_pcb_info = True + c.pad_properties = {} + if GS.global_use_pcb_fields: + copy_fields(c, m) + # Net + net_name = set() + net_class = set() + for pad in m.Pads(): + net_name.add(pad.GetNetname()) + net_class.add(pad.GetNetClassName()) + c.net_name = ','.join(net_name) + c.net_class = ','.join(net_class) + if GS.ki5: + # KiCad 5 + if attrs == UI_SMD: + c.smd = True + elif attrs == UI_VIRTUAL: + c.virtual = True else: - # KiCad 6 - if attrs & MOD_SMD: - c.smd = True - if attrs & MOD_THROUGH_HOLE: - c.tht = True - if attrs & MOD_VIRTUAL == MOD_VIRTUAL: - c.virtual = True - if attrs & MOD_EXCLUDE_FROM_POS_FILES: - c.in_pos = False - # The PCB contains another flag for the BoM - # I guess it should be in sync, but: why should somebody want to unsync it? - if attrs & MOD_EXCLUDE_FROM_BOM: - c.in_bom_pcb = False - if attrs & MOD_BOARD_ONLY: - c.in_pcb_only = True + c.tht = True + else: + # KiCad 6 + if attrs & MOD_SMD: + c.smd = True + if attrs & MOD_THROUGH_HOLE: + c.tht = True + if attrs & MOD_VIRTUAL == MOD_VIRTUAL: + c.virtual = True + if attrs & MOD_EXCLUDE_FROM_POS_FILES: + c.in_pos = False + # The PCB contains another flag for the BoM + # I guess it should be in sync, but: why should somebody want to unsync it? + if attrs & MOD_EXCLUDE_FROM_BOM: + c.in_bom_pcb = False + if attrs & MOD_BOARD_ONLY: + c.in_pcb_only = True + look_for_type = (not c.smd) and (not c.tht) + for pad in m.Pads(): + p = PadProperty() + center = pad.GetCenter() + p.x = center.x + p.y = center.y + p.fab_property = pad.GetProperty() + p.net = pad.GetNetname() + p.net_class = pad.GetNetClassName() + p.has_hole = pad.HasHole() + name = pad.GetNumber() + c.pad_properties[name] = p + # Try to figure out if this is THT or SMD when not specified + if look_for_type: + if p.has_hole: + # At least one THT, stop looking + c.tht = True + look_for_type = False + elif name: + # We have pad a valid pad, assume this is all SMD and keep looking + c.smd = True def expand_comp_fields(c, env): @@ -535,7 +597,7 @@ def look_for_output(name, op_name, parent, valids): return out -def _generate_outputs(outputs, targets, invert, skip_pre, cli_order, no_priority, dont_stop): +def _generate_outputs(targets, invert, skip_pre, cli_order, no_priority, dont_stop): logger.debug("Starting outputs for board {}".format(GS.pcb_file)) # Make a list of target outputs n = len(targets) @@ -598,14 +660,14 @@ def _generate_outputs(outputs, targets, invert, skip_pre, cli_order, no_priority run_output(out, dont_stop) -def generate_outputs(outputs, targets, invert, skip_pre, cli_order, no_priority, dont_stop=False): +def generate_outputs(targets, invert, skip_pre, cli_order, no_priority, dont_stop=False): setup_resources() prj = None if GS.global_restore_project: # Memorize the project content to restore it at exit prj = GS.read_pro() try: - _generate_outputs(outputs, targets, invert, skip_pre, cli_order, no_priority, dont_stop) + _generate_outputs(targets, invert, skip_pre, cli_order, no_priority, dont_stop) finally: # Restore the project file GS.write_pro(prj) @@ -651,7 +713,7 @@ def get_pre_targets(targets, dependencies, is_pre): tg = pre.get_targets() if not tg: continue - name = pre._name + name = pre.type targets[name] = [adapt_file_name(fn) for fn in tg] dependencies[name] = [adapt_file_name(fn) for fn in pre.get_dependencies()] is_pre.add(name) @@ -947,6 +1009,27 @@ def discover_files(dest_dir): return fname +def load_config(plot_config): + cr = CfgYamlReader() + outputs = None + try: + # The Python way ... + with gzip.open(plot_config, mode='rt') as cf_file: + try: + outputs = cr.read(cf_file) + except KiPlotConfigurationError as e: + config_error(str(e)) + except OSError: + pass + if outputs is None: + with open(plot_config) as cf_file: + try: + outputs = cr.read(cf_file) + except KiPlotConfigurationError as e: + config_error(str(e)) + return outputs + + def yaml_dump(f, tree): if version_str2tuple(yaml.__version__) < (3, 14): f.write(yaml.dump(tree)) @@ -1008,15 +1091,15 @@ def generate_one_example(dest_dir, types): needed_imports = {} # All the preflights preflights = {} - for n, cls in OrderedDict(sorted(BasePreFlight.get_registered().items())).items(): - o = cls(n, None) + for n in sorted(BasePreFlight.get_registered().keys()): + o = BasePreFlight.get_object_for(n) if types and n not in types: logger.debug('- {}, not selected (PCB: {} SCH: {})'.format(n, o.is_pcb(), o.is_sch())) continue if check_we_cant_use(o): logger.debug('- {}, skipped (PCB: {} SCH: {})'.format(n, o.is_pcb(), o.is_sch())) continue - tree = cls.get_conf_examples(n, layers) + tree = o.get_conf_examples(n, layers) if tree: logger.debug('- {}, generated'.format(n)) preflights.update(tree) @@ -1064,20 +1147,26 @@ def generate_one_example(dest_dir, types): return fname +def reset_config(): + # Outputs, groups, filters and variants + RegOutput.reset() + # Preflights + BasePreFlight.reset() + + def generate_targets(config_file): """ Generate all possible targets for the configuration file """ # Reset the board and schematic GS.board = None GS.sch = None # Reset the list of outputs and preflights - RegOutput.reset() - BasePreFlight.reset() + reset_config() # Read the config file cr = CfgYamlReader() with open(config_file) as cf_file: - outputs = cr.read(cf_file) + cr.read(cf_file) # Do all the job - generate_outputs(outputs, [], False, None, False, False, dont_stop=True) + generate_outputs([], False, None, False, False, dont_stop=True) def _walk(path, depth): @@ -1148,8 +1237,7 @@ def generate_examples(start_dir, dry, types): if not os.path.isdir(start_dir): GS.exit_with_error(f'Invalid dir {start_dir} to quick start', WRONG_ARGUMENTS) # Set default global options - glb = GS.class_for_global_opts() - glb.set_tree({}) + glb = GS.set_global_options_tree({}) glb.config(None) # Install the resources setup_resources() diff --git a/kibot/layer.py b/kibot/layer.py index beb6f053c..3afe455da 100644 --- a/kibot/layer.py +++ b/kibot/layer.py @@ -151,6 +151,7 @@ def __init__(self): A default can be specified using the `layer_defaults` global option """ self._unknown_is_error = True self._protel_extension = None + self._layer_example = 'F.Cu' def config(self, parent): super().config(parent) @@ -282,14 +283,14 @@ def _set_pcb_layers(): Layer._pcb_layers = {GS.board.GetLayerName(id): id for id in GS.board.GetEnabledLayers().Seq()} def get_default_suffix(self): - if GS.global_layer_defaults and not isinstance(GS.global_layer_defaults, type): + if GS.global_layer_defaults: layer = next(filter(lambda x: x.layer == self.layer, GS.global_layer_defaults), None) if layer and layer.suffix: return layer.suffix return self.layer.replace('.', '_') def get_default_description(self): - if GS.global_layer_defaults and not isinstance(GS.global_layer_defaults, type): + if GS.global_layer_defaults: layer = next(filter(lambda x: x.layer == self.layer, GS.global_layer_defaults), None) if layer and layer.description: return layer.description diff --git a/kibot/log.py b/kibot/log.py index 3dec6acc0..b4fa4806d 100644 --- a/kibot/log.py +++ b/kibot/log.py @@ -32,6 +32,8 @@ visual_level = None debug_level = 0 stop_on_warnings = False +record_error_msgs = False +recorded_error_msgs = [] def get_logger(name=None, indent=None): @@ -65,6 +67,20 @@ def set_filters(f): filters = f+filters +def start_recording_error_msgs(): + recorded_error_msgs.append([]) + + +def stop_recording_error_msgs(joined=True): + return '\n'.join(recorded_error_msgs.pop()) if joined else recorded_error_msgs.pop() + + +def push_error_msg(msg): + if not len(recorded_error_msgs): + return + recorded_error_msgs[-1].append(msg) + + class MyLogger(logging.Logger): warn_hash = {} warn_tcnt = warn_cnt = n_filtered = 0 @@ -99,7 +115,7 @@ def warning(self, msg, *args, **kwargs): else: number = int(num_str) for f in filters: - if (f.number == number or f.error == id) and f.regex.search(buf): + if (f.number == number or f.error == id) and f._regex.search(buf): MyLogger.n_filtered += 1 return MyLogger.warn_cnt += 1 @@ -110,6 +126,14 @@ def warning(self, msg, *args, **kwargs): super().warning(buf, **kwargs) self.check_warn_stop() + def error(self, msg, *args, **kwargs): + buf = str(msg) + push_error_msg(buf) + if sys.version_info >= (3, 8): + super().error(buf, stacklevel=2, **kwargs) # pragma: no cover (Py38) + else: + super().error(buf, **kwargs) + def check_warn_stop(self): if stop_on_warnings: self.error('Warnings treated as errors') diff --git a/kibot/misc.py b/kibot/misc.py index d2a4807bd..7168a037a 100644 --- a/kibot/misc.py +++ b/kibot/misc.py @@ -49,6 +49,7 @@ CORRUPTED_PRO = 34 BLENDER_ERROR = 35 WARN_AS_ERROR = 36 +CHECK_FIELD = 37 error_level_to_name = ['NONE', 'INTERNAL_ERROR', 'WRONG_ARGUMENTS', @@ -85,7 +86,8 @@ 'HPGL_SCH_PRINT', 'CORRUPTED_PRO', 'BLENDER_ERROR', - 'WARN_AS_ERROR' + 'WARN_AS_ERROR', + 'CHECK_FIELD' ] KICOST_SUBMODULE = '../submodules/KiCost/src/kicost' EXAMPLE_CFG = 'example_template.kibot.yaml' @@ -310,6 +312,17 @@ W_NEEDSK8 = '(W151) ' W_NEEDSK7 = '(W152) ' W_NEEDSK6 = '(W153) ' +W_UNKPADSH = '(W154) ' +W_NOFILES = '(W155) ' +W_NODESC = '(W156) ' +W_NOPAGES = '(W157) ' +W_NOLAYERS = '(W158) ' +W_NOPOPMD = '(W159) ' +W_NOQR = '(W160) ' +W_NOFOOTP = '(W161) ' +W_CHKFLD = '(W162) ' +W_ONMAC = '(W163) ' +W_MULTIREF = '(W164) ' # Somehow arbitrary, the colors are real, but can be different PCB_MAT_COLORS = {'fr1': "937042", 'fr2': "949d70", 'fr3': "adacb4", 'fr4': "332B16", 'fr5': "6cc290"} PCB_FINISH_COLORS = {'hal': "8b898c", 'hasl': "8b898c", 'imag': "8b898c", 'enig': "cfb96e", 'enepig': "cfb96e", @@ -483,6 +496,7 @@ [r"^PinHeader_2x03_P1\.27mm_Vertical", (-1.27, -0.635)], ] DEFAULT_OFFSET_FIELDS = ['JLCPCB Position Offset', 'JLCPosOffset'] +RE_LEN = re.compile(r'\{L:(\d+)\}') class Rect(object): @@ -539,3 +553,37 @@ def read_png(file): def force_list(v): return v if v is None or isinstance(v, list) else [v] + + +def typeof(v, cls, valid=None): + if isinstance(v, bool): + return 'boolean' + if isinstance(v, (int, float)): + return 'number' + if isinstance(v, str): + return 'string' + if isinstance(v, (dict, cls)): + return 'dict' + if isinstance(v, list): + if len(v) == 0: + if valid is not None: + return next(filter(lambda x: x.startswith('list('), valid), 'list(string)') + return 'list(string)' + return 'list({})'.format(typeof(v[0], cls)) + return 'None' + + +def pretty_list(items, short=False): + if not items: + return '' + if short: + if len(items) == 1: + return items[0].short_str() + return ', '.join((x.short_str() for x in items[:-1]))+' and '+items[-1].short_str() + return str(items[0]) if len(items) == 1 else ', '.join(map(str, items[:-1]))+' and '+str(items[-1]) + + +def try_int(value): + f_val = float(value) + i_val = int(f_val) + return i_val if i_val == f_val else f_val diff --git a/kibot/optionable.py b/kibot/optionable.py index 6bff1677c..410a0444a 100644 --- a/kibot/optionable.py +++ b/kibot/optionable.py @@ -5,13 +5,12 @@ # Project: KiBot (formerly KiPlot) """ Base class for output options """ import difflib -import inspect import os import re from re import compile from .error import KiPlotConfigurationError from .gs import GS -from .misc import W_UNKOPS, DISTRIBUTORS_STUBS, DISTRIBUTORS_STUBS_SEPS +from .misc import W_UNKOPS, DISTRIBUTORS_STUBS, DISTRIBUTORS_STUBS_SEPS, typeof, RE_LEN from . import log logger = log.get_logger() @@ -22,10 +21,6 @@ PATTERNS_DEP.append('%C'+str(n)) -def do_filter(v): - return inspect.isclass(v) or not (callable(v) or isinstance(v, (dict, list))) - - def _cl(text): """ Eliminates dangerous characters from the text """ return re.sub(r'[\\\/\?%\*:|"<>]', '_', text) @@ -34,8 +29,9 @@ def _cl(text): class Optionable(object): """ A class to validate and hold configuration outputs/options. Is configured from a dict and the collected values are stored in its attributes. """ - _str_values_re = compile(r"string=.*\] \[([^\]]+)\]") - _num_range_re = compile(r"number=.*\] \[(-?\d+),(-?\d+)\]") + _str_values_re = compile(r"string.*\](?:\[.*\])* \[([^\]]+)\]") + _num_range_re = compile(r"number.*\](?:\[.*\])* \[(-?[\d\.]+),(-?[\d\.]+)\]") + _num_values_re = compile(r"number.*\](?:\[.*\])* \[([^\]]+)\]") _default = None _color_re = re.compile(r"#("+HEX_DIGIT+"){3}$") @@ -63,15 +59,43 @@ def __init__(self): logger.debug('Using global `{}`=`{}`'.format(var, glb)) @staticmethod - def _check_str(key, val, doc): + def _promote_str_to_list(val, doc, valid): + if 'list(string)' not in valid or val == '_null': + return val, False + # Promote strings to list of strings + if not val: + return [], True + if ',' in val and '{comma_sep}' in doc: + return [v.strip() for v in val.split(',')], True + return [val], True + + @staticmethod + def _check_str(key, val, doc, valid): if not isinstance(val, str): raise KiPlotConfigurationError("Option `{}` must be a string".format(key)) + new_val, is_list = Optionable._promote_str_to_list(val, doc, valid) + if '{no_case}' in doc: + new_val = new_val.lower() if not is_list else [v.lower() for v in new_val] # If the docstring specifies the allowed values in the form [v1,v2...] enforce it m = Optionable._str_values_re.search(doc) if m: - vals = m.group(1).split(',') - if val not in vals: - raise KiPlotConfigurationError("Option `{}` must be any of {} not `{}`".format(key, vals, val)) + vals = [v.strip() for v in m.group(1).split(',')] + if '*' not in vals: + if not is_list: + wrong = val not in vals + else: + for v in new_val: + if v not in vals: + wrong = True + val = v + break + else: + wrong = False + if wrong: + raise KiPlotConfigurationError("Option `{}` must be any of {} not `{}`".format(key, vals, val)) + if is_list: + Optionable._check_list_len(key, new_val, doc) + return new_val @staticmethod def _check_num(key, val, doc): @@ -84,24 +108,44 @@ def _check_num(key, val, doc): max = float(m.group(2)) if val < min or val > max: raise KiPlotConfigurationError("Option `{}` outside its range [{},{}]".format(key, min, max)) + return + m = Optionable._num_values_re.search(doc) + if m: + vals = [float(v) for v in m.group(1).split(';')] + if val not in vals and '*' not in vals: + raise KiPlotConfigurationError("Option `{}` must be any of {} not `{}`".format(key, vals, val)) @staticmethod def _check_bool(key, val): if not isinstance(val, bool): raise KiPlotConfigurationError("Option `{}` must be true/false".format(key)) + @staticmethod + def _check_list_len(k, v, doc): + m = re.search(RE_LEN, doc) + if m: + items = int(m.group(1)) + if len(v) != items: + raise KiPlotConfigurationError(f"The `{k}` must contain {items} values ({v})") + + def get_doc_simple(self, name): + return getattr(self, '_help_'+name) + def get_doc(self, name, no_basic=False): try: doc = getattr(self, '_help_'+name).strip() except AttributeError: return None, name, False if doc[0] == '{': - alias = doc[1:-1] - return getattr(self, '_help_'+alias).strip(), alias, True + is_alias = True + name = doc[1:-1] + doc = getattr(self, '_help_'+name).strip() + else: + is_alias = False if no_basic and doc[0] == '*': # Remove the 'basic' indicator doc = doc[1:] - return doc, name, False + return doc, name, is_alias def is_basic_option(self, name): help, _, _ = self.get_doc(name) @@ -114,21 +158,53 @@ def add_to_doc(self, name, text, with_nl=True): def set_doc(self, name, text): setattr(self, '_help_'+name, text) - @staticmethod - def _typeof(v): - if isinstance(v, bool): - return 'boolean' - if isinstance(v, (int, float)): - return 'number' - if isinstance(v, str): - return 'string' - if isinstance(v, dict): - return 'dict' - if isinstance(v, list): - if len(v) == 0: - return 'list(string)' - return 'list({})'.format(Optionable._typeof(v[0])) - return 'None' + def get_valid_types(self, doc, skip_extra=False): + assert doc[0] == '[', doc[0]+'\n'+str(self.__dict__) + # Separate the valid types for this key + sections = doc[1:].split('] ') + valid = sections[0].split('|') + real_help = ' '+'] '.join([x for x in sections[1:] if x[0] != '[']) + # Remove the XXXX=Value + def_val = None + if '=' in valid[-1]: + res = valid[-1].split('=') + valid[-1] = res[0] + def_val = '='.join(res[1:]) + validation = [] + if not skip_extra: + for v in valid: + if v == 'number' or v == 'list(number)': + m = Optionable._num_range_re.search(doc) + if m: + min = float(m.group(1)) + if int(min) == min: + min = int(min) + max = float(m.group(2)) + if int(max) == max: + max = int(max) + validation.append((min, max)) + continue + m = Optionable._num_values_re.search(doc) + if m: + validation.append(('C', m.group(1).split(';'))) + continue + if v == 'string' or v == 'list(string)': + m = Optionable._str_values_re.search(doc) + if m: + validation.append([v.strip() for v in m.group(1).split(',')]) + continue + validation.append(None) + return valid, validation, def_val, real_help + + def check_string_dict(self, v_type, valid, k, v): + if v_type != 'dict' or 'string_dict' not in valid: + return False + # A particular case for dict + for key, value in v.items(): + if not isinstance(value, str): + raise KiPlotConfigurationError(f"Key `{key}` of option `{k}` must be a string, not" + f" `{typeof(value,Optionable)}`") + return True def _perform_config_mapping(self): """ Map the options to class attributes """ @@ -150,32 +226,29 @@ def _perform_config_mapping(self): continue # Check the data type cur_doc, alias, is_alias = self.get_doc(k, no_basic=True) + assert cur_doc[0] == '[', cur_doc[0] + # Separate the valid types for this key + valid, _, def_val, real_help = self.get_valid_types(cur_doc, skip_extra=True) + if isinstance(v, type): + # An optionable + v.set_default(def_val) cur_val = getattr(self, alias) - if cur_doc[0] == '[': - # Separate the valid types for this key - valid = cur_doc[1:].split(']')[0].split('|') - # Remove the XXXX=Value - if '=' in valid[-1]: - valid[-1] = valid[-1].split('=')[0] - # Get the type used by the user as a string - v_type = Optionable._typeof(v) - if v_type not in valid: - # Not a valid type for this key - if v_type == 'None': - raise KiPlotConfigurationError("Empty option `{}`".format(k)) - if len(valid) == 1: - raise KiPlotConfigurationError("Option `{}` must be a {} not `{}`".format(k, valid[0], v_type)) - else: - raise KiPlotConfigurationError("Option `{}` must be any of {} not `{}`".format(k, valid, v_type)) - else: - valid = None - v_type = Optionable._typeof(cur_val) + # Get the type used by the user as a string + v_type = typeof(v, Optionable, valid) + if v_type not in valid and not self.check_string_dict(v_type, valid, k, v): + # Not a valid type for this key + if v_type == 'None': + raise KiPlotConfigurationError("Empty option `{}`".format(k)) + if len(valid) == 1: + raise KiPlotConfigurationError("Option `{}` must be a {} not `{}`".format(k, valid[0], v_type)) + else: + raise KiPlotConfigurationError("Option `{}` must be any of {} not `{}`".format(k, valid, v_type)) if v_type == 'boolean': Optionable._check_bool(k, v) elif v_type == 'number': Optionable._check_num(k, v, cur_doc) elif v_type == 'string': - Optionable._check_str(k, v, cur_doc) + v = Optionable._check_str(k, v, cur_doc, valid) elif isinstance(cur_val, type): # A class, so we need more information i.e. "[dict|string]" if valid is not None: @@ -189,26 +262,35 @@ def _perform_config_mapping(self): elif isinstance(v, dict): # Dicts are solved using Optionable classes new_val = v - # Create an object for the valid class - v = cur_val() - # Delegate the validation to the object - v.set_tree(new_val) - v.config(self) + if 'string_dict' not in valid: + # Create an object for the valid class + v = cur_val() + # Delegate the validation to the object + v.set_tree(new_val) + v.config(self) + # Promote to a list if possible + if 'list(dict)' in valid: + v = [v] elif isinstance(v, list): new_val = [] + filtered_valid = [t[5:-1] for t in valid if t.startswith('list(')] + no_case = '{no_case}' in cur_doc for element in v: - e_type = 'list('+Optionable._typeof(element)+')' - if e_type not in valid: + e_type = typeof(element, Optionable) + if e_type not in filtered_valid: raise KiPlotConfigurationError("Option `{}` must be any of {} not `{}`". - format(element, valid, e_type)) + format(element, filtered_valid, e_type)) if isinstance(element, dict): nv = cur_val() nv.set_tree(element) nv.config(self) new_val.append(nv) else: + if no_case and isinstance(element, str): + element = element.lower() new_val.append(element) v = new_val + self._check_list_len(k, v, cur_doc) # Seems to be ok, map it dest_name = alias if is_alias else k setattr(self, dest_name, v) @@ -226,22 +308,87 @@ def get_user_defined(self, name): def set_tree(self, tree): self._tree = tree + def do_defaults(self): + """ Assign the defaults to complex data types """ + for k, v in self.get_attrs_gen(): + if not isinstance(v, type): + # We only process things that points to its class (Optionable) + continue + if self.get_user_defined(k): + # If the user assigned a value skip it + continue + cur_doc, alias, is_alias = self.get_doc(k, no_basic=True) + if is_alias: + # Aliases ignored + continue + valid, _, def_val, real_help = self.get_valid_types(cur_doc, skip_extra=True) + if def_val is None: + # Use the class default, used for complex cases + self.configure_from_default(k) + continue + new_val = None + # TODO: Merge with adapt_default + if def_val == '?': + # The local config will creat something useful + continue + elif def_val == '{}': + if 'string_dict' in valid: + new_val = {} + else: + # The default initialization for the class + new_val = v() + new_val.config(self) + elif def_val == '[{}]': + # The default initialization for the class + new_val = v() + new_val.config(self) + new_val = [new_val] + elif def_val == '[]': + # An empty list + new_val = [] + elif def_val == 'true': + new_val = True + elif def_val == 'false': + new_val = False + elif def_val == 'null': + # Explicit None + new_val = None + elif def_val[0] == "'": + # String + new_val, _ = self._promote_str_to_list(def_val[1:-1], real_help, valid) + elif def_val[0] in {'-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}: + new_val = float(def_val) + else: + assert new_val is not None, f'{self} {k} {def_val}' + logger.debugl(3, f'Configuring from default: {k} -> {new_val}') + setattr(self, k, new_val) + def config(self, parent): self._parent = parent + old_configured = self._configured if self._tree and not self._configured: self._perform_config_mapping() - self._configured = True + self._configured = True + if not old_configured: + self.do_defaults() if self._output_multiple_files and ('%i' not in self.output or '%x' not in self.output): raise KiPlotConfigurationError('The output pattern must contain %i and %x, otherwise file names will collide') + def reconfigure(self, tree, parent=None): + """ Configures an already configured object """ + # We need to reset the members that indicates which class is used for them + self.__init__() + # self._configured = False done by __init__() + self.set_tree(tree) + self.config(parent if parent is not None else (self._parent if hasattr(self, '_parent') else None)) + def get_attrs_for(self): """ Returns all attributes """ - return dict(inspect.getmembers(self, do_filter)) + return dict(vars(self).items()) def get_attrs_gen(self): """ Returns a (key, val) iterator on public attributes """ - attrs = self.get_attrs_for() - return ((k, v) for k, v in attrs.items() if k[0] != '_') + return filter(lambda k: k[0][0] != '_', vars(self).items()) @staticmethod def _find_global_variant(): @@ -440,6 +587,28 @@ def force_list(val, comma_sep=True, lower_case=False, default=None): def get_default(cls): return cls._default + def configure_from_default(self, member): + """ Initializes the `member` using its default value. + The `member` should be assigned with the class used for it """ + v = getattr(self, member) + default = v.get_default() + assert default is not None, f'Missing default for {member} in {self}' + if isinstance(default, dict): + o = v() + o.set_tree(default) + o.config(self) + default = o + elif isinstance(default, list) and isinstance(default[0], dict): + res = [] + for item in default: + o = v() + o.set_tree(item) + o.config(self) + res.append(o) + default = res + logger.debugl(3, f'Configuring from default: {member} -> {default}') + setattr(self, member, default) + def validate_color_str(self, color): return self._color_re.match(color) or self._color_re_a.match(color) @@ -525,11 +694,26 @@ def _solve_field_name(field, empty_when_none): @staticmethod def solve_field_name(field, empty_when_none=False): - if field != '_field_lcsc_part': + if field[:7] != '_field_': + return field + rest = field[7:] + if rest == 'current': + return GS.global_field_current[0] if GS.global_field_current else field + if rest == 'lcsc_part': + logger.debug('Looking for LCSC field name') + field = Optionable._solve_field_name(field, empty_when_none) + logger.debug('Using {} as LCSC field name'.format(field)) return field - logger.debug('Looking for LCSC field name') - field = Optionable._solve_field_name(field, empty_when_none) - logger.debug('Using {} as LCSC field name'.format(field)) + if rest == 'package': + return GS.global_field_package[0] if GS.global_field_package else field + if rest == 'power': + return GS.global_field_power[0] if GS.global_field_power else field + if rest == 'temp_coef': + return GS.global_field_temp_coef[0] if GS.global_field_temp_coef else field + if rest == 'tolerance': + return GS.global_field_tolerance[0] if GS.global_field_tolerance else field + if rest == 'voltage': + return GS.global_field_voltage[0] if GS.global_field_voltage else field return field diff --git a/kibot/out_any_drill.py b/kibot/out_any_drill.py index 9fae8c74b..ed8450e85 100644 --- a/kibot/out_any_drill.py +++ b/kibot/out_any_drill.py @@ -45,12 +45,12 @@ def __init__(self): self.use_aux_axis_as_origin = False """ Use the auxiliary axis as origin for coordinates """ self.map = DrillMap - """ [dict|string] [hpgl,ps,gerber,dxf,svg,pdf] Format for a graphical drill map. + """ [dict|string='None'] [hpgl,ps,gerber,dxf,svg,pdf,None] Format for a graphical drill map. Not generated unless a format is specified """ self.output = GS.def_global_output """ *name for the drill file, KiCad defaults if empty (%i='PTH_drill') """ self.report = DrillReport - """ [dict|string] Name of the drill report. Not generated unless a name is specified """ + """ [dict|string=''] Name of the drill report. Not generated unless a name is specified """ self.pth_id = None """ [string] Force this replacement for %i when generating PTH and unified files """ self.npth_id = None @@ -63,9 +63,10 @@ def __init__(self): 'gerber': PLOT_FORMAT_GERBER, 'dxf': PLOT_FORMAT_DXF, 'svg': PLOT_FORMAT_SVG, - 'pdf': PLOT_FORMAT_PDF + 'pdf': PLOT_FORMAT_PDF, + 'None': None } - self._map_ext = {'hpgl': 'plt', 'ps': 'ps', 'gerber': 'gbr', 'dxf': 'dxf', 'svg': 'svg', 'pdf': 'pdf'} + self._map_ext = {'hpgl': 'plt', 'ps': 'ps', 'gerber': 'gbr', 'dxf': 'dxf', 'svg': 'svg', 'pdf': 'pdf', 'None': None} self._unified_output = False self.help_only_sub_pcbs() @@ -73,20 +74,15 @@ def config(self, parent): super().config(parent) # Solve the map for both cases if isinstance(self.map, str): - self.map_ext = self._map_ext[self.map] - self.map_output = GS.global_output if GS.global_output is not None else GS.def_global_output - self.map = self._map_map[self.map] - elif isinstance(self.map, DrillMap): - self.map_ext = self._map_ext[self.map.type] - self.map_output = self.map.output - self.map = self._map_map[self.map.type] + map = self.map + self._map_output = GS.global_output if GS.global_output is not None else GS.def_global_output else: - self.map = None + map = self.map.type + self._map_output = self.map.output + self._map_ext = self._map_ext[map] + self._map = self._map_map[map] # Solve the report for both cases - if isinstance(self.report, DrillReport): - self.report = self.report.filename - elif not isinstance(self.report, str): - self.report = None + self._report = self.report.filename if isinstance(self.report, DrillReport) else self.report self._expand_id = 'drill' self._expand_ext = self._ext @@ -152,11 +148,11 @@ def get_file_names(self, output_dir): if self.output: file = self.expand_filename(output_dir, self.output, kibot_id, self._ext) filenames[k_file] = file - if self.map is not None: - k_file = self.expand_filename(output_dir, '%f'+kicad_id_map+'-drl_map.%x', '', self.map_ext) + if self._map is not None: + k_file = self.expand_filename(output_dir, '%f'+kicad_id_map+'-drl_map.%x', '', self._map_ext) file = '' - if self.map_output: - file = self.expand_filename(output_dir, self.map_output, kibot_id+'_map', self.map_ext) + if self._map_output: + file = self.expand_filename(output_dir, self._map_output, kibot_id+'_map', self._map_ext) filenames[k_file] = file return filenames @@ -173,10 +169,10 @@ def run(self, output_dir): drill_writer = self._configure_writer(GS.board, offset) logger.debug("Generating drill files in "+output_dir) - gen_map = self.map is not None + gen_map = self._map is not None if gen_map: - drill_writer.SetMapFileFormat(self.map) - logger.debug("Generating drill map type {} in {}".format(self.map, output_dir)) + drill_writer.SetMapFileFormat(self._map) + logger.debug("Generating drill map type {} in {}".format(self._map, output_dir)) # We always generate the drill file drill_writer.CreateDrillandMapFilesSet(output_dir, True, gen_map) # Rename the files @@ -186,8 +182,8 @@ def run(self, output_dir): logger.debug("Renaming {} -> {}".format(k_f, f)) os.replace(k_f, f) # Generate the report - if self.report: - drill_report_file = self.expand_filename(output_dir, self.report, 'drill_report', 'txt') + if self._report: + drill_report_file = self.expand_filename(output_dir, self._report, 'drill_report', 'txt') logger.debug("Generating drill report: "+drill_report_file) drill_writer.GenDrillReportFile(drill_report_file) self.unfilter_pcb_components() @@ -197,6 +193,6 @@ def get_targets(self, out_dir): files = self.get_file_names(out_dir) for k_f, f in files.items(): targets.append(f if f else k_f) - if self.report: - targets.append(self.expand_filename(out_dir, self.report, 'drill_report', 'txt')) + if self._report: + targets.append(self.expand_filename(out_dir, self._report, 'drill_report', 'txt')) return targets diff --git a/kibot/out_any_layer.py b/kibot/out_any_layer.py index ee2b02b05..9456cf640 100644 --- a/kibot/out_any_layer.py +++ b/kibot/out_any_layer.py @@ -11,7 +11,7 @@ PLOT_FORMAT_GERBER, PLOT_FORMAT_POST, PLOT_FORMAT_DXF, PLOT_FORMAT_PDF, PLOT_FORMAT_SVG, LSEQ, LSET) from .optionable import Optionable from .out_base import BaseOutput, VariantOptions -from .error import PlotError, KiPlotConfigurationError +from .error import PlotError from .layer import Layer from .gs import GS from .misc import W_NOLAYER, KICAD_VERSION_7_0_1, MISSING_TOOL, AUTO_SCALE @@ -39,6 +39,9 @@ def __init__(self): """ Content for the report. Use ``${basename}`` for the project name without extension. Use ``${filename(LAYER)}`` for the file corresponding to LAYER """ + def __str__(self): + return self.output + class AnyLayerOptions(VariantOptions): """ Base class for: DXF, Gerber, HPGL, PDF, PS and SVG """ @@ -74,7 +77,7 @@ def __init__(self): self.edge_cut_extension = '' """ Used to configure the edge cuts layer extension for Protel mode. Include the dot """ self.custom_reports = CustomReport - """ [list(dict)] A list of customized reports for the manufacturer """ + """ [list(dict)=[]] A list of customized reports for the manufacturer """ self.sketch_pads_on_fab_layers = False r""" Draw only the outline of the pads on the \*.Fab layers (KiCad 6+) """ self.sketch_pad_line_width = 0.1 @@ -89,8 +92,6 @@ def __init__(self): def config(self, parent): super().config(parent) - if isinstance(self.custom_reports, type): - self.custom_reports = [] self.sketch_pad_line_width = GS.from_mm(self.sketch_pad_line_width) def _configure_plot_ctrl(self, po, output_dir): @@ -298,14 +299,8 @@ def __init__(self): super().__init__() with document: self.layers = Layer - """ *[list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to plot """ - - def config(self, parent): - super().config(parent) - # We need layers - if isinstance(self.layers, type): - raise KiPlotConfigurationError("Missing `layers` list") + """ *[list(dict)|list(string)|string='all'] [all,selected,copper,technical,user,inners,outers,*] List + of PCB layers to plot """ def get_targets(self, out_dir): return self.options.get_targets(out_dir, self.layers) diff --git a/kibot/out_any_pcb_print.py b/kibot/out_any_pcb_print.py index 47e5dd534..7c61524a2 100644 --- a/kibot/out_any_pcb_print.py +++ b/kibot/out_any_pcb_print.py @@ -6,7 +6,7 @@ import os from .pre_base import BasePreFlight from .gs import GS -from .misc import PDF_PCB_PRINT, KICAD_VERSION_7_0_1, MISSING_TOOL, W_DEPR +from .misc import PDF_PCB_PRINT, KICAD_VERSION_7_0_1, MISSING_TOOL, W_DEPR, W_NOLAYERS from .out_base import VariantOptions from .macros import macros, document, output_class # noqa: F401 from .drill_marks import add_drill_marks, DRILL_MARKS_MAP @@ -70,6 +70,8 @@ def get_targets(self, out_dir): def run(self, output, svg=False): super().run(self._layers) logger.warning(W_DEPR+'The `pdf_pcb_print` and `svg_pcb_print` outputs are deprecated, use `pcb_print` instead') + if self._parent.layers == ['all'] and not self._parent.get_user_defined('layers'): + logger.warning(W_NOLAYERS+f'No layers specified for `{self._parent.name}`, including `all`') if GS.ki7 and GS.kicad_version_n < KICAD_VERSION_7_0_1 and self.scaling != 0 and self.scaling != 1.0: GS.exit_with_error("Scaled printing is broken in KiCad 7.0.0\n" "Please upgrade KiCad to 7.0.1 or newer", MISSING_TOOL) diff --git a/kibot/out_any_stencil.py b/kibot/out_any_stencil.py index 7f398d64c..6ffc7a8c3 100644 --- a/kibot/out_any_stencil.py +++ b/kibot/out_any_stencil.py @@ -26,7 +26,7 @@ def __init__(self): self.include_scad = True """ Include the generated OpenSCAD files """ self.cutout = '' - """ [string|list(string)] List of components to add a cutout based on the component courtyard. + """ [string|list(string)] {comma_sep} List of components to add a cutout based on the component courtyard. This is useful when you have already pre-populated board and you want to populate more components """ self.pcbthickness = 0 @@ -40,7 +40,7 @@ def __init__(self): def config(self, parent): super().config(parent) - self.cutout = ','.join(self.force_list(self.cutout)) + self.cutout = ','.join(self.cutout) def expand_name(self, id, ext, out_dir): self._expand_id = id diff --git a/kibot/out_base.py b/kibot/out_base.py index 238919839..1eda60b2a 100644 --- a/kibot/out_base.py +++ b/kibot/out_base.py @@ -1,13 +1,14 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2023 Salvador E. Tropea -# Copyright (c) 2020-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) from copy import deepcopy import math import os import re from shutil import rmtree +from .bom.columnlist import ColumnList from .gs import GS from .kicad.pcb import replace_footprints from .kiplot import load_sch, get_board_comps_data @@ -74,13 +75,14 @@ def __init__(self): self.run_by_default = True """ When enabled this output will be created when no specific outputs are requested """ self.disable_run_by_default = '' - """ [string|boolean] Use it to disable the `run_by_default` status of other output. + """ [string|boolean=''] Use it to disable the `run_by_default` status of other output. Useful when this output extends another and you don't want to generate the original. Use the boolean true value to disable the output you are extending """ self.output_id = '' """ Text to use for the %I expansion content. To differentiate variations of this output """ self.category = Optionable - """ [string|list(string)=''] The category for this output. If not specified an internally defined category is used. + """ [string|list(string)=''] {comma_sep} The category for this output. If not specified an internally defined + category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results` """ self.priority = 50 @@ -167,15 +169,8 @@ def config(self, parent): raise KiPlotConfigurationError('Unknown output `{}` in `disable_run_by_default`'.format(to_dis)) if self.dir[0] == '+': self.dir = (GS.global_dir if GS.global_dir is not None else './') + self.dir[1:] - if getattr(self, 'options', None) and isinstance(self.options, type): - # No options, get the defaults - self.options = self.options() - # Configure them using an empty tree - self.options.config(self) - self.category = self.force_list(self.category) if not self.category: - self.category = self._category - self.groups = self.force_list(self.groups, comma_sep=False) + self.category = self.force_list(self._category) def expand_dirname(self, out_dir): return self.options.expand_filename_both(out_dir, is_sch=self._sch_related) @@ -237,12 +232,17 @@ def __init__(self): """ Match if the field doesn't exists, no regex applied. Not affected by `invert` """ self.invert = False """ Invert the regex match result """ + self._column_example = ColumnList.COL_REFERENCE def config(self, parent): super().config(parent) if not self.column: raise KiPlotConfigurationError("Missing or empty `column` in field regex ({})".format(str(self._tree))) + def __str__(self): + invert = '!' if self.invert else '' + return f'{self.column} {invert}`{self.regex}`' + class VariantOptions(BaseOptions): """ BaseOptions plus generic support for variants. """ @@ -251,16 +251,16 @@ def __init__(self): self.variant = '' """ Board variant to apply """ self.dnf_filter = Optionable - """ [string|list(string)='_none'] Name of the filter to mark components as not fitted. + """ [string|list(string)='_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 """ self.pre_transform = Optionable - """ [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + """ [string|list(string)='_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 """ super().__init__() self._comps = None self._sub_pcb = None - self.undo_3d_models = {} - self.undo_3d_models_rep = {} + self._undo_3d_models = {} + self._undo_3d_models_rep = {} self._highlight_3D_file = None self._highlighted_3D_components = None @@ -280,6 +280,18 @@ def get_refs_hash(self): return None return {c.ref: c for c in self._comps} + def get_refs_hash_multi(self): + """ This version allows having multiple components with the same reference. + Is useful for things like a panel """ + if not self._comps: + return None + comps_hash = {} + for c in self._comps: + cur_list = comps_hash.get(c.ref, []) + cur_list.append(c) + comps_hash[c.ref] = cur_list + return comps_hash + def get_fitted_refs(self): """ List of fitted and included components """ if not self._comps: @@ -395,7 +407,7 @@ def detect_solder_paste(self, board): def remove_paste_and_glue(self, board, comps_hash): """ Remove from solder paste layers the filtered components. """ if comps_hash is None or not (GS.global_remove_solder_paste_for_dnp or GS.global_remove_adhesive_for_dnp or - GS.remove_solder_mask_for_dnp): + GS.global_remove_solder_mask_for_dnp): return logger.debug('Removing paste, mask and/or glue') exclude = LSET() @@ -470,11 +482,11 @@ def remove_paste_and_glue(self, board, comps_hash): if found: logger.debugl(3, '- Removed mask from '+ref) # Store the data to undo the above actions - self.old_layers = old_layers - self.old_fadhes = old_fadhes - self.old_badhes = old_badhes - self.old_fmask = old_fmask - self.old_bmask = old_bmask + self._old_layers = old_layers + self._old_fadhes = old_fadhes + self._old_badhes = old_badhes + self._old_fmask = old_fmask + self._old_bmask = old_bmask self._fadhes = fadhes self._badhes = badhes self._fmask = fmask @@ -491,27 +503,28 @@ def restore_paste_and_glue(self, board, comps_hash): c = comps_hash.get(ref, None) if c and c.included and not c.fitted: logger.debugl(3, '- Restoring paste/mask for '+ref) - restore = self.old_layers.pop(0) + restore = self._old_layers.pop(0) for p in m.Pads(): pad_layers = p.GetLayerSet() res = restore.pop(0) pad_layers.ParseHex(res, len(res)) p.SetLayerSet(pad_layers) if GS.global_remove_adhesive_for_dnp: - for gi in self.old_fadhes: + for gi in self._old_fadhes: gi.SetLayer(self._fadhes) - for gi in self.old_badhes: + for gi in self._old_badhes: gi.SetLayer(self._badhes) if GS.global_remove_solder_mask_for_dnp: - for gi in self.old_fmask: + for gi in self._old_fmask: gi.SetLayer(self._fmask) - for gi in self.old_bmask: + for gi in self._old_bmask: gi.SetLayer(self._bmask) def remove_fab(self, board, comps_hash): """ Remove from Fab the excluded components. """ if comps_hash is None: return + logger.debug('Removing from Fab') ffab = board.GetLayerID('F.Fab') bfab = board.GetLayerID('B.Fab') old_ffab = [] @@ -521,6 +534,7 @@ def remove_fab(self, board, comps_hash): ref = m.GetReference() c = comps_hash.get(ref, None) if c is not None and not c.included: + logger.debugl(3, '- Removed Fab drawings from '+ref) # Remove any graphical item in the *.Fab layers for gi in m.GraphicalItems(): l_gi = gi.GetLayer() @@ -546,7 +560,7 @@ def restore_fab(self, board, comps_hash): def replace_3D_models(self, models, new_model, c): """ Changes the 3D model using a provided model. - Stores changes in self.undo_3d_models_rep """ + Stores changes in self._undo_3d_models_rep """ logger.debug('Changing 3D models for '+c.ref) # Get the model references models_l = [] @@ -567,7 +581,7 @@ def replace_3D_models(self, models, new_model, c): for i, m3d in enumerate(models_l): replaced.append(m3d.m_Filename) m3d.m_Filename = new_model[i] - self.undo_3d_models_rep[c.ref] = replaced + self._undo_3d_models_rep[c.ref] = replaced # Push the models back for model in reversed(models_l): models.append(model) @@ -581,18 +595,18 @@ def undo_3d_models_rename(self, board): while not models.empty(): models_l.append(models.pop()) # Fix any changed path - replaced = self.undo_3d_models_rep.get(m.GetReference()) + replaced = self._undo_3d_models_rep.get(m.GetReference()) for i, m3d in enumerate(models_l): - if m3d.m_Filename in self.undo_3d_models: - m3d.m_Filename = self.undo_3d_models[m3d.m_Filename] + if m3d.m_Filename in self._undo_3d_models: + m3d.m_Filename = self._undo_3d_models[m3d.m_Filename] if replaced: m3d.m_Filename = replaced[i] # Push the models back for model in reversed(models_l): models.append(model) # Reset the list of changes - self.undo_3d_models = {} - self.undo_3d_models_rep = {} + self._undo_3d_models = {} + self._undo_3d_models_rep = {} def remove_3D_models(self, board, comps_hash): """ Removes 3D models for excluded or not fitted components. @@ -740,6 +754,8 @@ def highlight_3D_models(self, board, highlight): models = m.Models() m_pos = m.GetPosition() rot = m.GetOrientationDegrees() + if m.IsFlipped(): + rot = 180-rot # Measure the courtyard bbox = self.get_crtyd_bbox(board, m) if bbox.x1 is not None: @@ -759,7 +775,7 @@ def highlight_3D_models(self, board, highlight): if extra_debug: logger.debug(f'Highlight for {ref}') logger.debug(f' - Position {ToMM(m_pos.x)}, {ToMM(m_pos.y)}') - logger.debug(f' - Orientation {rot}') + logger.debug(f' - Orientation {rot} (Flipped: {m.IsFlipped()})') logger.debug(f' - Center {ToMM(m_cen.x)} {ToMM(m_cen.y)}') logger.debug(f' - w,h {ToMM(w)}, {ToMM(h)}') # Compute the offset @@ -768,6 +784,8 @@ def highlight_3D_models(self, board, highlight): rrot = math.radians(rot) # KiCad coordinates are inverted in the Y axis off_y = -off_y + if m.IsFlipped(): + off_x = -off_x # Apply the component rotation off_xp = off_x*math.cos(rrot)+off_y*math.sin(rrot) off_yp = -off_x*math.sin(rrot)+off_y*math.cos(rrot) @@ -817,25 +835,25 @@ def apply_footprint_variants(self, board, comps_hash): def filter_pcb_components(self, do_3D=False, do_2D=True, highlight=None): if not self.will_filter_pcb_components(): return False - self.comps_hash = self.get_refs_hash() + self._comps_hash = self.get_refs_hash() if self._sub_pcb: - self._sub_pcb.apply(self.comps_hash) + self._sub_pcb.apply(self._comps_hash) if self._comps: if do_2D: - self.apply_footprint_variants(GS.board, self.comps_hash) - self.cross_modules(GS.board, self.comps_hash) - self.remove_paste_and_glue(GS.board, self.comps_hash) + self.apply_footprint_variants(GS.board, self._comps_hash) + self.cross_modules(GS.board, self._comps_hash) + self.remove_paste_and_glue(GS.board, self._comps_hash) if hasattr(self, 'hide_excluded') and self.hide_excluded: - self.remove_fab(GS.board, self.comps_hash) + self.remove_fab(GS.board, self._comps_hash) # Copy any change in the schematic fields to the PCB properties # I.e. the value of a component so it gets updated in the *.Fab layer # Also useful for iBoM that can read the sch fields from the PCB - self.sch_fields_to_pcb(GS.board, self.comps_hash) + self.sch_fields_to_pcb(GS.board, self._comps_hash) if do_3D: # Disable the models that aren't for this variant self.apply_3D_variant_aspect(GS.board) # Remove the 3D models for not fitted components (also rename) - self.remove_3D_models(GS.board, self.comps_hash) + self.remove_3D_models(GS.board, self._comps_hash) # Highlight selected components self.highlight_3D_models(GS.board, highlight) return True @@ -843,22 +861,22 @@ def filter_pcb_components(self, do_3D=False, do_2D=True, highlight=None): def unfilter_pcb_components(self, do_3D=False, do_2D=True): if not self.will_filter_pcb_components(): return - if do_2D and self.comps_hash: - self.uncross_modules(GS.board, self.comps_hash) - self.restore_paste_and_glue(GS.board, self.comps_hash) + if do_2D and self._comps_hash: + self.uncross_modules(GS.board, self._comps_hash) + self.restore_paste_and_glue(GS.board, self._comps_hash) if hasattr(self, 'hide_excluded') and self.hide_excluded: - self.restore_fab(GS.board, self.comps_hash) + self.restore_fab(GS.board, self._comps_hash) # Restore the PCB properties and values self.restore_sch_fields_to_pcb(GS.board) - if do_3D and self.comps_hash: + if do_3D and self._comps_hash: # Undo the removing (also rename) - self.restore_3D_models(GS.board, self.comps_hash) + self.restore_3D_models(GS.board, self._comps_hash) # Re-enable the modules that aren't for this variant self.apply_3D_variant_aspect(GS.board, enable=True) # Remove the highlight 3D object self.unhighlight_3D_models(GS.board) if self._sub_pcb: - self._sub_pcb.revert(self.comps_hash) + self._sub_pcb.revert(self._comps_hash) def set_title(self, title, sch=False): self.old_title = None @@ -887,7 +905,7 @@ def restore_title(self, sch=False): def sch_fields_to_pcb(self, board, comps_hash): """ Change the module/footprint data according to the filtered fields. iBoM can parse it. """ - self.sch_fields_to_pcb_bkp = {} + self._sch_fields_to_pcb_bkp = {} has_GetFPIDAsString = False first = True for m in GS.get_modules_board(board): @@ -906,7 +924,7 @@ def sch_fields_to_pcb(self, board, comps_hash): m.SetValue(fields['Value']) if has_GetFPIDAsString: m.SetFPIDAsString(fields['Footprint']) - self.sch_fields_to_pcb_bkp[ref] = (old_value, old_fields, old_fp) + self._sch_fields_to_pcb_bkp[ref] = (old_value, old_fields, old_fp) self._has_GetFPIDAsString = has_GetFPIDAsString def restore_sch_fields_to_pcb(self, board): @@ -914,7 +932,7 @@ def restore_sch_fields_to_pcb(self, board): has_GetFPIDAsString = self._has_GetFPIDAsString for m in GS.get_modules_board(board): ref = m.GetReference() - data = self.sch_fields_to_pcb_bkp.get(ref, None) + data = self._sch_fields_to_pcb_bkp.get(ref, None) if data is not None: m.SetValue(data[0]) if has_GetFPIDAsString: @@ -1049,7 +1067,7 @@ def exec_with_retry(self, cmd, exit_with): if self._files_to_remove: self.remove_temporals() - def run(self, output_dir): + def load_list_components(self): """ Makes the list of components available """ self._files_to_remove = [] if not self.dnf_filter and not self.variant and not self.pre_transform: @@ -1069,12 +1087,15 @@ def run(self, output_dir): self._sub_pcb = self.variant._sub_pcb self._comps = comps + def run(self, output_dir): + self.load_list_components() + # The following 5 members are used by 2D and 3D renderers def setup_renderer(self, components, active_components): """ Setup the options to use it as a renderer """ self._show_all_components = False self._filters_to_expand = False - self.highlight = self.solve_kf_filters([c for c in active_components if c]) + self._highlight = self.solve_kf_filters([c for c in active_components if c]) self.show_components = [c for c in components if c] if self.show_components: self._show_components_raw = self.show_components @@ -1084,7 +1105,7 @@ def save_renderer_options(self): """ Save the current renderer settings """ self.old_filters_to_expand = self._filters_to_expand self.old_show_components = self.show_components - self.old_highlight = self.highlight + self.old_highlight = self._highlight self.old_dir = self._parent.dir self.old_done = self._parent._done @@ -1092,7 +1113,7 @@ def restore_renderer_options(self): """ Restore the renderer settings """ self._filters_to_expand = self.old_filters_to_expand self.show_components = self.old_show_components - self.highlight = self.old_highlight + self._highlight = self.old_highlight self._parent.dir = self.old_dir self._parent._done = self.old_done @@ -1142,9 +1163,8 @@ def __init__(self): @staticmethod def solve(margin): - if isinstance(margin, type): - return (0, 0, 0, 0) if isinstance(margin, PcbMargin): - return (GS.from_mm(margin.left), GS.from_mm(margin.right), GS.from_mm(margin.top), GS.from_mm(margin.bottom)) + return ((GS.from_mm(margin.left), GS.from_mm(margin.right), GS.from_mm(margin.top), GS.from_mm(margin.bottom)), + margin) margin = GS.from_mm(margin) - return (margin, margin, margin, margin) + return (margin, margin, margin, margin), margin diff --git a/kibot/out_base_3d.py b/kibot/out_base_3d.py index d36a66b6f..225b35805 100644 --- a/kibot/out_base_3d.py +++ b/kibot/out_base_3d.py @@ -444,7 +444,7 @@ def replace_model(self, replace, m3d, force_wrl, is_copy_mode, rename_function, self.source_models.add(replace) old_name = m3d.m_Filename new_name = self.wrl_name(replace, force_wrl) if not is_copy_mode else rename_function(rename_data, replace) - self.undo_3d_models[new_name] = old_name + self._undo_3d_models[new_name] = old_name m3d.m_Filename = new_name self.models_replaced = True @@ -452,7 +452,7 @@ def download_models(self, rename_filter=None, rename_function=None, rename_data= """ Check we have the 3D models. Inform missing models. Try to download the missing models - Stores changes in self.undo_3d_models_rep """ + Stores changes in self._undo_3d_models_rep """ self.models_replaced = False # Load KiCad configuration so we can expand the 3D models path KiConf.init(GS.pcb_file) @@ -586,7 +586,7 @@ class Base3DOptionsWithHL(Base3DOptions): def __init__(self): with document: self.show_components = Optionable - """ *[list(string)|string=all] [none,all] List of components to draw, can be also a string for `none` or `all`. + """ *[list(string)|string='all'] [none,all,*] List of components to draw, can be also a string for `none` or `all`. Ranges like *R5-R10* are supported. Unlike the `pcbdraw` output, the default is `all` """ self.highlight = Optionable @@ -603,26 +603,21 @@ def config(self, parent): # List of components self._show_all_components = False self._show_components_raw = self.show_components - if isinstance(self.show_components, str): - if self.show_components == 'all': + if len(self.show_components) == 1 and self.show_components[0] in {'all', 'none'}: + if self.show_components[0] == 'all': self._show_all_components = True - self.show_components = [] - elif isinstance(self.show_components, type): - # Default is all - self._show_all_components = True + else: # if self.show_components[0] == 'none': + self.show_components = [] else: # a list self.show_components = self.solve_kf_filters(self.show_components) # Highlight - if isinstance(self.highlight, type): - self.highlight = None - else: - self.highlight = self.solve_kf_filters(self.highlight) + self._highlight = self.solve_kf_filters(self.highlight) def copy_options(self, ref): """ Copy its options from another similar object """ super().copy_options(ref) self.show_components = ref.show_components - self.highlight = ref.highlight + self._highlight = ref._highlight self.highlight_padding = ref.highlight_padding self.highlight_on_top = ref.highlight_on_top self._filters_to_expand = ref._filters_to_expand diff --git a/kibot/out_blender_export.py b/kibot/out_blender_export.py index 56d1c98aa..80268a552 100644 --- a/kibot/out_blender_export.py +++ b/kibot/out_blender_export.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2023 Salvador E. Tropea -# Copyright (c) 2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2023-2024 Salvador E. Tropea +# Copyright (c) 2023-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) """ Dependencies: @@ -18,7 +18,7 @@ from .error import KiPlotConfigurationError from .kiplot import get_output_targets, run_output, run_command, register_xmp_import, config_output, configure_and_run from .gs import GS -from .misc import MISSING_TOOL, BLENDER_ERROR +from .misc import BLENDER_ERROR, MISSING_TOOL from .optionable import Optionable, BaseOptions from .out_base_3d import Base3D, Base3DOptionsWithHL from .registrable import RegOutput @@ -50,7 +50,7 @@ def __init__(self): self.cut_boards = True """ Separate the sub-PCBs in separated 3D models """ self.texture_dpi = 1016.0 - """ [508-2032] Texture density in dots per inch """ + """ [508,2032] Texture density in dots per inch """ self.center = True """ Center the PCB at the coordinates origin """ self.enhance_materials = True @@ -67,6 +67,8 @@ def __init__(self): class BlenderOutputOptions(Optionable): """ What is generated """ + _default = [{'type': 'render'}] + def __init__(self): super().__init__() with document: @@ -85,6 +87,14 @@ def __init__(self): """ Subdirectory for this output """ self._unknown_is_error = True + def __str__(self): + txt = self.type + if self.dir: + txt += f' ({self.dir})' + if self.output != GS.def_global_output: + txt += f' ({self.output})' + return txt + class BlenderObjOptions(Optionable): """ A light/camera in the scene. """ @@ -94,11 +104,11 @@ def __init__(self): self.name = "" """ Name for the """ self.pos_x = 0 - """ [number|string] X position [m]. You can use `width`, `height` and `size` for PCB dimensions """ + """ [number|string=0] X position [m]. You can use `width`, `height` and `size` for PCB dimensions """ self.pos_y = 0 - """ [number|string] Y position [m]. You can use `width`, `height` and `size` for PCB dimensions """ + """ [number|string=0] Y position [m]. You can use `width`, `height` and `size` for PCB dimensions """ self.pos_z = 0 - """ [number|string] Z position [m]. You can use `width`, `height` and `size` for PCB dimensions """ + """ [number|string=0] Z position [m]. You can use `width`, `height` and `size` for PCB dimensions """ self._unknown_is_error = True def solve(self, member): @@ -114,13 +124,18 @@ def solve(self, member): def config(self, parent): super().config(parent) self._width, self._height, self._size = get_board_size() - self.pos_x = self.solve('pos_x') - self.pos_y = self.solve('pos_y') - self.pos_z = self.solve('pos_z') + self._pos_x = self.solve('pos_x') + self._pos_y = self.solve('pos_y') + self._pos_z = self.solve('pos_z') + + def __str__(self): + return f'{self.name} ({self.pos_x},{self.pos_y},{self.pos_z})' class BlenderLightOptions(BlenderObjOptions): """ A light in the scene. """ + _default = [{'name': 'kibot_light', 'pos_x': '-size*3.33', 'pos_y': 'size*3.33', 'pos_z': 'size*5', 'energy': 0}] + def __init__(self): super().__init__() with document: @@ -133,9 +148,9 @@ def __init__(self): def adjust(self): self._width, self._height, self._size = get_board_size() if not self.get_user_defined('pos_x') and not self.get_user_defined('pos_y') and not self.get_user_defined('pos_z'): - self.pos_x = -self._size*3.33 - self.pos_y = self._size*3.33 - self.pos_z = self._size*5.0 + self._pos_x = -self._size*3.33 + self._pos_y = self._size*3.33 + self._pos_z = self._size*5.0 if self.energy == 0: if self.type == "POINT": # 10 W is the default, works for 5 cm board, we make it grow cudratically @@ -205,7 +220,7 @@ def __init__(self): class BlenderPointOfViewOptions(Optionable): """ Point of View parameters """ _views = {'top': 'z', 'bottom': 'Z', 'front': 'y', 'rear': 'Y', 'right': 'x', 'left': 'X'} - _rviews = {v: k for k, v in _views.items()} + _default = [{'view': 'top'}] def __init__(self): super().__init__() @@ -223,27 +238,34 @@ def __init__(self): """ String to differentiate the name of this point of view. When empty we use the `default_file_id` or the `view` """ self.steps = 1 - """ [1-1000] Generate this amount of steps using the rotation angles as increments. + """ [1,1000] Generate this amount of steps using the rotation angles as increments. Use a value of 1 (default) to interpret the angles as absolute. Used for animations. You should define the `default_file_id` to something like '_%03d' to get the animation frames """ self._unknown_is_error = True + self._view = 'z' def config(self, parent): super().config(parent) # View point - view = self._views.get(self.view, None) - if view is not None: - self.view = view + self._view = self._views.get(self.view, self.view) def get_view(self): - return self._rviews.get(self.view, 'no_view') + return self.view def increment(self, inc): self.rotate_x += inc.rotate_x self.rotate_y += inc.rotate_y self.rotate_z += inc.rotate_z + def __str__(self): + txt = self.view + if self.rotate_x or self.rotate_y or self.rotate_z: + txt += f' ({self.rotate_x},{self.rotate_y},{self.rotate_z})' + if self.steps != 1: + txt += f' {self.steps} steps' + return txt + class PCB3DExportOptions(Base3DOptionsWithHL): """ Options to generate the PCB3D file """ @@ -309,11 +331,11 @@ class Blender_ExportOptions(BaseOptions): def __init__(self): with document: self.pcb3d = PCB3DExportOptions - """ *[string|dict] Options to export the PCB to Blender. + """ *[string|dict={}] Options to export the PCB to Blender. You can also specify the name of the output that generates the PCB3D file. See the `PCB2Blender_2_1`, `PCB2Blender_2_7` and `PCB2Blender_2_1_haschtl` templates """ self.pcb_import = PCB2BlenderOptions - """ Options to configure how Blender imports the PCB. + """ [dict={}] Options to configure how Blender imports the PCB. The default values are good for most cases """ self.outputs = BlenderOutputOptions """ [dict|list(dict)] Outputs to generate in the same run """ @@ -323,7 +345,7 @@ def __init__(self): """ Add a default light when none specified. The default light is located at (-size*3.33, size*3.33, size*5) where size is max(width, height) of the PCB """ self.camera = BlenderCameraOptions - """ [dict] Options for the camera. + """ [dict={}] Options for the camera. If none specified KiBot will create a suitable camera. If no position is specified for the camera KiBot will look for a suitable position """ self.fixed_auto_camera = False @@ -336,7 +358,7 @@ def __init__(self): """ Default value for the `file_id` in the `point_of_view` options. Use something like '_%03d' for animations """ self.render_options = BlenderRenderOptions - """ *[dict] Controls how the render is done for the `render` output type """ + """ *[dict={}] Controls how the render is done for the `render` output type """ self.point_of_view = BlenderPointOfViewOptions """ *[dict|list(dict)] How the object is viewed by the camera """ super().__init__() @@ -349,33 +371,10 @@ def config(self, parent): if isinstance(self.pcb3d, str) and not self.pcb3d: raise KiPlotConfigurationError('You must specify the name of the output that' ' generates the PCB3D file or its options') - if isinstance(self.pcb3d, type): - self.pcb3d = PCB3DExportOptions() - self.pcb3d.config(self) - # Do we have outputs? - if isinstance(self.outputs, type): - self.outputs = [] - elif isinstance(self.outputs, BlenderOutputOptions): - # One, make a list - self.outputs = [self.outputs] - # Ensure we have import options - if isinstance(self.pcb_import, type): - self.pcb_import = PCB2BlenderOptions() - # Ensure we have a light - if isinstance(self.light, type): - # None - if self.add_default_light: - # Create one - light = BlenderLightOptions() - light.name = 'kibot_light' - light.adjust() - self.light = [light] - else: - # The dark ... - self.light = [] - elif isinstance(self.light, BlenderLightOptions): - # Ensure a list - self.light = [self.light] + # Check if the user doesn't want a light + if not self.get_user_defined('light') and not self.add_default_light: + # Remove the default light + self.light = [] # Check light names light_names = set() for li in self.light: @@ -386,22 +385,9 @@ def config(self, parent): id += 1 name = name+'_'+str(id) li.name = name - # If no camera let the script create one - if isinstance(self.camera, type): - self.camera = None - elif not self.camera.name: - self.camera.name = 'kibot_camera' - # Ensure we have some render options - if isinstance(self.render_options, type): - self.render_options = BlenderRenderOptions() - # Point of View, make sure we have a list and at least 1 element - if isinstance(self.point_of_view, type): - pov = BlenderPointOfViewOptions() - # Manually translate top -> z - pov.view = 'z' - self.point_of_view = [pov] - elif isinstance(self.point_of_view, BlenderPointOfViewOptions): - self.point_of_view = [self.point_of_view] + # Check the camera name + if not self.camera.name: + self.camera.name = 'kibot_camera' if self.get_user_defined('camera') else 'kibot_auto_camera' def get_output_filename(self, o, output_dir, pov, order): if o.type == 'render': @@ -564,6 +550,8 @@ def run(self, output): # Can be used to export the PCB to Blender if not self.outputs: return + outputs = self.outputs + point_of_view = self.point_of_view # Make sure Blender is available command = self._pcb3d.ensure_tool('Blender') if self.render_options.auto_crop: @@ -575,17 +563,18 @@ def run(self, output): scene = {} if self.light: lights = [{'name': light.name, - 'position': (light.pos_x, light.pos_y, light.pos_z), + 'position': (light._pos_x, light._pos_y, light._pos_z), 'type': light.type, 'energy': light.energy} for light in self.light] scene['lights'] = lights - if self.camera: + if self.get_user_defined('camera'): + # Only when the user defined a camera, otherwise let the script create a suitable one ca = self.camera scene['camera'] = {'name': ca.name, 'type': ca._type} if (hasattr(ca, '_pos_x_user_defined') or hasattr(ca, '_pos_y_user_defined') or hasattr(ca, '_pos_z_user_defined')): - scene['camera']['position'] = (ca.pos_x, ca.pos_y, ca.pos_z) + scene['camera']['position'] = (ca._pos_x, ca._pos_y, ca._pos_z) if ca.clip_start >= 0: scene['camera']['clip_start'] = ca.clip_start scene['fixed_auto_camera'] = self.fixed_auto_camera @@ -599,7 +588,7 @@ def run(self, output): 'background2': ro.background2} povs = [] last_pov = BlenderPointOfViewOptions() - for pov in self.point_of_view: + for pov in point_of_view: if pov.steps > 1: for _ in range(pov.steps): last_pov.increment(pov) @@ -641,16 +630,16 @@ def run(self, output): if self.render_options.no_denoiser: cmd.append('--no_denoiser') cmd.append('--format') - for pov in self.point_of_view: + for pov in point_of_view: for _ in range(pov.steps): - for o in self.outputs: + for o in outputs: cmd.append(o.type) cmd.append('--output') names = set() order = 1 - for pov in self.point_of_view: + for pov in point_of_view: for _ in range(pov.steps): - for o in self.outputs: + for o in outputs: name = self.get_output_filename(o, self._parent.output_dir, pov, order) if name in names: raise KiPlotConfigurationError('Repeated name (use `file_id`): '+name) @@ -664,9 +653,9 @@ def run(self, output): self.analyze_errors(run_command(cmd)) if self.render_options.auto_crop: order = 1 - for pov in self.point_of_view: + for pov in point_of_view: for _ in range(pov.steps): - for o in self.outputs: + for o in outputs: if o.type != 'render': continue name = self.get_output_filename(o, self._parent.output_dir, pov, order) @@ -690,7 +679,7 @@ def __init__(self): super().__init__() with document: self.options = Blender_ExportOptions - """ *[dict] Options for the `blender_export` output """ + """ *[dict={}] Options for the `blender_export` output """ self._category = 'PCB/3D' def get_dependencies(self): diff --git a/kibot/out_boardview.py b/kibot/out_boardview.py index 44bc1ab88..b7e974a22 100644 --- a/kibot/out_boardview.py +++ b/kibot/out_boardview.py @@ -6,8 +6,9 @@ # Project: KiBot (formerly KiPlot) # Adapted from: https://github.com/whitequark/kicad-boardview import re -from pcbnew import SHAPE_POLY_SET +from pcbnew import SHAPE_POLY_SET, PAD_SHAPE_CIRCLE from .gs import GS +from .misc import UI_SMD, UI_VIRTUAL from .out_base import VariantOptions from .macros import macros, document, output_class # noqa: F401 from . import log @@ -42,7 +43,7 @@ def natural_sort_key(s): for text in re.compile('([0-9]+)').split(s)]) -def convert(pcb, brd): +def convert_brd(pcb, brd, do_sort): # Board outline outlines = SHAPE_POLY_SET() if GS.ki5: @@ -87,8 +88,10 @@ def convert(pcb, brd): # Parts module_list = GS.get_modules() + if do_sort: + module_list = sorted(module_list, key=lambda mod: mod.GetReference()) modules = [] - for m in sorted(module_list, key=lambda mod: mod.GetReference()): + for m in module_list: if not skip_module(m): modules.append(m) @@ -128,8 +131,10 @@ def convert(pcb, brd): # Nails module_list = GS.get_modules() + if do_sort: + module_list = sorted(module_list, key=lambda mod: mod.GetReference()) testpoints = [] - for m in sorted(module_list, key=lambda mod: mod.GetReference()): + for m in module_list: if not skip_module(m, tp=True): pads_list = m.Pads() for pad in sorted(pads_list, key=lambda pad: natural_sort_key(pad.GetName())): @@ -148,21 +153,130 @@ def convert(pcb, brd): brd.write("\n") +def get_type_name(m): + if GS.ki5: + attrs = m.GetAttributes() + if attrs == UI_SMD: + return 'SMD' + if attrs == UI_VIRTUAL: + return 'VIRTUAL' + return 'THT' + return m.GetTypeName() + + +def convert_bvr(pcb, bvr): + bvr.write("BVRAW_FORMAT_3\n") + + outlines = SHAPE_POLY_SET() + if GS.ki5: + pcb.GetBoardPolygonOutlines(outlines, "") + outline = outlines.Outline(0) + outline_points = [outline.Point(n) for n in range(outline.PointCount())] + else: + pcb.GetBoardPolygonOutlines(outlines) + outline = outlines.Outline(0) + outline_points = [outline.GetPoint(n) for n in range(outline.GetPointCount())] + max((p.x for p in outline_points)) + outline_maxy = max((p.y for p in outline_points)) + + module_list = GS.get_modules() + modules = [] + for module in module_list: + if not skip_module(module): + modules.append(module) + + ref = module.GetReference() + flipped = module.IsFlipped() + side = "B" if flipped else "T" + mount = get_type_name(module) + pads_list = module.Pads() + + bvr.write("\n") + bvr.write(f"PART_NAME {ref}\n") + bvr.write(f" PART_SIDE {side}\n") + bvr.write(" PART_ORIGIN 0.000 0.000\n") + bvr.write(f" PART_MOUNT {mount}\n") + bvr.write("\n") + + for pad in sorted(pads_list, key=lambda pad: natural_sort_key(pad.GetName())): + pin_num = pad.GetName() if GS.ki5 else pad.GetNumber() + net = pad.GetNetname() + pad_bbox = pad.GetBoundingBox() + pad_size = pad.GetSize() + + x_center = (pad_bbox.GetLeft() + pad_bbox.GetRight()) / 2 + y_center = (pad_bbox.GetTop() + pad_bbox.GetBottom()) / 2 + x = coord(x_center) + y = y_coord(outline_maxy, y_center, flipped) + + if flipped: + y = coord(outline_maxy - y_center) + + if pad.GetShape() == PAD_SHAPE_CIRCLE: + radius = coord(pad_size.x / 1.6) + else: + smaller_dimension = min(pad_size.x, pad_size.y) + radius = coord(smaller_dimension / 1.6) + + bvr.write(f" PIN_ID {ref}-{pin_num}\n") + bvr.write(f" PIN_NUMBER {pin_num}\n") + bvr.write(f" PIN_NAME {pin_num}\n") + bvr.write(f" PIN_SIDE {side}\n") + bvr.write(f" PIN_ORIGIN {x} {y}\n") + bvr.write(f" PIN_RADIUS {radius}\n") + bvr.write(f" PIN_NET {net}\n") + bvr.write(" PIN_TYPE 2\n") + bvr.write(" PIN_COMMENT\n") + bvr.write(" PIN_END\n") + bvr.write("\n") + + bvr.write("PART_END\n") + bvr.write("\n") + + first_point = outline_points[0] + outline_pts = "" + + for point in outline_points: + x = coord(point.x) + y = y_coord(outline_maxy, point.y, False) + outline_pts += (f"{x} {y} ") + + x = coord(first_point.x) + y = y_coord(outline_maxy, first_point.y, False) + outline_pts += (f"{x} {y}") + + bvr.write("OUTLINE_POINTS ") + bvr.write(outline_pts) + + class BoardViewOptions(VariantOptions): def __init__(self): with document: self.output = GS.def_global_output - """ *Filename for the output (%i=boardview, %x=brd) """ + """ *Filename for the output (%i=boardview, %x=brd/brv) """ + self.sorted = True + """ Sort components by reference. Disable this option to get a file closer to what + kicad-boardview generates """ + self.format = 'BRD' + """ [BRD,BVR] Format used for the generated file. The BVR file format is bigger but keeps + more information, like alphanumeric pin names """ super().__init__() self._expand_id = 'boardview' self._expand_ext = 'brd' self.help_only_sub_pcbs() + def config(self, parent): + super().config(parent) + self._expand_ext = self.format.lower() + def run(self, output): super().run(output) self.filter_pcb_components() with open(output, 'wt') as f: - convert(GS.board, f) + if self.format == 'BRD': + convert_brd(GS.board, f, self.sorted) + else: + convert_bvr(GS.board, f) self.unfilter_pcb_components() def get_targets(self, out_dir): @@ -180,7 +294,7 @@ def __init__(self): self._category = ['PCB/repair', 'PCB/fabrication/assembly'] with document: self.options = BoardViewOptions - """ *[dict] Options for the `boardview` output """ + """ *[dict={}] Options for the `boardview` output """ @staticmethod def get_conf_examples(name, layers): diff --git a/kibot/out_bom.py b/kibot/out_bom.py index 2bc5e69a9..edfa03677 100644 --- a/kibot/out_bom.py +++ b/kibot/out_bom.py @@ -73,14 +73,14 @@ def __init__(self, field=None): super().__init__() if field: self.field = field.lower() - self.text = None - self.text_before = '' - self.text_after = '' + self.text = self._text = None + self.text_before = self._text_before = '' + self.text_after = self._text_after = '' return self._unknown_is_error = True with document: self.field = '' - """ *Name of the field """ + """ *{no_case} Name of the field """ self.text = '' """ Text to use instead of a field. This option is incompatible with the `field` option. Any space to separate it should be added in the text. @@ -109,25 +109,24 @@ def config(self, parent): if self.field and self.text: raise KiPlotConfigurationError("You can't specify a `field` and a `text` in a join list ({})". format(str(self._tree))) - self.field = self.field.lower() if self.text_before is None: self.text_before = '' if self.text_after is None: self.text_after = '' - self.text = self.unescape(self.text) - self.text_before = self.unescape(self.text_before) - self.text_after = self.unescape(self.text_after) + self._text = self.unescape(self.text) + self._text_before = self.unescape(self.text_before) + self._text_after = self.unescape(self.text_after) def get_text(self, field_getter): - if self.text: - return self.text + if self._text: + return self._text value = field_getter(self.field) if not value: return None - separator = '' if self.text_before else ' ' - return separator + self.text_before + value + self.text_after + separator = '' if self._text_before else ' ' + return separator + self._text_before + value + self._text_after - def __repr__(self): + def __str__(self): if self.text: return '`{}`'.format(self.text) return '`{}`+{}+`{}`'.format(self.text_before, self.field, self.text_after) @@ -153,6 +152,12 @@ def __init__(self): self._field_example = 'Row' self._name_example = 'Line' + def __str__(self): + txt = f'{self.name} ({self.field})' if self.name else self.field + if self.join: + txt += f' {self.join}' + return txt + def config(self, parent): super().config(parent) if not self.field: @@ -161,14 +166,7 @@ def config(self, parent): field = self.field.lower() # Ensure this is None or a list # Also arrange it as field, cols... - if isinstance(self.join, type): - self.join = None - elif isinstance(self.join, str): - if self.join: - self.join = [field, BoMJoinField(self.join)] - else: - self.join = None - else: + if self.join: join = [field] for c in self.join: if isinstance(c, str): @@ -200,10 +198,12 @@ def config(self, parent): self.validate_colors(['color']) if not self.description: raise KiPlotConfigurationError('You must add a description for a colored row') - if isinstance(self.filter, type): - raise KiPlotConfigurationError('You must provide a filter to match the rows') self.filter = BaseFilter.solve_filter(self.filter, 'colored rows') + def __str__(self): + desc = self.description if self.description else 'No description' + return f'`{desc}` ({self.color}) {self.filter}' + class BoMLinkable(Optionable): """ Base class for HTML and XLSX formats """ @@ -213,13 +213,13 @@ def __init__(self): self.col_colors = True """ Use colors to show the field type """ self.datasheet_as_link = '' - """ *Column with links to the datasheet """ + """ *{no_case} Column with links to the datasheet """ self.digikey_link = Optionable - """ [string|list(string)=''] Column/s containing Digi-Key part numbers, will be linked to web page """ + """ [string|list(string)=''] {no_case} Column/s containing Digi-Key part numbers, will be linked to web page """ self.mouser_link = Optionable - """ [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page """ + """ [string|list(string)=''] {no_case} Column/s containing Mouser part numbers, will be linked to web page """ self.lcsc_link = Optionable - """ [boolean|string|list(string)=''] Column/s containing LCSC part numbers, will be linked to web page. + """ [boolean|string|list(string)=''] {no_case} Column/s containing LCSC part numbers, will be linked to web page. Use **true** to copy the value indicated by the `field_lcsc_part` global option """ self.generate_dnf = True """ *Generate a separated section for DNF (Do Not Fit) components """ @@ -239,33 +239,21 @@ def __init__(self): self.extra_info = Optionable """ [string|list(string)=''] Information to put after the title and before the pcb and stats info """ self.row_colors = RowColors - """ [list(dict)] Used to highlight rows using filters. Rows that match a filter can be colored. + """ [list(dict)=[]] Used to highlight rows using filters. Rows that match a filter can be colored. Note that these rows won't have colored columns """ def config(self, parent): super().config(parent) - # *_link - self.digikey_link = self.force_list(self.digikey_link, comma_sep=False, lower_case=True) - self.mouser_link = self.force_list(self.mouser_link, comma_sep=False, lower_case=True) if isinstance(self.lcsc_link, bool): - self.lcsc_link = self.field_lcsc_part if self.lcsc_link else '' - self.lcsc_link = self.force_list(self.lcsc_link, comma_sep=False, lower_case=True) + self.lcsc_link = [self.solve_field_name('_field_lcsc_part')] if self.lcsc_link else [] # Logo - if isinstance(self.logo, type): - self.logo = '' - elif isinstance(self.logo, bool): + if isinstance(self.logo, bool): self.logo = '' if self.logo else None elif self.logo: - self.logo = os.path.abspath(self.logo) + if not os.path.isabs(self.logo): + self.logo = os.path.abspath(os.path.expandvars(os.path.expanduser(self.logo))) if not os.path.isfile(self.logo): raise KiPlotConfigurationError('Missing logo file `{}`'.format(self.logo)) - # Extra info lines - self.extra_info = Optionable.force_list(self.extra_info, comma_sep=False) - # Datasheet as link - self.datasheet_as_link = self.datasheet_as_link.lower() - # Row colors - if isinstance(self.row_colors, type): - self.row_colors = [] class BoMHTML(BoMLinkable): @@ -356,9 +344,9 @@ def __init__(self): """ *Enable KiCost worksheet creation. Note: an example of how to use it on CI/CD can be found [here](https://github.com/set-soft/kicost_ci_test) """ self.kicost_api_enable = Optionable - """ [string|list(string)=''] List of KiCost APIs to enable """ + """ [string|list(string)=''] {comma_sep} List of KiCost APIs to enable """ self.kicost_api_disable = Optionable - """ [string|list(string)=''] List of KiCost APIs to disable """ + """ [string|list(string)=''] {comma_sep} List of KiCost APIs to disable """ self.kicost_dist_desc = False """ Used to add a column with the distributor's description. So you can check this is the right component """ self.kicost_config = '' @@ -371,16 +359,15 @@ def __init__(self): """ *Enable Specs worksheet creation. Contains specifications for the components. Works with only some KiCost APIs """ self.specs_columns = BoMColumns - """ [list(dict)|list(string)] Which columns are included in the Specs worksheet. Use `References` for the + """ [list(dict)|list(string)=[]] Which columns are included in the Specs worksheet. Use `References` for the references, 'Row' for the order and 'Sep' to separate groups at the same level. By default all are included. Column names are distributor specific, the following aren't: '_desc', '_value', '_tolerance', '_footprint', - '_power', '_current', '_voltage', '_frequency', '_temp_coeff', '_manf', '_size' """ + '_power', '_current', '_voltage', '_frequency', '_temp_coeff', '_manf', '_size'. + Note that an empty list means all available specs, use `specs` options to disable it """ self.logo_scale = 2 """ Scaling factor for the logo. Note that this value isn't honored by all spreadsheet software """ def process_columns_config(self, cols): - if isinstance(cols, type): - return (None, None, None, None, None) columns = [] column_levels = [] column_comments = [] @@ -426,34 +413,21 @@ def config(self, parent): raise KiPlotConfigurationError('Missing KiCost configuration file `{}`'.format(self.kicost_config)) if not self.kicost_config: self.kicost_config = None - # KiCost APIs - self.kicost_api_enable = Optionable.force_list(self.kicost_api_enable) - self.kicost_api_disable = Optionable.force_list(self.kicost_api_disable) # Specs columns - (self.s_columns, self.s_levels, self.s_comments, self.s_rename, - self.s_join) = self.process_columns_config(self.specs_columns) + if self.specs_columns: + (self.s_columns, self.s_levels, self.s_comments, self.s_rename, + self.s_join) = self.process_columns_config(self.specs_columns) + else: + self.s_columns = self.s_levels = self.s_comments = self.s_rename = self.s_join = None class ComponentAliases(Optionable): _default = DEFAULT_ALIASES - def __init__(self): - super().__init__() - class GroupFields(Optionable): _default = ColumnList.DEFAULT_GROUPING + ['voltage', 'tolerance', 'current', 'power'] - def __init__(self): - super().__init__() - - -class NoConflict(Optionable): - _default = "['Config', 'Part']" - - def __init__(self): - super().__init__() - class Aggregate(Optionable): def __init__(self): @@ -469,6 +443,7 @@ def __init__(self): """ Number of boards to build (components multiplier). Use negative to subtract """ self.delimiter = ',' """ Delimiter used for CSV files """ + self._file_example = 'another_schematic.kicad_sch' def config(self, parent): super().config(parent) @@ -477,34 +452,40 @@ def config(self, parent): if not self.name: self.name = os.path.splitext(os.path.basename(self.file))[0] + def __str__(self): + return f'{self.name} ({self.file})' + class BoMOptions(BaseOptions): def __init__(self): with document: self.number = 1 """ *Number of boards to build (components multiplier) """ - self.variant = '' - """ Board variant, used to determine which components - are output to the BoM. """ + self.variant = '_kibom_simple' + """ Board variant, used to determine which components are output to the BoM. + The `_kibom_simple` variant is a KiBoM variant without any filters and it provides some basic + compatibility with KiBoM. Note that this output has default filters that behaves like KiBoM. + The combination between the default for this option and the defaults for the filters provides + a behavior that mimics KiBoM default behavior """ self.output = GS.def_global_output """ *filename for the output (%i=bom)""" - self.format = '' - """ *[HTML,CSV,TXT,TSV,XML,XLSX,HRTXT] format for the BoM. - Defaults to CSV or a guess according to the options. + self.format = 'Auto' + """ *[HTML,CSV,TXT,TSV,XML,XLSX,HRTXT,Auto] format for the BoM. + `Auto` defaults to CSV or a guess according to the options. HRTXT stands for Human Readable TeXT """ # Equivalent to KiBoM INI: self.ignore_dnf = True """ *Exclude DNF (Do Not Fit) components """ - self.fit_field = 'Config' - """ Field name used for internal filters (not for variants) """ + self.fit_field = 'config' + """ {no_case} Field name used for internal filters (not for variants) """ self.use_alt = False """ Print grouped references in the alternate compressed style eg: R1-R7,R18 """ self.columns = BoMColumns - """ *[list(dict)|list(string)] List of columns to display. + """ *[list(dict)|list(string)=?] List of columns to display. Can be just the name of the field. In addition to all user defined fields you have various special columns, consult :ref:`bom_columns` """ self.cost_extra_columns = BoMColumns - """ [list(dict)|list(string)] List of columns to add to the global section of the cost. + """ [list(dict)|list(string)=[]] List of columns to add to the global section of the cost. Can be just the name of the field """ self.normalize_values = False """ *Try to normalize the R, L and C values, producing uniform units and prefixes """ @@ -513,16 +494,16 @@ def __init__(self): self.ref_separator = ' ' """ Separator used for the list of references """ self.html = BoMHTML - """ *[dict] Options for the HTML format """ + """ *[dict={}] Options for the HTML format """ self.xlsx = BoMXLSX - """ *[dict] Options for the XLSX format """ + """ *[dict={}] Options for the XLSX format """ self.csv = BoMCSV - """ *[dict] Options for the CSV, TXT and TSV formats """ + """ *[dict={}] Options for the CSV, TXT and TSV formats """ self.hrtxt = BoMTXT - """ *[dict] Options for the HRTXT formats """ + """ *[dict={}] Options for the HRTXT formats """ # * Filters self.pre_transform = Optionable - """ [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. + """ [string|list(string)='_null'] Name of the filter to transform fields before applying other filters. This option is for simple cases, consider using a full variant for complex cases """ self.exclude_filter = Optionable """ [string|list(string)='_mechanical'] Name of the filter to exclude components from BoM processing. @@ -530,11 +511,11 @@ def __init__(self): Please consult the built-in filters explanation to fully understand what is excluded by default. This option is for simple cases, consider using a full variant for complex cases """ self.dnf_filter = Optionable - """ [string|list(string)='_kibom_dnf'] Name of the filter to mark components as 'Do Not Fit'. + """ [string|list(string)='_kibom_dnf_CONFIG_FIELD'] Name of the filter to mark components as 'Do Not Fit'. The default filter marks components with a DNF value or DNF in the Config field. This option is for simple cases, consider using a full variant for complex cases """ self.dnc_filter = Optionable - """ [string|list(string)='_kibom_dnc'] Name of the filter to mark components as 'Do Not Change'. + """ [string|list(string)='_kibom_dnc_CONFIG_FIELD'] Name of the filter to mark components as 'Do Not Change'. The default filter marks components with a DNC value or DNC in the Config field. This option is for simple cases, consider using a full variant for complex cases """ # * Grouping criteria @@ -545,7 +526,7 @@ def __init__(self): self.merge_both_blank = True """ When creating groups two components with empty/missing field will be interpreted as with the same value """ self.group_fields = GroupFields - """ *[list(string)] List of fields used for sorting individual components into groups. + """ *[list(string)] {no_case} List of fields used for sorting individual components into groups. Components which match (comparing *all* fields) will be grouped together. Field names are case-insensitive. For empty fields the behavior is defined by the `group_fields_fallbacks`, `merge_blank_fields` and @@ -556,7 +537,7 @@ def __init__(self): If empty: ['Part', 'Part Lib', 'Value', 'Footprint', 'Footprint Lib', . 'Voltage', 'Tolerance', 'Current', 'Power'] is used """ self.group_fields_fallbacks = Optionable - """ [list(string)] List of fields to be used when the fields in `group_fields` are empty. + """ [list(string)=[]] {no_case} List of fields to be used when the fields in `group_fields` are empty. The first field in this list is the fallback for the first in `group_fields`, and so on """ self.component_aliases = ComponentAliases """ [list(list(string))] A series of values which are considered to be equivalent for the part name. @@ -574,13 +555,13 @@ def __init__(self): Note that this implies that *1k 1%* is the same as *1k 5%*. If you really need to group using the extra information split it in separated fields, add the fields to `group_fields` and disable `merge_blank_fields` """ - self.no_conflict = NoConflict - """ [list(string)] List of fields where we tolerate conflicts. + self.no_conflict = Optionable + """ [list(string)=?] {no_case} List of fields where we tolerate conflicts. Use it to avoid undesired warnings. By default the field indicated in `fit_field`, the field used for variants and the field `part` are excluded """ self.aggregate = Aggregate - """ [list(dict)] Add components from other projects. + """ [list(dict)=[]] Add components from other projects. You can use CSV files, the first row must contain the names of the fields. The `Reference` and `Value` are mandatory, in most cases `Part` is also needed. The `Part` column should contain the name/type of the component. This is important for @@ -593,9 +574,10 @@ def __init__(self): self.int_qtys = True """ Component quantities are always expressed as integers. Using the ceil() function """ self.distributors = Optionable - """ [string|list(string)] Include this distributors list. Default is all the available """ + """ [string|list(string)=[]] {comma_sep} Include this distributors list. Default is all the available """ self.no_distributors = Optionable - """ [string|list(string)] Exclude this distributors list. They are removed after computing `distributors` """ + """ [string|list(string)=[]] {comma_sep} Exclude this distributors list. + They are removed after computing `distributors` """ self.count_smd_tht = False """ Show the stats about how many of the components are SMD/THT. You must provide the PCB """ self.units = 'millimeters' @@ -610,9 +592,9 @@ def __init__(self): self.sort_style = 'type_value' """ *[type_value,type_value_ref,ref] Sorting criteria """ self.footprint_populate_values = Optionable - """ [string|list(string)='no,yes'] Values for the `Footprint Populate` column """ + """ [string|list(string)='no,yes'] {comma_sep} {L:2} Values for the `Footprint Populate` column """ self.footprint_type_values = Optionable - """ [string|list(string)='SMD,THT,VIRTUAL'] Values for the `Footprint Type` column """ + """ [string|list(string)='SMD,THT,VIRTUAL'] {comma_sep} {L:3} Values for the `Footprint Type` column """ self.expand_text_vars = True """ Expand KiCad 6 text variables after applying all filters and variants. This is done using a **_expand_text_vars** filter. @@ -624,10 +606,8 @@ def __init__(self): self.exclude_marked_in_pcb = False """ Exclude components marked with *Exclude from BOM* in the PCB. This is a KiCad 6 option """ - self._format_example = 'CSV' - self._footprint_populate_values_example = 'no,yes' - self._footprint_type_values_example = 'SMD,THT,VIRTUAL' super().__init__() + self._no_conflict_example = ['Config', 'Part'] @staticmethod def _get_columns(): @@ -639,15 +619,15 @@ def _get_columns(): def _guess_format(self): """ Figure out the format """ - if not self.format: + if self.format == 'Auto': # If we have HTML options generate an HTML - if not isinstance(self.html, type): + if self.get_user_defined('html'): return 'html' # Same for XLSX - if not isinstance(self.xlsx, type): + if self.get_user_defined('xlsx'): return 'xlsx' # Same for HRTXT - if not isinstance(self.hrtxt, type): + if self.get_user_defined('hrtxt'): return 'hrtxt' # Default to a simple and common format: CSV return 'csv' @@ -656,175 +636,127 @@ def _guess_format(self): def _normalize_variant(self): """ Replaces the name of the variant by an object handling it. """ - self.variant = RegOutput.check_variant(self.variant) - if self.variant is None: - # If no variant is specified use the KiBoM variant class with basic functionality + if self.variant == '_kibom_simple': + # This is the default variant to get a basic KiBoM compatibility + # In particular: components that should go only to a particular variant will be excluded in this way self.variant = KiBoM() self.variant.config_field = self.fit_field self.variant.variant = [] self.variant.name = 'default' - # Delegate any filter to the variant - self.variant.set_def_filters(self.exclude_filter, self.dnf_filter, self.dnc_filter, self.pre_transform) - self.exclude_filter = self.dnf_filter = self.dnc_filter = self.pre_transform = None - self.variant.config(self) # Fill or adjust any detail + self.variant.config(self) + # Use our filters instead. + # If the user didn't specify them they have equivalent defaults to the ones we are removing + self.variant.clear_filters() + return + self.variant = RegOutput.check_variant(self.variant) - def process_columns_config(self, cols, valid_columns, extra_columns, add_all=True): + def process_columns_config(self, cols, valid_columns, extra_columns): column_rename = {} join = [] - if isinstance(cols, type): - if not add_all: - return ([], [], [], column_rename, join) - # If none specified make a list with all the possible columns. - # Here are some exceptions: - # Ignore the part and footprint library, also sheetpath and the Reference in singular - ignore = [ColumnList.COL_PART_LIB_L, ColumnList.COL_FP_LIB_L, ColumnList.COL_SHEETPATH_L, - ColumnList.COL_REFERENCE_L[:-1]] - if len(self.aggregate) == 0: - ignore.append(ColumnList.COL_SOURCE_BOM_L) - if self.number == 1: - # For one board avoid COL_GRP_BUILD_QUANTITY - ignore.append(ColumnList.COL_GRP_BUILD_QUANTITY_L) - # Exclude the particular columns - columns = [h for h in valid_columns if not h.lower() in ignore] - column_levels = [0]*len(columns) - column_comments = ['']*len(columns) - else: - columns = [] - column_levels = [] - column_comments = [] - # Ensure the column names are valid. - # Also create the rename and join lists. - # Lower case available columns (to check if valid) - valid_columns_l = {c.lower(): c for c in valid_columns + extra_columns} - logger.debug("Valid columns: {} ({})".format(valid_columns, len(valid_columns))) - # Create the different lists - for col in cols: - if isinstance(col, str): - # Just a string, add to the list of used - new_col = col - new_col_l = new_col.lower() - level = 0 - comment = '' - else: - # A complete entry - new_col = col.field - new_col_l = new_col.lower() - # A column rename - if col.name: - column_rename[new_col_l] = col.name - # Attach other columns - if col.join: - join.append(col.join) - level = col.level - comment = col.comment - # Check this is a valid column - if new_col_l not in valid_columns_l: - # The Field_Rename filter can change this situation: - # raise KiPlotConfigurationError('Invalid column name `{}`'.format(new_col)) - logger.warning(W_BADFIELD+'Invalid column name `{}`. Valid columns are {}.'. - format(new_col, list(valid_columns_l.values()))) - columns.append(new_col) - column_levels.append(level) - column_comments.append(comment) + columns = [] + column_levels = [] + column_comments = [] + # Ensure the column names are valid. + # Also create the rename and join lists. + # Lower case available columns (to check if valid) + valid_columns_l = {c.lower(): c for c in valid_columns + extra_columns} + logger.debug("Valid columns: {} ({})".format(valid_columns, len(valid_columns))) + # Create the different lists + for col in cols: + if isinstance(col, str): + # Just a string, add to the list of used + new_col = col + new_col_l = new_col.lower() + level = 0 + comment = '' + else: + # A complete entry + new_col = col.field + new_col_l = new_col.lower() + # A column rename + if col.name: + column_rename[new_col_l] = col.name + # Attach other columns + if col.join: + join.append(col.join) + level = col.level + comment = col.comment + # Check this is a valid column + if new_col_l not in valid_columns_l: + # The Field_Rename filter can change this situation: + # raise KiPlotConfigurationError('Invalid column name `{}`'.format(new_col)) + logger.warning(W_BADFIELD+'Invalid column name `{}`. Valid columns are {}.'. + format(new_col, list(valid_columns_l.values()))) + columns.append(new_col) + column_levels.append(level) + column_comments.append(comment) return (columns, column_levels, column_comments, column_rename, join) def config(self, parent): super().config(parent) - self.format = self._guess_format() + self._format = self._guess_format() self._expand_id = 'bom' - self._expand_ext = 'txt' if self.format.lower() == 'hrtxt' else self.format.lower() - # HTML options - if self.format == 'html' and isinstance(self.html, type): - # If no options get the defaults - self.html = BoMHTML() - self.html.config(self) - # CSV options - if self.format in ['csv', 'tsv', 'txt'] and isinstance(self.csv, type): - # If no options get the defaults - self.csv = BoMCSV() - self.csv.config(self) - # HRTXT options - if self.format == 'hrtxt' and isinstance(self.hrtxt, type): - # If no options get the defaults - self.hrtxt = BoMTXT() - self.hrtxt.config(self) - # XLSX options - if self.format == 'xlsx' and isinstance(self.xlsx, type): - # If no options get the defaults - self.xlsx = BoMXLSX() - self.xlsx.config(self) + self._expand_ext = 'txt' if self._format == 'hrtxt' else self._format + # Variants, make it an object. Do it early because is needed by other initializations (i.e. title) + self._normalize_variant() # Do title %X and ${var} expansions on the BoMLinkable titles # Here because some variables needs our parent - if self.format == 'html' and self.html.title: + if self._format == 'html' and self.html.title: self.html.title = self.expand_filename_both(self.html.title, make_safe=False) self.html.extra_info = [self.expand_filename_both(t, make_safe=False) for t in self.html.extra_info] - if self.format == 'xlsx' and self.xlsx.title: + if self._format == 'xlsx' and self.xlsx.title: self.xlsx.title = self.expand_filename_both(self.xlsx.title, make_safe=False) self.xlsx.extra_info = [self.expand_filename_both(t, make_safe=False) for t in self.xlsx.extra_info] - # group_fields - if isinstance(self.group_fields, type): - self.group_fields = GroupFields.get_default() - else: - # Make the grouping fields lowercase - self.group_fields = [f.lower() for f in self.group_fields] - # group_fields_fallbacks - if isinstance(self.group_fields_fallbacks, type): - self.group_fields_fallbacks = [] - else: - # Make the grouping fields lowercase - self.group_fields_fallbacks = [f.lower() for f in self.group_fields_fallbacks] - # Fill with None if needed + # Fill with empty if needed if len(self.group_fields_fallbacks) < len(self.group_fields): - self.group_fields_fallbacks.extend([None]*(len(self.group_fields)-len(self.group_fields_fallbacks))) - # component_aliases - if isinstance(self.component_aliases, type): - self.component_aliases = DEFAULT_ALIASES + self.group_fields_fallbacks.extend(['']*(len(self.group_fields)-len(self.group_fields_fallbacks))) # Filters self.pre_transform = BaseFilter.solve_filter(self.pre_transform, 'pre_transform', is_transform=True) self.exclude_filter = BaseFilter.solve_filter(self.exclude_filter, 'exclude_filter') - self.dnf_filter = BaseFilter.solve_filter(self.dnf_filter, 'dnf_filter') - self.dnc_filter = BaseFilter.solve_filter(self.dnc_filter, 'dnc_filter') - # Variants, make it an object - self._normalize_variant() - # Field names are handled in lowercase - self.fit_field = self.fit_field.lower() + self.dnf_filter = BaseFilter.solve_filter(KiBoM.fix_dnx_filter(self.dnf_filter, self.fit_field), 'dnf_filter') + self.dnc_filter = BaseFilter.solve_filter(KiBoM.fix_dnx_filter(self.dnc_filter, self.fit_field), 'dnc_filter') # Fields excluded from conflict warnings - no_conflict = set() if isinstance(self.no_conflict, type): + no_conflict = set() no_conflict.add(self.fit_field) no_conflict.add('part') - var_field = self.variant.get_variant_field() + var_field = self.variant.get_variant_field() if self.variant else None if var_field is not None: - no_conflict.add(var_field) + no_conflict.add(var_field.lower()) else: - for field in self.no_conflict: - no_conflict.add(field.lower()) - self.no_conflict = no_conflict - # Make sure aggregate is a list - if isinstance(self.aggregate, type): - self.aggregate = [] - # List of distributors - self.distributors = Optionable.force_list(self.distributors) - self.no_distributors = Optionable.force_list(self.no_distributors) - # Column values - self.footprint_populate_values = Optionable.force_list(self.footprint_populate_values) - if not self.footprint_populate_values: - self.footprint_populate_values = ['no', 'yes'] - if len(self.footprint_populate_values) != 2: - raise KiPlotConfigurationError("The `footprint_populate_values` must contain two values ({})". - format(self.footprint_populate_values)) - self.footprint_type_values = Optionable.force_list(self.footprint_type_values) - if not self.footprint_type_values: - self.footprint_type_values = ['SMD', 'THT', 'VIRTUAL'] - if len(self.footprint_type_values) != 3: - raise KiPlotConfigurationError("The `footprint_type_values` must contain three values ({})". - format(self.footprint_type_values)) + no_conflict = set(self.no_conflict) + self._no_conflict = no_conflict # Columns (valid_columns, extra_columns) = self._get_columns() - (self.columns, self.column_levels, self.column_comments, self.column_rename, - self.join) = self.process_columns_config(self.columns, valid_columns, extra_columns) - (self.columns_ce, self.column_levels_ce, self.column_comments_ce, self.column_rename_ce, - self.join_ce) = self.process_columns_config(self.cost_extra_columns, valid_columns, extra_columns, add_all=False) + self.create_default_columns(valid_columns) + (self._columns, self._column_levels, self._column_comments, self._column_rename, + self._join) = self.process_columns_config(self.columns, valid_columns, extra_columns) + (self.columns_ce, self._column_levels_ce, self._column_comments_ce, self._column_rename_ce, + self._join_ce) = self.process_columns_config(self.cost_extra_columns, valid_columns, extra_columns) + + def create_default_columns(self, valid_columns): + if not isinstance(self.columns, type): + # Something defined + return + # If none specified make a list with all the possible columns. + # Here are some exceptions: + # Ignore the part and footprint library, also sheetpath and the Reference in singular + ignore = [ColumnList.COL_PART_LIB_L, ColumnList.COL_FP_LIB_L, ColumnList.COL_SHEETPATH_L, + ColumnList.COL_REFERENCE_L[:-1]] + if len(self.aggregate) == 0: + ignore.append(ColumnList.COL_SOURCE_BOM_L) + if self.number == 1: + # For one board avoid COL_GRP_BUILD_QUANTITY + ignore.append(ColumnList.COL_GRP_BUILD_QUANTITY_L) + # Exclude the particular columns + self.columns = [] + for col in valid_columns: + if col.lower() in ignore: + continue + c = BoMColumns() + # Here we set the values from a fake tree, note that we don't set self._tree because this isn't from the YAML + c.reconfigure({'field': col}, self) + self.columns.append(c) def get_ref_index(self, header, fname): ref_n = ColumnList.COL_REFERENCE_L @@ -932,10 +864,10 @@ def aggregate_comps(self, comps): prj.source = os.path.basename(prj.file) def solve_logo(self): - if self.format == 'html': + if self._format == 'html': logo = self.html.logo w = self.html.logo_width - elif self.format == 'xlsx': + elif self._format == 'xlsx': logo = self.xlsx.logo w = self.xlsx.logo_width else: @@ -949,14 +881,14 @@ def solve_logo(self): cmd = [self.ensure_tool('RSVG'), '-w', str(w), '-f', 'png', '-o', png, logo] run_command(cmd) self._old_logo = logo - if self.format == 'html': + if self._format == 'html': self.html.logo = png - elif self.format == 'xlsx': + elif self._format == 'xlsx': self.xlsx.logo = png return png def run(self, output): - format = self.format.lower() + format = self._format if format == 'xlsx': if self.xlsx.kicost: self.ensure_tool('KiCost') @@ -997,12 +929,16 @@ def run(self, output): apply_fitted_filter(comps, self.dnf_filter) apply_fixed_filter(comps, self.dnc_filter) # Apply the variant - comps = self.variant.filter(comps) + if self.variant: + comps = self.variant.filter(comps) # Now expand the text variables, the user can disable it and insert a customized filter # in the variant or even before. if self.expand_text_vars: comps = apply_pre_transform(comps, BaseFilter.solve_filter('_expand_text_vars', 'KiCad 6 text vars', is_transform=True)) + # We will manipulate the aggregate list, so we use a copy + real_aggregate = self.aggregate + self.aggregate = real_aggregate.copy() # We add the main project to the aggregate list so do_bom sees a complete list base_sch = Aggregate() base_sch.file = GS.sch_file @@ -1020,11 +956,12 @@ def run(self, output): except BoMError as e: raise KiPlotConfigurationError(str(e)) finally: + self.aggregate = real_aggregate if tmp_png: os.remove(tmp_png) - if self.format == 'html': + if self._format == 'html': self.html.logo = self._old_logo - elif self.format == 'xlsx': + elif self._format == 'xlsx': self.xlsx.logo = self._old_logo # Undo the reference prefix if self.ref_id: @@ -1052,7 +989,7 @@ def __init__(self): super().__init__() with document: self.options = BoMOptions - """ *[dict] Options for the `bom` output """ + """ *[dict={}] Options for the `bom` output """ self._sch_related = True self._category = 'Schematic/BoM' diff --git a/kibot/out_compress.py b/kibot/out_compress.py index 5b292bb40..679d44af9 100644 --- a/kibot/out_compress.py +++ b/kibot/out_compress.py @@ -54,6 +54,12 @@ def __init__(self): self.dest = '' """ Destination directory inside the archive, empty means the same of the file """ + def __str__(self): + txt = self.from_output if self.from_output else self.source + filter = f' (filter: `{self.filter}`)' if self.filter and self.filter != '.*' else '' + dest = f' -> {self.dest}' if self.dest else '' + return txt+filter+dest + class CompressOptions(BaseOptions): ZIP_ALGORITHMS = {'auto': ZIP_DEFLATED, @@ -76,7 +82,7 @@ def __init__(self): self.compression = 'auto' """ [auto,stored,deflated,bzip2,lzma] Compression algorithm. Use auto to let KiBot select a suitable one """ self.files = FilesList - """ *[list(dict)] Which files will be included """ + """ *[list(dict)=[]] Which files will be included """ self.move_files = False """ Move the files to the archive. In other words: remove the files after adding them to the archive """ self.remove_files = None @@ -89,8 +95,7 @@ def __init__(self): def config(self, parent): super().config(parent) - if isinstance(self.files, type): - self.files = [] + if not self.get_user_defined('files'): logger.warning(W_EMPTYZIP+'No files provided, creating an empty archive') self._expand_id = parent.name self._expand_ext = self.solve_extension() @@ -237,10 +242,7 @@ def get_categories(self): if out is not None: config_output(out) if out.category: - if isinstance(out.category, str): - cats.add(out.category) - else: - cats.update(out.category) + cats.update(out.category) else: cats.add('Compress') return list(cats) @@ -287,14 +289,14 @@ def __init__(self): self.priority = 10 with document: self.options = CompressOptions - """ *[dict] Options for the `compress` output """ + """ *[dict={}] Options for the `compress` output """ self._none_related = True # The help is inherited and already mentions the default priority self.fix_priority_help() def config(self, parent): super().config(parent) - if self.category is None and not isinstance(self.options, type): + if self.category is None and self.get_user_defined('options'): self.category = self.options.get_categories() def get_dependencies(self): diff --git a/kibot/out_copy_files.py b/kibot/out_copy_files.py index da255f056..6b803bc8f 100644 --- a/kibot/out_copy_files.py +++ b/kibot/out_copy_files.py @@ -13,7 +13,7 @@ from .gs import GS from .kiplot import config_output, get_output_dir, run_output, register_xmp_import from .kicad.config import KiConf, LibAlias, FP_LIB_TABLE, SYM_LIB_TABLE -from .misc import WRONG_ARGUMENTS, INTERNAL_ERROR, W_COPYOVER, W_MISSLIB, W_MISSCMP +from .misc import WRONG_ARGUMENTS, INTERNAL_ERROR, W_COPYOVER, W_MISSLIB, W_MISSCMP, W_NOFILES from .optionable import Optionable from .out_base_3d import Base3DOptions from .registrable import RegOutput @@ -76,12 +76,18 @@ def apply_rename(self, fname): res = '${KIPRJMOD}/'+os.path.join(self.output_dir, dest) return res + def __str__(self): + txt = f'{self.source} [{self.source_type}]' + filter = f' (filter: `{self.filter}`)' if self.filter and self.filter != '.*' else '' + dest = f' -> {self.dest}' if self.dest else '' + return txt+filter+dest + class Copy_FilesOptions(Base3DOptions): def __init__(self): with document: self.files = FilesList - """ *[list(dict)] Which files will be included """ + """ *[list(dict)=[]] Which files will be included """ self.follow_links = True """ Store the file pointed by symlinks, not the symlink """ self.link_no_copy = False @@ -90,11 +96,6 @@ def __init__(self): self._expand_id = 'copy' self._expand_ext = 'files' - def config(self, parent): - super().config(parent) - if isinstance(self.files, type): - raise KiPlotConfigurationError('No files provided') - def get_from_output(self, f, no_out_run): from_output = f.source logger.debugl(2, '- From output `{}`'.format(from_output)) @@ -361,6 +362,8 @@ def run(self, output): logger.debug('Copying files') output += os.path.sep copied = {} + if not files: + logger.warning(W_NOFILES+'Nothing to copy') for (src, dst) in files: if src is None: # Files we generate, we don't need to copy them @@ -401,7 +404,7 @@ def __init__(self): self.priority = 11 with document: self.options = Copy_FilesOptions - """ *[dict] Options for the `copy_files` output """ + """ *[dict={}] Options for the `copy_files` output """ # The help is inherited and already mentions the default priority self.fix_priority_help() # Mostly oriented to the project copy diff --git a/kibot/out_diff.py b/kibot/out_diff.py index bb6031fd0..be1e43499 100644 --- a/kibot/out_diff.py +++ b/kibot/out_diff.py @@ -119,13 +119,12 @@ def config(self, parent): super().config(parent) self._expand_id = 'diff'+('_pcb' if self.pcb else '_sch') if self.new_type == 'multivar': - if isinstance(self.new, str): - raise KiPlotConfigurationError('`new` must be a list when using the `multivar` type') if len(self.new) < 2: raise KiPlotConfigurationError('`new` must contain at least two variants when using the `multivar` type') else: - if isinstance(self.new, list): + if len(self.new) > 1: raise KiPlotConfigurationError('`new` must be a single string for `{}` type'.format(self.new_type)) + self.new = self.new[0] if len(self.new) else '' if self.old_type == 'multivar' and self.new_type != 'multivar': raise KiPlotConfigurationError("`old_type` can't be `multivar` when `new_type` isn't (`{}`)".format(self.new_type)) self.validate_colors(['color_added', 'color_removed']) @@ -448,7 +447,7 @@ def cache_obj(self, name, type): return self.cache_output(name) def create_layers_incl(self, layers): - return self.save_layers_incl(Layer.solve(layers)) if self.pcb and not isinstance(layers, type) else None + return self.save_layers_incl(Layer.solve(layers)) if self.pcb else None def do_compare(self, old, old_type, new, new_type, name, name_ori): dir_name = os.path.dirname(name) @@ -561,10 +560,11 @@ def __init__(self): self._any_related = True with document: self.options = DiffOptions - """ *[dict] Options for the `diff` output """ + """ *[dict={}] Options for the `diff` output """ self.layers = Layer - """ *[list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to use. When empty all available layers are used. + """ *[list(dict)|list(string)|string='all'] [all,selected,copper,technical,user,inners,outers,*] List + of PCB layers to use. When empty all available layers are used. + If the list is empty all layers will be included. Note that if you want to support adding/removing layers you should specify a list here """ def config(self, parent): diff --git a/kibot/out_download_datasheets.py b/kibot/out_download_datasheets.py index 0b34edea1..0df6be5f3 100644 --- a/kibot/out_download_datasheets.py +++ b/kibot/out_download_datasheets.py @@ -6,6 +6,7 @@ import os import re import requests +from .optionable import Optionable from .out_base import VariantOptions from .fil_base import DummyFilter from .error import KiPlotConfigurationError @@ -14,6 +15,9 @@ from .macros import macros, document, output_class # noqa: F401 from . import log logger = log.get_logger() +SUBDIRS = {'C': 'Capacitors', 'R': 'Resistors', 'L': 'Inductors', 'U': 'Integrated_Circuits', 'J': 'Connectors', + 'D': 'Diodes', 'Q': 'Transistors', 'Y': 'Crystals', 'BZ': 'Buzzers', 'FL': 'Filters', 'JP': 'Jumpers', + 'M': 'Motors', 'K': 'Relays', 'HS': 'Heat_Sinks', 'F': 'Fuses', 'AE': 'Antennas'} def is_url(ds): @@ -31,6 +35,12 @@ def __init__(self): self.output = '${VALUE}.pdf' """ Name used for the downloaded datasheet. `${FIELD}` will be replaced by the FIELD content """ + self.classify = False + """ Use the reference to classify the components in different sub-dirs. + In this way C7 will go into a Capacitors sub-dir, R3 into Resistors, etc """ + self.classify_extra = Optionable + """ [string_dict={}] Extra reference associations used to classify the references. + They are pairs `Reference prefix` -> `Sub-dir` """ self.dnf = False """ Include the DNF components """ self.repeated = False @@ -55,6 +65,10 @@ def do_warning(self, msg, ds, c): return None def download(self, c, ds, dir, name, known): + if self.classify: + subdir = self.classify_extra.get(c.ref_prefix, SUBDIRS.get(c.ref_prefix, 'Miscellaneous')) + os.makedirs(os.path.join(dir, subdir), exist_ok=True) + name = os.path.join(subdir, name) dest = os.path.join(dir, name) logger.debug('To download: {} -> {}'.format(ds, dest)) if name in self._downloaded: @@ -131,7 +145,7 @@ def run(self, output_dir): if ds and is_url(ds): known = self._urls.get(ds, None) if known is None or self.repeated: - name = self.out_name(c) + name = self.out_name(c) # Here to simplify the tests name = self.download(c, ds, output_dir, name, known) if known is None: self._urls[ds] = name @@ -162,7 +176,7 @@ def __init__(self): super().__init__() with document: self.options = Download_Datasheets_Options - """ *[dict] Options for the `download_datasheets` output """ + """ *[dict={}] Options for the `download_datasheets` output """ self._sch_related = True self._category = 'Schematic/docs' diff --git a/kibot/out_dxf.py b/kibot/out_dxf.py index d3eadf730..71c856dca 100644 --- a/kibot/out_dxf.py +++ b/kibot/out_dxf.py @@ -60,4 +60,4 @@ def __init__(self): self._category = 'PCB/export' with document: self.options = DXFOptions - """ *[dict] Options for the `dxf` output """ + """ *[dict={}] Options for the `dxf` output """ diff --git a/kibot/out_dxf_sch_print.py b/kibot/out_dxf_sch_print.py index 8c8bba1fb..5f6cc9ac2 100644 --- a/kibot/out_dxf_sch_print.py +++ b/kibot/out_dxf_sch_print.py @@ -40,7 +40,7 @@ def __init__(self): super().__init__() with document: self.options = DXF_SCH_PrintOptions - """ *[dict] Options for the `dxf_sch_print` output """ + """ *[dict={}] Options for the `dxf_sch_print` output """ self._sch_related = True self._category = 'Schematic/docs' diff --git a/kibot/out_excellon.py b/kibot/out_excellon.py index 841870e79..117bbacae 100644 --- a/kibot/out_excellon.py +++ b/kibot/out_excellon.py @@ -56,7 +56,7 @@ def __init__(self): self._category = 'PCB/fabrication/drill' with document: self.options = ExcellonOptions - """ *[dict] Options for the `excellon` output """ + """ *[dict={}] Options for the `excellon` output """ @staticmethod def get_conf_examples(name, layers): diff --git a/kibot/out_gencad.py b/kibot/out_gencad.py index ea15c2dc8..54af7004c 100644 --- a/kibot/out_gencad.py +++ b/kibot/out_gencad.py @@ -75,7 +75,7 @@ def __init__(self): self._category = 'PCB/export' with document: self.options = GenCADOptions - """ *[dict] Options for the `gencad` output """ + """ *[dict={}] Options for the `gencad` output """ @staticmethod def get_conf_examples(name, layers): diff --git a/kibot/out_gerb_drill.py b/kibot/out_gerb_drill.py index 0301366ab..4863f0394 100644 --- a/kibot/out_gerb_drill.py +++ b/kibot/out_gerb_drill.py @@ -33,7 +33,7 @@ def __init__(self): self._category = 'PCB/fabrication/drill' with document: self.options = Gerb_DrillOptions - """ *[dict] Options for the `gerb_drill` output """ + """ *[dict={}] Options for the `gerb_drill` output """ @staticmethod def get_conf_examples(name, layers): diff --git a/kibot/out_gerber.py b/kibot/out_gerber.py index f79873153..08dfc2726 100644 --- a/kibot/out_gerber.py +++ b/kibot/out_gerber.py @@ -12,7 +12,6 @@ from .misc import FONT_HELP_TEXT from .optionable import Optionable from .out_any_layer import AnyLayer, AnyLayerOptions -from .error import KiPlotConfigurationError from .macros import macros, document, output_class # noqa: F401 from . import log @@ -31,8 +30,8 @@ def __init__(self): """ *Subtract the solder mask from the silk screen """ self.use_protel_extensions = False """ *Use legacy Protel file extensions """ - self._gerber_precision = 4.6 - """ This the gerber coordinate format, can be 4.5 or 4.6 """ + self.gerber_precision = 4.6 + """ [4.5;4.6] This is the gerber coordinate format, can be 4.5 or 4.6 """ self.create_gerber_job_file = True """ *Creates a file with information about all the generated gerbers. You can use it in gerbview to load all gerbers at once """ @@ -52,16 +51,6 @@ def __init__(self): if GS.global_output is not None: self.gerber_job_file = GS.global_output - @property - def gerber_precision(self): - return self._gerber_precision - - @gerber_precision.setter - def gerber_precision(self, val): - if val != 4.5 and val != 4.6: - raise KiPlotConfigurationError("`gerber_precision` must be 4.5 or 4.6") - self._gerber_precision = val - def _configure_plot_ctrl(self, po, output_dir): super()._configure_plot_ctrl(po, output_dir) po.SetSubtractMaskFromSilk(self.subtract_mask_from_silk) @@ -113,7 +102,7 @@ def __init__(self): super().__init__() with document: self.options = GerberOptions - """ *[dict] Options for the `gerber` output """ + """ *[dict={}] Options for the `gerber` output """ self._category = 'PCB/fabrication/gerber' @staticmethod diff --git a/kibot/out_hpgl.py b/kibot/out_hpgl.py index 674aa5ccc..cf8439705 100644 --- a/kibot/out_hpgl.py +++ b/kibot/out_hpgl.py @@ -57,4 +57,4 @@ def __init__(self): self._category = 'PCB/docs' with document: self.options = HPGLOptions - """ *[dict] Options for the `hpgl` output """ + """ *[dict={}] Options for the `hpgl` output """ diff --git a/kibot/out_hpgl_sch_print.py b/kibot/out_hpgl_sch_print.py index cedff6068..43044aca4 100644 --- a/kibot/out_hpgl_sch_print.py +++ b/kibot/out_hpgl_sch_print.py @@ -48,7 +48,7 @@ def __init__(self): super().__init__() with document: self.options = HPGL_SCH_PrintOptions - """ *[dict] Options for the `hpgl_sch_print` output """ + """ *[dict={}] Options for the `hpgl_sch_print` output """ self._sch_related = True self._category = 'Schematic/docs' diff --git a/kibot/out_ibom.py b/kibot/out_ibom.py index 7450e9a9e..f2ac63aeb 100644 --- a/kibot/out_ibom.py +++ b/kibot/out_ibom.py @@ -46,7 +46,7 @@ def __init__(self): self.hide_silkscreen = False """ Hide silkscreen by default """ self.highlight_pin1 = False - """ [boolean|none,all,selected] Highlight pin1 by default """ + """ [boolean|string=false] [none,all,selected] Highlight pin1 by default """ self.no_redraw_on_drag = False """ Do not redraw pcb on drag by default """ self.board_rotation = 0 @@ -213,7 +213,10 @@ def run(self, name): self.blacklist += ',' self.blacklist += to_remove # Convert attributes into options - for k, v in self.get_attrs_gen(): + # Note: here we should use self, instead of a template, but this is currently safer + template = IBoMOptions() + for k, v in template.get_attrs_gen(): + v = getattr(self, k) if not v or k in ['output', 'variant', 'dnf_filter', 'pre_transform', 'hide_excluded', 'forced_name']: continue if k == 'offset_back_rotation' and version < (2, 5, 0, 2): @@ -231,8 +234,8 @@ def run(self, name): raise CalledProcessError(1, cmd, cmd_output) except CalledProcessError as e: GS.exit_with_error(f'Failed to create BoM, error {e.returncode}', BOM_ERROR, e, - ("'PCB_SHAPE' object has no attribute 'GetAngle'", - "Update Interactive HTML BoM your version doesn't support KiCad 6 files")) + [("'PCB_SHAPE' object has no attribute 'GetAngle'", + "Update Interactive HTML BoM your version doesn't support KiCad 6 files")]) finally: if net_dir: logger.debug('Removing temporal variant dir `{}`'.format(net_dir)) @@ -255,7 +258,7 @@ def __init__(self): super().__init__() with document: self.options = IBoMOptions - """ *[dict] Options for the `ibom` output """ + """ *[dict={}] Options for the `ibom` output """ self._category = ['Schematic/BoM', 'PCB/fabrication/assembly'] def get_dependencies(self): diff --git a/kibot/out_info.py b/kibot/out_info.py index daeebfbe7..e940918e4 100644 --- a/kibot/out_info.py +++ b/kibot/out_info.py @@ -69,7 +69,7 @@ def __init__(self): self._category = ['PCB/docs', 'Schematic/docs'] with document: self.options = InfoOptions - """ *[dict] Options for the `info` output """ + """ *[dict={}] Options for the `info` output """ @staticmethod def get_conf_examples(name, layers): diff --git a/kibot/out_kibom.py b/kibot/out_kibom.py index d040ae29a..75f4f3856 100644 --- a/kibot/out_kibom.py +++ b/kibot/out_kibom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2022 Salvador E. Tropea -# Copyright (c) 2020-2022 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) """ Dependencies: @@ -9,12 +9,12 @@ role: mandatory github: INTI-CMNB/KiBoM command: KiBOM_CLI.py - version: 1.8.0 + version: 1.9.1 downloader: pytool """ import os from re import search -from .misc import BOM_ERROR, W_EXTNAME +from .misc import BOM_ERROR, W_EXTNAME, W_NONETLIST from .gs import GS from .kiplot import run_command from .optionable import Optionable, BaseOptions @@ -52,6 +52,7 @@ def __init__(self): self.regexp = None """ {regex} """ self._category = 'Schematic/BoM' + self._column_example = 'References' def config(self, parent): super().config(parent) @@ -84,10 +85,13 @@ def config(self, parent): if not self.field: raise KiPlotConfigurationError("Missing or empty `field` in columns list ({})".format(str(self._tree))) self.field = Optionable.solve_field_name(self.field) - if isinstance(self.join, type): - self.join = None - elif isinstance(self.join, list): - self.join = '\t'.join(self.join) + self.join = '\t'.join(self.join) + + def __str__(self): + txt = f'{self.name} ({self.field})' + if self.join: + txt += f' {self.join}' + return txt class ComponentAliases(Optionable): @@ -99,16 +103,10 @@ class ComponentAliases(Optionable): ['d', 'diode', 'd_small'], ] - def __init__(self): - super().__init__() - class GroupFields(Optionable): _default = ['Part', 'Part Lib', 'Value', 'Footprint', 'Footprint Lib'] - def __init__(self): - super().__init__() - class KiBoMConfig(Optionable): """ Implements the .ini options """ @@ -143,10 +141,9 @@ def __init__(self): """ [string|list(string)=''] Column/s containing Digi-Key part numbers, will be linked to web page (HTML only) """ self.mouser_link = Optionable """ [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page (HTML only) """ - # Upcoming release - # self.lcsc_link = Optionable - # """ [string|list(string)=''] Column/s containing LCSC part numbers, will be linked to web page (HTML only) """ - # ??? Use **true** to copy the value indicated by the `field_lcsc_part` global option """ + self.lcsc_link = Optionable + """ [boolean|string|list(string)=''] Column/s containing LCSC part numbers, will be linked to web page. + Use **true** to copy the value indicated by the `field_lcsc_part` global option """ self.group_fields = GroupFields """ *[list(string)] List of fields used for sorting individual components into groups. Components which match (comparing *all* fields) will be grouped together. @@ -164,15 +161,15 @@ def __init__(self): - ['zener', 'zenersmall'] - ['d', 'diode', 'd_small'] """ self.include_only = KiBoMRegex - """ [list(dict)] A series of regular expressions used to select included parts. + """ [list(dict)=[]] A series of regular expressions used to select included parts. If there are any regex defined here, only components that match against ANY of them will be included. Column names are case-insensitive. If empty all the components are included """ self.exclude_any = KiBoMRegex - """ [list(dict)] A series of regular expressions used to exclude parts. + """ [list(dict)=[]] A series of regular expressions used to exclude parts. If a component matches ANY of these, it will be excluded. Column names are case-insensitive. - If empty the following list is used: + If empty the following list is used by KiBoM: - column: References ..regex: '^TP[0-9]*' - column: References @@ -190,7 +187,7 @@ def __init__(self): - column: Footprint ..regex: 'fiducial' """ self.columns = KiBoMColumns - """ *[list(dict)|list(string)] List of columns to display. + """ *[list(dict)|list(string)=[]] List of columns to display. Can be just the name of the field """ @staticmethod @@ -203,12 +200,15 @@ def _get_columns(): """ Create a list of valid columns """ if not GS.sch: return ColumnList.COLUMNS_DEFAULT + xml = GS.sch_no_ext+'.xml' + if not os.path.isfile(xml): + logger.warning(W_NONETLIST+f"Missing `{xml}`, can't verify the field names") + return ColumnList.COLUMNS_DEFAULT command = GS.ensure_tool('kibom', 'KiBoM') config = None csv = None columns = None try: - xml = GS.sch_no_ext+'.xml' config = os.path.abspath(KiBoMConfig._create_minimal_ini()) csv = GS.tmp_file(suffix='.csv') cmd = [command, '--cfg', config, '-d', os.path.dirname(csv), '-s', ',', xml, csv] @@ -225,79 +225,54 @@ def _get_columns(): def config(self, parent): super().config(parent) # digikey_link - if isinstance(self.digikey_link, type): - self.digikey_link = None - elif isinstance(self.digikey_link, list): - self.digikey_link = '\t'.join(self.digikey_link) + self.digikey_link = '\t'.join(self.digikey_link) # mouser_link - if isinstance(self.mouser_link, type): - self.mouser_link = None - elif isinstance(self.mouser_link, list): - self.mouser_link = '\t'.join(self.mouser_link) + self.mouser_link = '\t'.join(self.mouser_link) # lcsc_link - # if isinstance(self.lcsc_link, type): - # self.lcsc_link = None - # elif isinstance(self.lcsc_link, list): - # self.lcsc_link = '\t'.join(self.lcsc_link) - # group_fields - if isinstance(self.group_fields, type): - self.group_fields = None + if isinstance(self.lcsc_link, bool): + self.lcsc_link = [self.solve_field_name('_field_lcsc_part')] if self.lcsc_link else [] + self.lcsc_link = '\t'.join(self.lcsc_link) # component_aliases - if isinstance(self.component_aliases, type): - self.component_aliases = None - else: - self.component_aliases = ['\t'.join(a) for a in self.component_aliases] + self.component_aliases = ['\t'.join(a) for a in self.component_aliases] # include_only - if isinstance(self.include_only, type): - self.include_only = None - else: - self.include_only = [str(r) for r in self.include_only] + self.include_only = [str(r) for r in self.include_only] # exclude_any - if isinstance(self.exclude_any, type): - self.exclude_any = None - else: - self.exclude_any = [str(r) for r in self.exclude_any] + self.exclude_any = [str(r) for r in self.exclude_any] # columns - if isinstance(self.columns, type): - self.columns = None - self.col_rename = None - self.join = None - self.ignore = None - else: - # This is tricky - # Lower case available columns - valid_columns = self._get_columns() - valid_columns_l = {c.lower(): c for c in valid_columns} - logger.debug("Valid columns: "+str(valid_columns)) - # Create the different lists - columns = [] - columns_l = {} - self.col_rename = [] - self.join = [] - for col in self.columns: - if isinstance(col, str): - # Just a string, add to the list of used - new_col = col - else: - # A complete entry - new_col = col.field - # A column rename - if col.name: - self.col_rename.append(col.field+'\t'+col.name) - # Attach other columns - if col.join: - self.join.append(col.field+'\t'+col.join) - # Check this is a valid column - if new_col.lower() not in valid_columns_l: - # Should we relax it? (as in out_bom) - raise KiPlotConfigurationError('Invalid column name `{}`. Valid columns are {}.'. - format(new_col, list(valid_columns_l.values()))) - columns.append(new_col) - columns_l[new_col.lower()] = new_col - # Create a list of the columns we don't want - self.ignore = [c for c in valid_columns_l.keys() if c not in columns_l] - # And this is the ordered list with the case style defined by the user - self.columns = columns + # This is tricky + # Lower case available columns + valid_columns = self._get_columns() if self.columns else [] + valid_columns_l = {c.lower(): c for c in valid_columns} + logger.debug("Valid columns: "+str(valid_columns)) + # Create the different lists + columns = [] + columns_l = {} + self.col_rename = [] + self.join = [] + for col in self.columns: + if isinstance(col, str): + # Just a string, add to the list of used + new_col = col + else: + # A complete entry + new_col = col.field + # A column rename + if col.name: + self.col_rename.append(col.field+'\t'+col.name) + # Attach other columns + if col.join: + self.join.append(col.field+'\t'+col.join) + # Check this is a valid column + if new_col.lower() not in valid_columns_l: + # Should we relax it? (as in out_bom) + raise KiPlotConfigurationError('Invalid column name `{}`. Valid columns are {}.'. + format(new_col, list(valid_columns_l.values()))) + columns.append(new_col) + columns_l[new_col.lower()] = new_col + # Create a list of the columns we don't want + self.ignore = [c for c in valid_columns_l.keys() if c not in columns_l] if self.columns else [] + # And this is the ordered list with the case style defined by the user + self.columns = columns def write_bool(self, attr): """ Write a .INI bool option """ @@ -361,7 +336,7 @@ def __init__(self): variants with the ';' (semicolon) character. This isn't related to the KiBot concept of variants """ self.conf = KiBoMConfig - """ [string|dict] BoM configuration file, relative to PCB. Environment variables and ~ allowed. + """ [string|dict='bom.ini'] BoM configuration file, relative to PCB. Environment variables and ~ allowed. You can also define the configuration here, will be stored in `config.kibom.ini` """ self.separator = ',' """ CSV Separator """ @@ -376,9 +351,7 @@ def __init__(self): def config(self, parent): super().config(parent) - if isinstance(self.conf, type): - self.conf = 'bom.ini' - elif isinstance(self.conf, str): + if isinstance(self.conf, str): if not self.conf: self.conf = 'bom.ini' else: @@ -445,7 +418,7 @@ def __init__(self): super().__init__() with document: self.options = KiBoMOptions - """ *[dict] Options for the `kibom` output """ + """ *[dict={}] Options for the `kibom` output """ self._sch_related = True def get_dependencies(self): diff --git a/kibot/out_kicanvas.py b/kibot/out_kicanvas.py index 79b28b3c4..54698c6a7 100644 --- a/kibot/out_kicanvas.py +++ b/kibot/out_kicanvas.py @@ -14,7 +14,6 @@ logger = log.get_logger() VALID_SOURCE = {'schematic', 'pcb', 'project'} -URL_SCRIPT = 'https://kicanvas.org/kicanvas/kicanvas.js' SCRIPT_NAME = 'kicanvas.js' JS_TEST = """ function ready() @@ -49,7 +48,7 @@ def __init__(self): self.title = '' """ Text used to replace the sheet title. %VALUE expansions are allowed. If it starts with `+` the text is concatenated """ - self.url_script = URL_SCRIPT + self.url_script = 'https://kicanvas.org/kicanvas/kicanvas.js' """ URL for the KiCanvas script """ self.controls = 'full' """ [full,basic,none] Which controls are displayed """ @@ -216,7 +215,7 @@ def __init__(self): self.output = GS.def_global_output """ *Filename for the output (%i=kicanvas, %x=html) """ self.options = KiCanvasOptions - """ *[dict] Options for the KiCanvas output """ + """ *[dict={}] Options for the KiCanvas output """ def config(self, parent): super().config(parent) diff --git a/kibot/out_kicost.py b/kibot/out_kicost.py index 4bb1fb989..0679d5576 100644 --- a/kibot/out_kicost.py +++ b/kibot/out_kicost.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2021-2022 Salvador E. Tropea -# Copyright (c) 2021-2022 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2021-2024 Salvador E. Tropea +# Copyright (c) 2021-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) """ Dependencies: @@ -40,12 +40,19 @@ def __init__(self): self.board_qty = None """ {number} """ self._category = 'Schematic/BoM' + self._file_example = 'netlist.xml' def config(self, parent): super().config(parent) if not self.file: raise KiPlotConfigurationError("Missing or empty `file` in aggregate list ({})".format(str(self._tree))) + def __str__(self): + txt = self.file + if self.variant.strip(): + txt += ' ({self.variant)' + return txt+f' x{self.number}' + class KiCostOptions(VariantOptions): def __init__(self): @@ -59,30 +66,36 @@ def __init__(self): self.show_cat_url = False """ Include the catalogue links in the catalogue code """ self.distributors = Optionable - """ *[string|list(string)] Include this distributors list. Default is all the available """ + """ *[string|list(string)=[]] Include this distributors list. Default is all the available """ self.no_distributors = Optionable - """ *[string|list(string)] Exclude this distributors list. They are removed after computing `distributors` """ + """ *[string|list(string)=[]] Exclude this distributors list. They are removed after computing `distributors` """ self.currency = Optionable - """ *[string|list(string)=USD] Currency priority. Use ISO4217 codes (i.e. USD, EUR) """ + """ *[string|list(string)='USD'] Currency priority. Use ISO4217 codes (i.e. USD, EUR) """ self.group_fields = Optionable - """ [string|list(string)] List of fields that can be different for a group. + """ [string|list(string)=[]] {comma_sep} List of fields that can be different for a group. Parts with differences in these fields are grouped together, but displayed individually """ self.split_extra_fields = Optionable - """ [string|list(string)] Declare part fields to include in multipart split process """ + """ [string|list(string)=[]] {comma_sep} Declare part fields to include in multipart split process """ self.ignore_fields = Optionable - """ [string|list(string)] List of fields to be ignored """ + """ [string|list(string)=[]] {comma_sep} List of fields to be ignored """ self.fields = Optionable - """ [string|list(string)] List of fields to be added to the global data section """ + """ [string|list(string)=[]] {comma_sep} List of fields to be added to the global data section """ self.translate_fields = FieldRename - """ [list(dict)] Fields to rename (KiCost option, not internal filters) """ + """ [list(dict)=[]] Fields to rename (KiCost option, not internal filters) """ self.kicost_variant = '' """ Regular expression to match the variant field (KiCost option, not internal variants) """ self.aggregate = Aggregate - """ [list(dict)] Add components from other projects """ + """ [list(dict)=[]] Add components from other projects """ self.number = 100 """ *Number of boards to build (components multiplier) """ self.board_qty = None """ {number} """ + self.kicost_config = '' + """ KiCost configuration file. It contains the keys for the different distributors APIs. + The regular KiCost config is used when empty. + Important for CI/CD environments: avoid exposing your API secrets! + To understand how to achieve this, and also how to make use of the cache please visit the + [kicost_ci_test](https://github.com/set-soft/kicost_ci_test) repo """ super().__init__() self.add_to_doc('variant', WARNING_MIX) @@ -92,7 +105,6 @@ def __init__(self): @staticmethod def _validate_dis(val): - val = Optionable.force_list(val) for v in val: if v not in DISTRIBUTORS: logger.warning(W_UNKDIST+'Unknown distributor `{}`'.format(v)) @@ -100,7 +112,6 @@ def _validate_dis(val): @staticmethod def _validate_cur(val): - val = Optionable.force_list(val) for v in val: if v not in ISO_CURRENCIES: logger.warning(W_UNKCUR+'Unknown currency `{}`'.format(v)) @@ -113,22 +124,13 @@ def config(self, parent): self.distributors = self._validate_dis(self.distributors) self.no_distributors = self._validate_dis(self.no_distributors) self.currency = self._validate_cur(self.currency) - self.group_fields = Optionable.force_list(self.group_fields) - self.split_extra_fields = Optionable.force_list(self.split_extra_fields) - self.ignore_fields = Optionable.force_list(self.ignore_fields) - self.fields = Optionable.force_list(self.fields) # Adapt translate_fields to its use - if isinstance(self.translate_fields, type): - self.translate_fields = [] if self.translate_fields: translate_fields = [] for f in self.translate_fields: translate_fields.append(f.field) translate_fields.append(f.name) self.translate_fields = translate_fields - # Make sure aggregate is a list - if isinstance(self.aggregate, type): - self.aggregate = [] def get_targets(self, out_dir): return [self.expand_filename(out_dir, self.output, self._expand_id, self._expand_ext)] @@ -211,6 +213,12 @@ def run(self, name): if self.translate_fields: cmd.append('--translate_fields') cmd.extend(self.translate_fields) + # Config specified by the user + if self.kicost_config: + cfg_name = os.path.expanduser(self.kicost_config) + if not os.path.isfile(cfg_name): + raise KiPlotConfigurationError(f"Missing config file: `{cfg_name}`") + cmd.extend(['--config', ]) # Run the command try: run_command(cmd, err_msg='Failed to create costs spreadsheet, error {ret}', err_lvl=BOM_ERROR) @@ -232,4 +240,4 @@ def __init__(self): self._sch_related = True with document: self.options = KiCostOptions - """ *[dict] Options for the `kicost` output """ + """ *[dict={}] Options for the `kicost` output """ diff --git a/kibot/out_kikit_present.py b/kibot/out_kikit_present.py index 6dafba866..4cc0f6b6e 100644 --- a/kibot/out_kikit_present.py +++ b/kibot/out_kikit_present.py @@ -21,7 +21,7 @@ import sys from tempfile import TemporaryDirectory from .error import KiPlotConfigurationError -from .misc import PCB_GENERATORS, RENDERERS, W_MORERES +from .misc import PCB_GENERATORS, RENDERERS, W_MORERES, W_NODESC from .gs import GS from .kiplot import config_output, run_output, get_output_dir, load_board, run_command, configure_and_run from .optionable import BaseOptions, Optionable @@ -117,10 +117,6 @@ def config(self, parent): raise KiPlotConfigurationError('Unknown output `{}` selected in board {}'. format(self.pcb_from_output, self.name)) - def fill_empty_values(self, parent): - # The defaults are good enough, but we need to attach to a parent - self._parent = parent - def solve_file(self): return self.name, self.comment, self.pcb_file, self.front_image, self.back_image, self.gerbers @@ -271,6 +267,11 @@ def solve(self, temporals): # external return self.solve_external() + def __str__(self): + desc = self.comment if self.comment else 'No comment' + name = self.name if self.name else 'No name' + return f'`{desc}` ({name}) [{self.mode}]' + class KiKit_PresentOptions(BaseOptions): def __init__(self): @@ -279,9 +280,10 @@ def __init__(self): """ *Name for a markdown file containing the main part of the page to be generated. This is mandatory and is the description of your project. You can embed the markdown code. If the text doesn't map to a file and contains - more than one line KiBot will assume this is the markdown """ + more than one line KiBot will assume this is the markdown. + If empty KiBot will generate a silly text and a warning """ self.boards = PresentBoards - """ [dict|list(dict)] One or more boards that compose your project. + """ [dict|list(dict)=[{}]] One or more boards that compose your project. When empty we will use only the main PCB for the current project """ self.resources = Optionable """ [string|list(string)=''] A list of file name patterns for additional resources to be included. @@ -310,21 +312,16 @@ def get_git_command(self): def config(self, parent): super().config(parent) # Validate the input file name - if not self.description: - raise KiPlotConfigurationError('You must specify an input markdown file using `description`') - if not os.path.isfile(self.description): - self.description = self.description.split('\n') - if len(self.description) == 1: - raise KiPlotConfigurationError('Missing description file `{}`'.format(self.description)) + self._description = self.description + self._silly_desc = False + if not self._description: + self._description = f'# {GS.pcb_basename.capitalize()}\n\nA project without description\n' + self._silly_desc = True + if not os.path.isfile(self._description): + self._description = self._description.split('\n') + if len(self._description) == 1: + raise KiPlotConfigurationError('Missing description file `{}`'.format(self._description)) # List of boards - if isinstance(self.boards, type): - a_board = PresentBoards() - a_board.fill_empty_values(self) - self.boards = [a_board] - elif isinstance(self.boards, PresentBoards): - self.boards = [self.boards] - # else ... we have a list of boards - self.resources = self.force_list(self.resources, comma_sep=False) if not self.name: self.name = GS.pcb_basename # Make sure the template exists @@ -366,6 +363,8 @@ def get_navigate_targets(self, out_dir): def run(self, dir_name): self.ensure_tool('markdown2') from .PcbDraw.present import boardpage + if self._silly_desc: + logger.warning(W_NODESC+'No project description, please provide one') # Generate missing images board = [] temporals = [] @@ -373,16 +372,15 @@ def run(self, dir_name): for brd in self.boards: board.append(brd.solve(temporals)) # Support embedded markdown - if isinstance(self.description, list): + self._desc_file = self._description + if isinstance(self._desc_file, list): tmp_md = _get_tmp_name('md') with open(tmp_md, 'w') as f: - f.writelines([ln+'\n' for ln in self.description]) - self._description = tmp_md + f.writelines([ln+'\n' for ln in self._desc_file]) + self._desc_file = tmp_md temporals.append(tmp_md) - else: - self._description = self.description try: - boardpage(dir_name, self._description, board, self.resources, self.template, self.repository, self.name, + boardpage(dir_name, self._desc_file, board, self.resources, self.template, self.repository, self.name, self.get_git_command()) except RuntimeError as e: raise KiPlotConfigurationError('KiKit present error: '+str(e)) @@ -404,7 +402,7 @@ def __init__(self): super().__init__() with document: self.options = KiKit_PresentOptions - """ *[dict] Options for the `kikit_present` output """ + """ *[dict={}] Options for the `kikit_present` output """ self._category = 'PCB/docs' def get_navigate_targets(self, out_dir): diff --git a/kibot/out_kiri.py b/kibot/out_kiri.py index d19eed20f..fd1689b61 100644 --- a/kibot/out_kiri.py +++ b/kibot/out_kiri.py @@ -21,7 +21,11 @@ """ import datetime import glob -import pwd +try: + # Not available on Windows?! + import pwd +except Exception: + pass import os from shutil import copy2, rmtree from subprocess import CalledProcessError @@ -101,7 +105,7 @@ def get_navigate_targets(self, out_dir): def create_layers_incl(self, layers): self.incl_file = None - if isinstance(layers, type): + if not layers: self._solved_layers = None return False self.save_layers_incl(Layer.solve(layers)) @@ -354,10 +358,10 @@ def __init__(self): self._both_related = True with document: self.options = KiRiOptions - """ *[dict] Options for the `diff` output """ + """ *[dict={}] Options for the `diff` output """ self.layers = Layer - """ *[list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to use. When empty all available layers are used. + """ *[list(dict)|list(string)|string='all'] [all,selected,copper,technical,user,inners,outers,*] List + of PCB layers to use. When empty all available layers are used. Note that if you want to support adding/removing layers you should specify a list here """ @staticmethod diff --git a/kibot/out_navigate_results.py b/kibot/out_navigate_results.py index 49a7df3da..528268981 100644 --- a/kibot/out_navigate_results.py +++ b/kibot/out_navigate_results.py @@ -295,9 +295,7 @@ def __init__(self): def config(self, parent): super().config(parent) # Logo - if isinstance(self.logo, type): - self.logo = '' - elif isinstance(self.logo, bool): + if isinstance(self.logo, bool): self.logo = '' if self.logo else None elif self.logo: self.logo = os.path.abspath(self.logo) @@ -315,9 +313,7 @@ def config(self, parent): self._logo_w = self._logo_h = 0 self._logo_data = '' # Title URL - if isinstance(self.title_url, type): - self.title_url = '' - elif isinstance(self.title_url, bool): + if isinstance(self.title_url, bool): self.title_url = '' if self.title_url else None def add_to_tree(self, cat, out, o_tree): @@ -639,7 +635,7 @@ def create_tree(self): # Skip outputs that aren't generated in a regular run continue config_output(o) - cat = force_list(o.category) + cat = o.category if cat is None: continue for c in cat: @@ -783,7 +779,7 @@ def __init__(self): self.priority = 10 with document: self.options = Navigate_ResultsOptions - """ *[dict] Options for the `navigate_results` output """ + """ *[dict={}] Options for the `navigate_results` output """ # The help is inherited and already mentions the default priority self.fix_priority_help() self._any_related = True diff --git a/kibot/out_netlist.py b/kibot/out_netlist.py index 981dadd4c..6e555445a 100644 --- a/kibot/out_netlist.py +++ b/kibot/out_netlist.py @@ -72,7 +72,7 @@ def __init__(self): super().__init__() with document: self.options = NetlistOptions - """ *[dict] Options for the `netlist` output """ + """ *[dict={}] Options for the `netlist` output """ @staticmethod def get_conf_examples(name, layers): diff --git a/kibot/out_panelize.py b/kibot/out_panelize.py index c23b6252a..eec71a077 100644 --- a/kibot/out_panelize.py +++ b/kibot/out_panelize.py @@ -19,7 +19,7 @@ from .kiplot import run_command, config_output, register_xmp_import from .layer import Layer from .misc import W_PANELEMPTY, KIKIT_UNIT_ALIASES, W_KEEPTMP -from .optionable import PanelOptions +from .optionable import PanelOptions, Optionable from .out_base import VariantOptions from .registrable import RegOutput from .macros import macros, document, output_class # noqa: F401 @@ -65,17 +65,17 @@ def __init__(self): """ [tl,tr,bl,br,mt,mb,ml,mr,c] Point of the panel to be placed at given position. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr (middle of sides), c (center). The anchors refer to the panel outline """ self.posx = '50%' - """ [number|string] The X position of the panel on the page. Can be expressed as a page size percentage """ + """ [number|string='50%'] The X position of the panel on the page. Can be expressed as a page size percentage """ self.pos_x = None """ {posx} """ self.posy = 20 - """ [number|string] The Y position of the panel on the page. Can be expressed as a page size percentage """ + """ [number|string=20] The Y position of the panel on the page. Can be expressed as a page size percentage """ self.pos_y = None """ {posy} """ self.width = 297 - """ [number|string] Width for the `custom` paper size """ + """ [number|string=297] Width for the `custom` paper size """ self.height = 210 - """ [number|string] Height for the `custom` paper size """ + """ [number|string=210] Height for the `custom` paper size """ super().__init__() def config(self, parent): @@ -90,13 +90,13 @@ def __init__(self): self.type = 'grid' """ [grid,plugin] In the plugin type only `code` and `arg` are relevant """ self.hspace = 0 - """ [number|string] Specify the horizontal gap between the boards """ + """ [number|string=0] Specify the horizontal gap between the boards """ self.vspace = 0 - """ [number|string] Specify the vertical gap between the boards """ - self.space = None - """ [number|string] Specify the gap between the boards, overwrites `hspace` and `vspace` """ + """ [number|string=0] Specify the vertical gap between the boards """ + self.space = 0 + """ [number|string=0] Specify the gap between the boards, overwrites `hspace` and `vspace` """ self.rotation = 0 - """ [number|string] Rotate the boards before placing them in the panel """ + """ [number|string=0] Rotate the boards before placing them in the panel """ self.renamenet = 'Board_{n}-{orig}' """ A pattern by which to rename the nets. You can use {n} and {orig} to get the board number and original name """ self.rename_net = None @@ -121,12 +121,12 @@ def __init__(self): cols: Rotate boards by 180Ā° on every next column. rowsCols: Rotate boards by 180Ā° based on a chessboard pattern """ self.vbackbone = 0 - """ [number|string] The width of vertical backbone (0 means no backbone). The backbone does not increase the + """ [number|string=0] The width of vertical backbone (0 means no backbone). The backbone does not increase the spacing of the boards """ self.v_back_bone = None """ {vbackbone} """ self.hbackbone = 0 - """ [number|string] The width of horizontal backbone (0 means no backbone). The backbone does not increase the + """ [number|string=0] The width of horizontal backbone (0 means no backbone). The backbone does not increase the spacing of the boards """ self.h_back_bone = None """ {hbackbone} """ @@ -160,7 +160,7 @@ def __init__(self): def config(self, parent): super().config(parent) - if self.space: + if self.get_user_defined('space'): self.hspace = self.vspace = self.space self.add_units(('vbackbone', 'hbackbone', 'hspace', 'vspace', 'space')) self.add_angle(('rotation', )) @@ -177,25 +177,25 @@ def __init__(self): Annotation: Add tabs based on PCB annotations. Plugin: Uses an external python function, only `code` and `arg` are relevant """ self.vwidth = 3 - """ [number|string] The width of tabs in the vertical direction. Used for *fixed* and *spacing* """ + """ [number|string=3] The width of tabs in the vertical direction. Used for *fixed* and *spacing* """ self.hwidth = 3 - """ [number|string] The width of tabs in the horizontal direction. Used for *fixed* and *spacing* """ - self.width = None - """ [number|string] The width of tabs in both directions. Overrides both `vwidth` and `hwidth`. + """ [number|string=3] The width of tabs in the horizontal direction. Used for *fixed* and *spacing* """ + self.width = 3 + """ [number|string=3] The width of tabs in both directions. Overrides both `vwidth` and `hwidth`. Used for *fixed*, *spacing*, *corner* and *annotation* """ self.vcount = 1 """ Number of tabs in the vertical direction. Used for *fixed* """ self.hcount = 1 """ Number of tabs in the horizontal direction. Used for *fixed* """ self.mindistance = 0 - """ [number|string] Minimal spacing between the tabs. If there are too many tabs, their count is reduced. + """ [number|string=0] Minimal spacing between the tabs. If there are too many tabs, their count is reduced. Used for *fixed* """ self.min_distance = None """ {mindistance} """ self.spacing = 10 - """ [number|string] The maximum spacing of the tabs. Used for *spacing* """ + """ [number|string=10] The maximum spacing of the tabs. Used for *spacing* """ self.cutout = 1 - """ [number|string] When your design features open pockets on the side, this parameter specifies extra cutout + """ [number|string=1] When your design features open pockets on the side, this parameter specifies extra cutout depth in order to ensure that a sharp corner of the pocket can be milled. Used for *full* """ self.patchcorners = True """ The full tabs are appended to the nearest flat face of the PCB. If the PCB has sharp corners, you want to @@ -211,7 +211,7 @@ def __init__(self): def config(self, parent): super().config(parent) - if self.width: + if self.get_user_defined('width'): self.vwidth = self.hwidth = self.width self.add_units(('vwidth', 'hwidth', 'width', 'mindistance', 'spacing', 'cutout')) @@ -223,28 +223,28 @@ def __init__(self): """ *[none,mousebites,vcuts,layer,plugin] Layer: When KiKit reports it cannot perform cuts, you can render the cuts into a layer with this option to understand what's going on. Shouldn't be used for the final design """ self.drill = 0.5 - """ [number|string] Drill size used for the *mousebites* """ + """ [number|string=0.5] Drill size used for the *mousebites* """ self.spacing = 0.8 - """ [number|string] The spacing of the holes used for the *mousebites* """ + """ [number|string=0.8] The spacing of the holes used for the *mousebites* """ self.offset = 0 - """ [number|string] Specify the *mousebites* and *vcuts* offset, positive offset puts the cuts into the board, + """ [number|string=0] Specify the *mousebites* and *vcuts* offset, positive offset puts the cuts into the board, negative puts the cuts into the tabs """ self.prolong = 0 - """ [number|string] Distance for tangential prolongation of the cuts (to cut through the internal corner fillets + """ [number|string=0] Distance for tangential prolongation of the cuts (to cut through the internal corner fillets caused by milling). Used for *mousebites* and *layer* """ self.clearance = 0 - """ [number|string] Specify clearance for copper around V-cuts """ + """ [number|string=0] Specify clearance for copper around V-cuts """ self.cutcurves = False """ Specify if curves should be approximated by straight cuts (e.g., for cutting tabs on circular boards). Used for *vcuts* """ self.cut_curves = None """ {cutcurves} """ self.linewidth = 0.3 - """ [number|string] Line width to plot cuts with """ + """ [number|string=0.3] Line width to plot cuts with """ self.line_width = None """ {linewidth} """ self.textthickness = 0.3 - """ [number|string] Text thickness for width """ + """ [number|string=0.3] Text thickness for width """ self.text_thickness = None """ {textthickness} """ self.textsize = 2 @@ -252,15 +252,15 @@ def __init__(self): self.text_size = None """ {textsize} """ self.endprolongation = 3 - """ [number|string] Prolongation on the end of V-CUT without text """ + """ [number|string=3] Prolongation on the end of V-CUT without text """ self.end_prolongation = None """ {endprolongation} """ self.textprolongation = 3 - """ [number|string] Prolongation of the text size of V-CUT """ + """ [number|string=3] Prolongation of the text size of V-CUT """ self.text_prolongation = None """ {textprolongation} """ self.textoffset = 3 - """ [number|string] Text offset from the V-CUT """ + """ [number|string=3] Text offset from the V-CUT """ self.text_offset = None """ {textoffset} """ self.template = 'V-CUT' @@ -289,56 +289,56 @@ def __init__(self): the boards have just a milled slot around their perimeter. Plugin: Uses an external python function, only `code` and `arg` are relevant """ self.hspace = 2 - """ [number|string] Specify the horizontal space between PCB and the frame/rail """ + """ [number|string=2] Specify the horizontal space between PCB and the frame/rail """ self.vspace = 2 - """ [number|string] Specify the vertical space between PCB and the frame/rail """ - self.space = None - """ [number|string] Specify the space between PCB and the frame/rail. Overrides `hspace` and `vspace` """ + """ [number|string=2] Specify the vertical space between PCB and the frame/rail """ + self.space = 2 + """ [number|string=2] Specify the space between PCB and the frame/rail. Overrides `hspace` and `vspace` """ self.width = 5 - """ [number|string] Specify with of the rails or frame """ + """ [number|string=5] Specify with of the rails or frame """ self.fillet = 0 - """ [number|string] Specify radius of fillet frame corners """ + """ [number|string=0] Specify radius of fillet frame corners """ self.chamfer = 0 - """ [number|string] Specify the size of chamfer frame corners. You can also separately specify `chamferwidth` + """ [number|string=0] Specify the size of chamfer frame corners. You can also separately specify `chamferwidth` and `chamferheight` to create a non 45 degrees chamfer """ self.chamferwidth = 0 """ [number|string] Width of the chamfer frame corners, used for non 45 degrees chamfer """ self.chamfer_width = None """ {chamferwidth} """ self.chamferheight = 0 - """ [number|string] Height of the chamfer frame corners, used for non 45 degrees chamfer """ + """ [number|string=0] Height of the chamfer frame corners, used for non 45 degrees chamfer """ self.chamfer_height = None """ {chamferheight} """ self.mintotalheight = 0 - """ [number|string] If needed, add extra material to the rail or frame to meet the minimal requested size. + """ [number|string=0] If needed, add extra material to the rail or frame to meet the minimal requested size. Useful for services that require minimal panel size """ self.min_total_height = None """ {mintotalheight} """ self.mintotalwidth = 0 - """ [number|string] If needed, add extra material to the rail or frame to meet the minimal requested size. + """ [number|string=0] If needed, add extra material to the rail or frame to meet the minimal requested size. Useful for services that require minimal panel size """ self.min_total_width = None """ {mintotalwidth} """ self.maxtotalheight = 10000 - """ [number|string] Maximal height of the panel """ + """ [number|string=10000] Maximal height of the panel """ self.max_total_height = None """ {maxtotalheight} """ self.maxtotalwidth = 10000 - """ [number|string] Maximal width of the panel """ + """ [number|string=10000] Maximal width of the panel """ self.max_total_width = None """ {maxtotalwidth} """ self.cuts = 'both' """ [none,both,v,h] Specify whether to add cuts to the corners of the frame for easy removal. Used for *frame* """ self.slotwidth = 2 - """ [number|string] Width of the milled slot for *tightframe* """ + """ [number|string=2] Width of the milled slot for *tightframe* """ self.slot_width = None """ {slotwidth} """ super().__init__() def config(self, parent): super().config(parent) - if self.space: + if self.get_user_defined('space'): self.hspace = self.vspace = self.space self.add_units(('hspace', 'vspace', 'space', 'width', 'fillet', 'chamfer', 'mintotalwidth', 'mintotalheight', 'slotwidth', 'chamferwidth', 'chamferheight')) @@ -350,15 +350,15 @@ def __init__(self): self.type = 'none' """ *[none,3hole,4hole,plugin] Add none, 3 or 4 holes to the (rail/frame of) the panel """ self.hoffset = 0 - """ [number|string] Horizontal offset from panel edges """ + """ [number|string=0] Horizontal offset from panel edges """ self.voffset = 0 - """ [number|string] Vertical offset from panel edges """ + """ [number|string=0] Vertical offset from panel edges """ self.size = 1.152 - """ [number|string] Diameter of the holes """ + """ [number|string=1.152] Diameter of the holes """ self.paste = False """ If True, the holes are included in the paste layer (therefore they appear on the stencil) """ self.soldermaskmargin = 0 - """ [number|string] Solder mask expansion/margin. Use 1.3mm for JLCPCB """ + """ [number|string=0] Solder mask expansion/margin. Use 1.3mm for JLCPCB """ self.solder_mask_margin = None """ {soldermaskmargin} """ super().__init__() @@ -374,15 +374,15 @@ def __init__(self): self.type = 'none' """ *[none,3fid,4fid,plugin] Add none, 3 or 4 fiducials to the (rail/frame of) the panel """ self.hoffset = 0 - """ [number|string] Horizontal offset from panel edges """ + """ [number|string=0] Horizontal offset from panel edges """ self.voffset = 0 - """ [number|string] Vertical offset from panel edges """ + """ [number|string=0] Vertical offset from panel edges """ self.coppersize = 1 - """ [number|string] Diameter of the copper spot """ + """ [number|string=1] Diameter of the copper spot """ self.copper_size = None """ {coppersize} """ self.opening = 1 - """ [number|string] Diameter of the solder mask opening """ + """ [number|string=1] Diameter of the solder mask opening """ self.paste = False """ Include the fiducials in the paste layer (therefore they appear on the stencil) """ super().__init__() @@ -410,21 +410,21 @@ def __init__(self): """ [tl,tr,bl,br,mt,mb,ml,mr,c] Origin of the text. Can be one of tl, tr, bl, br (corners), mt, mb, ml, mr (middle of sides), c (center). The anchors refer to the panel outline """ self.hoffset = 0 - """ [number|string] Specify the horizontal offset from anchor. Respects KiCAD coordinate system """ + """ [number|string=0] Specify the horizontal offset from anchor. Respects KiCAD coordinate system """ self.voffset = 0 - """ [number|string] Specify the vertical offset from anchor. Respects KiCAD coordinate system """ + """ [number|string=0] Specify the vertical offset from anchor. Respects KiCAD coordinate system """ self.orientation = 0 - """ [number|string] Specify the orientation (angle) """ + """ [number|string=0] Specify the orientation (angle) """ self.width = 1.5 - """ [number|string] Width of the characters (the same parameters as KiCAD uses) """ + """ [number|string=1.5] Width of the characters (the same parameters as KiCAD uses) """ self.height = 1.5 - """ [number|string] Height of the characters (the same parameters as KiCAD uses) """ + """ [number|string=1.5] Height of the characters (the same parameters as KiCAD uses) """ self.hjustify = 'center' """ [left,right,center] Horizontal justification of the text """ self.vjustify = 'center' """ [left,right,center] Vertical justification of the text """ self.thickness = 0.3 - """ [number|string] Stroke thickness """ + """ [number|string=0.3] Stroke thickness """ self.layer = 'F.SilkS' """ Specify text layer """ self.plugin = '' @@ -448,23 +448,23 @@ def __init__(self): self.type = 'none' """ *[none,solid,hatched,hex] How to fill non-board areas of the panel with copper """ self.clearance = 0.5 - """ [number|string] Extra clearance from the board perimeters. Suitable for, e.g., not filling the tabs with + """ [number|string=0.5] Extra clearance from the board perimeters. Suitable for, e.g., not filling the tabs with copper """ self.edgeclearance = 0.5 - """ [number|string] Specifies clearance between the fill and panel perimeter """ + """ [number|string=0.5] Specifies clearance between the fill and panel perimeter """ self.edge_clearance = None """ {edgeclearance} """ - self.layers = 'F.Cu,B.Cu' - """ [string|list(string)] List of layers to fill. Can be a comma-separated string. + self.layers = Optionable + """ [string|list(string)='F.Cu,B.Cu'] {comma_sep} List of layers to fill. Can be a comma-separated string. Using *all* means all external copper layers """ self.width = 1 - """ [number|string] The width of the hatched strokes """ + """ [number|string=1] The width of the hatched strokes """ self.spacing = 1 - """ [number|string] The space between the hatched strokes or hexagons """ + """ [number|string=1] The space between the hatched strokes or hexagons """ self.orientation = 45 - """ [number|string] The orientation of the hatched strokes """ + """ [number|string=45] The orientation of the hatched strokes """ self.diameter = 7 - """ [number|string] Diameter of hexagons """ + """ [number|string=7] Diameter of hexagons """ self.threshold = 15 """ Remove fragments smaller than threshold. Expressed as a percentage """ super().__init__() @@ -474,9 +474,9 @@ def config(self, parent): self.add_units(('width', 'spacing', 'clearance', 'edgeclearance', 'diameter')) self.add_angle(('orientation', )) self.threshold = str(self.threshold)+'%' - if not isinstance(self.layers, str) or self.layers != 'all': - if isinstance(self.layers, str): - self.layers = self.layers.split(',') + if len(self.layers) == 1 and self.layers[0] == 'all': + self.layers = 'all' + else: res = Layer.solve(self.layers) self.layers = ','.join([la.layer for la in res]) @@ -489,12 +489,12 @@ def __init__(self): self.copperfill = False """ Fill tabs and frame with copper (e.g., to save etchant or to increase rigidity of flex-PCB panels) """ self.millradius = 0 - """ [number|string] Simulate the milling operation (add fillets to the internal corners). + """ [number|string=0] Simulate the milling operation (add fillets to the internal corners). Specify mill radius (usually 1 mm). 0 radius disables the functionality """ self.mill_radius = None """ {millradius} """ self.millradiusouter = 0 - """ [number|string] Like `millradius`, but modifies only board outer counter. + """ [number|string=0] Like `millradius`, but modifies only board outer counter. No internal features of the board are affected """ self.mill_radius_outer = None """ {millradiusouter} """ @@ -526,7 +526,7 @@ def __init__(self): self.dimensions = False """ Draw dimensions with the panel size. """ self.edgewidth = 0.1 - """ [number|string] Specify line width for the Edge.Cuts of the panel """ + """ [number|string=0.1] Specify line width for the Edge.Cuts of the panel """ self.edge_width = None """ {edgewidth} """ super().__init__() @@ -564,15 +564,15 @@ def __init__(self): self.stack = 'inherit' """ [inherit,2layer,4layer,6layer] Used to reduce the number of layers used for the panel """ self.tolerance = 1 - """ [number|string] Extra space around the PCB reported size to be included. Used for *auto* and *annotation* """ + """ [number|string=1] Extra space around the PCB reported size to be included. Used for *auto* and *annotation* """ self.tlx = 0 - """ [number|string] Top left X coordinate of the rectangle used. Used for *rectangle* """ + """ [number|string=0] Top left X coordinate of the rectangle used. Used for *rectangle* """ self.tly = 0 - """ [number|string] Top left Y coordinate of the rectangle used. Used for *rectangle* """ + """ [number|string=0] Top left Y coordinate of the rectangle used. Used for *rectangle* """ self.brx = 0 - """ [number|string] Bottom right X coordinate of the rectangle used. Used for *rectangle* """ + """ [number|string=0] Bottom right X coordinate of the rectangle used. Used for *rectangle* """ self.bry = 0 - """ [number|string] Bottom right Y coordinate of the rectangle used. Used for *rectangle* """ + """ [number|string=0] Bottom right Y coordinate of the rectangle used. Used for *rectangle* """ self.ref = '' """ Reference for the kikit:Board footprint used to select the contour. Used for *annotation* """ super().__init__() @@ -591,35 +591,35 @@ def __init__(self): self.extends = '' """ A configuration to use as base for this one. Use the following format: `OUTPUT_NAME[CFG_NAME]` """ self.page = PanelizePage - """ *[dict] Sets page size on the resulting panel and position the panel in the page """ + """ *[dict=null] Sets page size on the resulting panel and position the panel in the page """ self.layout = PanelizeLayout - """ *[dict] Layout used for the panel """ + """ *[dict=null] Layout used for the panel """ self.tabs = PanelizeTabs - """ *[dict] Style of the tabs used to join the PCB copies """ + """ *[dict=null] Style of the tabs used to join the PCB copies """ self.cuts = PanelizeCuts - """ *[dict] Specify how to perform the cuts on the tabs separating the board """ + """ *[dict=null] Specify how to perform the cuts on the tabs separating the board """ self.framing = PanelizeFraming - """ *[dict] Specify the frame around the boards """ + """ *[dict=null] Specify the frame around the boards """ self.tooling = PanelizeTooling - """ *[dict] Used to add tooling holes to the (rail/frame of) the panel """ + """ *[dict=null] Used to add tooling holes to the (rail/frame of) the panel """ self.fiducials = PanelizeFiducials - """ *[dict] Used to add fiducial marks to the (rail/frame of) the panel """ + """ *[dict=null] Used to add fiducial marks to the (rail/frame of) the panel """ self.text = PanelizeText - """ [dict] Used to add text to the panel """ + """ [dict=null] Used to add text to the panel """ self.text2 = PanelizeText - """ [dict] Used to add text to the panel """ + """ [dict=null] Used to add text to the panel """ self.text3 = PanelizeText - """ [dict] Used to add text to the panel """ + """ [dict=null] Used to add text to the panel """ self.text4 = PanelizeText - """ [dict] Used to add text to the panel """ + """ [dict=null] Used to add text to the panel """ self.copperfill = PanelizeCopperfill - """ [dict] Fill non-board areas of the panel with copper """ + """ [dict=null] Fill non-board areas of the panel with copper """ self.post = PanelizePost - """ [dict] Finishing touches to the panel """ + """ [dict=null] Finishing touches to the panel """ self.debug = PanelizeDebug - """ [dict] Debug options """ + """ [dict=null] Debug options """ self.source = PanelizeSource - """ [dict] Used to adjust details of which part of the PCB is panelized """ + """ [dict=null] Used to adjust details of which part of the PCB is panelized """ self.expand_text = True """ Expand text variables and KiBot %X markers in text objects """ super().__init__() @@ -635,10 +635,12 @@ def config(self, parent): if name_is_number: raise KiPlotConfigurationError("Don't use a number as name, this can be confused with an index ({})". format(self.name)) - # Make None all things not specified - for k, v in self.get_attrs_gen(): - if isinstance(v, type): - setattr(self, k, None) + + def __str__(self): + txt = f'`{self.name}`' + if self.extends: + txt += f' (extends: {self.extends})' + return txt class PanelizeOptions(VariantOptions): @@ -649,7 +651,7 @@ def __init__(self): self.output = GS.def_global_output """ *Filename for the output (%i=panel, %x=kicad_pcb) """ self.configs = PanelizeConfig - """ *[list(dict)|list(string)|string] One or more configurations used to create the panel. + """ *[list(dict)|list(string)|string=[]] One or more configurations used to create the panel. Use a string to include an external configuration, i.e. `myDefault.json`. You can also include a preset using `:name`, i.e. `:vcuts`. Use a dict to specify the options using the KiBot YAML file """ @@ -747,10 +749,7 @@ def config(self, parent): list(map(self.solve_extends, filter(lambda x: 'extends' in x, configs))) super().config(parent) self.units = KIKIT_UNIT_ALIASES.get(self.units, self.units) - if isinstance(self.configs, type): - logger.warning(W_PANELEMPTY+'Generating a panel with default options, not very useful') - self.configs = [] - elif isinstance(self.configs, str): + if isinstance(self.configs, str): self.configs = [self.configs] for c, cfg in enumerate(self.configs): if isinstance(cfg, str): @@ -791,6 +790,8 @@ def run(self, output): cmd_kikit, version = self.ensure_tool_get_ver('KiKit') if GS.ki5 and version >= (1, 1, 0): raise KiPlotConfigurationError("Installed KiKit doesn't support KiCad 5") + if not self.get_user_defined('configs'): + logger.warning(W_PANELEMPTY+'Generating a panel with default options, not very useful') super().run(output) fname = self.save_tmp_board_if_variant(new_title=self.title, do_3D=True) # Create the command @@ -846,7 +847,7 @@ def __init__(self): super().__init__() with document: self.options = PanelizeOptions - """ *[dict] Options for the `Panelize` output """ + """ *[dict={}] Options for the `Panelize` output """ self._category = 'PCB/fabrication' @staticmethod diff --git a/kibot/out_pcb2blender_tools.py b/kibot/out_pcb2blender_tools.py index 82fe5728e..f8ef6e7bd 100644 --- a/kibot/out_pcb2blender_tools.py +++ b/kibot/out_pcb2blender_tools.py @@ -104,9 +104,8 @@ def __init__(self): self.sub_boards_stacked_prefix = 'stacked_' """ Prefix used for the stack files """ self.show_components = Optionable - """ *[list(string)|string=all] [none,all] List of components to include in the pads list, - can be also a string for `none` or `all`. The default is `all`. - Ranges like *R5-R10* are supported """ + """ *[list(string)|string='all'] [none,all,*] List of components to include in the pads list, + can be also a string for `none` or `all`. Ranges like *R5-R10* are supported """ super().__init__() self._expand_id = 'pcb2blender' self._expand_ext = 'pcb3d' @@ -116,13 +115,11 @@ def config(self, parent): self._filters_to_expand = False # List of components self._show_all_components = False - if isinstance(self.show_components, str): - if self.show_components == 'all': + if len(self.show_components) == 1 and self.show_components[0] in {'all', 'none'}: + if self.show_components[0] == 'all': self._show_all_components = True - self.show_components = [] - elif isinstance(self.show_components, type): - # Default is all - self._show_all_components = True + else: # if self.show_components[0] == 'none': + self.show_components = [] else: # a list self.show_components = self.solve_kf_filters(self.show_components) @@ -329,6 +326,13 @@ def run(self, output): self.undo_show_components() def get_targets(self, out_dir): + # Here we have an interesting case: + # We are listing the pads, but this needs variants applied. + # Otherwise a transform filter could invalidate the generated list. + # So we need to apply the variants. + self.load_list_components() + self.apply_show_components() + self.filter_pcb_components(do_3D=True) files = [] if self.board_bounds_create: files.append(os.path.join(out_dir, self.board_bounds_dir, self.board_bounds_file)) @@ -351,6 +355,8 @@ def get_targets(self, out_dir): files.append(os.path.join(subdir, self.sub_boards_stacked_prefix+stacked.name)) else: files.append(dir_name) + self.unfilter_pcb_components(do_3D=True) + self.undo_show_components() return files @@ -369,4 +375,4 @@ def __init__(self): self._category = 'PCB/3D/Auxiliar' with document: self.options = PCB2Blender_ToolsOptions - """ *[dict] Options for the `pcb2blender_tools` output """ + """ *[dict={}] Options for the `pcb2blender_tools` output """ diff --git a/kibot/out_pcb_print.py b/kibot/out_pcb_print.py index 90d632068..271805a73 100644 --- a/kibot/out_pcb_print.py +++ b/kibot/out_pcb_print.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2022-2023 Salvador E. Tropea -# Copyright (c) 2022-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2022-2024 Salvador E. Tropea +# Copyright (c) 2022-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Base idea: https://gitlab.com/dennevi/Board2Pdf/ (Released as Public Domain) """ @@ -45,7 +45,7 @@ from .kicad.v5_sch import SchError from .kicad.pcb import PCB from .misc import (PDF_PCB_PRINT, W_PDMASKFAIL, W_MISSTOOL, PCBDRAW_ERR, W_PCBDRAW, VIATYPE_THROUGH, VIATYPE_BLIND_BURIED, - VIATYPE_MICROVIA, FONT_HELP_TEXT, W_BUG16418) + VIATYPE_MICROVIA, FONT_HELP_TEXT, W_BUG16418, pretty_list, try_int, W_NOPAGES, W_NOLAYERS) from .create_pdf import create_pdf_from_pages from .macros import macros, document, output_class # noqa: F401 from .drill_marks import DRILL_MARKS_MAP, add_drill_marks @@ -165,12 +165,14 @@ def __init__(self): """ Mirror text in the footprints when mirror option is enabled and we plot a user layer """ self.monochrome = False """ Print in gray scale """ - self.scaling = None - """ *[number=1.0] Scale factor (0 means autoscaling)""" - self.autoscale_margin_x = None - """ [number=0] Horizontal margin used for the autoscaling mode [mm] """ - self.autoscale_margin_y = None - """ [number=0] Vertical margin used for the autoscaling mode [mm] """ + self.scaling = 1.0 + """ *[number=1.0] Scale factor (0 means autoscaling). When not defined we use the default value for the output """ + self.autoscale_margin_x = 0 + """ [number=0] Horizontal margin used for the autoscaling mode [mm]. + When not defined we use the default value for the output """ + self.autoscale_margin_y = 0 + """ [number=0] Vertical margin used for the autoscaling mode [mm]. + When not defined we use the default value for the output """ self.title = '' """ Text used to replace the sheet title. %VALUE expansions are allowed. If it starts with `+` the text is concatenated """ @@ -200,7 +202,8 @@ def __init__(self): self.sort_layers = False """ *Try to sort the layers in the same order that uses KiCad for printing """ self.layers = LayerOptions - """ *[list(dict)|list(string)|string] List of layers printed in this page. + """ *[list(dict)|list(string)|string='all'] [all,selected,copper,technical,user,inners,outers,*] + List of layers printed in this page. Order is important, the last goes on top. You can reuse other layers lists, some options aren't used here, but they are valid """ self.page_id = '%02d' @@ -216,7 +219,8 @@ def __init__(self): This can be used to generate a page for each copper layer, here you put `F.Cu`. See `repeat_layers` """ self.repeat_layers = LayerOptions - """ [list(dict)|list(string)|string] List of layers to replace `repeat_for_layer`. + """ [list(dict)|list(string)|string='inners'] [all,selected,copper,technical,user,inners,outers,*] + List of layers to replace `repeat_for_layer`. This can be used to generate a page for each copper layer, here you put `copper` """ self.repeat_inherit = True """ If we will inherit the options of the layer we are replacing. @@ -224,6 +228,17 @@ def __init__(self): self._scaling_example = 1.0 self._autoscale_margin_x_example = 0 self._autoscale_margin_y_example = 0 + self._layers = None + + def __str__(self): + txt = self.sheet + if self._layers: + txt += ' ['+pretty_list([la.layer for la in self._layers])+']' + if self.scaling != 1.0: + txt += ' auto' if not self.scaling else f' x{try_int(self.scaling)}' + if self.mirror: + txt += ' mirror' + return txt def expand_sheet_patterns(self, parent, sheet, layers, layer=None): sheet = sheet.replace('%ll', layers) @@ -235,36 +250,34 @@ def expand_sheet_patterns(self, parent, sheet, layers, layer=None): def config(self, parent): super().config(parent) - if isinstance(self.layers, type): - raise KiPlotConfigurationError("Missing `layers` list") # Fill the ID member for all the layers - self.layers = LayerOptions.solve(self.layers) + self._layers = LayerOptions.solve(self.layers) if self.sort_layers: - self.layers.sort(key=lambda x: get_priority(x._id), reverse=True) + self._layers.sort(key=lambda x: get_priority(x._id), reverse=True) if self.sheet_reference_color: self.validate_color('sheet_reference_color') if self.holes_color: self.validate_color('holes_color') - if self.scaling is None: + if not self.get_user_defined('scaling'): self.scaling = parent.scaling - if self.autoscale_margin_x is None: + if not self.get_user_defined('autoscale_margin_x'): self.autoscale_margin_x = parent.autoscale_margin_x - if self.autoscale_margin_y is None: + if not self.get_user_defined('self.autoscale_margin_y'): self.autoscale_margin_y = parent.autoscale_margin_y - self.sketch_pad_line_width = GS.from_mm(self.sketch_pad_line_width) + self._sketch_pad_line_width = GS.from_mm(self.sketch_pad_line_width) # Validate the repeat_* stuff if self.repeat_for_layer: layer = Layer.solve(self.repeat_for_layer) if len(layer) > 1: raise KiPlotConfigurationError('Please specify a single layer for `repeat_for_layer`') layer = layer[0] - self._repeat_for_layer = next(filter(lambda x: x._id == layer._id, self.layers), None) + self._repeat_for_layer = next(filter(lambda x: x._id == layer._id, self._layers), None) if self._repeat_for_layer is None: raise KiPlotConfigurationError("Layer `{}` specified in `repeat_for_layer` isn't valid".format(layer)) - self._repeat_for_layer_index = self.layers.index(self._repeat_for_layer) - if isinstance(self.repeat_layers, type): - raise KiPlotConfigurationError('`repeat_for_layer` specified, but nothing to repeat') + self._repeat_for_layer_index = self._layers.index(self._repeat_for_layer) self._repeat_layers = LayerOptions.solve(self.repeat_layers) + if not self._repeat_layers: + raise KiPlotConfigurationError('`repeat_for_layer` specified, but nothing to repeat') class PCB_PrintOptions(VariantOptions): @@ -305,7 +318,7 @@ def __init__(self): plot: uses KiCad Python API. Not available for KiCad 5. You get the default frame and some substitutions doesn't work """ self.pages = PagesOptions - """ *[list(dict)] List of pages to include in the output document. + """ *[list(dict)=[]] List of pages to include in the output document. Each page contains one or more layers of the PCB """ self.title = '' """ Text used to replace the sheet title. %VALUE expansions are allowed. @@ -372,7 +385,7 @@ def __init__(self): def get_layers_for_page(self, page): layer = '' - for la in page.layers: + for la in page._layers: if len(layer): layer += '+' layer = layer+la.layer @@ -380,8 +393,6 @@ def get_layers_for_page(self, page): def config(self, parent): super().config(parent) - if isinstance(self.pages, type): - raise KiPlotConfigurationError("Missing `pages` list") # Expand any repeat_for_layer pages = [] for page in self.pages: @@ -391,29 +402,30 @@ def config(self, parent): new_page = deepcopy(page) if page.repeat_inherit: la.copy_extra_from(page._repeat_for_layer) - new_page.layers[page._repeat_for_layer_index] = la - page.sheet = new_page.expand_sheet_patterns(parent, page.sheet, la.layer+'+'+layers_for_page, la) - page.layer_var = new_page.expand_sheet_patterns(parent, page.layer_var, la.layer+'+'+layers_for_page, la) + new_page._layers[page._repeat_for_layer_index] = la + new_page.sheet = new_page.expand_sheet_patterns(parent, page.sheet, la.layer+'+'+layers_for_page, la) + new_page.layer_var = new_page.expand_sheet_patterns(parent, page.layer_var, la.layer+'+'+layers_for_page, + la) pages.append(new_page) else: page.sheet = page.expand_sheet_patterns(parent, page.sheet, layers_for_page) page.layer_var = page.expand_sheet_patterns(parent, page.layer_var, layers_for_page) pages.append(page) - self.pages = pages + self._pages = pages # Color theme self._color_theme = load_color_theme(self.color_theme) if self._color_theme is None: raise KiPlotConfigurationError("Unable to load `{}` color theme".format(self.color_theme)) # Assign a color if none was defined layer_id2color = self._color_theme.layer_id2color - for p in self.pages: - for la in p.layers: + for p in self._pages: + for la in p._layers: if not la.color: if la._id in layer_id2color: la.color = layer_id2color[la._id] else: la.color = "#000000" - self.drill_marks = DRILL_MARKS_MAP[self.drill_marks] + self._drill_marks = DRILL_MARKS_MAP[self.drill_marks] self._expand_ext = self.format.lower() for member, color in self._pad_colors.items(): if getattr(self, member): @@ -425,10 +437,11 @@ def config(self, parent): if self.frame_plot_mechanism == 'plot' and GS.ki5: raise KiPlotConfigurationError("You can't use `plot` for `frame_plot_mechanism` with KiCad 5. It will crash.") KiConf.init(GS.pcb_file) - if self.sheet_reference_layout: - self.sheet_reference_layout = KiConf.expand_env(self.sheet_reference_layout) - if not os.path.isfile(self.sheet_reference_layout): - raise KiPlotConfigurationError("Missing page layout file: "+self.sheet_reference_layout) + self._sheet_reference_layout = self.sheet_reference_layout + if self._sheet_reference_layout: + self._sheet_reference_layout = KiConf.expand_env(self.sheet_reference_layout) + if not os.path.isfile(self._sheet_reference_layout): + raise KiPlotConfigurationError("Missing page layout file: "+self._sheet_reference_layout) if self.add_background: self.validate_color('background_color') if self.background_image: @@ -452,7 +465,7 @@ def get_id_and_ext(self, n=None, id='%02d'): def get_targets(self, out_dir): if self.format in ['SVG', 'PNG', 'EPS']: files = [] - for n, p in enumerate(self.pages): + for n, p in enumerate(self._pages): id, ext = self.get_id_and_ext(n, p.page_id) files.append(self.expand_filename(out_dir, self.output, id, ext)) return files @@ -1059,7 +1072,7 @@ def pdf_to_png(self, pdf_file, output): # Adjust the width convert_command = self.ensure_tool('ImageMagick') size = str(self.png_width)+'x' - for n in range(len(self.pages)): + for n in range(len(self._pages)): file = output % (n+1) cmd = [convert_command, file, '-resize', size, file] _run_command(cmd) @@ -1084,7 +1097,7 @@ def check_tools(self): # self.rsvg_command_eps = self.ensure_tool('rsvg2') def rename_pages(self, output_dir): - for n, p in enumerate(self.pages): + for n, p in enumerate(self._pages): id, ext = self.get_id_and_ext(n) cur_name = self.expand_filename(output_dir, self.output, id, ext) id, ext = self.get_id_and_ext(n, p.page_id) @@ -1134,6 +1147,8 @@ def mirror_text(self, page, id): def generate_output(self, output): self.check_tools() + if not self._pages: + logger.warning(W_NOPAGES+f'No pages to include in `{self._parent.name}`') # Avoid KiCad 5 complaining about fake vias diameter == drill == 0 self.min_w = 2 if GS.ki5 else 0 output_dir = os.path.dirname(output) @@ -1141,8 +1156,8 @@ def generate_output(self, output): logger.debug(f'Starting to generate `{output}`') logger.debug(f'- Temporal dir: {temp_dir_base}') self.find_paper_size() - if self.sheet_reference_layout: - layout = self.sheet_reference_layout + if self._sheet_reference_layout: + layout = self._sheet_reference_layout else: # Find the layout file layout = KiConf.fix_page_layout(GS.pro_file, dry=True)[1] @@ -1177,8 +1192,8 @@ def generate_output(self, output): if not self.individual_page_scaling: # Make all the layers in all the pages visible vis_layers = LSET() - for p in self.pages: - for la in p.layers: + for p in self._pages: + for la in p._layers: if la.use_for_center ^ self.invert_use_for_center: vis_layers.addLayer(la._id) if self.force_edge_cuts and (self.forced_edge_cuts_use_for_center ^ self.invert_use_for_center): @@ -1186,12 +1201,12 @@ def generate_output(self, output): GS.board.SetVisibleLayers(vis_layers) # Generate the output, page by page pages = [] - for n, p in enumerate(self.pages): + for n, p in enumerate(self._pages): # Make visible only the layers we need # This is very important when scaling, otherwise the results are controlled by the .kicad_prl (See #407) if self.individual_page_scaling: vis_layers = LSET() - for la in p.layers: + for la in p._layers: if la.use_for_center ^ self.invert_use_for_center: vis_layers.addLayer(la._id) if self.force_edge_cuts and (self.forced_edge_cuts_use_for_center ^ self.invert_use_for_center): @@ -1220,19 +1235,21 @@ def generate_output(self, output): po.SetPlotPadsOnSilkLayer(not p.exclude_pads_from_silkscreen) else: po.SetSketchPadsOnFabLayers(p.sketch_pads_on_fab_layers) - po.SetSketchPadLineWidth(p.sketch_pad_line_width) + po.SetSketchPadLineWidth(p._sketch_pad_line_width) filelist = [] - if self.force_edge_cuts and next(filter(lambda x: x._id == edge_id, p.layers), None) is None: - p.layers.append(edge_layer) + if self.force_edge_cuts and next(filter(lambda x: x._id == edge_id, p._layers), None) is None: + p._layers.append(edge_layer) user_layer_ids = set(Layer._get_user().values()) - for la in p.layers: + if p.layers == ['all'] and not p.get_user_defined('layers'): + logger.warning(W_NOLAYERS+f'No layers specified for `{p}` (`{self._parent.name}`), including `all`') + for la in p._layers: id = la._id logger.debug('- Plotting layer {} ({})'.format(la.layer, id)) po.SetPlotReference(la.plot_footprint_refs) po.SetPlotValue(la.plot_footprint_values) po.SetPlotInvisibleText(la.force_plot_invisible_refs_vals) # Avoid holes on non-copper layers - po.SetDrillMarksType(self.drill_marks if IsCopperLayer(id) else 0) + po.SetDrillMarksType(self._drill_marks if IsCopperLayer(id) else 0) pc.SetLayer(id) if id in user_layer_ids: self.mirror_text(p, id) @@ -1255,7 +1272,7 @@ def generate_output(self, output): elif self.frame_plot_mechanism == 'plot': self.plot_frame_api(pc, po, p) else: # internal - self.plot_frame_internal(pc, po, p, len(pages)+1, len(self.pages)) + self.plot_frame_internal(pc, po, p, len(pages)+1, len(self._pages)) color = p.sheet_reference_color if p.sheet_reference_color else self._color_theme.pcb_frame filelist.append((GS.pcb_basename+"-frame.svg", color)) # 3) Stack all layers in one file @@ -1322,7 +1339,7 @@ def __init__(self): super().__init__() with document: self.options = PCB_PrintOptions - """ *[dict] Options for the `pcb_print` output """ + """ *[dict={}] Options for the `pcb_print` output """ self._category = 'PCB/docs' @staticmethod diff --git a/kibot/out_pcb_variant.py b/kibot/out_pcb_variant.py index 48f9975f7..c99c45198 100644 --- a/kibot/out_pcb_variant.py +++ b/kibot/out_pcb_variant.py @@ -56,4 +56,4 @@ def __init__(self): super().__init__() with document: self.options = PCB_Variant_Options - """ *[dict] Options for the `pcb_variant` output """ + """ *[dict={}] Options for the `pcb_variant` output """ diff --git a/kibot/out_pcbdraw.py b/kibot/out_pcbdraw.py index 2b0a16b41..5c8b112b2 100644 --- a/kibot/out_pcbdraw.py +++ b/kibot/out_pcbdraw.py @@ -116,9 +116,6 @@ def to_dict(self): class PcbDrawRemap(Optionable): """ This class accepts a free form dict. No validation is done. """ - def __init__(self): - super().__init__() - def config(self, parent): pass @@ -136,12 +133,17 @@ def __init__(self): """ *Value to use for `ref` """ self.value = None """ {val} """ + self._ref_example = 'R1' + self._val_example = '10k' def config(self, parent): super().config(parent) if not self.ref or not self.val: raise KiPlotConfigurationError("The resistors remapping must specify a `ref` and a `val`") + def __str__(self): + return f'{self.ref} -> {self.val}' + class PcbDrawRemapComponents(Optionable): """ Reference -> Library + Footprint """ @@ -160,27 +162,37 @@ def __init__(self): """ *Component to use (from `lib`) """ self.component = None """ {comp} """ + self._ref_example = 'D1' + self._lib_example = 'LEDs' + self._comp_example = 'LED-5MM_green' def config(self, parent): super().config(parent) if not self.ref or not self.lib or not self.comp: raise KiPlotConfigurationError("The component remapping must specify a `ref`, a `lib` and a `comp`") + def __str__(self): + return f'{self.ref} -> {self.lib}:{self.comp}' + + +class PcbDrawLibs(Optionable): + _default = ['KiCAD-base'] + class PcbDrawOptions(VariantOptions): def __init__(self): with document: self.style = PcbDrawStyle - """ *[string|dict] PCB style (colors). An internal name, the name of a JSON file or the style options """ - self.libs = Optionable - """ [list(string)=[]] List of libraries """ + """ *[string|dict={}] PCB style (colors). An internal name, the name of a JSON file or the style options """ + self.libs = PcbDrawLibs + """ [list(string)] List of libraries """ self.placeholder = False """ Show placeholder for missing components """ self.remap = PcbDrawRemap - """ [dict|None] (DEPRECATED) Replacements for PCB references using specified components (lib:component). + """ [dict|string='None'] (DEPRECATED) Replacements for PCB references using specified components (lib:component). Use `remap_components` instead """ self.remap_components = PcbDrawRemapComponents - """ [list(dict)] Replacements for PCB references using specified components. + """ [list(dict)=[]] Replacements for PCB references using specified components. Replaces `remap` with type check """ self.no_drillholes = False """ Do not make holes transparent """ @@ -192,7 +204,7 @@ def __init__(self): """ [list(string)=[]] List of components to highlight. Filter expansion is also allowed here, see `show_components` """ self.show_components = Optionable - """ *[list(string)|string=none] [none,all] List of components to draw, can be also a string for none or all. + """ *[list(string)|string='none'] [none,all,*] List of components to draw, can be also a string for none or all. The default is none. There two ways of using this option, please consult the `add_to_variant` option. You can use `_kf(FILTER)` as an element in the list to get all the components that pass the filter. @@ -218,7 +230,7 @@ def __init__(self): self.output = GS.def_global_output """ *Name for the generated file """ self.margin = PcbMargin - """ [number|dict] Margin around the generated image [mm]. + """ [number|dict=0] Margin around the generated image [mm]. Using a number the margin is the same in the four directions """ self.outline_width = 0.15 """ [0,10] Width of the trace to draw the PCB border [mm]. @@ -226,9 +238,9 @@ def __init__(self): self.show_solderpaste = True """ Show the solder paste layers """ self.resistor_remap = PcbDrawResistorRemap - """ [list(dict)] List of resistors to be remapped. You can change the value of the resistors here """ + """ [list(dict)=[]] List of resistors to be remapped. You can change the value of the resistors here """ self.resistor_flip = Optionable - """ [string|list(string)=''] List of resistors to flip its bands """ + """ [string|list(string)=''] {comma_sep} List of resistors to flip its bands """ self.size_detection = 'kicad_edge' """ [kicad_edge,kicad_all,svg_paths] Method used to detect the size of the resulting image. The `kicad_edge` method uses the size of the board as reported by KiCad, @@ -251,37 +263,22 @@ def config(self, parent): if isinstance(bot, bool): self.bottom = bot super().config(parent) - # Libs - if isinstance(self.libs, type): - self.libs = ['KiCAD-base'] - # else: - # self.libs = ','.join(self.libs) # V-CUTS layer self._vcuts_layer = Layer.solve(self.vcuts_layer)[0]._id if self.vcuts else 41 # Highlight - if isinstance(self.highlight, type): - self.highlight = None - else: - self.highlight = self.solve_kf_filters(self.highlight) + self._highlight = self.solve_kf_filters(self.highlight) # Margin - self.margin = PcbMargin.solve(self.margin) + self._margin, self.margin = PcbMargin.solve(self.margin) # Filter - if isinstance(self.show_components, type): - # Default option is 'none' - self.show_components = None - elif isinstance(self.show_components, str): - if self.show_components == 'none': + if len(self.show_components) == 1 and self.show_components[0] in {'all', 'none'}: + if self.show_components[0] == 'none': self.show_components = None - else: # self.show_components == 'all' + else: # if self.show_components[0] == 'all': # Empty list: means we don't filter self.show_components = [] else: # A list self.show_components = self.solve_kf_filters(self.show_components) - # Resistors remap/flip - if isinstance(self.resistor_remap, type): - self.resistor_remap = [] - self.resistor_flip = Optionable.force_list(self.resistor_flip) - # Remap + # Resistors Remap self._remap = {} if isinstance(self.remap, PcbDrawRemap): for ref, v in self.remap._tree.items(): @@ -292,17 +289,15 @@ def config(self, parent): self._remap[ref] = tuple(lib_comp) else: raise KiPlotConfigurationError("Wrong PcbDraw remap, must be `ref: lib:component` ({}: {})".format(ref, v)) - if isinstance(self.remap_components, list): - for mapping in self.remap_components: - self._remap[mapping.ref] = (mapping.lib, mapping.comp) + elif isinstance(self.remap, str) and self.remap != 'None': + raise KiPlotConfigurationError(f"Unknown `{self.remap}` option") + for mapping in self.remap_components: + self._remap[mapping.ref] = (mapping.lib, mapping.comp) # Style - if isinstance(self.style, type): - # Apply the global defaults - style = PcbDrawStyle() - style.config(self) - self.style = style.to_dict() - elif isinstance(self.style, PcbDrawStyle): - self.style = self.style.to_dict() + if isinstance(self.style, PcbDrawStyle): + self._style = self.style.to_dict() + else: + self._style = self.style self._expand_id = 'bottom' if self.bottom else 'top' self._expand_ext = self.format @@ -412,8 +407,8 @@ def remapping_fun(ref, lib, name): else: logger.debug('Using all components') - if self.highlight is not None: - highlight_set = set(self.expand_filtered_components(self.highlight)) + if self._highlight: + highlight_set = set(self.expand_filtered_components(self._highlight)) plot_components.highlight = lambda ref: ref in highlight_set return plot_components @@ -447,13 +442,13 @@ def create_image(self, name, board): plotter.libs = self.libs plotter.render_back = self.bottom plotter.mirror = self.mirror - plotter.margin = self.margin + plotter.margin = self._margin plotter.svg_precision = self.svg_precision - if self.style: - if isinstance(self.style, str): - plotter.resolve_style(self.style) + if self._style: + if isinstance(self._style, str): + plotter.resolve_style(self._style) else: - plotter.style = self.style + plotter.style = self._style plotter.plot_plan = [PlotSubstrate(drill_holes=not self.no_drillholes, outline_width=mm2ki(self.outline_width))] if self.show_solderpaste: plotter.plot_plan.append(PlotPaste()) @@ -535,7 +530,7 @@ def __init__(self): super().__init__() with document: self.options = PcbDrawOptions - """ *[dict] Options for the `pcbdraw` output """ + """ *[dict={}] Options for the `pcbdraw` output """ self._category = 'PCB/docs' def get_dependencies(self): diff --git a/kibot/out_pdf.py b/kibot/out_pdf.py index 4a6aa8b3e..f9d0cf277 100644 --- a/kibot/out_pdf.py +++ b/kibot/out_pdf.py @@ -56,5 +56,5 @@ def __init__(self): super().__init__() with document: self.options = PDFOptions - """ *[dict] Options for the `pdf` output """ + """ *[dict={}] Options for the `pdf` output """ self._category = 'PCB/docs' diff --git a/kibot/out_pdf_pcb_print.py b/kibot/out_pdf_pcb_print.py index 6cb483989..a14371590 100644 --- a/kibot/out_pdf_pcb_print.py +++ b/kibot/out_pdf_pcb_print.py @@ -11,7 +11,6 @@ """ from .gs import GS from .out_any_pcb_print import Any_PCB_PrintOptions -from .error import KiPlotConfigurationError from .misc import FONT_HELP_TEXT from .macros import macros, document, output_class # noqa: F401 from .layer import Layer @@ -42,15 +41,12 @@ def __init__(self): super().__init__() with document: self.options = PDF_PCB_PrintOptions - """ *[dict] Options for the `pdf_pcb_print` output """ + """ *[dict={}] Options for the `pdf_pcb_print` output """ self.layers = Layer - """ *[list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to include in the PDF """ + """ *[list(dict)|list(string)|string='all'] [all,selected,copper,technical,user,inners,outers,*] List + of PCB layers to include in the PDF """ self._category = 'PCB/docs' def config(self, parent): super().config(parent) - # We need layers - if isinstance(self.layers, type): - raise KiPlotConfigurationError("Missing `layers` list") self.options.set_layers(self.layers) diff --git a/kibot/out_pdf_sch_print.py b/kibot/out_pdf_sch_print.py index df1732814..46a2b3d96 100644 --- a/kibot/out_pdf_sch_print.py +++ b/kibot/out_pdf_sch_print.py @@ -41,7 +41,7 @@ def __init__(self): super().__init__() with document: self.options = PDF_SCH_PrintOptions - """ *[dict] Options for the `pdf_sch_print` output """ + """ *[dict={}] Options for the `pdf_sch_print` output """ self._sch_related = True self._category = 'Schematic/docs' diff --git a/kibot/out_pdfunite.py b/kibot/out_pdfunite.py index 945d11a78..d0987ecdc 100644 --- a/kibot/out_pdfunite.py +++ b/kibot/out_pdfunite.py @@ -35,6 +35,11 @@ def __init__(self): self.filter = r'.*\.pdf' """ A regular expression that source files must match """ + def __str__(self): + txt = self.from_output if self.from_output else self.source + filter = f' (filter: `{self.filter}`)' if self.filter and self.filter != '.*' else '' + return txt+filter + class PDFUniteOptions(BaseOptions): def __init__(self): @@ -42,7 +47,7 @@ def __init__(self): self.output = GS.def_global_output """ *Name for the generated PDF (%i=name of the output %x=pdf) """ self.outputs = FilesList - """ *[list(dict)] Which files will be included """ + """ *[list(dict)=[]] Which files will be included """ self.use_external_command = False """ Use the `pdfunite` tool instead of PyPDF2 Python module """ super().__init__() @@ -50,7 +55,7 @@ def __init__(self): def config(self, parent): super().config(parent) - if isinstance(self.outputs, type): + if not self.outputs: KiPlotConfigurationError('Nothing to join') self._expand_id = parent.name @@ -140,7 +145,7 @@ def __init__(self): super().__init__() with document: self.options = PDFUniteOptions - """ *[dict] Options for the `pdfunite` output """ + """ *[dict={}] Options for the `pdfunite` output """ self._none_related = True def get_dependencies(self): diff --git a/kibot/out_populate.py b/kibot/out_populate.py index 0d52733a6..8c7d1664f 100644 --- a/kibot/out_populate.py +++ b/kibot/out_populate.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2022-2023 Salvador E. Tropea -# Copyright (c) 2022-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2022-2024 Salvador E. Tropea +# Copyright (c) 2022-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # No longer a dependency, now included. # Will be fixed when the code supports mistune 3 ... or never @@ -15,7 +15,7 @@ import os # Here we import the whole module to make monkeypatch work from .error import KiPlotConfigurationError -from .misc import W_PCBDRAW, RENDERERS +from .misc import W_PCBDRAW, RENDERERS, W_NOPOPMD from .gs import GS from .kiplot import run_output, look_for_output from .optionable import Optionable @@ -23,6 +23,17 @@ from .macros import macros, document, output_class # noqa: F401 from . import log logger = log.get_logger() +DUMMY_MD = """# Very basic populate example + +This is the board without components: + +- [[front | ]] Front side +- [[back | ]] Back side + +Now you solder all the components for the front side + +- [[front | _kf(_none) ]] All components soldered +""" def pcbdraw_warnings(tag, msg): @@ -42,11 +53,12 @@ def __init__(self): self.format = 'html' """ *[html,md] Format for the generated output """ self.initial_components = Optionable - """ [string|list(string)=''] List of components soldered before the first step """ + """ [string|list(string)=''] {comma_sep} List of components soldered before the first step """ self.input = '' """ *Name of the input file describing the assembly. Must be a markdown file. Note that the YAML section of the file will be skipped, all the needed information - comes from this output and the `renderer` output """ + comes from this output and the `renderer` output, not from the YAML section. + When empty we use a dummy template, you should provide something better """ self.imgname = 'img/populating_%d.%x' """ Pattern used for the image names. The `%d` is replaced by the image number. The `%x` is replaced by the extension. Note that the format is selected by the @@ -56,12 +68,8 @@ def __init__(self): def config(self, parent): super().config(parent) # Validate the input file name - if not self.input: - raise KiPlotConfigurationError('You must specify an input markdown file') - if not os.path.isfile(self.input): + if self.input and not os.path.isfile(self.input): raise KiPlotConfigurationError('Missing input file `{}`'.format(self.input)) - # Initial components - self.initial_components = Optionable.force_list(self.initial_components) # Validate the image pattern name if '%d' not in self.imgname: raise KiPlotConfigurationError('The image pattern must contain `%d` `{}`'.format(self.imgname)) @@ -113,10 +121,14 @@ def run(self, dir_name): # Check the renderer output is valid self._renderer = look_for_output(self.renderer, 'renderer', self._parent, RENDERERS) # Load the input content - try: - _, content = load_content(self.input) - except IOError: - raise KiPlotConfigurationError('Failed to load `{}`'.format(self.input)) + if not self.input: + content = DUMMY_MD + logger.warning(W_NOPOPMD+f'No populate plan for `{self._parent.name}`, using a very simple one') + else: + try: + _, content = load_content(self.input) + except IOError: + raise KiPlotConfigurationError('Failed to load `{}`'.format(self.input)) # Load the template if self.format == 'html': data_path = get_data_path() @@ -159,5 +171,5 @@ def __init__(self): super().__init__() with document: self.options = PopulateOptions - """ *[dict] Options for the `populate` output """ + """ *[dict={}] Options for the `populate` output """ self._category = 'PCB/docs' diff --git a/kibot/out_position.py b/kibot/out_position.py index faf929545..446620df1 100644 --- a/kibot/out_position.py +++ b/kibot/out_position.py @@ -1,14 +1,13 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2023 Salvador E. Tropea -# Copyright (c) 2020-2023 Instituto Nacional de TecnologĆ­a Industrial +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial # Copyright (c) 2019 Romain Deterre (@rdeterre) -# License: GPL-3.0 +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Adapted from: https://github.com/johnbeard/kiplot/pull/10 import os from re import compile from datetime import datetime -from collections import OrderedDict from .gs import GS from .kiplot import run_command from .misc import UI_SMD, UI_VIRTUAL, MOD_THROUGH_HOLE, MOD_SMD, MOD_EXCLUDE_FROM_POS_FILES @@ -20,6 +19,7 @@ logger = log.get_logger() ref_re = compile(r'([^\d]+)([\?\d]+)') +DEFAULT_COLUMNS = ['Ref', 'Val', 'Package', 'PosX', 'PosY', 'Rot', 'Side'] def _ref_key(ref_str): @@ -40,7 +40,9 @@ def check_names(top, bot): class PosColumns(Optionable): """ Which columns we want and its names """ - def __init__(self): + _default = DEFAULT_COLUMNS + + def __init__(self, id=None, name=None): super().__init__() self._unknown_is_error = True with document: @@ -50,12 +52,18 @@ def __init__(self): """ Name to use in the output file. The id is used when empty """ self._id_example = 'Ref' self._name_example = 'Reference' + if id is not None: + self.id = id + self.name = name def config(self, parent): super().config(parent) if not self.id: raise KiPlotConfigurationError("Missing or empty `id` in columns list ({})".format(str(self._tree))) + def __str__(self): + return f'{self.id} -> {self.name}' + class PositionOptions(VariantOptions): def __init__(self): @@ -77,7 +85,6 @@ def __init__(self): """ [list(dict)|list(string)] Which columns are included in the output """ self.right_digits = 4 """ number of digits for mantissa part of coordinates (0 is auto) """ - self.columns = PosColumns self.bottom_negative_x = False """ Use negative X coordinates for footprints on bottom layer """ self.use_aux_axis_as_origin = True @@ -96,21 +103,16 @@ def __init__(self): def config(self, parent): super().config(parent) - if isinstance(self.columns, type): - # Default list of columns - self.columns = OrderedDict([('Ref', 'Ref'), ('Val', 'Val'), ('Package', 'Package'), ('PosX', 'PosX'), - ('PosY', 'PosY'), ('Rot', 'Rot'), ('Side', 'Side')]) - else: - new_columns = OrderedDict() - for col in self.columns: - if isinstance(col, str): - # Just a string, add to the list of used - new_name = new_col = col - else: - new_col = col.id - new_name = col.name if col.name else new_col - new_columns[new_col] = new_name - self.columns = new_columns + new_columns = [] + for col in self.columns: + if isinstance(col, str): + # Just a string, add to the list of used + new_name = new_col = col + else: + new_col = col.id + new_name = col.name if col.name else new_col + new_columns.append(PosColumns(new_col, new_name)) + self._columns = new_columns self._expand_ext = 'pos' if self.format == 'ASCII' else self.format.lower() def _do_position_plot_ascii(self, output_dir, columns, modulesStr, maxSizes, modules_side): @@ -255,10 +257,10 @@ def run(self, fname): self.run_gerber(output_dir) return self.filter_pcb_components() - columns = self.columns.values() + columns = tuple(o.name for o in self._columns) conv = GS.unit_name_to_scale_factor(self.units) # Format all strings - comps_hash = self.get_refs_hash() + comps_hash = self.get_refs_hash_multi() modules = [] modules_side = [] is_pure_smd, is_not_virtual = self.get_attr_tests() @@ -277,6 +279,8 @@ def run(self, fname): if comps_hash: c = comps_hash.get(ref, None) if c: + # Multiple components with the same reference is "normal" for a panel + c = c.pop() logger.debug('- fit: {} include: {}'.format(c.fitted, c.included)) if not c.fitted or not c.included: continue @@ -309,7 +313,8 @@ def run(self, fname): float_format = "{{:.{}f}}".format(self.right_digits) else: float_format = "{}" - for k in self.columns: + for col in self._columns: + k = col.id if k == 'Ref': row.append(quote_char+ref+quote_char) elif k == 'Val': @@ -357,7 +362,7 @@ def __init__(self): super().__init__() with document: self.options = PositionOptions - """ *[dict] Options for the `position` output """ + """ *[dict={}] Options for the `position` output """ self._category = 'PCB/fabrication/assembly' @staticmethod diff --git a/kibot/out_ps.py b/kibot/out_ps.py index 62525c4a0..176c22b4e 100644 --- a/kibot/out_ps.py +++ b/kibot/out_ps.py @@ -73,5 +73,5 @@ def __init__(self): super().__init__() with document: self.options = PSOptions - """ *[dict] Options for the `ps` output """ + """ *[dict={}] Options for the `ps` output """ self._category = 'PCB/docs' diff --git a/kibot/out_ps_sch_print.py b/kibot/out_ps_sch_print.py index 60ced0b6b..be5683bcc 100644 --- a/kibot/out_ps_sch_print.py +++ b/kibot/out_ps_sch_print.py @@ -40,7 +40,7 @@ def __init__(self): super().__init__() with document: self.options = PS_SCH_PrintOptions - """ *[dict] Options for the `ps_sch_print` output """ + """ *[dict={}] Options for the `ps_sch_print` output """ self._sch_related = True self._category = 'Schematic/docs' diff --git a/kibot/out_qr_lib.py b/kibot/out_qr_lib.py index 3173fa47f..33f031a88 100644 --- a/kibot/out_qr_lib.py +++ b/kibot/out_qr_lib.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2022-2023 Salvador E. Tropea -# Copyright (c) 2022-2023 Instituto Nacional de TecnologĆ­a Industrial +# Copyright (c) 2022-2024 Salvador E. Tropea +# Copyright (c) 2022-2024 Instituto Nacional de TecnologĆ­a Industrial # License: AGPL-3.0 # Project: KiBot (formerly KiPlot) """ @@ -13,6 +13,7 @@ """ import os from .gs import GS +from .misc import W_NOQR from .optionable import BaseOptions, Optionable from .error import KiPlotConfigurationError from .kicad.pcb import save_pcb_from_sexp @@ -82,6 +83,9 @@ def config(self, parent): super().config(parent) self.layer = 'F.SilkS' if self.layer == 'silk' else 'F.Cu' + def __str__(self): + return f'`{self.name} "{self.text}" ({self.size_sch}/{self.size_pcb} {self.size_units}) [{self.layer}]' + class QR_LibOptions(BaseOptions): def __init__(self): @@ -96,15 +100,13 @@ def __init__(self): self.use_sch_dir = True """ Generate the libs relative to the schematic/PCB dir """ self.qrs = QRCodeOptions - """ *[list(dict)] QR codes to include in the library """ + """ *[dict|list(dict)=[{}]] QR codes to include in the library """ super().__init__() self._expand_id = 'qr' self._expand_ext = 'lib' def config(self, parent): super().config(parent) - if isinstance(self.qrs, type): - raise KiPlotConfigurationError("You must specify at least one QR code") names = set() for qr in self.qrs: if qr.name in names: @@ -459,6 +461,8 @@ def run(self, output): global qrcodegen if qrcodegen is None: qrcodegen = self.ensure_tool('QRCodeGen') + if not self.get_user_defined('qrs'): + logger.warning(W_NOQR+'Using a default QR configuration, please provide one') # Now we are sure we have qrcodegen QR_ECCS = {'low': qrcodegen.QrCode.Ecc.LOW, 'medium': qrcodegen.QrCode.Ecc.MEDIUM, @@ -527,7 +531,7 @@ def __init__(self): self.priority = 90 with document: self.options = QR_LibOptions - """ *[dict] Options for the `boardview` output """ + """ *[dict={}] Options for the `boardview` output """ self._both_related = True self._update_mode = False # The help is inherited and already mentions the default priority diff --git a/kibot/out_render_3d.py b/kibot/out_render_3d.py index aa05725bd..decde4e3a 100644 --- a/kibot/out_render_3d.py +++ b/kibot/out_render_3d.py @@ -113,6 +113,9 @@ def __init__(self): self.auto_crop = False """ When enabled the image will be post-processed to remove the empty space around the image. In this mode the `background2` is changed to be the same as `background1` """ + self.enable_crop_workaround = False + """ Some versions of Image Magick (i.e. the one in Debian 11) needs two passes to crop. + Enable it to force a double pass. It was the default in KiBot 1.7.0 and older """ self.transparent_background = False """ When enabled the image will be post-processed to make the background transparent. In this mode the `background1` and `background2` colors are ignored """ @@ -320,13 +323,17 @@ def run(self, output): self.add_options(cmd) # The board self.apply_show_components() - board_name = self.filter_components(highlight=set(self.expand_kf_components(self.highlight))) + board_name = self.filter_components(highlight=set(self.expand_kf_components(self._highlight))) self.undo_show_components() cmd.extend([board_name, os.path.dirname(output)]) # Execute it self.exec_with_retry(self.add_extra_options(cmd), RENDER_3D_ERR) if self.auto_crop: - _run_command([convert_command, output, '-trim', '+repage', '-trim', '+repage', output]) + cmd = [convert_command, output, '-trim', '+repage'] + if self.enable_crop_workaround: + cmd.extend(['-trim', '+repage']) + cmd.append(output) + _run_command(cmd) if self.transparent_background: _run_command([convert_command, output, '-fuzz', str(self.transparent_background_fuzz)+'%', '-transparent', self.color_str_to_rgb(self.transparent_background_color), output]) @@ -342,7 +349,7 @@ def __init__(self): super().__init__() with document: self.options = Render3DOptions - """ *[dict] Options for the `render_3d` output """ + """ *[dict={}] Options for the `render_3d` output """ self._category = 'PCB/3D' def get_renderer_options(self): diff --git a/kibot/out_report.py b/kibot/out_report.py index ca8187204..92027a7cf 100644 --- a/kibot/out_report.py +++ b/kibot/out_report.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2022-2023 Salvador E. Tropea -# Copyright (c) 2022-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2022-2024 Salvador E. Tropea +# Copyright (c) 2022-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) """ Dependencies: @@ -15,15 +15,16 @@ extra_arch: ['texlive-core'] comments: 'In CI/CD environments: the `kicad_auto_test` docker image contains it.' """ +import math import os import re import pcbnew from .gs import GS -from .misc import (UI_SMD, UI_VIRTUAL, MOD_THROUGH_HOLE, MOD_SMD, MOD_EXCLUDE_FROM_POS_FILES, W_WRONGEXT, +from .misc import (UI_SMD, UI_VIRTUAL, MOD_THROUGH_HOLE, MOD_SMD, MOD_EXCLUDE_FROM_POS_FILES, W_WRONGEXT, W_UNKPADSH, W_WRONGOAR, W_ECCLASST, VIATYPE_THROUGH, VIATYPE_BLIND_BURIED, VIATYPE_MICROVIA, W_BLINDVIAS, W_MICROVIAS) from .registrable import RegOutput -from .out_base import BaseOptions +from .out_base import VariantOptions from .error import KiPlotConfigurationError from .kiplot import config_output, run_command from .dep_downloader import get_dep_data @@ -175,15 +176,20 @@ def list_nice(names): return res[2:] -class ReportOptions(BaseOptions): +class PadProperty(object): + pass + + +class ReportOptions(VariantOptions): def __init__(self): with document: self.output = GS.def_global_output """ *Output file name (%i='report', %x='txt') """ self.template = 'full' - """ *Name for one of the internal templates (full, full_svg, simple) or a custom template file. + """ *[full,full_svg,simple,testpoints,*] Name for one of the internal templates or a custom template file. Environment variables and ~ are allowed. - Note: when converting to PDF PanDoc can fail on some Unicode values (use `simple_ASCII`) """ + Note: when converting to PDF PanDoc can fail on some Unicode values (use `simple_ASCII`). + Note: the testpoint variables uses the `testpoint` fabrication attribute of pads """ self.convert_from = 'markdown' """ Original format for the report conversion. Current templates are `markdown`. See `do_convert` """ self.convert_to = 'pdf' @@ -202,6 +208,14 @@ def __init__(self): """ When computing the Eurocircuits category: Final holes sizes smaller or equal to this given diameter can be reduced to accommodate the correct annular ring values. Use 0 to disable it """ + self.alloy_specific_gravity = 7.4 + """ Specific gravity of the alloy used for the solder paste, in g/cm3. Used to compute solder paste usage """ + self.flux_specific_gravity = 1.0 + """ Specific gravity of the flux used for the solder paste, in g/cm3. Used to compute solder paste usage """ + self.solder_paste_metal_amount = 87.75 + """ [0,100] Amount of metal in the solder paste (percentage). Used to compute solder paste usage """ + self.stencil_thickness = 0.12 + """ Stencil thickness in mm. Used to compute solder paste usage """ super().__init__() self._expand_id = 'report' self._expand_ext = 'txt' @@ -220,7 +234,7 @@ def config(self, parent): if self.template.endswith('_ASCII'): self.template = self.template[:-6] self.to_ascii = True - if self.template.lower() in ('full', 'simple', 'full_svg'): + if self.template.lower() in ('full', 'simple', 'full_svg', 'testpoints'): self.template = os.path.abspath(os.path.join(GS.get_resource_path('report_templates'), 'report_'+self.template.lower()+'.txt')) if not os.path.isabs(self.template): @@ -378,6 +392,34 @@ def _context_images(self, line, images): text += self.do_replacements(line, context) return text + def context_nets_without_testpoint(self, line): + """ Replace iterator for the `nets_without_testpoint` context """ + text = '' + for s in self._nets_without_testpoint: + context = {'net': s} + text += self.do_replacements(line, context) + return text + + def context_nets_with_one_testpoint(self, line): + """ Replace iterator for the `nets_with_one_testpoint` context """ + text = '' + for n, pads in self._nets_with_tp.items(): + if len(pads) > 1: + continue + context = {'net': n, 'pad': pads[0]} + text += self.do_replacements(line, context) + return text + + def context_nets_with_many_testpoints(self, line): + """ Replace iterator for the `nets_with_many_testpoints` context """ + text = '' + for n, pads in self._nets_with_tp.items(): + if len(pads) == 1: + continue + context = {'net': n, 'pads': ", ".join(pads)} + text += self.do_replacements(line, context) + return text + def context_layer_pdfs(self, line): """ Replace iterator for the `layer_pdfs` context """ return self._context_images(line, self._layer_pdfs) @@ -581,7 +623,9 @@ def collect_data(self, board): is_pure_smd, is_not_virtual = self.get_attr_tests() npth_attrib = 3 if GS.ki5 else pcbnew.PAD_ATTRIB_NPTH min_oar = GS.from_mm(0.1) + pad_properties = [] for m in modules: + ref = m.GetReference() layer = m.GetLayer() if layer == top_layer: if is_pure_smd(m): @@ -595,6 +639,13 @@ def collect_data(self, board): self.bot_tht += 1 pads = m.Pads() for pad in pads: + # Pad properties + if not GS.ki5: + p = PadProperty() + p.fab_property = pad.GetProperty() + p.net = pad.GetNetname() + p.name = ref+'.'+pad.GetNumber() + pad_properties.append(p) dr = pad.GetDrillSize() if not dr.x: continue @@ -727,6 +778,108 @@ def collect_data(self, board): ########################################################### self._track_sizes = board.GetTrackWidthList() self._tracks_defined = set(self._track_sizes) + ########################################################### + # Solder paste stats + # https://www.indium.com/blog/calculating-solder-paste-usage.php#ixzz246lOB9HY + # https://github.com/mfussi/kicad-solderpaste-usage + ########################################################### + self.paste_pads_front = self.paste_pads_bottom = 0 + self.paste_pads_front_area = self.paste_pads_bottom_area = 0 + for m in modules: + for pad in m.Pads(): + on_top = pad.IsOnLayer(pcbnew.F_Paste) + on_bottom = pad.IsOnLayer(pcbnew.B_Paste) + if not on_top and not on_bottom: + continue + shape = pad.GetShape() + size = pad.GetSize() + if GS.ki6: + area = GS.to_mm(GS.to_mm(pad.GetEffectivePolygon().Area())) + elif shape == pcbnew.PAD_SHAPE_CIRCLE: + radius = GS.to_mm(size.x/2) + area = math.pi*radius*radius + elif shape == pcbnew.PAD_SHAPE_RECT: + area = GS.to_mm(size.x)*GS.to_mm(size.y) + elif shape == pcbnew.PAD_SHAPE_OVAL: + if size.x > size.y: + dia_major = GS.to_mm(size.x) + dia_minor = GS.to_mm(size.y) + else: + dia_major = GS.to_mm(size.y) + dia_minor = GS.to_mm(size.x) + area = dia_major*dia_minor + # Adjust the area, here the dia_minor is the diameter for a circle + area -= (1-math.pi/4)*dia_minor*dia_minor + elif shape == pcbnew.PAD_SHAPE_TRAPEZOID: + delta = pad.GetDelta() + if delta.x: + a = GS.to_mm(size.y-delta.y) + b = GS.to_mm(size.y+delta.y) + h = GS.to_mm(size.x) + else: + a = GS.to_mm(size.x-delta.x) + b = GS.to_mm(size.x+delta.x) + h = GS.to_mm(size.y) + area = a*b/2*h + elif shape == pcbnew.PAD_SHAPE_ROUNDRECT: + area = GS.to_mm(size.x)*GS.to_mm(size.y) + # Adjust the corners area + radius = GS.to_mm(pad.GetRoundRectCornerRadius()) + # Taking the 4 corners: + # - We computed a square: 2*radius*2*radius = 4*radius + # - But we should compute a circle: PI*radius*radius + area -= (4-math.pi)*radius*radius + # Introduced in KiCad 6, so we can use GetEffectivePolygon + # elif shape == pcbnew.PAD_SHAPE_CHAMFERED_RECT: + # area = GS.to_mm(size.x)*GS.to_mm(size.y) + # sz = pad.GetChamferRectRatio()*GS.to_mm(min(size.x, size.y)) + # corners = pad.GetChamferPositions() + # n_corners = 1 if corners & 1 else 0 + # n_corners += 1 if corners & 2 else 0 + # n_corners += 1 if corners & 4 else 0 + # n_corners += 1 if corners & 8 else 0 + # area -= n_corners*sz*sz/2 + elif shape == pcbnew.PAD_SHAPE_CUSTOM: + poly = pad.GetCustomShapeAsPolygon() + area = GS.to_mm(GS.to_mm(poly.Area())) + else: + logger.warning(f"{W_UNKPADSH}Unknown shape for pad `{pad.GetNumber()}` of `{m.GetReference()}` " + + get_pad_info(pad)) + if on_top: + self.paste_pads_front += 1 + self.paste_pads_front_area += area + else: + self.paste_pads_bottom += 1 + self.paste_pads_bottom_area += area + self._paste_pads_front_vol = self.paste_pads_front_area * self.stencil_thickness + self._paste_pads_bottom_vol = self.paste_pads_bottom_area * self.stencil_thickness + amount_of_metal = self.solder_paste_metal_amount/100.0 + # Greely Formula + self.solder_paste_gravity = ((self.alloy_specific_gravity * self.flux_specific_gravity) / + (((1.0 - amount_of_metal) * self.alloy_specific_gravity) + + (amount_of_metal * self.flux_specific_gravity))) + self.solder_paste_front = (self._paste_pads_front_vol / 100.0) * self.solder_paste_gravity + self.solder_paste_bottom = (self._paste_pads_bottom_vol / 100.0) * self.solder_paste_gravity + self.paste_pads = self.paste_pads_front + self.paste_pads_bottom + self.paste_pads_area = self.paste_pads_front_area + self.paste_pads_bottom_area + self.solder_paste = self.solder_paste_front + self.solder_paste_bottom + ########################################################### + # Testpoints report + ########################################################### + nets = GS.board.GetNetsByName() + self.testpoint_pads = 0 + self.total_pads = len(pad_properties) + nets_with_tp = {} + for p in pad_properties: + if p.fab_property == pcbnew.PAD_PROP_TESTPOINT: + self.testpoint_pads += 1 + nets_with_tp[p.net] = nets_with_tp.get(p.net, [])+[p.name] + cnd = GS.board.GetConnectivity() + self.total_nets = cnd.GetNetCount() + self.nets_with_testpoint = len(nets_with_tp) + self.testpoint_coverage = (self.nets_with_testpoint/self.total_nets)*100 if self.total_nets else 0 + self._nets_without_testpoint = [str(n) for n in nets.keys() if str(n) and str(n) not in nets_with_tp] + self._nets_with_tp = nets_with_tp def eval_conditional(self, line): context = {k: getattr(self, k) for k in dir(self) if k[0] != '_' and not callable(getattr(self, k))} @@ -823,6 +976,7 @@ def convert(self, fname): run_command(cmd) def run(self, fname): + super().run(fname) self.pcb_material = GS.global_pcb_material self.solder_mask_color = GS.global_solder_mask_color self.solder_mask_color_top = GS.global_solder_mask_color_top @@ -840,7 +994,10 @@ def run(self, fname): self.impedance_controlled = GS.global_impedance_controlled self.stackup = 'yes' if GS.stackup else '' self._stackup = GS.stackup if GS.stackup else [] + filtered = self.filter_pcb_components() self.collect_data(GS.board) + if filtered: + self.unfilter_pcb_components() base_dir = os.path.dirname(fname) # Collect the PCB layers and schematic prints self._layer_pdfs = [] @@ -892,7 +1049,7 @@ def __init__(self): super().__init__() with document: self.options = ReportOptions - """ *[dict] Options for the `report` output """ + """ *[dict={}] Options for the `report` output """ self._category = 'PCB/docs' @staticmethod diff --git a/kibot/out_sch_variant.py b/kibot/out_sch_variant.py index 8d4db0f24..d66ad6e1a 100644 --- a/kibot/out_sch_variant.py +++ b/kibot/out_sch_variant.py @@ -46,7 +46,7 @@ def __init__(self): super().__init__() with document: self.options = Sch_Variant_Options - """ *[dict] Options for the `sch_variant` output """ + """ *[dict={}] Options for the `sch_variant` output """ self._sch_related = True def get_output_sch_name(self, out_dir): diff --git a/kibot/out_stencil_3d.py b/kibot/out_stencil_3d.py index 5a5dd5a14..eee2e874b 100644 --- a/kibot/out_stencil_3d.py +++ b/kibot/out_stencil_3d.py @@ -130,7 +130,7 @@ def __init__(self): super().__init__() with document: self.options = Stencil_3D_Options - """ *[dict] Options for the `stencil_3d` output """ + """ *[dict={}] Options for the `stencil_3d` output """ self._category = 'PCB/fabrication/assembly' @staticmethod diff --git a/kibot/out_stencil_for_jig.py b/kibot/out_stencil_for_jig.py index d8617da8f..3ad19abbf 100644 --- a/kibot/out_stencil_for_jig.py +++ b/kibot/out_stencil_for_jig.py @@ -130,7 +130,7 @@ def __init__(self): super().__init__() with document: self.options = Stencil_For_Jig_Options - """ *[dict] Options for the `stencil_for_jig` output """ + """ *[dict={}] Options for the `stencil_for_jig` output """ self._category = 'PCB/fabrication/assembly' @staticmethod diff --git a/kibot/out_step.py b/kibot/out_step.py index 1d815f981..36f5b5209 100644 --- a/kibot/out_step.py +++ b/kibot/out_step.py @@ -28,8 +28,9 @@ def __init__(self): with document: self.metric_units = True """ Use metric units instead of inches """ - self._origin = 'grid' - """ *Determines the coordinates origin. Using grid the coordinates are the same as you have in the design sheet. + self.origin = 'grid' + """ *[grid,drill,*] Determines the coordinates origin. Using grid the coordinates are the same as you have in the + design sheet. The drill option uses the auxiliary reference defined by the user. You can define any other origin using the format 'X,Y', i.e. '3.2,-10' """ self.min_distance = -1 @@ -43,15 +44,11 @@ def __init__(self): super().__init__() self._expand_ext = 'step' - @property - def origin(self): - return self._origin - - @origin.setter - def origin(self, val): + def config(self, parent): + super().config(parent) + val = self.origin if (val not in ['grid', 'drill']) and (re.match(r'[-\d\.]+\s*,\s*[-\d\.]+\s*$', val) is None): raise KiPlotConfigurationError('Origin must be `grid` or `drill` or `X,Y`') - self._origin = val def run(self, output): super().run(output) @@ -97,7 +94,7 @@ def __init__(self): super().__init__() with document: self.options = STEPOptions - """ *[dict] Options for the `step` output """ + """ *[dict={}] Options for the `step` output """ self._category = 'PCB/3D' @staticmethod diff --git a/kibot/out_svg.py b/kibot/out_svg.py index 122473a8e..4e8958fb9 100644 --- a/kibot/out_svg.py +++ b/kibot/out_svg.py @@ -44,7 +44,7 @@ def __init__(self): The `kicad_all` method uses the whole size reported by KiCad. Usually includes extra space. See `limit_viewbox` option """ self.margin = PcbMargin - """ [number|dict] Margin around the view box [mm]. + """ [number|dict=0] Margin around the view box [mm]. Using a number the margin is the same in the four directions. See `limit_viewbox` option """ self._plot_format = PLOT_FORMAT_SVG @@ -67,7 +67,7 @@ def read_vals_from_po(self, po): def config(self, parent): super().config(parent) # Margin - self.margin = PcbMargin.solve(self.margin) + self._margin, self.margin = PcbMargin.solve(self.margin) def run(self, output_dir, layers): super().run(output_dir, layers) @@ -79,8 +79,8 @@ def run(self, output_dir, layers): # Limit the view box of the SVG bbox = GS.get_rect_for(GS.board.ComputeBoundingBox(self.size_detection == 'kicad_edge')) # Apply the margin (left right top bottom) - bbox = (bbox[0]-self.margin[0], bbox[1]-self.margin[2], - bbox[2]+self.margin[0]+self.margin[1], bbox[3]+self.margin[2]+self.margin[3]) + bbox = (bbox[0]-self._margin[0], bbox[1]-self._margin[2], + bbox[2]+self._margin[0]+self._margin[1], bbox[3]+self._margin[2]+self._margin[3]) # Width/height of the used area in cm width = ToMM(bbox[2])*0.1 height = ToMM(bbox[3])*0.1 @@ -106,5 +106,5 @@ def __init__(self): super().__init__() with document: self.options = SVGOptions - """ *[dict] Options for the `svg` output """ + """ *[dict={}] Options for the `svg` output """ self._category = 'PCB/docs' diff --git a/kibot/out_svg_pcb_print.py b/kibot/out_svg_pcb_print.py index 2cb89c8d2..c4b642cf9 100644 --- a/kibot/out_svg_pcb_print.py +++ b/kibot/out_svg_pcb_print.py @@ -12,7 +12,6 @@ import os from .gs import GS from .out_any_pcb_print import Any_PCB_PrintOptions -from .error import KiPlotConfigurationError from .kicad.patch_svg import patch_svg_file from .kicad.pcb import PCB from .misc import FONT_HELP_TEXT @@ -58,15 +57,12 @@ def __init__(self): super().__init__() with document: self.options = SVG_PCB_PrintOptions - """ *[dict] Options for the `pdf_pcb_print` output """ + """ *[dict={}] Options for the `pdf_pcb_print` output """ self.layers = Layer - """ *[list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers] - List of PCB layers to include in the PDF """ + """ *[list(dict)|list(string)|string='all'] [all,selected,copper,technical,user,inners,outers,*] List + of PCB layers to include in the PDF """ self._category = 'PCB/docs' def config(self, parent): super().config(parent) - # We need layers - if isinstance(self.layers, type): - raise KiPlotConfigurationError("Missing `layers` list") self.options.set_layers(self.layers) diff --git a/kibot/out_svg_sch_print.py b/kibot/out_svg_sch_print.py index f325d013e..1a4e70822 100644 --- a/kibot/out_svg_sch_print.py +++ b/kibot/out_svg_sch_print.py @@ -42,7 +42,7 @@ def __init__(self): super().__init__() with document: self.options = SVG_SCH_PrintOptions - """ *[dict] Options for the `svg_sch_print` output """ + """ *[dict={}] Options for the `svg_sch_print` output """ self._sch_related = True self._category = 'Schematic/docs' diff --git a/kibot/out_vrml.py b/kibot/out_vrml.py index 850c26452..07ae07df0 100644 --- a/kibot/out_vrml.py +++ b/kibot/out_vrml.py @@ -73,7 +73,7 @@ def run(self, name): command = self.ensure_tool('KiAuto') super().run(name) self.apply_show_components() - board_name = self.filter_components(highlight=set(self.expand_kf_components(self.highlight)), force_wrl=True) + board_name = self.filter_components(highlight=set(self.expand_kf_components(self._highlight)), force_wrl=True) self.undo_show_components() cmd = [command, 'export_vrml', '--output_name', os.path.basename(name), '-U', self.model_units] if self.dir_models: @@ -109,7 +109,7 @@ def __init__(self): self._category = 'PCB/3D' with document: self.options = VRMLOptions - """ *[dict] Options for the `vrml` output """ + """ *[dict={}] Options for the `vrml` output """ @staticmethod def get_conf_examples(name, layers): diff --git a/kibot/pre_annotate_pcb.py b/kibot/pre_annotate_pcb.py index 7a0e66a19..aadf98896 100644 --- a/kibot/pre_annotate_pcb.py +++ b/kibot/pre_annotate_pcb.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2022-2023 Salvador E. Tropea -# Copyright (c) 2022-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2022-2024 Salvador E. Tropea +# Copyright (c) 2022-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) from .error import PlotError from .gs import GS @@ -119,24 +119,22 @@ def sort_key(ops, obj, top=True): @pre_class class Annotate_PCB(BasePreFlight): # noqa: F821 - """ [dict] Annotates the PCB according to physical coordinates. + """ Annotate PCB + Annotates the PCB according to physical coordinates. This preflight modifies the PCB and schematic, use it only in revision control environments. Used to assign references according to footprint coordinates. The project must be fully annotated first """ - def __init__(self, name, value): - super().__init__(name, value) + def __init__(self): + super().__init__() self._sch_related = True self._pcb_related = True + with document: + self.annotate_pcb = Annotate_PCBOptions + """ [dict={}] Options for the `annotate_pcb` preflight """ - def config(self): - o = Annotate_PCBOptions() - o.set_tree(self._value) - o.config(self) - self._value = o - - @classmethod - def get_doc(cls): - return cls.__doc__, Annotate_PCBOptions + def __str__(self): + v = self.annotate_pcb + return f'{self.type} (top: {v.top_main_axis}/{v.top_start} bot: {v.bottom_main_axis}/{v.bottom_start})' def get_example(): """ Returns a YAML value for the example config """ @@ -180,7 +178,7 @@ def annotate_ki5(self, changes): o.ref = c.ref_prefix+str(new_ref_suffix) def run(self): - o = self._value + o = self.annotate_pcb # # PCB part # @@ -228,8 +226,7 @@ def run(self): changes[old_ref] = m.new_ref_suffix m.footprint.SetReference(new_ref) logger.debug('- Saving PCB') - GS.make_bkp(GS.pcb_file) - GS.board.Save(GS.pcb_file) + GS.save_pcb() # # SCH part # diff --git a/kibot/pre_annotate_power.py b/kibot/pre_annotate_power.py index e6d582685..0e3f71f3d 100644 --- a/kibot/pre_annotate_power.py +++ b/kibot/pre_annotate_power.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2022 Salvador E. Tropea -# Copyright (c) 2022 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2022-2024 Salvador E. Tropea +# Copyright (c) 2022-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) from .gs import (GS) from .kiplot import load_sch from .misc import W_NOANNO -from .macros import macros, pre_class # noqa: F401 +from .macros import macros, document, pre_class # noqa: F401 from .log import get_logger logger = get_logger(__name__) @@ -14,12 +14,16 @@ @pre_class class Annotate_Power(BasePreFlight): # noqa: F821 - """ [boolean=false] Annotates all power components. + """ Annotate Power + Annotates all power components. This preflight modifies the schematic, use it only in revision control environments. Used to solve ERC problems when using filters that remove power reference numbers """ - def __init__(self, name, value): - super().__init__(name, value) + def __init__(self): + super().__init__() self._sch_related = True + with document: + self.annotate_power = False + """ Enable this preflight """ def annotate_ki5(self): """ Annotate power components for KiCad 5 """ diff --git a/kibot/pre_any_replace.py b/kibot/pre_any_replace.py index cca54d4d0..8d7f15cf7 100644 --- a/kibot/pre_any_replace.py +++ b/kibot/pre_any_replace.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2021-2023 Salvador E. Tropea -# Copyright (c) 2021-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2021-2024 Salvador E. Tropea +# Copyright (c) 2021-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) import os import re from subprocess import run, PIPE from .error import KiPlotConfigurationError -from .misc import FAILED_EXECUTE, W_EMPTREP, W_BADCHARS +from .misc import FAILED_EXECUTE, W_EMPTREP, W_BADCHARS, pretty_list from .optionable import Optionable from .pre_base import BasePreFlight from .gs import GS @@ -38,6 +38,7 @@ def __init__(self): self.after = '' """ Text to add after the output of `command` """ self._relax_check = False + self._tag_example = 'version' def config(self, parent): super().config(parent) @@ -45,6 +46,14 @@ def config(self, parent): raise KiPlotConfigurationError("No tag to replace specified ({})".format(str(self._tree))) self.tag = self.tag_delimiter + re.escape(self.tag) + self.tag_delimiter + def __str__(self): + txt = self.tag_delimiter+self.tag+self.tag_delimiter + if self.text: + txt += f' -> `{self.text}`' + else: + txt += f' -> command(`{self.command}`)' + return txt + class Base_ReplaceOptions(Optionable): """ PCB/SCH replacement options """ @@ -60,22 +69,10 @@ def __init__(self): Important: on KiCad 6 the title block data is optional. This command will work only if you have a date in the PCB/Schematic """ self.replace_tags = TagReplaceBase - """ [dict|list(dict)] Tag or tags to replace """ - - def config(self, parent): - super().config(parent) - if isinstance(self.replace_tags, type): - self.replace_tags = [] - elif isinstance(self.replace_tags, TagReplaceBase): - self.replace_tags = [self.replace_tags] + """ [dict|list(dict)=[]] Tag or tags to replace """ class Base_Replace(BasePreFlight): # noqa: F821 - """ [dict] Replaces tags in the PCB/schematic. I.e. to insert the git hash or last revision date """ - def __init__(self, name, value): - super().__init__(name, value) - self._context = '' # PCB/SCH - @classmethod def get_example(cls): """ Returns a YAML value for the example config """ @@ -86,12 +83,18 @@ def get_example(cls): "\n before: 'Git hash: <'" "\n after: '>'".format(cls._context, cls._context)) - def replace(self, file): + def __str__(self): + res = self.type + main_value = getattr(self, self.type) + if len(main_value.replace_tags): + res += f' ({pretty_list([v.tag for v in main_value.replace_tags])})' + return res + + def replace(self, file, o): logger.debug('Applying replacements to `{}`'.format(file)) with open(file, 'rt') as f: content = f.read() os.environ['KIBOT_' + type(self)._context + '_NAME'] = file - o = self._value bash_command = None for r in o.replace_tags: text = r.text diff --git a/kibot/pre_any_xrc.py b/kibot/pre_any_xrc.py index 677094b60..6ba4c6e5d 100644 --- a/kibot/pre_any_xrc.py +++ b/kibot/pre_any_xrc.py @@ -17,8 +17,8 @@ from .pre_base import BasePreFlight from .pre_filters import FilterOptions, FiltersOptions from .macros import macros, document # noqa: F401 -from .log import get_logger -logger = get_logger(__name__) +from . import log +logger = log.get_logger(__name__) UNITS_2_KICAD = {'millimeters': 'mm', 'inches': 'in', 'mils': 'mils'} @@ -49,28 +49,34 @@ def __init__(self): self.output = GS.def_global_output """ *Name for the generated archive (%i=erc %x=according to format) """ self.format = Optionable - """ [string|list(string)='HTML'][RPT,HTML,CSV,JSON] Format/s used for the report. + """ [string|list(string)='HTML'] [RPT,HTML,CSV,JSON] {comma_sep} Format/s used for the report. You can specify multiple formats """ self.warnings_as_errors = False - """ Warnings are considered errors, they still reported as errors, but consider it an error """ + """ Warnings are considered errors, they still reported as warnings """ self.dont_stop = False """ Continue even if we detect errors """ self.units = 'millimeters' """ [millimeters,inches,mils] Units used for the positions. Affected by global options """ + self.force_english = True + """ Force english messages. KiCad 8.0.4 introduced translation, breaking filters for previous versions. + Disable it if you prefer using the system wide language """ + self.category = Optionable + """ [string|list(string)=''] {comma_sep} The category for this preflight. If not specified an internally defined + category is used. + Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. + The categories are currently used for `navigate_results` """ super().__init__() self.filters = FilterOptionsXRC - self.set_doc('filters', " [list(dict)] Used to manipulate the violations. Avoid using the *filters* preflight") + self.set_doc('filters', " [list(dict)=[]] Used to manipulate the violations. Avoid using the *filters* preflight") self._unknown_is_error = True self._format_example = 'HTML,RPT' def config(self, parent): super().config(parent) - self.format = Optionable.force_list(self.format) if not self.format: self.format = ['HTML'] - for f in self.format: - if f not in {'RPT', 'HTML', 'CSV', 'JSON'}: - raise KiPlotConfigurationError(f'unkwnown format `{f}`') + if not self.category: + self.category = self.force_list(parent._category) class DRCOptions(ERCOptions): @@ -88,26 +94,27 @@ def __init__(self): class XRC(BasePreFlight): - def __init__(self, name, value, cls): - super().__init__(name, value) + def __init__(self, cls): + super().__init__() self._opts_cls = cls - def config(self): - if isinstance(self._value, bool): - f = self._opts_cls() - f.enabled = self._value - f.format = ['HTML'] - elif isinstance(self._value, dict): - f = self._opts_cls() - f.set_tree(self._value) - f.config(self) - else: - raise KiPlotConfigurationError('must be boolean or dict') + def __str__(self): + return f'{self.type}: {self._enabled} ({self._format})' + + def config(self, parent): + super().config(parent) + ops = self.erc if self._sch_related else self.drc + if isinstance(ops, bool): + new_ops = self._opts_cls() + new_ops.enabled = ops + new_ops.format = ['HTML'] + new_ops.filters = [] + ops = new_ops # Transfer the options to this class - for k, v in dict(f.get_attrs_gen()).items(): + for k, v in dict(ops.get_attrs_gen()).items(): setattr(self, '_'+k, v) - self._format = f.format - self._filters = None if isinstance(f.filters, type) else f.unparsed + self._format = ops.format + self._filters = ops.filters self._expand_ext = self._format[0].lower() self.dir = self._dir @@ -292,7 +299,14 @@ def run(self): # Run the xRC from the CLI cmd = self.get_command(output) logger.info(f'- Running the {nm}') + # Introduced in 8.0.4: translated messages + if self._force_english: + old_lang = os.environ.get('LANG') + if old_lang: + os.environ['LANG'] = 'en' run_command(cmd) + if self._force_english and old_lang: + os.environ['LANG'] = old_lang # Read the result with open(output, 'rt') as f: raw = f.read() @@ -318,9 +332,19 @@ def run(self): # Write it to the output file with open(output, 'wt') as f: f.write(res) + # Sanity check + if self._dont_stop and self.c_warn and log.stop_on_warnings: + logger.error("Inconsistent options, asked to don't stop, but also to stop on warnings") # Report the result - self.report('error', self.c_err, data) + revert_stop_on_warnings = False + if self.c_warn and log.stop_on_warnings: + revert_stop_on_warnings = True + log.stop_on_warnings = False self.report('warning', self.c_warn, data) + if revert_stop_on_warnings: + log.stop_on_warnings = True + logger.check_warn_stop() + self.report('error', self.c_err, data) # Check the final status error_level = -1 if self._dont_stop else err if self.c_err: diff --git a/kibot/pre_base.py b/kibot/pre_base.py index ac3ba2d4f..c9f95a51a 100644 --- a/kibot/pre_base.py +++ b/kibot/pre_base.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2023 Salvador E. Tropea -# Copyright (c) 2020-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) import os from shutil import rmtree @@ -15,17 +15,15 @@ logger = get_logger(__name__) -class BasePreFlight(Registrable): +class BasePreFlight(Optionable, Registrable): _registered = {} _in_use = {} _options = {} _targets = None _configured = False - def __init__(self, name, value): + def __init__(self): super().__init__() - self._value = value - self._name = name self._sch_related = False self._pcb_related = False self._any_related = False # True if we need an schematic OR a PCB @@ -34,15 +32,25 @@ def __init__(self, name, value): self._expand_ext = '' self._files_to_remove = [] self._category = None - # Compatibility with outputs - self.name = name - self.comment = '' + self.type = self.__class__.__name__.lower() - def config(self): + # Compatibility with outputs for navigate_results + @property + def name(self): + return self.type + + # Compatibility with outputs for navigate_results + @property + def comment(self): + return '' + + def config(self, parent): """ Default configuration assumes this is just a boolean """ - if not isinstance(self._value, bool): - raise KiPlotConfigurationError('must be boolean') - self._enabled = self._value + super().config(parent) + # If this is just a boolean copy the result to _enabled + main_value = getattr(self, self.type) + if isinstance(main_value, bool): + self._enabled = main_value @staticmethod def reset(): @@ -55,14 +63,34 @@ def reset(): # No longer configured BasePreFlight._configured = False + @staticmethod + def get_object_for(name, value=None): + obj = BasePreFlight._registered[name]() + assert name == obj.type + if value is None: + cur_doc, _, _ = obj.get_doc(name, no_basic=True) + _, _, def_val, _ = obj.get_valid_types(cur_doc, skip_extra=True) + assert def_val is not None, f'Missing default for `{name}`' + value = eval(def_val.capitalize()) + if isinstance(value, bool): + # Create an object that is enabled + value = True + obj._value = value + obj.set_tree({name: value}) + return obj + @staticmethod def add_preflight(o_pre): - BasePreFlight._in_use[o_pre._name] = o_pre + BasePreFlight._in_use[o_pre.type] = o_pre @staticmethod def add_preflights(pre): for p in pre: - BasePreFlight._in_use[p._name] = p + BasePreFlight._in_use[p.type] = p + + @staticmethod + def remove_preflight(o_pre): + del BasePreFlight._in_use[o_pre.type] @staticmethod def get_preflight(name): @@ -106,7 +134,7 @@ def configure_all(): # Configure all of them for k, v in BasePreFlight._in_use.items(): logger.debug('Configuring preflight '+k) - v.config() + v.config(None) except KiPlotConfigurationError as e: GS.exit_with_error("In preflight `"+str(k)+"`: "+str(e), EXIT_BAD_CONFIG) BasePreFlight._configured = True @@ -139,7 +167,7 @@ def disable(self): # return self._enabled def __str__(self): - return "{}: {}".format(self._name, self._enabled) + return "{}: {}".format(self.type, self._enabled) def is_sch(self): """ True for preflights that needs the schematic """ @@ -157,10 +185,6 @@ def get_example(): """ Returns a YAML value for the example config """ return 'true' - @classmethod - def get_doc(cls): - return cls.__doc__, None - def run(self): pass @@ -204,17 +228,17 @@ def _find_variant_name(self): def _find_subpcb(self): # Preflights doesn't have a variant, but we could have one global default - if hasattr(self, '_variant') and self._variant and self.variant._sub_pcb: - return self.variant._sub_pcb.name + if hasattr(self, '_variant') and self._variant and self._variant._sub_pcb: + return self._variant._sub_pcb.name return Optionable._find_global_subpcb() def ensure_tool(self, name): """ Looks for a mandatory dependency """ - return GS.check_tool_dep(self._name, name, fatal=True) + return GS.check_tool_dep(self.type, name, fatal=True) def check_tool(self, name): """ Looks for a dependency """ - return GS.check_tool_dep(self._name, name, fatal=False) + return GS.check_tool_dep(self.type, name, fatal=False) def add_extra_options(self, cmd, dir=None): """ KiAuto extra options (debug, record, etc.) """ diff --git a/kibot/pre_check_fields.py b/kibot/pre_check_fields.py new file mode 100644 index 000000000..84118e7fa --- /dev/null +++ b/kibot/pre_check_fields.py @@ -0,0 +1,149 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2024 Salvador E. Tropea +# Copyright (c) 2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 +# Project: KiBot (formerly KiPlot) +import re +from .error import KiPlotConfigurationError +from .kiplot import load_sch +from .misc import CHECK_FIELD, W_CHKFLD +from .optionable import Optionable +from .gs import GS +from .macros import macros, document, pre_class # noqa: F401 +from . import log + +logger = log.get_logger() +OPERATIONS = {'>': lambda v, r: v > r, + '<': lambda v, r: v < r, + '=': lambda v, r: v == r, + '<=': lambda v, r: v <= r, + '>=': lambda v, r: v >= r} + + +class FieldCheck(Optionable): + """ Condition to apply to a field """ + def __init__(self): + super().__init__() + self._unknown_is_error = True + with document: + self.field = '' + """ *Name of field to check """ + self.regex = '' + """ *Regular expression to match the field content. Note that technically we do a search, not a match """ + self.regexp = None + """ {regex} """ + self.severity = 'error' + """ [error,warning,info,skip,continue] Default severity applied to various situations. + The *error* will stop execution. + The *warning* and *info* will generate a message and continue with the rest of the tests. + In the *skip* case we jump to the next component. + Use *continue* to just skip this test and apply the rest + """ + self.severity_missing = 'continue' + """ [error,warning,info,skip,continue,default] What to do if the field isn't defined. + Default means to use the *severity* option """ + self.severity_no_match = 'default' + """ [error,warning,info,skip,continue,default] What to do when the regex doesn't match. + Default means to use the *severity* option """ + self.severity_no_number = 'default' + """ [error,warning,info,skip,continue,default] What to do if we don't get a number for a *numeric_condition*. + Default means to use the *severity* option """ + self.severity_fail_condition = 'default' + """ [error,warning,info,skip,continue,default] What to do when the *numeric_condition* isn't met. + Default means to use the *severity* option """ + self.numeric_condition = 'none' + """ [>,>=,<,<=,=,none] Convert the group 1 of the regular expression to a number and apply this operation + to the *numeric_reference* value """ + self.numeric_reference = 0 + """ Value to compare using *numeric_condition* """ + self._field_example = 'temperature' + + def __str__(self): + txt = f'`{self.field}` matched to `{self.regex}`' + if self.numeric_condition != 'none': + txt += f' {self.numeric_condition} {self.numeric_reference}' + txt += f' [{self.severity}]' + return txt + + def config(self, parent): + super().config(parent) + if not self.field: + raise KiPlotConfigurationError(f"Missing field name ({self._tree})") + try: + self._regex = re.compile(self.regex) + except re.error as e: + raise KiPlotConfigurationError(f'Wrong regular expression: `{self.regex}` ({e})') + if self.numeric_condition != 'none' and self._regex.groups < 1: + raise KiPlotConfigurationError(f'No groups in regular expression: `{self.regex}`') + + +@pre_class +class Check_Fields(BasePreFlight): # noqa: F821 + """ Check Fields + Checks to apply to the schematic fields. + You can define conditions that must be met by the fields. + The checks are applied to every component in the schematic. + When an error is hit execution is stopped. + One use is to check that all components are suitable for a temperature range. + In this case a field must declare the temperature range """ + def __init__(self): + super().__init__() + with document: + self.check_fields = FieldCheck + """ [dict|list(dict)=[]] One or more check rules """ + + @classmethod + def get_example(cls): + """ Returns a YAML value for the example config """ + return ("\n - field: 'temperature'\n" + r" regex: '(-?\d+).+?(?:-?\d+).*'" + "\n numeric_condition: '<='" + "\n numeric_reference: -10") + + def apply_severity(self, check, severity, msg): + if severity == 'default': + severity = check.severity + if severity == 'error': + GS.exit_with_error(msg, CHECK_FIELD) + elif severity == 'warning': + logger.warning(W_CHKFLD+msg) + elif severity == 'info': + logger.info(msg) + return severity == 'skip' + + def __str__(self): + return f'{self.type} ({[v.field for v in self.check_fields]})' + + def run(self): + load_sch() + if not GS.sch: + return + comps = GS.sch.get_components() + for c in comps: + for check in self.check_fields: + field = check.field.lower() + if not c.is_field(field): + # No field with this name + if self.apply_severity(check, check.severity_missing, f'{c.ref} missing field `{check.field}`'): + break + else: + v = c.get_field_value(field) + match = check._regex.search(v) + if not match: + if self.apply_severity(check, check.severity_no_match, + f"{c.ref} field `{check.field}` doesn't match `{check.regex}` ({v})"): + break + elif check.numeric_condition != 'none': + matched = match.group(1) + try: + matched = float(matched) + except ValueError: + if self.apply_severity(check, check.severity_no_number, + f"{c.ref} field `{check.field}` matched `{matched}`, but isn't a number"): + break + else: + continue + if not OPERATIONS[check.numeric_condition](matched, check.numeric_reference): + if self.apply_severity(check, check.severity_fail_condition, f"{c.ref} field `{check.field}` " + f"fails {matched} {check.numeric_condition} {check.numeric_reference}"): + break diff --git a/kibot/pre_check_zone_fills.py b/kibot/pre_check_zone_fills.py index 864573332..868fe72c9 100644 --- a/kibot/pre_check_zone_fills.py +++ b/kibot/pre_check_zone_fills.py @@ -1,18 +1,22 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2023 Salvador E. Tropea -# Copyright (c) 2020-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) -from .macros import macros, pre_class # noqa: F401 +from .macros import macros, document, pre_class # noqa: F401 @pre_class class Check_Zone_Fills(BasePreFlight): # noqa: F821 - """ [boolean=false] Zones are filled before doing any operation involving PCB layers. + """ Check Zone Fills + Zones are filled before doing any operation involving PCB layers. The original PCB remains unchanged. If you need to abort when the zone fill creates significant changes to a layer use the CheckZoneFill internal template """ - def __init__(self, name, value): - super().__init__(name, value) + def __init__(self): + super().__init__() + with document: + self.check_zone_fills = False + """ Enable this preflight """ def apply(self): BasePreFlight._set_option('check_zone_fills', self._enabled) # noqa: F821 diff --git a/kibot/pre_convert_pcb.py b/kibot/pre_convert_pcb.py new file mode 100644 index 000000000..9842cfe10 --- /dev/null +++ b/kibot/pre_convert_pcb.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2024 Salvador E. Tropea +# Copyright (c) 2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 +# Project: KiBot (formerly KiPlot) +""" +Dependencies: + - from: KiAuto + role: mandatory + version: 2.3.2 +""" diff --git a/kibot/pre_draw_stackup.py b/kibot/pre_draw_stackup.py index 57ec78de7..77054fd23 100644 --- a/kibot/pre_draw_stackup.py +++ b/kibot/pre_draw_stackup.py @@ -22,7 +22,7 @@ def __init__(self): super().__init__() self._unknown_is_error = True with document: - self.type = '' + self.type = 'drawing' """ *[gerber,drawing,description,thickness] The gerber column contains the file names for the gerber files. Is usable only when a gerber output is provided. @@ -38,7 +38,9 @@ def __init__(self): self.side = 'auto' """ [auto,right,left] Side for the dimension used for the *thickness* type. When using *auto* the side is detected looking for a *drawing* column """ - self._type_example = 'drawing' + + def __str__(self): + return f'{self.type} {self.width} {self.side}' class DrawStackupOptions(Optionable): @@ -71,9 +73,9 @@ def __init__(self): """ *Name of the output used to generate the gerbers. This is needed only when you want to include the *gerber* column, containing the gerber file names """ self.columns = SUColumns - """ *[list(dict)|list(string)] List of columns to display. + """ *[list(dict)|list(string)=?] List of columns to display. Can be just the name of the column. - Available columns are *gerber*, *drawing* and *description*. + Available columns are *gerber*, *drawing*, *thickness* and *description*. When empty KiBot will add them in the above order, skipping the *gerber* if not available """ super().__init__() self._unknown_is_error = True @@ -261,6 +263,7 @@ def draw_thickness(g, x, y, w, font_h, first, last, layer, right=True): y1 = int(y+(first+0.5)*font_h) y2 = int(y+(last+0.5)*font_h) dim = pcbnew.PCB_DIM_ALIGNED(GS.board, pcbnew.PCB_DIM_ALIGNED_T) + dim.SetLayer(layer) pos = dim.GetStart() pos.x = x1 pos.y = y1 @@ -392,6 +395,7 @@ def update_drawing_group(g, pos_x, pos_y, width, height, tlayer, border, gerber, def update_drawing(ops, parent): + load_board() gerber = look_for_output(ops.gerber, 'gerber', parent, {'gerber'}) if ops.gerber else None if gerber: targets, _, _ = get_output_targets(ops.gerber, parent) @@ -419,7 +423,8 @@ def update_drawing(ops, parent): @pre_class class Draw_Stackup(BasePreFlight): # noqa: F821 - """ [boolean=False|dict] Draw the PCB stackup. Needs KiCad 7 or newer. + """ Draw Stackup + Draw the PCB stackup. Needs KiCad 7 or newer. To specify the position and size of the drawing you can use two methods. You can specify it using the *pos_x*, *pos_y*, *width*, *height* and *layer* options. But you can also draw a rectangle in your PCB with the size and layer you want. @@ -427,15 +432,26 @@ class Draw_Stackup(BasePreFlight): # noqa: F821 (right mouse button, then Grouping -> Group). Now edit the group and change its name to *kibot_stackup*. After running this preflight the rectangle will contain the stackup """ - def __init__(self, name, value): - super().__init__(name, value) + def __init__(self): + super().__init__() self._pcb_related = True + with document: + self.draw_stackup = DrawStackupOptions + """ [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior """ - def config(self): - o = DrawStackupOptions() - o.set_tree({'enabled': self._value} if isinstance(self._value, bool) else self._value) - o.config(self) - self._value = o + def __str__(self): + v = self.draw_stackup + if isinstance(v, bool): + return super().__str__() + return f'{self.type}: {v.enabled} ({[c.type for c in v._columns]})' + + def config(self, parent): + super().config(parent) + if isinstance(self.draw_stackup, bool): + self._value = DrawStackupOptions() + self._value.config(self) + else: + self._value = self.draw_stackup def apply(self): if not GS.ki7: @@ -443,5 +459,4 @@ def apply(self): if not GS.stackup: raise KiPlotConfigurationError('Unable to find the stackup information') if update_drawing(self._value, self): - GS.make_bkp(GS.pcb_file) - GS.board.Save(GS.pcb_file) + GS.save_pcb() diff --git a/kibot/pre_drc.py b/kibot/pre_drc.py index e90a219fa..d9e777333 100644 --- a/kibot/pre_drc.py +++ b/kibot/pre_drc.py @@ -20,26 +20,23 @@ @pre_class class DRC(XRC): # noqa: F821 - """ [boolean=false|dict] Runs the DRC (Distance Rules Check). To ensure we have a valid PCB. + """ DRC + Runs the DRC (Distance Rules Check) to ensure we have a valid PCB. You need a valid *fp-lib-table* installed. If not KiBot will try to temporarily install the template. This is a replacement for the *run_drc* preflight that needs KiCad 8 or newer. GUI exclusions and schematic parity are supported """ - def __init__(self, name, value): - super().__init__(name, value, DRCOptions) + def __init__(self): + super().__init__(DRCOptions) self._pcb_related = True self._expand_id = 'drc' self._category = 'PCB/docs' - - @classmethod - def get_doc(cls): - return cls.__doc__, DRCOptions + with document: + self.drc = DRCOptions + """ [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior """ def apply_filters(self, data): - filters = [] - if self._filters: - filters += self._filters + filters = self._filters.copy() if GS.filters: - logger.error(GS.filters) filters += GS.filters logger.warning(W_FILXRC+'Using filters from the `filters` preflight, move them to `drc`') self.c_err = self.c_warn = self.c_tot = 0 @@ -65,7 +62,7 @@ def apply_filters(self, data): else: # Check if any filter matches this violation for f in filters: - if type == f.error and f.regex.search(txt): + if type == f.error and f._regex.search(txt): change_to = f.change_to if hasattr(f, 'change_to') else 'ignore' if change_to == 'ignore': if not excluded: diff --git a/kibot/pre_erc.py b/kibot/pre_erc.py index fb913ac65..b2e6f350a 100644 --- a/kibot/pre_erc.py +++ b/kibot/pre_erc.py @@ -16,25 +16,23 @@ @pre_class class ERC(XRC): # noqa: F821 - """ [boolean=false|dict] Runs the ERC (Electrical Rules Check). To ensure the schematic is electrically correct. + """ ERC + Runs the ERC (Electrical Rules Check). To ensure the schematic is electrically correct. You need a valid *sym-lib-table* installed. If not KiBot will try to temporarily install the template. This is a replacement for the *run_erc* preflight that needs KiCad 8 or newer """ - def __init__(self, name, value): - super().__init__(name, value, ERCOptions) + def __init__(self): + super().__init__(ERCOptions) self._sch_related = True self._expand_id = 'erc' self._category = 'Schematic/docs' - - @classmethod - def get_doc(cls): - return cls.__doc__, ERCOptions + with document: + self.erc = ERCOptions + """ [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior """ def apply_filters(self, data): # Create a dict to translate sheets paths to file names self.solve_sheet_paths() - filters = [] - if self._filters: - filters += self._filters + filters = self._filters.copy() if GS.filters: filters += GS.filters logger.warning(W_FILXRC+'Using filters from the `filters` preflight, move them to `erc`') @@ -54,7 +52,7 @@ def apply_filters(self, data): # Check if any filter matches this violation excluded = violation.get('excluded') for f in filters: - if type == f.error and f.regex.search(txt): + if type == f.error and f._regex.search(txt): change_to = f.change_to if hasattr(f, 'change_to') else 'ignore' if change_to == 'ignore': if not excluded: diff --git a/kibot/pre_erc_warnings.py b/kibot/pre_erc_warnings.py index 27f3d7f82..57c8da842 100644 --- a/kibot/pre_erc_warnings.py +++ b/kibot/pre_erc_warnings.py @@ -4,20 +4,24 @@ # License: AGPL-3.0 # Project: KiBot (formerly KiPlot) from .misc import W_DEPR -from .macros import macros, pre_class # noqa: F401 +from .macros import macros, document, pre_class # noqa: F401 from .log import get_logger logger = get_logger(__name__) @pre_class class ERC_Warnings(BasePreFlight): # noqa: F821 - """ [boolean=false] **Deprecated**, use the `warnings_as_errors` option from `run_erc`/`erc`. - Option for `run_erc`. ERC warnings are considered errors """ - def __init__(self, name, value): - super().__init__(name, value) + """ ERC Warnings (**Deprecated**) + Option for `run_erc`. ERC warnings are considered errors. + Use the `warnings_as_errors` option from `run_erc`/`erc` instead """ + def __init__(self): + super().__init__() + with document: + self.erc_warnings = False + """ Enable this preflight """ - def config(self): - super().config() + def config(self, parent): + super().config(parent) logger.warning(W_DEPR+'The `erc_warnings` preflight is deprecated, use the `warnings_as_errors` option') def get_example(): diff --git a/kibot/pre_fill_zones.py b/kibot/pre_fill_zones.py index 767433779..f9fdba50a 100644 --- a/kibot/pre_fill_zones.py +++ b/kibot/pre_fill_zones.py @@ -1,28 +1,26 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2022 Salvador E. Tropea -# Copyright (c) 2022 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2022-2024 Salvador E. Tropea +# Copyright (c) 2022-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) import pcbnew from .gs import GS from .kiplot import load_board -from .macros import macros, pre_class # noqa: F401 +from .macros import macros, document, pre_class # noqa: F401 @pre_class class Fill_Zones(BasePreFlight): # noqa: F821 - """ [boolean=false] Fill all zones again and save the PCB """ - def __init__(self, name, value): - super().__init__(name, value) + """ Fill Zones + Fill all zones again and save the PCB """ + def __init__(self): + super().__init__() self._pcb_related = True + with document: + self.fill_zones = False + """ Enable this preflight """ def apply(self): load_board() pcbnew.ZONE_FILLER(GS.board).Fill(GS.board.Zones()) - GS.make_bkp(GS.pcb_file) - # KiCad likes to write the project every time we save the PCB - # But KiCad doesn't read the exclusions, so they get lost - # As a workaround we restore the project, there is no need to change it - prj = GS.read_pro() - GS.board.Save(GS.pcb_file) - GS.write_pro(prj) + GS.save_pcb() diff --git a/kibot/pre_filters.py b/kibot/pre_filters.py index 11a801d37..c6bda5d4a 100644 --- a/kibot/pre_filters.py +++ b/kibot/pre_filters.py @@ -1,13 +1,14 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2021 Salvador E. Tropea -# Copyright (c) 2020-2021 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Contributors: Leandro Heck (@leoheck) import os import re from .gs import GS from .error import KiPlotConfigurationError +from .misc import pretty_list from .optionable import Optionable from .kiplot import get_output_dir from .macros import macros, document, pre_class # noqa: F401 @@ -37,6 +38,16 @@ def __init__(self): self.regexp = None """ {regex} """ + def __str__(self): + txt = self.filter + if self.error: + txt += f' ({self.error})' + if getattr(self, 'number', None): + txt += f' ({self.number})' + if self.regex: + txt += f' [{self.regex}]' + return txt + class FilterOptions(FilterOptionsKiBot): """ Valid options for a filter entry """ @@ -44,6 +55,7 @@ def __init__(self): super().__init__() self.add_to_doc('error', 'A name for KiCad 6 or a number for KiCad 5, but always a string') self.add_to_doc('number', 'KiCad 5 only') + self._error_example = 'lib_symbol_issues' class FiltersOptions(Optionable): @@ -52,67 +64,57 @@ def __init__(self): super().__init__() with document: self.filters = FilterOptions - """ [list(dict)] DRC/ERC errors to be ignored """ + """ [list(dict)=[]] DRC/ERC errors to be ignored """ self._filter_what = 'DRC/ERC errors' def config(self, parent): super().config(parent) parsed = None - self.unparsed = None - if not isinstance(self.filters, type): - for f in self.filters: - where = ' (in `{}` filter)'.format(f.filter) if f.filter else '' - error = f.error - if not error: - if not hasattr(f, 'number') or not f.number: - raise KiPlotConfigurationError('Missing `error`'+where) - error = str(f.number) - regex = f.regex - if regex == 'None': - raise KiPlotConfigurationError('Missing `regex`'+where) - comment = f.filter - logger.debug("Adding {} filter '{}','{}','{}'".format(self._filter_what, comment, error, regex)) - if parsed is None: - parsed = '' - if comment: - parsed += '# '+comment+'\n' - parsed += '{},{}\n'.format(error, regex) - f.regex = re.compile(regex) - # If the list is valid make a copy for the warnings filter - if parsed: - self.unparsed = self.filters - self.filters = parsed + for f in self.filters: + where = ' (in `{}` filter)'.format(f.filter) if f.filter else '' + error = f.error + if not error: + if not hasattr(f, 'number') or not f.number: + raise KiPlotConfigurationError('Missing `error`'+where) + error = str(f.number) + regex = f.regex + if regex == 'None': + raise KiPlotConfigurationError('Missing `regex`'+where) + comment = f.filter + logger.debug("Adding {} filter '{}','{}','{}'".format(self._filter_what, comment, error, regex)) + if parsed is None: + parsed = '' + if comment: + parsed += '# '+comment+'\n' + parsed += '{},{}\n'.format(error, regex) + f._regex = re.compile(regex) + self._parsed = parsed @pre_class -class Filters(BasePreFlight): # noqa: F821 - """ [list(dict)] A list of entries to filter out ERC/DRC messages when using *run_erc*/*run_drc*. +class Filters(BasePreFlight, FiltersOptions): # noqa: F821 + """ Filters + A list of entries to filter out ERC/DRC messages when using *run_erc*/*run_drc*. Avoid using it with the new *erc* and *drc* preflights. Note that ignored errors will become KiBot warnings (i.e. `(W058) ...`). To farther ignore these warnings use the `filters` option in the `global` section """ -# def __init__(self, name, value): -# super().__init__(name, value) + def __init__(self): + super().__init__() + self.set_doc('filters', "[list(dict)=[]] One or more filters") - def config(self): - self._filter_ops = FiltersOptions() - self._filter_ops.set_tree({'filters': self._value}) - self._filter_ops.config(self) - self._value = self._filter_ops.filters + def __str__(self): + return super().__str__()+f' ({pretty_list([v.filter for v in self.filters])})' def get_example(): """ Returns a YAML value for the example config """ return "\n - filter: 'Filter description'\n error: '10'\n regex: 'Regular expression to match'" - @classmethod - def get_doc(cls): - return cls.__doc__, FilterOptions - def apply(self): # Create the filters file - if self._value: + if self.filters: our_dir = GS.global_dir if GS.global_use_dir_for_preflights else '' o_dir = get_output_dir(our_dir, self) GS.filter_file = os.path.join(o_dir, 'kibot_errors.filter') - GS.filters = self._filter_ops.unparsed + GS.filters = self.filters with open(GS.filter_file, 'w') as f: - f.write(self._value) + f.write(self._parsed) diff --git a/kibot/pre_ignore_unconnected.py b/kibot/pre_ignore_unconnected.py index 91fe011a0..631b8a1dd 100644 --- a/kibot/pre_ignore_unconnected.py +++ b/kibot/pre_ignore_unconnected.py @@ -4,21 +4,25 @@ # License: AGPL-3.0 # Project: KiBot (formerly KiPlot) from .misc import W_DEPR -from .macros import macros, pre_class # noqa: F401 +from .macros import macros, document, pre_class # noqa: F401 from .log import get_logger logger = get_logger(__name__) @pre_class class Ignore_Unconnected(BasePreFlight): # noqa: F821 - """ [boolean=false] **Deprecated**, use the `ignore_unconnected` option from `run_drc`/`drc`. + """ Ignore Unconnected (**Deprecated**) Option for `run_drc`. Ignores the unconnected nets. Useful if you didn't finish the routing. - It will also ignore KiCad 6 warnings when using `run_drc` """ - def __init__(self, name, value): - super().__init__(name, value) + It will also ignore KiCad 6 warnings when using `run_drc`. + Use the `ignore_unconnected` option from `run_drc`/`drc` instead """ + def __init__(self): + super().__init__() + with document: + self.ignore_unconnected = False + """ Enable this preflight """ - def config(self): - super().config() + def config(self, parent): + super().config(parent) logger.warning(W_DEPR+'The `ignore_unconnected` preflight is deprecated, use the `ignore_unconnected` option') def get_example(): diff --git a/kibot/pre_pcb_replace.py b/kibot/pre_pcb_replace.py index 3194b07c7..7ef43b5e3 100644 --- a/kibot/pre_pcb_replace.py +++ b/kibot/pre_pcb_replace.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2021-2022 Salvador E. Tropea -# Copyright (c) 2021-2022 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2021-2024 Salvador E. Tropea +# Copyright (c) 2021-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) """ Dependencies: @@ -34,26 +34,20 @@ def __init__(self): @pre_class class PCB_Replace(Base_Replace): # noqa: F821 - """ [dict] Replaces tags in the PCB. I.e. to insert the git hash or last revision date. + """ PCB Replace (**Deprecated**) + Replaces tags in the PCB. I.e. to insert the git hash or last revision date. This is useful for KiCad 5, use `set_text_variables` when using KiCad 6. This preflight modifies the PCB. Even when a back-up is done use it carefully """ _context = 'PCB' - def __init__(self, name, value): - super().__init__(name, value) - - def config(self): - o = PCB_ReplaceOptions() - o.set_tree(self._value) - o.config(self) - self._value = o - - @classmethod - def get_doc(cls): - return cls.__doc__, PCB_ReplaceOptions + def __init__(self): + super().__init__() + with document: + self.pcb_replace = PCB_ReplaceOptions + """ [dict={}] Options for the `pcb_replace` preflight """ def apply(self): - o = self._value + o = self.pcb_replace if o.date_command: # Convert it into another replacement t = TagReplacePCB() @@ -63,6 +57,6 @@ def apply(self): t.after = '")' t._relax_check = True o.replace_tags.append(t) - self.replace(GS.pcb_file) + self.replace(GS.pcb_file, o) # Force the schematic reload GS.board = None diff --git a/kibot/pre_run_drc.py b/kibot/pre_run_drc.py index 722a8676d..07822751c 100644 --- a/kibot/pre_run_drc.py +++ b/kibot/pre_run_drc.py @@ -11,7 +11,6 @@ """ import os from .macros import macros, document, pre_class # noqa: F401 -from .error import KiPlotConfigurationError from .gs import GS from .optionable import Optionable from .kicad.config import KiConf @@ -39,33 +38,33 @@ def __init__(self): @pre_class class Run_DRC(BasePreFlight): # noqa: F821 - """ [boolean=false|dict] Runs the DRC (Distance Rules Check). To ensure we have a valid PCB. + """ Run DRC (**Deprecated for KiCad 8**) + Runs the DRC (Distance Rules Check) to ensure we have a valid PCB. + For KiCad 8 use *drc* The report file name is controlled by the global output pattern (%i=drc %x=txt). Note that the KiCad 6+ *Test for parity between PCB and schematic* option is not supported. If you need to check the parity use the `update_xml` preflight. KiCad 6 introduced `warnings` they are currently counted be the `unconnected` counter of KiBot. This will change in the future. If you use DRC exclusions please consult the `drc_exclusions_workaround` global option """ - def __init__(self, name, value): - super().__init__(name, value) + def __init__(self): + super().__init__() self._pcb_related = True self._expand_id = 'drc' self._expand_ext = 'txt' + with document: + self.run_drc = Run_DRCOptions + """ [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior """ - def config(self): - if isinstance(self._value, bool): - self._enabled = self._value + def config(self, parent): + super().config(parent) + if isinstance(self.run_drc, bool): self._dir = '' self._ignore_unconnected = False - elif isinstance(self._value, dict): - f = Run_DRCOptions() - f.set_tree(self._value) - f.config(self) - self._enabled = f.enabled - self._dir = f.dir - self._ignore_unconnected = f.ignore_unconnected - else: - raise KiPlotConfigurationError('must be boolean or dict') + else: # Run_DRCOptions + self._enabled = self.run_drc.enabled + self._dir = self.run_drc.dir + self._ignore_unconnected = self.run_drc.ignore_unconnected def get_targets(self): """ Returns a list of targets generated by this preflight """ @@ -77,10 +76,6 @@ def get_targets(self): out_dir = os.path.join(out_dir, self.expand_dirname(GS.global_dir)) return [os.path.abspath(os.path.join(out_dir, self._dir, name))] - @classmethod - def get_doc(cls): - return cls.__doc__, Run_DRCOptions - def run(self): if GS.ki8: logger.warning(W_DEPR+'For KiCad 8 use the `drc` preflight instead of `run_drc`') diff --git a/kibot/pre_run_erc.py b/kibot/pre_run_erc.py index bc27dd052..94f620edd 100644 --- a/kibot/pre_run_erc.py +++ b/kibot/pre_run_erc.py @@ -16,7 +16,6 @@ from .gs import GS from .optionable import Optionable from .kiplot import load_sch -from .error import KiPlotConfigurationError from .misc import ERC_ERROR, W_DEPR from .log import get_logger @@ -39,29 +38,29 @@ def __init__(self): @pre_class class Run_ERC(BasePreFlight): # noqa: F821 - """ [boolean=false|dict] (Deprecated for KiCad 8, use *erc*) Runs the ERC (Electrical Rules Check). + """ Run ERC (**Deprecated for KiCad 8**) + Runs the ERC (Electrical Rules Check). + For KiCad 8 use *erc* To ensure the schematic is electrically correct. The report file name is controlled by the global output pattern (%i=erc %x=txt) """ - def __init__(self, name, value): - super().__init__(name, value) + def __init__(self): + super().__init__() self._sch_related = True self._expand_id = 'erc' self._expand_ext = 'txt' + with document: + self.run_erc = Run_ERCOptions + """ [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior """ - def config(self): - if isinstance(self._value, bool): - self._enabled = self._value + def config(self, parent): + super().config(parent) + if isinstance(self.run_erc, bool): self._dir = '' self._warnings_as_errors = False - elif isinstance(self._value, dict): - f = Run_ERCOptions() - f.set_tree(self._value) - f.config(self) - self._enabled = f.enabled - self._dir = f.dir - self._warnings_as_errors = f.warnings_as_errors - else: - raise KiPlotConfigurationError('must be boolean or dict') + else: # Run_ERCOptions + self._enabled = self.run_erc.enabled + self._dir = self.run_erc.dir + self._warnings_as_errors = self.run_erc.warnings_as_errors def get_targets(self): """ Returns a list of targets generated by this preflight """ @@ -73,10 +72,6 @@ def get_targets(self): out_dir = os.path.join(out_dir, self.expand_dirname(GS.global_dir)) return [os.path.abspath(os.path.join(out_dir, self._dir, name))] - @classmethod - def get_doc(cls): - return cls.__doc__, Run_ERCOptions - def run(self): if GS.ki8: logger.warning(W_DEPR+'For KiCad 8 use the `erc` preflight instead of `run_erc`') diff --git a/kibot/pre_sch_replace.py b/kibot/pre_sch_replace.py index f1b80b90a..4a610dbe7 100644 --- a/kibot/pre_sch_replace.py +++ b/kibot/pre_sch_replace.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2021-2022 Salvador E. Tropea -# Copyright (c) 2021-2022 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2021-2024 Salvador E. Tropea +# Copyright (c) 2021-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) """ Dependencies: @@ -38,26 +38,20 @@ def __init__(self): @pre_class class SCH_Replace(Base_Replace): # noqa: F821 - """ [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date. + """ SCH Replace (**Deprecated**) + Replaces tags in the schematic. I.e. to insert the git hash or last revision date. This is useful for KiCad 5, use `set_text_variables` when using KiCad 6. This preflight modifies the schematics. Even when a back-up is done use it carefully """ _context = 'SCH' - def __init__(self, name, value): - super().__init__(name, value) - - def config(self): - o = SCH_ReplaceOptions() - o.set_tree(self._value) - o.config(self) - self._value = o - - @classmethod - def get_doc(cls): - return cls.__doc__, SCH_ReplaceOptions + def __init__(self): + super().__init__() + with document: + self.sch_replace = SCH_ReplaceOptions + """ [dict={}] Options for the `sch_replace` preflight """ def apply(self): - o = self._value + o = self.sch_replace if o.date_command: # Convert it into another replacement t = TagReplaceSCH() @@ -75,6 +69,6 @@ def apply(self): load_sch() os.environ['KIBOT_TOP_SCH_NAME'] = GS.sch_file for file in GS.sch.get_files(): - self.replace(file) + self.replace(file, o) # Force the schematic reload GS.sch = None diff --git a/kibot/pre_set_text_variables.py b/kibot/pre_set_text_variables.py index 7f990f5a1..7e5442181 100644 --- a/kibot/pre_set_text_variables.py +++ b/kibot/pre_set_text_variables.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2022 Salvador E. Tropea -# Copyright (c) 2022 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2022-2024 Salvador E. Tropea +# Copyright (c) 2022-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) """ Dependencies: @@ -15,7 +15,7 @@ import re from subprocess import run, PIPE from .error import KiPlotConfigurationError -from .misc import FAILED_EXECUTE, W_EMPTREP +from .misc import FAILED_EXECUTE, W_EMPTREP, pretty_list from .optionable import Optionable from .pre_base import BasePreFlight from .gs import GS @@ -50,6 +50,15 @@ def __init__(self): """ Text to add after the output of `command` """ self.expand_kibot_patterns = True """ Expand %X patterns. The context is `schematic` """ + self._name_example = 'version' + + def __str__(self): + txt = '${'+self.name+'}' + if self.text: + txt += f' -> `{self.text}`' + else: + txt += f' -> command(`{self.command}`)' + return txt def config(self, parent): super().config(parent) @@ -57,41 +66,22 @@ def config(self, parent): raise KiPlotConfigurationError("Missing variable name ({})".format(str(self._tree))) -class Set_Text_VariablesOptions(Optionable): - """ A list of KiCad variables """ - def __init__(self): - super().__init__() - with document: - self.variables = KiCadVariable - """ [dict|list(dict)] Variables """ - - def config(self, parent): - super().config(parent) - if isinstance(self.variables, type): - self.variables = [] - elif isinstance(self.variables, KiCadVariable): - self.variables = [self.variables] - - @pre_class class Set_Text_Variables(BasePreFlight): # noqa: F821 - """ [dict|list(dict)] Defines KiCad 6+ variables. + """ Set Text Variables + Defines KiCad 6+ variables. They are expanded using `${VARIABLE}`, and stored in the project file. - This preflight replaces `pcb_replace` and `sch_replace` when using KiCad 6. + This preflight replaces `pcb_replace` and `sch_replace` when using KiCad 6 or newer. The KiCad project file is modified. - Warning: don't use `-s all` or this preflight will be skipped """ - def __init__(self, name, value): - super().__init__(name, value) - - def config(self): - f = Set_Text_VariablesOptions() - f.set_tree({'variables': self._value}) - f.config(self) - self._value = f.variables + Warning: don't use `-s all` or this preflight will be skipped """ + def __init__(self): + super().__init__() + with document: + self.set_text_variables = KiCadVariable + """ [dict|list(dict)=[]] One or more variable definition """ - @classmethod - def get_doc(cls): - return cls.__doc__, KiCadVariable + def __str__(self): + return f'{self.type} ({pretty_list([v.name for v in self.set_text_variables])})' @classmethod def get_example(cls): @@ -102,7 +92,7 @@ def get_example(cls): "\n after: '>'") def apply(self): - o = self._value + o = self.set_text_variables if len(o) == 0: return if GS.ki5: diff --git a/kibot/pre_update_footprint.py b/kibot/pre_update_footprint.py index cdde1d982..ea09aa1e7 100644 --- a/kibot/pre_update_footprint.py +++ b/kibot/pre_update_footprint.py @@ -4,8 +4,8 @@ # License: AGPL-3.0 # Project: KiBot (formerly KiPlot) from .gs import GS -from .error import KiPlotConfigurationError from .kicad.pcb import replace_footprints +from .misc import W_NOFOOTP, pretty_list from .optionable import Optionable from .macros import macros, document, pre_class # noqa: F401 from .log import get_logger @@ -15,24 +15,24 @@ @pre_class class Update_Footprint(BasePreFlight): # noqa: F821 - """ [string|list(string)=''] Updates footprints from the libs, you must provide one or more references to be updated. - This is useful to replace logos using freshly created versions """ - def __init__(self, name, value): - super().__init__(name, value) + """ Update Footprint + Updates footprints from the libs, you must provide one or more + references to be updated. This is useful to replace logos using freshly created versions """ + def __init__(self): + super().__init__() self._pcb_related = True + with document: + self.update_footprint = Optionable + """ [string|list(string)=''] {comma_sep} One or more component references """ - def config(self): - if not isinstance(self._value, list) and not isinstance(self._value, str): - raise KiPlotConfigurationError('must be string or list of strings') - if isinstance(self._value, list) and any((not isinstance(x, str) for x in self._value)): - raise KiPlotConfigurationError('all items in the list must be strings') - self._refs = Optionable.force_list(self._value) - if not self._refs: - raise KiPlotConfigurationError('nothing to update') + def __str__(self): + return f'{self.type} ({pretty_list(self.update_footprint)})' def get_example(): """ Returns a YAML value for the example config """ - return "QR1, QR2" + return "QR1,QR2" def apply(self): - replace_footprints(GS.pcb_file, {k: None for k in self._refs}, logger) + if not self.update_footprint: + logger.warning(W_NOFOOTP+'Nothing to update in `update_footprint`') + replace_footprints(GS.pcb_file, dict.fromkeys(self.update_footprint), logger) diff --git a/kibot/pre_update_pcb_characteristics.py b/kibot/pre_update_pcb_characteristics.py index fb971c0a5..77a66f146 100644 --- a/kibot/pre_update_pcb_characteristics.py +++ b/kibot/pre_update_pcb_characteristics.py @@ -51,14 +51,18 @@ def update_table(values): @pre_class class Update_PCB_Characteristics(BasePreFlight): # noqa: F821 - """ [boolean=False] Update the information in the Board Characteristics. + """ Update PCB Characteristics + Update the information in the Board Characteristics. Starting with KiCad 7 you can paste a block containing board information using - *Place* -> *Add Board Characteristics*. But this information is static, so if + Place* -> *Add Board Characteristics*. But this information is static, so if you modify anything related to it the block will be obsolete. This preflight tries to refresh the information """ - def __init__(self, name, value): - super().__init__(name, value) + def __init__(self): + super().__init__() self._pcb_related = True + with document: + self.update_pcb_characteristics = False + """ Enable this preflight """ def v2str(self, v): return pcbnew.StringFromValue(self.pcb_iu, self.pcb_units, v, True) @@ -90,5 +94,4 @@ def apply(self): YESNO[GS.global_edge_plating], GS.global_edge_connector.capitalize()) if update_table(values): - GS.make_bkp(GS.pcb_file) - GS.board.Save(GS.pcb_file) + GS.save_pcb() diff --git a/kibot/pre_update_qr.py b/kibot/pre_update_qr.py index c3e24ee70..94dbcd1a9 100644 --- a/kibot/pre_update_qr.py +++ b/kibot/pre_update_qr.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2022 Salvador E. Tropea -# Copyright (c) 2020-2022 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) -from .macros import macros, pre_class # noqa: F401 +from .macros import macros, document, pre_class # noqa: F401 from .registrable import RegOutput from .log import get_logger @@ -12,13 +12,17 @@ @pre_class class Update_QR(BasePreFlight): # noqa: F821 - """ [boolean=false] Update the QR codes. + """ Update QR + Update the QR codes. Complements the `qr_lib` output. The KiCad 6 files and the KiCad 5 PCB needs manual update, generating a new library isn't enough """ - def __init__(self, name, value): - super().__init__(name, value) + def __init__(self): + super().__init__() self._sch_related = True self._pcb_related = True + with document: + self.update_qr = False + """ Enable this preflight """ def run(self): for o in RegOutput.get_outputs(): diff --git a/kibot/pre_update_stackup.py b/kibot/pre_update_stackup.py index c7bb38fe3..420348bba 100644 --- a/kibot/pre_update_stackup.py +++ b/kibot/pre_update_stackup.py @@ -230,14 +230,18 @@ def update_table(): @pre_class class Update_Stackup(BasePreFlight): # noqa: F821 - """ [boolean=False] Update the information in the Stackup Table. + """ Update Stackup + Update the information in the Stackup Table. Starting with KiCad 7 you can paste a block containing board information using *Place* -> *Stackup Table*. But this information is static, so if you modify anything related to it the block will be obsolete. This preflight tries to refresh the information """ - def __init__(self, name, value): - super().__init__(name, value) + def __init__(self): + super().__init__() self._pcb_related = True + with document: + self.update_stackup = False + """ Enable this preflight """ def v2str(self, v): return pcbnew.StringFromValue(self.pcb_iu, self.pcb_units, v, True) @@ -250,5 +254,4 @@ def apply(self): raise KiPlotConfigurationError('Unable to find the stackup information') # Collect the information if update_table(): - GS.make_bkp(GS.pcb_file) - GS.board.Save(GS.pcb_file) + GS.save_pcb() diff --git a/kibot/pre_update_xml.py b/kibot/pre_update_xml.py index a92bfd45f..8b0b94859 100644 --- a/kibot/pre_update_xml.py +++ b/kibot/pre_update_xml.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2023 Salvador E. Tropea -# Copyright (c) 2020-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) """ Dependencies: @@ -17,7 +17,7 @@ from .error import KiPlotConfigurationError from .gs import GS from .kiplot import load_board -from .misc import BOM_ERROR, NETLIST_DIFF, W_PARITY, MISSING_TOOL, KICAD_VERSION_7_0_1, W_NOTINBOM, MOD_BOARD_ONLY, W_DEPR +from .misc import BOM_ERROR, KICAD_VERSION_7_0_1, MISSING_TOOL, MOD_BOARD_ONLY, NETLIST_DIFF, W_NOTINBOM, W_PARITY from .log import get_logger from .optionable import Optionable import pcbnew @@ -36,7 +36,7 @@ def __init__(self): self.check_pcb_parity = False """ *Check if the PCB and Schematic are synchronized. This is equivalent to the *Test for parity between PCB and schematic* of the DRC dialog. - Not available for KiCad 5. **Important**: when using KiCad 6 and the *Exclude from BoM* attribute + Only for KiCad 6 and 7. **Important**: when using KiCad 6 and the *Exclude from BoM* attribute these components won't be included in the generated XML, so we can't check its parity """ self.as_warnings = False """ Inform the problems as warnings and don't stop """ @@ -44,32 +44,31 @@ def __init__(self): @pre_class class Update_XML(BasePreFlight): # noqa: F821 - """ [boolean=false|dict] Update the XML version of the BoM (Bill of Materials). + """ Update XML + Update the XML version of the BoM (Bill of Materials). To ensure our generated BoM is up to date. Note that this isn't needed when using the internal BoM generator (`bom`). - You can compare the PCB and schematic netlists using it """ - def __init__(self, name, value): - super().__init__(name, value) + You can compare the PCB and schematic netlists using it (KiCad 6 and 7 only) """ + def __init__(self): + super().__init__() self._check_pcb_parity = False self._sch_related = True + with document: + self.update_xml = Update_XMLOptions + """ [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior """ - def config(self): - if isinstance(self._value, bool): - self._enabled = self._value - elif isinstance(self._value, dict): - f = Update_XMLOptions() - f.set_tree(self._value) - f.config(self) - self._enabled = f.enabled - self._check_pcb_parity = f.check_pcb_parity - self.options = f - self._pcb_related = True - else: - raise KiPlotConfigurationError('must be boolean or dict') + def __str__(self): + res = super().__str__() + if self._check_pcb_parity: + res += ' + check PCB/SCH parity' + return res - @classmethod - def get_doc(cls): - return cls.__doc__, Update_XMLOptions + def config(self, parent): + super().config(parent) + if isinstance(self.update_xml, Update_XMLOptions): + self._enabled = self.update_xml.enabled + self._check_pcb_parity = self.update_xml.check_pcb_parity + self._pcb_related = True def get_targets(self): """ Returns a list of targets generated by this preflight """ @@ -169,7 +168,8 @@ def check_pcb_parity(self): GS.exit_with_error("Connectivity API is broken on KiCad 7.0.0\n" "Please upgrade KiCad to 7.0.1 or newer", MISSING_TOOL) if GS.ki8: - logger.warning(W_DEPR+'For KiCad 8 use the `drc` preflight, it supports parity checks from KiCad') + GS.exit_with_error('`check_pcb_parity` not available for KiCad 8 (broken API).\n' + ' Use the `drc` preflight, it supports parity checks from KiCad', MISSING_TOOL) fname = GS.sch_no_ext+'.xml' logger.debug('Loading XML: '+fname) try: @@ -208,7 +208,7 @@ def check_pcb_parity(self): self.check_nets(net_nodes, errors, excluded) # Report errors if errors: - if self.options.as_warnings: + if self.update_xml.as_warnings: for e in errors: logger.warning(W_PARITY+e) else: diff --git a/kibot/registrable.py b/kibot/registrable.py index 90a6733cb..c90313488 100644 --- a/kibot/registrable.py +++ b/kibot/registrable.py @@ -5,9 +5,10 @@ # Project: KiBot (formerly KiPlot) from collections import OrderedDict from copy import copy +from .error import KiPlotConfigurationError from .gs import GS +from .misc import pretty_list from .optionable import Optionable -from .error import KiPlotConfigurationError from . import log logger = log.get_logger() @@ -19,6 +20,78 @@ def fname(file): return "" +class GroupEntry(object): + def __init__(self, item, from_out=False, out=None): + self.item = item # The name (group or output) + self.from_out = from_out # Defined in the "groups" option of an output + self.from_top = not from_out # Defined in the global "groups" + self.out = out # Optional pointer to the output object + + def update_out(self): + """ Update the pointer to the output object """ + self.out = RegOutput.get_output(self.item) + + def is_from_output(self): + return self.from_out + + def is_from_top(self): + return self.from_top + + def __repr__(self): + origin = '' + if self.from_out and self.from_top: + origin = ' (from both)' + elif self.from_out: + origin = ' (from output)' + elif self.from_top: + origin = ' (from groups)' + return f"{self.out if self.out else self.item}{origin}" + + # def __str__(self): + # return str(self.out) if self.out else self.item + + def short_str(self): + return self.out.short_str() if self.out else self.item + + +class Group(object): + def __init__(self, name, items): + self.name = name + if len(items) == 0 or isinstance(items[0], GroupEntry): + self.items = items + else: + self.items = [GroupEntry(i) for i in items] + + def add_from_output(self, out): + i = next((i for i in self.items if i.item == out.name), None) + if i is not None: + i.from_out = True + return + self.items.append(GroupEntry(out.name, from_out=True, out=out)) + + def remove_from_output(self, out): + i = next((i for i in self.items if i.item == out.name), None) + if i is None or not i.is_from_output(): + return None + i.from_out = False + return i + + def get_list(self): + """ Get the name of the items """ + return [i.item for i in self.items] + + def update_out(self): + """ Update the output pointer for all items """ + for i in self.items: + i.update_out() + + def __repr__(self): + return f"{self.name} -> {list(self.items)}" + + def __str__(self): + return f"{self.name} -> {pretty_list(self.items, True)}" + + class Registrable(object): """ This class adds the mechanism to register plug-ins """ def __init__(self): @@ -43,6 +116,9 @@ def get_registered(cl): def __str__(self): return "'{}' ({}) [{}]".format(self.comment, self.name, self.type) + def short_str(self): + return "{} [{}]".format(self.name, self.type) + class RegOutput(Optionable, Registrable): """ An optionable that is also registrable. @@ -73,63 +149,104 @@ def reset(): RegOutput._def_outputs = OrderedDict() @staticmethod - def add_variants(variants): - for k, v in variants.items(): - # Do we have sub-PCBs - if v.sub_pcbs: - # Add a variant for each sub-PCB - for sp in v.sub_pcbs: - name = k+'['+sp.name+']' - vn = copy(v) - vn._sub_pcb = sp - if sp.file_id: - vn.file_id = sp.file_id - else: - vn.file_id += '_'+sp.name - RegOutput._def_variants[name] = vn - else: - RegOutput._def_variants[k] = v + def add_output(obj, file=None): + if obj.name in RegOutput._def_outputs: + raise KiPlotConfigurationError("Output name `{}` already defined".format(obj.name)+fname(file)) + if obj.name in RegOutput._def_groups: + raise KiPlotConfigurationError("Output name `{}` already defined as group".format(obj.name)+fname(file)) + RegOutput._def_outputs[obj.name] = obj @staticmethod - def is_variant(name): - return name in RegOutput._def_variants + def add_outputs(objs, file=None): + for o in objs: + RegOutput.add_output(o, file) @staticmethod - def get_variant(name): - return RegOutput._def_variants[name] + def remove_output(obj): + del RegOutput._def_outputs[obj.name] @staticmethod - def get_variants(): - return RegOutput._def_variants + def get_outputs(): + return RegOutput._def_outputs.values() @staticmethod - def add_filters(filters): - RegOutput._def_filters.update(filters) + def get_output(name): + return RegOutput._def_outputs.get(name, None) @staticmethod - def is_filter(name): - return name in RegOutput._def_filters + def is_output_or_group(name): + return name in RegOutput._def_outputs or name in RegOutput._def_groups + + # ################################### + # Variants operations + # ################################### @staticmethod - def get_filter(name): - return RegOutput._def_filters[name] + def add_variants(variants): + RegOutput._def_variants.update(variants) @staticmethod - def add_filter(obj): - RegOutput._def_filters[obj.name] = obj + def add_variant(variant): + RegOutput._def_variants[variant.name] = variant @staticmethod - def add_output(obj, file=None): - if obj.name in RegOutput._def_outputs: - raise KiPlotConfigurationError("Output name `{}` already defined".format(obj.name)+fname(file)) - if obj.name in RegOutput._def_groups: - raise KiPlotConfigurationError("Output name `{}` already defined as group".format(obj.name)+fname(file)) - RegOutput._def_outputs[obj.name] = obj + def remove_variant(variant): + del RegOutput._def_variants[variant.name] @staticmethod - def add_outputs(objs, file=None): - for o in objs: - RegOutput.add_output(o, file) + def separate_variant_and_subpcb(name): + """ Separate VARIANT[SUBPCB] into VARIANT, SUBPCB """ + subpcb = None + if '[' in name: + try: + name, subpcb = name.split('[') + if subpcb.endswith(']'): + subpcb = subpcb[:-1] + except ValueError: + pass + return name, subpcb + + @staticmethod + def is_variant(name): + name, subpcb = RegOutput.separate_variant_and_subpcb(name) + variant = RegOutput._def_variants.get(name) + if variant is None: + return False + if subpcb is None: + return True + return any((sp.name == subpcb for sp in variant.sub_pcbs)) + + @staticmethod + def get_variant(name): + name, subpcb = RegOutput.separate_variant_and_subpcb(name) + variant = RegOutput._def_variants[name] + if variant and subpcb: + # Return a copy customized for the desired sub-pcb + variant = copy(variant) + variant._sub_pcb = sp = next((sp for sp in variant.sub_pcbs if sp.name == subpcb)) + if sp.file_id: + variant.file_id = sp.file_id + else: + variant.file_id += '_'+sp.name + return variant + + @staticmethod + def get_variants(): + return RegOutput._def_variants + + @staticmethod + def check_variant(variant): + if variant: + if isinstance(variant, RegVariant): + return variant + if not RegOutput.is_variant(variant): + raise KiPlotConfigurationError("Unknown variant name `{}`".format(variant)) + return RegOutput.get_variant(variant) + return None + + # ################################### + # Groups operations + # ################################### @staticmethod def add_group(name, lst, file=None): @@ -137,52 +254,60 @@ def add_group(name, lst, file=None): raise KiPlotConfigurationError("Group name `{}` already defined".format(name)+fname(file)) if name in RegOutput._def_outputs: raise KiPlotConfigurationError("Group name `{}` already defined as output".format(name)+fname(file)) - RegOutput._def_groups[name] = lst + new_grp = Group(name, lst) + RegOutput._def_groups[name] = new_grp + return new_grp @staticmethod def add_groups(objs, file=None): - logger.debug('Adding groups: '+str(objs)) + logger.debug(f'Adding groups: {objs}') for n, lst in objs.items(): RegOutput.add_group(n, lst, file) @staticmethod - def add_to_group(out, group): - items = RegOutput._def_groups.get(group) - if items is not None: - if out not in items: - items.append(out) - return True - RegOutput.add_group(group, [out]) + def replace_group(old_name, name, lst): + new_group = Group(name, lst) + RegOutput._def_groups[name] = new_group + return new_group @staticmethod - def get_groups(): - return RegOutput._def_groups + def add_out_to_group(out, group): + """ Add `out` to the `group` assuming this is from the `groups` option of the output """ + grp = RegOutput._def_groups.get(group) + if grp is not None: + grp.add_from_output(out) + return True, grp + grp = RegOutput.add_group(group, [GroupEntry(out.name, from_out=True)]) + return False, grp @staticmethod - def get_group_names(): - return RegOutput._def_groups.keys() + def remove_out_from_group(out, group): + """ Remove `out` from the `group` assuming this is from the `groups` option of the output """ + grp = RegOutput._def_groups.get(group) + if grp is None: + # Wrong group? + return + i = grp.remove_from_output(out) + if i is None: + # Not found or not from output + return False + if i.is_from_top(): + # Also defined at top level + return False + del grp.items[grp.items.index(i)] + return True @staticmethod - def get_outputs(): - return RegOutput._def_outputs.values() - - @staticmethod - def get_output(name): - return RegOutput._def_outputs.get(name, None) + def get_groups(): + return {g.name: g.get_list() for g in RegOutput._def_groups.values()} @staticmethod - def is_output_or_group(name): - return name in RegOutput._def_outputs or name in RegOutput._def_groups + def get_groups_struct(): + return RegOutput._def_groups @staticmethod - def check_variant(variant): - if variant: - if isinstance(variant, RegVariant): - return variant - if not RegOutput.is_variant(variant): - raise KiPlotConfigurationError("Unknown variant name `{}`".format(variant)) - return RegOutput.get_variant(variant) - return None + def get_group_names(): + return RegOutput._def_groups.keys() @staticmethod def solve_groups(targets, where, level=0): @@ -202,9 +327,37 @@ def solve_groups(targets, where, level=0): if new_grp is None: raise KiPlotConfigurationError('Unknown output/group `{}` (in `{}`)'.format(t, where)) # Recursive expand - new_targets.extend(RegOutput.solve_groups(new_grp, t, level)) + new_targets.extend(RegOutput.solve_groups(new_grp.get_list(), t, level)) return new_targets + # ################################### + # Filters operations + # ################################### + + @staticmethod + def add_filters(filters): + RegOutput._def_filters.update(filters) + + @staticmethod + def remove_filter(obj): + del RegOutput._def_filters[obj.name] + + @staticmethod + def is_filter(name): + return name in RegOutput._def_filters + + @staticmethod + def get_filter(name): + return RegOutput._def_filters[name] + + @staticmethod + def add_filter(obj): + RegOutput._def_filters[obj.name] = obj + + @staticmethod + def get_filters(): + return RegOutput._def_filters + class RegVariant(Optionable, Registrable): """ An optionable that is also registrable. diff --git a/kibot/resources/config_templates/Testpoints_by_attr.kibot.yaml b/kibot/resources/config_templates/Testpoints_by_attr.kibot.yaml new file mode 100644 index 000000000..9865fbfc1 --- /dev/null +++ b/kibot/resources/config_templates/Testpoints_by_attr.kibot.yaml @@ -0,0 +1,64 @@ +# Testpoints selected by fabrication attribute +kibot: + version: 1 + +filters: + - name: _separate_pins_for_tp + comment: "Separate pins with testpoint as fabrication attribute" + type: separate_pins + +outputs: + - name: _testpoints_attr@_KIBOT_IMPORT_ID@ + comment: "Testpoints report by fabrication attribute" + type: bom + dir: @_KIBOT_IMPORT_DIR@ + options: + pre_transform: @_KIBOT_PRE_TRANSFORM@ + exclude_filter: @_KIBOT_EXCLUDE_FILTER@ + dnf_filter: @_KIBOT_DNF_FILTER@ + exclude_marked_in_sch: false + group_fields: [] + sort_style: ref + use_aux_axis_as_origin: true + ignore_dnf: false + format: @_KIBOT_TESTPOINTS_FORMAT@ + xlsx: + logo_scale: 1.7 + csv: + hide_pcb_info: true + hide_stats_info: true + footprint_type_values: 'SMT,THRU,' + columns: + - field: Row + name: '' + - field: References + name: Source + - field: Net Name + name: Net + - field: Net Class + - field: Footprint Side + name: Side + - field: Footprint X + name: X-Loc + - field: Footprint Y + name: Y-Loc + - field: Footprint Type + name: Pad Type + + - name: _testpoints_summary@_KIBOT_IMPORT_ID@ + comment: "Testpoints summary by fabrication attribute" + type: report + dir: @_KIBOT_IMPORT_DIR@ + output_id: _testpoints + options: + template: testpoints + + +... +definitions: + _KIBOT_IMPORT_ID: '' + _KIBOT_IMPORT_DIR: 'Testpoints' + _KIBOT_PRE_TRANSFORM: ['_kicost_rename', '_separate_pins_for_tp'] + _KIBOT_DNF_FILTER: '_null' + _KIBOT_EXCLUDE_FILTER: '_null' + _KIBOT_TESTPOINTS_FORMAT: 'XLSX' diff --git a/kibot/resources/config_templates/Testpoints_by_attr_CSV.kibot.yaml b/kibot/resources/config_templates/Testpoints_by_attr_CSV.kibot.yaml new file mode 100644 index 000000000..55da5222c --- /dev/null +++ b/kibot/resources/config_templates/Testpoints_by_attr_CSV.kibot.yaml @@ -0,0 +1,9 @@ +# Testpoints selected by fabrication attribute +kibot: + version: 1 + +import: + - file: Testpoints_by_attr + definitions: + _KIBOT_IMPORT_ID: '_csv' + _KIBOT_TESTPOINTS_FORMAT: CSV diff --git a/kibot/resources/config_templates/Testpoints_by_attr_HTML.kibot.yaml b/kibot/resources/config_templates/Testpoints_by_attr_HTML.kibot.yaml new file mode 100644 index 000000000..f7214c08c --- /dev/null +++ b/kibot/resources/config_templates/Testpoints_by_attr_HTML.kibot.yaml @@ -0,0 +1,9 @@ +# Testpoints selected by fabrication attribute +kibot: + version: 1 + +import: + - file: Testpoints_by_attr + definitions: + _KIBOT_IMPORT_ID: '_html' + _KIBOT_TESTPOINTS_FORMAT: HTML diff --git a/kibot/resources/config_templates/Testpoints_by_value.kibot.yaml b/kibot/resources/config_templates/Testpoints_by_value.kibot.yaml new file mode 100644 index 000000000..fe5dc1915 --- /dev/null +++ b/kibot/resources/config_templates/Testpoints_by_value.kibot.yaml @@ -0,0 +1,58 @@ +# Testpoints selected by value +kibot: + version: 1 + +filters: + - name: _separate_testpoints + comment: "Separate components with value starting with `TestPoint`" + type: generic + include_only: + - column: Value + regex: "^TestPoint" + +outputs: + - name: _testpoints_value@_KIBOT_IMPORT_ID@ + comment: "Testpoints report by value" + type: bom + dir: @_KIBOT_IMPORT_DIR@ + options: + pre_transform: @_KIBOT_PRE_TRANSFORM@ + exclude_filter: @_KIBOT_EXCLUDE_FILTER@ + dnf_filter: @_KIBOT_DNF_FILTER@ + exclude_marked_in_sch: false + group_fields: [] + sort_style: ref + use_aux_axis_as_origin: true + ignore_dnf: false + format: @_KIBOT_TESTPOINTS_FORMAT@ + xlsx: + logo_scale: 1.7 + csv: + hide_pcb_info: true + hide_stats_info: true + footprint_type_values: 'SMT,THRU,' + columns: + - field: Row + name: '' + - field: References + name: Source + - field: Net Name + name: Net + - field: Net Class + - field: Footprint Side + name: Side + - field: Footprint X + name: X-Loc + - field: Footprint Y + name: Y-Loc + - field: Footprint Type NV + name: Pad Type + +... +definitions: + _KIBOT_IMPORT_ID: '' + _KIBOT_IMPORT_DIR: 'Testpoints' + _KIBOT_PRE_TRANSFORM: '_kicost_rename' + _KIBOT_DNF_FILTER: '_null' + _KIBOT_EXCLUDE_FILTER: '_separate_testpoints' + _KIBOT_TESTPOINTS_FORMAT: 'XLSX' diff --git a/kibot/resources/config_templates/Testpoints_by_value_CSV.kibot.yaml b/kibot/resources/config_templates/Testpoints_by_value_CSV.kibot.yaml new file mode 100644 index 000000000..f9b018edc --- /dev/null +++ b/kibot/resources/config_templates/Testpoints_by_value_CSV.kibot.yaml @@ -0,0 +1,9 @@ +# Testpoints selected by value +kibot: + version: 1 + +import: + - file: Testpoints_by_value + definitions: + _KIBOT_IMPORT_ID: '_csv' + _KIBOT_TESTPOINTS_FORMAT: CSV diff --git a/kibot/resources/config_templates/Testpoints_by_value_HTML.kibot.yaml b/kibot/resources/config_templates/Testpoints_by_value_HTML.kibot.yaml new file mode 100644 index 000000000..d7125453c --- /dev/null +++ b/kibot/resources/config_templates/Testpoints_by_value_HTML.kibot.yaml @@ -0,0 +1,9 @@ +# Testpoints selected by value +kibot: + version: 1 + +import: + - file: Testpoints_by_value + definitions: + _KIBOT_IMPORT_ID: '_html' + _KIBOT_TESTPOINTS_FORMAT: HTML diff --git a/kibot/resources/report_templates/report_full.txt b/kibot/resources/report_templates/report_full.txt index 22da74cd4..ed3a9213d 100644 --- a/kibot/resources/report_templates/report_full.txt +++ b/kibot/resources/report_templates/report_full.txt @@ -108,6 +108,22 @@ Drill tools (including vias and computing adjusts and rounding): #drill_tools:- ${drill_mm} mm (${drill_mils} mils) (${count}) +Solder paste stats: + +Using a paste with ${solder_paste_metal_amount} % alloy, that has an specific gravity for the alloy of ${alloy_specific_gravity} g/cmĀ³ +and ${flux_specific_gravity} g/cmĀ³ for the flux. This paste has an specific gravity of ${%5.2f,solder_paste_gravity} g/cmĀ³. + +The stencil thickness is ${%5.2f,stencil_thickness} mm. + +| Side | Pads with paste | Area [mmĀ²] | Paste [g] | +|--------|-----------------|------------|-----------| +#?paste_pads_front and paste_pads_bottom +| Top | ${%15s,paste_pads_front} | ${%10.2f,paste_pads_front_area} | ${%9.2f,solder_paste_front} | +#?paste_pads_front and paste_pads_bottom +| Bottom | ${%15s,paste_pads_bottom} | ${%10.2f,paste_pads_bottom_area} | ${%9.2f,solder_paste_bottom} | +| Total | ${%15s,paste_pads} | ${%10.2f,paste_pads_area} | ${%9.2f,solder_paste} | + +Note: this is just an approximation to the theoretical value. Margins of the solder mask and waste aren't computed. #?schematic_svgs # Schematic diff --git a/kibot/resources/report_templates/report_full_svg.txt b/kibot/resources/report_templates/report_full_svg.txt index 70d0ea75e..69d6753c6 100644 --- a/kibot/resources/report_templates/report_full_svg.txt +++ b/kibot/resources/report_templates/report_full_svg.txt @@ -108,6 +108,22 @@ Drill tools (including vias and computing adjusts and rounding): #drill_tools:- ${drill_mm} mm (${drill_mils} mils) (${count}) +Solder paste stats: + +Using a paste with ${solder_paste_metal_amount} % alloy, that has an specific gravity for the alloy of ${alloy_specific_gravity} g/cmĀ³ +and ${flux_specific_gravity} g/cmĀ³ for the flux. This paste has an specific gravity of ${%5.2f,solder_paste_gravity} g/cmĀ³. + +The stencil thickness is ${%5.2f,stencil_thickness} mm. + +| Side | Pads with paste | Area [mmĀ²] | Paste [g] | +|--------|-----------------|------------|-----------| +#?paste_pads_front and paste_pads_bottom +| Top | ${%15s,paste_pads_front} | ${%10.2f,paste_pads_front_area} | ${%9.2f,solder_paste_front} | +#?paste_pads_front and paste_pads_bottom +| Bottom | ${%15s,paste_pads_bottom} | ${%10.2f,paste_pads_bottom_area} | ${%9.2f,solder_paste_bottom} | +| Total | ${%15s,paste_pads} | ${%10.2f,paste_pads_area} | ${%9.2f,solder_paste} | + +Note: this is just an approximation to the theoretical value. Margins of the solder mask and waste aren't computed. #?schematic_svgs # Schematic diff --git a/kibot/resources/report_templates/report_testpoints.txt b/kibot/resources/report_templates/report_testpoints.txt new file mode 100644 index 000000000..c702d867c --- /dev/null +++ b/kibot/resources/report_templates/report_testpoints.txt @@ -0,0 +1,23 @@ +# Testpoints + +Total pads: ${total_pads} +Total testpoints: ${testpoint_pads} +Total Nets: ${total_nets} + +- With testpoint: ${nets_with_testpoint} + +TestPoint coverage: ${%5.2f,testpoint_coverage} % + + +## Nets without testpoint + +#nets_without_testpoint:- ${net} + +## Nets with one testpoint + +#nets_with_one_testpoint:- ${net}: ${pad} + +## Nets with more than one testpoint + +#nets_with_many_testpoints:- ${net}: ${pads} + diff --git a/kibot/var_base.py b/kibot/var_base.py index 664f340f6..dd0972b54 100644 --- a/kibot/var_base.py +++ b/kibot/var_base.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2022 Salvador E. Tropea -# Copyright (c) 2020-2022 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Note: the algorithm used to detect the PCB outline is adapted from KiKit project. from itertools import chain @@ -107,6 +107,12 @@ def __init__(self): self.center_result = True """ Move the resulting PCB to the center of the page. You can disable it only for the internal tool, KiKit should always do it """ + self._name_example = 'a_sub_pcb' + self._reference_example = 'BRD1' + + def __str__(self): + res = self.name+' ' + return res+(self.reference if self.reference else f'({self.tlx},{self.tly}) ({self.brx},{self.bry})') def is_zero(self, val): return isinstance(val, (int, float)) and val == 0 @@ -120,11 +126,9 @@ def config(self, parent): self.is_zero(self.bry)): raise KiPlotConfigurationError('No reference or rectangle specified for {} sub-PCB'.format(self.name)) self.add_units(('tlx', 'tly', 'brx', 'bry', 'tolerance'), self.units, convert=True) - self.board_rect = GS.create_eda_rect(self._tlx, self._tly, self._brx, self._bry) if not self._tolerance and GS.ki5: # KiCad 5 workaround: rounding issues generate 1 fm of error. So we change to 2 fm tolerance. self._tolerance = 2 - self.board_rect.Inflate(int(self._tolerance)) def get_separate_source(self): if self.reference: @@ -178,7 +182,7 @@ def _remove_items(self, iter): if with_width: width = m.GetWidth() m.SetWidth(0) - if not self.board_rect.Contains(m.GetBoundingBox()): + if not self._board_rect.Contains(m.GetBoundingBox()): GS.board.Remove(m) self._removed.append(m) if with_width: @@ -190,14 +194,14 @@ def _remove_modules(self, iter, comps_hash): We also check their position, not their BBox. """ for m in iter: ref = m.GetReference() - if not self.board_rect.Contains(m.GetPosition()) or (self.strip_annotation and ref == self.reference): + if not self._board_rect.Contains(m.GetPosition()) or (self.strip_annotation and ref == self.reference): GS.board.Remove(m) self._removed.append(m) if comps_hash: self._excl_by_sub_pcb.add(ref) def remove_outside(self, comps_hash): - """ Remove footprints, drawings, text and zones outside `board_rect` rectangle. + """ Remove footprints, drawings, text and zones outside `_board_rect` rectangle. Keep them in a list to restore later. """ self._removed = [] self._remove_modules(GS.get_modules(), comps_hash) @@ -299,7 +303,7 @@ def center_objects(self): paper_center_x = GS.from_mm(pcb.paper_w/2) paper_center_y = GS.from_mm(pcb.paper_h/2) # Compute the offset to make it centered - self._moved = self.board_rect.GetCenter() + self._moved = self._board_rect.GetCenter() self._moved.x = paper_center_x-self._moved.x self._moved.y = paper_center_y-self._moved.y self.move_objects() @@ -307,11 +311,13 @@ def center_objects(self): def apply(self, comps_hash): """ Apply the sub-PCB selection. """ self._excl_by_sub_pcb = set() + self._board_rect = GS.create_eda_rect(self._tlx, self._tly, self._brx, self._bry) + self._board_rect.Inflate(int(self._tolerance)) if self.tool == 'internal': if self.reference: # Get the rectangle containing the board edge pointed by the reference - self.board_rect = self.search_reference_rect(self.reference) - self.board_rect.Inflate(int(self._tolerance)) + self._board_rect = self.search_reference_rect(self.reference) + self._board_rect.Inflate(int(self._tolerance)) # Using a rectangle self.remove_outside(comps_hash) # Center the PCB @@ -319,6 +325,8 @@ def apply(self, comps_hash): else: # Using KiKit: self.separate_board(comps_hash) + # This can't be cloned + self._board_rect = None def unload_board(self, comps_hash): # Undo the sub-PCB: just reload the PCB @@ -364,33 +372,28 @@ def __init__(self): """ Text to use as the replacement for %v expansion """ # * Filters self.pre_transform = Optionable - """ [string|list(string)=''] Name of the filter to transform fields before applying other filters. + """ [string|list(string)='_null'] Name of the filter to transform fields before applying other filters. Use '_var_rename' to transform VARIANT:FIELD fields. Use '_var_rename_kicost' to transform kicost.VARIANT:FIELD fields. Use '_kicost_rename' to apply KiCost field rename rules """ self.exclude_filter = Optionable - """ [string|list(string)=''] Name of the filter to exclude components from BoM processing. + """ [string|list(string)='_null'] Name of the filter to exclude components from BoM processing. Use '_mechanical' for the default KiBoM behavior """ self.dnf_filter = Optionable - """ [string|list(string)=''] Name of the filter to mark components as 'Do Not Fit'. + """ [string|list(string)='_null'] Name of the filter to mark components as 'Do Not Fit'. Use '_kibom_dnf' for the default KiBoM behavior. Use '_kicost_dnp'' for the default KiCost behavior """ self.dnc_filter = Optionable - """ [string|list(string)=''] Name of the filter to mark components as 'Do Not Change'. + """ [string|list(string)='_null'] Name of the filter to mark components as 'Do Not Change'. Use '_kibom_dnc' for the default KiBoM behavior """ self.sub_pcbs = SubPCBOptions - """ [list(dict)] Used for multi-board workflows as defined by KiKit. + """ [list(dict)=[]] Used for multi-board workflows as defined by KiKit. I don't recommend using it, for detail read [this](https://github.com/INTI-CMNB/KiBot/tree/master/docs/1_SCH_2_part_PCBs). But if you really need it you can define the sub-PCBs here. Then you just use *VARIANT[SUB_PCB_NAME]* instead of just *VARIANT* """ self._sub_pcb = None - def config(self, parent): - super().config(parent) - if isinstance(self.sub_pcbs, type): - self.sub_pcbs = [] - def get_variant_field(self): """ Returns the name of the field used to determine if the component belongs to the variant """ return None @@ -399,6 +402,13 @@ def matches_variant(self, text): """ This is a generic match mechanism used by variants that doesn't really have a matching mechanism """ return self.name.lower() == text.lower() + def fix_doc(self, name, value=None): + what = '_null' + if value is None: + value = '' + what = "='"+what+"'" + self.set_doc(name, self.get_doc_simple(name).replace(what, value)) + def filter(self, comps): # Apply all the filters comps = apply_pre_transform(comps, self.pre_transform) diff --git a/kibot/var_ibom.py b/kibot/var_ibom.py index e9396aeec..fb644d159 100644 --- a/kibot/var_ibom.py +++ b/kibot/var_ibom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020 Salvador E. Tropea -# Copyright (c) 2020 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Description: Implements the IBoM variants mechanism. from .optionable import Optionable @@ -26,9 +26,10 @@ def __init__(self): self.variant_field = 'Config' """ Name of the field that stores board variant for component """ self.variants_blacklist = Optionable - """ [string|list(string)=''] List of board variants to exclude from the BOM """ + """ [string|list(string)=[]] {comma_sep} List of board variants to exclude from the BOM """ self.variants_whitelist = Optionable - """ [string|list(string)=''] List of board variants to include in the BOM """ + """ [string|list(string)=[]] {comma_sep} List of board variants to include in the BOM """ + self.fix_doc('exclude_filter', IFILT_MECHANICAL) def get_variant_field(self): """ Returns the name of the field used to determine if the component belongs to the variant """ @@ -40,8 +41,6 @@ def config(self, parent): self.exclude_filter = BaseFilter.solve_filter(self.exclude_filter, 'exclude_filter', IFILT_MECHANICAL) self.dnf_filter = BaseFilter.solve_filter(self.dnf_filter, 'dnf_filter') self.dnc_filter = BaseFilter.solve_filter(self.dnc_filter, 'dnc_filter') - self.variants_blacklist = self.force_list(self.variants_blacklist) - self.variants_whitelist = self.force_list(self.variants_whitelist) def skip_component(self, c): """ Skip components that doesn't belong to this variant. """ @@ -64,11 +63,11 @@ def filter(self, comps): self.variants_blacklist = [v.lower() for v in self.variants_blacklist] # Apply to all the components for c in comps: - logger.debug("{} {} {}".format(c.ref, c.fitted, c.included)) + logger.debug("- Check {} fitted {} included {}".format(c.ref, c.fitted, c.included)) if not (c.fitted and c.included): # Don't check if we already discarded it continue c.fitted = not self.skip_component(c) if not c.fitted and GS.debug_level > 2: - logger.debug('ref: {} value: {} -> False'.format(c.ref, c.value)) + logger.debug(f' fitted -> False (value: {c.value})') return comps diff --git a/kibot/var_kibom.py b/kibot/var_kibom.py index 5d4cc74fb..2bf02e83f 100644 --- a/kibot/var_kibom.py +++ b/kibot/var_kibom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2022 Salvador E. Tropea -# Copyright (c) 2020-2022 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # Description: Implements the KiBoM variants mechanism. from .optionable import Optionable @@ -22,59 +22,40 @@ class KiBoM(BaseVariant): # noqa: F821 +VARIANT includes the component only if we are using this variant """ def __init__(self): super().__init__() - self._def_pre_transform = None - self._def_exclude_filter = None - self._def_dnf_filter = None - self._def_dnc_filter = None with document: self.config_field = 'Config' """ Name of the field used to classify components """ self.variant = Optionable - """ [string|list(string)=''] Board variant(s) """ + """ [string|list(string)=[]] {comma_sep} Board variant(s) """ self.fix_doc('exclude_filter', IFILT_MECHANICAL) self.fix_doc('dnf_filter', '_kibom_dnf_CONFIG_FIELD') self.fix_doc('dnc_filter', '_kibom_dnc_CONFIG_FIELD') - def fix_doc(self, name, value): - d, _, _ = self.get_doc(name) - d = d.replace("''", "'"+value+"'") - self.set_doc(name, d) - def get_variant_field(self): """ Returns the name of the field used to determine if the component belongs to the variant """ return self.config_field - def set_def_filters(self, exclude_filter, dnf_filter, dnc_filter, pre_transform): - """ Filters delegated to the variant """ - self._def_exclude_filter = exclude_filter - self._def_dnf_filter = dnf_filter - self._def_dnc_filter = dnc_filter - self._def_pre_transform = pre_transform + def clear_filters(self): + """ Remove any filter """ + self.exclude_filter = self.dnf_filter = self.dnc_filter = self.pre_transform = None + + @staticmethod + def fix_dnx_filter(name, config_field): + if isinstance(name, list): + name = name[0] + if name.startswith('_kibom_dn') and name.endswith('_CONFIG_FIELD'): + return name[:11]+config_field + return name def config(self, parent): # Now we can let the parent initialize the filters super().config(parent) # Variants, ensure a lowercase list - self.variant = [v.lower() for v in self.force_list(self.variant)] - # Filters priority: - # 1) Defined here - # 2) Delegated from the output format - # 3) KiBoM default behavior - # pre_transform - self.pre_transform = BaseFilter.solve_filter(self.pre_transform, 'pre_transform', self._def_pre_transform, - is_transform=True) - # exclude_filter - if not self._def_exclude_filter: - self._def_exclude_filter = IFILT_MECHANICAL - self.exclude_filter = BaseFilter.solve_filter(self.exclude_filter, 'exclude_filter', self._def_exclude_filter) - # dnf_filter - if not self._def_dnf_filter: - self._def_dnf_filter = '_kibom_dnf_'+self.config_field - self.dnf_filter = BaseFilter.solve_filter(self.dnf_filter, 'dnf_filter', self._def_dnf_filter) - # dnc_filter - if not self._def_dnc_filter: - self._def_dnc_filter = '_kibom_dnc_'+self.config_field - self.dnc_filter = BaseFilter.solve_filter(self.dnc_filter, 'dnc_filter', self._def_dnc_filter) + self.variant = [v.lower() for v in self.variant] + self.pre_transform = BaseFilter.solve_filter(self.pre_transform, 'pre_transform', is_transform=True) + self.exclude_filter = BaseFilter.solve_filter(self.exclude_filter, 'exclude_filter') + self.dnf_filter = BaseFilter.solve_filter(self.fix_dnx_filter(self.dnf_filter, self.config_field), 'dnf_filter') + self.dnc_filter = BaseFilter.solve_filter(self.fix_dnx_filter(self.dnc_filter, self.config_field), 'dnc_filter') # Config field must be lowercase self.config_field = self.config_field.lower() diff --git a/kibot/var_kicost.py b/kibot/var_kicost.py index d1bd3241f..ad5beff81 100644 --- a/kibot/var_kicost.py +++ b/kibot/var_kicost.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2023 Salvador E. Tropea -# Copyright (c) 2020-2023 Instituto Nacional de TecnologĆ­a Industrial -# License: GPL-3.0 +# Copyright (c) 2020-2024 Salvador E. Tropea +# Copyright (c) 2020-2024 Instituto Nacional de TecnologĆ­a Industrial +# License: AGPL-3.0 # Project: KiBot (formerly KiPlot) # The algorithm is from KiCost project (https://github.com/xesscorp/KiCost) # Description: Implements the KiCost variants mechanism. @@ -9,12 +9,17 @@ from .gs import GS from .misc import IFILT_KICOST_RENAME, IFILT_KICOST_DNP from .fil_base import BaseFilter +from .optionable import Optionable from .macros import macros, document, variant_class # noqa: F401 from . import log logger = log.get_logger() +class KiCostPreTransform(Optionable): + _default = ['_var_rename_kicost', IFILT_KICOST_RENAME] + + @variant_class class KiCost(BaseVariant): # noqa: F821 """ KiCost variant style @@ -35,6 +40,9 @@ def __init__(self): """ Valid separators for variants in the variant field. Each character is a valid separator. Only supported internally, don't use it if you plan to use KiCost """ + self.fix_doc('pre_transform') + self.pre_transform = KiCostPreTransform + self.fix_doc('dnf_filter', IFILT_KICOST_DNP) def get_variant_field(self): """ Returns the name of the field used to determine if the component belongs to the variant """ @@ -42,10 +50,9 @@ def get_variant_field(self): def config(self, parent): super().config(parent) - self.pre_transform = BaseFilter.solve_filter(self.pre_transform, 'pre_transform', - ['_var_rename_kicost', IFILT_KICOST_RENAME], is_transform=True) + self.pre_transform = BaseFilter.solve_filter(self.pre_transform, 'pre_transform', is_transform=True) self.exclude_filter = BaseFilter.solve_filter(self.exclude_filter, 'exclude_filter') - self.dnf_filter = BaseFilter.solve_filter(self.dnf_filter, 'dnf_filter', IFILT_KICOST_DNP) + self.dnf_filter = BaseFilter.solve_filter(self.dnf_filter, 'dnf_filter') self.dnc_filter = BaseFilter.solve_filter(self.dnc_filter, 'dnc_filter') if not self.separators: self.separators = ' ' diff --git a/src/kibot-check b/src/kibot-check index d17af2188..85b87ce20 100755 --- a/src/kibot-check +++ b/src/kibot-check @@ -385,8 +385,8 @@ deps = '{\ "output": "kibom",\ "version": [\ 1,\ - 8,\ - 0\ + 9,\ + 1\ ]\ }\ ],\ @@ -404,7 +404,7 @@ deps = '{\ "extra_arch": null,\ "extra_deb": null,\ "help_option": "--version",\ - "importance": 150004,\ + "importance": 160004,\ "in_debian": false,\ "is_kicad_plugin": false,\ "is_python": false,\ @@ -591,6 +591,17 @@ deps = '{\ 0\ ]\ },\ + {\ + "desc": null,\ + "mandatory": true,\ + "max_version": null,\ + "output": "convert_pcb",\ + "version": [\ + 2,\ + 3,\ + 2\ + ]\ + },\ {\ "desc": null,\ "mandatory": true,\ @@ -1384,8 +1395,8 @@ def check_tool_binary_python(name): def check_tool_binary_local(name): - home = os.environ.get('HOME') or os.environ.get('username') - if home is None: + home = os.path.expanduser('~') + if not home: return None home_bin = os.path.join(home, '.local', 'share', 'kibot', 'bin') full_name = os.path.join(home_bin, name) @@ -1691,7 +1702,7 @@ if args.show_paths: print(' '+os.__file__) print(' '+str(which('python3'))) # KiCad -home = None +home = os.path.expanduser('~') try: import pcbnew kicad_ok = True @@ -1714,8 +1725,7 @@ try: kicad_plugins_dirs.append(os.path.join(kicad_conf_path, 'scripting')) kicad_plugins_dirs.append(os.path.join(kicad_conf_path, 'scripting', 'plugins')) # ~/.kicad_plugins and ~/.kicad - if 'HOME' in os.environ: - home = os.environ['HOME'] + if home: kicad_plugins_dirs.append(os.path.join(home, '.kicad_plugins')) kicad_plugins_dirs.append(os.path.join(home, '.kicad', 'scripting')) kicad_plugins_dirs.append(os.path.join(home, '.kicad', 'scripting', 'plugins')) @@ -1754,7 +1764,10 @@ if kicad_ok: if kicad_version[0] >= 6 and home: # KiCad 6.0 PCM ver_dir = str(kicad_version[0])+'.'+str(kicad_version[1]) - local_share = os.path.join(home, '.local', 'share', 'kicad', ver_dir) + if system == 'Linux': + local_share = os.path.join(home, '.local', 'share', 'kicad', ver_dir) + else: + local_share = os.path.join(home, 'Documents', 'KiCad', ver_dir) kicad_plugins_dirs.append(os.path.join(local_share, 'scripting')) kicad_plugins_dirs.append(os.path.join(local_share, 'scripting', 'plugins')) kicad_plugins_dirs.append(os.path.join(local_share, '3rdparty', 'plugins')) # KiCad 6.0 PCM @@ -1866,9 +1879,9 @@ elif which('pip'): if not os_ok: print(sev2color(4)+'* KiBot is currently tested under Linux') if system == 'Darwin': - print(' MacOSX should be supported for KiCad 6.x') + print(' MacOSX should be supported for KiCad 6.x or newer') elif system == 'Windows': - print(' Windows may work with some limitations for KiCad 6.x') + print(' Windows may work with some limitations for KiCad 6.x or newer') print(' Consider using a docker image, Windows docker can run Linux images (using virtualization)') print(' You can also try WSL (Windows Subsystem for Linux)') else: diff --git a/src/kibot-check.in b/src/kibot-check.in index 544c88db3..adb665ffa 100755 --- a/src/kibot-check.in +++ b/src/kibot-check.in @@ -51,8 +51,8 @@ def check_tool_binary_python(name): def check_tool_binary_local(name): - home = os.environ.get('HOME') or os.environ.get('username') - if home is None: + home = os.path.expanduser('~') + if not home: return None home_bin = os.path.join(home, '.local', 'share', 'kibot', 'bin') full_name = os.path.join(home_bin, name) @@ -358,7 +358,7 @@ if args.show_paths: print(' '+os.__file__) print(' '+str(which('python3'))) # KiCad -home = None +home = os.path.expanduser('~') try: import pcbnew kicad_ok = True @@ -381,8 +381,7 @@ try: kicad_plugins_dirs.append(os.path.join(kicad_conf_path, 'scripting')) kicad_plugins_dirs.append(os.path.join(kicad_conf_path, 'scripting', 'plugins')) # ~/.kicad_plugins and ~/.kicad - if 'HOME' in os.environ: - home = os.environ['HOME'] + if home: kicad_plugins_dirs.append(os.path.join(home, '.kicad_plugins')) kicad_plugins_dirs.append(os.path.join(home, '.kicad', 'scripting')) kicad_plugins_dirs.append(os.path.join(home, '.kicad', 'scripting', 'plugins')) @@ -421,7 +420,10 @@ if kicad_ok: if kicad_version[0] >= 6 and home: # KiCad 6.0 PCM ver_dir = str(kicad_version[0])+'.'+str(kicad_version[1]) - local_share = os.path.join(home, '.local', 'share', 'kicad', ver_dir) + if system == 'Linux': + local_share = os.path.join(home, '.local', 'share', 'kicad', ver_dir) + else: + local_share = os.path.join(home, 'Documents', 'KiCad', ver_dir) kicad_plugins_dirs.append(os.path.join(local_share, 'scripting')) kicad_plugins_dirs.append(os.path.join(local_share, 'scripting', 'plugins')) kicad_plugins_dirs.append(os.path.join(local_share, '3rdparty', 'plugins')) # KiCad 6.0 PCM @@ -533,9 +535,9 @@ elif which('pip'): if not os_ok: print(sev2color(4)+'* KiBot is currently tested under Linux') if system == 'Darwin': - print(' MacOSX should be supported for KiCad 6.x') + print(' MacOSX should be supported for KiCad 6.x or newer') elif system == 'Windows': - print(' Windows may work with some limitations for KiCad 6.x') + print(' Windows may work with some limitations for KiCad 6.x or newer') print(' Consider using a docker image, Windows docker can run Linux images (using virtualization)') print(' You can also try WSL (Windows Subsystem for Linux)') else: diff --git a/tests/.config/kiplot/plugins/out_test.py b/tests/.config/kiplot/plugins/out_test.py index 2204853c3..e9d09c3bc 100644 --- a/tests/.config/kiplot/plugins/out_test.py +++ b/tests/.config/kiplot/plugins/out_test.py @@ -26,7 +26,7 @@ def __init__(self): logger.debug('Creating a test') with document: self.options = TestOptions - """ [dict] Options for the `test` output """ # pragma: no cover + """ [dict={}] Options for the `test` output """ # pragma: no cover def run(self, output_dir): logger.debug("Running test plug-in with "+output_dir) diff --git a/tests/.config/kiplot/plugins/pre_test.py b/tests/.config/kiplot/plugins/pre_test.py index 009f9ae1a..82a60ba21 100644 --- a/tests/.config/kiplot/plugins/pre_test.py +++ b/tests/.config/kiplot/plugins/pre_test.py @@ -1,4 +1,4 @@ -from kibot.macros import macros, pre_class # noqa: F401 +from kibot.macros import macros, document, pre_class # noqa: F401 from .log import get_logger logger = get_logger(__name__) @@ -6,7 +6,11 @@ @pre_class class Pre_Test(BasePreFlight): # noqa: F821 - def __init__(self, name, value): - super().__init__(name, value) - self._enabled = value + """ Pre Test + A preflight just for testing purposes """ + def __init__(self): + super().__init__() self._pcb_related = True + with document: + self.pre_test = False + """ Enable this preflight """ diff --git a/tests/board_samples/kicad_5/bom_adhes.kicad_pcb b/tests/board_samples/kicad_5/bom_adhes.kicad_pcb new file mode 120000 index 000000000..2f5270e5e --- /dev/null +++ b/tests/board_samples/kicad_5/bom_adhes.kicad_pcb @@ -0,0 +1 @@ +bom.kicad_pcb \ No newline at end of file diff --git a/tests/board_samples/kicad_5/bom_adhes.sch b/tests/board_samples/kicad_5/bom_adhes.sch new file mode 120000 index 000000000..4887ab932 --- /dev/null +++ b/tests/board_samples/kicad_5/bom_adhes.sch @@ -0,0 +1 @@ +bom.sch \ No newline at end of file diff --git a/tests/board_samples/kicad_6/bom_adhes.kicad_pcb b/tests/board_samples/kicad_6/bom_adhes.kicad_pcb new file mode 120000 index 000000000..2f5270e5e --- /dev/null +++ b/tests/board_samples/kicad_6/bom_adhes.kicad_pcb @@ -0,0 +1 @@ +bom.kicad_pcb \ No newline at end of file diff --git a/tests/board_samples/kicad_6/bom_adhes.kicad_sch b/tests/board_samples/kicad_6/bom_adhes.kicad_sch new file mode 120000 index 000000000..5e75b812f --- /dev/null +++ b/tests/board_samples/kicad_6/bom_adhes.kicad_sch @@ -0,0 +1 @@ +bom.kicad_sch \ No newline at end of file diff --git a/tests/board_samples/kicad_7/bom_adhes.kicad_pcb b/tests/board_samples/kicad_7/bom_adhes.kicad_pcb new file mode 120000 index 000000000..2f5270e5e --- /dev/null +++ b/tests/board_samples/kicad_7/bom_adhes.kicad_pcb @@ -0,0 +1 @@ +bom.kicad_pcb \ No newline at end of file diff --git a/tests/board_samples/kicad_7/bom_adhes.kicad_sch b/tests/board_samples/kicad_7/bom_adhes.kicad_sch new file mode 120000 index 000000000..5e75b812f --- /dev/null +++ b/tests/board_samples/kicad_7/bom_adhes.kicad_sch @@ -0,0 +1 @@ +bom.kicad_sch \ No newline at end of file diff --git a/tests/board_samples/kicad_8/bom_adhes.kicad_pcb b/tests/board_samples/kicad_8/bom_adhes.kicad_pcb new file mode 100644 index 000000000..3702fa5b3 --- /dev/null +++ b/tests/board_samples/kicad_8/bom_adhes.kicad_pcb @@ -0,0 +1,793 @@ +(kicad_pcb + (version 20240108) + (generator "pcbnew") + (generator_version "8.0") + (general + (thickness 1.6) + (legacy_teardrops no) + ) + (paper "A4") + (layers + (0 "F.Cu" signal) + (31 "B.Cu" signal) + (32 "B.Adhes" user "B.Adhesive") + (33 "F.Adhes" user "F.Adhesive") + (34 "B.Paste" user) + (35 "F.Paste" user) + (36 "B.SilkS" user "B.Silkscreen") + (37 "F.SilkS" user "F.Silkscreen") + (38 "B.Mask" user) + (39 "F.Mask" user) + (40 "Dwgs.User" user "User.Drawings") + (41 "Cmts.User" user "User.Comments") + (42 "Eco1.User" user "User.Eco1") + (43 "Eco2.User" user "User.Eco2") + (44 "Edge.Cuts" user) + (45 "Margin" user) + (46 "B.CrtYd" user "B.Courtyard") + (47 "F.CrtYd" user "F.Courtyard") + (48 "B.Fab" user) + (49 "F.Fab" user) + ) + (setup + (pad_to_mask_clearance 0) + (allow_soldermask_bridges_in_footprints no) + (aux_axis_origin 148.4 80.2) + (pcbplotparams + (layerselection 0x00010fc_ffffffff) + (plot_on_all_layers_selection 0x0000000_00000000) + (disableapertmacros no) + (usegerberextensions no) + (usegerberattributes no) + (usegerberadvancedattributes no) + (creategerberjobfile no) + (dashed_line_dash_ratio 12.000000) + (dashed_line_gap_ratio 3.000000) + (svgprecision 6) + (plotframeref no) + (viasonmask no) + (mode 1) + (useauxorigin no) + (hpglpennumber 1) + (hpglpenspeed 20) + (hpglpendiameter 15.000000) + (pdf_front_fp_property_popups yes) + (pdf_back_fp_property_popups yes) + (dxfpolygonmode yes) + (dxfimperialunits yes) + (dxfusepcbnewfont yes) + (psnegative no) + (psa4output no) + (plotreference yes) + (plotvalue yes) + (plotfptext yes) + (plotinvisibletext no) + (sketchpadsonfab no) + (subtractmaskfromsilk no) + (outputformat 1) + (mirror no) + (drillshape 1) + (scaleselection 1) + (outputdirectory "") + ) + ) + (net 0 "") + (net 1 "GND") + (net 2 "Net-(C1-Pad1)") + (net 3 "VCC") + (footprint "Capacitor_SMD:C_0805_2012Metric" + (layer "F.Cu") + (uuid "00000000-0000-0000-0000-00005ebea01d") + (at 146.3 78.6) + (descr "Capacitor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 76, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf, https://docs.google.com/spreadsheets/d/1BsfQQcO9C6DZCsRaXUlFlo91Tg2WpOkGARC1WS5S8t0/edit?usp=sharing), generated with kicad-footprint-generator") + (tags "capacitor") + (property "Reference" "C1" + (at 0 -1.65 0) + (layer "F.SilkS") + (uuid "5156832d-3a20-4910-ada3-43f11349a620") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "1uF" + (at 0 1.65 0) + (layer "F.Fab") + (uuid "7d830e9e-ca8d-405c-9522-5a97f348cbb9") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "2a032b88-0d2d-4b00-92f3-1e825cbc9f60") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "44201d7a-42a6-4037-b302-dce7b3dd0628") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "d4291cae-e4f9-4292-b79a-b3f1f68e4570") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (path "/00000000-0000-0000-0000-00005ebe91ac") + (attr smd) + (fp_line + (start -0.261252 -0.735) + (end 0.261252 -0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "02b7d92a-22cd-4459-9dcd-2ce5b807e2d9") + ) + (fp_line + (start -0.261252 0.735) + (end 0.261252 0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "3981a3b9-cfcb-4bfb-a958-293365d7c877") + ) + (fp_line + (start -1.7 -0.98) + (end 1.7 -0.98) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "3f61b978-781f-4d12-ba66-c6f14af48752") + ) + (fp_line + (start -1.7 0.98) + (end -1.7 -0.98) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "df481dfa-4060-413b-8134-0ac2115807fc") + ) + (fp_line + (start 1.7 -0.98) + (end 1.7 0.98) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "4f1195c5-11d6-4c13-a19f-c0b92d6aa5bf") + ) + (fp_line + (start 1.7 0.98) + (end -1.7 0.98) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "0a39b0eb-a969-442a-b9b2-26bc41e3156d") + ) + (fp_line + (start -1 -0.625) + (end 1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "4be95788-4e3c-4fcc-8dcb-5cdb6e15d6f2") + ) + (fp_line + (start -1 0.625) + (end -1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "fe2c02ea-d0f9-4f3c-b111-2105791284db") + ) + (fp_line + (start 1 -0.625) + (end 1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "5ac523cb-ca8a-4a4a-949c-5d679fa0fa98") + ) + (fp_line + (start 1 0.625) + (end -1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "7249fa99-227d-4874-8854-5ba766a0e81c") + ) + (fp_text user "${REFERENCE}" + (at 0 0 0) + (layer "F.Fab") + (uuid "72c04459-1877-4921-bfa8-dfb948d362ef") + (effects + (font + (size 0.5 0.5) + (thickness 0.08) + ) + ) + ) + (pad "1" smd roundrect + (at -0.95 0) + (size 1 1.45) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.25) + (net 2 "Net-(C1-Pad1)") + (uuid "47093265-53bc-49ef-8aae-af52cab37285") + ) + (pad "2" smd roundrect + (at 0.95 0) + (size 1 1.45) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.25) + (net 1 "GND") + (uuid "b1f3d5f2-cf1a-4ecc-bd0f-375f4d72d1a8") + ) + (model "${KICAD6_3DMODEL_DIR}/Capacitor_SMD.3dshapes/C_0805_2012Metric.wrl" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (footprint "Resistor_SMD:R_0805_2012Metric" + (layer "F.Cu") + (uuid "00000000-0000-0000-0000-00005ebea02e") + (at 146.3 81.55 180) + (descr "Resistor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator") + (tags "resistor") + (property "Reference" "R1" + (at 0 -1.65 0) + (layer "F.SilkS") + (uuid "1053aaea-fc19-4eee-914d-f959e8cc40e4") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "100" + (at 0 1.65 0) + (layer "F.Fab") + (uuid "63394e16-a998-492a-a7e7-99e409d94829") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "19538ed1-ddff-43e8-8b83-5a6455dc7dd2") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "e79eecc4-e6de-4640-b8b4-44ae86bc4b85") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "3d1e5abd-751d-4d8f-b830-cc25c484a389") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (path "/00000000-0000-0000-0000-00005ebe8a2e") + (attr smd) + (fp_line + (start -0.227064 0.735) + (end 0.227064 0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "f9e6a748-139b-436a-8bb7-0a36ea4aa8b2") + ) + (fp_line + (start -0.227064 -0.735) + (end 0.227064 -0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "f0302ab2-5bf2-4f8e-87bc-054eaf7e87ca") + ) + (fp_line + (start 1.68 0.95) + (end -1.68 0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "b80fa6a3-f5c0-4c5b-8461-ff0ec4b41b7d") + ) + (fp_line + (start 1.68 -0.95) + (end 1.68 0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "db6a1a12-d325-4052-9471-0f7f586cc979") + ) + (fp_line + (start -1.68 0.95) + (end -1.68 -0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "fa53ad7c-8da0-472e-bc80-ff2cb5e9801a") + ) + (fp_line + (start -1.68 -0.95) + (end 1.68 -0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "77c11789-e4da-4263-939d-2f9780c7d1a3") + ) + (fp_line + (start 1 0.625) + (end -1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "21918345-a3a1-4d20-b002-9b270582362f") + ) + (fp_line + (start 1 -0.625) + (end 1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "fa46cddb-5e63-441b-a52c-34e3063d1cc7") + ) + (fp_line + (start -1 0.625) + (end -1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "584b1607-1683-4d9d-a463-166798a8f09f") + ) + (fp_line + (start -1 -0.625) + (end 1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "3a9a2d79-17e3-44b5-8172-197d4bacecc2") + ) + (fp_text user "${REFERENCE}" + (at 0 0 0) + (layer "F.Fab") + (uuid "84210d8a-2ec3-4adf-9330-88113d389e5d") + (effects + (font + (size 0.5 0.5) + (thickness 0.08) + ) + ) + ) + (pad "1" smd roundrect + (at -0.9125 0 180) + (size 1.025 1.4) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.243902) + (net 3 "VCC") + (uuid "ca5dee75-0100-4e80-9909-6f982562aed0") + ) + (pad "2" smd roundrect + (at 0.9125 0 180) + (size 1.025 1.4) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.243902) + (net 2 "Net-(C1-Pad1)") + (uuid "2eaaa66f-26c8-4f24-a908-203ddfbb8a05") + ) + (model "${KICAD6_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_0805_2012Metrico.step" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (footprint "Resistor_SMD:R_0805_2012Metric" + (layer "F.Cu") + (uuid "00000000-0000-0000-0000-00005ebea03f") + (at 150.71 78.6 180) + (descr "Resistor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator") + (tags "resistor") + (property "Reference" "R2" + (at 0 -1.65 0) + (layer "F.SilkS") + (uuid "0ab00bc7-ccce-4c58-b197-9e23eae9c42a") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "200" + (at 0 1.65 0) + (layer "F.Fab") + (uuid "8c63214b-9b01-41a2-a5ec-dc9bc79be652") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "d8dd01a8-bca9-4819-8237-756c03acec23") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "2b3c3249-8a24-4b8d-a846-eb9659701250") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "0f934d8d-a84a-499b-8d39-d70671550b47") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (path "/00000000-0000-0000-0000-00005ebe8e9e") + (attr smd) + (fp_circle + (center 0 0) + (end 0.254 0) + (stroke + (width 0.1) + (type solid) + ) + (fill solid) + (layer "F.Adhes") + (uuid "a26b5a84-8119-4ed6-ac4b-153c7ba9aa92") + ) + (fp_line + (start -0.227064 0.735) + (end 0.227064 0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "4fa77920-15f8-478a-88fd-53ad3a3f1721") + ) + (fp_line + (start -0.227064 -0.735) + (end 0.227064 -0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "73cc7935-382d-427f-9ae7-c1549626bf35") + ) + (fp_line + (start 1.68 0.95) + (end -1.68 0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "f5626507-7dda-44c5-a395-29a1d8820e69") + ) + (fp_line + (start 1.68 -0.95) + (end 1.68 0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "ecd7ddf4-d72e-4029-b6bd-c9a995efd2a7") + ) + (fp_line + (start -1.68 0.95) + (end -1.68 -0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "8add9f1f-34dc-474e-8e5a-658ad85335ca") + ) + (fp_line + (start -1.68 -0.95) + (end 1.68 -0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "9f0372c1-ae1f-458e-90f4-eaafc0f34623") + ) + (fp_line + (start 1 0.625) + (end -1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "0878fabd-4c6f-47fe-bf61-c62c65c2b7ad") + ) + (fp_line + (start 1 -0.625) + (end 1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "bf1cfe02-9ffa-4325-b504-88bc94c1ab05") + ) + (fp_line + (start -1 0.625) + (end -1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "fab11f95-6bb3-456c-a864-e484c6d2b654") + ) + (fp_line + (start -1 -0.625) + (end 1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "db240f13-6a3e-43ef-bc53-58153445ec2d") + ) + (fp_text user "${REFERENCE}" + (at 0 0 0) + (layer "F.Fab") + (uuid "0db3ec9b-2c95-4019-8e43-4e3047b0581b") + (effects + (font + (size 0.5 0.5) + (thickness 0.08) + ) + ) + ) + (pad "1" smd roundrect + (at -0.9125 0 180) + (size 1.025 1.4) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.243902) + (net 2 "Net-(C1-Pad1)") + (uuid "c27af2e7-932c-4725-a4cb-98d32e6d6dfe") + ) + (pad "2" smd roundrect + (at 0.9125 0 180) + (size 1.025 1.4) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.243902) + (net 1 "GND") + (uuid "e87e7715-e05d-4071-a657-65eacaab75c4") + ) + (model "${KICAD6_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_0805_2012Metric.wrl" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (gr_line + (start 153 84) + (end 153 76) + (stroke + (width 0.05) + (type solid) + ) + (layer "Edge.Cuts") + (uuid "00000000-0000-0000-0000-00005ebea29b") + ) + (gr_line + (start 144 76) + (end 144 84) + (stroke + (width 0.05) + (type solid) + ) + (layer "Edge.Cuts") + (uuid "bb3326cd-028c-43fb-af47-5975412a67c7") + ) + (gr_line + (start 153 76) + (end 144 76) + (stroke + (width 0.05) + (type solid) + ) + (layer "Edge.Cuts") + (uuid "d534140b-6f16-4b83-8893-ef4b026f6ec9") + ) + (gr_line + (start 144 84) + (end 153 84) + (stroke + (width 0.05) + (type solid) + ) + (layer "Edge.Cuts") + (uuid "ea655683-6135-4d3f-a322-1186e1a703b2") + ) + (segment + (start 147.2375 78.6) + (end 149.7725 78.6) + (width 0.25) + (layer "F.Cu") + (net 1) + (uuid "4ebf58f7-8428-4480-b240-bb7d3c895103") + ) + (segment + (start 145.3625 78.6) + (end 146.4625 77.5) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "094b0da9-055e-4caf-8a61-eb0abbabc6ad") + ) + (segment + (start 150.5475 77.5) + (end 151.6475 78.6) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "3ec9ac06-d662-405d-a323-fd037fa00de7") + ) + (segment + (start 146.4625 77.5) + (end 150.5475 77.5) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "636a61f2-1871-4e58-a0a3-09c17469dd1e") + ) + (segment + (start 145.3625 81.55) + (end 145.3625 78.6) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "88783723-a7d1-470c-aea1-fc38629b827f") + ) +) diff --git a/tests/board_samples/kicad_8/bom_adhes.kicad_sch b/tests/board_samples/kicad_8/bom_adhes.kicad_sch new file mode 120000 index 000000000..5e75b812f --- /dev/null +++ b/tests/board_samples/kicad_8/bom_adhes.kicad_sch @@ -0,0 +1 @@ +bom.kicad_sch \ No newline at end of file diff --git a/tests/board_samples/kicad_8/fail-project.kicad_pro b/tests/board_samples/kicad_8/fail-project.kicad_pro index 9a66445a5..18073dfad 100644 --- a/tests/board_samples/kicad_8/fail-project.kicad_pro +++ b/tests/board_samples/kicad_8/fail-project.kicad_pro @@ -289,5 +289,7 @@ "legacy_lib_list": [] }, "sheets": [], - "text_variables": {} -} + "text_variables": { + "DUMMY": "foobar" + } +} \ No newline at end of file diff --git a/tests/board_samples/kicad_8/light_control.kicad_pro b/tests/board_samples/kicad_8/light_control.kicad_pro index 777bf79e1..e56b4de1a 100644 --- a/tests/board_samples/kicad_8/light_control.kicad_pro +++ b/tests/board_samples/kicad_8/light_control.kicad_pro @@ -6,14 +6,14 @@ "apply_defaults_to_fp_fields": false, "apply_defaults_to_fp_shapes": false, "apply_defaults_to_fp_text": false, - "board_outline_line_width": 0.049999999999999996, - "copper_line_width": 0.19999999999999998, + "board_outline_line_width": 0.05, + "copper_line_width": 0.2, "copper_text_italic": false, "copper_text_size_h": 1.5, "copper_text_size_v": 1.5, "copper_text_thickness": 0.3, "copper_text_upright": false, - "courtyard_line_width": 0.049999999999999996, + "courtyard_line_width": 0.05, "dimension_precision": 4, "dimension_units": 3, "dimensions": { @@ -24,13 +24,13 @@ "text_position": 0, "units_format": 1 }, - "fab_line_width": 0.09999999999999999, + "fab_line_width": 0.1, "fab_text_italic": false, "fab_text_size_h": 1.0, "fab_text_size_v": 1.0, "fab_text_thickness": 0.15, "fab_text_upright": false, - "other_line_width": 0.09999999999999999, + "other_line_width": 0.1, "other_text_italic": false, "other_text_size_h": 1.0, "other_text_size_v": 1.0, @@ -121,18 +121,18 @@ "max_error": 0.005, "min_clearance": 0.0, "min_connection": 0.0, - "min_copper_edge_clearance": 0.024999999999999998, + "min_copper_edge_clearance": 0.025, "min_hole_clearance": 0.25, "min_hole_to_hole": 0.25, - "min_microvia_diameter": 0.19999999999999998, - "min_microvia_drill": 0.09999999999999999, + "min_microvia_diameter": 0.2, + "min_microvia_drill": 0.1, "min_resolved_spokes": 2, "min_silk_clearance": 0.0, - "min_text_height": 0.7999999999999999, + "min_text_height": 0.8, "min_text_thickness": 0.08, "min_through_hole_diameter": 0.2032, "min_track_width": 0.127, - "min_via_annular_width": 0.049999999999999996, + "min_via_annular_width": 0.05, "min_via_diameter": 0.4572, "solder_mask_to_copper_clearance": 0.0, "use_height_for_length_calcs": true @@ -459,7 +459,7 @@ "pinned_symbol_libs": [] }, "meta": { - "filename": "light_control_diff.kicad_pro", + "filename": "light_control.kicad_pro", "version": 1 }, "net_settings": { diff --git a/tests/board_samples/kicad_8/panel_C1x4.kicad_pcb b/tests/board_samples/kicad_8/panel_C1x4.kicad_pcb new file mode 100644 index 000000000..2ef391cb2 --- /dev/null +++ b/tests/board_samples/kicad_8/panel_C1x4.kicad_pcb @@ -0,0 +1,2397 @@ +(kicad_pcb + (version 20240108) + (generator "pcbnew") + (generator_version "8.0") + (general + (thickness 1.6) + (legacy_teardrops no) + ) + (paper "A4") + (layers + (0 "F.Cu" signal) + (31 "B.Cu" signal) + (32 "B.Adhes" user "B.Adhesive") + (33 "F.Adhes" user "F.Adhesive") + (34 "B.Paste" user) + (35 "F.Paste" user) + (36 "B.SilkS" user "B.Silkscreen") + (37 "F.SilkS" user "F.Silkscreen") + (38 "B.Mask" user) + (39 "F.Mask" user) + (40 "Dwgs.User" user "User.Drawings") + (41 "Cmts.User" user "User.Comments") + (42 "Eco1.User" user "User.Eco1") + (43 "Eco2.User" user "User.Eco2") + (44 "Edge.Cuts" user) + (45 "Margin" user) + (46 "B.CrtYd" user "B.Courtyard") + (47 "F.CrtYd" user "F.Courtyard") + (48 "B.Fab" user) + (49 "F.Fab" user) + (50 "User.1" user) + (51 "User.2" user) + (52 "User.3" user) + (53 "User.4" user) + (54 "User.5" user) + (55 "User.6" user) + (56 "User.7" user) + (57 "User.8" user) + (58 "User.9" user) + ) + (setup + (pad_to_mask_clearance 0) + (allow_soldermask_bridges_in_footprints no) + (aux_axis_origin 137.75 20) + (grid_origin 137.75 20) + (pcbplotparams + (layerselection 0x00010fc_ffffffff) + (plot_on_all_layers_selection 0x0000000_00000000) + (disableapertmacros no) + (usegerberextensions no) + (usegerberattributes yes) + (usegerberadvancedattributes yes) + (creategerberjobfile yes) + (dashed_line_dash_ratio 12.000000) + (dashed_line_gap_ratio 3.000000) + (svgprecision 4) + (plotframeref no) + (viasonmask no) + (mode 1) + (useauxorigin no) + (hpglpennumber 1) + (hpglpenspeed 20) + (hpglpendiameter 15.000000) + (pdf_front_fp_property_popups yes) + (pdf_back_fp_property_popups yes) + (dxfpolygonmode yes) + (dxfimperialunits yes) + (dxfusepcbnewfont yes) + (psnegative no) + (psa4output no) + (plotreference yes) + (plotvalue yes) + (plotfptext yes) + (plotinvisibletext no) + (sketchpadsonfab no) + (subtractmaskfromsilk no) + (outputformat 1) + (mirror no) + (drillshape 1) + (scaleselection 1) + (outputdirectory "") + ) + ) + (net 0 "") + (net 1 "Board_0-unconnected-(C1-Pad1)") + (net 2 "Board_0-unconnected-(C1-Pad2)") + (net 3 "Board_1-unconnected-(C1-Pad1)") + (net 4 "Board_1-unconnected-(C1-Pad2)") + (net 5 "Board_2-unconnected-(C1-Pad1)") + (net 6 "Board_2-unconnected-(C1-Pad2)") + (net 7 "Board_3-unconnected-(C1-Pad1)") + (net 8 "Board_3-unconnected-(C1-Pad2)") + (footprint "Capacitor_SMD:CP_Elec_6.3x7.7" + (layer "F.Cu") + (uuid "4dc349cb-7e1c-4b1c-a04e-6ec073422b59") + (at 154.25 23.6 180) + (descr "SMD capacitor, aluminum electrolytic, Nichicon, 6.3x7.7mm") + (tags "capacitor electrolytic") + (property "Reference" "C1" + (at 0 -4.35 180) + (unlocked yes) + (layer "F.SilkS") + (uuid "dd58870d-f6e0-4eb8-868d-0dad91ab574e") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "100u" + (at 0 4.35 180) + (unlocked yes) + (layer "F.Fab") + (uuid "922fb6e2-772c-4eb7-b163-7e7ac39d2ca5") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "Capacitor_SMD:CP_Elec_6.3x7.7" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "ebc648cf-3e9e-48bb-b7c3-644a159a9e1e") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "7f6da36a-4df0-4d9d-a41b-d1afc1bdf5e8") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "Polarized capacitor" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "1653cd4e-b93d-4166-9ef2-f561e5cfd410") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "LCSC" "C0123456" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "d24edfff-9f78-4b81-934f-65fb3750ebc5") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (path "/113de184-d79e-4b62-bbb4-b62db61e7fcd") + (attr smd) + (fp_line + (start 3.41 3.41) + (end 3.41 1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "ac7cfec8-2f78-4c62-a389-724fa1fc061c") + ) + (fp_line + (start 3.41 -3.41) + (end 3.41 -1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "86848ed0-fbb9-410d-bd5b-aac946a0e124") + ) + (fp_line + (start -2.345563 3.41) + (end 3.41 3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "37e76494-6d92-4dee-9183-c9d9dd09b344") + ) + (fp_line + (start -2.345563 -3.41) + (end 3.41 -3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "ebf0135a-d02f-4d79-baa3-1d0b238ee0d1") + ) + (fp_line + (start -3.41 2.345563) + (end -2.345563 3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "39e81cf3-adf5-4330-b4df-143e3ecbf4c9") + ) + (fp_line + (start -3.41 2.345563) + (end -3.41 1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "e97bfd5e-5ae7-495b-bbb9-0fed8e5e32db") + ) + (fp_line + (start -3.41 -2.345563) + (end -2.345563 -3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "fb942d3b-e022-4320-a6a5-ed599b7295e5") + ) + (fp_line + (start -3.41 -2.345563) + (end -3.41 -1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "15538a6c-1493-44c8-977a-a852bb6f89d8") + ) + (fp_line + (start -4.04375 -2.24125) + (end -4.04375 -1.45375) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "c401347f-84d7-40eb-9eab-4a9f200ffb7e") + ) + (fp_line + (start -4.4375 -1.8475) + (end -3.65 -1.8475) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "ae9a6a5e-0ec1-4f08-ac51-00ad2212bb28") + ) + (fp_line + (start 4.7 1.05) + (end 3.55 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "2e0ae644-75bb-4829-8327-1a9de8b75a0f") + ) + (fp_line + (start 4.7 -1.05) + (end 4.7 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "bd053fcb-0945-428b-b8fe-1017a31ba61a") + ) + (fp_line + (start 3.55 1.05) + (end 3.55 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "ff41f0e0-5c25-437d-83bc-9fccf48e7249") + ) + (fp_line + (start 3.55 -1.05) + (end 4.7 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "4fb0dc0b-eccc-4581-a28d-75ee138cbae0") + ) + (fp_line + (start 3.55 -3.55) + (end 3.55 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "81aa61be-3c58-4bf2-a08a-a66881378969") + ) + (fp_line + (start -2.4 3.55) + (end 3.55 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "cc180add-ac33-48cd-9017-98b1ee8a6c64") + ) + (fp_line + (start -2.4 -3.55) + (end 3.55 -3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "5b21ea15-26bd-4e54-8e4f-a59770999d9e") + ) + (fp_line + (start -3.55 2.4) + (end -2.4 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "4a021f67-7772-4e6e-a178-7056b28580fb") + ) + (fp_line + (start -3.55 1.05) + (end -3.55 2.4) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "0c739bdc-1ff0-4bc4-9959-fb29ac7c637e") + ) + (fp_line + (start -3.55 -1.05) + (end -4.7 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "f0f25952-af5b-47ab-8431-3af9b097d8b1") + ) + (fp_line + (start -3.55 -2.4) + (end -2.4 -3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "f071d57c-a1a2-4967-81f2-cdb8f2f66a7f") + ) + (fp_line + (start -3.55 -2.4) + (end -3.55 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "d107e302-c20a-4410-8f83-6422f338c8ad") + ) + (fp_line + (start -4.7 1.05) + (end -3.55 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "4d4cdd82-abde-410a-b3f3-80dedf3411cc") + ) + (fp_line + (start -4.7 -1.05) + (end -4.7 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "11013fc5-bea6-46f8-850c-97553f2be340") + ) + (fp_line + (start 3.3 -3.3) + (end 3.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "0b4782c0-4ed6-45b5-9d8e-f65dcbed455e") + ) + (fp_line + (start -2.3 3.3) + (end 3.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "e5cf008f-7aac-4b33-a666-9b25aa31fdee") + ) + (fp_line + (start -2.3 -3.3) + (end 3.3 -3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "32961fce-d435-4163-ba0e-04e4c70d7ed4") + ) + (fp_line + (start -2.389838 -1.645) + (end -2.389838 -1.015) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "86afcaa8-db00-4a89-9337-c7f072226460") + ) + (fp_line + (start -2.704838 -1.33) + (end -2.074838 -1.33) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "fc4bc0dd-05b7-440a-847a-2c001d534639") + ) + (fp_line + (start -3.3 2.3) + (end -2.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "5e520249-7536-400b-8714-51b5a8a20653") + ) + (fp_line + (start -3.3 -2.3) + (end -2.3 -3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "a6b48151-dd3b-4067-a318-bfa44b31b65e") + ) + (fp_line + (start -3.3 -2.3) + (end -3.3 2.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "382e4839-a18e-418f-85b1-dbb6647985df") + ) + (fp_circle + (center 0 0) + (end 3.15 0) + (stroke + (width 0.1) + (type solid) + ) + (fill none) + (layer "F.Fab") + (uuid "ff25f267-c8d1-4186-8f62-a3d90303d7f3") + ) + (fp_text user "${REFERENCE}" + (at 0 0 0) + (layer "F.Fab") + (uuid "dbf16542-99f9-497b-98fe-3191aeb2db74") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (pad "1" smd roundrect + (at -2.7 0 180) + (size 3.5 1.6) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.15625) + (net 3 "Board_1-unconnected-(C1-Pad1)") + (pintype "passive") + (uuid "23584a6b-5451-4b24-80e9-72b4b92fc3bd") + ) + (pad "2" smd roundrect + (at 2.7 0 180) + (size 3.5 1.6) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.15625) + (net 4 "Board_1-unconnected-(C1-Pad2)") + (pintype "passive") + (uuid "29208ccc-6565-4c49-a01a-d32d9052b09c") + ) + (model "${KICAD8_3DMODEL_DIR}/Capacitor_SMD.3dshapes/CP_Elec_6.3x7.7.wrl" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (footprint "Capacitor_SMD:CP_Elec_6.3x7.7" + (layer "F.Cu") + (uuid "79538d2e-2e08-41ca-bd1b-ee9cc6f446e3") + (at 154.5 33.7) + (descr "SMD capacitor, aluminum electrolytic, Nichicon, 6.3x7.7mm") + (tags "capacitor electrolytic") + (property "Reference" "C1" + (at 0 -4.35 0) + (unlocked yes) + (layer "F.SilkS") + (uuid "8a333d58-48e9-4868-8091-7a33bdad63fd") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "100u" + (at 0 4.35 0) + (unlocked yes) + (layer "F.Fab") + (uuid "1f1d2eb5-2dae-4661-833e-4e5ba35e0910") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "Capacitor_SMD:CP_Elec_6.3x7.7" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "9e5ceca1-1381-44f4-bba9-3929aaf54c85") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "5c5ea4b9-4b1f-4f08-bf17-bc59f245f397") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "Polarized capacitor" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "4685ca68-f718-4b13-a3ba-872b2660f5b4") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "LCSC" "C0123456" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "60d962d8-e853-452b-b896-f53132040117") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (path "/113de184-d79e-4b62-bbb4-b62db61e7fcd") + (attr smd) + (fp_line + (start -4.4375 -1.8475) + (end -3.65 -1.8475) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "a3c5b69e-9670-42e1-9bd1-b98e34dbace2") + ) + (fp_line + (start -4.04375 -2.24125) + (end -4.04375 -1.45375) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "cae7dc8b-42c8-4bd7-9aa9-d90bce2845ff") + ) + (fp_line + (start -3.41 -2.345563) + (end -3.41 -1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "3ce1fc9b-3f17-4c85-b5a9-1df106f46d13") + ) + (fp_line + (start -3.41 -2.345563) + (end -2.345563 -3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "80c8b953-bc15-488f-ab25-1b9858b72c06") + ) + (fp_line + (start -3.41 2.345563) + (end -3.41 1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "dacc803b-903c-4a9f-91d8-d440c1564c33") + ) + (fp_line + (start -3.41 2.345563) + (end -2.345563 3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "c9cbf702-b0ac-48b2-b695-aff8ccd3d97b") + ) + (fp_line + (start -2.345563 -3.41) + (end 3.41 -3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "1eda8fb2-53e2-4b5c-bc66-46a2dbd2a673") + ) + (fp_line + (start -2.345563 3.41) + (end 3.41 3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "fe6c2cab-0bbc-4e66-bf9a-02df8a890146") + ) + (fp_line + (start 3.41 -3.41) + (end 3.41 -1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "ecc645b9-2f89-4330-8ae7-134864ac8a03") + ) + (fp_line + (start 3.41 3.41) + (end 3.41 1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "239368c1-cfac-4366-9bf0-bcbad0c9a352") + ) + (fp_line + (start -4.7 -1.05) + (end -4.7 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "2f198214-33ba-4730-93a8-5c0b90f3a181") + ) + (fp_line + (start -4.7 1.05) + (end -3.55 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "edd51917-a823-40b3-8749-9af6a8b0cdd4") + ) + (fp_line + (start -3.55 -2.4) + (end -3.55 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "096077a5-933d-44c5-9991-5a0830892d02") + ) + (fp_line + (start -3.55 -2.4) + (end -2.4 -3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "33f5c3e8-5e54-4051-a6a0-4c1b041bd5e9") + ) + (fp_line + (start -3.55 -1.05) + (end -4.7 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "35d4b8a3-79df-467b-8b8d-e50d310b08b8") + ) + (fp_line + (start -3.55 1.05) + (end -3.55 2.4) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "79c93ec0-a7d1-4a80-a19f-9091e193e7c1") + ) + (fp_line + (start -3.55 2.4) + (end -2.4 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "cb3f6d47-0edb-4f1a-a268-f5f69d7aec66") + ) + (fp_line + (start -2.4 -3.55) + (end 3.55 -3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "4efa48d7-cbf9-47e0-84d3-ee5a917f3915") + ) + (fp_line + (start -2.4 3.55) + (end 3.55 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "661e35a0-5399-4553-b1db-02789c046f14") + ) + (fp_line + (start 3.55 -3.55) + (end 3.55 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "ad685923-09f1-4f37-a7b6-bb218a2db348") + ) + (fp_line + (start 3.55 -1.05) + (end 4.7 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "5f45b71b-5a6c-4088-a101-772e178408a6") + ) + (fp_line + (start 3.55 1.05) + (end 3.55 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "1f78e76c-6b14-40ff-8216-e589e6787e2b") + ) + (fp_line + (start 4.7 -1.05) + (end 4.7 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "7d886a71-4438-4de8-9db3-c6cd5c14283e") + ) + (fp_line + (start 4.7 1.05) + (end 3.55 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "c1173c89-345c-4d0a-af9a-be3b77e022f6") + ) + (fp_line + (start -3.3 -2.3) + (end -3.3 2.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "1d98a135-c567-4c49-a221-7145944d7529") + ) + (fp_line + (start -3.3 -2.3) + (end -2.3 -3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "10454ae5-273d-456e-8110-f60374ab10d4") + ) + (fp_line + (start -3.3 2.3) + (end -2.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "b124f58e-a5a5-4161-a8c6-c7952060233b") + ) + (fp_line + (start -2.704838 -1.33) + (end -2.074838 -1.33) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "e239018d-1ebe-4209-9634-8698cc87de8f") + ) + (fp_line + (start -2.389838 -1.645) + (end -2.389838 -1.015) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "f7c3b5e0-a62a-41a8-a4cc-9ddac1efd5af") + ) + (fp_line + (start -2.3 -3.3) + (end 3.3 -3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "4c383b88-da31-487f-a8bb-3dd6aff9af08") + ) + (fp_line + (start -2.3 3.3) + (end 3.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "87d06654-e9ee-42e3-8fa9-9bfc5909edc8") + ) + (fp_line + (start 3.3 -3.3) + (end 3.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "abc70c04-7bec-4e1a-9976-d7c61cce9ca7") + ) + (fp_circle + (center 0 0) + (end 3.15 0) + (stroke + (width 0.1) + (type solid) + ) + (fill none) + (layer "F.Fab") + (uuid "834e20a7-0b89-4ad5-ae73-f58e19877216") + ) + (fp_text user "${REFERENCE}" + (at 0 0 0) + (layer "F.Fab") + (uuid "758409fd-ba25-4579-81f5-0c0c66df7d37") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (pad "1" smd roundrect + (at -2.7 0) + (size 3.5 1.6) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.15625) + (net 7 "Board_3-unconnected-(C1-Pad1)") + (pintype "passive") + (uuid "1ce2c86c-c73a-4f8a-8e26-5eabe9293f83") + ) + (pad "2" smd roundrect + (at 2.7 0) + (size 3.5 1.6) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.15625) + (net 8 "Board_3-unconnected-(C1-Pad2)") + (pintype "passive") + (uuid "7e7b1c3a-2cb3-4af0-85f4-41b10025edeb") + ) + (model "${KICAD8_3DMODEL_DIR}/Capacitor_SMD.3dshapes/CP_Elec_6.3x7.7.wrl" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (footprint "Capacitor_SMD:CP_Elec_6.3x7.7" + (layer "F.Cu") + (uuid "bc4790f6-48f3-45b9-ae81-5438b79a56d7") + (at 142.75 33.7) + (descr "SMD capacitor, aluminum electrolytic, Nichicon, 6.3x7.7mm") + (tags "capacitor electrolytic") + (property "Reference" "C1" + (at 0 -4.35 0) + (unlocked yes) + (layer "F.SilkS") + (uuid "b6fffa07-3a48-4745-874d-bbde03832038") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "100u" + (at 0 4.35 0) + (unlocked yes) + (layer "F.Fab") + (uuid "aee49402-5fce-419d-b344-2fb7171c05f0") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "Capacitor_SMD:CP_Elec_6.3x7.7" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "617672b7-8b12-4acf-a452-ee0782409fe9") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "dc99111b-b0b8-4b0d-bdb9-d823b797fdf2") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "Polarized capacitor" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "4bedf4a1-0703-41bb-b16b-1500487b2861") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "LCSC" "C0123456" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "e62a28be-8242-4818-a2c4-f96ea209d630") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (path "/113de184-d79e-4b62-bbb4-b62db61e7fcd") + (attr smd) + (fp_line + (start -4.4375 -1.8475) + (end -3.65 -1.8475) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "0832b94c-2555-4852-a858-9f6268f3f9b5") + ) + (fp_line + (start -4.04375 -2.24125) + (end -4.04375 -1.45375) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "4c94f1d8-37d0-49ce-8796-7e239b18c621") + ) + (fp_line + (start -3.41 -2.345563) + (end -3.41 -1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "e4667072-d3a4-4c50-be59-3f60b52fa322") + ) + (fp_line + (start -3.41 -2.345563) + (end -2.345563 -3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "460ced53-e955-4e74-a876-cbc52e4d268c") + ) + (fp_line + (start -3.41 2.345563) + (end -3.41 1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "703a7718-6fd9-4bcb-a623-c2ef45306fad") + ) + (fp_line + (start -3.41 2.345563) + (end -2.345563 3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "e5b91243-e221-4a87-818c-389835b10cf4") + ) + (fp_line + (start -2.345563 -3.41) + (end 3.41 -3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "5777f8e8-25ad-4fd3-9086-9b78d9777486") + ) + (fp_line + (start -2.345563 3.41) + (end 3.41 3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "f6ddc797-b0ab-402f-99fb-93ddb3755f4c") + ) + (fp_line + (start 3.41 -3.41) + (end 3.41 -1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "d2b4634b-4e2b-4e2e-a06b-c0843daa5b19") + ) + (fp_line + (start 3.41 3.41) + (end 3.41 1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "531b815b-084c-4290-8298-286876b4efee") + ) + (fp_line + (start -4.7 -1.05) + (end -4.7 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "c7a6a9bf-962c-4fbd-90d0-d0344dfeb1de") + ) + (fp_line + (start -4.7 1.05) + (end -3.55 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "a4978eec-6311-4be6-965d-2d595f2f8bac") + ) + (fp_line + (start -3.55 -2.4) + (end -3.55 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "bb84f1fa-6b3e-449a-83f8-7b866dfa4ba8") + ) + (fp_line + (start -3.55 -2.4) + (end -2.4 -3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "2044a1c5-3048-4b7c-a3fe-2d658d69c73b") + ) + (fp_line + (start -3.55 -1.05) + (end -4.7 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "cb444197-7ed3-438f-abbc-e9a01471bd26") + ) + (fp_line + (start -3.55 1.05) + (end -3.55 2.4) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "827ad407-41ea-4c76-91db-d12aaee7aeb9") + ) + (fp_line + (start -3.55 2.4) + (end -2.4 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "8302df25-e860-4dfc-bf26-b1a97eb0197c") + ) + (fp_line + (start -2.4 -3.55) + (end 3.55 -3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "4cd063d3-151c-40cf-a534-c69a98ab3c23") + ) + (fp_line + (start -2.4 3.55) + (end 3.55 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "7a40707d-a8bb-4e95-b0dd-4f4c25c27208") + ) + (fp_line + (start 3.55 -3.55) + (end 3.55 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "4d967009-46ce-447b-98a9-1500c3ce6303") + ) + (fp_line + (start 3.55 -1.05) + (end 4.7 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "d014e6c3-12e6-4e33-bba7-ea5770287287") + ) + (fp_line + (start 3.55 1.05) + (end 3.55 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "73519d4d-96ad-4c15-b1ce-a5028835d327") + ) + (fp_line + (start 4.7 -1.05) + (end 4.7 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "df02b079-475b-42d5-a037-f837a5f881b0") + ) + (fp_line + (start 4.7 1.05) + (end 3.55 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "b2d73681-6c54-49c0-9d5f-1c6f5fc6d856") + ) + (fp_line + (start -3.3 -2.3) + (end -3.3 2.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "e15783b1-e492-421f-8556-dabd614426af") + ) + (fp_line + (start -3.3 -2.3) + (end -2.3 -3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "ab265b85-641b-4963-bcfc-172b899b6077") + ) + (fp_line + (start -3.3 2.3) + (end -2.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "8bb84ad9-c8d2-4eba-a4d4-933311fc7cce") + ) + (fp_line + (start -2.704838 -1.33) + (end -2.074838 -1.33) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "a8060bf5-fc7c-487b-bc39-e263c99b8f68") + ) + (fp_line + (start -2.389838 -1.645) + (end -2.389838 -1.015) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "d040e093-b83a-4c6f-ac6a-0ed9915c1580") + ) + (fp_line + (start -2.3 -3.3) + (end 3.3 -3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "dbf6c35c-0b98-45f8-a397-1d98a3d63bbb") + ) + (fp_line + (start -2.3 3.3) + (end 3.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "7b4392b4-8eb3-4bcc-b4e1-3002fb0cd396") + ) + (fp_line + (start 3.3 -3.3) + (end 3.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "fdd6b927-502f-4677-b793-84ffaf2b6254") + ) + (fp_circle + (center 0 0) + (end 3.15 0) + (stroke + (width 0.1) + (type solid) + ) + (fill none) + (layer "F.Fab") + (uuid "ad9272ce-88ab-4fc8-9046-cdf2aacd756b") + ) + (fp_text user "${REFERENCE}" + (at 0 0 0) + (layer "F.Fab") + (uuid "d60ab483-b2e9-472a-91bd-bf6ea4751cdf") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (pad "1" smd roundrect + (at -2.7 0) + (size 3.5 1.6) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.15625) + (net 5 "Board_2-unconnected-(C1-Pad1)") + (pintype "passive") + (uuid "93baff28-f345-4beb-89a4-2a3036a6270f") + ) + (pad "2" smd roundrect + (at 2.7 0) + (size 3.5 1.6) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.15625) + (net 6 "Board_2-unconnected-(C1-Pad2)") + (pintype "passive") + (uuid "92da6b50-7357-4c97-ba09-78930578ae75") + ) + (model "${KICAD8_3DMODEL_DIR}/Capacitor_SMD.3dshapes/CP_Elec_6.3x7.7.wrl" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (footprint "Capacitor_SMD:CP_Elec_6.3x7.7" + (layer "F.Cu") + (uuid "c4f62bac-e007-4ef9-bf2d-3fb93995088d") + (at 142.5 23.6 180) + (descr "SMD capacitor, aluminum electrolytic, Nichicon, 6.3x7.7mm") + (tags "capacitor electrolytic") + (property "Reference" "C1" + (at 0 -4.35 180) + (unlocked yes) + (layer "F.SilkS") + (uuid "88dda69c-0157-415b-a82f-f27b66528166") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "100u" + (at 0 4.35 180) + (unlocked yes) + (layer "F.Fab") + (uuid "6bc56e20-5a51-4c00-bd11-8d02db500576") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "Capacitor_SMD:CP_Elec_6.3x7.7" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "497a3382-0f0a-49ae-9856-9c165b7b478f") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "cded40e3-dc6a-4373-a1a5-21d42273c99c") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "Polarized capacitor" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "dab037ff-6d4e-4d31-b811-4a25292218e9") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "LCSC" "C0123456" + (at 0 0 180) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "3186f8e4-f2bc-4a89-a23f-74e337bdd546") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (path "/113de184-d79e-4b62-bbb4-b62db61e7fcd") + (attr smd) + (fp_line + (start 3.41 3.41) + (end 3.41 1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "5578cfa5-08d1-408d-a843-83a8bfae5989") + ) + (fp_line + (start 3.41 -3.41) + (end 3.41 -1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "3659c2c2-031d-4ea8-b15f-88e809b198e9") + ) + (fp_line + (start -2.345563 3.41) + (end 3.41 3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "7f7ef062-e78a-45bf-ae4e-4dcb7ba862e3") + ) + (fp_line + (start -2.345563 -3.41) + (end 3.41 -3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "30ca2183-cb5f-40a8-8922-2ac2428af6ec") + ) + (fp_line + (start -3.41 2.345563) + (end -2.345563 3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "8e1fb1c8-e394-4c45-9971-6345ce253027") + ) + (fp_line + (start -3.41 2.345563) + (end -3.41 1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "35677eba-77be-4f95-ba52-65157a26d3f9") + ) + (fp_line + (start -3.41 -2.345563) + (end -2.345563 -3.41) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "ca44ea4f-7204-4a22-8255-a8ada44219e8") + ) + (fp_line + (start -3.41 -2.345563) + (end -3.41 -1.06) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "6d1026a1-2d9b-4993-9686-0887b435e43a") + ) + (fp_line + (start -4.04375 -2.24125) + (end -4.04375 -1.45375) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "31b31649-48c3-4e3b-a948-0b371d6a8f09") + ) + (fp_line + (start -4.4375 -1.8475) + (end -3.65 -1.8475) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "d2ae5073-3169-42cb-8c84-1a26fe96a580") + ) + (fp_line + (start 4.7 1.05) + (end 3.55 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "49ef7c9a-9753-4d10-9de4-23820c624314") + ) + (fp_line + (start 4.7 -1.05) + (end 4.7 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "ebc412d4-bbb3-4db1-a047-4d7d19dc98c8") + ) + (fp_line + (start 3.55 1.05) + (end 3.55 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "c4082695-3a3b-4c26-aefa-e65376d2ee4d") + ) + (fp_line + (start 3.55 -1.05) + (end 4.7 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "4bebc71e-b917-4d08-9b05-416143040208") + ) + (fp_line + (start 3.55 -3.55) + (end 3.55 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "3af23843-2d5b-4537-b0b3-cbb7590840df") + ) + (fp_line + (start -2.4 3.55) + (end 3.55 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "e104c60c-e594-49a7-bc70-739060d56e6f") + ) + (fp_line + (start -2.4 -3.55) + (end 3.55 -3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "513d9a94-bde6-48a8-a8f3-a327d9c04eab") + ) + (fp_line + (start -3.55 2.4) + (end -2.4 3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "12916413-edb4-4689-8dab-d3d2a4c22466") + ) + (fp_line + (start -3.55 1.05) + (end -3.55 2.4) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "9c9cb778-a65e-4fe7-86e7-2de31af80db4") + ) + (fp_line + (start -3.55 -1.05) + (end -4.7 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "95549c73-ea6f-43f7-b961-3185495e4891") + ) + (fp_line + (start -3.55 -2.4) + (end -2.4 -3.55) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "0a3d2fdc-06b4-4849-97c0-f5171716db08") + ) + (fp_line + (start -3.55 -2.4) + (end -3.55 -1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "c50a60ba-c0d5-4b71-83d4-79d86e984166") + ) + (fp_line + (start -4.7 1.05) + (end -3.55 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "6da5d8c8-ef5a-471a-b0a0-dbd2df125378") + ) + (fp_line + (start -4.7 -1.05) + (end -4.7 1.05) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "6470beef-2582-43e9-af1f-417626abf298") + ) + (fp_line + (start 3.3 -3.3) + (end 3.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "2876fea5-9cb6-4ad0-b32d-f5ac2a86bda2") + ) + (fp_line + (start -2.3 3.3) + (end 3.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "22a96061-1a71-4d2d-98c4-d0fbb2062237") + ) + (fp_line + (start -2.3 -3.3) + (end 3.3 -3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "4d93520b-286c-4b90-81ed-f2616a873281") + ) + (fp_line + (start -2.389838 -1.645) + (end -2.389838 -1.015) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "08c85c0c-bc8a-46a5-a3e1-3a6de05add68") + ) + (fp_line + (start -2.704838 -1.33) + (end -2.074838 -1.33) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "ab440c35-1276-485c-8b0b-4d4df5d43a0e") + ) + (fp_line + (start -3.3 2.3) + (end -2.3 3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "e5d42aae-39dc-4c52-906f-7db88e1819bd") + ) + (fp_line + (start -3.3 -2.3) + (end -2.3 -3.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "17735156-9131-4449-b386-8d2354d85ce6") + ) + (fp_line + (start -3.3 -2.3) + (end -3.3 2.3) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "251dc438-7969-42d2-95cc-3a598c9202aa") + ) + (fp_circle + (center 0 0) + (end 3.15 0) + (stroke + (width 0.1) + (type solid) + ) + (fill none) + (layer "F.Fab") + (uuid "da98ad57-5d4d-4912-a844-a863c2d0a641") + ) + (fp_text user "${REFERENCE}" + (at 0 0 0) + (layer "F.Fab") + (uuid "2cd3fbc1-55ac-4cc4-94d5-ebfb3cff9925") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (pad "1" smd roundrect + (at -2.7 0 180) + (size 3.5 1.6) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.15625) + (net 1 "Board_0-unconnected-(C1-Pad1)") + (pintype "passive") + (uuid "b28ddcfe-a895-47e1-aa80-0678bbbba429") + ) + (pad "2" smd roundrect + (at 2.7 0 180) + (size 3.5 1.6) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.15625) + (net 2 "Board_0-unconnected-(C1-Pad2)") + (pintype "passive") + (uuid "49b03514-8f6c-452a-8399-f8a1228e4143") + ) + (model "${KICAD8_3DMODEL_DIR}/Capacitor_SMD.3dshapes/CP_Elec_6.3x7.7.wrl" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (gr_line + (start 159.249729 27.648754) + (end 159.249999 27.637752) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "02c8be46-98a9-4aba-9c88-294e2be3ab92") + ) + (gr_line + (start 137.75 20.012272) + (end 137.75 27.637727) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "0406dddc-cc5e-4b5a-a3d1-a2da4298c18f") + ) + (gr_line + (start 147.5 27.637727) + (end 147.5 20.012272) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "05b4457d-fcef-4d05-aee3-6f0a9be86390") + ) + (gr_line + (start 149.50027 29.651245) + (end 149.5 29.662247) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "07fdccf1-1829-4ae5-8005-17fd188522ca") + ) + (gr_line + (start 147.499999 20.012247) + (end 147.499729 20.001245) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "0b9d4378-1310-42ba-9504-35d66d55114c") + ) + (gr_line + (start 147.487727 29.65) + (end 137.762272 29.65) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "0bccb8a0-6291-416a-9fa1-3824400a0c32") + ) + (gr_line + (start 149.5 37.287752) + (end 149.50027 37.298754) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "14cf5765-f61c-4118-8bfc-df10c45d0838") + ) + (gr_line + (start 159.25 27.637727) + (end 159.25 20.012272) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "170c0618-6db1-4a20-becd-80f1cd0790ff") + ) + (gr_line + (start 149.512272 37.3) + (end 159.237727 37.3) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "2b876092-a970-4cfd-b7de-1f179c9c6765") + ) + (gr_line + (start 149.5 29.662272) + (end 149.5 37.287727) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "30d380d6-1232-4974-91f2-1ee46dba85fb") + ) + (gr_line + (start 159.237752 37.299999) + (end 159.248754 37.299729) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "362aeada-6f6f-4e9e-a9a6-efbd6eed648e") + ) + (gr_line + (start 137.762247 20) + (end 137.751245 20.00027) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "3bc23cbb-039c-4f5b-80d1-d51dd82b849c") + ) + (gr_line + (start 149.5 27.637752) + (end 149.50027 27.648754) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "4d122b3b-3fbd-42a0-97f2-bd29f7a1ccf6") + ) + (gr_line + (start 159.237727 20) + (end 149.512272 20) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "4fda8f83-6159-44d0-ae18-119df9d92352") + ) + (gr_line + (start 159.237727 29.65) + (end 149.512272 29.65) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "5bef48b2-dac2-4090-b3ef-85268a7bd2d6") + ) + (gr_line + (start 137.75027 29.651245) + (end 137.75 29.662247) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "60132cbe-6459-4dce-b567-72f4308ed51a") + ) + (gr_line + (start 147.499999 29.662247) + (end 147.499729 29.651245) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "6568d51a-3b32-4b8a-b1b5-38806e36c1af") + ) + (gr_line + (start 137.75 27.637752) + (end 137.75027 27.648754) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "6943bd1b-1951-485e-b3c4-ded602ab352e") + ) + (gr_line + (start 137.75 37.287752) + (end 137.75027 37.298754) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "89398423-dc51-4f46-9d60-dad7964fdfaf") + ) + (gr_line + (start 147.498754 20.00027) + (end 147.487752 20) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "8a08873a-53c4-4369-b3c0-51209ea11875") + ) + (gr_line + (start 137.762247 29.65) + (end 137.751245 29.65027) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "902cc169-1004-4caa-81b2-ff15c02bfdcc") + ) + (gr_line + (start 147.499729 37.298754) + (end 147.499999 37.287752) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "952e4446-2509-4f62-9fa8-5eb5bb82ced3") + ) + (gr_line + (start 137.75027 20.001245) + (end 137.75 20.012247) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "9af053ac-1b46-435a-956c-a18e308c40cd") + ) + (gr_line + (start 137.762272 27.65) + (end 147.487727 27.65) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "9c043eca-fd89-4920-9d71-3a4372ab17a3") + ) + (gr_line + (start 147.487727 20) + (end 137.762272 20) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "9eb1c169-67bf-436b-8d0a-a5638c54b476") + ) + (gr_line + (start 149.512272 27.65) + (end 159.237727 27.65) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "a6057a66-cfe6-4dfa-a6dd-6866f9b09a6f") + ) + (gr_line + (start 149.501245 37.299729) + (end 149.512247 37.299999) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "a6a6d2f6-a028-4b75-8868-42facc209169") + ) + (gr_line + (start 149.501245 27.649729) + (end 149.512247 27.649999) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "ab8a2749-1d03-4aa0-ba02-f545e9452c78") + ) + (gr_line + (start 147.498754 29.65027) + (end 147.487752 29.65) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "b1c6faec-9472-4ca0-a8bd-d738bf65aeb5") + ) + (gr_line + (start 147.487752 37.299999) + (end 147.498754 37.299729) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "b63f1348-8aba-4306-809e-7c5183e28736") + ) + (gr_line + (start 149.512247 20) + (end 149.501245 20.00027) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "b8cb1654-55a4-4fdd-9707-37fde398573e") + ) + (gr_line + (start 159.237752 27.649999) + (end 159.248754 27.649729) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "ba9e2bcc-92f4-4582-968c-23f899ee7a12") + ) + (gr_line + (start 149.512247 29.65) + (end 149.501245 29.65027) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "bb986e0b-e5ef-4c40-9745-a03d72621861") + ) + (gr_line + (start 147.487752 27.649999) + (end 147.498754 27.649729) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "bc274249-a226-4071-96ad-6badeee30328") + ) + (gr_line + (start 159.25 37.287727) + (end 159.25 29.662272) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "bd62b326-fe82-48fa-ac80-5f40ca06d12d") + ) + (gr_line + (start 159.249999 29.662247) + (end 159.249729 29.651245) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "c516a046-a6e2-4538-8f25-f8d03dfa2c7a") + ) + (gr_line + (start 159.249729 37.298754) + (end 159.249999 37.287752) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "c5e1f865-1c59-4d8e-a35e-e70fd1452b97") + ) + (gr_line + (start 147.499729 27.648754) + (end 147.499999 27.637752) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "cd1b323d-4ec3-47f4-a878-1cc8d9a33a60") + ) + (gr_line + (start 149.5 20.012272) + (end 149.5 27.637727) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "cd226c00-520b-4ef2-81c9-153408a6318e") + ) + (gr_line + (start 137.762272 37.3) + (end 147.487727 37.3) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "d6520d99-3c3b-4e01-8dcc-8f0734d9f77c") + ) + (gr_line + (start 137.751245 27.649729) + (end 137.762247 27.649999) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "d9512f42-54e9-4d83-b857-389129668225") + ) + (gr_line + (start 147.5 37.287727) + (end 147.5 29.662272) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "dd75067e-5a49-458e-bc45-419e92b3c305") + ) + (gr_line + (start 159.248754 29.65027) + (end 159.237752 29.65) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "ddfe089e-541a-469a-830d-0b93c36b33b2") + ) + (gr_line + (start 137.751245 37.299729) + (end 137.762247 37.299999) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "e364b052-b5f8-4a63-b86a-756271c90c6d") + ) + (gr_line + (start 149.50027 20.001245) + (end 149.5 20.012247) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "e54a79ec-aed3-416e-8845-dddb51fe8ba5") + ) + (gr_line + (start 159.249999 20.012247) + (end 159.249729 20.001245) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "eef26653-66e0-478d-8ef0-af1facf1fee4") + ) + (gr_line + (start 159.248754 20.00027) + (end 159.237752 20) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "f553572d-c270-4f51-a0af-6328b4153643") + ) + (gr_line + (start 137.75 29.662272) + (end 137.75 37.287727) + (stroke + (width 0.1) + (type default) + ) + (layer "Edge.Cuts") + (uuid "fcf4b788-1bd6-4787-a722-c4f80e028327") + ) +) diff --git a/tests/board_samples/kicad_8/panel_C1x4.kicad_sch b/tests/board_samples/kicad_8/panel_C1x4.kicad_sch new file mode 100644 index 000000000..2a0f84f44 --- /dev/null +++ b/tests/board_samples/kicad_8/panel_C1x4.kicad_sch @@ -0,0 +1,251 @@ +(kicad_sch + (version 20231120) + (generator "eeschema") + (generator_version "8.0") + (uuid "b401e7dc-f155-4a98-b294-403da1930d88") + (paper "A4") + (lib_symbols + (symbol "Device:C_Polarized" + (pin_numbers hide) + (pin_names + (offset 0.254) + ) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "C" + (at 0.635 2.54 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "C_Polarized" + (at 0.635 -2.54 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "" + (at 0.9652 -3.81 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Polarized capacitor" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "cap capacitor" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "CP_*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "C_Polarized_0_1" + (rectangle + (start -2.286 0.508) + (end 2.286 1.016) + (stroke + (width 0) + (type default) + ) + (fill + (type none) + ) + ) + (polyline + (pts + (xy -1.778 2.286) (xy -0.762 2.286) + ) + (stroke + (width 0) + (type default) + ) + (fill + (type none) + ) + ) + (polyline + (pts + (xy -1.27 2.794) (xy -1.27 1.778) + ) + (stroke + (width 0) + (type default) + ) + (fill + (type none) + ) + ) + (rectangle + (start 2.286 -0.508) + (end -2.286 -1.016) + (stroke + (width 0) + (type default) + ) + (fill + (type outline) + ) + ) + ) + (symbol "C_Polarized_1_1" + (pin passive line + (at 0 3.81 270) + (length 2.794) + (name "~" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + (pin passive line + (at 0 -3.81 90) + (length 2.794) + (name "~" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "2" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + ) + (symbol + (lib_id "Device:C_Polarized") + (at 130.175 68.58 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "113de184-d79e-4b62-bbb4-b62db61e7fcd") + (property "Reference" "C1" + (at 133.35 66.4209 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "100u" + (at 133.35 68.9609 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "Capacitor_SMD:CP_Elec_6.3x7.7" + (at 131.1402 72.39 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 130.175 68.58 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Polarized capacitor" + (at 130.175 68.58 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "LCSC" "C0123456" + (at 130.175 68.58 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "1" + (uuid "a0fb19e1-3e58-4bd0-ab69-361be490123c") + ) + (pin "2" + (uuid "3bdef9cb-7da9-44cb-9975-a39b84219959") + ) + (instances + (project "" + (path "/b401e7dc-f155-4a98-b294-403da1930d88" + (reference "C1") + (unit 1) + ) + ) + ) + ) + (sheet_instances + (path "/" + (page "1") + ) + ) +) diff --git a/tests/board_samples/kicad_8/rotations.kicad_pcb b/tests/board_samples/kicad_8/rotations.kicad_pcb index 9967e3516..08ac19553 100644 --- a/tests/board_samples/kicad_8/rotations.kicad_pcb +++ b/tests/board_samples/kicad_8/rotations.kicad_pcb @@ -132,7 +132,7 @@ ) ) ) - (property "Footprint" "" + (property "Footprint" "Package_TO_SOT_SMD:SOT-23-3" (at 0 0 0) (unlocked yes) (layer "F.Fab") @@ -141,6 +141,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -153,10 +154,11 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) - (property "Description" "NPN transistor, base/collector/emitter" + (property "Description" "" (at 0 0 0) (unlocked yes) (layer "F.Fab") @@ -165,6 +167,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -181,6 +184,7 @@ ) ) (path "/b68f53ba-e083-4318-8fe6-5b0470e92732") + (sheetname "RaĆ­z") (sheetfile "rotations.kicad_sch") (attr smd) (fp_line @@ -394,7 +398,7 @@ ) ) ) - (property "Footprint" "" + (property "Footprint" "Package_TO_SOT_SMD:SOT-23-3" (at 0 0 0) (unlocked yes) (layer "F.Fab") @@ -403,6 +407,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -415,10 +420,11 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) - (property "Description" "NPN transistor, base/collector/emitter" + (property "Description" "" (at 0 0 0) (unlocked yes) (layer "F.Fab") @@ -427,10 +433,12 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) (path "/156101ec-1111-4dbd-9ddd-f335c334c5b7") + (sheetname "RaĆ­z") (sheetfile "rotations.kicad_sch") (attr smd) (fp_line @@ -644,7 +652,7 @@ ) ) ) - (property "Footprint" "" + (property "Footprint" "Package_TO_SOT_SMD:SOT-23-3" (at 0 0 0) (unlocked yes) (layer "F.Fab") @@ -653,6 +661,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -665,10 +674,11 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) - (property "Description" "NPN transistor, base/collector/emitter" + (property "Description" "" (at 0 0 0) (unlocked yes) (layer "F.Fab") @@ -677,10 +687,12 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) (path "/998825bf-b119-4086-8284-b9c9d4168399") + (sheetname "RaĆ­z") (sheetfile "rotations.kicad_sch") (attr smd) (fp_line @@ -894,7 +906,7 @@ ) ) ) - (property "Footprint" "" + (property "Footprint" "Package_TO_SOT_SMD:SOT-23-3" (at 0 0 0) (unlocked yes) (layer "F.Fab") @@ -903,6 +915,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -915,10 +928,11 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) - (property "Description" "NPN transistor, base/collector/emitter" + (property "Description" "" (at 0 0 0) (unlocked yes) (layer "F.Fab") @@ -927,14 +941,16 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) (property "JLCRotOffset" "270" (at 0 0 0) + (unlocked yes) (layer "F.Fab") (hide yes) - (uuid "4b042745-3188-4d00-b6dc-e388d692e8cf") + (uuid "3a9c44a4-294b-41d2-8bcc-05fa0628e739") (effects (font (size 1 1) @@ -943,6 +959,7 @@ ) ) (path "/a6627712-868c-47c9-a4e7-41e82a8eb9ab") + (sheetname "RaĆ­z") (sheetfile "rotations.kicad_sch") (attr smd) (fp_line @@ -1158,7 +1175,7 @@ (justify mirror) ) ) - (property "Footprint" "" + (property "Footprint" "Package_TO_SOT_SMD:SOT-23-3" (at 0 0 180) (unlocked yes) (layer "F.Fab") @@ -1167,6 +1184,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -1179,10 +1197,11 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) - (property "Description" "NPN transistor, base/collector/emitter" + (property "Description" "" (at 0 0 180) (unlocked yes) (layer "F.Fab") @@ -1191,6 +1210,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -1208,6 +1228,7 @@ ) ) (path "/e07970ec-8763-4699-bcef-1f4bcab9f123") + (sheetname "RaĆ­z") (sheetfile "rotations.kicad_sch") (attr smd) (fp_line @@ -1424,7 +1445,7 @@ (justify mirror) ) ) - (property "Footprint" "" + (property "Footprint" "Package_TO_SOT_SMD:SOT-23-3" (at 0 0 180) (unlocked yes) (layer "F.Fab") @@ -1433,6 +1454,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -1445,10 +1467,11 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) - (property "Description" "NPN transistor, base/collector/emitter" + (property "Description" "" (at 0 0 180) (unlocked yes) (layer "F.Fab") @@ -1457,6 +1480,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -1474,6 +1498,7 @@ ) ) (path "/1bdf9d0a-89c2-4af6-85cb-bc7ceea16049") + (sheetname "RaĆ­z") (sheetfile "rotations.kicad_sch") (attr smd) (fp_line @@ -1690,7 +1715,7 @@ (justify mirror) ) ) - (property "Footprint" "" + (property "Footprint" "Package_TO_SOT_SMD:SOT-23-3" (at 0 0 180) (unlocked yes) (layer "F.Fab") @@ -1699,6 +1724,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -1711,10 +1737,11 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) - (property "Description" "NPN transistor, base/collector/emitter" + (property "Description" "" (at 0 0 180) (unlocked yes) (layer "F.Fab") @@ -1723,10 +1750,12 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) (path "/692ee82b-0f4b-42f0-a84a-e4814784d25d") + (sheetname "RaĆ­z") (sheetfile "rotations.kicad_sch") (attr smd) (fp_line @@ -1943,7 +1972,7 @@ (justify mirror) ) ) - (property "Footprint" "" + (property "Footprint" "Package_TO_SOT_SMD:SOT-23" (at 0 0 180) (unlocked yes) (layer "F.Fab") @@ -1952,6 +1981,7 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) @@ -1964,10 +1994,11 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) - (property "Description" "NPN transistor, base/collector/emitter" + (property "Description" "" (at 0 0 180) (unlocked yes) (layer "F.Fab") @@ -1976,10 +2007,12 @@ (effects (font (size 1.27 1.27) + (thickness 0.15) ) ) ) (path "/30137d82-173a-4494-81da-85c3939d39ec") + (sheetname "RaĆ­z") (sheetfile "rotations.kicad_sch") (attr smd) (fp_line @@ -2177,4 +2210,4 @@ (layer "Edge.Cuts") (uuid "e6ed0aaa-d0ca-4a99-8b73-63f9c0e34c38") ) -) \ No newline at end of file +) diff --git a/tests/board_samples/kicad_8/rotations.kicad_sch b/tests/board_samples/kicad_8/rotations.kicad_sch index b43ad0b58..2c975c153 100644 --- a/tests/board_samples/kicad_8/rotations.kicad_sch +++ b/tests/board_samples/kicad_8/rotations.kicad_sch @@ -184,6 +184,16 @@ ) ) ) + (text "Q3 is rotated using a field\nonly found in the PCB" + (exclude_from_sim no) + (at 110.49 40.894 0) + (effects + (font + (size 1.27 1.27) + ) + ) + (uuid "002436c9-cca0-428c-8b3a-624e67a0a337") + ) (symbol (lib_id "Device:Q_NPN_BCE") (at 55.88 50.8 0) @@ -613,15 +623,6 @@ (hide yes) ) ) - (property "JLCRotOffset" "270" - (at 106.68 50.8 0) - (effects - (font - (size 1.27 1.27) - ) - (hide yes) - ) - ) (pin "1" (uuid "f8a8791f-97f0-4ab4-9120-a6e27bf18b29") ) @@ -809,4 +810,4 @@ (page "1") ) ) -) \ No newline at end of file +) diff --git a/tests/board_samples/kicad_8/temp_range.kicad_sch b/tests/board_samples/kicad_8/temp_range.kicad_sch new file mode 100644 index 000000000..c7d689a6a --- /dev/null +++ b/tests/board_samples/kicad_8/temp_range.kicad_sch @@ -0,0 +1,600 @@ +(kicad_sch + (version 20231120) + (generator "eeschema") + (generator_version "8.0") + (uuid "d3d27ee8-ee40-45c8-9c16-4597f14cd32d") + (paper "A4") + (lib_symbols + (symbol "Device:R" + (pin_numbers hide) + (pin_names + (offset 0) + ) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "R" + (at 2.032 0 90) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "R" + (at 0 0 90) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "" + (at -1.778 0 90) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Resistor" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "R res resistor" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "R_*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "R_0_1" + (rectangle + (start -1.016 -2.54) + (end 1.016 2.54) + (stroke + (width 0.254) + (type default) + ) + (fill + (type none) + ) + ) + ) + (symbol "R_1_1" + (pin passive line + (at 0 3.81 270) + (length 1.27) + (name "~" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + (pin passive line + (at 0 -3.81 90) + (length 1.27) + (name "~" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "2" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + ) + (symbol + (lib_id "Device:R") + (at 101.6 105.41 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "0fdb35df-3886-43cc-815c-3d406dedee23") + (property "Reference" "R3" + (at 104.14 104.1399 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "R" + (at 104.14 106.6799 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "" + (at 99.822 105.41 90) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 101.6 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Resistor" + (at 101.6 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Temp" "--10 20" + (at 101.6 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "2" + (uuid "4893aa0f-7397-4175-8b50-554ea3fc26eb") + ) + (pin "1" + (uuid "3d9336c0-d368-4821-88fc-78c52a19258f") + ) + (instances + (project "" + (path "/d3d27ee8-ee40-45c8-9c16-4597f14cd32d" + (reference "R3") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Device:R") + (at 114.3 105.41 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "32fefee7-4bb0-46f2-850a-762d5bfa5522") + (property "Reference" "R4" + (at 116.84 104.1399 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "R" + (at 116.84 106.6799 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "" + (at 112.522 105.41 90) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 114.3 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Resistor" + (at 114.3 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Temp" "-5 ĀŗC ~ 100 ĀŗC" + (at 114.3 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "1" + (uuid "38c68d54-4e6c-48ec-80d8-5df8faea6b69") + ) + (pin "2" + (uuid "46bf6070-8128-46fb-b01d-40b325cd03e7") + ) + (instances + (project "" + (path "/d3d27ee8-ee40-45c8-9c16-4597f14cd32d" + (reference "R4") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Device:R") + (at 139.7 105.41 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "9a09e89f-aa4d-4275-9829-7085cba18bfd") + (property "Reference" "R6" + (at 142.24 104.1399 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "R" + (at 142.24 106.6799 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "" + (at 137.922 105.41 90) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 139.7 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Resistor" + (at 139.7 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Temp" "-25 ĀŗC ~ 100 ĀŗC" + (at 139.7 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "2" + (uuid "31a9ed45-19de-4f97-992a-91798bd1699f") + ) + (pin "1" + (uuid "17365244-0e76-4c98-bc81-c90b4d0d1537") + ) + (instances + (project "" + (path "/d3d27ee8-ee40-45c8-9c16-4597f14cd32d" + (reference "R6") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Device:R") + (at 127 105.41 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "c96edd01-8e2b-44bd-b404-40952baded65") + (property "Reference" "R5" + (at 129.54 104.1399 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "R" + (at 129.54 106.6799 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "" + (at 125.222 105.41 90) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 127 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Resistor" + (at 127 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Temp" "-25 ĀŗC ~ 60 ĀŗC" + (at 127 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "2" + (uuid "98ca4808-3d18-47d0-8a2e-058a1414a0ea") + ) + (pin "1" + (uuid "3c99bc64-aad0-40f6-b2c2-58ba93946e89") + ) + (instances + (project "" + (path "/d3d27ee8-ee40-45c8-9c16-4597f14cd32d" + (reference "R5") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Device:R") + (at 76.2 105.41 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "d07d0153-a421-46ee-9209-8b30de776e08") + (property "Reference" "R1" + (at 78.74 104.1399 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "R" + (at 78.74 106.6799 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "" + (at 74.422 105.41 90) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 76.2 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Resistor" + (at 76.2 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "2" + (uuid "7ace2f13-28b5-4a00-81f8-b8c701371f57") + ) + (pin "1" + (uuid "c55d0838-6daf-4f58-b3a2-3fa2410774a8") + ) + (instances + (project "" + (path "/d3d27ee8-ee40-45c8-9c16-4597f14cd32d" + (reference "R1") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Device:R") + (at 88.9 105.41 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "f627da38-cb6f-47d8-a762-05ccad1a2e26") + (property "Reference" "R2" + (at 91.44 104.1399 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "R" + (at 91.44 106.6799 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "" + (at 87.122 105.41 90) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 88.9 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Resistor" + (at 88.9 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Temp" "no_match" + (at 88.9 105.41 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "2" + (uuid "90d0ad7c-90f4-4410-9424-700e988170ce") + ) + (pin "1" + (uuid "7eaf4974-cea8-4c2b-ab96-f69e3ae27b88") + ) + (instances + (project "" + (path "/d3d27ee8-ee40-45c8-9c16-4597f14cd32d" + (reference "R2") + (unit 1) + ) + ) + ) + ) + (sheet_instances + (path "/" + (page "1") + ) + ) +) diff --git a/tests/board_samples/kicad_8/test_points.kicad_pcb b/tests/board_samples/kicad_8/test_points.kicad_pcb new file mode 100644 index 000000000..709b89185 --- /dev/null +++ b/tests/board_samples/kicad_8/test_points.kicad_pcb @@ -0,0 +1,1535 @@ +(kicad_pcb + (version 20240108) + (generator "pcbnew") + (generator_version "8.0") + (general + (thickness 1.6) + (legacy_teardrops no) + ) + (paper "A4") + (layers + (0 "F.Cu" signal) + (31 "B.Cu" signal) + (32 "B.Adhes" user "B.Adhesive") + (33 "F.Adhes" user "F.Adhesive") + (34 "B.Paste" user) + (35 "F.Paste" user) + (36 "B.SilkS" user "B.Silkscreen") + (37 "F.SilkS" user "F.Silkscreen") + (38 "B.Mask" user) + (39 "F.Mask" user) + (40 "Dwgs.User" user "User.Drawings") + (41 "Cmts.User" user "User.Comments") + (42 "Eco1.User" user "User.Eco1") + (43 "Eco2.User" user "User.Eco2") + (44 "Edge.Cuts" user) + (45 "Margin" user) + (46 "B.CrtYd" user "B.Courtyard") + (47 "F.CrtYd" user "F.Courtyard") + (48 "B.Fab" user) + (49 "F.Fab" user) + (50 "User.1" user) + (51 "User.2" user) + (52 "User.3" user) + (53 "User.4" user) + (54 "User.5" user) + (55 "User.6" user) + (56 "User.7" user) + (57 "User.8" user) + (58 "User.9" user) + ) + (setup + (pad_to_mask_clearance 0) + (allow_soldermask_bridges_in_footprints no) + (pcbplotparams + (layerselection 0x00010fc_ffffffff) + (plot_on_all_layers_selection 0x0000000_00000000) + (disableapertmacros no) + (usegerberextensions no) + (usegerberattributes yes) + (usegerberadvancedattributes yes) + (creategerberjobfile yes) + (dashed_line_dash_ratio 12.000000) + (dashed_line_gap_ratio 3.000000) + (svgprecision 4) + (plotframeref no) + (viasonmask no) + (mode 1) + (useauxorigin no) + (hpglpennumber 1) + (hpglpenspeed 20) + (hpglpendiameter 15.000000) + (pdf_front_fp_property_popups yes) + (pdf_back_fp_property_popups yes) + (dxfpolygonmode yes) + (dxfimperialunits yes) + (dxfusepcbnewfont yes) + (psnegative no) + (psa4output no) + (plotreference yes) + (plotvalue yes) + (plotfptext yes) + (plotinvisibletext no) + (sketchpadsonfab no) + (subtractmaskfromsilk no) + (outputformat 1) + (mirror no) + (drillshape 1) + (scaleselection 1) + (outputdirectory "") + ) + ) + (net 0 "") + (net 1 "Net-(C1-Pad1)") + (net 2 "Net-(C1-Pad2)") + (net 3 "Net-(R1-Pad2)") + (net 4 "Net-(R1-Pad1)") + (footprint "Resistor_SMD:R_0805_2012Metric" + (layer "F.Cu") + (uuid "01085ecd-34f9-4d72-a088-4f8978da2f11") + (at 111.9125 77) + (descr "Resistor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator") + (tags "resistor") + (property "Reference" "R1" + (at 0 -1.65 0) + (layer "F.SilkS") + (uuid "0aba4e93-04a6-44fa-a200-63e737972525") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "10" + (at 0 1.65 0) + (layer "F.Fab") + (uuid "7d6b2836-375a-4073-a207-1a7a1725ed5f") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "Resistor_SMD:R_0805_2012Metric" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "e5c7e5a5-526e-477d-b140-5fdb0328a713") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "7459b478-11b8-4f38-b7f2-b39ed2c95dc6") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "Resistor" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "058482ab-6d30-4ada-b93a-bd37764c5529") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property ki_fp_filters "R_*") + (path "/b1588627-7df2-4e63-8d28-9ecd84234fff") + (sheetname "RaĆ­z") + (sheetfile "test_points.kicad_sch") + (attr smd) + (fp_line + (start -0.227064 -0.735) + (end 0.227064 -0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "e2f6f4cc-d4b6-4148-85a2-72da8a9f4a6e") + ) + (fp_line + (start -0.227064 0.735) + (end 0.227064 0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "a50ae818-763a-4a06-ac04-26606e11427c") + ) + (fp_line + (start -1.68 -0.95) + (end 1.68 -0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "b51e270c-0492-47fd-8ff2-243f3fd9cbc3") + ) + (fp_line + (start -1.68 0.95) + (end -1.68 -0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "8f52568b-18bc-447d-9297-37343b0026e7") + ) + (fp_line + (start 1.68 -0.95) + (end 1.68 0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "33250533-db49-46d0-aa17-54a7c513039d") + ) + (fp_line + (start 1.68 0.95) + (end -1.68 0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "0b8aa41e-2177-4494-8733-bb937e0bdc07") + ) + (fp_line + (start -1 -0.625) + (end 1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "98f0a898-cd4e-46bf-b530-60203e43f58b") + ) + (fp_line + (start -1 0.625) + (end -1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "496ff9ed-94d5-4c3f-88ae-a476a8380826") + ) + (fp_line + (start 1 -0.625) + (end 1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "68ea165a-fa3a-4d4a-8ff2-88cb32326208") + ) + (fp_line + (start 1 0.625) + (end -1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "967db304-3c54-455e-a0bc-40e89fcc211d") + ) + (fp_text user "${REFERENCE}" + (at 0 0 0) + (layer "F.Fab") + (uuid "ba032c2f-c490-4732-b0ad-8a3317530a8b") + (effects + (font + (size 0.5 0.5) + (thickness 0.08) + ) + ) + ) + (pad "1" smd roundrect + (at -0.9125 0) + (size 1.025 1.4) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.243902) + (net 4 "Net-(R1-Pad1)") + (pintype "passive") + (uuid "fc7cd461-2901-490f-b0ae-9754a34dda49") + ) + (pad "2" smd roundrect + (at 0.9125 0) + (size 1.025 1.4) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.243902) + (net 3 "Net-(R1-Pad2)") + (pintype "passive") + (uuid "b4aca25b-7910-4056-8b77-16b4fe9c4eee") + ) + (model "${KICAD8_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_0805_2012Metric.wrl" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (footprint "TestPoint:TestPoint_Pad_D2.0mm" + (layer "F.Cu") + (uuid "18305402-c6fd-4de7-a9ee-608132480f37") + (at 142 71) + (descr "SMD pad as test Point, diameter 2.0mm") + (tags "test point SMD pad") + (property "Reference" "TP4" + (at 0 -1.998 0) + (layer "F.SilkS") + (uuid "49f5896a-e15f-400f-8f5a-71a9b0fc880a") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "TestPoint_Probe" + (at 0 2.05 0) + (layer "F.Fab") + (uuid "677bc986-c897-44e5-88c0-042c7a7cccff") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "TestPoint:TestPoint_Pad_D2.0mm" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "a902ea37-e38a-4057-87d8-b53396534bf8") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "f65e083d-298d-49c2-90d5-08884ffacb6b") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "test point (alternative probe-style design)" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "190cd012-fbda-4ad0-84e7-68a6807af466") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property ki_fp_filters "Pin* Test*") + (path "/4865779a-1f67-4666-93e6-033755e85cb4") + (sheetname "RaĆ­z") + (sheetfile "test_points.kicad_sch") + (attr exclude_from_pos_files exclude_from_bom) + (fp_circle + (center 0 0) + (end 0 1.2) + (stroke + (width 0.12) + (type solid) + ) + (fill none) + (layer "F.SilkS") + (uuid "dbd09ff4-3f7e-4de0-b8b6-7ae424ca6fb9") + ) + (fp_circle + (center 0 0) + (end 1.5 0) + (stroke + (width 0.05) + (type solid) + ) + (fill none) + (layer "F.CrtYd") + (uuid "16ddc81a-087d-4eb6-b557-50f163e6c1bd") + ) + (fp_text user "${REFERENCE}" + (at 0 -2 0) + (layer "F.Fab") + (uuid "57b59c77-bf4d-435c-a4cb-4a65a39dd765") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (pad "1" smd circle + (at 0 0) + (size 2 2) + (layers "F.Cu" "F.Mask") + (net 2 "Net-(C1-Pad2)") + (pinfunction "1") + (pintype "passive") + (uuid "757856f1-be3e-4877-8479-d61108438382") + ) + ) + (footprint "TestPoint:TestPoint_Pad_1.0x1.0mm" + (layer "F.Cu") + (uuid "3a4ca783-df47-4b33-bbd1-0e51afe8bf2e") + (at 120 65) + (descr "SMD rectangular pad as test Point, square 1.0mm side length") + (tags "test point SMD pad rectangle square") + (property "Reference" "TP2" + (at 0 -1.448 0) + (layer "F.SilkS") + (uuid "c520afba-20f3-45db-a302-f4ef132d8855") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "TestPoint_Alt" + (at 0 1.55 0) + (layer "F.Fab") + (uuid "0709b846-f30b-446c-aea5-15645fbf9b29") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "TestPoint:TestPoint_Pad_1.0x1.0mm" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "8c938b74-468f-44ac-bf25-2918bfcd7a2f") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "ccf00f95-0d06-408a-8f62-35752fc7f3c1") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "test point (alternative shape)" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "8267ff78-054f-412a-b931-ddabc90dc76b") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property ki_fp_filters "Pin* Test*") + (path "/7c6364ce-f170-4c18-b2dd-d4c8a8ae7c04") + (sheetname "RaĆ­z") + (sheetfile "test_points.kicad_sch") + (attr smd exclude_from_pos_files dnp) + (fp_line + (start -0.7 -0.7) + (end 0.7 -0.7) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "3d69f1a5-ad24-47c0-838f-574ac17d90f4") + ) + (fp_line + (start -0.7 0.7) + (end -0.7 -0.7) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "7cafd050-a504-4cb4-915e-843dbe9fcf48") + ) + (fp_line + (start 0.7 -0.7) + (end 0.7 0.7) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "2baa5940-f997-4121-b2df-440874ec29b4") + ) + (fp_line + (start 0.7 0.7) + (end -0.7 0.7) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "e7e1129e-c3d1-4e37-82c4-b0fbbe29c390") + ) + (fp_line + (start -1 -1) + (end -1 1) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "2ed97169-f23f-4cb9-8de4-99746002aa4c") + ) + (fp_line + (start -1 -1) + (end 1 -1) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "cd15d2fd-965f-420f-a9bb-34bb22dc1714") + ) + (fp_line + (start 1 1) + (end -1 1) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "964732a3-a6b0-4307-b9c3-2fe7a068af05") + ) + (fp_line + (start 1 1) + (end 1 -1) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "bffd9961-766d-4751-b553-a52ae3fa6095") + ) + (fp_text user "${REFERENCE}" + (at 0 -1.45 0) + (layer "F.Fab") + (uuid "9df78a73-bb04-41f1-9bb5-33bdd32f299f") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (pad "1" smd rect + (at 0 0) + (size 1 1) + (layers "F.Cu" "F.Mask") + (net 3 "Net-(R1-Pad2)") + (pinfunction "1") + (pintype "passive") + (uuid "29af664c-c5fc-4aba-8fea-609d5f769ace") + ) + ) + (footprint "TestPoint:TestPoint_Plated_Hole_D2.0mm" + (layer "F.Cu") + (uuid "5777b015-507c-43ce-846f-4234b5d61f0b") + (at 132 65) + (descr "Plated Hole as test Point, diameter 2.0mm") + (tags "test point plated hole") + (property "Reference" "TP3" + (at 0 -2.498 0) + (layer "F.SilkS") + (uuid "181520f4-a70f-437a-878a-9242c65bda99") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "TestPoint_Flag" + (at 0 2.45 0) + (layer "F.Fab") + (uuid "132339d1-003f-414c-b86f-d624caf0a55e") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "TestPoint:TestPoint_Plated_Hole_D2.0mm" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "3536012b-fb64-4699-bd21-6bf19056998a") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "d37cb9dc-a499-4a8e-8150-a4fd8ed0392b") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "test point (alternative flag-style design)" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "52aaaefa-bcf4-4685-9e8b-7bfbbc5cd3dd") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property ki_fp_filters "Pin* Test*") + (path "/efdd716d-c2dd-4abe-891e-5cca0c2ff88c") + (sheetname "RaĆ­z") + (sheetfile "test_points.kicad_sch") + (attr exclude_from_pos_files exclude_from_bom) + (fp_circle + (center 0 0) + (end 0 -1.7) + (stroke + (width 0.12) + (type solid) + ) + (fill none) + (layer "F.SilkS") + (uuid "88046460-a7d8-4eae-9b0e-31ec5df8ec43") + ) + (fp_circle + (center 0 0) + (end 1.8 0) + (stroke + (width 0.05) + (type solid) + ) + (fill none) + (layer "F.CrtYd") + (uuid "29a62bd3-b99a-47af-90f2-3dd309a42e98") + ) + (fp_text user "${REFERENCE}" + (at 0 -2.5 0) + (layer "F.Fab") + (uuid "5051109f-7478-43a6-8bca-125afaec5f42") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (pad "1" thru_hole circle + (at 0 0) + (size 3 3) + (drill 2) + (property pad_prop_testpoint) + (layers "*.Cu" "*.Mask") + (remove_unused_layers no) + (net 1 "Net-(C1-Pad1)") + (pinfunction "1") + (pintype "passive") + (uuid "b696b506-9d7e-4a37-a732-955191356115") + ) + ) + (footprint "TestPoint:TestPoint_Loop_D1.80mm_Drill1.0mm_Beaded" + (layer "F.Cu") + (uuid "6d2fd2e1-7a36-4a86-b3d3-bba017592f48") + (at 105 65) + (descr "wire loop with bead as test point, loop diameter 1.8mm, hole diameter 1.0mm") + (tags "test point wire loop bead") + (property "Reference" "TP1" + (at 0.7 2.5 0) + (layer "F.SilkS") + (uuid "a1bde631-56a2-4703-90c8-17ea1071e2e9") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "TestPoint" + (at 0 -2.8 0) + (layer "F.Fab") + (uuid "48ba5726-4b69-473f-869d-b8c93841ed94") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "TestPoint:TestPoint_Loop_D1.80mm_Drill1.0mm_Beaded" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "ed967eed-8eeb-4c10-ab70-2e5d098b77b6") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "a2480568-a0a3-4a1b-ab90-43d636b87f68") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "test point" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "99671187-64ab-4eb8-a1ab-4e929a4b24a3") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property ki_fp_filters "Pin* Test*") + (path "/f9eb7bc5-fb03-4b1a-8b19-525d1d3e94b2") + (sheetname "RaĆ­z") + (sheetfile "test_points.kicad_sch") + (attr through_hole) + (fp_circle + (center 0 0) + (end 1.5 0) + (stroke + (width 0.12) + (type solid) + ) + (fill none) + (layer "F.SilkS") + (uuid "78f2580d-2cc7-4f3a-ad7a-1340e5740420") + ) + (fp_circle + (center 0 0) + (end 1.8 0) + (stroke + (width 0.05) + (type solid) + ) + (fill none) + (layer "F.CrtYd") + (uuid "9278da50-0d76-456b-9fde-c8e9b8f39741") + ) + (fp_line + (start -0.9 -0.2) + (end 0.9 -0.2) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.Fab") + (uuid "59125849-71e8-4dd3-86db-cbe33c095065") + ) + (fp_line + (start -0.9 0.2) + (end -0.9 -0.2) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.Fab") + (uuid "78da7546-18f6-4d9d-8b1e-f06bd0a641da") + ) + (fp_line + (start 0.9 -0.2) + (end 0.9 0.2) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.Fab") + (uuid "069f9751-32e4-4037-bf2b-383922471b52") + ) + (fp_line + (start 0.9 0.2) + (end -0.9 0.2) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.Fab") + (uuid "d56e0eaa-0602-48f4-92c9-ad25fcee6eda") + ) + (fp_circle + (center 0 0) + (end 1.3 0) + (stroke + (width 0.12) + (type solid) + ) + (fill none) + (layer "F.Fab") + (uuid "81d49dd7-c05b-4a8b-b351-e64ffcfc988e") + ) + (fp_text user "${REFERENCE}" + (at 0.7 2.5 0) + (layer "F.Fab") + (uuid "b42d36c1-50ce-4c7f-879a-23ee7918e4bb") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (pad "1" thru_hole circle + (at 0 0) + (size 2 2) + (drill 1) + (property pad_prop_testpoint) + (layers "*.Cu" "*.Mask") + (remove_unused_layers no) + (net 4 "Net-(R1-Pad1)") + (pinfunction "1") + (pintype "passive") + (uuid "e3ead967-ba43-4641-8b45-6cbd208ef6b4") + ) + (model "${KICAD8_3DMODEL_DIR}/TestPoint.3dshapes/TestPoint_Loop_D1.80mm_Drill1.0mm_Beaded.wrl" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (footprint "TestPoint:TestPoint_Pad_D1.0mm" + (layer "F.Cu") + (uuid "d294f311-2eeb-41aa-8f7c-27722d832681") + (at 140 87) + (descr "SMD pad as test Point, diameter 1.0mm") + (tags "test point SMD pad") + (property "Reference" "Wrong_Reference1" + (at 0 -1.448 0) + (layer "F.SilkS") + (uuid "ec4a6122-11b7-4e6d-b3f5-f95f8e013f4a") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "TestPoint_Small" + (at 0 1.55 0) + (layer "F.Fab") + (uuid "40c04f5a-5e87-4956-9f56-00bb521b7112") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "TestPoint:TestPoint_Pad_D1.0mm" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "046536b0-5f17-49a0-9b4a-558dcc132870") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "78905c16-ef41-4173-aa7b-525c857e1502") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "test point" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "14cb7a40-72ff-4fd8-a999-fed1574a9d79") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property ki_fp_filters "Pin* Test*") + (path "/7d298bff-ddd9-4e9c-92c1-a8a2585cd743") + (sheetname "RaĆ­z") + (sheetfile "test_points.kicad_sch") + (attr smd exclude_from_pos_files) + (fp_circle + (center 0 0) + (end 0 0.7) + (stroke + (width 0.12) + (type solid) + ) + (fill none) + (layer "F.SilkS") + (uuid "776b8c92-342f-4183-9dd7-d1c682dd370a") + ) + (fp_circle + (center 0 0) + (end 1 0) + (stroke + (width 0.05) + (type solid) + ) + (fill none) + (layer "F.CrtYd") + (uuid "860b6438-4c85-417b-a230-acf7b761abf1") + ) + (fp_text user "${REFERENCE}" + (at 0 -1.45 0) + (layer "F.Fab") + (uuid "dfc04849-8f62-4f07-ade0-4a3d873aa48e") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (pad "1" smd circle + (at 0 0) + (size 1 1) + (layers "F.Cu" "F.Mask") + (net 2 "Net-(C1-Pad2)") + (pinfunction "1") + (pintype "passive") + (uuid "ddc7d590-1369-4b45-a576-daa301beae61") + ) + ) + (footprint "Resistor_SMD:R_0805_2012Metric" + (layer "F.Cu") + (uuid "d51eff31-1b09-4274-b02e-9b6c4c78818b") + (at 125 77) + (descr "Resistor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator") + (tags "resistor") + (property "Reference" "R2" + (at 0 -1.65 0) + (layer "F.SilkS") + (uuid "d2deda10-8573-4994-93a9-c5df748ba0ec") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "20" + (at 0 1.65 0) + (layer "F.Fab") + (uuid "16a7f000-1271-48bf-8b41-4a4ed2d4f338") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "Resistor_SMD:R_0805_2012Metric" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "cb2485ad-47c5-4a1c-bacf-0f74695152b1") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "77feb72f-cdb7-4d4f-8edc-ef87148ddff5") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "Resistor" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "26de23b6-231d-4e41-b2aa-1a1d730cb34d") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property ki_fp_filters "R_*") + (path "/89450603-a6bb-4445-8a45-0bf903140f18") + (sheetname "RaĆ­z") + (sheetfile "test_points.kicad_sch") + (attr smd) + (fp_line + (start -0.227064 -0.735) + (end 0.227064 -0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "52a639c2-d332-4f9a-a917-e39315b14e28") + ) + (fp_line + (start -0.227064 0.735) + (end 0.227064 0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "bce389c2-c6b3-4cf2-8095-0327b85e3a3d") + ) + (fp_line + (start -1.68 -0.95) + (end 1.68 -0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "3d94e4a2-f81e-4873-b097-5252a2b80dd5") + ) + (fp_line + (start -1.68 0.95) + (end -1.68 -0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "3f50d8a2-b621-4211-9336-d695780ab8c6") + ) + (fp_line + (start 1.68 -0.95) + (end 1.68 0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "f883186f-16a3-4653-890a-dbc85e77db57") + ) + (fp_line + (start 1.68 0.95) + (end -1.68 0.95) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "c9223692-05fd-41f4-9523-203b8785e080") + ) + (fp_line + (start -1 -0.625) + (end 1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "af53f365-04b8-409a-a890-e2eb3b005165") + ) + (fp_line + (start -1 0.625) + (end -1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "72fde897-b5ce-431d-bee3-3923be459af1") + ) + (fp_line + (start 1 -0.625) + (end 1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "9f254ccd-ff41-4a8b-b3d4-693ef7ae5d24") + ) + (fp_line + (start 1 0.625) + (end -1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "f2c928a1-b961-4ba9-a613-8b29371bfda0") + ) + (fp_text user "${REFERENCE}" + (at 0 0 0) + (layer "F.Fab") + (uuid "6510e6e3-4580-463f-a4ea-32b144f30a67") + (effects + (font + (size 0.5 0.5) + (thickness 0.08) + ) + ) + ) + (pad "1" smd roundrect + (at -0.9125 0) + (size 1.025 1.4) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.243902) + (net 3 "Net-(R1-Pad2)") + (pintype "passive") + (uuid "42dfd8e3-8d3c-42f5-a984-c783c54bbe8a") + ) + (pad "2" smd roundrect + (at 0.9125 0) + (size 1.025 1.4) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.243902) + (net 1 "Net-(C1-Pad1)") + (pintype "passive") + (uuid "37091f30-1226-4ce0-b9a7-acda45e3d73c") + ) + (model "${KICAD8_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_0805_2012Metric.wrl" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (footprint "Capacitor_SMD:C_0805_2012Metric" + (layer "F.Cu") + (uuid "e0a508fc-c758-41cf-979b-de8670284de5") + (at 134 77) + (descr "Capacitor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 76, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf, https://docs.google.com/spreadsheets/d/1BsfQQcO9C6DZCsRaXUlFlo91Tg2WpOkGARC1WS5S8t0/edit?usp=sharing), generated with kicad-footprint-generator") + (tags "capacitor") + (property "Reference" "C1" + (at 0 -1.68 0) + (layer "F.SilkS") + (uuid "da63fd61-655a-46f7-9ea0-be7e56d2b36a") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Value" "1uF" + (at 0 1.68 0) + (layer "F.Fab") + (uuid "a6752523-0a95-4b20-a96d-f3701de0c6ba") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (property "Footprint" "Capacitor_SMD:C_0805_2012Metric" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "1d7ed113-afdf-4a29-9637-6050512fe9d8") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "01d2df47-d430-49ab-b4c2-1f2d9dd9d066") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "Unpolarized capacitor" + (at 0 0 0) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (uuid "fe78ea7b-3691-4a98-8870-22ad9ed3a387") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property ki_fp_filters "C_*") + (path "/2d6ef313-78bc-4f8f-a304-e0ba9652a3ef") + (sheetname "RaĆ­z") + (sheetfile "test_points.kicad_sch") + (attr smd) + (fp_line + (start -0.261252 -0.735) + (end 0.261252 -0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "e17f14f8-266a-4e84-b522-a9fef6b3be19") + ) + (fp_line + (start -0.261252 0.735) + (end 0.261252 0.735) + (stroke + (width 0.12) + (type solid) + ) + (layer "F.SilkS") + (uuid "3b14ffc5-2fa6-4e83-8d0a-4aa756cd8da2") + ) + (fp_line + (start -1.7 -0.98) + (end 1.7 -0.98) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "b36ea2ca-089a-4f5f-96de-6a754f635de9") + ) + (fp_line + (start -1.7 0.98) + (end -1.7 -0.98) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "0cbb1ae6-78da-4898-a46b-815cb1a28122") + ) + (fp_line + (start 1.7 -0.98) + (end 1.7 0.98) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "c8d30d4a-0554-4255-a5a4-6057d209c4f0") + ) + (fp_line + (start 1.7 0.98) + (end -1.7 0.98) + (stroke + (width 0.05) + (type solid) + ) + (layer "F.CrtYd") + (uuid "094d6ce8-9512-40a8-b3e2-691d178a88da") + ) + (fp_line + (start -1 -0.625) + (end 1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "cf4e62fb-db65-4df7-ae2f-e869ad346a4a") + ) + (fp_line + (start -1 0.625) + (end -1 -0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "78371dcf-140a-48d7-829c-86bb8bc378e9") + ) + (fp_line + (start 1 -0.625) + (end 1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "c52a5525-d27e-41e1-a8b6-5700947cb5d4") + ) + (fp_line + (start 1 0.625) + (end -1 0.625) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "cf0bdb93-b889-4138-9e2e-8c005a4f7f90") + ) + (fp_text user "${REFERENCE}" + (at 0 0 0) + (layer "F.Fab") + (uuid "9295abc7-5e2d-4f6b-bba9-539dfb55fb6c") + (effects + (font + (size 0.5 0.5) + (thickness 0.08) + ) + ) + ) + (pad "1" smd roundrect + (at -0.95 0) + (size 1 1.45) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.25) + (net 1 "Net-(C1-Pad1)") + (pintype "passive") + (uuid "bd3a1842-4801-4c9b-aad9-080154380c3c") + ) + (pad "2" smd roundrect + (at 0.95 0) + (size 1 1.45) + (property pad_prop_testpoint) + (layers "F.Cu" "F.Paste" "F.Mask") + (roundrect_rratio 0.25) + (net 2 "Net-(C1-Pad2)") + (pintype "passive") + (uuid "c43b244e-b761-4a0f-a358-95a666a62245") + ) + (model "${KICAD8_3DMODEL_DIR}/Capacitor_SMD.3dshapes/C_0805_2012Metric.wrl" + (offset + (xyz 0 0 0) + ) + (scale + (xyz 1 1 1) + ) + (rotate + (xyz 0 0 0) + ) + ) + ) + (gr_rect + (start 100 60) + (end 150 90) + (stroke + (width 0.05) + (type default) + ) + (fill none) + (layer "Edge.Cuts") + (uuid "4b79127e-2c46-48f3-9a83-22c74784407c") + ) + (segment + (start 133.05 66.05) + (end 132 65) + (width 0.2) + (layer "F.Cu") + (net 1) + (uuid "78d74676-328c-4e5e-b4d8-b7ed8b6b28ce") + ) + (segment + (start 125.9125 77) + (end 133.05 77) + (width 0.2) + (layer "F.Cu") + (net 1) + (uuid "bdf0ac2a-e3f8-4b1e-908f-5153fae2f15f") + ) + (segment + (start 133.05 77) + (end 133.05 66.05) + (width 0.2) + (layer "F.Cu") + (net 1) + (uuid "df8179c4-4249-4322-8bc9-407b9a3b27de") + ) + (segment + (start 134.95 77) + (end 140.95 71) + (width 0.2) + (layer "F.Cu") + (net 2) + (uuid "65364ed7-383f-41ca-b21a-76436f4d27c9") + ) + (segment + (start 140.95 71) + (end 142 71) + (width 0.2) + (layer "F.Cu") + (net 2) + (uuid "65c46808-26e1-4a08-9cd8-5a18a0f3407d") + ) + (segment + (start 134.95 81.95) + (end 140 87) + (width 0.2) + (layer "F.Cu") + (net 2) + (uuid "deb67fc8-5b77-4d3a-beaf-d8a875b56de2") + ) + (segment + (start 134.95 77) + (end 134.95 81.95) + (width 0.2) + (layer "F.Cu") + (net 2) + (uuid "e7b08a59-ee7c-4444-9749-a207f7405af5") + ) + (segment + (start 124.0875 69.0875) + (end 120 65) + (width 0.2) + (layer "F.Cu") + (net 3) + (uuid "0205ea3b-bbf3-4791-ae8e-487b74720c06") + ) + (segment + (start 124.0875 77) + (end 124.0875 69.0875) + (width 0.2) + (layer "F.Cu") + (net 3) + (uuid "298738a7-597a-48a9-9750-0fbf2deb6c3c") + ) + (segment + (start 112.825 77) + (end 124.0875 77) + (width 0.2) + (layer "F.Cu") + (net 3) + (uuid "55941275-3217-4028-b6af-dbd7a5e5a40d") + ) + (segment + (start 105 65) + (end 105 71) + (width 0.2) + (layer "F.Cu") + (net 4) + (uuid "4e26242c-1f8b-4a01-abc2-4082a37cda83") + ) + (segment + (start 105 71) + (end 111 77) + (width 0.2) + (layer "F.Cu") + (net 4) + (uuid "c3a539bb-023f-477b-8ae4-ad8f84871cb8") + ) +) diff --git a/tests/board_samples/kicad_8/test_points.kicad_prl b/tests/board_samples/kicad_8/test_points.kicad_prl new file mode 100644 index 000000000..359f6518b --- /dev/null +++ b/tests/board_samples/kicad_8/test_points.kicad_prl @@ -0,0 +1,83 @@ +{ + "board": { + "active_layer": 0, + "active_layer_preset": "All Layers", + "auto_track_width": true, + "hidden_netclasses": [], + "hidden_nets": [], + "high_contrast_mode": 0, + "net_color_mode": 1, + "opacity": { + "images": 0.6, + "pads": 1.0, + "tracks": 1.0, + "vias": 1.0, + "zones": 0.6 + }, + "selection_filter": { + "dimensions": true, + "footprints": true, + "graphics": true, + "keepouts": true, + "lockedItems": false, + "otherItems": true, + "pads": true, + "text": true, + "tracks": true, + "vias": true, + "zones": true + }, + "visible_items": [ + 0, + 1, + 2, + 3, + 4, + 5, + 8, + 9, + 10, + 11, + 12, + 13, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 32, + 33, + 34, + 35, + 36, + 39, + 40 + ], + "visible_layers": "fffffff_ffffffff", + "zone_display_mode": 0 + }, + "git": { + "repo_password": "", + "repo_type": "", + "repo_username": "", + "ssh_key": "" + }, + "meta": { + "filename": "test_points.kicad_prl", + "version": 3 + }, + "project": { + "files": [] + } +} diff --git a/tests/board_samples/kicad_8/test_points.kicad_pro b/tests/board_samples/kicad_8/test_points.kicad_pro new file mode 100644 index 000000000..97e4fc2fd --- /dev/null +++ b/tests/board_samples/kicad_8/test_points.kicad_pro @@ -0,0 +1,584 @@ +{ + "board": { + "3dviewports": [], + "design_settings": { + "defaults": { + "apply_defaults_to_fp_fields": false, + "apply_defaults_to_fp_shapes": false, + "apply_defaults_to_fp_text": false, + "board_outline_line_width": 0.05, + "copper_line_width": 0.2, + "copper_text_italic": false, + "copper_text_size_h": 1.5, + "copper_text_size_v": 1.5, + "copper_text_thickness": 0.3, + "copper_text_upright": false, + "courtyard_line_width": 0.05, + "dimension_precision": 4, + "dimension_units": 3, + "dimensions": { + "arrow_length": 1270000, + "extension_offset": 500000, + "keep_text_aligned": true, + "suppress_zeroes": false, + "text_position": 0, + "units_format": 1 + }, + "fab_line_width": 0.1, + "fab_text_italic": false, + "fab_text_size_h": 1.0, + "fab_text_size_v": 1.0, + "fab_text_thickness": 0.15, + "fab_text_upright": false, + "other_line_width": 0.1, + "other_text_italic": false, + "other_text_size_h": 1.0, + "other_text_size_v": 1.0, + "other_text_thickness": 0.15, + "other_text_upright": false, + "pads": { + "drill": 0.762, + "height": 1.524, + "width": 1.524 + }, + "silk_line_width": 0.1, + "silk_text_italic": false, + "silk_text_size_h": 1.0, + "silk_text_size_v": 1.0, + "silk_text_thickness": 0.1, + "silk_text_upright": false, + "zones": { + "min_clearance": 0.5 + } + }, + "diff_pair_dimensions": [], + "drc_exclusions": [], + "meta": { + "version": 2 + }, + "rule_severities": { + "annular_width": "error", + "clearance": "error", + "connection_width": "warning", + "copper_edge_clearance": "error", + "copper_sliver": "warning", + "courtyards_overlap": "error", + "diff_pair_gap_out_of_range": "error", + "diff_pair_uncoupled_length_too_long": "error", + "drill_out_of_range": "error", + "duplicate_footprints": "warning", + "extra_footprint": "warning", + "footprint": "error", + "footprint_symbol_mismatch": "warning", + "footprint_type_mismatch": "ignore", + "hole_clearance": "error", + "hole_near_hole": "error", + "holes_co_located": "warning", + "invalid_outline": "error", + "isolated_copper": "warning", + "item_on_disabled_layer": "error", + "items_not_allowed": "error", + "length_out_of_range": "error", + "lib_footprint_issues": "warning", + "lib_footprint_mismatch": "warning", + "malformed_courtyard": "error", + "microvia_drill_out_of_range": "error", + "missing_courtyard": "ignore", + "missing_footprint": "warning", + "net_conflict": "warning", + "npth_inside_courtyard": "ignore", + "padstack": "warning", + "pth_inside_courtyard": "ignore", + "shorting_items": "error", + "silk_edge_clearance": "warning", + "silk_over_copper": "warning", + "silk_overlap": "warning", + "skew_out_of_range": "error", + "solder_mask_bridge": "error", + "starved_thermal": "error", + "text_height": "warning", + "text_thickness": "warning", + "through_hole_pad_without_hole": "error", + "too_many_vias": "error", + "track_dangling": "warning", + "track_width": "error", + "tracks_crossing": "error", + "unconnected_items": "error", + "unresolved_variable": "error", + "via_dangling": "warning", + "zones_intersect": "error" + }, + "rules": { + "max_error": 0.005, + "min_clearance": 0.0, + "min_connection": 0.0, + "min_copper_edge_clearance": 0.5, + "min_hole_clearance": 0.25, + "min_hole_to_hole": 0.25, + "min_microvia_diameter": 0.2, + "min_microvia_drill": 0.1, + "min_resolved_spokes": 2, + "min_silk_clearance": 0.0, + "min_text_height": 0.8, + "min_text_thickness": 0.08, + "min_through_hole_diameter": 0.3, + "min_track_width": 0.0, + "min_via_annular_width": 0.1, + "min_via_diameter": 0.5, + "solder_mask_to_copper_clearance": 0.0, + "use_height_for_length_calcs": true + }, + "teardrop_options": [ + { + "td_onpadsmd": true, + "td_onroundshapesonly": false, + "td_ontrackend": false, + "td_onviapad": true + } + ], + "teardrop_parameters": [ + { + "td_allow_use_two_tracks": true, + "td_curve_segcount": 0, + "td_height_ratio": 1.0, + "td_length_ratio": 0.5, + "td_maxheight": 2.0, + "td_maxlen": 1.0, + "td_on_pad_in_zone": false, + "td_target_name": "td_round_shape", + "td_width_to_size_filter_ratio": 0.9 + }, + { + "td_allow_use_two_tracks": true, + "td_curve_segcount": 0, + "td_height_ratio": 1.0, + "td_length_ratio": 0.5, + "td_maxheight": 2.0, + "td_maxlen": 1.0, + "td_on_pad_in_zone": false, + "td_target_name": "td_rect_shape", + "td_width_to_size_filter_ratio": 0.9 + }, + { + "td_allow_use_two_tracks": true, + "td_curve_segcount": 0, + "td_height_ratio": 1.0, + "td_length_ratio": 0.5, + "td_maxheight": 2.0, + "td_maxlen": 1.0, + "td_on_pad_in_zone": false, + "td_target_name": "td_track_end", + "td_width_to_size_filter_ratio": 0.9 + } + ], + "track_widths": [], + "tuning_pattern_settings": { + "diff_pair_defaults": { + "corner_radius_percentage": 80, + "corner_style": 1, + "max_amplitude": 1.0, + "min_amplitude": 0.2, + "single_sided": false, + "spacing": 1.0 + }, + "diff_pair_skew_defaults": { + "corner_radius_percentage": 80, + "corner_style": 1, + "max_amplitude": 1.0, + "min_amplitude": 0.2, + "single_sided": false, + "spacing": 0.6 + }, + "single_track_defaults": { + "corner_radius_percentage": 80, + "corner_style": 1, + "max_amplitude": 1.0, + "min_amplitude": 0.2, + "single_sided": false, + "spacing": 0.6 + } + }, + "via_dimensions": [], + "zones_allow_external_fillets": false + }, + "ipc2581": { + "dist": "", + "distpn": "", + "internal_id": "", + "mfg": "", + "mpn": "" + }, + "layer_presets": [], + "viewports": [] + }, + "boards": [], + "cvpcb": { + "equivalence_files": [] + }, + "erc": { + "erc_exclusions": [], + "meta": { + "version": 0 + }, + "pin_map": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 2, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 2, + 2, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 2 + ], + [ + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 1, + 2, + 1, + 1, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2 + ], + [ + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 2 + ], + [ + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 2 + ], + [ + 0, + 2, + 1, + 2, + 0, + 0, + 1, + 0, + 2, + 2, + 2, + 2 + ], + [ + 0, + 2, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 2 + ], + [ + 0, + 2, + 1, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 2 + ], + [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ] + ], + "rule_severities": { + "bus_definition_conflict": "error", + "bus_entry_needed": "error", + "bus_to_bus_conflict": "error", + "bus_to_net_conflict": "error", + "conflicting_netclasses": "error", + "different_unit_footprint": "error", + "different_unit_net": "error", + "duplicate_reference": "error", + "duplicate_sheet_names": "error", + "endpoint_off_grid": "warning", + "extra_units": "error", + "global_label_dangling": "warning", + "hier_label_mismatch": "error", + "label_dangling": "error", + "lib_symbol_issues": "warning", + "missing_bidi_pin": "warning", + "missing_input_pin": "warning", + "missing_power_pin": "error", + "missing_unit": "warning", + "multiple_net_names": "warning", + "net_not_bus_member": "warning", + "no_connect_connected": "warning", + "no_connect_dangling": "warning", + "pin_not_connected": "error", + "pin_not_driven": "error", + "pin_to_pin": "warning", + "power_pin_not_driven": "error", + "similar_labels": "warning", + "simulation_model_issue": "ignore", + "unannotated": "error", + "unit_value_mismatch": "error", + "unresolved_variable": "error", + "wire_dangling": "error" + } + }, + "libraries": { + "pinned_footprint_libs": [], + "pinned_symbol_libs": [] + }, + "meta": { + "filename": "test_points.kicad_pro", + "version": 1 + }, + "net_settings": { + "classes": [ + { + "bus_width": 12, + "clearance": 0.2, + "diff_pair_gap": 0.25, + "diff_pair_via_gap": 0.25, + "diff_pair_width": 0.2, + "line_style": 0, + "microvia_diameter": 0.3, + "microvia_drill": 0.1, + "name": "Default", + "pcb_color": "rgba(0, 0, 0, 0.000)", + "schematic_color": "rgba(0, 0, 0, 0.000)", + "track_width": 0.2, + "via_diameter": 0.6, + "via_drill": 0.3, + "wire_width": 6 + } + ], + "meta": { + "version": 3 + }, + "net_colors": null, + "netclass_assignments": null, + "netclass_patterns": [] + }, + "pcbnew": { + "last_paths": { + "gencad": "", + "idf": "", + "netlist": "", + "plot": "", + "pos_files": "", + "specctra_dsn": "", + "step": "", + "svg": "", + "vrml": "" + }, + "page_layout_descr_file": "" + }, + "schematic": { + "annotate_start_num": 0, + "bom_export_filename": "", + "bom_fmt_presets": [], + "bom_fmt_settings": { + "field_delimiter": ",", + "keep_line_breaks": false, + "keep_tabs": false, + "name": "CSV", + "ref_delimiter": ",", + "ref_range_delimiter": "", + "string_delimiter": "\"" + }, + "bom_presets": [], + "bom_settings": { + "exclude_dnp": false, + "fields_ordered": [ + { + "group_by": false, + "label": "Reference", + "name": "Reference", + "show": true + }, + { + "group_by": true, + "label": "Value", + "name": "Value", + "show": true + }, + { + "group_by": false, + "label": "Datasheet", + "name": "Datasheet", + "show": true + }, + { + "group_by": false, + "label": "Footprint", + "name": "Footprint", + "show": true + }, + { + "group_by": false, + "label": "Qty", + "name": "${QUANTITY}", + "show": true + }, + { + "group_by": true, + "label": "DNP", + "name": "${DNP}", + "show": true + } + ], + "filter_string": "", + "group_symbols": true, + "name": "Grouped By Value", + "sort_asc": true, + "sort_field": "Referencia" + }, + "connection_grid_size": 50.0, + "drawing": { + "dashed_lines_dash_length_ratio": 12.0, + "dashed_lines_gap_length_ratio": 3.0, + "default_line_thickness": 6.0, + "default_text_size": 50.0, + "field_names": [], + "intersheets_ref_own_page": false, + "intersheets_ref_prefix": "", + "intersheets_ref_short": false, + "intersheets_ref_show": false, + "intersheets_ref_suffix": "", + "junction_size_choice": 3, + "label_size_ratio": 0.375, + "operating_point_overlay_i_precision": 3, + "operating_point_overlay_i_range": "~A", + "operating_point_overlay_v_precision": 3, + "operating_point_overlay_v_range": "~V", + "overbar_offset_ratio": 1.23, + "pin_symbol_size": 25.0, + "text_offset_ratio": 0.15 + }, + "legacy_lib_dir": "", + "legacy_lib_list": [], + "meta": { + "version": 1 + }, + "net_format_name": "", + "page_layout_descr_file": "", + "plot_directory": "", + "spice_current_sheet_as_root": false, + "spice_external_command": "spice \"%I\"", + "spice_model_current_sheet_as_root": true, + "spice_save_all_currents": false, + "spice_save_all_dissipations": false, + "spice_save_all_voltages": false, + "subpart_first_id": 65, + "subpart_id_separator": 0 + }, + "sheets": [ + [ + "f11cc9b6-ad0e-4d80-ba6b-8c4c473ef93a", + "RaĆ­z" + ] + ], + "text_variables": {} +} diff --git a/tests/board_samples/kicad_8/test_points.kicad_sch b/tests/board_samples/kicad_8/test_points.kicad_sch new file mode 100644 index 000000000..f254bf6ac --- /dev/null +++ b/tests/board_samples/kicad_8/test_points.kicad_sch @@ -0,0 +1,1474 @@ +(kicad_sch + (version 20231120) + (generator "eeschema") + (generator_version "8.0") + (uuid "f11cc9b6-ad0e-4d80-ba6b-8c4c473ef93a") + (paper "A4") + (lib_symbols + (symbol "Connector:TestPoint" + (pin_numbers hide) + (pin_names + (offset 0.762) hide) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "TP" + (at 0 6.858 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "TestPoint" + (at 0 5.08 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "" + (at 5.08 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 5.08 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "test point" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "test point tp" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "Pin* Test*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "TestPoint_0_1" + (circle + (center 0 3.302) + (radius 0.762) + (stroke + (width 0) + (type default) + ) + (fill + (type none) + ) + ) + ) + (symbol "TestPoint_1_1" + (pin passive line + (at 0 0 90) + (length 2.54) + (name "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + (symbol "Connector:TestPoint_Alt" + (pin_numbers hide) + (pin_names + (offset 0.762) hide) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "TP" + (at 0 6.858 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "TestPoint_Alt" + (at 0 5.08 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "" + (at 5.08 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 5.08 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "test point (alternative shape)" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "test point tp" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "Pin* Test*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "TestPoint_Alt_0_1" + (polyline + (pts + (xy 0 2.54) (xy -0.762 3.302) (xy 0 4.064) (xy 0.762 3.302) (xy 0 2.54) + ) + (stroke + (width 0) + (type default) + ) + (fill + (type none) + ) + ) + ) + (symbol "TestPoint_Alt_1_1" + (pin passive line + (at 0 0 90) + (length 2.54) + (name "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + (symbol "Connector:TestPoint_Flag" + (pin_numbers hide) + (pin_names + (offset 0.762) hide) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "TP" + (at 3.429 1.778 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "TestPoint_Flag" + (at 3.302 4.191 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "" + (at 5.08 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 5.08 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "test point (alternative flag-style design)" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "test point tp" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "Pin* Test*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "TestPoint_Flag_0_1" + (polyline + (pts + (xy 0 0) (xy 0.889 0.889) + ) + (stroke + (width 0.254) + (type default) + ) + (fill + (type none) + ) + ) + (rectangle + (start 0.889 2.794) + (end 5.842 0.889) + (stroke + (width 0.254) + (type default) + ) + (fill + (type background) + ) + ) + ) + (symbol "TestPoint_Flag_1_1" + (pin passive line + (at 0 0 90) + (length 0) + (name "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + (symbol "Connector:TestPoint_Probe" + (pin_numbers hide) + (pin_names + (offset 0.762) hide) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "TP" + (at 1.651 5.842 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "TestPoint_Probe" + (at 1.651 4.064 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "" + (at 5.08 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 5.08 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "test point (alternative probe-style design)" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "test point tp" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "Pin* Test*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "TestPoint_Probe_0_1" + (polyline + (pts + (xy 1.27 0.762) (xy 0 0) (xy 0.762 1.27) (xy 1.27 0.762) + ) + (stroke + (width 0) + (type default) + ) + (fill + (type outline) + ) + ) + (polyline + (pts + (xy 1.397 0.635) (xy 0.635 1.397) (xy 2.413 3.175) (xy 3.175 2.413) (xy 1.397 0.635) + ) + (stroke + (width 0) + (type default) + ) + (fill + (type background) + ) + ) + ) + (symbol "TestPoint_Probe_1_1" + (pin passive line + (at 0 0 90) + (length 0) + (name "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + (symbol "Connector:TestPoint_Small" + (pin_numbers hide) + (pin_names + (offset 0.762) hide) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "TP" + (at 0 3.81 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "TestPoint_Small" + (at 0 2.032 0) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "" + (at 5.08 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 5.08 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "test point" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "test point tp" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "Pin* Test*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "TestPoint_Small_0_1" + (circle + (center 0 0) + (radius 0.508) + (stroke + (width 0) + (type default) + ) + (fill + (type none) + ) + ) + ) + (symbol "TestPoint_Small_1_1" + (pin passive line + (at 0 0 90) + (length 0) + (name "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + (symbol "Device:C" + (pin_numbers hide) + (pin_names + (offset 0.254) + ) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "C" + (at 0.635 2.54 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "C" + (at 0.635 -2.54 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "" + (at 0.9652 -3.81 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Unpolarized capacitor" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "cap capacitor" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "C_*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "C_0_1" + (polyline + (pts + (xy -2.032 -0.762) (xy 2.032 -0.762) + ) + (stroke + (width 0.508) + (type default) + ) + (fill + (type none) + ) + ) + (polyline + (pts + (xy -2.032 0.762) (xy 2.032 0.762) + ) + (stroke + (width 0.508) + (type default) + ) + (fill + (type none) + ) + ) + ) + (symbol "C_1_1" + (pin passive line + (at 0 3.81 270) + (length 2.794) + (name "~" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + (pin passive line + (at 0 -3.81 90) + (length 2.794) + (name "~" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "2" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + (symbol "Device:R" + (pin_numbers hide) + (pin_names + (offset 0) + ) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (property "Reference" "R" + (at 2.032 0 90) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "R" + (at 0 0 90) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "" + (at -1.778 0 90) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Resistor" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_keywords" "R res resistor" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "ki_fp_filters" "R_*" + (at 0 0 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (symbol "R_0_1" + (rectangle + (start -1.016 -2.54) + (end 1.016 2.54) + (stroke + (width 0.254) + (type default) + ) + (fill + (type none) + ) + ) + ) + (symbol "R_1_1" + (pin passive line + (at 0 3.81 270) + (length 1.27) + (name "~" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "1" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + (pin passive line + (at 0 -3.81 90) + (length 1.27) + (name "~" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (number "2" + (effects + (font + (size 1.27 1.27) + ) + ) + ) + ) + ) + ) + ) + (junction + (at 127 76.2) + (diameter 0) + (color 0 0 0 0) + (uuid "3601cd66-7038-4003-86db-22539e81e580") + ) + (junction + (at 101.6 76.2) + (diameter 0) + (color 0 0 0 0) + (uuid "9ef07769-4451-4d6c-9d1c-fcf6b6b1bad9") + ) + (junction + (at 152.4 76.2) + (diameter 0) + (color 0 0 0 0) + (uuid "b25a242c-67b1-473b-8d1f-0b29ebe1aa0f") + ) + (wire + (pts + (xy 101.6 76.2) (xy 110.49 76.2) + ) + (stroke + (width 0) + (type default) + ) + (uuid "02d95b8c-c33d-4601-8c06-fc89d256ad4e") + ) + (wire + (pts + (xy 101.6 63.5) (xy 101.6 76.2) + ) + (stroke + (width 0) + (type default) + ) + (uuid "4bc7a2db-c8de-447a-bd52-82f6b81ad736") + ) + (wire + (pts + (xy 76.2 76.2) (xy 85.09 76.2) + ) + (stroke + (width 0) + (type default) + ) + (uuid "6d9f288c-3a54-4927-a583-fcaa3681b5f4") + ) + (wire + (pts + (xy 127 76.2) (xy 135.89 76.2) + ) + (stroke + (width 0) + (type default) + ) + (uuid "73d40d0f-7f51-4cf4-a738-6774fac6bff3") + ) + (wire + (pts + (xy 76.2 63.5) (xy 76.2 76.2) + ) + (stroke + (width 0) + (type default) + ) + (uuid "820c536b-1478-4f34-b01a-e8ff32e0dc41") + ) + (wire + (pts + (xy 127 63.5) (xy 127 76.2) + ) + (stroke + (width 0) + (type default) + ) + (uuid "a47edf7f-7a74-49c2-8051-fd050feb741d") + ) + (wire + (pts + (xy 92.71 76.2) (xy 101.6 76.2) + ) + (stroke + (width 0) + (type default) + ) + (uuid "a9221aa2-9b5e-4a39-9ff1-599c258b7266") + ) + (wire + (pts + (xy 152.4 76.2) (xy 160.02 76.2) + ) + (stroke + (width 0) + (type default) + ) + (uuid "d166dd9d-0ff9-4c75-b2da-f226e72c5d7a") + ) + (wire + (pts + (xy 118.11 76.2) (xy 127 76.2) + ) + (stroke + (width 0) + (type default) + ) + (uuid "d3a446e5-7702-4d2a-b17d-d0c2ae770600") + ) + (wire + (pts + (xy 143.51 76.2) (xy 152.4 76.2) + ) + (stroke + (width 0) + (type default) + ) + (uuid "eb7e0f3f-5aa1-4a71-baaf-2184c9ef5d70") + ) + (wire + (pts + (xy 152.4 76.2) (xy 152.4 63.5) + ) + (stroke + (width 0) + (type default) + ) + (uuid "fe26af82-bb07-4aaa-a010-7ee4518226f2") + ) + (symbol + (lib_id "Device:C") + (at 139.7 76.2 90) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "2d6ef313-78bc-4f8f-a304-e0ba9652a3ef") + (property "Reference" "C1" + (at 139.7 68.58 90) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "1uF" + (at 139.7 71.12 90) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "Capacitor_SMD:C_0805_2012Metric" + (at 143.51 75.2348 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 139.7 76.2 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Unpolarized capacitor" + (at 139.7 76.2 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "1" + (uuid "d1a6362b-f953-4dca-8967-2f757d60c7be") + ) + (pin "2" + (uuid "bf11d090-6088-43ac-a9e6-888c08b3bea9") + ) + (instances + (project "" + (path "/f11cc9b6-ad0e-4d80-ba6b-8c4c473ef93a" + (reference "C1") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Connector:TestPoint_Probe") + (at 152.4 63.5 0) + (unit 1) + (exclude_from_sim yes) + (in_bom no) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "4865779a-1f67-4666-93e6-033755e85cb4") + (property "Reference" "TP4" + (at 156.21 60.6424 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "TestPoint_Probe" + (at 156.21 63.1824 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "TestPoint:TestPoint_Pad_D2.0mm" + (at 157.48 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 157.48 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "test point (alternative probe-style design)" + (at 152.4 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "1" + (uuid "5e588a57-5eac-4559-9fd5-8cf2488fd15d") + ) + (instances + (project "" + (path "/f11cc9b6-ad0e-4d80-ba6b-8c4c473ef93a" + (reference "TP4") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Connector:TestPoint_Alt") + (at 101.6 63.5 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp yes) + (fields_autoplaced yes) + (uuid "7c6364ce-f170-4c18-b2dd-d4c8a8ae7c04") + (property "Reference" "TP2" + (at 104.14 58.9279 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "TestPoint_Alt" + (at 104.14 61.4679 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "TestPoint:TestPoint_Pad_1.0x1.0mm" + (at 106.68 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 106.68 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "test point (alternative shape)" + (at 101.6 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "1" + (uuid "e5b43eca-a911-4383-93dc-334be2fc90eb") + ) + (instances + (project "" + (path "/f11cc9b6-ad0e-4d80-ba6b-8c4c473ef93a" + (reference "TP2") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Connector:TestPoint_Small") + (at 160.02 76.2 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "7d298bff-ddd9-4e9c-92c1-a8a2585cd743") + (property "Reference" "Wrong_Reference1" + (at 161.29 74.9299 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "TestPoint_Small" + (at 161.29 77.4699 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "TestPoint:TestPoint_Pad_D1.0mm" + (at 165.1 76.2 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 165.1 76.2 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "test point" + (at 160.02 76.2 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "1" + (uuid "383a0d0d-b76c-4956-80c3-328f5f071207") + ) + (instances + (project "" + (path "/f11cc9b6-ad0e-4d80-ba6b-8c4c473ef93a" + (reference "Wrong_Reference1") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Device:R") + (at 114.3 76.2 90) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "89450603-a6bb-4445-8a45-0bf903140f18") + (property "Reference" "R2" + (at 114.3 69.85 90) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "20" + (at 114.3 72.39 90) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "Resistor_SMD:R_0805_2012Metric" + (at 114.3 77.978 90) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 114.3 76.2 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Resistor" + (at 114.3 76.2 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "2" + (uuid "6d9eb2d6-994a-4aeb-93c0-27fb28d7c24b") + ) + (pin "1" + (uuid "cf5f7251-1a0b-4807-8580-70724fd47216") + ) + (instances + (project "" + (path "/f11cc9b6-ad0e-4d80-ba6b-8c4c473ef93a" + (reference "R2") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Device:R") + (at 88.9 76.2 90) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "b1588627-7df2-4e63-8d28-9ecd84234fff") + (property "Reference" "R1" + (at 88.9 69.85 90) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Value" "10" + (at 88.9 72.39 90) + (effects + (font + (size 1.27 1.27) + ) + ) + ) + (property "Footprint" "Resistor_SMD:R_0805_2012Metric" + (at 88.9 77.978 90) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 88.9 76.2 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "Resistor" + (at 88.9 76.2 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "2" + (uuid "6ad9b8a8-a6d3-486b-91c7-45f2e1f2d5af") + ) + (pin "1" + (uuid "844acad6-3d18-474a-9f5d-f1fd226070da") + ) + (instances + (project "" + (path "/f11cc9b6-ad0e-4d80-ba6b-8c4c473ef93a" + (reference "R1") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Connector:TestPoint_Flag") + (at 127 63.5 0) + (unit 1) + (exclude_from_sim no) + (in_bom no) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "efdd716d-c2dd-4abe-891e-5cca0c2ff88c") + (property "Reference" "TP3" + (at 134.62 60.8329 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "TestPoint_Flag" + (at 134.62 63.3729 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "TestPoint:TestPoint_Plated_Hole_D2.0mm" + (at 132.08 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 132.08 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "test point (alternative flag-style design)" + (at 127 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "1" + (uuid "c15f2875-c330-459b-92ec-64d21818b53e") + ) + (instances + (project "" + (path "/f11cc9b6-ad0e-4d80-ba6b-8c4c473ef93a" + (reference "TP3") + (unit 1) + ) + ) + ) + ) + (symbol + (lib_id "Connector:TestPoint") + (at 76.2 63.5 0) + (unit 1) + (exclude_from_sim no) + (in_bom yes) + (on_board yes) + (dnp no) + (fields_autoplaced yes) + (uuid "f9eb7bc5-fb03-4b1a-8b19-525d1d3e94b2") + (property "Reference" "TP1" + (at 78.74 58.9279 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Value" "TestPoint" + (at 78.74 61.4679 0) + (effects + (font + (size 1.27 1.27) + ) + (justify left) + ) + ) + (property "Footprint" "TestPoint:TestPoint_Loop_D1.80mm_Drill1.0mm_Beaded" + (at 81.28 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Datasheet" "~" + (at 81.28 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (property "Description" "test point" + (at 76.2 63.5 0) + (effects + (font + (size 1.27 1.27) + ) + (hide yes) + ) + ) + (pin "1" + (uuid "b9b79ef9-9fac-4952-879c-fc8d37a24140") + ) + (instances + (project "" + (path "/f11cc9b6-ad0e-4d80-ba6b-8c4c473ef93a" + (reference "TP1") + (unit 1) + ) + ) + ) + ) + (sheet_instances + (path "/" + (page "1") + ) + ) +) diff --git a/tests/reference/5_1_7/light_control-F_Cu_color.png b/tests/reference/5_1_7/light_control-F_Cu_color.png index e1d7e81c9..f6991f4c9 100644 Binary files a/tests/reference/5_1_7/light_control-F_Cu_color.png and b/tests/reference/5_1_7/light_control-F_Cu_color.png differ diff --git a/tests/reference/5_1_7/light_control-report.txt b/tests/reference/5_1_7/light_control-report.txt index 742932b09..55b9ddc0b 100644 --- a/tests/reference/5_1_7/light_control-report.txt +++ b/tests/reference/5_1_7/light_control-report.txt @@ -101,6 +101,18 @@ Drill tools (including vias and computing adjusts and rounding): - 1.3 mm (51 mils) (20) - 3.2 mm (126 mils) (4) +Solder paste stats: + +Using a paste with 87.75 % alloy, that has an specific gravity for the alloy of 7.4 g/cmĀ³ +and 1.0 g/cmĀ³ for the flux. This paste has an specific gravity of 4.15 g/cmĀ³. + +The stencil thickness is 0.12 mm. + +| Side | Pads with paste | Area [mmĀ²] | Paste [g] | +|--------|-----------------|------------|-----------| +| Total | 204 | 205.54 | 1.02 | + +Note: this is just an approximation to the theoretical value. Margins of the solder mask and waste aren't computed. # Schematic diff --git a/tests/reference/5_1_7/light_control-report.txt_2 b/tests/reference/5_1_7/light_control-report.txt_2 index 1340358e1..befffe893 100644 --- a/tests/reference/5_1_7/light_control-report.txt_2 +++ b/tests/reference/5_1_7/light_control-report.txt_2 @@ -101,6 +101,18 @@ Drill tools (including vias and computing adjusts and rounding): - 1.3 mm (51 mils) (20) - 3.2 mm (126 mils) (4) +Solder paste stats: + +Using a paste with 87.75 % alloy, that has an specific gravity for the alloy of 7.4 g/cmĀ³ +and 1.0 g/cmĀ³ for the flux. This paste has an specific gravity of 4.15 g/cmĀ³. + +The stencil thickness is 0.12 mm. + +| Side | Pads with paste | Area [mmĀ²] | Paste [g] | +|--------|-----------------|------------|-----------| +| Total | 204 | 205.54 | 1.02 | + +Note: this is just an approximation to the theoretical value. Margins of the solder mask and waste aren't computed. # Schematic diff --git a/tests/reference/6_0_8/light_control-F_Cu_color.png b/tests/reference/6_0_8/light_control-F_Cu_color.png index 00e75cfbb..cfbf1f2aa 100644 Binary files a/tests/reference/6_0_8/light_control-F_Cu_color.png and b/tests/reference/6_0_8/light_control-F_Cu_color.png differ diff --git a/tests/reference/6_0_8/light_control-report.txt b/tests/reference/6_0_8/light_control-report.txt index 82a8d470a..26790829e 100644 --- a/tests/reference/6_0_8/light_control-report.txt +++ b/tests/reference/6_0_8/light_control-report.txt @@ -125,6 +125,18 @@ Drill tools (including vias and computing adjusts and rounding): - 1.3 mm (51 mils) (20) - 3.2 mm (126 mils) (4) +Solder paste stats: + +Using a paste with 87.75 % alloy, that has an specific gravity for the alloy of 7.4 g/cmĀ³ +and 1.0 g/cmĀ³ for the flux. This paste has an specific gravity of 4.15 g/cmĀ³. + +The stencil thickness is 0.12 mm. + +| Side | Pads with paste | Area [mmĀ²] | Paste [g] | +|--------|-----------------|------------|-----------| +| Total | 204 | 205.36 | 1.02 | + +Note: this is just an approximation to the theoretical value. Margins of the solder mask and waste aren't computed. # Schematic diff --git a/tests/reference/6_0_8/light_control-report.txt_2 b/tests/reference/6_0_8/light_control-report.txt_2 index 8b29ad348..917a88b70 100644 --- a/tests/reference/6_0_8/light_control-report.txt_2 +++ b/tests/reference/6_0_8/light_control-report.txt_2 @@ -125,6 +125,18 @@ Drill tools (including vias and computing adjusts and rounding): - 1.3 mm (51 mils) (20) - 3.2 mm (126 mils) (4) +Solder paste stats: + +Using a paste with 87.75 % alloy, that has an specific gravity for the alloy of 7.4 g/cmĀ³ +and 1.0 g/cmĀ³ for the flux. This paste has an specific gravity of 4.15 g/cmĀ³. + +The stencil thickness is 0.12 mm. + +| Side | Pads with paste | Area [mmĀ²] | Paste [g] | +|--------|-----------------|------------|-----------| +| Total | 204 | 205.36 | 1.02 | + +Note: this is just an approximation to the theoretical value. Margins of the solder mask and waste aren't computed. # Schematic diff --git a/tests/reference/7_0_3/light_control-report.txt b/tests/reference/7_0_3/light_control-report.txt index 678401097..ccf9f4596 100644 --- a/tests/reference/7_0_3/light_control-report.txt +++ b/tests/reference/7_0_3/light_control-report.txt @@ -125,6 +125,18 @@ Drill tools (including vias and computing adjusts and rounding): - 1.3 mm (51 mils) (20) - 3.2 mm (126 mils) (4) +Solder paste stats: + +Using a paste with 87.75 % alloy, that has an specific gravity for the alloy of 7.4 g/cmĀ³ +and 1.0 g/cmĀ³ for the flux. This paste has an specific gravity of 4.15 g/cmĀ³. + +The stencil thickness is 0.12 mm. + +| Side | Pads with paste | Area [mmĀ²] | Paste [g] | +|--------|-----------------|------------|-----------| +| Total | 204 | 205.36 | 1.02 | + +Note: this is just an approximation to the theoretical value. Margins of the solder mask and waste aren't computed. # Schematic diff --git a/tests/reference/7_0_3/light_control-report.txt_2 b/tests/reference/7_0_3/light_control-report.txt_2 index 961a9e295..952bdd0d4 100644 --- a/tests/reference/7_0_3/light_control-report.txt_2 +++ b/tests/reference/7_0_3/light_control-report.txt_2 @@ -125,6 +125,18 @@ Drill tools (including vias and computing adjusts and rounding): - 1.3 mm (51 mils) (20) - 3.2 mm (126 mils) (4) +Solder paste stats: + +Using a paste with 87.75 % alloy, that has an specific gravity for the alloy of 7.4 g/cmĀ³ +and 1.0 g/cmĀ³ for the flux. This paste has an specific gravity of 4.15 g/cmĀ³. + +The stencil thickness is 0.12 mm. + +| Side | Pads with paste | Area [mmĀ²] | Paste [g] | +|--------|-----------------|------------|-----------| +| Total | 204 | 205.36 | 1.02 | + +Note: this is just an approximation to the theoretical value. Margins of the solder mask and waste aren't computed. # Schematic diff --git a/tests/reference/7_0_6/light_control-F_Cu_color.png b/tests/reference/7_0_6/light_control-F_Cu_color.png index 6e32b69cc..5bb4fd59e 100644 Binary files a/tests/reference/7_0_6/light_control-F_Cu_color.png and b/tests/reference/7_0_6/light_control-F_Cu_color.png differ diff --git a/tests/reference/8_0_0/PCB_Bot.pdf b/tests/reference/8_0_0/PCB_Bot.pdf index 7beeee110..06fba1f39 100644 Binary files a/tests/reference/8_0_0/PCB_Bot.pdf and b/tests/reference/8_0_0/PCB_Bot.pdf differ diff --git a/tests/reference/8_0_0/PCB_Bot_def.pdf b/tests/reference/8_0_0/PCB_Bot_def.pdf index 65ecfb9b2..b7b292b6b 100644 Binary files a/tests/reference/8_0_0/PCB_Bot_def.pdf and b/tests/reference/8_0_0/PCB_Bot_def.pdf differ diff --git a/tests/reference/8_0_0/bom-F_Cu+F_SilkS.pdf b/tests/reference/8_0_0/bom-F_Cu+F_SilkS.pdf index 475db6b48..e06753dfd 100644 Binary files a/tests/reference/8_0_0/bom-F_Cu+F_SilkS.pdf and b/tests/reference/8_0_0/bom-F_Cu+F_SilkS.pdf differ diff --git a/tests/reference/8_0_0/bom-F_Cu+F_SilkS.svg b/tests/reference/8_0_0/bom-F_Cu+F_SilkS.svg index 1848adf2e..e72059ef9 100644 --- a/tests/reference/8_0_0/bom-F_Cu+F_SilkS.svg +++ b/tests/reference/8_0_0/bom-F_Cu+F_SilkS.svg @@ -1,58 +1,58 @@ - + - - - - + + + + - - + + - - - - - - - - + + + + + + + + - + - + - + - + - + diff --git a/tests/reference/8_0_0/bom_portrait-F_Cu+F_SilkS.svg b/tests/reference/8_0_0/bom_portrait-F_Cu+F_SilkS.svg index 5359e589c..eec5c3fd0 100644 --- a/tests/reference/8_0_0/bom_portrait-F_Cu+F_SilkS.svg +++ b/tests/reference/8_0_0/bom_portrait-F_Cu+F_SilkS.svg @@ -1,60 +1,60 @@ - + - - - - + + + + - - + + - - - - - - - - - - + + + + + + + + + + - + - + - + - + - + diff --git a/tests/reference/8_0_0/kibom-variant_3_txt-3D_top.png b/tests/reference/8_0_0/kibom-variant_3_txt-3D_top.png index 6aba54811..6754e207c 100644 Binary files a/tests/reference/8_0_0/kibom-variant_3_txt-3D_top.png and b/tests/reference/8_0_0/kibom-variant_3_txt-3D_top.png differ diff --git a/tests/reference/8_0_0/kibom-variant_3_txt-F_Fab.pdf b/tests/reference/8_0_0/kibom-variant_3_txt-F_Fab.pdf index bcffeab05..9c833bd45 100644 Binary files a/tests/reference/8_0_0/kibom-variant_3_txt-F_Fab.pdf and b/tests/reference/8_0_0/kibom-variant_3_txt-F_Fab.pdf differ diff --git a/tests/reference/8_0_0/light_control-F_Cu_color.png b/tests/reference/8_0_0/light_control-F_Cu_color.png index 85ac8ab66..f10bbec60 100644 Binary files a/tests/reference/8_0_0/light_control-F_Cu_color.png and b/tests/reference/8_0_0/light_control-F_Cu_color.png differ diff --git a/tests/reference/8_0_0/light_control-diff_sch.pdf b/tests/reference/8_0_0/light_control-diff_sch.pdf index b81329c51..4daf698bc 100644 Binary files a/tests/reference/8_0_0/light_control-diff_sch.pdf and b/tests/reference/8_0_0/light_control-diff_sch.pdf differ diff --git a/tests/reference/8_0_0/light_control-report.txt b/tests/reference/8_0_0/light_control-report.txt index faa20a236..c45c101a0 120000 --- a/tests/reference/8_0_0/light_control-report.txt +++ b/tests/reference/8_0_0/light_control-report.txt @@ -1 +1 @@ -../7_0_0/light_control-report.txt \ No newline at end of file +../7_0_3/light_control-report.txt \ No newline at end of file diff --git a/tests/reference/8_0_0/light_control-report.txt_2 b/tests/reference/8_0_0/light_control-report.txt_2 index bc5ee75f8..e864a416d 120000 --- a/tests/reference/8_0_0/light_control-report.txt_2 +++ b/tests/reference/8_0_0/light_control-report.txt_2 @@ -1 +1 @@ -../7_0_0/light_control-report.txt_2 \ No newline at end of file +../7_0_3/light_control-report.txt_2 \ No newline at end of file diff --git a/tests/reference/8_0_0/light_control_diff-diff_sch.pdf b/tests/reference/8_0_0/light_control_diff-diff_sch.pdf index 4ed0a10d8..7c4671ae5 100644 Binary files a/tests/reference/8_0_0/light_control_diff-diff_sch.pdf and b/tests/reference/8_0_0/light_control_diff-diff_sch.pdf differ diff --git a/tests/test_plot/test_dep_downloader.py b/tests/test_plot/test_dep_downloader.py index 292cfbb1c..27f1f41b9 100644 --- a/tests/test_plot/test_dep_downloader.py +++ b/tests/test_plot/test_dep_downloader.py @@ -142,6 +142,7 @@ def test_dep_gs(test_dir, caplog, monkeypatch): # @pytest.mark.xfail(True, reason="URL down", run=True, raises=AssertionError) # https://imagemagick.org/archive/binaries/magick +# @pytest.mark.skip @pytest.mark.slow @pytest.mark.indep def test_dep_convert(test_dir, caplog, monkeypatch): diff --git a/tests/test_plot/test_ibom.py b/tests/test_plot/test_ibom.py index 29c5cc2ad..793a70d88 100644 --- a/tests/test_plot/test_ibom.py +++ b/tests/test_plot/test_ibom.py @@ -69,16 +69,17 @@ def test_ibom_fail(test_dir): def test_ibom_all_ops(test_dir): - prj = 'bom' + prj = 'bom_adhes' ctx = context.TestContext(test_dir, prj, 'ibom_all_ops', BOM_DIR, add_cfg_kmajor=True) ctx.run() - ctx.expect_out_file_d(IBOM_OUT) + out_file = IBOM_OUT.replace('bom-', prj+'-') + ctx.expect_out_file_d(out_file) # These options are transferred as defaults: - ctx.search_in_file_d(IBOM_OUT, [r'"dark_mode": true', + ctx.search_in_file_d(out_file, [r'"dark_mode": true', r'"show_pads": false', r'"show_fabrication": true', r'"show_silkscreen": false', - r'"highlight_pin1": "all"', + r'"highlight_pin1": "selected"', r'"redraw_on_drag": false', r'"board_rotation": 18.0', # 90/5 r'"offset_back_rotation": true', diff --git a/tests/test_plot/test_int_bom.py b/tests/test_plot/test_int_bom.py index 6acd85564..03691cb19 100644 --- a/tests/test_plot/test_int_bom.py +++ b/tests/test_plot/test_int_bom.py @@ -574,7 +574,7 @@ def test_int_bom_datasheet_link(test_dir): ctx.clean_up() -def test_int_bom_digikey_link(test_dir): +def test_int_bom_digikey_link_1(test_dir): prj = 'links' ext = 'html' ctx = context.TestContextSCH(test_dir, prj, 'int_bom_digikey_link', BOM_DIR) @@ -609,7 +609,7 @@ def test_int_bom_digikey_link(test_dir): logging.debug(c + ' OK') parts = get_column(rows[0]+rows[1], lcsc_column, False) for c in parts: - assert c.strip().startswith('= 85', 'R5 field `Temp` fails 60.0 >= 85']) + ctx.clean_up() + + +@pytest.mark.skipif(not context.ki8(), reason="Test for 8 and up") +def test_check_fields_2(test_dir): + """ Simple check for temperature range """ + prj = 'temp_range' + ctx = context.TestContextSCH(test_dir, prj, 'check_fields_temp_2') + ctx.run(CHECK_FIELD) + ctx.search_err([r"WARNING:\(W162\) R1 missing field `Temp`", "ERROR:R2 field `Temp` doesn't match"]) + ctx.clean_up() diff --git a/tests/test_plot/test_yaml_errors.py b/tests/test_plot/test_yaml_errors.py index 852959927..b9cbc0b5d 100644 --- a/tests/test_plot/test_yaml_errors.py +++ b/tests/test_plot/test_yaml_errors.py @@ -51,7 +51,7 @@ import pytest import os from . import context -from kibot.misc import (EXIT_BAD_CONFIG, PLOT_ERROR, BOM_ERROR, WRONG_ARGUMENTS) +from kibot.misc import (EXIT_BAD_CONFIG, PLOT_ERROR, WRONG_ARGUMENTS) PRJ = 'fail-project' @@ -283,12 +283,13 @@ def test_out_needs_type(test_dir): # ctx.clean_up() -@pytest.mark.indep -def test_no_layers(test_dir): - ctx = context.TestContext(test_dir, '3Rs', 'error_no_layers') - ctx.run(EXIT_BAD_CONFIG) - assert ctx.search_err("Missing .?layers.? list") - ctx.clean_up() +# Now we interpret it as "all" +# @pytest.mark.indep +# def test_no_layers(test_dir): +# ctx = context.TestContext(test_dir, '3Rs', 'error_no_layers') +# ctx.run(EXIT_BAD_CONFIG) +# assert ctx.search_err("Missing .?layers.? list") +# ctx.clean_up() @pytest.mark.indep @@ -368,7 +369,7 @@ def test_error_wrong_type_1(test_dir): """ run_drc = number """ ctx = context.TestContext(test_dir, PRJ, 'error_pre_wrong_type_1') ctx.run(EXIT_BAD_CONFIG) - assert ctx.search_err("In preflight .?run_drc.?: must be boolean") + assert ctx.search_err("In preflight .?run_drc.?: (.*)not .?number.?") ctx.clean_up(keep_project=True) @@ -377,7 +378,7 @@ def test_error_wrong_type_2(test_dir): """ ignore_unconnected = string """ ctx = context.TestContext(test_dir, PRJ, 'error_pre_wrong_type_2') ctx.run(EXIT_BAD_CONFIG) - assert ctx.search_err("In preflight .?ignore_unconnected.?: must be boolean") + assert ctx.search_err("In preflight .?ignore_unconnected.?: (.*)must be a boolean") ctx.clean_up(keep_project=True) @@ -386,7 +387,7 @@ def test_error_wrong_type_3(test_dir): """ run_erc = number """ ctx = context.TestContext(test_dir, PRJ, 'error_pre_wrong_type_3') ctx.run(EXIT_BAD_CONFIG) - assert ctx.search_err("In preflight .?run_erc.?: must be boolean") + assert ctx.search_err("In preflight .?run_erc.?: (.*)must be any") ctx.clean_up(keep_project=True) @@ -395,7 +396,7 @@ def test_error_wrong_type_4(test_dir): """ update_xml = number """ ctx = context.TestContextSCH(test_dir, 'bom', 'error_pre_wrong_type_4') ctx.run(EXIT_BAD_CONFIG) - assert ctx.search_err("In preflight .?update_xml.?: must be boolean") + assert ctx.search_err("In preflight .?update_xml.?: (.*)must be any of") ctx.clean_up(keep_project=True) @@ -404,7 +405,7 @@ def test_error_wrong_type_5(test_dir): """ check_zone_fills = number """ ctx = context.TestContext(test_dir, PRJ, 'error_pre_wrong_type_5') ctx.run(EXIT_BAD_CONFIG) - assert ctx.search_err("In preflight .?check_zone_fills.?: must be boolean") + assert ctx.search_err("In preflight .?check_zone_fills.?: (.*)must be a boolean") ctx.clean_up(keep_project=True) @@ -459,8 +460,9 @@ def test_error_bom_column(test_dir): @pytest.mark.indep def test_error_bom_no_columns(test_dir): ctx = context.TestContext(test_dir, PRJ, 'error_bom_column') - ctx.run(BOM_ERROR, no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), 'bom_no_xml'+context.KICAD_SCH_EXT)]) - assert ctx.search_err("Failed to get the column names") + ctx.run(EXIT_BAD_CONFIG, no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), + 'bom_no_xml'+context.KICAD_SCH_EXT)]) + assert ctx.search_err("can't verify the field names") ctx.clean_up(keep_project=True) @@ -485,7 +487,7 @@ def test_error_wrong_boolean(test_dir): def test_error_gerber_precision(test_dir): ctx = context.TestContext(test_dir, PRJ, 'error_gerber_precision') ctx.run(EXIT_BAD_CONFIG) - assert ctx.search_err(".?gerber_precision.? must be 4.5 or 4.6") + assert ctx.search_err(".?gerber_precision.? must be any of") ctx.clean_up(keep_project=True) @@ -501,8 +503,8 @@ def test_error_wrong_drill_marks_1(test_dir): def test_error_print_pcb_no_layer(test_dir): prj = 'bom' ctx = context.TestContext(test_dir, prj, 'error_print_pcb_no_layer') - ctx.run(EXIT_BAD_CONFIG) - assert ctx.search_err("Missing .?layers.? list") + ctx.run() # EXIT_BAD_CONFIG Now allowed + assert ctx.search_err("No layers specified for") ctx.clean_up() @@ -806,7 +808,7 @@ def test_pre_list_instead_of_dict(test_dir): """ Extend an undefined output """ ctx = context.TestContext(test_dir, PRJ, 'error_pre_list_instead_of_dict_issue_360') ctx.run(EXIT_BAD_CONFIG) - assert ctx.search_err(r"Found .*list.* instead of dict") + assert ctx.search_err(r"must be a dict(.*)list") ctx.clean_up(keep_project=True) @@ -880,3 +882,21 @@ def test_download_datasheets_no_output(test_dir): ctx.run(EXIT_BAD_CONFIG) assert ctx.search_err(r"Empty `output`") ctx.clean_up(keep_project=True) + + +@pytest.mark.indep +def test_line_width_min(test_dir): + """ line_width < min """ + ctx = context.TestContext(test_dir, 'bom', 'error_wrong_line_width_min') + ctx.run(EXIT_BAD_CONFIG) + assert ctx.search_err(r"`line_width` outside its range ") + ctx.clean_up(keep_project=True) + + +@pytest.mark.indep +def test_line_width_max(test_dir): + """ line_width > max """ + ctx = context.TestContext(test_dir, 'bom', 'error_wrong_line_width_max') + ctx.run(EXIT_BAD_CONFIG) + assert ctx.search_err(r"`line_width` outside its range ") + ctx.clean_up(keep_project=True) diff --git a/tests/utils/context.py b/tests/utils/context.py index c49fc38cb..af9b64dff 100644 --- a/tests/utils/context.py +++ b/tests/utils/context.py @@ -551,7 +551,7 @@ def compare_image(self, image, reference=None, diff='diff.png', ref_out_dir=Fals png_ref = None if reference[-3:] == 'svg': png_ref = reference[:-3]+'png' - cmd = ['rsvg-convert', '-h', '2160', '-o', png_ref, reference] + cmd = ['rsvg-convert', '-b', '#FFFFFF', '-h', '2160', '-o', png_ref, reference] logging.debug('Converting reference to PNG with: '+usable_cmd(cmd)) subprocess.check_call(cmd) reference = png_ref @@ -559,7 +559,7 @@ def compare_image(self, image, reference=None, diff='diff.png', ref_out_dir=Fals png_image = None if image[-3:] == 'svg': png_image = image[:-3]+'png' - cmd = ['rsvg-convert', '-h', '2160', '-o', png_image, image] + cmd = ['rsvg-convert', '-b', '#FFFFFF', '-h', '2160', '-o', png_image, image] logging.debug('Converting result image to PNG with: '+usable_cmd(cmd)) subprocess.check_call(cmd) image = png_image diff --git a/tests/yaml_samples/check_fields_temp_1.kibot.yaml b/tests/yaml_samples/check_fields_temp_1.kibot.yaml new file mode 100644 index 000000000..0b1b0fd60 --- /dev/null +++ b/tests/yaml_samples/check_fields_temp_1.kibot.yaml @@ -0,0 +1,18 @@ +# Example KiBot config file +kibot: + version: 1 + +preflight: + check_fields: + - field: Temp + regex: '(-?\d+).+?(?:-?\d+).*' + numeric_condition: '<=' + numeric_reference: -10 + severity: warning + severity_missing: skip + - field: Temp + regex: '(?:-?\d+).+?(-?\d+).*' + numeric_condition: '>=' + numeric_reference: 85 + severity: info + severity_no_match: skip diff --git a/tests/yaml_samples/check_fields_temp_2.kibot.yaml b/tests/yaml_samples/check_fields_temp_2.kibot.yaml new file mode 100644 index 000000000..813243068 --- /dev/null +++ b/tests/yaml_samples/check_fields_temp_2.kibot.yaml @@ -0,0 +1,19 @@ +# Example KiBot config file +kibot: + version: 1 + +preflight: + check_fields: + - field: Temp + regex: '(-?\d+).+?(?:-?\d+).*' + numeric_condition: '<=' + numeric_reference: -10 + severity: error + severity_missing: warning + - field: Temp + regex: '(?:-?\d+).+?(-?\d+).*' + numeric_condition: '>=' + numeric_reference: 85 + severity: error + severity_missing: warning + diff --git a/tests/yaml_samples/drc_filter_k6_exc.kibot.yaml b/tests/yaml_samples/drc_filter_k6_exc.kibot.yaml index 920570f2d..3001abe12 100644 --- a/tests/yaml_samples/drc_filter_k6_exc.kibot.yaml +++ b/tests/yaml_samples/drc_filter_k6_exc.kibot.yaml @@ -7,6 +7,9 @@ globals: preflight: run_drc: true + set_text_variables: + - name: 'DUMMY' + text: 'foobar' filters: - filter_msg: 'Ignore unconnected pad 2 of C4' error: unconnected_items diff --git a/tests/yaml_samples/drc_k8.kibot.yaml b/tests/yaml_samples/drc_k8.kibot.yaml index 955f97f25..77ac12409 100644 --- a/tests/yaml_samples/drc_k8.kibot.yaml +++ b/tests/yaml_samples/drc_k8.kibot.yaml @@ -10,3 +10,10 @@ global: preflight: drc: format: RPT,HTML,CSV,JSON + category: 'Tests' + +outputs: + - name: 'navigate' + comment: "Browse the results" + type: navigate_results + run_by_default: false diff --git a/tests/yaml_samples/error_pcbdraw_comp_key.kibot.yaml b/tests/yaml_samples/error_pcbdraw_comp_key.kibot.yaml index 00b51ed3e..952ac0c46 100644 --- a/tests/yaml_samples/error_pcbdraw_comp_key.kibot.yaml +++ b/tests/yaml_samples/error_pcbdraw_comp_key.kibot.yaml @@ -17,5 +17,5 @@ outputs: variant: default format: png # This isn't a good idea, but works - show_components: 'C1' + show_components: 3 diff --git a/tests/yaml_samples/error_wrong_layer_1.kibot.yaml b/tests/yaml_samples/error_wrong_layer_1.kibot.yaml index a17de0b48..1e237f8f9 100644 --- a/tests/yaml_samples/error_wrong_layer_1.kibot.yaml +++ b/tests/yaml_samples/error_wrong_layer_1.kibot.yaml @@ -20,7 +20,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.02 layers: - layer: F.Cu suffix: F_Cu diff --git a/tests/yaml_samples/error_wrong_layer_2.kibot.yaml b/tests/yaml_samples/error_wrong_layer_2.kibot.yaml index 7839a76f3..97d3aa2d1 100644 --- a/tests/yaml_samples/error_wrong_layer_2.kibot.yaml +++ b/tests/yaml_samples/error_wrong_layer_2.kibot.yaml @@ -20,7 +20,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.02 layers: - layer: F.Cu suffix: F_Cu diff --git a/tests/yaml_samples/error_wrong_layer_3.kibot.yaml b/tests/yaml_samples/error_wrong_layer_3.kibot.yaml index e8b5aae71..e77236557 100644 --- a/tests/yaml_samples/error_wrong_layer_3.kibot.yaml +++ b/tests/yaml_samples/error_wrong_layer_3.kibot.yaml @@ -20,7 +20,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.03 layers: - layer: F.Cu suffix: F_Cu diff --git a/tests/yaml_samples/error_wrong_layer_4.kibot.yaml b/tests/yaml_samples/error_wrong_layer_4.kibot.yaml index f422c34ca..175f0b3ec 100644 --- a/tests/yaml_samples/error_wrong_layer_4.kibot.yaml +++ b/tests/yaml_samples/error_wrong_layer_4.kibot.yaml @@ -20,7 +20,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.02 layers: layer: F.Cu suffix: F_Cu diff --git a/tests/yaml_samples/error_wrong_layer_5.kibot.yaml b/tests/yaml_samples/error_wrong_layer_5.kibot.yaml index e3e1c2cd5..cada7e041 100644 --- a/tests/yaml_samples/error_wrong_layer_5.kibot.yaml +++ b/tests/yaml_samples/error_wrong_layer_5.kibot.yaml @@ -20,7 +20,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.05 layers: - layer: F.Cu description: 'Ok' diff --git a/tests/yaml_samples/error_wrong_layer_6.kibot.yaml b/tests/yaml_samples/error_wrong_layer_6.kibot.yaml index f32a00275..18557c61a 100644 --- a/tests/yaml_samples/error_wrong_layer_6.kibot.yaml +++ b/tests/yaml_samples/error_wrong_layer_6.kibot.yaml @@ -20,7 +20,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.06 layers: - description: 'Not in order' suffix: 'A_' diff --git a/tests/yaml_samples/error_wrong_layer_7.kibot.yaml b/tests/yaml_samples/error_wrong_layer_7.kibot.yaml index 25324552d..9b379f417 100644 --- a/tests/yaml_samples/error_wrong_layer_7.kibot.yaml +++ b/tests/yaml_samples/error_wrong_layer_7.kibot.yaml @@ -20,7 +20,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.02 layers: - 1 - 2 diff --git a/tests/yaml_samples/error_wrong_layer_8.kibot.yaml b/tests/yaml_samples/error_wrong_layer_8.kibot.yaml index 7450f4f56..a492c3fe7 100644 --- a/tests/yaml_samples/error_wrong_layer_8.kibot.yaml +++ b/tests/yaml_samples/error_wrong_layer_8.kibot.yaml @@ -20,7 +20,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.08 layers: - all - 4 diff --git a/tests/yaml_samples/error_wrong_layer_9.kibot.yaml b/tests/yaml_samples/error_wrong_layer_9.kibot.yaml index 52f91d831..3a946375d 100644 --- a/tests/yaml_samples/error_wrong_layer_9.kibot.yaml +++ b/tests/yaml_samples/error_wrong_layer_9.kibot.yaml @@ -20,7 +20,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.09 layers: - all - nada diff --git a/tests/yaml_samples/error_wrong_line_width_max.kibot.yaml b/tests/yaml_samples/error_wrong_line_width_max.kibot.yaml new file mode 100644 index 000000000..3ea354023 --- /dev/null +++ b/tests/yaml_samples/error_wrong_line_width_max.kibot.yaml @@ -0,0 +1,27 @@ +kiplot: + version: 1 + +outputs: + - name: PDF + comment: "PDF files" + type: pdf + dir: PDF + options: + exclude_edge_layer: false + exclude_pads_from_silkscreen: false + plot_sheet_reference: false + plot_footprint_refs: true + plot_footprint_values: true + force_plot_invisible_refs_vals: false + tent_vias: true + + # PDF options + drill_marks: small + mirror_plot: false + negative_plot: false + line_width: 2.01 + layers: + - layer: F.Cu + suffix: F_Cu + - layer: B.SilkS + suffix: B_Silks diff --git a/tests/yaml_samples/error_wrong_line_width_min.kibot.yaml b/tests/yaml_samples/error_wrong_line_width_min.kibot.yaml new file mode 100644 index 000000000..00d0c5251 --- /dev/null +++ b/tests/yaml_samples/error_wrong_line_width_min.kibot.yaml @@ -0,0 +1,27 @@ +kiplot: + version: 1 + +outputs: + - name: PDF + comment: "PDF files" + type: pdf + dir: PDF + options: + exclude_edge_layer: false + exclude_pads_from_silkscreen: false + plot_sheet_reference: false + plot_footprint_refs: true + plot_footprint_values: true + force_plot_invisible_refs_vals: false + tent_vias: true + + # PDF options + drill_marks: small + mirror_plot: false + negative_plot: false + line_width: 0.015 + layers: + - layer: F.Cu + suffix: F_Cu + - layer: B.SilkS + suffix: B_Silks diff --git a/tests/yaml_samples/ibom_all_ops5.kibot.yaml b/tests/yaml_samples/ibom_all_ops5.kibot.yaml index c5dcd5d8b..3649035b0 100644 --- a/tests/yaml_samples/ibom_all_ops5.kibot.yaml +++ b/tests/yaml_samples/ibom_all_ops5.kibot.yaml @@ -12,7 +12,7 @@ outputs: hide_pads: true show_fabrication: true hide_silkscreen: true - highlight_pin1: true + highlight_pin1: selected no_redraw_on_drag: true board_rotation: 90 checkboxes: 'Sourced,Placed,Bogus' diff --git a/tests/yaml_samples/ibom_all_ops6.kibot.yaml b/tests/yaml_samples/ibom_all_ops6.kibot.yaml index 911907e42..692a527a0 100644 --- a/tests/yaml_samples/ibom_all_ops6.kibot.yaml +++ b/tests/yaml_samples/ibom_all_ops6.kibot.yaml @@ -2,17 +2,24 @@ kibot: version: 1 +filters: + - name: remove_R2 + comment: Removes R2 + type: generic + exclude_refs: [R2] + outputs: - name: 'interactive_bom' comment: "Interactive Bill of Materials (HTML)" type: ibom dir: BoM options: + dnf_filter: remove_R2 dark_mode: true hide_pads: true show_fabrication: true hide_silkscreen: true - highlight_pin1: true + highlight_pin1: selected no_redraw_on_drag: true board_rotation: 90 checkboxes: 'Sourced,Placed,Bogus' diff --git a/tests/yaml_samples/int_bom_digikey_link.kibot.yaml b/tests/yaml_samples/int_bom_digikey_link.kibot.yaml index 79fb7327c..f4dc6cf29 100644 --- a/tests/yaml_samples/int_bom_digikey_link.kibot.yaml +++ b/tests/yaml_samples/int_bom_digikey_link.kibot.yaml @@ -11,7 +11,7 @@ outputs: html: digikey_link: 'digikey#' mouser_link: 'mouser#' - lcsc_link: 'LCSC#' + lcsc_link: true output: '%f.%x' columns: - References diff --git a/tests/yaml_samples/int_bom_subparts_1.kibot.yaml b/tests/yaml_samples/int_bom_subparts_1.kibot.yaml index d1a8b38d4..f14f51ae5 100644 --- a/tests/yaml_samples/int_bom_subparts_1.kibot.yaml +++ b/tests/yaml_samples/int_bom_subparts_1.kibot.yaml @@ -48,7 +48,7 @@ outputs: options: <<: *bom_options html: - digikey_link: 'digikey#' + digikey_link: ['Digikey#'] highlight_empty: false @@ -59,5 +59,5 @@ outputs: options: <<: *bom_options xlsx: - digikey_link: 'digikey#' + digikey_link: 'Digikey#' highlight_empty: false diff --git a/tests/yaml_samples/int_bom_var_t1_csv.kibot.yaml b/tests/yaml_samples/int_bom_var_t1_csv.kibot.yaml index aa9974d22..b08f0a873 100644 --- a/tests/yaml_samples/int_bom_var_t1_csv.kibot.yaml +++ b/tests/yaml_samples/int_bom_var_t1_csv.kibot.yaml @@ -61,3 +61,19 @@ outputs: dir: BoM options: variant: 'bla bla' + + - name: 'report' + comment: "Report" + type: report + + - name: 'report_v1' + comment: "Report for variant t1_v1" + type: report + options: + variant: t1_v1 + + - name: 'report_v2' + comment: "Report for variant t1_v2" + type: report + options: + variant: t1_v2 diff --git a/tests/yaml_samples/kikit_present_file_1.kibot.yaml b/tests/yaml_samples/kikit_present_file_1.kibot.yaml index 9f11d574c..9fb851035 100644 --- a/tests/yaml_samples/kikit_present_file_1.kibot.yaml +++ b/tests/yaml_samples/kikit_present_file_1.kibot.yaml @@ -8,7 +8,6 @@ outputs: type: kikit_present dir: Present/Files options: - description: 'tests/data/silly_project.md' boards: mode: file comment: This is a comment diff --git a/tests/yaml_samples/pcb_print.kibot.yaml b/tests/yaml_samples/pcb_print.kibot.yaml index 6e41057fc..51a431979 100644 --- a/tests/yaml_samples/pcb_print.kibot.yaml +++ b/tests/yaml_samples/pcb_print.kibot.yaml @@ -35,7 +35,7 @@ outputs: sketch_pad_line_width: 1 layers: - layer: Edge.Cuts - - layer: F.Cu + - F.Cu - layer: F.Mask color: '#14332440' - layer: F.Paste diff --git a/tests/yaml_samples/pcb_print_hide_excluded.kibot.yaml b/tests/yaml_samples/pcb_print_hide_excluded.kibot.yaml new file mode 100644 index 000000000..5b659fffc --- /dev/null +++ b/tests/yaml_samples/pcb_print_hide_excluded.kibot.yaml @@ -0,0 +1,31 @@ +# Example KiBot config file +kibot: + version: 1 + +globals: + hide_excluded: true + +filters: + - name: no_R1 + type: generic + exclude_refs: [R1] + +variants: + - name: 't1_v1' + comment: 'Test 1 Variant V1' + type: kibom + file_id: '_(V1)' + variant: V1 + exclude_filter: no_R1 + +outputs: + - name: 'print_front' + comment: "Experiment" + type: pcb_print + options: + format: 'PNG' + scaling: 2 + pages: + - layers: [F.Fab, Edge.Cuts] + + diff --git a/tests/yaml_samples/pcb_print_repeat.kibot.yaml b/tests/yaml_samples/pcb_print_repeat.kibot.yaml index 17b47b9bf..2895ca204 100644 --- a/tests/yaml_samples/pcb_print_repeat.kibot.yaml +++ b/tests/yaml_samples/pcb_print_repeat.kibot.yaml @@ -29,7 +29,6 @@ outputs: - scaling: 2.0 sheet: '%ln' repeat_for_layer: 'F.Cu' - repeat_layers: inners layers: - layer: Edge.Cuts - layer: F.Cu diff --git a/tests/yaml_samples/pcbdraw.kibot.yaml b/tests/yaml_samples/pcbdraw.kibot.yaml index a5eff9c78..9029b2f4a 100644 --- a/tests/yaml_samples/pcbdraw.kibot.yaml +++ b/tests/yaml_samples/pcbdraw.kibot.yaml @@ -79,4 +79,4 @@ outputs: show_components: - L_G1 - L_B1 - remap: + remap: None diff --git a/tests/yaml_samples/pdf.kibot.yaml b/tests/yaml_samples/pdf.kibot.yaml index 3e1065343..bd18fb8a1 100644 --- a/tests/yaml_samples/pdf.kibot.yaml +++ b/tests/yaml_samples/pdf.kibot.yaml @@ -19,7 +19,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.02 layers: - layer: F.Cu suffix: F_Cu diff --git a/tests/yaml_samples/pdf_zone-refill.kibot.yaml b/tests/yaml_samples/pdf_zone-refill.kibot.yaml index fe80f597c..e3cac1e80 100644 --- a/tests/yaml_samples/pdf_zone-refill.kibot.yaml +++ b/tests/yaml_samples/pdf_zone-refill.kibot.yaml @@ -23,7 +23,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.02 layers: - layer: B.Cu suffix: B_Cu diff --git a/tests/yaml_samples/pdf_zone-refill_2.kibot.yaml b/tests/yaml_samples/pdf_zone-refill_2.kibot.yaml index bebcfd69d..f9d24e3e7 100644 --- a/tests/yaml_samples/pdf_zone-refill_2.kibot.yaml +++ b/tests/yaml_samples/pdf_zone-refill_2.kibot.yaml @@ -23,7 +23,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.02 layers: - layer: B.Cu suffix: B_Cu diff --git a/tests/yaml_samples/pdfunite_1.kibot.yaml b/tests/yaml_samples/pdfunite_1.kibot.yaml index 783b37ece..537611f5c 100644 --- a/tests/yaml_samples/pdfunite_1.kibot.yaml +++ b/tests/yaml_samples/pdfunite_1.kibot.yaml @@ -27,7 +27,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.02 layers: - layer: F.Cu suffix: F_Cu @@ -44,7 +44,7 @@ outputs: drill_marks: full mirror_plot: true negative_plot: true - line_width: 0.01 + line_width: 0.02 layers: - layer: B.Cu suffix: B_Cu diff --git a/tests/yaml_samples/pdfunite_2.kibot.yaml b/tests/yaml_samples/pdfunite_2.kibot.yaml index 46e568548..a56b5dbfe 100644 --- a/tests/yaml_samples/pdfunite_2.kibot.yaml +++ b/tests/yaml_samples/pdfunite_2.kibot.yaml @@ -19,7 +19,7 @@ outputs: drill_marks: small mirror_plot: false negative_plot: false - line_width: 0.01 + line_width: 0.02 layers: - layer: F.Cu suffix: F_Cu @@ -36,7 +36,7 @@ outputs: drill_marks: full mirror_plot: true negative_plot: true - line_width: 0.01 + line_width: 0.03 layers: - layer: B.Cu suffix: B_Cu diff --git a/tests/yaml_samples/report_testpoints_1.kibot.yaml b/tests/yaml_samples/report_testpoints_1.kibot.yaml new file mode 100644 index 000000000..943689f52 --- /dev/null +++ b/tests/yaml_samples/report_testpoints_1.kibot.yaml @@ -0,0 +1,11 @@ +# Example KiBot config file +kibot: + version: 1 + +outputs: + - name: 'report_testpoints' + comment: "Report for the testpoints" + type: report + output_id: _testpoints + options: + template: testpoints diff --git a/tests/yaml_samples/spec_to_field_1.kibot.yaml b/tests/yaml_samples/spec_to_field_1.kibot.yaml index 54736b1ab..0d48da14f 100644 --- a/tests/yaml_samples/spec_to_field_1.kibot.yaml +++ b/tests/yaml_samples/spec_to_field_1.kibot.yaml @@ -1,6 +1,11 @@ kibot: version: 1 +global: + field_current: Corriente + field_power: Potencia + field_voltage: TensiĆ³n + filters: - name: spec_to_field type: spec_to_field @@ -12,6 +17,12 @@ filters: - spec: [resistance_tolerance, capacitance_tolerance, _tolerance] field: Tolerance type: percent + - spec: _power + field: _field_power + - spec: _voltage + field: _field_voltage + - spec: _current + field: _field_current outputs: - name: create_sch diff --git a/tests/yaml_samples/test_points_1.kibot.yaml b/tests/yaml_samples/test_points_1.kibot.yaml new file mode 100644 index 000000000..f35f9b75c --- /dev/null +++ b/tests/yaml_samples/test_points_1.kibot.yaml @@ -0,0 +1,38 @@ +kibot: + version: 1 + +filters: + - name: only_testpoints + comment: "Select only testpoints" + type: generic + include_only: + - column: Value + regex: "^TestPoint" + +outputs: + - name: testpoints + comment: "Testpoint report" + type: bom + options: + pre_transform: ['_kicost_rename', '_rot_footprint'] + exclude_filter: 'only_testpoints' + dnf_filter: '_null' + exclude_marked_in_sch: false + group_fields: [] + sort_style: ref + use_aux_axis_as_origin: true + ignore_dnf: false + format: CSV + columns: + - field: References + name: Designator + - field: Footprint X + name: X-Loc + - field: Footprint Y + name: Y-Loc + - field: Footprint Side + name: Side + - field: Footprint Type + name: Type + - field: Value + - field: Footprint diff --git a/tests/yaml_samples/test_points_2.kibot.yaml b/tests/yaml_samples/test_points_2.kibot.yaml new file mode 100644 index 000000000..3fdb17b14 --- /dev/null +++ b/tests/yaml_samples/test_points_2.kibot.yaml @@ -0,0 +1,43 @@ +kibot: + version: 1 + +filters: + - name: only_testpoints + comment: "Select testpoint pads" + type: separate_pins + +outputs: + - name: testpoints + comment: "Testpoint report" + type: bom + options: + pre_transform: ['_kicost_rename', 'only_testpoints'] + exclude_filter: '_null' + dnf_filter: '_null' + exclude_marked_in_sch: false + group_fields: [] + sort_style: ref + use_aux_axis_as_origin: true + ignore_dnf: false + format: XLSX + xlsx: + logo_scale: 1.7 + footprint_type_values: 'SMT,THRU,' + columns: + - field: Row + name: '' + - field: References + name: Source + - field: Net Name + name: Net + - field: Net Class + - field: Footprint Side + name: Side + - field: Footprint X + name: X-Loc + - field: Footprint Y + name: Y-Loc + - field: Footprint Type + name: Pad Type + - field: Value + - field: Footprint diff --git a/tests/yaml_samples/test_points_template_base.kibot.yaml b/tests/yaml_samples/test_points_template_base.kibot.yaml new file mode 100644 index 000000000..00a0d72a3 --- /dev/null +++ b/tests/yaml_samples/test_points_template_base.kibot.yaml @@ -0,0 +1,5 @@ +kibot: + version: 1 + +import: + - file: Testpoints_by_attr diff --git a/tests/yaml_samples/test_points_template_csv.kibot.yaml b/tests/yaml_samples/test_points_template_csv.kibot.yaml new file mode 100644 index 000000000..2750c61fa --- /dev/null +++ b/tests/yaml_samples/test_points_template_csv.kibot.yaml @@ -0,0 +1,5 @@ +kibot: + version: 1 + +import: + - file: Testpoints_by_attr_CSV diff --git a/tests/yaml_samples/test_points_template_html.kibot.yaml b/tests/yaml_samples/test_points_template_html.kibot.yaml new file mode 100644 index 000000000..fc6fb5d7d --- /dev/null +++ b/tests/yaml_samples/test_points_template_html.kibot.yaml @@ -0,0 +1,5 @@ +kibot: + version: 1 + +import: + - file: Testpoints_by_attr_HTML diff --git a/tests/yaml_samples/test_points_template_v_base.kibot.yaml b/tests/yaml_samples/test_points_template_v_base.kibot.yaml new file mode 100644 index 000000000..f5a40335d --- /dev/null +++ b/tests/yaml_samples/test_points_template_v_base.kibot.yaml @@ -0,0 +1,5 @@ +kibot: + version: 1 + +import: + - file: Testpoints_by_value diff --git a/tests/yaml_samples/test_points_template_v_csv.kibot.yaml b/tests/yaml_samples/test_points_template_v_csv.kibot.yaml new file mode 100644 index 000000000..4686642bd --- /dev/null +++ b/tests/yaml_samples/test_points_template_v_csv.kibot.yaml @@ -0,0 +1,5 @@ +kibot: + version: 1 + +import: + - file: Testpoints_by_value_CSV diff --git a/tests/yaml_samples/test_points_template_v_html.kibot.yaml b/tests/yaml_samples/test_points_template_v_html.kibot.yaml new file mode 100644 index 000000000..0cbccd633 --- /dev/null +++ b/tests/yaml_samples/test_points_template_v_html.kibot.yaml @@ -0,0 +1,5 @@ +kibot: + version: 1 + +import: + - file: Testpoints_by_value_HTML diff --git a/tools/dev_image_k5/Dockerfile b/tools/dev_image_k5/Dockerfile index 14db37525..4e59e0a21 100644 --- a/tools/dev_image_k5/Dockerfile +++ b/tools/dev_image_k5/Dockerfile @@ -13,17 +13,18 @@ RUN dpkg --remove kicost kibot && \ curl https://codeload.github.com/hildogjr/KiCost/zip/refs/heads/master --output pp.zip && \ unzip pp.zip && \ pip3 install KiCost-master/ && \ - apt-get -y remove curl unzip python3-pip && \ rm -rf KiCost-master pp.zip && \ + dpkg --remove kidiff kiauto && \ + curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install KiAuto-master/ && \ + rm -rf KiAuto-master/ pp.zip && \ + curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install KiDiff-master/ && \ + rm -rf KiDiff-master/ pp.zip && \ rm -rf /var/lib/apt/lists/* -# kidiff depends on KiAuto -# dpkg --remove kiauto && \ -# curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ -# unzip pp.zip && \ -# pip3 install KiAuto-master/ && \ -# rm -rf KiAuto-master/ pp.zip && \ - ARG repo_hash ENV KIBOT_REPO_HASH=$repo_hash diff --git a/tools/dev_image_k5f/Dockerfile b/tools/dev_image_k5f/Dockerfile index 27a34d6ad..52b46c345 100644 --- a/tools/dev_image_k5f/Dockerfile +++ b/tools/dev_image_k5f/Dockerfile @@ -12,15 +12,17 @@ RUN dpkg --remove kicost kibot && \ unzip pp.zip && \ pip3 install KiCost-master/ && \ rm -rf KiCost-master pp.zip && \ + dpkg --remove kidiff kiauto && \ + curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install KiAuto-master/ && \ + rm -rf KiAuto-master/ pp.zip && \ + curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install KiDiff-master/ && \ + rm -rf KiDiff-master/ pp.zip && \ rm -rf /var/lib/apt/lists/* -# kidiff depends on KiAuto -# dpkg --remove kiauto && \ -# curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ -# unzip pp.zip && \ -# pip3 install KiAuto-master/ && \ -# rm -rf KiAuto-master/ pp.zip && \ - ARG repo_hash ENV KIBOT_REPO_HASH=$repo_hash ENV KICAD_AUTO_FULL=1 diff --git a/tools/dev_image_k6/Dockerfile b/tools/dev_image_k6/Dockerfile index b97360738..ca9089f52 100644 --- a/tools/dev_image_k6/Dockerfile +++ b/tools/dev_image_k6/Dockerfile @@ -12,17 +12,18 @@ RUN dpkg --remove kicost kibot && \ curl https://codeload.github.com/hildogjr/KiCost/zip/refs/heads/master --output pp.zip && \ unzip pp.zip && \ pip3 install --break-system-packages KiCost-master/ && \ - apt-get -y remove curl unzip python3-pip && \ rm -rf KiCost-master pp.zip && \ + dpkg --remove kidiff kiauto && \ + curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install --break-system-packages KiAuto-master/ && \ + rm -rf KiAuto-master/ pp.zip && \ + curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install --break-system-packages KiDiff-master/ && \ + rm -rf KiDiff-master/ pp.zip && \ rm -rf /var/lib/apt/lists/* -# kidiff depends on KiAuto -# dpkg --remove kiauto && \ -# curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ -# unzip pp.zip && \ -# pip3 install --break-system-packages KiAuto-master/ && \ -# rm -rf KiAuto-master/ pp.zip && \ - ARG repo_hash ENV KIBOT_REPO_HASH=$repo_hash diff --git a/tools/dev_image_k6f/Dockerfile b/tools/dev_image_k6f/Dockerfile index f51f7d937..e25cf3712 100644 --- a/tools/dev_image_k6f/Dockerfile +++ b/tools/dev_image_k6f/Dockerfile @@ -12,15 +12,17 @@ RUN dpkg --remove kicost kibot && \ unzip pp.zip && \ pip3 install --break-system-packages KiCost-master/ && \ rm -rf KiCost-master pp.zip && \ + dpkg --remove kidiff kiauto && \ + curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install --break-system-packages KiAuto-master/ && \ + rm -rf KiAuto-master/ pp.zip && \ + curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install --break-system-packages KiDiff-master/ && \ + rm -rf KiDiff-master/ pp.zip && \ rm -rf /var/lib/apt/lists/* -# kidiff depends on KiAuto -# dpkg --remove kiauto && \ -# curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ -# unzip pp.zip && \ -# pip3 install --break-system-packages KiAuto-master/ && \ -# rm -rf KiAuto-master/ pp.zip && \ - ARG repo_hash ENV KIBOT_REPO_HASH=$repo_hash ENV KICAD_AUTO_FULL=1 diff --git a/tools/dev_image_k7/Dockerfile b/tools/dev_image_k7/Dockerfile index 612345366..4bf03f06e 100644 --- a/tools/dev_image_k7/Dockerfile +++ b/tools/dev_image_k7/Dockerfile @@ -14,11 +14,15 @@ RUN dpkg --remove kicost kibot && \ unzip pp.zip && \ pip3 install --break-system-packages KiCost-master/ && \ rm -rf KiCost-master pp.zip && \ - dpkg --remove --force-all kiauto && \ + dpkg --remove kidiff kiauto && \ curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ unzip pp.zip && \ pip3 install --break-system-packages KiAuto-master/ && \ rm -rf KiAuto-master/ pp.zip && \ + curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install --break-system-packages KiDiff-master/ && \ + rm -rf KiDiff-master/ pp.zip && \ rm -rf /var/lib/apt/lists/* ARG repo_hash diff --git a/tools/dev_image_k7f/Dockerfile b/tools/dev_image_k7f/Dockerfile index 6ed29aa79..7c897c608 100644 --- a/tools/dev_image_k7f/Dockerfile +++ b/tools/dev_image_k7f/Dockerfile @@ -12,11 +12,15 @@ RUN dpkg --remove kicost kibot && \ unzip pp.zip && \ pip3 install --break-system-packages KiCost-master/ && \ rm -rf KiCost-master pp.zip && \ - dpkg --remove --force-all kiauto && \ + dpkg --remove kidiff kiauto && \ curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ unzip pp.zip && \ pip3 install --break-system-packages KiAuto-master/ && \ rm -rf KiAuto-master/ pp.zip && \ + curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install --break-system-packages KiDiff-master/ && \ + rm -rf KiDiff-master/ pp.zip && \ rm -rf /var/lib/apt/lists/* ARG repo_hash diff --git a/tools/dev_image_k8/Dockerfile b/tools/dev_image_k8/Dockerfile index f377d6fb5..d985c5566 100644 --- a/tools/dev_image_k8/Dockerfile +++ b/tools/dev_image_k8/Dockerfile @@ -4,16 +4,20 @@ LABEL Description="KiCad 8 with KiBot and other automation scripts (development) RUN dpkg --remove kibot && \ apt-get update && \ - apt-get -y install --no-install-recommends curl unzip python3-pip && \ + apt-get -y install -t bookworm-backports --no-install-recommends curl unzip python3-pip && \ curl https://codeload.github.com/INTI-CMNB/KiBot/zip/refs/heads/dev --output pp.zip && \ unzip pp.zip && \ pip3 install --break-system-packages --no-compile KiBot-dev/ && \ rm -rf KiBot-dev pp.zip && \ - dpkg --remove --force-all kiauto && \ + dpkg --remove kidiff kiauto && \ curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ unzip pp.zip && \ pip3 install --break-system-packages KiAuto-master/ && \ rm -rf KiAuto-master/ pp.zip && \ + curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install --break-system-packages KiDiff-master/ && \ + rm -rf KiDiff-master/ pp.zip && \ rm -rf /var/lib/apt/lists/* ARG repo_hash diff --git a/tools/dev_image_k8f/Dockerfile b/tools/dev_image_k8f/Dockerfile index 7008514ec..f8fecef95 100644 --- a/tools/dev_image_k8f/Dockerfile +++ b/tools/dev_image_k8f/Dockerfile @@ -8,11 +8,15 @@ RUN dpkg --remove kibot && \ unzip pp.zip && \ pip3 install --break-system-packages --no-compile KiBot-dev/ && \ rm -rf KiBot-dev pp.zip && \ - dpkg --remove --force-all kiauto && \ + dpkg --remove kidiff kiauto && \ curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \ unzip pp.zip && \ pip3 install --break-system-packages KiAuto-master/ && \ rm -rf KiAuto-master/ pp.zip && \ + curl https://codeload.github.com/INTI-CMNB/KiDiff/zip/refs/heads/master --output pp.zip && \ + unzip pp.zip && \ + pip3 install --break-system-packages KiDiff-master/ && \ + rm -rf KiDiff-master/ pp.zip && \ rm -rf /var/lib/apt/lists/* ARG repo_hash diff --git a/tools/release_helper_version.py b/tools/release_helper_version.py new file mode 100755 index 000000000..b3aaaddeb --- /dev/null +++ b/tools/release_helper_version.py @@ -0,0 +1,125 @@ +#!/usr/bin/python3 +VERSION = "1.8.0" +DRY = False + +from datetime import datetime +import re +import subprocess +import sys +if sys.stdout.isatty(): + CSI = '\033[' + RED = CSI+str(31)+'m' + GREEN = CSI+str(32)+'m' + YELLOW = CSI+str(33)+'m' + YELLOW2 = CSI+str(93)+'m' + RESET = CSI+str(39)+'m' + BRIGHT = CSI+";1;4"+'m' + NORMAL = CSI+'0'+'m' +else: + RED = GREEN = YELLOW = YELLOW2 = RESET = BRIGHT = NORMAL = '' + + +def read_file(fname): + with open(fname, 'rt') as f: + return f.read() + + +def write_file(fname, txt): + if DRY: + return + with open(fname, 'wt') as f: + f.write(txt) + + +def replace_txt(pattern, repl, txt): + new_txt = re.sub(pattern, repl, txt) + return new_txt, new_txt != txt + + +def msg(txt): + print(txt) + + +def warn(txt): + print(YELLOW+txt+RESET) + + +def err(txt): + print(RED+txt+RESET) + exit(1) + + +def run(cmd): + subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + + +today = datetime.now().strftime('%Y-%m-%d') +# Ensure global version +txt = read_file('kibot/__init__.py') +txt, changed = replace_txt(r"__version__ = '(.*)'", f"__version__ = '{VERSION}'", txt) +if changed: + warn(f"Updating __version__ to {VERSION}") +else: + msg("Version ok") +write_file('kibot/__init__.py', txt) + +# Ensure Debian version +ver_debian = VERSION +if re.search(r'-\d+$', ver_debian) is None: + ver_debian += '-1' +txt = read_file('debian/changelog') +res = re.match(r'^kibot \(([\d\.-]+)\) (\w+);', txt) +if res is None: + err('Wrong Debian changelog') +cur_version = res.group(1) +cur_status = res.group(2) +if cur_version != ver_debian: + warn(f'Updating Debian version to {ver_debian}') +if cur_status == 'UNRELEASED': + warn('Updating release status') +if cur_version != ver_debian or cur_status == 'UNRELEASED': + if not DRY: + msg('- Change status to stable') + run(['dch', '-v', ver_debian]) +else: + msg('Debian changelog ok') +txt = read_file('debian/changelog') +res = re.match(r'^kibot \(([\d\.-]+)\) (\w+);', txt) +if res is None: + err('Wrong Debian changelog') +cur_version = res.group(1) +cur_status = res.group(2) +if cur_version != ver_debian: + err('Wrong Debian version found') +if cur_status == 'UNRELEASED': + err('Wrong Debian status') + +# Check the CHANGELOG.md +CHLOG = 'CHANGELOG.md' +txt = read_file(CHLOG) +res = re.search(r'## \[([\d\.-]+)\] - (.*)', txt) +if res is None: + err(f'No releases in {CHLOG}') +cur_version = res.group(1) +cur_date = res.group(2).strip() +if cur_version != VERSION: + warn(f'Updating {CHLOG} version to {VERSION}') +if cur_date != today: + warn(f'Updating date to {today}') +txt, changed = replace_txt(r'## \['+cur_version+r'\] - (.*)', f'## [{VERSION}] - {today}', txt) +if changed: + write_file(CHLOG, txt) +else: + msg(f'{CHLOG} ok') + +# Regenerate docs +msg('Regenerating docs ...') +if not DRY: + run(['make', 'doc']) + +# Debian package +# Esto va desde el master +# msg('Generating Debian package ...') +# if not DRY: +# run(['make', 'deb']) +# run(['make', 'deb_clean'])