Skip to content

Commit d3b48e8

Browse files
committed
[iBoM][Added] mark_when_checked option
Closes #881
1 parent e95e4c3 commit d3b48e8

8 files changed

Lines changed: 88 additions & 44 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77

8+
## [1.8.6] - UNRELEASED
9+
### Added
10+
- iBoM: `mark_when_checked` option (#881)
11+
12+
813
## [1.8.5] - 2025-11-26
914
### Added
1015
- CLI:

docs/samples/generic_plot.kibot.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,6 +1845,11 @@ outputs:
18451845
include_tracks: false
18461846
# [string='FB'] [F,FB,B] Default layer view
18471847
layer_view: 'FB'
1848+
# [string=''] Name of the checkbox column used to mark components when checked.
1849+
# When enabled components checked in this column will be displayed in green.
1850+
# Leave empty to disable it.
1851+
# Needs iBoM newer than 2.10.0.
1852+
mark_when_checked: ''
18481853
# [string='ibom'] Output file name format supports substitutions:
18491854
# %f : original pcb file name without extension.
18501855
# %p : pcb/project title from pcb metadata.

docs/source/Changelog.rst

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,19 @@ Changelog <https://keepachangelog.com/en/1.0.0/>`__, and this project
1313
adheres to `Semantic
1414
Versioning <https://semver.org/spec/v2.0.0.html>`__.
1515

16+
[1.8.6] - UNRELEASED
17+
--------------------
18+
19+
Added
20+
~~~~~
21+
22+
- iBoM: ``mark_when_checked`` option (#881)
23+
1624
[1.8.5] - 2025-11-26
1725
--------------------
1826

27+
.. _added-1:
28+
1929
Added
2030
~~~~~
2131

@@ -88,7 +98,7 @@ Changed
8898
[1.8.4] - 2025-04-03
8999
--------------------
90100

91-
.. _added-1:
101+
.. _added-2:
92102

93103
Added
94104
~~~~~
@@ -124,7 +134,7 @@ Fixed
124134
[1.8.3] - 2025-03-18
125135
--------------------
126136

127-
.. _added-2:
137+
.. _added-3:
128138

129139
Added
130140
~~~~~
@@ -338,7 +348,7 @@ Changed
338348
[1.8.2] - 2024-10-28
339349
--------------------
340350

341-
.. _added-3:
351+
.. _added-4:
342352

343353
Added
344354
~~~~~
@@ -439,7 +449,7 @@ Fixed
439449
[1.8.0] - 2024-09-17
440450
--------------------
441451

442-
.. _added-4:
452+
.. _added-5:
443453

444454
Added
445455
~~~~~
@@ -588,7 +598,7 @@ Changed:
588598
[1.7.0] - 2024-04-23
589599
--------------------
590600

591-
.. _added-5:
601+
.. _added-6:
592602

593603
Added
594604
~~~~~
@@ -693,7 +703,7 @@ Changed
693703
[1.6.5] - 2024-03-31
694704
--------------------
695705

696-
.. _added-6:
706+
.. _added-7:
697707

698708
Added
699709
~~~~~
@@ -753,7 +763,7 @@ Fixed
753763
[1.6.4] - 2024-02-02
754764
--------------------
755765

756-
.. _added-7:
766+
.. _added-8:
757767

758768
Added
759769
~~~~~
@@ -1034,7 +1044,7 @@ Fixed
10341044
[1.6.3] - 2023-06-26
10351045
--------------------
10361046

1037-
.. _added-8:
1047+
.. _added-9:
10381048

10391049
Added
10401050
~~~~~
@@ -1204,7 +1214,7 @@ Fixed
12041214
[1.6.2] - 2023-04-24
12051215
--------------------
12061216

1207-
.. _added-9:
1217+
.. _added-10:
12081218

12091219
Added
12101220
~~~~~
@@ -1322,7 +1332,7 @@ Changed:
13221332
[1.6.1] - 2023-03-16
13231333
--------------------
13241334

1325-
.. _added-10:
1335+
.. _added-11:
13261336

13271337
Added
13281338
~~~~~
@@ -1371,7 +1381,7 @@ Fixed
13711381
[1.6.0] - 2023-02-06
13721382
--------------------
13731383

1374-
.. _added-11:
1384+
.. _added-12:
13751385

13761386
Added
13771387
~~~~~
@@ -1502,7 +1512,7 @@ Fixed
15021512
[1.5.0] - 2022-12-16
15031513
--------------------
15041514

1505-
.. _added-12:
1515+
.. _added-13:
15061516

15071517
Added
15081518
~~~~~
@@ -1616,7 +1626,7 @@ Fixed
16161626
[1.4.0] - 2022-10-12
16171627
--------------------
16181628

1619-
.. _added-13:
1629+
.. _added-14:
16201630

16211631
Added
16221632
~~~~~
@@ -1734,7 +1744,7 @@ Changed
17341744
[1.3.0] - 2022-09-08
17351745
--------------------
17361746

1737-
.. _added-14:
1747+
.. _added-15:
17381748

17391749
Added
17401750
~~~~~
@@ -1834,7 +1844,7 @@ Changed
18341844
[1.2.0] - 2022-06-15
18351845
--------------------
18361846

1837-
.. _added-15:
1847+
.. _added-16:
18381848

18391849
Added
18401850
~~~~~
@@ -1893,7 +1903,7 @@ Changed
18931903
[1.1.0] - 2022-05-24
18941904
--------------------
18951905

1896-
.. _added-16:
1906+
.. _added-17:
18971907

18981908
Added
18991909
~~~~~
@@ -1924,7 +1934,7 @@ Fixed
19241934
[1.0.0] - 2022-05-10
19251935
--------------------
19261936

1927-
.. _added-17:
1937+
.. _added-18:
19281938

19291939
Added
19301940
~~~~~
@@ -2102,7 +2112,7 @@ Fixed
21022112
[0.11.0] - 2021-04-25
21032113
---------------------
21042114

2105-
.. _added-18:
2115+
.. _added-19:
21062116

21072117
Added
21082118
~~~~~
@@ -2158,7 +2168,7 @@ Fixed
21582168
[0.10.1] - 2021-02-22
21592169
---------------------
21602170

2161-
.. _added-19:
2171+
.. _added-20:
21622172

21632173
Added
21642174
~~~~~
@@ -2207,7 +2217,7 @@ Fixed
22072217
[0.10.0] - 2021-02-12
22082218
---------------------
22092219

2210-
.. _added-20:
2220+
.. _added-21:
22112221

22122222
Added
22132223
~~~~~
@@ -2270,7 +2280,7 @@ Fixed
22702280
[0.9.0] - 2021-01-04
22712281
--------------------
22722282

2273-
.. _added-21:
2283+
.. _added-22:
22742284

22752285
Added
22762286
~~~~~
@@ -2308,7 +2318,7 @@ Fixed
23082318
[0.8.1] - 2020-12-09
23092319
--------------------
23102320

2311-
.. _added-22:
2321+
.. _added-23:
23122322

23132323
Added
23142324
~~~~~
@@ -2329,7 +2339,7 @@ Fixed
23292339
[0.8.0] - 2020-11-06
23302340
--------------------
23312341

2332-
.. _added-23:
2342+
.. _added-24:
23332343

23342344
Added
23352345
~~~~~
@@ -2360,7 +2370,7 @@ Fixed
23602370
[0.7.0] - 2020-09-11
23612371
--------------------
23622372

2363-
.. _added-24:
2373+
.. _added-25:
23642374

23652375
Added
23662376
~~~~~
@@ -2424,7 +2434,7 @@ Fixed
24242434
[0.6.1] - 2020-08-20
24252435
--------------------
24262436

2427-
.. _added-25:
2437+
.. _added-26:
24282438

24292439
Added
24302440
~~~~~
@@ -2451,7 +2461,7 @@ Fixed
24512461
[0.6.0] - 2020-08-18
24522462
--------------------
24532463

2454-
.. _added-26:
2464+
.. _added-27:
24552465

24562466
Added
24572467
~~~~~
@@ -2519,7 +2529,7 @@ Changed
25192529
- Now we test the PCB and/or SCH only when we are doing something that
25202530
needs them.
25212531

2522-
.. _added-27:
2532+
.. _added-28:
25232533

25242534
Added
25252535
~~~~~
@@ -2588,7 +2598,7 @@ Fixed
25882598
[0.4.0] - 2020-06-17
25892599
--------------------
25902600

2591-
.. _added-28:
2601+
.. _added-29:
25922602

25932603
Added
25942604
~~~~~
@@ -2601,7 +2611,7 @@ Added
26012611
[0.3.0] - 2020-06-14
26022612
--------------------
26032613

2604-
.. _added-29:
2614+
.. _added-30:
26052615

26062616
Added
26072617
~~~~~
@@ -2630,7 +2640,7 @@ Fixed
26302640
[0.2.5] - 2020-06-11
26312641
--------------------
26322642

2633-
.. _added-30:
2643+
.. _added-31:
26342644

26352645
Added
26362646
~~~~~
@@ -2671,7 +2681,7 @@ Fixed
26712681
[0.2.3] - 2020-04-23
26722682
--------------------
26732683

2674-
.. _added-31:
2684+
.. _added-32:
26752685

26762686
Added
26772687
~~~~~
@@ -2709,7 +2719,7 @@ Fixed
27092719
[0.2.0] - 2020-03-28
27102720
--------------------
27112721

2712-
.. _added-32:
2722+
.. _added-33:
27132723

27142724
Added
27152725
~~~~~
@@ -2739,7 +2749,7 @@ Fixed
27392749
[0.1.1] - 2020-03-13
27402750
--------------------
27412751

2742-
.. _added-33:
2752+
.. _added-34:
27432753

27442754
Added
27452755
~~~~~

docs/source/configuration/outputs/IBoMOptions.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ IBoMOptions parameters
4848
- ``hide_silkscreen`` :index:`: <pair: output - ibom - options; hide_silkscreen>` [:ref:`boolean <boolean>`] (default: ``false``) Hide silkscreen by default.
4949
- ``highlight_pin1`` :index:`: <pair: output - ibom - options; highlight_pin1>` [:ref:`boolean <boolean>` | :ref:`string <string>`] (default: ``false``) (choices: "none", "all", "selected") Highlight pin1 by default.
5050
- ``include_nets`` :index:`: <pair: output - ibom - options; include_nets>` [:ref:`boolean <boolean>`] (default: ``false``) Include netlist information in output..
51+
- ``mark_when_checked`` :index:`: <pair: output - ibom - options; mark_when_checked>` [:ref:`string <string>`] (default: ``''``) Name of the checkbox column used to mark components when checked.
52+
When enabled components checked in this column will be displayed in green. |br|
53+
Leave empty to disable it. |br|
54+
Needs iBoM newer than 2.10.0. |br|.
5155
- ``name_format`` :index:`: <pair: output - ibom - options; name_format>` [:ref:`string <string>`] (default: ``'ibom'``) Output file name format supports substitutions:
5256
%f : original pcb file name without extension. |br|
5357
%p : pcb/project title from pcb metadata. |br|

kibot/misc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@
343343
W_MISSWRL = '(W174) '
344344
W_STACKUP = '(W175) '
345345
W_NOVISLA = '(W176) '
346+
W_IBOMNOCHK = '(W177) '
346347
# Somehow arbitrary, the colors are real, but can be different
347348
PCB_MAT_COLORS = {'fr1': "937042", 'fr2': "949d70", 'fr3': "adacb4", 'fr4': "332B16", 'fr5': "6cc290"}
348349
PCB_FINISH_COLORS = {'hal': "8b898c", 'hasl': "8b898c", 'imag': "8b898c", 'enig': "cfb96e", 'enepig': "cfb96e",

kibot/out_ibom.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
import os
2323
from subprocess import (check_output, STDOUT, CalledProcessError)
2424
from shutil import which, rmtree
25-
from .misc import BOM_ERROR, W_EXTNAME, W_NONETLIST
25+
from .error import KiPlotConfigurationError
26+
from .misc import BOM_ERROR, W_EXTNAME, W_NONETLIST, W_IBOMNOCHK
2627
from .gs import GS
2728
from .out_base import VariantOptions
2829
from .macros import macros, document, output_class # noqa: F401
@@ -55,6 +56,11 @@ def __init__(self):
5556
""" Offset the back of the pcb by 180 degrees """
5657
self.checkboxes = 'Sourced,Placed'
5758
""" Comma separated list of checkbox columns """
59+
self.mark_when_checked = ''
60+
""" Name of the checkbox column used to mark components when checked.
61+
When enabled components checked in this column will be displayed in green.
62+
Leave empty to disable it.
63+
Needs iBoM newer than 2.10.0. """
5864
self.bom_view = 'left-right'
5965
""" *[bom-only,left-right,top-bottom] Default BOM view """
6066
self.layer_view = 'FB'
@@ -146,6 +152,12 @@ def config(self, parent):
146152
self.extra_data_file = self.expand_filename('', self.extra_data_file, 'ibom', 'xml')
147153
if isinstance(self.highlight_pin1, bool):
148154
self.highlight_pin1 = 'all' if self.highlight_pin1 else 'none'
155+
checkboxes = self.checkboxes.split(',')
156+
if not checkboxes:
157+
logger.warning(W_IBOMNOCHK+"No checkbox columns provided for iBoM")
158+
elif self.mark_when_checked and self.mark_when_checked not in checkboxes:
159+
raise KiPlotConfigurationError(f"The `mark_when_checked` ({self.mark_when_checked}) isn't in "
160+
f"`checkboxes` ({checkboxes})")
149161

150162
def get_targets(self, out_dir):
151163
if self.output:

0 commit comments

Comments
 (0)