Skip to content

Commit

Permalink
Check for 'dnp' attribute introduced in kicad v7
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed May 5, 2023
1 parent 39a277f commit 48bcd79
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kibom/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ def getRef(self):
def isFitted(self):
""" Determine if a component is FITTED or not """

# First, check for the 'dnp' attribute (added in KiCad 7.0)
for child in self.element.getChildren():
if child.name == 'property':
if child.attributes.get('name', '').lower() == 'dnp':
return False

# Check the value field first
if self.getValue().lower() in DNF:
return False
Expand Down

0 comments on commit 48bcd79

Please sign in to comment.