From b12644e70d81c7d313ffab0c778faec7d41b7c1a Mon Sep 17 00:00:00 2001 From: Muhammad Taha <37846193+AbsorbedInThought@users.noreply.github.com> Date: Tue, 22 Dec 2020 23:41:10 +0500 Subject: [PATCH] Fixed an issue with multiple instances of wires. --- app/backend/main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/backend/main.py b/app/backend/main.py index fe597fad..61c328cf 100644 --- a/app/backend/main.py +++ b/app/backend/main.py @@ -155,11 +155,13 @@ def build(): ###################### Setting up communication between blocks ###################### loginfo("Setting up connections...") - wire_id = 0 + for wire in wires: src_block, src_port = wire['source']['block'], wire['source']['port'] tgt_block, tgt_port = wire['target']['block'], wire['target']['port'] + + wire_id = src_block+str(src_port) # Connecting Paramters to Blocks @@ -178,17 +180,16 @@ def build(): # Connecting Wires to Blocks else: - wire_name = "wire_"+str(wire_id) - wire_id += 1 + #wire_name = "wire_"+str(wire_id) for block in blocks: if tgt_block == block.id: - block.connect_input_wire(wire_name, tgt_port) + block.connect_input_wire(wire_id, tgt_port) break for block in blocks: if src_block == block.id: - block.connect_output_wire(wire_name, src_port) + block.connect_output_wire(wire_id, src_port) break ######################################################################################