From 02fcc688acee1080e38c01a1340246fbb39762b7 Mon Sep 17 00:00:00 2001 From: Tobias Falk Date: Sat, 8 Jun 2024 14:17:04 +0200 Subject: [PATCH] more to added more options --- examples/ex15.gv | 45 ++++++++++++++++++++++++++++++++++---- src/wireviz/DataClasses.py | 2 ++ src/wireviz/Harness.py | 11 ++++++++++ 3 files changed, 54 insertions(+), 4 deletions(-) diff --git a/examples/ex15.gv b/examples/ex15.gv index c35214b..87027cd 100644 --- a/examples/ex15.gv +++ b/examples/ex15.gv @@ -4,10 +4,10 @@ graph { graph [bgcolor="#FFFFFF" fontname=arial nodesep=0.33 rankdir=LR ranksep=2] node [fillcolor="#FFFFFF" fontname=arial height=0 margin=0 shape=none style=filled width=0] edge [fontname=arial style=bold] - edge [color="#FF66CC" headclip=false style=dashed tailclip=false] + edge [color="#FF66CC" headclip=false style="solid,bold" tailclip=false] X1:p1j:c -- X1:p5j:c [straight=straight] X1:p5j:c -- X1:p7j:c [straight=straight] - edge [color="#FF0000" headclip=false style=dashed tailclip=false] + edge [color="#FF0000" headclip=false style="solid,bold" tailclip=false] X1:p2j:c -- X1:p6j:c [straight=straight] edge [headclip=true style=bold tailclip=true] X1 [label=< @@ -26,6 +26,12 @@ graph { + + + + + + @@ -70,12 +76,37 @@ graph {
SH1SH2
GND
+ + + + + + + + + + + + + + + + + + + + + + + +
ShortManufacturerM.P.N.LengthDescription
SH1WireViz42XCD42A5shortPart
SH2WireViz42XCD42A542mmshortPart
+ > fillcolor="#FFFFFF" shape=box style=filled] - edge [color="#000000" headclip=false style=dashed tailclip=false] + edge [color="#000000" headclip=false style="solid,bold" tailclip=false] X2:p1j:c -- X2:p5j:c [straight=straight] X2:p5j:c -- X2:p7j:c [straight=straight] - edge [color="#000000" headclip=false style=dashed tailclip=false] + edge [color="#000000" headclip=false style="solid,bold" tailclip=false] X2:p2j:c -- X2:p6j:c [straight=straight] edge [headclip=true style=bold tailclip=true] X2 [label=< @@ -94,6 +125,12 @@ graph { + + + + + + diff --git a/src/wireviz/DataClasses.py b/src/wireviz/DataClasses.py index 9a5496f..0b54d1e 100644 --- a/src/wireviz/DataClasses.py +++ b/src/wireviz/DataClasses.py @@ -235,6 +235,8 @@ class Connector: if isinstance(item, dict): self.additional_components[i] = AdditionalComponent(**item) + # self.shorts = {} + for i, item in enumerate(self.shorts): if isinstance(item, dict): self.shorts[i] = Short(**item) diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index 30426b9..eb79165 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -20,6 +20,7 @@ from wireviz.DataClasses import ( Options, Tweak, Side, + Short, ) from wireviz.svgembed import embed_svg_images_file from wireviz.wv_bom import ( @@ -185,6 +186,9 @@ class Harness: fontname=self.options.fontname, ) dot.attr("edge", style="bold", fontname=self.options.fontname) + + # print(self.connectors) + # print(self.connectors.values()) for connector in self.connectors.values(): @@ -307,6 +311,13 @@ class Harness: shorthtml.append(f' ') shorthtml.append(" ") + # print(connector.shorts) + + #shorts = connector.shorts + #for shortI in shorts.values(): + # print(shortI) + # print(shortI.name) + for shortName in connector.shorts: short = connector.shorts[shortName] shPins = short.get('pins');
SH1SH2
1 GNDDescription