Change 'gender' to 'subtype' for more flexibility
This commit is contained in:
parent
567e65f062
commit
a43d7701f4
@ -1,11 +1,11 @@
|
||||
connectors:
|
||||
X1:
|
||||
type: D-Sub
|
||||
gender: female
|
||||
subtype: female
|
||||
pinout: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI]
|
||||
X2:
|
||||
type: Molex KK 254
|
||||
gender: female
|
||||
subtype: female
|
||||
pinout: [GND, RX, TX]
|
||||
|
||||
cables:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
templates: # defining templates to be used later on
|
||||
- &molex_f
|
||||
type: Molex KK 254
|
||||
gender: female
|
||||
subtype: female
|
||||
- &con_i2c
|
||||
pinout: [GND, +5V, SCL, SDA]
|
||||
- &wire_i2c
|
||||
@ -24,7 +24,7 @@ connectors:
|
||||
pinout: [GND, +12V, MISO, MOSI, SCK]
|
||||
X5:
|
||||
type: Molex Micro-Fit
|
||||
gender: male
|
||||
subtype: male
|
||||
pinout: [GND, +12V]
|
||||
|
||||
cables:
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
connectors:
|
||||
X1:
|
||||
type: Molex KK 254 # more information
|
||||
gender: female
|
||||
subtype: female
|
||||
pinout: [GND, VCC, RX, TX] # pincount is implicit in pinout
|
||||
X2:
|
||||
type: Molex KK 254
|
||||
gender: female
|
||||
subtype: female
|
||||
pinout: [GND, VCC, RX, TX]
|
||||
|
||||
cables:
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
connectors:
|
||||
X1: &boo
|
||||
type: Molex Micro-Fit
|
||||
gender: male
|
||||
subtype: male
|
||||
pinout: [GND, VCC]
|
||||
X2: &con_power_f # define template
|
||||
type: Molex Micro-Fit
|
||||
gender: female
|
||||
subtype: female
|
||||
pinout: [GND, VCC]
|
||||
X3:
|
||||
<<: *con_power_f # create from template
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
connectors:
|
||||
X1: &boo
|
||||
type: Molex Micro-Fit
|
||||
gender: male
|
||||
subtype: male
|
||||
pinout: [GND, VCC]
|
||||
X2: &con_power_f
|
||||
type: Molex Micro-Fit
|
||||
gender: female
|
||||
subtype: female
|
||||
pinout: [GND, VCC]
|
||||
X3:
|
||||
<<: *con_power_f
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
# connectors:
|
||||
# X1:
|
||||
# type: D-Sub
|
||||
# gender: female
|
||||
# subtype: female
|
||||
# pincount: 4
|
||||
# X2:
|
||||
# type: Molex KK 254
|
||||
# gender: female
|
||||
# subtype: female
|
||||
# pincount: 3
|
||||
|
||||
cables:
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
templates:
|
||||
- &template_con
|
||||
type: Molex KK 254
|
||||
gender: female
|
||||
subtype: female
|
||||
pinout: [GND, VCC, SCL, SDA]
|
||||
- &template_wire
|
||||
gauge: 0.25 mm2
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
templates:
|
||||
- &template_con
|
||||
type: Molex KK 254
|
||||
gender: female
|
||||
subtype: female
|
||||
pinout: [GND, VCC, SCL, SDA]
|
||||
- &template_wire
|
||||
gauge: 0.25 mm2
|
||||
|
||||
@ -32,11 +32,11 @@ _Note_: WireViz is not designed to represent the complete wiring of a system. It
|
||||
connectors:
|
||||
X1:
|
||||
type: D-Sub
|
||||
gender: female
|
||||
subtype: female
|
||||
pinout: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI]
|
||||
X2:
|
||||
type: Molex KK 254
|
||||
gender: female
|
||||
subtype: female
|
||||
pinout: [GND, RX, TX]
|
||||
|
||||
cables:
|
||||
|
||||
@ -128,7 +128,7 @@ class Harness:
|
||||
else:
|
||||
# a = attributes
|
||||
a = [n.type,
|
||||
n.gender,
|
||||
n.subtype,
|
||||
'{}-pin'.format(len(n.pinout)) if n.show_pincount else '']
|
||||
# p = pinout
|
||||
p = [[],[],[]]
|
||||
@ -256,7 +256,7 @@ class Harness:
|
||||
if gen_bom:
|
||||
# connectors
|
||||
_con = self.bom_connectors()
|
||||
header_con = ['Type','Gender','Pin count','Qty','Designators']
|
||||
header_con = ['Type','Subtype','Pin count','Qty','Designators']
|
||||
bom_con = tuplelist2tsv(_con, header_con)
|
||||
with open('{}.connectors.bom.tsv'.format(filename),'w') as file:
|
||||
file.write(bom_con)
|
||||
@ -276,16 +276,16 @@ class Harness:
|
||||
bom = []
|
||||
types = Counter([v.type for v in self.connectors.values()])
|
||||
for type in types.keys():
|
||||
genders = Counter([v.gender for v in self.connectors.values() if v.type == type])
|
||||
for gender in genders.keys():
|
||||
subtypes = Counter([v.subtype for v in self.connectors.values() if v.type == type])
|
||||
for subtype in subtypes.keys():
|
||||
pincounts = Counter([v.pincount for v in self.connectors.values() if v.type == type and
|
||||
v.gender == gender])
|
||||
v.subtype == subtype])
|
||||
for pincount in pincounts.keys():
|
||||
designators = [k for k,v in self.connectors.items() if v.type == type and
|
||||
v.gender == gender and
|
||||
v.subtype == subtype and
|
||||
v.pincount == pincount]
|
||||
qty = pincounts[pincount]
|
||||
bom.append([type, gender, pincount, qty, designators])
|
||||
bom.append([type, subtype, pincount, qty, designators])
|
||||
return bom
|
||||
|
||||
def bom_cables_and_cutlist(self):
|
||||
@ -323,7 +323,7 @@ class Connector:
|
||||
name: str
|
||||
category: str = None
|
||||
type: str = None
|
||||
gender: str = None
|
||||
subtype: str = None
|
||||
pincount: int = None
|
||||
notes: str = None
|
||||
pinout: List[Any] = field(default_factory=list)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user