From 06a9188e8354d0c398ca4898ba61b485da3b2528 Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Sun, 24 May 2020 15:10:56 +0200 Subject: [PATCH] Add minimalist example 4 --- src/example2.py | 16 ++++++++-------- src/example4.py | 13 +++++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 src/example4.py diff --git a/src/example2.py b/src/example2.py index d0f5be0..5af74f1 100644 --- a/src/example2.py +++ b/src/example2.py @@ -7,14 +7,14 @@ PINOUT_I2C = ('GND','+5V','SCL','SDA') COLORS_I2C = ('BK', 'RD', 'YE', 'GN') PINOUT_SPI_DATAONLY = ('MISO','MOSI','SCK') -h.add_node('X1',type='Molex KK 254', gender='female', pinout=('GND', - '+5V', - 'SCL', - 'SDA', - 'MISO', - 'MOSI', - 'SCK', - 'N/C')) +h.add_node('X1', type='Molex KK 254', gender='female', pinout=('GND', + '+5V', + 'SCL', + 'SDA', + 'MISO', + 'MOSI', + 'SCK', + 'N/C')) h.add_node('X2', type='Molex KK 254', gender='female', pinout=PINOUT_I2C) h.add_node('X3', type='Molex KK 254', gender='female', pinout=PINOUT_I2C) h.add_node('X4', type='Molex KK 254', gender='female', pinout=('GND','+12V')+PINOUT_SPI_DATAONLY) diff --git a/src/example4.py b/src/example4.py new file mode 100644 index 0000000..97f9bb9 --- /dev/null +++ b/src/example4.py @@ -0,0 +1,13 @@ +import wireviz + +h = wireviz.Harness() + +h.add_cable('W1', show_name=False, show_num_wires=False, num_wires=4, color_code='DIN') +h.add_cable('W2', show_name=False, show_num_wires=False, num_wires=4, color_code='DIN') +h.add_node('X1', num_pins=4, show_num_pins=False) +h.add_node('X2', num_pins=4, show_num_pins=False) +h.add_node('X3', num_pins=4, show_num_pins=False) +h.connect_all_straight('W1','X1','X2') +h.connect_all_straight('W2','X2','X3') + +h.output(filename='output', format=('png','svg'), view=False)