[Diff] Added option to skip pages with no diffs

This commit is contained in:
Salvador E. Tropea 2022-10-05 11:30:00 -03:00
parent fcc7575f99
commit 86a9c25949
6 changed files with 16 additions and 5 deletions

View File

@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Mechanism to compare using a variant (See #278)
- Mechanism to specify the current PCB/Schematic in memory (See #295)
- Mechanism to compare with the last Nth tag (See #312)
- Option to skip pages with no differences
- Sch Variant:
- Option to copy the project. Needed for text variables.
- Option to change the title (similar to PCB Variant)

View File

@ -13,7 +13,7 @@
- The GitHub actions with KiCad 6 support are tagged as `v2_k6` (stable) and `v2_dk6` (development).
Consult: [Github Actions tags](#github-actions-tags)
**Important note about PcbDraw 1.0.0
**Important note about PcbDraw 1.0.0**
- This release is incompatible with 0.9.0, I'm trying to fix some issues in the upstream package.
**New on v1.3.0**
@ -150,7 +150,7 @@ Notes:
[**KiBoM**](https://github.com/INTI-CMNB/KiBoM) v1.8.0 [![Tool](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/llave-inglesa-22x22.png)](https://github.com/INTI-CMNB/KiBoM) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png)
- Mandatory for `kibom`
[**KiCad PCB/SCH Diff**](https://github.com/INTI-CMNB/KiDiff) v2.4.1 [![Tool](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/llave-inglesa-22x22.png)](https://github.com/INTI-CMNB/KiDiff) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png)
[**KiCad PCB/SCH Diff**](https://github.com/INTI-CMNB/KiDiff) v2.4.2 [![Tool](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/llave-inglesa-22x22.png)](https://github.com/INTI-CMNB/KiDiff) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png)
- Mandatory for `diff`
[**LXML**](https://pypi.org/project/LXML/) [![Python module](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/Python-logo-notext-22x22.png)](https://pypi.org/project/LXML/) [![Debian](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/debian-openlogo-22x22.png)](https://packages.debian.org/bullseye/python3-lxml) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png)
@ -1737,6 +1737,8 @@ Notes:
- `old_type`: [string='git'] [git,file,output,multivar] How to interpret the `old` name. Use `git` for a git hash, branch, etc.
Use `file` for a file name. Use `output` to specify the name of a `pcb_variant`/`sch_variant` output.
Use `multivar` to specify a reference file when `new_type` is also `multivar`.
- `only_different`: [boolean=false] Only include the pages with differences in the output PDF.
Note that when no differeces are found we get a page saying *No diff*.
- `pcb`: [boolean=true] Compare the PCB, otherwise compare the schematic.
- `threshold`: [number=0] [0,1000000] Error threshold for the `stats` mode, 0 is no error. When specified a
difference bigger than the indicated value will make the diff fail.

View File

@ -13,7 +13,7 @@
- The GitHub actions with KiCad 6 support are tagged as `v2_k6` (stable) and `v2_dk6` (development).
Consult: [Github Actions tags](#github-actions-tags)
**Important note about PcbDraw 1.0.0
**Important note about PcbDraw 1.0.0**
- This release is incompatible with 0.9.0, I'm trying to fix some issues in the upstream package.
**New on v1.3.0**

View File

@ -524,6 +524,9 @@ outputs:
# Use `file` for a file name. Use `output` to specify the name of a `pcb_variant`/`sch_variant` output.
# Use `multivar` to specify a reference file when `new_type` is also `multivar`
old_type: 'git'
# [boolean=false] Only include the pages with differences in the output PDF.
# Note that when no differeces are found we get a page saying *No diff*
only_different: false
# [string='%f-%i%I%v.%x'] Filename for the output (%i=diff_pcb/diff_sch, %x=pdf). Affected by global options
output: '%f-%i%I%v.%x'
# [boolean=true] Compare the PCB, otherwise compare the schematic

View File

@ -6,7 +6,7 @@
"""
Dependencies:
- name: KiCad PCB/SCH Diff
version: 2.4.1
version: 2.4.2
role: mandatory
github: INTI-CMNB/KiDiff
command: kicad-diff.py
@ -99,6 +99,9 @@ class DiffOptions(BaseOptions):
self.use_file_id = False
""" When creating the link name of an output file related to a variant use the variant
`file_id` instead of its name """
self.only_different = False
""" Only include the pages with differences in the output PDF.
Note that when no differeces are found we get a page saying *No diff* """
super().__init__()
self._expand_id = 'diff'
self._expand_ext = 'pdf'
@ -403,6 +406,8 @@ class DiffOptions(BaseOptions):
cmd.extend(['--layers', self.incl_file])
if self.threshold:
cmd.extend(['--threshold', str(self.threshold)])
if self.only_different:
cmd.append('--only_different')
cmd.extend([self.file_exist, self.file_exist])
if GS.debug_enabled:
cmd.insert(1, '-'+'v'*GS.debug_level)

View File

@ -485,7 +485,7 @@ deps = '{\
"version": [\
2,\
4,\
1\
2\
]\
}\
],\