From e2042584da71e45cdabc7eebd2885d90e2a84716 Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Fri, 5 Jun 2020 16:56:04 +0200 Subject: [PATCH] Add notes field for nodes and wires --- src/wireviz.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/wireviz.py b/src/wireviz.py index d67c402..7503791 100755 --- a/src/wireviz.py +++ b/src/wireviz.py @@ -136,7 +136,7 @@ class Harness: if n.ports_right: p[2].append('{portno}'.format(portno=i)) # l = label - l = [n.name if n.show_name else '', a, p] + l = [n.name if n.show_name else '', a, p, n.notes] dot.node(k, label=nested(l)) if len(n.loops) > 0: @@ -203,7 +203,13 @@ class Harness: html = html + '' # conductor table - html = html + '' # main table + html = html + '' # main table + if c.notes: + html = html + '{}'.format(c.notes) # notes table + html = html + ' ' # spacer at the end + # html = html + ' ' # spacer at the end + + html = html + '' # main table # print(html) @@ -251,6 +257,7 @@ class Node: type: str = None gender: str = None num_pins: int = None + notes: str = None pinout: List[Any] = field(default_factory=list) color: str = None show_name: bool = True @@ -282,6 +289,7 @@ class Cable: length: float = 0 num_wires: int = None shield: bool = False + notes: str = None colors: List[Any] = field(default_factory=list) color_code: str = None show_name: bool = True