[DOCs][Fixed] annotate_pcb docs and example

- Missing options in docs
- Wrong example

Fixes #360
This commit is contained in:
Salvador E. Tropea 2023-01-10 15:05:05 -03:00
parent ac65cc022e
commit db6fa6767a
4 changed files with 45 additions and 22 deletions

View File

@ -46,6 +46,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Problems on KiCad 5 (no 3rd party dir) (#357)
- BoM:
- pre_transform filers can't be logic filters
- DOCs
- annotate_pcb pre-flight missing options (#360)
- annotate_pcb pre-flight wrong example (#360)
## [1.5.1] - 2022-12-16
### Fixed

View File

@ -400,6 +400,22 @@ This section is used to specify tasks that will be executed before generating an
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.
* Valid keys:
- `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`: [string='y'] [x,y] Use this axis as main sorting criteria for the bottom layer.
- `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`: [number=101] First number for references at the bottom layer.
Use -1 to continue from the last top reference.
- `grid`: [number=1.0] Grid size in millimeters.
- `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`: [string='y'] [x,y] Use this axis as main sorting criteria for the top layer.
- `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`: [number=1] First number for references at the top layer.
- `use_position_of`: [string='footprint'] [footprint,reference] Which coordinate is used.
- `annotate_power`: [boolean=false] 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.

View File

@ -11,16 +11,16 @@ preflight:
# Used to assign references according to footprint coordinates.
# The project must be fully annotated first.
annotate_pcb:
- top_main_axis: y
- top_main_ascending: true
- top_secondary_ascending: true
- top_start: 1
- bottom_main_axis: y
- bottom_main_ascending: true
- bottom_secondary_ascending: true
- bottom_start: 101
- use_position_of: 'footprint'
- grid: 1.0
top_main_axis: y
top_main_ascending: true
top_secondary_ascending: true
top_start: 1
bottom_main_axis: y
bottom_main_ascending: true
bottom_secondary_ascending: true
bottom_start: 101
use_position_of: 'footprint'
grid: 1.0
# [boolean=false] 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.

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022 Salvador E. Tropea
# Copyright (c) 2022 Instituto Nacional de Tecnología Industrial
# Copyright (c) 2022-2023 Salvador E. Tropea
# Copyright (c) 2022-2023 Instituto Nacional de Tecnología Industrial
# License: GPL-3.0
# Project: KiBot (formerly KiPlot)
from .error import PlotError
@ -131,18 +131,22 @@ class Annotate_PCB(BasePreFlight): # noqa: F821
self._sch_related = True
self._pcb_related = True
@classmethod
def get_doc(cls):
return cls.__doc__, Annotate_PCBOptions
def get_example():
""" Returns a YAML value for the example config """
return "\n - top_main_axis: y"\
"\n - top_main_ascending: true"\
"\n - top_secondary_ascending: true"\
"\n - top_start: 1"\
"\n - bottom_main_axis: y"\
"\n - bottom_main_ascending: true"\
"\n - bottom_secondary_ascending: true"\
"\n - bottom_start: 101"\
"\n - use_position_of: 'footprint'"\
"\n - grid: 1.0"
return ("\n top_main_axis: y"
"\n top_main_ascending: true"
"\n top_secondary_ascending: true"
"\n top_start: 1"
"\n bottom_main_axis: y"
"\n bottom_main_ascending: true"
"\n bottom_secondary_ascending: true"
"\n bottom_start: 101"
"\n use_position_of: 'footprint'"
"\n grid: 1.0")
def annotate_ki6(self, changes):
""" Apply changes to the KiCad 6 schematic """