diff options
author | Joshua Drake <joshua.ellis.drake@okstate.edu> | 2024-11-05 17:11:43 -0600 |
---|---|---|
committer | Joshua Drake <joshua.ellis.drake@okstate.edu> | 2024-11-05 17:11:43 -0600 |
commit | 246447d7155b7b04bb9d477ecccc860dd79bdd6a (patch) | |
tree | 29ca65433f79121cbd1aa249a8af0464d8cfe0cc | |
parent | 1f55b201683159c209a95e973a370ccb325d4dca (diff) |
Added mechanism for accounting for singles. Need to finish shielding, and splicing issues.
-rw-r--r-- | tableconversion.py | 76 | ||||
-rw-r--r-- | wireviz/Choppy_IB_CEX.csv | 70 | ||||
-rw-r--r-- | wireviz/Choppy_IB_PPS_main.csv | 20 | ||||
-rw-r--r-- | wireviz/Choppy_IB_VPX_J10.csv | 14 | ||||
-rw-r--r-- | wireviz/Choppy_IB_VPX_J12.csv | 15 | ||||
-rw-r--r-- | wireviz/Choppy_IB_VPX_J8.csv | 10 |
6 files changed, 181 insertions, 24 deletions
diff --git a/tableconversion.py b/tableconversion.py index ef81240..c69ac71 100644 --- a/tableconversion.py +++ b/tableconversion.py @@ -6,43 +6,59 @@ def parse_wireviz_yml(file_path): # Load the WireViz YML file with open(file_path, 'r') as file: data = yaml.safe_load(file) - + idcount = 0 wires = data['cables'] connectors = data['connectors'] connections = data['connections'] + connectorlist = [] + for connector in data['connectors']: + connectorlist.append(connector) + print(connectorlist) wire_info = [] for connection in connections: connectorwpin = str(connection[0]) connector = connectorwpin[2:connectorwpin.find("':")] + #currently skipping all abnormal conditions + if connectorlist.count(connector) < 1: + continue connectorpins = connectorwpin[connectorwpin.find(" [")+2:connectorwpin.rfind("]}")].strip(" ").split(",") connectorpinsadjusted = [] for pins in connectorpins: - if pins.count("-") > 0: + if str(pins).count("-") > 0: pinrange = pins.strip("' ").split("-") + print(pinrange) for x in range(int(pinrange[0]),int(pinrange[1])+1): connectorpinsadjusted.append(x) else: - connectorpinsadjusted = connectorpins + connectorpinsadjusted.append(pins) + print(connectorpinsadjusted) connectorwires = str(connection[1]) bundle = connectorwires[2:connectorwires.find("':")] bundlewires = connectorwires[connectorwires.find(" [")+2:connectorwires.rfind("]}")].split(",") + + connector2pinsadjusted = [] + idcount=idcount+1 if len(connection) > 2: connector2wpin = str(connection[2]) connector2 = connector2wpin[2:connector2wpin.find("':")] connector2pins = connector2wpin[connector2wpin.find(" [")+2:connector2wpin.rfind("]}")].split(",") - print(connector2pins) - connector2pinsadjusted = [] - for pins in connector2pins: - if pins.count("-") > 0: - pinrange = pins.strip("' ").split("-") - for x in range(int(pinrange[0]),int(pinrange[1])+1): - connector2pinsadjusted.append(x) - else: - connector2pinsadjusted = connector2pins - print(connector2pinsadjusted) + + for pins in connector2pins: + if pins.count("-") > 0: + pinrange = pins.strip("' ").split("-") + for x in range(int(pinrange[0]),int(pinrange[1])+1): + connector2pinsadjusted.append(x) + else: + connector2pinsadjusted = connector2pins for x in range(0,len(connectorpinsadjusted)): + ident = str(ord(connector[0]))+str(ord(str(connectorpinsadjusted[x])[0]))+str(ord(wires[bundle]['colors'][x][0]))+str(idcount) + ident = ident.strip(" ") + notes = "none" + if str(wires[bundle]).find("'notes':") > 0: + notes = wires[bundle]['notes'] wire_info.append({ + 'Identifier': ident, 'End 1': connector, 'Pin 1': connectorpinsadjusted[x], 'Length': wires[bundle]['length'], @@ -50,26 +66,38 @@ def parse_wireviz_yml(file_path): 'Gauge': wires[bundle]['gauge'], 'End 2': connector2, 'Pin 2': connector2pinsadjusted[x], + 'Notes': notes, + }) + else: + for x in range(0,len(connectorpinsadjusted)): + ident = str(ord(connector[0]))+str(ord(str(connectorpinsadjusted[x])[0]))+str(ord(wires[bundle]['colors'][x][0]))+str(idcount) + ident = ident.strip(" ") + notes = "none" + if str(wires[bundle]).find("'notes':") > 0: + notes = wires[bundle]['notes'] + wire_info.append({ + 'Identifier': ident, + 'End 1': connector, + 'Pin 1': connectorpinsadjusted[x], + 'Length': wires[bundle]['length'], + 'Color': wires[bundle]['colors'][x], + 'Gauge': wires[bundle]['gauge'], + 'End 2': "----", + 'Pin 2': "----", + 'Notes': notes, }) - - #print(connection[1]) - - - for wire in wires: - wire_name = wire - length = wires[wire]['length'] - - # Create a DataFrame to display the data as a table - wire_df = pd.DataFrame(wire_info, columns=['End 1', 'Pin 1', 'Length', 'Color', 'Gauge', 'End 2', 'Pin 2']) + wire_df = pd.DataFrame(wire_info, columns=['Identifier','End 1', 'Pin 1', 'Length', 'Color', 'Gauge', 'End 2', 'Pin 2', 'Notes']) return wire_df # Path to your WireViz YML file -file_path = 'wireviz/Choppy_IB_PPS_main.yml' +file_path = 'wireviz/Choppy_IB_CEX.yml' wire_table = parse_wireviz_yml(file_path) # Display the table print(wire_table) +outputfile = file_path[:-4]+".csv" +wire_table.to_csv(outputfile) diff --git a/wireviz/Choppy_IB_CEX.csv b/wireviz/Choppy_IB_CEX.csv new file mode 100644 index 0000000..7b0d040 --- /dev/null +++ b/wireviz/Choppy_IB_CEX.csv @@ -0,0 +1,70 @@ +,Identifier,End 1,Pin 1,Length,Color,Gauge,End 2,Pin 2,Notes +0,8649871,Veronte CEX,1,12 Inches,WH,22 AWG,----,----,none +1,8650661,Veronte CEX,2,12 Inches,BN,22 AWG,----,----,none +2,8653711,Veronte CEX,5,12 Inches,GN,22 AWG,----,----,none +3,8654891,Veronte CEX,6,12 Inches,YE,22 AWG,----,----,none +4,8649711,Veronte CEX,10,12 Inches,GY,22 AWG,----,----,none +5,8649801,Veronte CEX,11,12 Inches,PK,22 AWG,----,----,none +6,8649861,Veronte CEX,12,12 Inches,VT,22 AWG,----,----,none +7,8649801,Veronte CEX,13,12 Inches,PKGY,22 AWG,----,----,none +8,8649661,Veronte CEX,14,12 Inches,BURD,22 AWG,----,----,none +9,8650711,Veronte CEX,20,12 Inches,GNWH,22 AWG,----,----,none +10,8650711,Veronte CEX,21,12 Inches,GNBN,22 AWG,----,----,none +11,8650711,Veronte CEX,22,12 Inches,GYWH,22 AWG,----,----,none +12,8632661,Veronte CEX, 24,12 Inches,BNGY,22 AWG,----,----,none +13,8650801,Veronte CEX,26,12 Inches,PKWH,22 AWG,----,----,none +14,8650661,Veronte CEX,27,12 Inches,BUBN,22 AWG,----,----,none +15,8650821,Veronte CEX,28,12 Inches,RDWH,22 AWG,----,----,none +16,8650821,Veronte CEX,29,12 Inches,RDBN,22 AWG,----,----,none +17,8651661,Veronte CEX,30,12 Inches,BKWH,22 AWG,----,----,none +18,8651661,Veronte CEX,31,12 Inches,BKBN,22 AWG,----,----,none +19,8651711,Veronte CEX,32,12 Inches,GNGY,22 AWG,----,----,none +20,8651711,Veronte CEX,33,12 Inches,GNYE,22 AWG,----,----,none +21,8651711,Veronte CEX,34,12 Inches,GNPK,22 AWG,----,----,none +22,8651801,Veronte CEX,35,12 Inches,PKYE,22 AWG,----,----,none +23,8651871,Veronte CEX,36,12 Inches,WH,22 AWG,----,----,none +24,8651661,Veronte CEX,37,12 Inches,BN,22 AWG,----,----,none +25,8651711,Veronte CEX,38,12 Inches,GN,22 AWG,----,----,none +26,8651891,Veronte CEX,39,12 Inches,YE,22 AWG,----,----,none +27,8652711,Veronte CEX,40,12 Inches,GY,22 AWG,----,----,none +28,8652801,Veronte CEX,41,12 Inches,PK,22 AWG,----,----,none +29,8652661,Veronte CEX,43,12 Inches,BU,22 AWG,----,----,none +30,8652821,Veronte CEX,44,12 Inches,RD,22 AWG,----,----,none +31,8652661,Veronte CEX,45,12 Inches,BK,22 AWG,----,----,none +32,8652801,Veronte CEX,46,12 Inches,PK,22 AWG,----,----,none +33,8652801,Veronte CEX,47,12 Inches,PKGY,22 AWG,----,----,none +34,8652661,Veronte CEX,48,12 Inches,BURD,22 AWG,----,----,none +35,8652711,Veronte CEX,49,12 Inches,GNWH,22 AWG,----,----,none +36,8653711,Veronte CEX,50,12 Inches,GNBN,22 AWG,----,----,none +37,8653891,Veronte CEX,52,12 Inches,YEWH,22 AWG,----,----,none +38,8653661,Veronte CEX,53,12 Inches,BNYE,22 AWG,----,----,none +39,8653711,Veronte CEX,54,12 Inches,GYWH,22 AWG,----,----,none +40,8653661,Veronte CEX,55,12 Inches,BNGY,22 AWG,----,----,none +41,8653801,Veronte CEX,56,12 Inches,PKWH,22 AWG,----,----,none +42,8653661,Veronte CEX,57,12 Inches,BNPK,22 AWG,----,----,none +43,8653661,Veronte CEX,58,12 Inches,BUWH,22 AWG,----,----,none +44,8653661,Veronte CEX,59,12 Inches,BUBN,22 AWG,----,----,none +45,8654821,Veronte CEX,60,12 Inches,RDWH,22 AWG,----,----,none +46,8654821,Veronte CEX,61,12 Inches,RDBN,22 AWG,----,----,none +47,8654661,Veronte CEX,62,12 Inches,BKWH,22 AWG,----,----,none +48,8654661,Veronte CEX,63,12 Inches,BKBN,22 AWG,----,----,none +49,8654711,Veronte CEX,64,12 Inches,GNGY,22 AWG,----,----,none +50,8654711,Veronte CEX,65,12 Inches,GNYE,22 AWG,----,----,none +51,8654711,Veronte CEX,66,12 Inches,GNPK,22 AWG,----,----,none +52,8654801,Veronte CEX,67,12 Inches,PKYE,22 AWG,----,----,none +53,8654871,Veronte CEX,68,12 Inches,WH,22 AWG,----,----,none +54,8655662,Veronte CEX,7,12 Inches,BU,22 AWG,----,----,Twisted Pair +55,8632822,Veronte CEX, 8,12 Inches,RD,22 AWG,----,----,Twisted Pair +56,8632662,Veronte CEX, 9,12 Inches,BK,22 AWG,----,----,Twisted Pair +57,8649663,Veronte CEX,18,124 Inches,BNPK,22 AWG,Mag,'RX',Twisted Pair +58,8632663,Veronte CEX, 19,124 Inches,BUWH,22 AWG,Mag, 'TX',Twisted Pair +59,8649894,Veronte CEX,15,87.5 Inches,YEWH,22 AWG,VPX J1,'RX',Twisted Pair +60,8632664,Veronte CEX, 16,87.5 Inches,BNYE,22 AWG,VPX J1, 'TX',Twisted Pair +61,8651875,Veronte CEX,3,12 Inches,WH,22 AWG,"GND', 'GND', 'GND', 'GND', 'GND', 'GND', 'GND'",'GND',none +62,8632665,Veronte CEX, 4,12 Inches,BN,22 AWG,"GND', 'GND', 'GND', 'GND', 'GND', 'GND', 'GND'", 'GND',none +63,8632715,Veronte CEX, 17,12 Inches,GN,22 AWG,"GND', 'GND', 'GND', 'GND', 'GND', 'GND', 'GND'", 'GND',none +64,8632895,Veronte CEX, 23,12 Inches,YE,22 AWG,"GND', 'GND', 'GND', 'GND', 'GND', 'GND', 'GND'", 'GND',none +65,8632715,Veronte CEX, 25,12 Inches,GY,22 AWG,"GND', 'GND', 'GND', 'GND', 'GND', 'GND', 'GND'", 'GND',none +66,8632805,Veronte CEX, 42,12 Inches,PK,22 AWG,"GND', 'GND', 'GND', 'GND', 'GND', 'GND', 'GND'", 'GND',none +67,8632865,Veronte CEX, 51,12 Inches,VT,22 AWG,"GND', 'GND', 'GND', 'GND', 'GND', 'GND', 'GND'", 'GND',none +68,8655666,Veronte CEX,7,12 Inches,BU,22 AWG,----,----,Twisted Pair diff --git a/wireviz/Choppy_IB_PPS_main.csv b/wireviz/Choppy_IB_PPS_main.csv new file mode 100644 index 0000000..4953f59 --- /dev/null +++ b/wireviz/Choppy_IB_PPS_main.csv @@ -0,0 +1,20 @@ +,Identifier,End 1,Pin 1,Length,Color,Gauge,End 2,Pin 2 +0,801820,PPS main,1,"26.5 """,RD,6 AWG,VP-X power lug,1 +1,802820,PPS main,2,"85 """,RD,6 AWG,Altinator,2 +2,805820,PPS main,5,33 Inches,RD,6 AWG,Batt,1 +3,804660,PPS main,4,31 Inches,BK,6 AWG,Batt,2 +4,803820,PPS main,3,"80 """,RD,2 AWG,Starter,1 +5,832660,Starter,2,24 Inches????,BK,6 AWG,Negative Bus Bar,2 +6,821890,Rectifier,1,12 Inches,YE,6 AWG,Alternator 3⌀,1 +7,822891,Rectifier,2,12 Inches,YE,6 AWG,Alternator 3⌀,2 +8,823892,Rectifier,3,12 Inches,YE,6 AWG,Alternator 3⌀,3 +9,824820,Rectifier,4,6 Inches,RD,10 AWG,Positive Bus Bar,2 +10,825821,Rectifier,5,6 Inches,RD,10 AWG,Positive Bus Bar, 2 +11,824820,Rectifier,4,6 Inches,RD,10 AWG,Positive Bus Bar,2 +12,825821,Rectifier,5,6 Inches,RD,10 AWG,Positive Bus Bar, 2 +13,826660,Rectifier,6,6 Inches,BK,10 AWG,Negative Bus Bar,3 +14,827661,Rectifier,7,6 Inches,BK,10 AWG,Negative Bus Bar, 3 +15,826660,Rectifier,6,6 Inches,BK,10 AWG,Negative Bus Bar,3 +16,827661,Rectifier,7,6 Inches,BK,10 AWG,Negative Bus Bar, 3 +17,801820,PPS main,1,73 Inches,RD,10 AWG,Positive Bus Bar,1 +18,662660,Batt,2,57 Inches,BK,6 AWG,Negative Bus Bar,1 diff --git a/wireviz/Choppy_IB_VPX_J10.csv b/wireviz/Choppy_IB_VPX_J10.csv new file mode 100644 index 0000000..3a457d4 --- /dev/null +++ b/wireviz/Choppy_IB_VPX_J10.csv @@ -0,0 +1,14 @@ +,Identifier,End 1,Pin 1,Length,Color,Gauge,End 2,Pin 2,Notes +0,8649821,VPX J10,10,"21 """,RD,18 AWG,Mag,9,none +1,8655822,VPX J10,7,"34.5 """,RD,14 AWG,Radar,4,none +2,8652823,VPX J10,4,1 TBD,RD,14 AWG,Radio,4,none +3,8639664,VPX J10,'GND',"37.5 """,BK,14 AWG,GND','GND',none +4,8654825,VPX J10,6,"90 """,RD,14 AWG,Swash1,1,none +5,8649876,VPX J10,1,1 TBD,WH,22 AWG,Starter Switch,1,none +6,8350877,Starter Switch,2,1 TBD,WH,2 AWG,PPS J1,3,none +7,8651828,VPX J10,3,"90 """,RD,14 AWG,Servo,1,none +8,7739669,Mag,'GND',"43.5 """,BK,14 AWG,GND','GND',none +9,83516610,Servo,3,36 Inches,BK,14 AWG,Negative Bus Bar,2,none +10,82396611,Radio,'GND',1 TBD,BK,14 AWG,GND','GND',none +11,83516612,Swash1,3,36 Inches,BK,14 AWG,Negative Bus Bar,2,none +12,82396613,Radar,'GND',"18 """,BK,14 AWG,GND','GND',none diff --git a/wireviz/Choppy_IB_VPX_J12.csv b/wireviz/Choppy_IB_VPX_J12.csv new file mode 100644 index 0000000..3502235 --- /dev/null +++ b/wireviz/Choppy_IB_VPX_J12.csv @@ -0,0 +1,15 @@ +,Identifier,End 1,Pin 1,Length,Color,Gauge,End 2,Pin 2,Notes +0,8650821,VPX J12,2,90 Inches,RD,14 AWG,Swash2,1,none +1,8649822,VPX J12,12,90 Inches,RD,14 AWG,Swash3,1,none +2,8651823,VPX J12,3,"207.5 """,RD,14 AWG,Yaw,1,none +3,8657824,VPX J12,9,"87.5 """,RD,20 AWG,1X,68,none +4,8657825,VPX J12,9,"93.5 """,RD,20 AWG,CEX,1,none +5,8649666,VPX J12,11,"67.5 """,BK,18 AWG,Altinator,1,none +6,8351667,Swash2,3,36 Inches,BK,14 AWG,Negative Bus Bar,2,none +7,8351668,Swash3,3,36 Inches,BK,14 AWG,Negative Bus Bar,3,none +8,8951669,Yaw,3,170 Inches,BK,14 AWG,Negative Bus Bar,2,none +9,49546610,1X,65,46 Inches,BK,20 AWG,Negative Bus Bar,4,none +10,49326610,1X, 66,46 Inches,BK,20 AWG,Negative Bus Bar, 4,none +11,67516611,CEX,3,34 Inches,BK,20 AWG,Negative Bus Bar,3,none +12,67326611,CEX, 4,34 Inches,BK,20 AWG,Negative Bus Bar, 3,none +13,86526612,VPX J12,4,"37.5 """,BK,14 AWG,GND','GND',none diff --git a/wireviz/Choppy_IB_VPX_J8.csv b/wireviz/Choppy_IB_VPX_J8.csv new file mode 100644 index 0000000..051068e --- /dev/null +++ b/wireviz/Choppy_IB_VPX_J8.csv @@ -0,0 +1,10 @@ +,Identifier,End 1,Pin 1,Length,Color,Gauge,End 2,Pin 2,Notes +0,8649821,VP-X J8,1,"92 """,RD,20 AWG,Nav Light 1,1,none +1,8632891,VP-X J8, 3,"92 """,YE,20 AWG,Nav Light 1,2,none +2,8649822,VP-X J8,1,"72 """,RD,20 AWG,Nav Light 2,1,none +3,8632892,VP-X J8, 3,"72 """,YE,20 AWG,Nav Light 2,2,none +4,8649823,VP-X J8,1,"170 """,RD,20 AWG,Tail Strobe,'A',none +5,7852714,Nav Light 1,4,"32 """,GN,20 AWG,Nav Light 2,4,none +6,7851665,Nav Light 1,3,"18 """,BK,20 AWG,Negative Bus Bar,3,none +7,7851666,Nav Light 2,3,"18 """,BK,20 AWG,Negative Bus Bar,3,none +8,8439667,Tail Strobe,'B',"170 """,BK,20 AWG,Negative Bus Bar,3,none |