Highlighted the most relevant options

This commit is contained in:
Salvador E. Tropea 2022-06-08 08:37:30 -03:00
parent 043ee382d3
commit 54dd130e4f
43 changed files with 882 additions and 822 deletions

View File

@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- The outputs help now display the more relevant options first and highlighted.
Which ones are more relevant is somehow arbitrary, comments are welcome.
- General stuff:
- Outputs now can have priorities, by default is applied.
Use `-n` to disable it.

1297
README.md

File diff suppressed because it is too large Load Diff

View File

@ -889,11 +889,11 @@ outputs:
test_regex: true
# [boolean=false] Print grouped references in the alternate compressed style eg: R1-R7,R18
use_alt: false
# [string='HTML'] [HTML,CSV,XML,XLSX] format for the BoM
# [string='HTML'] [HTML,CSV,XML,XLSX] Format for the BoM
format: 'HTML'
# [number=1] Number of boards to build (components multiplier)
number: 1
# [string='%f-%i%I%v.%x'] filename for the output (%i=bom). Affected by global options
# [string='%f-%i%I%v.%x'] Filename for the output (%i=bom). Affected by global options
output: '%f-%i%I%v.%x'
# [string=','] CSV Separator
separator: ','
@ -1142,25 +1142,25 @@ outputs:
show_components: none
# [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)
# [string='#208b47'] Color for the board without copper (covered by solder mask)
board: '#208b47'
# [string='#cabb3e'] color for the PCB core (not covered by solder mask)
# [string='#cabb3e'] Color for the PCB core (not covered by solder mask)
clad: '#cabb3e'
# [string='#285e3a'] color for the copper zones (covered by solder mask)
# [string='#285e3a'] Color for the copper zones (covered by solder mask)
copper: '#285e3a'
# [boolean=false] highlight over the component (not under)
# [boolean=false] Highlight over the component (not under)
highlight_on_top: false
# [number=1.5] [0,1000] how much the highlight extends around the component [mm]
highlight_padding: 1.5
# [string='stroke:none;fill:#ff0000;opacity:0.5;'] SVG code for the highlight style
highlight_style: 'stroke:none;fill:#ff0000;opacity:0.5;'
# [string='#000000'] color for the outline
# [string='#000000'] Color for the outline
outline: '#000000'
# [string='#8b898c'] color for the exposed pads (metal finish)
# [string='#8b898c'] Color for the exposed pads (metal finish)
pads: '#8b898c'
# [string='#d5dce4'] color for the silk screen
# [string='#d5dce4'] Color for the silk screen
silk: '#d5dce4'
# [string='#bf2600'] color for the V-CUTS
# [string='#bf2600'] Color for the V-CUTS
vcut: '#bf2600'
# [string=''] Board variant to apply
variant: ''
@ -1352,7 +1352,7 @@ outputs:
type: 'ps'
dir: 'Example/ps_dir'
options:
# [boolean=true] force A4 paper size
# [boolean=true] Force A4 paper size
a4_output: true
# [list(dict)] A list of customized reports for the manufacturer
custom_reports:

View File

@ -459,7 +459,7 @@ def print_output_options(name, cl, indent):
ind_str = indent*' '
obj = cl()
num_opts = 0
for k, v in obj.get_attrs_gen():
for k, v in sorted(obj.get_attrs_gen(), key=lambda x: not obj.is_basic_option(x[0])):
if k == 'type' and indent == 2:
# Type is fixed for an output
continue
@ -467,9 +467,15 @@ def print_output_options(name, cl, indent):
# We found one, put the title
print(ind_str+'* Valid keys:')
help, alias, is_alias = obj.get_doc(k)
is_basic = False
if help and help[0] == '*':
help = help[1:]
is_basic = True
if is_alias:
help = 'Alias for '+alias
entry = ' - *{}*: '
elif is_basic:
entry = ' - **`{}`**: '
else:
entry = ' - `{}`: '
if help is None:
@ -516,6 +522,10 @@ def print_outputs_help(details=False):
outs = RegOutput.get_registered()
logger.debug('{} supported outputs'.format(len(outs)))
print('Supported outputs:')
print('\nNotes:')
print('1. Most relevant options are listed first and in **bold**. '
'Which ones are more relevant is quite arbitrary, comments are welcome.')
print('2. Aliases are listed in *italics*.')
for n, o in OrderedDict(sorted(outs.items())).items():
if details:
print()
@ -571,7 +581,7 @@ def print_example_options(f, cls, name, indent, po, is_list=False):
if po:
obj.read_vals_from_po(po)
for k, _ in obj.get_attrs_gen():
help, alias, is_alias = obj.get_doc(k)
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))
continue

View File

@ -81,6 +81,11 @@ def document(sentences, **kw):
doc_str.startswith(' [boolean')):
# Hardcoded type hint, don't add one
type_hint = ''
# The * marks this option as a basic (not advanced) option
if doc_str.startswith(' *'):
# Move the marker to the beginning
doc_str = ' '+doc_str[2:]
type_hint = '*'+type_hint
help_str.s = type_hint+doc_str+post_hint
sentences[n] = Assign(targets=[target], value=help_str)
# Copy the line number from the original docstring

View File

@ -78,7 +78,7 @@ class Optionable(object):
if not isinstance(val, bool):
raise KiPlotConfigurationError("Option `{}` must be true/false".format(key))
def get_doc(self, name):
def get_doc(self, name, no_basic=False):
try:
doc = getattr(self, '_help_'+name).strip()
except AttributeError:
@ -86,8 +86,15 @@ class Optionable(object):
if doc[0] == '{':
alias = doc[1:-1]
return getattr(self, '_help_'+alias).strip(), alias, True
if no_basic and doc[0] == '*':
# Remove the 'basic' indicator
doc = doc[1:]
return doc, name, False
def is_basic_option(self, name):
help, _, _ = self.get_doc(name)
return help and help[0] == '*'
def add_to_doc(self, name, text):
doc = getattr(self, '_help_'+name).strip()
setattr(self, '_help_'+name, doc+'.\n'+text)
@ -122,7 +129,7 @@ class Optionable(object):
logger.warning(W_UNKOPS + "Unknown {}option `{}`".format(self._error_context, k))
continue
# Check the data type
cur_doc, alias, is_alias = self.get_doc(k)
cur_doc, alias, is_alias = self.get_doc(k, no_basic=True)
cur_val = getattr(self, alias)
if cur_doc[0] == '[':
# Separate the valid types for this key

View File

@ -20,7 +20,7 @@ class DrillMap(Optionable):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Name for the map file, KiCad defaults if empty (%i='PTH_drill_map') """
""" *Name for the map file, KiCad defaults if empty (%i='PTH_drill_map') """
self.type = 'pdf'
""" [hpgl,ps,gerber,dxf,svg,pdf] Format for a graphical drill map """
super().__init__()
@ -47,7 +47,7 @@ class AnyDrill(BaseOptions):
""" [dict|string] [hpgl,ps,gerber,dxf,svg,pdf] 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') """
""" *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 """
self.pth_id = None

View File

@ -49,7 +49,7 @@ class AnyLayerOptions(VariantOptions):
self.exclude_pads_from_silkscreen = False
""" Do not plot the component pads in the silk screen (KiCad 5.x only) """
self.plot_sheet_reference = False
""" Include the frame and title block. Only available for KiCad 6 and you get a poor result
""" *Include the frame and title block. Only available for KiCad 6 and you get a poor result
The `pcb_print` output can do a better job for PDF, SVG, PS, EPS and PNG outputs """
self.plot_footprint_refs = True
""" Include the footprint references """
@ -58,7 +58,7 @@ class AnyLayerOptions(VariantOptions):
self.force_plot_invisible_refs_vals = False
""" Include references and values even when they are marked as invisible """
self.output = GS.def_global_output
""" Output file name, the default KiCad name if empty """
""" *Output file name, the default KiCad name if empty """
self.tent_vias = True
""" Cover the vias """
self.uppercase_extensions = False
@ -241,7 +241,7 @@ class AnyLayer(BaseOutput):
super().__init__()
with document:
self.layers = Layer
""" [list(dict)|list(string)|string] [all,selected,copper,technical,user]
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user]
List of PCB layers to plot """
def config(self, parent):

View File

@ -32,15 +32,15 @@ class Any_PCB_PrintOptions(VariantOptions):
self.output_name = None
""" {output} """
self.scaling = 1.0
""" Scale factor (0 means autoscaling)"""
""" *Scale factor (0 means autoscaling)"""
self._drill_marks = 'full'
""" What to use to indicate the drill places, can be none, small or full (for real scale) """
self.plot_sheet_reference = True
""" Include the title-block """
""" *Include the title-block """
self.monochrome = False
""" Print in black and white """
self.separated = False
""" Print layers in separated pages """
""" *Print layers in separated pages """
self.mirror = False
""" Print mirrored (X axis inverted). ONLY for KiCad 6 """
self.hide_excluded = False

View File

@ -42,7 +42,7 @@ class Any_SCH_PrintOptions(VariantOptions):
self.monochrome = False
""" Generate a monochromatic PDF """
self.frame = True
""" Include the frame and title block """
""" *Include the frame and title block """
super().__init__()
self.add_to_doc('variant', "Not fitted components are crossed")
self._expand_id = 'schematic'

View File

@ -35,13 +35,14 @@ class BaseOutput(RegOutput):
super().__init__()
with document:
self.name = ''
""" Used to identify this particular output definition """
""" *Used to identify this particular output definition """
self.type = ''
""" Type of output """
""" *Type of output """
self.dir = './'
""" Output directory for the generated files. If it starts with `+` the rest is concatenated to the default dir """
""" *Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir """
self.comment = ''
""" A comment for documentation purposes """
""" *A comment for documentation purposes """
self.extends = ''
""" Copy the `options` section from the indicated output """
self.run_by_default = True

View File

@ -23,9 +23,9 @@ class Base3DOptions(VariantOptions):
def __init__(self):
with document:
self.no_virtual = False
""" Used to exclude 3D models for components with 'virtual' attribute """
""" *Used to exclude 3D models for components with 'virtual' attribute """
self.download = True
""" Downloads missing 3D models from KiCad git. Only applies to models in KISYS3DMOD """
""" *Downloads missing 3D models from KiCad git. Only applies to models in KISYS3DMOD """
self.kicad_3d_url = 'https://gitlab.com/kicad/libraries/kicad-packages3D/-/raw/master/'
""" Base URL for the KiCad 3D models """
# Temporal dir used to store the downloaded files

View File

@ -154,7 +154,7 @@ class BoardViewOptions(BaseOptions):
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) """
super().__init__()
self._expand_id = 'boardview'
self._expand_ext = 'brd'
@ -178,7 +178,7 @@ class BoardView(BaseOutput): # noqa: F821
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, templates):

View File

@ -56,7 +56,7 @@ class BoMJoinField(Optionable):
self._unkown_is_error = True
with document:
self.field = ''
""" Name of the field """
""" *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.
@ -116,9 +116,9 @@ class BoMColumns(Optionable):
self._unkown_is_error = True
with document:
self.field = ''
""" Name of the field to use for this column """
""" *Name of the field to use for this column """
self.name = ''
""" Name to display in the header. The field is used when empty """
""" *Name to display in the header. The field is used when empty """
self.join = BoMJoinField
""" [list(dict)|list(string)|string=''] List of fields to join to this column """
self.level = 0
@ -160,11 +160,11 @@ class BoMLinkable(Optionable):
self.col_colors = True
""" Use colors to show the field type """
self.datasheet_as_link = ''
""" Column with links to the datasheet """
""" *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 """
self.generate_dnf = True
""" Generate a separated section for DNF (Do Not Fit) components """
""" *Generate a separated section for DNF (Do Not Fit) components """
self.hide_pcb_info = False
""" Hide project information """
self.hide_stats_info = False
@ -172,9 +172,9 @@ class BoMLinkable(Optionable):
self.highlight_empty = True
""" Use a color for empty cells. Applies only when `col_colors` is `true` """
self.logo = Optionable
""" [string|boolean=''] PNG file to use as logo, use false to remove """
""" *[string|boolean=''] PNG file to use as logo, use false to remove """
self.title = 'KiBot Bill of Materials'
""" BoM title """
""" *BoM title """
self.extra_info = Optionable
""" [string|list(string)=''] Information to put after the title and before the pcb and stats info """
@ -226,7 +226,7 @@ class BoMCSV(Optionable):
super().__init__()
with document:
self.separator = ','
""" CSV Separator. TXT and TSV always use tab as delimiter """
""" *CSV Separator. TXT and TSV always use tab as delimiter """
self.hide_header = False
""" Hide the header line (names of the columns) """
self.hide_pcb_info = False
@ -234,7 +234,7 @@ class BoMCSV(Optionable):
self.hide_stats_info = False
""" Hide statistics information """
self.quote_all = False
""" Enclose all values using double quotes """
""" *Enclose all values using double quotes """
class BoMXLSX(BoMLinkable):
@ -247,7 +247,7 @@ class BoMXLSX(BoMLinkable):
self.style = 'modern-blue'
""" Head style: modern-blue, modern-green, modern-red and classic """
self.kicost = False
""" Enable KiCost worksheet creation """
""" *Enable KiCost worksheet creation """
self.kicost_api_enable = Optionable
""" [string|list(string)=''] List of KiCost APIs to enable """
self.kicost_api_disable = Optionable
@ -258,7 +258,7 @@ class BoMXLSX(BoMLinkable):
""" KiCost configuration file. It contains the keys for the different distributors APIs.
The regular KiCost config is used when empty """
self.specs = False
""" Enable Specs worksheet creation. Contains specifications for the components.
""" *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 references,
@ -370,40 +370,40 @@ class BoMOptions(BaseOptions):
def __init__(self):
with document:
self.number = 1
""" Number of boards to build (components multiplier) """
""" *Number of boards to build (components multiplier) """
self.variant = ''
""" Board variant, used to determine which components
are output to the BoM. """
self.output = GS.def_global_output
""" filename for the output (%i=bom)"""
""" *filename for the output (%i=bom)"""
self.format = ''
""" [HTML,CSV,TXT,TSV,XML,XLSX] format for the BoM.
""" *[HTML,CSV,TXT,TSV,XML,XLSX] format for the BoM.
Defaults to CSV or a guess according to the options. """
# Equivalent to KiBoM INI:
self.ignore_dnf = True
""" Exclude DNF (Do Not Fit) components """
""" *Exclude DNF (Do Not Fit) components """
self.fit_field = 'Config'
""" Field name used for internal filters """
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 """
self.cost_extra_columns = BoMColumns
""" [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 """
""" *Try to normalize the R, L and C values, producing uniform units and prefixes """
self.normalize_locale = False
""" When normalizing values use the locale decimal point """
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 """
# * Filters
self.exclude_filter = Optionable
""" [string|list(string)='_mechanical'] Name of the filter to exclude components from BoM processing.
@ -422,7 +422,7 @@ class BoMOptions(BaseOptions):
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)] 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',
@ -461,7 +461,7 @@ class BoMOptions(BaseOptions):
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'
""" [millimeters,inches,mils] Units used for the positions ('Footprint X' and 'Footprint Y' columns).
""" *[millimeters,inches,mils] Units used for the positions ('Footprint X' and 'Footprint Y' columns).
Affected by global options """
self.bottom_negative_x = False
""" Use negative X coordinates for footprints on bottom layer (for XYRS) """
@ -470,7 +470,7 @@ class BoMOptions(BaseOptions):
self.angle_positive = True
""" Always use positive values for the footprint rotation """
self.sort_style = 'type_value'
""" [type_value,type_value_ref,ref] Sorting criteria """
""" *[type_value,type_value_ref,ref] Sorting criteria """
self.footprint_populate_values = Optionable
""" [string|list(string)='no,yes'] Values for the `Footprint Populate` column """
self.footprint_type_values = Optionable
@ -756,7 +756,7 @@ class BoM(BaseOutput): # noqa: F821
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'

View File

@ -32,13 +32,13 @@ class FilesList(Optionable):
super().__init__()
with document:
self.source = '*'
""" File names to add, wildcards allowed. Use ** for recursive match.
""" *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 """
self.from_cwd = False
""" Use the current working directory instead of the dir specified by `-d` """
self.from_output = ''
""" Collect files from the selected output.
""" *Collect files from the selected output.
When used the `source` option is ignored """
self.filter = '.*'
""" A regular expression that source files must match """
@ -61,13 +61,13 @@ class CompressOptions(BaseOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Name for the generated archive (%i=name of the output %x=according to format) """
""" *Name for the generated archive (%i=name of the output %x=according to format) """
self.format = 'ZIP'
""" [ZIP,TAR,RAR] Output file format """
""" *[ZIP,TAR,RAR] Output file format """
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
@ -229,7 +229,7 @@ class Compress(BaseOutput): # noqa: F821
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()

View File

@ -28,7 +28,7 @@ class Download_Datasheets_Options(VariantOptions):
super().__init__()
with document:
self.field = 'Datasheet'
""" Name of the field containing the URL """
""" *Name of the field containing the URL """
self.output = '${VALUE}.pdf'
""" Name used for the downloaded datasheet.
${FIELD} will be replaced by the FIELD content """
@ -152,7 +152,7 @@ class Download_Datasheets(BaseOutput): # noqa: F821
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'

View File

@ -57,4 +57,4 @@ class DXF(AnyLayer):
self._category = 'PCB/export'
with document:
self.options = DXFOptions
""" [dict] Options for the `dxf` output """
""" *[dict] Options for the `dxf` output """

View File

@ -18,13 +18,13 @@ class ExcellonOptions(AnyDrill):
super().__init__()
with document:
self.metric_units = True
""" Use metric units instead of inches """
""" *Use metric units instead of inches """
self.pth_and_npth_single_file = True
""" Generate one file for both, plated holes and non-plated holes, instead of two separated files """
""" *Generate one file for both, plated holes and non-plated holes, instead of two separated files """
self.minimal_header = False
""" Use a minimal header in the file """
self.mirror_y_axis = False
""" Invert the Y axis """
""" *Invert the Y axis """
self.zeros_format = 'DECIMAL_FORMAT'
""" [DECIMAL_FORMAT,SUPPRESS_LEADING,SUPPRESS_TRAILING,KEEP_ZEROS] How to handle the zeros """
self.left_digits = 0
@ -55,7 +55,7 @@ class Excellon(BaseOutput): # noqa: F821
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, templates):

View File

@ -20,7 +20,7 @@ class GenCADOptions(BaseOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Filename for the output (%i=gencad, %x=cad) """
""" *Filename for the output (%i=gencad, %x=cad) """
self.flip_bottom_padstacks = False
""" Flip bottom footprint padstacks """
self.unique_pin_names = False
@ -76,7 +76,7 @@ class GenCAD(BaseOutput): # noqa: F821
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, templates):

View File

@ -32,7 +32,7 @@ class Gerb_Drill(BaseOutput): # noqa: F821
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, templates):

View File

@ -25,20 +25,20 @@ class GerberOptions(AnyLayerOptions):
self.line_width = 0.1
""" [0.02,2] Line_width for objects without width [mm] (KiCad 5) """
self.subtract_mask_from_silk = False
""" Subtract the solder mask from the silk screen """
""" *Subtract the solder mask from the silk screen """
self.use_protel_extensions = False
""" Use legacy Protel file extensions """
""" *Use legacy Protel file extensions """
self._gerber_precision = 4.6
""" This 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.
""" *Creates a file with information about all the generated gerbers.
You can use it in gerbview to load all gerbers at once """
self.gerber_job_file = GS.def_global_output
""" Name for the gerber job file (%i='job', %x='gbrjob') """
self.use_gerber_x2_attributes = True
""" Use the extended X2 format (otherwise use X1 formerly RS-274X) """
""" *Use the extended X2 format (otherwise use X1 formerly RS-274X) """
self.use_gerber_net_attributes = True
""" Include netlist metadata """
""" *Include netlist metadata """
self.disable_aperture_macros = False
""" Disable aperture macros (workaround for buggy CAM software) (KiCad 6) """
super().__init__()
@ -105,7 +105,7 @@ class Gerber(AnyLayer):
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

View File

@ -66,4 +66,4 @@ class HPGL(AnyLayer):
self._category = 'PCB/docs'
with document:
self.options = HPGLOptions
""" [dict] Options for the `hpgl` output """
""" *[dict] Options for the `hpgl` output """

View File

@ -33,7 +33,7 @@ class IBoMOptions(VariantOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Filename for the output, use '' to use the IBoM filename (%i=ibom, %x=html) """
""" *Filename for the output, use '' to use the IBoM filename (%i=ibom, %x=html) """
self.dark_mode = False
""" Default to dark mode """
self.hide_pads = False
@ -47,13 +47,13 @@ class IBoMOptions(VariantOptions):
self.no_redraw_on_drag = False
""" Do not redraw pcb on drag by default """
self.board_rotation = 0
""" Board rotation in degrees (-180 to 180). Will be rounded to multiple of 5 """
""" *Board rotation in degrees (-180 to 180). Will be rounded to multiple of 5 """
self.checkboxes = 'Sourced,Placed'
""" Comma separated list of checkbox columns """
self.bom_view = 'left-right'
""" [bom-only,left-right,top-bottom] Default BOM view """
""" *[bom-only,left-right,top-bottom] Default BOM view """
self.layer_view = 'FB'
""" [F,FB,B] Default layer view """
""" *[F,FB,B] Default layer view """
self.no_compression = False
""" Disable compression of pcb data """
self.name_format = 'ibom'
@ -68,7 +68,7 @@ class IBoMOptions(VariantOptions):
Extension .html will be added automatically.
Note that this name is used only when output is '' """
self.include_tracks = False
""" Include track/zone information in output. F.Cu and B.Cu layers only """
""" *Include track/zone information in output. F.Cu and B.Cu layers only """
self.include_nets = False
""" Include netlist information in output. """
self.sort_order = 'C,R,L,D,U,Y,X,F,SW,A,~,HS,CNN,J,P,NT,MH'
@ -79,16 +79,16 @@ class IBoMOptions(VariantOptions):
""" 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 """
self.extra_fields = ''
""" Comma separated list of extra fields to pull from netlist or xml file.
""" *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' """
self.show_fields = ''
""" Comma separated list of fields to show in the BOM.
""" *Comma separated list of fields to show in the BOM.
Value and Footprint are displayed when nothing is specified """
self.group_fields = ''
""" Comma separated list of fields that components will be grouped by.
Value and Footprint are used when nothing is specified """
self.normalize_field_case = False
""" Normalize extra field name case. E.g. 'MPN' and 'mpn' will be considered the same field """
""" *Normalize extra field name case. E.g. 'MPN' and 'mpn' will be considered the same field """
self.blacklist = ''
""" List of comma separated blacklisted components or prefixes with *. E.g. 'X1,MH*'.
IBoM option, avoid using in conjunction with KiBot variants/filters """
@ -218,7 +218,7 @@ class IBoM(BaseOutput): # noqa: F821
super().__init__()
with document:
self.options = IBoMOptions
""" [dict] Options for the `ibom` output """
""" *[dict] Options for the `ibom` output """
def get_dependencies(self):
return self.options.get_dependencies()

View File

@ -50,9 +50,9 @@ class KiBoMColumns(Optionable):
self._unkown_is_error = True
with document:
self.field = ''
""" Name of the field to use for this column """
""" *Name of the field to use for this column """
self.name = ''
""" Name to display in the header. The field is used when empty """
""" *Name to display in the header. The field is used when empty """
self.join = Optionable
""" [list(string)|string=''] List of fields to join to this column """
self._field_example = 'Row'
@ -94,13 +94,13 @@ class KiBoMConfig(Optionable):
super().__init__()
with document:
self.ignore_dnf = True
""" Exclude DNF (Do Not Fit) components """
""" *Exclude DNF (Do Not Fit) components """
self.html_generate_dnf = True
""" Generate a separated section for DNF (Do Not Fit) components (HTML only) """
self.use_alt = False
""" Print grouped references in the alternate compressed style eg: R1-R7,R18 """
self.number_rows = True
""" First column is the row number """
""" *First column is the row number """
self.group_connectors = True
""" Connectors with the same footprints will be grouped together, independent of the name of the connector """
self.test_regex = True
@ -108,7 +108,7 @@ class KiBoMConfig(Optionable):
self.merge_blank_fields = True
""" Component groups with blank fields will be merged into the most compatible group, where possible """
self.fit_field = 'Config'
""" Field name used to determine if a particular part is to be fitted (also DNC and variants) """
""" *Field name used to determine if a particular part is to be fitted (also DNC and variants) """
self.datasheet_as_link = ''
""" Column with links to the datasheet (HTML only) """
self.hide_headers = False
@ -120,7 +120,7 @@ class KiBoMConfig(Optionable):
self.digikey_link = Optionable
""" [string|list(string)=''] Column/s containing Digi-Key part numbers, will be linked to web page (HTML only) """
self.group_fields = GroupFields
""" [list(string)] List of fields used for sorting individual components into groups.
""" *[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 """
@ -162,7 +162,7 @@ class KiBoMConfig(Optionable):
- 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
@ -327,7 +327,7 @@ class KiBoMOptions(BaseOptions):
def __init__(self):
with document:
self.number = 1
""" Number of boards to build (components multiplier) """
""" *Number of boards to build (components multiplier) """
self.variant = ''
""" Board variant(s), used to determine which components
are output to the BoM. To specify multiple variants,
@ -340,9 +340,9 @@ class KiBoMOptions(BaseOptions):
self.separator = ','
""" CSV Separator """
self.output = GS.def_global_output
""" filename for the output (%i=bom)"""
""" *Filename for the output (%i=bom)"""
self.format = 'HTML'
""" [HTML,CSV,XML,XLSX] format for the BoM """
""" *[HTML,CSV,XML,XLSX] Format for the BoM """
super().__init__()
self._expand_id = 'bom'
@ -422,7 +422,7 @@ class KiBoM(BaseOutput): # noqa: F821
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):

View File

@ -31,11 +31,11 @@ class Aggregate(Optionable):
super().__init__()
with document:
self.file = ''
""" Name of the XML to aggregate """
""" *Name of the XML to aggregate """
self.variant = ' '
""" Variant for this project """
self.number = 100
""" Number of boards to build (components multiplier) """
""" *Number of boards to build (components multiplier) """
self.board_qty = None
""" {number} """
self._category = 'Schematic/BoM'
@ -50,19 +50,19 @@ class KiCostOptions(VariantOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Filename for the output (%i=kicost, %x=xlsx) """
""" *Filename for the output (%i=kicost, %x=xlsx) """
self.no_price = False
""" Do not look for components price. For testing purposes """
""" *Do not look for components price. For testing purposes """
self.no_collapse = False
""" Do not collapse the part references (collapse=R1-R4) """
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.
Parts with differences in these fields are grouped together, but displayed individually """
@ -79,7 +79,7 @@ class KiCostOptions(VariantOptions):
self.aggregate = Aggregate
""" [list(dict)] Add components from other projects """
self.number = 100
""" Number of boards to build (components multiplier) """
""" *Number of boards to build (components multiplier) """
self.board_qty = None
""" {number} """
@ -240,4 +240,4 @@ class KiCost(BaseOutput): # noqa: F821
self._sch_related = True
with document:
self.options = KiCostOptions
""" [dict] Options for the `kicost` output """
""" *[dict] Options for the `kicost` output """

View File

@ -155,9 +155,9 @@ class Navigate_ResultsOptions(BaseOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Filename for the output (%i=html, %x=navigate) """
""" *Filename for the output (%i=html, %x=navigate) """
self.link_from_root = ''
""" The name of a file to create at the main output directory linking to the home page """
""" *The name of a file to create at the main output directory linking to the home page """
super().__init__()
self._expand_id = 'navigate'
self._expand_ext = 'html'
@ -459,7 +459,7 @@ class Navigate_Results(BaseOutput): # noqa: F821
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()

