Skip to content

Commit

Permalink
Support exclude attribute
Browse files Browse the repository at this point in the history
Support  "Exclude from BOM" and "Exclude from position files" attribute
  • Loading branch information
pcbway authored Sep 24, 2024
1 parent 3415337 commit f4e2fad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"versions": [
{
"version": "1.0.0",
"version": "1.0.1",
"status": "stable",
"kicad_version": "6.00"

Expand Down
35 changes: 21 additions & 14 deletions plugins/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ def get_components_file(self, temp_dir):
parsed_attrs = self.parse_attrs(f_attrs)

mount_type = 'smt' if parsed_attrs['smd'] else 'tht'
placed = not parsed_attrs['not_in_bom']
not_in_bom = parsed_attrs['not_in_bom']
not_in_pos = parsed_attrs['not_in_pos']

if not_in_bom and not_in_pos:
continue

rotation = f.GetOrientation().AsDegrees() if hasattr(f.GetOrientation(), 'AsDegrees') else f.GetOrientation() / 10.0

Expand All @@ -131,19 +135,22 @@ def get_components_file(self, temp_dir):
if not mpn:
mpn = ''

self.components.append({
'pos_x': pos_x,
'pos_y': pos_y,
'rotation': rotation,
'side': layer,
'designator': designator,
'mpn': mpn,
'pack': pack,
'footprint': footprint_name,
'value': value,
'mount_type': mount_type,
'place': placed
})
if not_in_pos == False:
self.components.append({
'pos_x': pos_x,
'pos_y': pos_y,
'rotation': rotation,
'side': layer,
'designator': designator,
'mpn': mpn,
'pack': pack,
'footprint': footprint_name,
'value': value,
'mount_type': mount_type,
})

if not_in_bom:
continue

fp_item_fields = {
'designator': designator,
Expand Down

0 comments on commit f4e2fad

Please sign in to comment.