Skip to content

Commit

Permalink
[Added] Templates to generate testpoint reports
Browse files Browse the repository at this point in the history
Related to #638
  • Loading branch information
set-soft committed Jul 19, 2024
1 parent c6f2d45 commit 40f456f
Show file tree
Hide file tree
Showing 15 changed files with 226 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- check_fields: used to ensure conditions on desired fields (#643)
- Filters:
- separate_pins: used to create testpoint reports (#638)
- 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)
- 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)
Expand Down
7 changes: 7 additions & 0 deletions docs/source/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ Added

- separate_pins: used to create testpoint reports (#638)

- 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)

- 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)
Expand Down
36 changes: 36 additions & 0 deletions docs/source/configuration/imports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,31 @@ Here is a list of currently defined templates and their outputs / groups:
- `PCBWay_stencil <https://www.pcbway.com>`__: 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:

Expand Down Expand Up @@ -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
Expand Down
55 changes: 55 additions & 0 deletions kibot/resources/config_templates/Testpoints_by_attr.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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

...
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'
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
58 changes: 58 additions & 0 deletions kibot/resources/config_templates/Testpoints_by_value.kibot.yaml
Original file line number Diff line number Diff line change
@@ -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
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'
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions tests/yaml_samples/test_points_template_base.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kibot:
version: 1

import:
- file: Testpoints_by_attr
5 changes: 5 additions & 0 deletions tests/yaml_samples/test_points_template_csv.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kibot:
version: 1

import:
- file: Testpoints_by_attr_CSV
5 changes: 5 additions & 0 deletions tests/yaml_samples/test_points_template_html.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kibot:
version: 1

import:
- file: Testpoints_by_attr_HTML
5 changes: 5 additions & 0 deletions tests/yaml_samples/test_points_template_v_base.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kibot:
version: 1

import:
- file: Testpoints_by_value
5 changes: 5 additions & 0 deletions tests/yaml_samples/test_points_template_v_csv.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kibot:
version: 1

import:
- file: Testpoints_by_value_CSV
5 changes: 5 additions & 0 deletions tests/yaml_samples/test_points_template_v_html.kibot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kibot:
version: 1

import:
- file: Testpoints_by_value_HTML

0 comments on commit 40f456f

Please sign in to comment.