diff --git a/CHANGELOG.md b/CHANGELOG.md index 0df490d9..c5beb746 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `_only_smd` used to get only SMD parts - `_only_tht` used to get only THT parts - `_only_virtual` used to get only virtual parts +- Variants: + - Support for multi-boards as defined by KiKit - Compress: - Option to use the output's `dir` as reference (`from_output_dir`) - iBoM: @@ -32,8 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - PCBWay: gerber, drill and compress - Plot related outputs and PCB_Print: - Added support for the KiCad 6 "sketch_pads_on_fab_layers" option. (#356) -- Variants: - - Support for multi-boards as defined by KiKit +- *SCH_Print: + - Added options to select the color theme and enable background color. (#362) - SVG: - Options to limit the view box to the used area. ### Fixed diff --git a/README.md b/README.md index 62adf2fd..877bd8e8 100644 --- a/README.md +++ b/README.md @@ -3597,9 +3597,11 @@ Notes: * Valid keys: - **`frame`**: [boolean=true] Include the frame and title block. - `all_pages`: [boolean=true] Generate with all hierarchical sheets. + - `background_color`: [boolean=false] Use the background color from the `color_theme` (KiCad 6). + - `color_theme`: [string='_builtin_default'] Color theme used, this must exist in the KiCad config (KiCad 6). - `dnf_filter`: [string|list(string)='_none'] Name of the filter to mark components as not fitted. A short-cut to use for simple cases where a variant is an overkill. - - `monochrome`: [boolean=false] Generate a monochromatic PDF. + - `monochrome`: [boolean=false] Generate a monochromatic output. - `output`: [string='%f-%i%I%v.%x'] Filename for the output PDF (%i=schematic, %x=pdf). Affected by global options. - `pre_transform`: [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. A short-cut to use for simple cases where a variant is an overkill. @@ -4328,9 +4330,11 @@ Notes: * Valid keys: - **`frame`**: [boolean=true] Include the frame and title block. - `all_pages`: [boolean=true] Generate with all hierarchical sheets. + - `background_color`: [boolean=false] Use the background color from the `color_theme` (KiCad 6). + - `color_theme`: [string='_builtin_default'] Color theme used, this must exist in the KiCad config (KiCad 6). - `dnf_filter`: [string|list(string)='_none'] Name of the filter to mark components as not fitted. A short-cut to use for simple cases where a variant is an overkill. - - `monochrome`: [boolean=false] Generate a monochromatic PDF. + - `monochrome`: [boolean=false] Generate a monochromatic output. - `output`: [string='%f-%i%I%v.%x'] Filename for the output SVG (%i=schematic, %x=svg). Affected by global options. - `pre_transform`: [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. A short-cut to use for simple cases where a variant is an overkill. diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index d2948e1f..ce7ce772 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -2313,12 +2313,16 @@ outputs: options: # [boolean=true] Generate with all hierarchical sheets all_pages: true + # [boolean=false] Use the background color from the `color_theme` (KiCad 6) + background_color: false + # [string='_builtin_default'] Color theme used, this must exist in the KiCad config (KiCad 6) + color_theme: '_builtin_default' # [string|list(string)='_none'] 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: '_none' # [boolean=true] Include the frame and title block frame: true - # [boolean=false] Generate a monochromatic PDF + # [boolean=false] Generate a monochromatic output monochrome: false # [string='%f-%i%I%v.%x'] Filename for the output PDF (%i=schematic, %x=pdf). Affected by global options output: '%f-%i%I%v.%x' @@ -2992,12 +2996,16 @@ outputs: options: # [boolean=true] Generate with all hierarchical sheets all_pages: true + # [boolean=false] Use the background color from the `color_theme` (KiCad 6) + background_color: false + # [string='_builtin_default'] Color theme used, this must exist in the KiCad config (KiCad 6) + color_theme: '_builtin_default' # [string|list(string)='_none'] 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: '_none' # [boolean=true] Include the frame and title block frame: true - # [boolean=false] Generate a monochromatic PDF + # [boolean=false] Generate a monochromatic output monochrome: false # [string='%f-%i%I%v.%x'] Filename for the output SVG (%i=schematic, %x=svg). Affected by global options output: '%f-%i%I%v.%x' diff --git a/kibot/out_any_sch_print.py b/kibot/out_any_sch_print.py index b7f78869..2fccf144 100644 --- a/kibot/out_any_sch_print.py +++ b/kibot/out_any_sch_print.py @@ -33,11 +33,15 @@ class Any_SCH_PrintOptions(VariantOptions): def __init__(self): with document: self.monochrome = False - """ Generate a monochromatic PDF """ + """ Generate a monochromatic output """ self.frame = True """ *Include the frame and title block """ self.all_pages = True """ Generate with all hierarchical sheets """ + self.color_theme = '' + """ Color theme used, this must exist in the KiCad config (KiCad 6) """ + self.background_color = False + """ Use the background color from the `color_theme` (KiCad 6) """ super().__init__() self.add_to_doc('variant', "Not fitted components are crossed") self._expand_id = 'schematic' @@ -66,5 +70,9 @@ class Any_SCH_PrintOptions(VariantOptions): cmd.append('--no_frame') if self.all_pages: cmd.append('--all_pages') + if self.color_theme: + cmd.extend(['--color_theme', self.color_theme]) + if self.background_color: + cmd.append('--background_color') cmd.extend([sch_file, os.path.dirname(name)]) self.exec_with_retry(self.add_extra_options(cmd), self._exit_error) diff --git a/kibot/out_pdf_sch_print.py b/kibot/out_pdf_sch_print.py index 7e588e39..2baa1fc8 100644 --- a/kibot/out_pdf_sch_print.py +++ b/kibot/out_pdf_sch_print.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2022 Salvador E. Tropea -# Copyright (c) 2020-2022 Instituto Nacional de Tecnología Industrial +# Copyright (c) 2020-2023 Salvador E. Tropea +# Copyright (c) 2020-2023 Instituto Nacional de Tecnología Industrial # License: GPL-3.0 # Project: KiBot (formerly KiPlot) """ @@ -8,7 +8,7 @@ Dependencies: - from: KiAuto role: mandatory command: eeschema_do - version: 2.0.0 + version: 2.1.1 """ from .gs import GS from .out_any_sch_print import Any_SCH_PrintOptions diff --git a/kibot/out_svg_sch_print.py b/kibot/out_svg_sch_print.py index af935d95..02fa0561 100644 --- a/kibot/out_svg_sch_print.py +++ b/kibot/out_svg_sch_print.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2022 Salvador E. Tropea -# Copyright (c) 2020-2022 Instituto Nacional de Tecnología Industrial +# Copyright (c) 2020-2023 Salvador E. Tropea +# Copyright (c) 2020-2023 Instituto Nacional de Tecnología Industrial # Copyright (c) 2020 @nerdyscout # License: GPL-3.0 # Project: KiBot (formerly KiPlot) @@ -9,7 +9,7 @@ Dependencies: - from: KiAuto role: mandatory command: eeschema_do - version: 2.0.0 + version: 2.1.1 """ from .gs import GS from .out_any_sch_print import Any_SCH_PrintOptions