Skip to content

Commit

Permalink
[DOCs][Drill] Updated
Browse files Browse the repository at this point in the history
- Also added a warning when generating nothing
- Also removed redundant option in excellon (from any)
  • Loading branch information
set-soft committed Nov 14, 2024
1 parent bc67b2f commit 3d32845
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
ranges
- `use_ref_ranges` alias for `use_alt`
- New *kicad* format to mimic KiCad's internal BoM.
- Drill:
- Option to don't generate the drill files, so you can generate only the maps
(#720)
- PCB Print: a mechanism to filter components for a particular layer (#706)
- SCH Variant and *SCH Print:
- A mechanism to paste images from outputs (#714)
Expand Down
4 changes: 4 additions & 0 deletions docs/samples/generic_plot.kibot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,8 @@ outputs:
# [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=true] Generate drill files. Set to False and choose map format if only map is to be generated
generate_drill_files: true
# [number=0] number of digits for integer part of coordinates (0 is auto)
left_digits: 0
# [dict|string='None'] [hpgl,ps,gerber,dxf,svg,pdf,None] Format for a graphical drill map.
Expand Down Expand Up @@ -1249,6 +1251,8 @@ outputs:
# [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=true] Generate drill files. Set to False and choose map format if only map is to be generated
generate_drill_files: true
# [dict|string='None'] [hpgl,ps,gerber,dxf,svg,pdf,None] Format for a graphical drill map.
# Not generated unless a format is specified
map:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/configuration/outputs/ExcellonOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
ExcellonOptions parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~

- **generate_drill_files** :index:`: <pair: output - excellon - options; generate_drill_files>` [:ref:`boolean <boolean>`] (default: ``true``) Generate drill files. Set to False and choose map format if only map is to be generated.
- **metric_units** :index:`: <pair: output - excellon - options; metric_units>` [:ref:`boolean <boolean>`] (default: ``true``) Use metric units instead of inches.
- **mirror_y_axis** :index:`: <pair: output - excellon - options; mirror_y_axis>` [:ref:`boolean <boolean>`] (default: ``false``) Invert the Y axis.
- **output** :index:`: <pair: output - excellon - options; output>` [:ref:`string <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:`: <pair: output - excellon - options; pth_and_npth_single_file>` [:ref:`boolean <boolean>`] (default: ``true``) Generate one file for both, plated holes and non-plated holes, instead of two separated files.
- ``dnf_filter`` :index:`: <pair: output - excellon - options; dnf_filter>` [:ref:`string <string>` | :ref:`list(string) <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.

- ``generate_drill_files`` :index:`: <pair: output - excellon - options; generate_drill_files>` [:ref:`boolean <boolean>`] (default: ``true``) Generate drill files. Set to False and choose map format if only map is to be generated.
- ``left_digits`` :index:`: <pair: output - excellon - options; left_digits>` [:ref:`number <number>`] (default: ``0``) number of digits for integer part of coordinates (0 is auto).
- ``map`` :index:`: <pair: output - excellon - options; map>` [:ref:`DrillMap parameters <DrillMap>`] [:ref:`dict <dict>` | :ref:`string <string>`] (default: ``'None'``) (choices: "hpgl", "ps", "gerber", "dxf", "svg", "pdf", "None") Format for a graphical drill map.
Not generated unless a format is specified.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/configuration/outputs/Gerb_DrillOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Gerb_DrillOptions parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- **output** :index:`: <pair: output - gerb_drill - options; output>` [:ref:`string <string>`] (default: ``'%f-%i%I%v.%x'``) name for the drill file, KiCad defaults if empty (%i='PTH_drill'). Affected by global options.
- **generate_drill_files** :index:`: <pair: output - gerb_drill - options; generate_drill_files>` [:ref:`boolean <boolean>`] (default: ``true``) Generate drill files. Set to False and choose map format if only map is to be generated.
- ``dnf_filter`` :index:`: <pair: output - gerb_drill - options; dnf_filter>` [:ref:`string <string>` | :ref:`list(string) <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.

- ``generate_drill_files`` :index:`: <pair: output - gerb_drill - options; generate_drill_files>` [:ref:`boolean <boolean>`] (default: ``true``) Generate drill files. Set to False and choose map format if only map is to be generated.
- ``map`` :index:`: <pair: output - gerb_drill - options; map>` [:ref:`DrillMap parameters <DrillMap>`] [:ref:`dict <dict>` | :ref:`string <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:`: <pair: output - gerb_drill - options; npth_id>` [:ref:`string <string>`] Force this replacement for %i when generating NPTH files.
Expand Down
1 change: 1 addition & 0 deletions kibot/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@
W_NOVIAS = '(W167) '
W_NOMATCHGRP = '(W168) '
W_NOBOMOPS = '(W169) '
W_NODRILL = '(W170) '
# 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",
Expand Down
9 changes: 6 additions & 3 deletions kibot/out_any_drill.py
Original file line number Diff line number Diff line change
@@ -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)
import os
import re
Expand All @@ -11,6 +11,7 @@
from .out_base import VariantOptions
from .gs import GS
from .layer import Layer
from .misc import W_NODRILL
from .macros import macros, document # noqa: F401
from . import log

Expand Down Expand Up @@ -176,6 +177,8 @@ def run(self, output_dir):
if gen_map:
drill_writer.SetMapFileFormat(self._map)
logger.debug("Generating drill map type {} in {}".format(self._map, output_dir))
if not self.generate_drill_files and not gen_map and not self._report:
logger.warning(W_NODRILL+f"Not generating drill files nor drill maps nor report on `{self._parent.name}`")
drill_writer.CreateDrillandMapFilesSet(output_dir, self.generate_drill_files, gen_map)
# Rename the files
files = self.get_file_names(output_dir)
Expand Down
2 changes: 0 additions & 2 deletions kibot/out_excellon.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class ExcellonOptions(AnyDrill):
def __init__(self):
super().__init__()
with document:
self.generate_drill_files = True
""" Generate drill files. Set to False and choose map format if only map is to be generated """
self.metric_units = True
""" *Use metric units instead of inches """
self.pth_and_npth_single_file = True
Expand Down
14 changes: 14 additions & 0 deletions tests/GUI/outputs
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,13 @@
"DataTypeDict"
],
[
[
"generate_drill_files",
[
"DataTypeBoolean"
],
null
],
[
"use_aux_axis_as_origin",
[
Expand Down Expand Up @@ -3484,6 +3491,13 @@
"DataTypeDict"
],
[
[
"generate_drill_files",
[
"DataTypeBoolean"
],
null
],
[
"use_aux_axis_as_origin",
[
Expand Down
24 changes: 12 additions & 12 deletions tests/GUI/stats
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
48 outputs types with a total of 1881 different parameters
Single type parameters: 1707 (91 %)
48 outputs types with a total of 1883 different parameters
Single type parameters: 1709 (91 %)
Multi type parameters: 174 (9 %)
Average parameters: 39
Maximum number of parameters: 214
Expand Down Expand Up @@ -43,8 +43,8 @@ Outputs sorted by parameters:
- pdf_sch_print: 23
- ps_sch_print: 23
- svg_sch_print: 23
- gerb_drill: 24
- compress: 25
- gerb_drill: 25
- hpgl_sch_print: 25
- kiri: 25
- qr_lib: 25
Expand All @@ -57,9 +57,9 @@ Outputs sorted by parameters:
- position: 29
- pcb2blender_tools: 30
- pdf_pcb_print: 30
- excellon: 32
- svg_pcb_print: 32
- vrml: 32
- excellon: 33
- kicost: 36
- diff: 39
- dxf: 42
Expand Down Expand Up @@ -138,7 +138,7 @@ Outputs sorted by depth:
--------------------------------------------------------------------------------
14 different data types
- String: 844
- Boolean: 473
- Boolean: 475
- Number: 266
- ListStringSingular: 224
- Choice: 95
Expand All @@ -154,7 +154,7 @@ Outputs sorted by depth:
--------------------------------------------------------------------------------
Used as single data type:
- String: 690
- Boolean: 417
- Boolean: 419
- ListStringSingular: 221
- Number: 172
- Choice: 92
Expand Down Expand Up @@ -390,8 +390,8 @@ Used as single data type:
- Number,String: 15
================================================================================
================================================================================
86 totals types with a total of 2249 different parameters
Single type parameters: 2051 (91 %)
86 totals types with a total of 2251 different parameters
Single type parameters: 2053 (91 %)
Multi type parameters: 198 (9 %)
Average parameters: 26
Maximum number of parameters: 214
Expand Down Expand Up @@ -470,10 +470,10 @@ Totals sorted by parameters:
- ps_sch_print: 23
- svg_sch_print: 23
- kibom: 23
- gerb_drill: 24
- ibom: 24
- kicost: 24
- compress: 25
- gerb_drill: 25
- hpgl_sch_print: 25
- kiri: 25
- qr_lib: 25
Expand All @@ -486,9 +486,9 @@ Totals sorted by parameters:
- position: 29
- pcb2blender_tools: 30
- pdf_pcb_print: 30
- excellon: 32
- svg_pcb_print: 32
- vrml: 32
- excellon: 33
- generic: 34
- kicost: 36
- diff: 39
Expand Down Expand Up @@ -606,7 +606,7 @@ Totals sorted by depth:
--------------------------------------------------------------------------------
14 different data types
- String: 995
- Boolean: 571
- Boolean: 573
- Number: 314
- ListStringSingular: 253
- Choice: 127
Expand All @@ -622,7 +622,7 @@ Totals sorted by depth:
--------------------------------------------------------------------------------
Used as single data type:
- String: 825
- Boolean: 507
- Boolean: 509
- ListStringSingular: 250
- Number: 205
- Choice: 124
Expand Down

0 comments on commit 3d32845

Please sign in to comment.