Commit 1d9a2af2 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][toolchaineditor] Add support for connection colors

parent 1697c44c
Pipeline #33608 canceled with stage
in 35 minutes and 11 seconds
......@@ -154,11 +154,18 @@ class SimpleToolchainPreview(QWidget):
name, label = build_block_table(block, ANALYZER_COLOR)
ag.node(name=name, label=label)
channel_colors = json_object["representation"]["channel_colors"]
for connection in json_object["connections"]:
from_block, output = connection["from"].split(".")
to_block, input_ = connection["to"].split(".")
channel_color = channel_colors.get(connection["channel"], "black")
graph.edge(f"{from_block}:out_{output}:e", f"{to_block}:in_{input_}:w")
graph.edge(
f"{from_block}:out_{output}:e",
f"{to_block}:in_{input_}:w",
color=channel_color,
)
self.label.setPixmap(QPixmap.fromImage(QImage.fromData(graph.pipe())))
self.label.adjustSize()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment