diff --git a/examples/demo02.yml b/examples/demo02.yml index 1fee94f..6985624 100644 --- a/examples/demo02.yml +++ b/examples/demo02.yml @@ -29,25 +29,25 @@ connectors: cables: W1: <<: *wire_i2c - type: bundle + category: bundle length: 0.2 show_equiv: true W2: <<: *wire_i2c - type: bundle + category: bundle length: 0.4 show_equiv: true W3: gauge: 0.14 mm2 length: 0.3 colors: [BK, BU, OG, VT] - type: bundle + category: bundle show_equiv: true W4: gauge: 0.5 mm2 length: 0.3 colors: [BK, RD] - type: bundle + category: bundle show_equiv: true connections: diff --git a/examples/ex03.yml b/examples/ex03.yml index 911817b..fb935a2 100644 --- a/examples/ex03.yml +++ b/examples/ex03.yml @@ -14,7 +14,7 @@ connectors: cables: 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 colors: [BK, RD] # if number of items in color list is less than wirecount, loop colors gauge: 0.25 mm2 diff --git a/examples/ex04.yml b/examples/ex04.yml index 998ce7f..1973afb 100644 --- a/examples/ex04.yml +++ b/examples/ex04.yml @@ -15,7 +15,7 @@ cables: length: 0.2 color_code: IEC wirecount: 6 - type: bundle + category: bundle ferrules: ferrule_crimp: diff --git a/examples/ex05.yml b/examples/ex05.yml index 8450a79..9723b1f 100644 --- a/examples/ex05.yml +++ b/examples/ex05.yml @@ -8,7 +8,7 @@ templates: gauge: 0.25 mm2 length: 0.2 colors: [PK, TQ, YE, VT] - type: bundle + category: bundle connectors: X1: diff --git a/examples/ex06.yml b/examples/ex06.yml index fa07b5c..ea0d505 100644 --- a/examples/ex06.yml +++ b/examples/ex06.yml @@ -8,7 +8,7 @@ templates: gauge: 0.25 mm2 length: 0.2 colors: [PK, TQ, YE, VT] - type: bundle + category: bundle connectors: X1: diff --git a/src/wireviz.py b/src/wireviz.py index 7ea72bd..5d1e8a8 100755 --- a/src/wireviz.py +++ b/src/wireviz.py @@ -170,7 +170,7 @@ class Harness: html = '
' # main table html = html + '' # name+attributes table - if (not c.show_name) or c.type != 'bundle': + if (not c.show_name) or c.category != 'bundle': html = html + ''.format(colspan=len(a), name=c.name) html = html + '' # attribute row for attrib in a: @@ -242,7 +242,7 @@ class Harness: to_string = '{}:{}'.format(x.to_name, x.to_port) if not to_ferrule else '' html = html.replace(''.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 @@ -335,6 +335,7 @@ class Connector: @dataclass class Cable: name: str + category : str = None type: str = None gauge: float = None gauge_unit : str = None
{name}