Update organic syn station.

This commit is contained in:
Xuwznln
2025-12-15 02:34:36 +08:00
parent 53219d8b04
commit 13a6795657
3 changed files with 35 additions and 23 deletions

View File

@@ -329,6 +329,10 @@ def main():
for ind, i in enumerate(resource_edge_info[::-1]): for ind, i in enumerate(resource_edge_info[::-1]):
source_node: ResourceDict = nodes[i["source"]] source_node: ResourceDict = nodes[i["source"]]
target_node: ResourceDict = nodes[i["target"]] target_node: ResourceDict = nodes[i["target"]]
if "sourceHandle" not in source_node:
continue
if "targetHandle" not in target_node:
continue
source_handle = i["sourceHandle"] source_handle = i["sourceHandle"]
target_handle = i["targetHandle"] target_handle = i["targetHandle"]
source_handler_keys = [ source_handler_keys = [

View File

@@ -284,10 +284,18 @@ def modify_to_backend_format(data: list[dict[str, Any]]) -> list[dict[str, Any]]
edge["sourceHandle"] = port[source] edge["sourceHandle"] = port[source]
elif "source_port" in edge: elif "source_port" in edge:
edge["sourceHandle"] = edge.pop("source_port") edge["sourceHandle"] = edge.pop("source_port")
else:
typ = edge.get("type")
if typ == "communication":
continue
if target in port: if target in port:
edge["targetHandle"] = port[target] edge["targetHandle"] = port[target]
elif "target_port" in edge: elif "target_port" in edge:
edge["targetHandle"] = edge.pop("target_port") edge["targetHandle"] = edge.pop("target_port")
else:
typ = edge.get("type")
if typ == "communication":
continue
edge["id"] = f"reactflow__edge-{source}-{edge['sourceHandle']}-{target}-{edge['targetHandle']}" edge["id"] = f"reactflow__edge-{source}-{edge['sourceHandle']}-{target}-{edge['targetHandle']}"
for key in ["source_port", "target_port"]: for key in ["source_port", "target_port"]:
if key in edge: if key in edge:

View File

@@ -69,7 +69,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "device", "type": "device",
"class": "syringepump.runze", "class": "syringe_pump_with_valve.runze.SY03B-T08",
"position": { "position": {
"x": 620.6111111111111, "x": 620.6111111111111,
"y": 171, "y": 171,
@@ -93,7 +93,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 430.4087301587302, "x": 430.4087301587302,
"y": 428, "y": 428,
@@ -117,7 +117,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 295.36944444444447, "x": 295.36944444444447,
"y": 428, "y": 428,
@@ -141,7 +141,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 165.36944444444444, "x": 165.36944444444444,
"y": 428, "y": 428,
@@ -165,7 +165,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 165.36944444444444, "x": 165.36944444444444,
"y": 428, "y": 428,
@@ -189,7 +189,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 35, "x": 35,
"y": 428, "y": 428,
@@ -213,7 +213,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 698.1111111111111, "x": 698.1111111111111,
"y": 428, "y": 428,
@@ -255,7 +255,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "device", "type": "device",
"class": "syringepump.runze", "class": "syringe_pump_with_valve.runze.SY03B-T08",
"position": { "position": {
"x": 1195.611507936508, "x": 1195.611507936508,
"y": 686, "y": 686,
@@ -279,7 +279,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 1587.703373015873, "x": 1587.703373015873,
"y": 1172.5, "y": 1172.5,
@@ -299,7 +299,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "device", "type": "device",
"class": "separator_controller", "class": "separator.homemade",
"position": { "position": {
"x": 1624.4027777777778, "x": 1624.4027777777778,
"y": 665.5, "y": 665.5,
@@ -320,7 +320,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 1614.404365079365, "x": 1614.404365079365,
"y": 948, "y": 948,
@@ -340,7 +340,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 1915.7035714285714, "x": 1915.7035714285714,
"y": 665.5, "y": 665.5,
@@ -360,7 +360,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 1785.7035714285714, "x": 1785.7035714285714,
"y": 665.5, "y": 665.5,
@@ -384,7 +384,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 2054.0650793650793, "x": 2054.0650793650793,
"y": 665.5, "y": 665.5,
@@ -408,7 +408,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "device", "type": "device",
"class": "syringepump.runze", "class": "syringe_pump_with_valve.runze.SY03B-T08",
"position": { "position": {
"x": 1630.6527777777778, "x": 1630.6527777777778,
"y": 448.5, "y": 448.5,
@@ -432,7 +432,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "device", "type": "device",
"class": "rotavap", "class": "rotavap.one",
"position": { "position": {
"x": 1339.7031746031746, "x": 1339.7031746031746,
"y": 968.5, "y": 968.5,
@@ -453,7 +453,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 1339.7031746031746, "x": 1339.7031746031746,
"y": 1152, "y": 1152,
@@ -473,7 +473,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 909.722619047619, "x": 909.722619047619,
"y": 948, "y": 948,
@@ -493,7 +493,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 867.972619047619, "x": 867.972619047619,
"y": 1152, "y": 1152,
@@ -513,7 +513,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 742.722619047619, "x": 742.722619047619,
"y": 948, "y": 948,
@@ -533,7 +533,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 1206.722619047619, "x": 1206.722619047619,
"y": 948, "y": 948,
@@ -553,7 +553,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "container", "type": "container",
"class": null, "class": "container",
"position": { "position": {
"x": 1148.222619047619, "x": 1148.222619047619,
"y": 1152, "y": 1152,
@@ -573,7 +573,7 @@
"children": [], "children": [],
"parent": "YugongStation", "parent": "YugongStation",
"type": "device", "type": "device",
"class": "syringepump.runze", "class": "syringe_pump_with_valve.runze.SY03B-T08",
"position": { "position": {
"x": 1469.7031746031746, "x": 1469.7031746031746,
"y": 968.5, "y": 968.5,