diff --git a/CHANGELOG.md b/CHANGELOG.md index 196cecf0..2ba53640 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 96ba2af7..1e878b88 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -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. @@ -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: diff --git a/docs/source/configuration/outputs/ExcellonOptions.rst b/docs/source/configuration/outputs/ExcellonOptions.rst index 12478d2f..6481621c 100644 --- a/docs/source/configuration/outputs/ExcellonOptions.rst +++ b/docs/source/configuration/outputs/ExcellonOptions.rst @@ -4,7 +4,6 @@ ExcellonOptions parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~ -- **generate_drill_files** :index:`: ` [:ref:`boolean `] (default: ``true``) Generate drill files. Set to False and choose map format if only map is to be generated. - **metric_units** :index:`: ` [:ref:`boolean `] (default: ``true``) Use metric units instead of inches. - **mirror_y_axis** :index:`: ` [:ref:`boolean `] (default: ``false``) Invert the Y axis. - **output** :index:`: ` [:ref:`string `] (default: ``'%f-%i%I%v.%x'``) name for the drill file, KiCad defaults if empty (%i='PTH_drill'). Affected by global options. @@ -12,6 +11,7 @@ ExcellonOptions parameters - ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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:`: ` [:ref:`boolean `] (default: ``true``) Generate drill files. Set to False and choose map format if only map is to be generated. - ``left_digits`` :index:`: ` [:ref:`number `] (default: ``0``) number of digits for integer part of coordinates (0 is auto). - ``map`` :index:`: ` [:ref:`DrillMap parameters `] [:ref:`dict ` | :ref:`string `] (default: ``'None'``) (choices: "hpgl", "ps", "gerber", "dxf", "svg", "pdf", "None") Format for a graphical drill map. Not generated unless a format is specified. diff --git a/docs/source/configuration/outputs/Gerb_DrillOptions.rst b/docs/source/configuration/outputs/Gerb_DrillOptions.rst index b1f9eff5..b3979291 100644 --- a/docs/source/configuration/outputs/Gerb_DrillOptions.rst +++ b/docs/source/configuration/outputs/Gerb_DrillOptions.rst @@ -5,10 +5,10 @@ Gerb_DrillOptions parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - **output** :index:`: ` [:ref:`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:`: ` [:ref:`boolean `] (default: ``true``) Generate drill files. Set to False and choose map format if only map is to be generated. - ``dnf_filter`` :index:`: ` [:ref:`string ` | :ref:`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:`: ` [:ref:`boolean `] (default: ``true``) Generate drill files. Set to False and choose map format if only map is to be generated. - ``map`` :index:`: ` [:ref:`DrillMap parameters `] [:ref:`dict ` | :ref:`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:`: ` [:ref:`string `] Force this replacement for %i when generating NPTH files. diff --git a/kibot/misc.py b/kibot/misc.py index 9aa74e50..a5b31013 100644 --- a/kibot/misc.py +++ b/kibot/misc.py @@ -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", diff --git a/kibot/out_any_drill.py b/kibot/out_any_drill.py index 86391f2b..e824eb4a 100644 --- a/kibot/out_any_drill.py +++ b/kibot/out_any_drill.py @@ -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 @@ -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 @@ -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) diff --git a/kibot/out_excellon.py b/kibot/out_excellon.py index 22891632..117bbaca 100644 --- a/kibot/out_excellon.py +++ b/kibot/out_excellon.py @@ -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 diff --git a/tests/GUI/outputs b/tests/GUI/outputs index f98df065..a0913b96 100644 --- a/tests/GUI/outputs +++ b/tests/GUI/outputs @@ -3101,6 +3101,13 @@ "DataTypeDict" ], [ + [ + "generate_drill_files", + [ + "DataTypeBoolean" + ], + null + ], [ "use_aux_axis_as_origin", [ @@ -3484,6 +3491,13 @@ "DataTypeDict" ], [ + [ + "generate_drill_files", + [ + "DataTypeBoolean" + ], + null + ], [ "use_aux_axis_as_origin", [ diff --git a/tests/GUI/stats b/tests/GUI/stats index 596407da..a3f4f566 100644 --- a/tests/GUI/stats +++ b/tests/GUI/stats @@ -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 @@ -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 @@ -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 @@ -138,7 +138,7 @@ Outputs sorted by depth: -------------------------------------------------------------------------------- 14 different data types - String: 844 -- Boolean: 473 +- Boolean: 475 - Number: 266 - ListStringSingular: 224 - Choice: 95 @@ -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 @@ -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 @@ -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 @@ -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 @@ -606,7 +606,7 @@ Totals sorted by depth: -------------------------------------------------------------------------------- 14 different data types - String: 995 -- Boolean: 571 +- Boolean: 573 - Number: 314 - ListStringSingular: 253 - Choice: 127 @@ -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