diff --git a/examples/demo01.yml b/examples/demo01.yml index cf11cc7..b125176 100644 --- a/examples/demo01.yml +++ b/examples/demo01.yml @@ -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: diff --git a/examples/demo02.yml b/examples/demo02.yml index f77ed1f..4d30808 100644 --- a/examples/demo02.yml +++ b/examples/demo02.yml @@ -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: diff --git a/examples/ex01.yml b/examples/ex01.yml index aca8d46..83cce3c 100644 --- a/examples/ex01.yml +++ b/examples/ex01.yml @@ -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: diff --git a/examples/ex02.yml b/examples/ex02.yml index 30179d1..056e6fe 100644 --- a/examples/ex02.yml +++ b/examples/ex02.yml @@ -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 diff --git a/examples/ex03.yml b/examples/ex03.yml index 21fc828..911817b 100644 --- a/examples/ex03.yml +++ b/examples/ex03.yml @@ -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 diff --git a/examples/ex04.yml b/examples/ex04.yml index ce36c99..998ce7f 100644 --- a/examples/ex04.yml +++ b/examples/ex04.yml @@ -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: diff --git a/examples/ex05.yml b/examples/ex05.yml index d9afcf9..8450a79 100644 --- a/examples/ex05.yml +++ b/examples/ex05.yml @@ -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 diff --git a/examples/ex06.yml b/examples/ex06.yml index 94f68e4..fa07b5c 100644 --- a/examples/ex06.yml +++ b/examples/ex06.yml @@ -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 diff --git a/readme.md b/readme.md index b899f71..9f51810 100644 --- a/readme.md +++ b/readme.md @@ -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: diff --git a/src/wireviz.py b/src/wireviz.py index aae122d..03a6bc2 100755 --- a/src/wireviz.py +++ b/src/wireviz.py @@ -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)