Skip to content

Commit

Permalink
Исключать компоненты с атрибутом 'Exclude from bill of materials'.
Browse files Browse the repository at this point in the history
  • Loading branch information
baranovskiykonstantin committed Jun 11, 2022
1 parent e839ef0 commit b7be793
Show file tree
Hide file tree
Showing 14 changed files with 442 additions and 399 deletions.
113 changes: 57 additions & 56 deletions bom/Scripts/python/doc/help.html

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion bom/Scripts/python/pythonpath/schematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ def __init__(self, netlistName):
for comp in netlist.items("comp"):
component = Component(self)
component.reference = comp.attributes["ref"]
skip = False
for item in comp.items:
if item.name == "value":
component.value = item.text if item.text is not None and item.text != "~" else ""
Expand All @@ -716,7 +717,12 @@ def __init__(self, netlistName):
for field in item.items:
fieldName = field.attributes["name"]
component.fields[fieldName] = field.text if field.text is not None and field.text != "~" else ""
self.components.append(component)
elif item.name == "property":
if item.attributes["name"] == "exclude_from_bom":
skip = True
break
if not skip:
self.components.append(component)

def getGroupedComponents(self):
"""Вернуть компоненты, сгруппированные по типу."""
Expand Down
113 changes: 57 additions & 56 deletions gbom/Scripts/python/doc/help.html

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion gbom/Scripts/python/pythonpath/schematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ def __init__(self, netlistName):
for comp in netlist.items("comp"):
component = Component(self)
component.reference = comp.attributes["ref"]
skip = False
for item in comp.items:
if item.name == "value":
component.value = item.text if item.text is not None and item.text != "~" else ""
Expand All @@ -716,7 +717,12 @@ def __init__(self, netlistName):
for field in item.items:
fieldName = field.attributes["name"]
component.fields[fieldName] = field.text if field.text is not None and field.text != "~" else ""
self.components.append(component)
elif item.name == "property":
if item.attributes["name"] == "exclude_from_bom":
skip = True
break
if not skip:
self.components.append(component)

def getGroupedComponents(self):
"""Вернуть компоненты, сгруппированные по типу."""
Expand Down
113 changes: 57 additions & 56 deletions gspec/Scripts/python/doc/help.html

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion gspec/Scripts/python/pythonpath/schematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ def __init__(self, netlistName):
for comp in netlist.items("comp"):
component = Component(self)
component.reference = comp.attributes["ref"]
skip = False
for item in comp.items:
if item.name == "value":
component.value = item.text if item.text is not None and item.text != "~" else ""
Expand All @@ -822,7 +823,12 @@ def __init__(self, netlistName):
for field in item.items:
fieldName = field.attributes["name"]
component.fields[fieldName] = field.text if field.text is not None and field.text != "~" else ""
self.components.append(component)
elif item.name == "property":
if item.attributes["name"] == "exclude_from_bom":
skip = True
break
if not skip:
self.components.append(component)

def getGroupedComponents(self):
"""Вернуть компоненты, сгруппированные по типу."""
Expand Down
113 changes: 57 additions & 56 deletions index/Scripts/python/doc/help.html

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion index/Scripts/python/pythonpath/schematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ def __init__(self, netlistName):
for comp in netlist.items("comp"):
component = Component(self)
component.reference = comp.attributes["ref"]
skip = False
for item in comp.items:
if item.name == "value":
component.value = item.text if item.text is not None and item.text != "~" else ""
Expand All @@ -712,7 +713,12 @@ def __init__(self, netlistName):
for field in item.items:
fieldName = field.attributes["name"]
component.fields[fieldName] = field.text if field.text is not None and field.text != "~" else ""
self.components.append(component)
elif item.name == "property":
if item.attributes["name"] == "exclude_from_bom":
skip = True
break
if not skip:
self.components.append(component)

def getGroupedComponents(self):
"""Вернуть компоненты, сгруппированные по обозначению и типу."""
Expand Down
Loading

0 comments on commit b7be793

Please sign in to comment.