176 lines
14 KiB
ReStructuredText
176 lines
14 KiB
ReStructuredText
.. Automatically generated by KiBot, please don't edit this file
|
|
|
|
Supported preflights
|
|
^^^^^^^^^^^^^^^^^^^^
|
|
|
|
- **annotate_pcb**: :index:`: <pair: preflights; annotate_pcb>` [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:`: <pair: preflight - annotate_pcb; bottom_main_ascending>` [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:`: <pair: preflight - annotate_pcb; bottom_main_axis>` [string='y'] [x,y] Use this axis as main sorting criteria for the bottom layer.
|
|
- ``bottom_secondary_ascending`` :index:`: <pair: preflight - annotate_pcb; bottom_secondary_ascending>` [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:`: <pair: preflight - annotate_pcb; bottom_start>` [number=101] First number for references at the bottom layer.
|
|
Use -1 to continue from the last top reference.
|
|
- ``grid`` :index:`: <pair: preflight - annotate_pcb; grid>` [number=1.0] Grid size in millimeters.
|
|
- ``top_main_ascending`` :index:`: <pair: preflight - annotate_pcb; top_main_ascending>` [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:`: <pair: preflight - annotate_pcb; top_main_axis>` [string='y'] [x,y] Use this axis as main sorting criteria for the top layer.
|
|
- ``top_secondary_ascending`` :index:`: <pair: preflight - annotate_pcb; top_secondary_ascending>` [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:`: <pair: preflight - annotate_pcb; top_start>` [number=1] First number for references at the top layer.
|
|
- ``use_position_of`` :index:`: <pair: preflight - annotate_pcb; use_position_of>` [string='footprint'] [footprint,reference] Which coordinate is used.
|
|
|
|
- **annotate_power**: :index:`: <pair: preflights; annotate_power>` [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:`: <pair: preflights; check_zone_fills>` [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.
|
|
- **erc_warnings**: :index:`: <pair: preflights; erc_warnings>` [boolean=false] **Deprecated**, use the `warnings_as_errors` option from `run_erc`.
|
|
Option for `run_erc`. ERC warnings are considered errors.
|
|
- **fill_zones**: :index:`: <pair: preflights; fill_zones>` [boolean=false] Fill all zones again and save the PCB.
|
|
- **filters**: :index:`: <pair: preflights; filters>` [list(dict)] A list of entries to filter out ERC/DRC messages.
|
|
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:`: <pair: preflight - filters; error>` [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:`: <pair: preflight - filters; error_number>` Alias for number.
|
|
- ``filter`` :index:`: <pair: preflight - filters; filter>` [string=''] Name for the filter, for documentation purposes.
|
|
- *filter_msg* :index:`: <pair: preflight - filters; filter_msg>` Alias for filter.
|
|
- ``number`` :index:`: <pair: preflight - filters; number>` [number=0] Error number we want to exclude.
|
|
KiCad 5 only.
|
|
- ``regex`` :index:`: <pair: preflight - filters; regex>` [string=''] Regular expression to match the text for the error we want to exclude.
|
|
- *regexp* :index:`: <pair: preflight - filters; regexp>` Alias for regex.
|
|
|
|
- **ignore_unconnected**: :index:`: <pair: preflights; ignore_unconnected>` [boolean=false] **Deprecated**, use the `ignore_unconnected` option from `run_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.
|
|
- **pcb_replace**: :index:`: <pair: preflights; pcb_replace>` [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:`: <pair: preflight - pcb_replace; date_command>` [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:`: <pair: preflight - pcb_replace; replace_tags>` [dict|list(dict)] Tag or tags to replace.
|
|
|
|
- Valid keys:
|
|
|
|
- ``after`` :index:`: <pair: preflight - pcb_replace - replace_tags; after>` [string=''] Text to add after the output of `command`.
|
|
- ``before`` :index:`: <pair: preflight - pcb_replace - replace_tags; before>` [string=''] Text to add before the output of `command`.
|
|
- ``command`` :index:`: <pair: preflight - pcb_replace - replace_tags; command>` [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:`: <pair: preflight - pcb_replace - replace_tags; tag>` [string=''] Name of the tag to replace. Use `version` for a tag named `@version@`.
|
|
- ``tag_delimiter`` :index:`: <pair: preflight - pcb_replace - replace_tags; tag_delimiter>` [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:`: <pair: preflight - pcb_replace - replace_tags; text>` [string=''] Text to insert instead of the tag.
|
|
|
|
|
|
- **run_drc**: :index:`: <pair: preflights; run_drc>` [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:`: <pair: preflight - run_drc; dir>` [string=''] Sub-directory for the report.
|
|
- ``enabled`` :index:`: <pair: preflight - run_drc; enabled>` [boolean=true] Enable the DRC. This is the replacement for the boolean value.
|
|
- ``ignore_unconnected`` :index:`: <pair: preflight - run_drc; ignore_unconnected>` [boolean=false] Ignores the unconnected nets. Useful if you didn't finish the routing.
|
|
It will also ignore KiCad 6 warnings.
|
|
|
|
- **run_erc**: :index:`: <pair: preflights; run_erc>` [boolean=false|dict] Runs the ERC (Electrical Rules Check). To ensure the schematic is electrically correct.
|
|
The report file name is controlled by the global output pattern (%i=erc %x=txt).
|
|
|
|
- Valid keys:
|
|
|
|
- ``dir`` :index:`: <pair: preflight - run_erc; dir>` [string=''] Sub-directory for the report.
|
|
- ``enabled`` :index:`: <pair: preflight - run_erc; enabled>` [boolean=true] Enable the ERC. This is the replacement for the boolean value.
|
|
- ``warnings_as_errors`` :index:`: <pair: preflight - run_erc; warnings_as_errors>` [boolean=false] ERC warnings are considered errors.
|
|
|
|
- **sch_replace**: :index:`: <pair: preflights; sch_replace>` [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:`: <pair: preflight - sch_replace; date_command>` [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:`: <pair: preflight - sch_replace; replace_tags>` [dict|list(dict)] Tag or tags to replace.
|
|
|
|
- Valid keys:
|
|
|
|
- ``after`` :index:`: <pair: preflight - sch_replace - replace_tags; after>` [string=''] Text to add after the output of `command`.
|
|
- ``before`` :index:`: <pair: preflight - sch_replace - replace_tags; before>` [string=''] Text to add before the output of `command`.
|
|
- ``command`` :index:`: <pair: preflight - sch_replace - replace_tags; command>` [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:`: <pair: preflight - sch_replace - replace_tags; tag>` [string=''] Name of the tag to replace. Use `version` for a tag named `@version@`.
|
|
- ``tag_delimiter`` :index:`: <pair: preflight - sch_replace - replace_tags; tag_delimiter>` [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:`: <pair: preflight - sch_replace - replace_tags; text>` [string=''] Text to insert instead of the tag.
|
|
|
|
|
|
- **set_text_variables**: :index:`: <pair: preflights; set_text_variables>` [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:`: <pair: preflight - set_text_variables; after>` [string=''] Text to add after the output of `command`.
|
|
- ``before`` :index:`: <pair: preflight - set_text_variables; before>` [string=''] Text to add before the output of `command`.
|
|
- ``command`` :index:`: <pair: preflight - set_text_variables; command>` [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:`: <pair: preflight - set_text_variables; expand_kibot_patterns>` [boolean=true] Expand %X patterns. The context is `schematic`.
|
|
- ``name`` :index:`: <pair: preflight - set_text_variables; name>` [string=''] Name of the variable. The `version` variable will be expanded using `${version}`.
|
|
- ``text`` :index:`: <pair: preflight - set_text_variables; text>` [string=''] Text to insert instead of the variable.
|
|
- *variable* :index:`: <pair: preflight - set_text_variables; variable>` Alias for name.
|
|
|
|
- **update_qr**: :index:`: <pair: preflights; update_qr>` [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_xml**: :index:`: <pair: preflights; update_xml>` [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:`: <pair: preflight - update_xml; check_pcb_parity>` [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:`: <pair: preflight - update_xml; as_warnings>` [boolean=false] Inform the problems as warnings and don't stop.
|
|
- ``enabled`` :index:`: <pair: preflight - update_xml; enabled>` [boolean=true] Enable the update. This is the replacement for the boolean value.
|
|
|