Skip to content

Commit

Permalink
Merge pull request #184 from SchrodingersGat/observe-dnf
Browse files Browse the repository at this point in the history
Check for 'dnp' attribute introduced in kicad v7
  • Loading branch information
SchrodingersGat authored May 7, 2023
2 parents 148728a + 48bcd79 commit 3ddd175
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 3ddd175

Please sign in to comment.