Change type: bundle to category: bundle

This commit is contained in:
Daniel Rojas 2020-06-14 17:52:22 +02:00
parent d97d1e1f41
commit d5356260ca
6 changed files with 11 additions and 10 deletions

View File

@ -29,25 +29,25 @@ connectors:
cables: cables:
W1: W1:
<<: *wire_i2c <<: *wire_i2c
type: bundle category: bundle
length: 0.2 length: 0.2
show_equiv: true show_equiv: true
W2: W2:
<<: *wire_i2c <<: *wire_i2c
type: bundle category: bundle
length: 0.4 length: 0.4
show_equiv: true show_equiv: true
W3: W3:
gauge: 0.14 mm2 gauge: 0.14 mm2
length: 0.3 length: 0.3
colors: [BK, BU, OG, VT] colors: [BK, BU, OG, VT]
type: bundle category: bundle
show_equiv: true show_equiv: true
W4: W4:
gauge: 0.5 mm2 gauge: 0.5 mm2
length: 0.3 length: 0.3
colors: [BK, RD] colors: [BK, RD]
type: bundle category: bundle
show_equiv: true show_equiv: true
connections: connections:

View File

@ -14,7 +14,7 @@ connectors:
cables: cables:
W1: W1:
type: bundle # bundles are routed together, but more loosely than normal cables category: bundle # bundles are routed together, but more loosely than normal cables
wirecount: 6 wirecount: 6
colors: [BK, RD] # if number of items in color list is less than wirecount, loop colors colors: [BK, RD] # if number of items in color list is less than wirecount, loop colors
gauge: 0.25 mm2 gauge: 0.25 mm2

View File

@ -15,7 +15,7 @@ cables:
length: 0.2 length: 0.2
color_code: IEC color_code: IEC
wirecount: 6 wirecount: 6
type: bundle category: bundle
ferrules: ferrules:
ferrule_crimp: ferrule_crimp:

View File

@ -8,7 +8,7 @@ templates:
gauge: 0.25 mm2 gauge: 0.25 mm2
length: 0.2 length: 0.2
colors: [PK, TQ, YE, VT] colors: [PK, TQ, YE, VT]
type: bundle category: bundle
connectors: connectors:
X1: X1:

View File

@ -8,7 +8,7 @@ templates:
gauge: 0.25 mm2 gauge: 0.25 mm2
length: 0.2 length: 0.2
colors: [PK, TQ, YE, VT] colors: [PK, TQ, YE, VT]
type: bundle category: bundle
connectors: connectors:
X1: X1:

View File

@ -170,7 +170,7 @@ class Harness:
html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td>' # main table html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td>' # main table
html = html + '<table border="0" cellspacing="0" cellpadding="3" cellborder="1">' # name+attributes table html = html + '<table border="0" cellspacing="0" cellpadding="3" cellborder="1">' # name+attributes table
if (not c.show_name) or c.type != 'bundle': if (not c.show_name) or c.category != 'bundle':
html = html + '<tr><td colspan="{colspan}">{name}</td></tr>'.format(colspan=len(a), name=c.name) html = html + '<tr><td colspan="{colspan}">{name}</td></tr>'.format(colspan=len(a), name=c.name)
html = html + '<tr>' # attribute row html = html + '<tr>' # attribute row
for attrib in a: for attrib in a:
@ -242,7 +242,7 @@ class Harness:
to_string = '{}:{}'.format(x.to_name, x.to_port) if not to_ferrule else '' to_string = '{}:{}'.format(x.to_name, x.to_port) if not to_ferrule else ''
html = html.replace('<!-- {}_out -->'.format(x.via_port), to_string) html = html.replace('<!-- {}_out -->'.format(x.via_port), to_string)
dot.node(c.name, label='<{html}>'.format(html=html), shape='box', style='filled,dashed' if c.type=='bundle' else '', margin='0', fillcolor='white') dot.node(c.name, label='<{html}>'.format(html=html), shape='box', style='filled,dashed' if c.category=='bundle' else '', margin='0', fillcolor='white')
return dot return dot
@ -335,6 +335,7 @@ class Connector:
@dataclass @dataclass
class Cable: class Cable:
name: str name: str
category : str = None
type: str = None type: str = None
gauge: float = None gauge: float = None
gauge_unit : str = None gauge_unit : str = None