View File

@ -21,9 +21,9 @@ class NetlistOptions(BaseOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Filename for the output (%i=netlist/IPC-D-356, %x=net/d356) """
""" *Filename for the output (%i=netlist/IPC-D-356, %x=net/d356) """
self.format = 'classic'
""" [classic,ipc] The `classic` format is the KiCad internal format, and is generated
""" *[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 """
super().__init__()
@ -84,7 +84,7 @@ class Netlist(BaseOutput): # noqa: F821
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, templates):

View File

@ -178,7 +178,7 @@ class PagesOptions(Optionable):
self.monochrome = False
""" Print in gray scale """
self.scaling = None
""" [number=1.0] Scale factor (0 means autoscaling)"""
""" *[number=1.0] Scale factor (0 means autoscaling)"""
self.title = ''
""" Text used to replace the sheet title. %VALUE expansions are allowed.
If it starts with `+` the text is concatenated """
@ -199,9 +199,9 @@ class PagesOptions(Optionable):
self.holes_color = '#000000'
""" Color used for the holes when `colored_holes` is enabled """
self.sort_layers = False
""" Try to sort the layers in the same order that uses KiCad for printing """
""" *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] List of layers printed in this page.
Order is important, the last goes on top """
self._scaling_example = 1.0
@ -234,17 +234,17 @@ class PCB_PrintOptions(VariantOptions):
self.output_name = None
""" {output} """
self.output = GS.def_global_output
""" Filename for the output (%i=assembly, %x=pdf)/(%i=assembly_page_NN, %x=svg)"""
""" *Filename for the output (%i=assembly, %x=pdf)/(%i=assembly_page_NN, %x=svg)"""
self.hide_excluded = False
""" Hide components in the Fab layer that are marked as excluded by a variant """
self._drill_marks = 'full'
""" What to use to indicate the drill places, can be none, small or full (for real scale) """
self.color_theme = '_builtin_classic'
""" Selects the color theme. Only applies to KiCad 6.
""" *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 """
self.plot_sheet_reference = True
""" Include the title-block (worksheet, frame, etc.) """
""" *Include the title-block (worksheet, frame, etc.) """
self.sheet_reference_layout = ''
""" Worksheet file (.kicad_wks) to use. Leave empty to use the one specified in the project """
self.frame_plot_mechanism = 'internal'
@ -257,13 +257,13 @@ class PCB_PrintOptions(VariantOptions):
plot: uses KiCad Python API. Only available for KiCad 6.
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.
If it starts with `+` the text is concatenated """
self.format = 'PDF'
""" [PDF,SVG,PNG,EPS,PS] Format for the output file/s.
""" *[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 """
self.png_width = 1280
""" Width of the PNG in pixels """
@ -282,9 +282,9 @@ class PCB_PrintOptions(VariantOptions):
self.keep_temporal_files = False
""" Store the temporal page and layer files in the output dir and don't delete them """
self.force_edge_cuts = False
""" Add the `Edge.Cuts` to all the pages """
""" *Add the `Edge.Cuts` to all the pages """
self.scaling = 1.0
""" Default scale factor (0 means autoscaling)"""
""" *Default scale factor (0 means autoscaling)"""
self.realistic_solder_mask = 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'.
@ -1007,7 +1007,7 @@ class PCB_Print(BaseOutput): # noqa: F821
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

View File

@ -37,21 +37,21 @@ class PcbDrawStyle(Optionable):
super().__init__()
with document:
self.copper = "#285e3a"
""" color for the copper zones (covered by solder mask) """
""" *Color for the copper zones (covered by solder mask) """
self.board = "#208b47"
""" color for the board without copper (covered by solder mask) """
""" *Color for the board without copper (covered by solder mask) """
self.silk = "#d5dce4"
""" color for the silk screen """
""" *Color for the silk screen """
self.pads = "#8b898c"
""" color for the exposed pads (metal finish) """
""" *Color for the exposed pads (metal finish) """
self.outline = "#000000"
""" color for the outline """
""" *Color for the outline """
self.clad = "#cabb3e"
""" color for the PCB core (not covered by solder mask) """
""" *Color for the PCB core (not covered by solder mask) """
self.vcut = "#bf2600"
""" color for the V-CUTS """
""" Color for the V-CUTS """
self.highlight_on_top = False
""" highlight over the component (not under) """
""" Highlight over the component (not under) """
self.highlight_style = "stroke:none;fill:#ff0000;opacity:0.5;"
""" SVG code for the highlight style """
self.highlight_padding = 1.5
@ -133,7 +133,7 @@ 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 """
""" *[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 """
self.placeholder = False
@ -143,13 +143,13 @@ class PcbDrawOptions(VariantOptions):
self.no_drillholes = False
""" Do not make holes transparent """
self.bottom = False
""" Render the bottom side of the board (default is top side) """
""" *Render the bottom side of the board (default is top side) """
self.mirror = False
""" Mirror the board """
""" *Mirror the board """
self.highlight = Optionable
""" [list(string)=[]] List of components to highlight """
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 """
self.vcuts = False
""" Render V-CUTS on the Cmts.User layer """
@ -158,9 +158,9 @@ class PcbDrawOptions(VariantOptions):
self.dpi = 300
""" [10,1200] Dots per inch (resolution) of the generated image """
self.format = 'svg'
""" [svg,png,jpg] Output format. Only used if no `output` is specified """
""" *[svg,png,jpg] Output format. Only used if no `output` is specified """
self.output = GS.def_global_output
""" Name for the generated file """
""" *Name for the generated file """
super().__init__()
def config(self, parent):
@ -336,7 +336,7 @@ class PcbDraw(BaseOutput): # noqa: F821
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):

View File

@ -53,5 +53,5 @@ class PDF(AnyLayer, DrillMarks):
super().__init__()
with document:
self.options = PDFOptions
""" [dict] Options for the `pdf` output """
""" *[dict] Options for the `pdf` output """
self._category = 'PCB/docs'

View File

@ -34,9 +34,9 @@ class PDF_PCB_Print(BaseOutput): # noqa: F821
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]
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user]
List of PCB layers to include in the PDF """
self._category = 'PCB/docs'

View File

@ -33,7 +33,7 @@ class PDF_SCH_Print(BaseOutput): # noqa: F821
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'

View File

@ -26,13 +26,13 @@ class FilesList(Optionable):
super().__init__()
with document:
self.source = '*.pdf'
""" File names to add, wildcards allowed. Use ** for recursive match.
""" *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 """
self.from_cwd = False
""" Use the current working directory instead of the dir specified by `-d` """
self.from_output = ''
""" Collect files from the selected output.
""" *Collect files from the selected output.
When used the `source` option is ignored """
self.filter = r'.*\.pdf'
""" A regular expression that source files must match """
@ -42,9 +42,9 @@ class PDFUniteOptions(BaseOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Name for the generated PDF (%i=name of the output %x=pdf) """
""" *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__()
@ -146,7 +146,7 @@ class PDFUnite(BaseOutput): # noqa: F821
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):

View File

@ -38,7 +38,7 @@ class PosColumns(Optionable):
self._unkown_is_error = True
with document:
self.id = ''
""" [Ref,Val,Package,PosX,PosY,Rot,Side] Internal name """
""" *[Ref,Val,Package,PosX,PosY,Rot,Side] Internal name """
self.name = ''
""" Name to use in the output file. The id is used when empty """
self._id_example = 'Ref'
@ -54,15 +54,15 @@ class PositionOptions(VariantOptions):
def __init__(self):
with document:
self.format = 'ASCII'
""" [ASCII,CSV] Format for the position file """
""" *[ASCII,CSV] Format for the position file """
self.separate_files_for_front_and_back = True
""" Generate two separated files, one for the top and another for the bottom """
""" *Generate two separated files, one for the top and another for the bottom """
self.only_smd = True
""" Only include the surface mount components """
""" *Only include the surface mount components """
self.output = GS.def_global_output
""" Output file name (%i='top_pos'|'bottom_pos'|'both_pos', %x='pos'|'csv') """
""" *Output file name (%i='top_pos'|'bottom_pos'|'both_pos', %x='pos'|'csv') """
self.units = 'millimeters'
""" [millimeters,inches,mils] Units used for the positions. Affected by global options """
""" *[millimeters,inches,mils] Units used for the positions. Affected by global options """
self.columns = PosColumns
""" [list(dict)|list(string)] Which columns are included in the output """
self.bottom_negative_x = False
@ -299,7 +299,7 @@ class Position(BaseOutput): # noqa: F821
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

View File

@ -26,7 +26,7 @@ class PSOptions(DrillMarks):
self.sketch_plot = False
""" Don't fill objects, just draw the outline """
self.scaling = 1
""" Scale factor (0 means autoscaling)"""
""" *Scale factor (0 means autoscaling)"""
self.scale_adjust_x = 1.0
""" Fine grain adjust for the X scale (floating point multiplier) """
self.scale_adjust_y = 1.0
@ -35,7 +35,7 @@ class PSOptions(DrillMarks):
""" 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 """
self.a4_output = True
""" force A4 paper size """
""" Force A4 paper size """
self._plot_format = PLOT_FORMAT_POST
def _configure_plot_ctrl(self, po, output_dir):
@ -84,5 +84,5 @@ class PS(AnyLayer):
super().__init__()
with document:
self.options = PSOptions
""" [dict] Options for the `ps` output """
""" *[dict] Options for the `ps` output """
self._category = 'PCB/docs'

View File

@ -71,19 +71,19 @@ class QRCodeOptions(Optionable):
super().__init__()
with document:
self.name = 'QR'
""" Name for the symbol/footprint """
""" *Name for the symbol/footprint """
self.text = '%p %r'
""" Text to encode as QR """
""" *Text to encode as QR """
self.correction_level = 'low'
""" [low,medium,quartile,high] Error correction level """
self.size_sch = 15
""" Size of the QR symbol """
""" *Size of the QR symbol """
self.size_pcb = 15
""" Size of the QR footprint """
""" *Size of the QR footprint """
self.size_units = 'millimeters'
""" [millimeters,inches] Units used for the size """
self.layer = 'silk'
""" [silk,copper] Layer for the footprint """
""" *[silk,copper] Layer for the footprint """
self.pcb_negative = False
""" Generate a negative image for the PCB """
self._unkown_is_error = True
@ -98,15 +98,15 @@ class QR_LibOptions(BaseOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Filename for the output (%i=qr, %x=lib) """
""" *Filename for the output (%i=qr, %x=lib) """
self.lib = 'QR'
""" Short name for the library """
""" *Short name for the library """
self.reference = 'QR'
""" The reference prefix """
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 """
""" *[list(dict)] QR codes to include in the library """
super().__init__()
self._expand_id = 'qr'
self._expand_ext = 'lib'

View File

@ -33,7 +33,7 @@ class Render3DOptions(Base3DOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Name for the generated image file (%i='3D_$VIEW' %x='png') """
""" *Name for the generated image file (%i='3D_$VIEW' %x='png') """
self.no_tht = False
""" Used to exclude 3D models for through hole components """
self.no_smd = False
@ -53,22 +53,22 @@ class Render3DOptions(Base3DOptions):
self.solder_paste = "#808080"
""" Color for the solder paste """
self.move_x = 0
""" Steps to move in the X axis, positive is to the right.
""" *Steps to move in the X axis, positive is to the right.
Just like pressing the right arrow in the 3D viewer """
self.move_y = 0
""" Steps to move in the Y axis, positive is up.
""" *Steps to move in the Y axis, positive is up.
Just like pressing the up arrow in the 3D viewer """
self.rotate_x = 0
""" Steps to rotate around the X axis, positive is clockwise.
""" *Steps to rotate around the X axis, positive is clockwise.
Each step is currently 10 degrees. Only for KiCad 6 """
self.rotate_y = 0
""" Steps to rotate around the Y axis, positive is clockwise.
""" *Steps to rotate around the Y axis, positive is clockwise.
Each step is currently 10 degrees. Only for KiCad 6 """
self.rotate_z = 0
""" Steps to rotate around the Z axis, positive is clockwise.
""" *Steps to rotate around the Z axis, positive is clockwise.
Each step is currently 10 degrees. Only for KiCad 6 """
self.ray_tracing = False
""" Enable the ray tracing. Much better result, but slow, and you'll need to adjust `wait_rt` """
""" *Enable the ray tracing. Much better result, but slow, and you'll need to adjust `wait_rt` """
self.wait_render = -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.
@ -77,9 +77,9 @@ class Render3DOptions(Base3DOptions):
self.wait_ray_tracing = None
""" {wait_render} """
self.view = 'top'
""" [top,bottom,front,rear,right,left,z,Z,y,Y,x,X] Point of view """
""" *[top,bottom,front,rear,right,left,z,Z,y,Y,x,X] Point of view """
self.zoom = 0
""" Zoom steps. Use positive to enlarge, get closer, and negative to reduce.
""" *Zoom steps. Use positive to enlarge, get closer, and negative to reduce.
Same result as using the mouse wheel in the 3D viewer """
self.width = 1280
""" Image width (aprox.) """
@ -202,7 +202,7 @@ class Render_3D(Base3D): # noqa: F821
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'
@staticmethod

View File

@ -161,16 +161,16 @@ class ReportOptions(BaseOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Output file name (%i='report', %x='txt') """
""" *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.
""" *Name for one of the internal templates (full, full_svg, simple) or a custom template file.
Note: when converting to PDF PanDoc can fail on some Unicode values (use `simple_ASCII`) """
self.convert_from = 'markdown'
""" Original format for the report conversion. Current templates are `markdown`. See `do_convert` """
self.convert_to = 'pdf'
""" Target format for the report conversion. See `do_convert` """
""" *Target format for the report conversion. See `do_convert` """
self.do_convert = False
""" Run `Pandoc` to convert the report. Note that Pandoc must be installed.
""" *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 """
@ -799,7 +799,7 @@ class Report(BaseOutput): # noqa: F821
super().__init__()
with document:
self.options = ReportOptions
""" [dict] Options for the `report` output """
""" *[dict] Options for the `report` output """
self._category = 'PCB/docs'
@staticmethod

View File

@ -31,7 +31,7 @@ class Sch_Variant(BaseOutput): # noqa: F821
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 run(self, output_dir):

View File

@ -27,13 +27,13 @@ class STEPOptions(Base3DOptions):
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.
""" *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
""" The minimum distance between points to treat them as separate ones (-1 is KiCad default: 0.01 mm) """
self.output = GS.def_global_output
""" Name for the generated STEP file (%i='3D' %x='step') """
""" *Name for the generated STEP file (%i='3D' %x='step') """
self.subst_models = True
""" Substitute STEP or IGS models with the same name in place of VRML models """
# Temporal dir used to store the downloaded files
@ -117,7 +117,7 @@ class STEP(Base3D):
super().__init__()
with document:
self.options = STEPOptions
""" [dict] Options for the `step` output """
""" *[dict] Options for the `step` output """
self._category = 'PCB/3D'
@staticmethod

View File

@ -50,5 +50,5 @@ class SVG(AnyLayer):
super().__init__()
with document:
self.options = SVGOptions
""" [dict] Options for the `svg` output """
""" *[dict] Options for the `svg` output """
self._category = 'PCB/docs'

View File

@ -20,7 +20,7 @@ class SVG_PCB_PrintOptions(Any_PCB_PrintOptions):
def __init__(self):
with document:
self.output = GS.def_global_output
""" Filename for the output SVG (%i=layers, %x=svg)"""
""" *Filename for the output SVG (%i=layers, %x=svg)"""
self.enable_ki6_page_fix = True
""" Enable workaround for KiCad 6 bug #11033 """
self.enable_ki5_page_fix = True
@ -48,9 +48,9 @@ class SVG_PCB_Print(BaseOutput): # noqa: F821
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]
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user]
List of PCB layers to include in the PDF """
self._category = 'PCB/docs'

View File

@ -33,7 +33,7 @@ class SVG_SCH_Print(BaseOutput): # noqa: F821
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'