Compare commits

..

206 Commits

Author SHA1 Message Date
KCFeng425
771540b88c 修复了很多protocol,亲测能跑 2025-06-19 20:25:07 +08:00
KCFeng425
622edbde1e 添加了一套简易双八通阀工作站JSON,亲测能跑 2025-06-18 11:05:15 +08:00
Xuwznln
afc095f22c protocol node 执行action不应携带自身device id 2025-06-18 10:54:51 +08:00
KCFeng425
cbe04a0b09 Merge branch 'device-registry-port' of github.com:KCFeng425/Uni-Lab-OS into device-registry-port 2025-06-17 16:57:28 +08:00
KCFeng425
f6f9244ff1 bump version to 0.9.7 新增一个测试PumpTransferProtocol的teststation,亲测可以运行,将八通阀们和转移泵与pump_protocol适配 2025-06-17 16:56:49 +08:00
Xuwznln
ac88c59b50 protocol node不再嵌套显示 2025-06-17 16:10:28 +08:00
Xuwznln
2492af57c0 完善tip 2025-06-17 15:59:32 +08:00
Xuwznln
b1dae6da17 默认不进行注册表报送,通过命令unilabos-register或者增加启动参数 2025-06-17 15:58:56 +08:00
Junhan Chang
af812d630a separate registry sync and resource_add 2025-06-17 15:37:36 +08:00
Xuwznln
183579fd7f 移除device的父节点关联 2025-06-17 15:34:03 +08:00
Junhan Chang
678ace6109 Fix edge id 2025-06-17 13:53:38 +08:00
Junhan Chang
18c4eb3e4d fix device ports 2025-06-17 13:27:27 +08:00
Junhan Chang
dd7abe987e fix resource and edge upload 2025-06-17 13:27:01 +08:00
KCFeng425
3e6c8d6340 修改了json图中link的格式 2025-06-17 13:01:55 +08:00
KCFeng425
ab7f1539af Merge branch 'device-registry-port' of github.com:KCFeng425/Uni-Lab-OS into device-registry-port 2025-06-17 10:00:19 +08:00
KCFeng425
ee918a0e93 添加了icon的文件名在注册表里面 2025-06-17 10:00:11 +08:00
Xuwznln
6fd95fdb08 default resource upload mode is false 2025-06-16 16:08:18 +08:00
KCFeng425
31993594e6 大图的问题都修复好了,添加了gassource和vacuum pump的驱动以及注册表 2025-06-16 14:39:55 +08:00
Xuwznln
6c471553c4 fix container value
add parent_name to edge device id
2025-06-16 12:45:26 +08:00
Xuwznln
e193bc493c Merge branch 'device-registry-port' of https://github.com/KCFeng425/Uni-Lab-OS into fork/KCFeng425/device-registry-port 2025-06-16 12:16:05 +08:00
Xuwznln
9f8f6e55c4 add virtual_separator virtual_rotavap
fix transfer_pump
2025-06-16 12:15:54 +08:00
Junhan Chang
8d56c523bb update container registry and handles 2025-06-16 12:15:39 +08:00
Xuwznln
57cb120c8c add resource edge upload 2025-06-16 11:51:02 +08:00
Xuwznln
a303bd7c5b bump version to 0.9.6 2025-06-16 10:59:35 +08:00
Xuwznln
47e58e13c7 Merge remote-tracking branch 'origin/dev' into fork/KCFeng425/device-registry-port 2025-06-16 10:01:27 +08:00
Junhan Chang
5b9e13555c Fix handles 2025-06-16 08:03:06 +08:00
KCFeng425
7b04f3fa50 修复了添加protocol前缀导致的不能启动的bug 2025-06-16 02:06:53 +08:00
Xuwznln
f7db8d17c5 container 添加和更新完成 2025-06-15 17:37:38 +08:00
KCFeng425
ff6998501e 修复了阀门更新版的bug 2025-06-15 13:55:51 +08:00
Xuwznln
a354965f8e Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev 2025-06-15 12:51:48 +08:00
Xuwznln
934276d2f7 create container 2025-06-15 12:51:37 +08:00
Harvey Que
803809480b hotfix: Add .certs in .gitignore 2025-06-15 09:09:06 +08:00
KCFeng425
b875f86bbb 修改了add protocol 2025-06-14 18:53:43 +08:00
KCFeng425
d058de3702 区分了虚拟仪器中的八通阀和电磁阀,添加了两个阀门的驱动 2025-06-14 16:23:26 +08:00
KCFeng425
6385065ba3 更正了stir和heater的连接方式 2025-06-14 15:58:52 +08:00
KCFeng425
3b32dcf066 Update virtual_device.yaml 2025-06-14 15:48:56 +08:00
KCFeng425
7c714721db Merge branch 'dev' of github.com:dptech-corp/Uni-Lab-OS into dev 2025-06-14 14:44:46 +08:00
Xuwznln
5478ba3237 test artifacts 2025-06-13 14:13:41 +08:00
Xuwznln
49f1aa9c28 try build 2025-06-13 14:05:58 +08:00
Xuwznln
d5d516f0ef try build fix 2025-06-13 13:52:45 +08:00
Xuwznln
4471fed4b8 测试自动构建 2025-06-13 13:47:08 +08:00
Xuwznln
30d143e1a5 Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev 2025-06-13 13:12:46 +08:00
Xuwznln
75ea45f21e include device_mesh when pip install 2025-06-13 00:32:15 +08:00
hh.
66af337d6c hotfix: Add macos_sdk_config (#46)
Co-authored-by: quehh <scienceol@outlook.com>
2025-06-12 22:46:44 +08:00
Xuwznln
ae3c65c1d3 Merge remote-tracking branch 'origin/main' into dev
# Conflicts:
#	README.md
#	README_zh.md
#	recipes/ros-humble-unilabos-msgs/recipe.yaml
#	recipes/unilabos/recipe.yaml
#	setup.py
#	unilabos/compile/pump_protocol.py
#	unilabos/registry/devices/pump_and_valve.yaml
#	unilabos/ros/nodes/presets/protocol_node.py
2025-06-12 21:27:07 +08:00
Xuwznln
11e4f053f1 bump version & protocol fix 2025-06-12 21:21:25 +08:00
Kongchang Feng
96f37b3b0d Add Mock Device for Organic Synthesis\添加有机合成的虚拟仪器和Protocol (#43)
* Add Device MockChiller

Add device MockChiller

* Add Device MockFilter

* Add Device MockPump

* Add Device MockRotavap

* Add Device MockSeparator

* Add Device MockStirrer

* Add Device MockHeater

* Add Device MockVacuum

* Add Device MockSolenoidValve

* Add Device Mock \_init_.py

* 规范模拟设备代码与注册表信息

* 更改Mock大写文件夹名

* 删除大写目录

* Edited Mock device json

* Match mock device with action

* Edit mock device yaml

* Add new action

* Add Virtual Device, Action, YAML, Protocol for Organic Syn

* 单独分类测试的protocol文件夹

* 更名Action

---------

Co-authored-by: Xuwznln <18435084+Xuwznln@users.noreply.github.com>
2025-06-12 20:58:39 +08:00
Xuwznln
d7d0a27976 Device visualization (#42)
* Update README and MQTTClient for installation instructions and code improvements

* feat: 支持local_config启动
add: 增加对crt path的说明,为传入config.py的相对路径
move: web component

* add: registry description

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* feat: node_info_update srv
fix: OTDeck cant create

* close #12
feat: slave node registry

* feat: show machine name
fix: host node registry not uploaded

* feat: add hplc registry

* feat: add hplc registry

* fix: hplc status typo

* fix: devices/

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* fix: device.class possible null

* fix: HPLC additions with online service

* fix: slave mode spin not working

* fix: slave mode spin not working

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* feat: 多ProtocolNode 允许子设备ID相同
feat: 上报发现的ActionClient
feat: Host重启动,通过discover机制要求slaveNode重新注册,实现信息及时上报

* feat: 支持env设置config

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

* Device visualization (#14)

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

---------

Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com>

* fix: missing hostname in devices_names
fix: upload_file for model file

* fix: missing paho-mqtt package
bump version to 0.9.0

* fix startup
add ResourceCreateFromOuter.action

* fix type hint

* update actions

* update actions

* host node add_resource_from_outer
fix cmake list

* pass device config to device class

* add: bind_parent_ids to resource create action
fix: message convert string

* fix: host node should not be re_discovered

* feat: resource tracker support dict

* feat: add more necessary params

* feat: fix boolean null in registry action data

* feat: add outer resource

* 编写mesh添加action

* feat: append resource

* add action

* feat: vis 2d for plr

* fix

* fix: browser on rviz

* fix: cloud bridge error fallback to local

* fix: salve auto run rviz

* 初始化两个plate

* Device visualization (#22)

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

* 编写mesh添加action

* add action

* fix

* fix: browser on rviz

* fix: cloud bridge error fallback to local

* fix: salve auto run rviz

* 初始化两个plate

---------

Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com>

* fix: multi channel

* fix: aspirate

* fix: aspirate

* fix: aspirate

* fix: aspirate

* 提交

* fix: jobadd

* fix: jobadd

* fix: msg converter

* tijiao

* add resource creat easy action

* identify debug msg

* mq client id

* 提取lh的joint发布

* unify liquid_handler definition

* 修改物料跟随与物料添加逻辑

修改物料跟随与物料添加逻辑
将joint_publisher类移出lh的backends,但仍需要对lh的backends进行一些改写

* Revert "修改物料跟随与物料添加逻辑"

This reverts commit 498c997ad7.

* Reapply "修改物料跟随与物料添加逻辑"

This reverts commit 3a60d2ae81.

* Revert "Merge remote-tracking branch 'upstream/dev' into device_visualization"

This reverts commit fa727220af, reversing
changes made to 498c997ad7.

* 修改物料放下时的方法,如果选择

修改物料放下时的方法,
如果选择drop_trash,则删除物料显示
如果选择drop,则让其解除连接

* unilab添加moveit启动

1,整合所有moveit节点到一个move_group中,并整合所有的controller依次激活
2,添加pymoveit2的节点,使用json可直接启动
3,修改机械臂规划方式,添加约束,让冗余关节不会进行过多移动

* 修改物体attach时,多次赋值当前时间导致卡顿问题,

* Revert "修改物体attach时,多次赋值当前时间导致卡顿问题,"

This reverts commit 56d45b94f5.

* Reapply "修改物体attach时,多次赋值当前时间导致卡顿问题,"

This reverts commit 07d9db20c3.

* 添加缺少物料:"plate_well_G12",

* add

* fix tip resource data

* liquid states

* change to debug level

* Revert "change to debug level"

This reverts commit 5d9953c3e5.

* Reapply "change to debug level"

This reverts commit 2487bb6ffc.

* fix tip resource data

* add full device

* add moveit yaml

* 修复moveit
增加post_init阶段,给予ros_node反向

* remove necessary node

* fix moveit action client

* remove necessary imports

* Update moveit_interface.py

* fix handler_key uppercase

* json add liquids

* fix setup

* add

* change to "sources" and "targets" for lh

* bump version

* remove parent's parent link

* change arm's name

* change name

* fix ik error

---------

Co-authored-by: Harvey Que <Q-Query@outlook.com>
Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: q434343 <73513873+q434343@users.noreply.github.com>
Co-authored-by: Junhan Chang <changjh@pku.edu.cn>
2025-06-12 20:58:18 +08:00
Xuwznln
34151f5cb2 补充日志 2025-06-10 22:13:35 +08:00
Xuwznln
369a21b904 调整protocol node以更好支持多种类型的read和write 2025-06-10 21:54:23 +08:00
Xuwznln
90169981c1 增加modbus支持
调整protocol node以更好支持多种类型的read和write
2025-06-10 21:46:49 +08:00
Xuwznln
d297abfd19 bump ver
modify slot type
2025-06-10 03:46:28 +08:00
Xuwznln
9c515a252a create_resource 2025-06-10 02:55:29 +08:00
Xuwznln
ea5e7a5ce2 Merge branch '37-biomek-i5i7' into dev
# Conflicts:
#	README.md
#	README_zh.md
#	recipes/ros-humble-unilabos-msgs/recipe.yaml
#	recipes/unilabos/recipe.yaml
#	setup.py
#	unilabos/devices/liquid_handling/biomek.py
#	unilabos/devices/liquid_handling/biomek_test.py
#	unilabos/registry/devices/liquid_handler.yaml
#	unilabos/registry/registry.py
#	unilabos/ros/msgs/message_converter.py
#	unilabos_msgs/action/LiquidHandlerMoveBiomek.action
#	unilabos_msgs/action/LiquidHandlerTransferBiomek.action
2025-06-10 02:00:43 +08:00
Xuwznln
2e9a0a4677 fix move it 2025-06-10 01:55:39 +08:00
Xuwznln
4c7aa8a89a fix move it 2025-06-10 01:53:58 +08:00
Xuwznln
d8a0c5e715 Device visualization (#41)
* Update README and MQTTClient for installation instructions and code improvements

* feat: 支持local_config启动
add: 增加对crt path的说明,为传入config.py的相对路径
move: web component

* add: registry description

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* feat: node_info_update srv
fix: OTDeck cant create

* close #12
feat: slave node registry

* feat: show machine name
fix: host node registry not uploaded

* feat: add hplc registry

* feat: add hplc registry

* fix: hplc status typo

* fix: devices/

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* fix: device.class possible null

* fix: HPLC additions with online service

* fix: slave mode spin not working

* fix: slave mode spin not working

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* feat: 多ProtocolNode 允许子设备ID相同
feat: 上报发现的ActionClient
feat: Host重启动,通过discover机制要求slaveNode重新注册,实现信息及时上报

* feat: 支持env设置config

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

* Device visualization (#14)

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

---------

Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com>

* fix: missing hostname in devices_names
fix: upload_file for model file

* fix: missing paho-mqtt package
bump version to 0.9.0

* fix startup
add ResourceCreateFromOuter.action

* fix type hint

* update actions

* update actions

* host node add_resource_from_outer
fix cmake list

* pass device config to device class

* add: bind_parent_ids to resource create action
fix: message convert string

* fix: host node should not be re_discovered

* feat: resource tracker support dict

* feat: add more necessary params

* feat: fix boolean null in registry action data

* feat: add outer resource

* 编写mesh添加action

* feat: append resource

* add action

* feat: vis 2d for plr

* fix

* fix: browser on rviz

* fix: cloud bridge error fallback to local

* fix: salve auto run rviz

* 初始化两个plate

* Device visualization (#22)

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

* 编写mesh添加action

* add action

* fix

* fix: browser on rviz

* fix: cloud bridge error fallback to local

* fix: salve auto run rviz

* 初始化两个plate

---------

Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com>

* fix: multi channel

* fix: aspirate

* fix: aspirate

* fix: aspirate

* fix: aspirate

* 提交

* fix: jobadd

* fix: jobadd

* fix: msg converter

* tijiao

* add resource creat easy action

* identify debug msg

* mq client id

* 提取lh的joint发布

* unify liquid_handler definition

* 修改物料跟随与物料添加逻辑

修改物料跟随与物料添加逻辑
将joint_publisher类移出lh的backends,但仍需要对lh的backends进行一些改写

* Revert "修改物料跟随与物料添加逻辑"

This reverts commit 498c997ad7.

* Reapply "修改物料跟随与物料添加逻辑"

This reverts commit 3a60d2ae81.

* Revert "Merge remote-tracking branch 'upstream/dev' into device_visualization"

This reverts commit fa727220af, reversing
changes made to 498c997ad7.

* 修改物料放下时的方法,如果选择

修改物料放下时的方法,
如果选择drop_trash,则删除物料显示
如果选择drop,则让其解除连接

* add biomek.py demo implementation

* 更新LiquidHandlerBiomek类,添加资源创建功能,优化协议创建方法,修复部分代码格式问题,更新YAML配置以支持新功能。

* Test

* fix biomek success type

* Convert LH action to biomek.

* Update biomek.py

* 注册表上报handle和schema (param input)

* 修复biomek缺少的字段

* delete 's'

* Remove warnings

* Update biomek.py

* Biomek test

* Update biomek.py

* 新增transfer_biomek的msg

* New transfer_biomek

* Updated transfer_biomek

* 更新transfer_biomek的msg

* 更新transfer_biomek的msg

* 支持Biomek创建

* new action

* fix key name typo

* New parameter for biomek to run.

* Refine

* Update

* new actions

* new actions

* 1

* registry

* fix biomek startup
add action handles

* fix handles not as default entry

* unilab添加moveit启动

1,整合所有moveit节点到一个move_group中,并整合所有的controller依次激活
2,添加pymoveit2的节点,使用json可直接启动
3,修改机械臂规划方式,添加约束,让冗余关节不会进行过多移动

* biomek_test.py

biomek_test.py是最新的版本,运行它会生成complete_biomek_protocol.json

* Update biomek.py

* biomek_test.py

* fix liquid_handler.biomek handles

* 修改物体attach时,多次赋值当前时间导致卡顿问题,

* Revert "修改物体attach时,多次赋值当前时间导致卡顿问题,"

This reverts commit 56d45b94f5.

* Reapply "修改物体attach时,多次赋值当前时间导致卡顿问题,"

This reverts commit 07d9db20c3.

* 添加缺少物料:"plate_well_G12",

* host node新增resource add时间统计
create_resource新增handle
bump version to 0.9.2

* 修正物料上传时间
改用biomek_test
增加ResultInfoEncoder
支持返回结果上传

* 正确发送return_info结果

* 同步执行状态信息

* 取消raiseValueError提示

* Update biomek_test.py

* 0608 DONE

* 同步了Biomek.py 现在应可用

* biomek switch back to non-test

* temp disable initialize resource

* add

* fix tip resource data

* liquid states

* change to debug level

* Revert "change to debug level"

This reverts commit 5d9953c3e5.

* Reapply "change to debug level"

This reverts commit 2487bb6ffc.

* fix tip resource data

* add full device

* add moveit yaml

* 修复moveit
增加post_init阶段,给予ros_node反向

* remove necessary node

* fix moveit action client

* remove necessary imports

* Update moveit_interface.py

* fix handler_key uppercase

* json add liquids

* fix setup

* add

* change to "sources" and "targets" for lh

* bump version

* remove parent's parent link

* change arm's name

* change name

---------

Co-authored-by: Harvey Que <Q-Query@outlook.com>
Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: q434343 <73513873+q434343@users.noreply.github.com>
Co-authored-by: Junhan Chang <changjh@pku.edu.cn>
Co-authored-by: Guangxin Zhang <guangxin.zhang.bio@gmail.com>
Co-authored-by: qxw138 <qxw@stu.pku.edu.cn>
2025-06-10 01:28:09 +08:00
q434343
133ffaac17 Device visualization (#39)
* Update README and MQTTClient for installation instructions and code improvements

* feat: 支持local_config启动
add: 增加对crt path的说明,为传入config.py的相对路径
move: web component

* add: registry description

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* feat: node_info_update srv
fix: OTDeck cant create

* close #12
feat: slave node registry

* feat: show machine name
fix: host node registry not uploaded

* feat: add hplc registry

* feat: add hplc registry

* fix: hplc status typo

* fix: devices/

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* fix: device.class possible null

* fix: HPLC additions with online service

* fix: slave mode spin not working

* fix: slave mode spin not working

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* feat: 多ProtocolNode 允许子设备ID相同
feat: 上报发现的ActionClient
feat: Host重启动,通过discover机制要求slaveNode重新注册,实现信息及时上报

* feat: 支持env设置config

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

* Device visualization (#14)

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

---------

Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com>

* fix: missing hostname in devices_names
fix: upload_file for model file

* fix: missing paho-mqtt package
bump version to 0.9.0

* fix startup
add ResourceCreateFromOuter.action

* fix type hint

* update actions

* update actions

* host node add_resource_from_outer
fix cmake list

* pass device config to device class

* add: bind_parent_ids to resource create action
fix: message convert string

* fix: host node should not be re_discovered

* feat: resource tracker support dict

* feat: add more necessary params

* feat: fix boolean null in registry action data

* feat: add outer resource

* 编写mesh添加action

* feat: append resource

* add action

* feat: vis 2d for plr

* fix

* fix: browser on rviz

* fix: cloud bridge error fallback to local

* fix: salve auto run rviz

* 初始化两个plate

* Device visualization (#22)

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

* 编写mesh添加action

* add action

* fix

* fix: browser on rviz

* fix: cloud bridge error fallback to local

* fix: salve auto run rviz

* 初始化两个plate

---------

Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com>

* fix: multi channel

* fix: aspirate

* fix: aspirate

* fix: aspirate

* fix: aspirate

* 提交

* fix: jobadd

* fix: jobadd

* fix: msg converter

* tijiao

* add resource creat easy action

* identify debug msg

* mq client id

* 提取lh的joint发布

* unify liquid_handler definition

* 修改物料跟随与物料添加逻辑

修改物料跟随与物料添加逻辑
将joint_publisher类移出lh的backends,但仍需要对lh的backends进行一些改写

* Revert "修改物料跟随与物料添加逻辑"

This reverts commit 498c997ad7.

* Reapply "修改物料跟随与物料添加逻辑"

This reverts commit 3a60d2ae81.

* Revert "Merge remote-tracking branch 'upstream/dev' into device_visualization"

This reverts commit fa727220af, reversing
changes made to 498c997ad7.

* 修改物料放下时的方法,如果选择

修改物料放下时的方法,
如果选择drop_trash,则删除物料显示
如果选择drop,则让其解除连接

* add biomek.py demo implementation

* 更新LiquidHandlerBiomek类,添加资源创建功能,优化协议创建方法,修复部分代码格式问题,更新YAML配置以支持新功能。

* Test

* fix biomek success type

* Convert LH action to biomek.

* Update biomek.py

* 注册表上报handle和schema (param input)

* 修复biomek缺少的字段

* delete 's'

* Remove warnings

* Update biomek.py

* Biomek test

* Update biomek.py

* 新增transfer_biomek的msg

* New transfer_biomek

* Updated transfer_biomek

* 更新transfer_biomek的msg

* 更新transfer_biomek的msg

* 支持Biomek创建

* new action

* fix key name typo

* New parameter for biomek to run.

* Refine

* Update

* new actions

* new actions

* 1

* registry

* fix biomek startup
add action handles

* fix handles not as default entry

* unilab添加moveit启动

1,整合所有moveit节点到一个move_group中,并整合所有的controller依次激活
2,添加pymoveit2的节点,使用json可直接启动
3,修改机械臂规划方式,添加约束,让冗余关节不会进行过多移动

* biomek_test.py

biomek_test.py是最新的版本,运行它会生成complete_biomek_protocol.json

* Update biomek.py

* biomek_test.py

* fix liquid_handler.biomek handles

* 修改物体attach时,多次赋值当前时间导致卡顿问题,

* Revert "修改物体attach时,多次赋值当前时间导致卡顿问题,"

This reverts commit 56d45b94f5.

* Reapply "修改物体attach时,多次赋值当前时间导致卡顿问题,"

This reverts commit 07d9db20c3.

* 添加缺少物料:"plate_well_G12",

* host node新增resource add时间统计
create_resource新增handle
bump version to 0.9.2

* 修正物料上传时间
改用biomek_test
增加ResultInfoEncoder
支持返回结果上传

* 正确发送return_info结果

* 同步执行状态信息

* 取消raiseValueError提示

* Update biomek_test.py

* 0608 DONE

* 同步了Biomek.py 现在应可用

* biomek switch back to non-test

* temp disable initialize resource

* add

* fix tip resource data

* liquid states

* change to debug level

* Revert "change to debug level"

This reverts commit 5d9953c3e5.

* Reapply "change to debug level"

This reverts commit 2487bb6ffc.

* fix tip resource data

* add full device

* add moveit yaml

* 修复moveit
增加post_init阶段,给予ros_node反向

* remove necessary node

* fix moveit action client

* remove necessary imports

* Update moveit_interface.py

* fix handler_key uppercase

* json add liquids

* fix setup

* add

* change to "sources" and "targets" for lh

* bump version

* remove parent's parent link

---------

Co-authored-by: Harvey Que <Q-Query@outlook.com>
Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com>
Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: Junhan Chang <changjh@pku.edu.cn>
Co-authored-by: Guangxin Zhang <guangxin.zhang.bio@gmail.com>
Co-authored-by: qxw138 <qxw@stu.pku.edu.cn>
2025-06-09 17:06:04 +08:00
Xuwznln
729a0fcf0c 37-biomek-i5i7 (#40)
* add biomek.py demo implementation

* 更新LiquidHandlerBiomek类,添加资源创建功能,优化协议创建方法,修复部分代码格式问题,更新YAML配置以支持新功能。

* Test

* fix biomek success type

* Convert LH action to biomek.

* Update biomek.py

* 注册表上报handle和schema (param input)

* 修复biomek缺少的字段

* delete 's'

* Remove warnings

* Update biomek.py

* Biomek test

* Update biomek.py

* 新增transfer_biomek的msg

* New transfer_biomek

* Updated transfer_biomek

* 更新transfer_biomek的msg

* 更新transfer_biomek的msg

* 支持Biomek创建

* new action

* fix key name typo

* New parameter for biomek to run.

* Refine

* Update

* new actions

* new actions

* 1

* registry

* fix biomek startup
add action handles

* fix handles not as default entry

* biomek_test.py

biomek_test.py是最新的版本,运行它会生成complete_biomek_protocol.json

* Update biomek.py

* biomek_test.py

* fix liquid_handler.biomek handles

* host node新增resource add时间统计
create_resource新增handle
bump version to 0.9.2

* 修正物料上传时间
改用biomek_test
增加ResultInfoEncoder
支持返回结果上传

* 正确发送return_info结果

* 同步执行状态信息

* 取消raiseValueError提示

* Update biomek_test.py

* 0608 DONE

* 同步了Biomek.py 现在应可用

* biomek switch back to non-test

* temp disable initialize resource

* Refine biomek

* Refine copy issue

* Refine

---------

Co-authored-by: Junhan Chang <changjh@pku.edu.cn>
Co-authored-by: Guangxin Zhang <guangxin.zhang.bio@gmail.com>
Co-authored-by: qxw138 <qxw@stu.pku.edu.cn>
2025-06-09 16:57:42 +08:00
Xuwznln
6ae77e0408 temp disable initialize resource 2025-06-08 17:07:48 +08:00
Xuwznln
bab4b1d67a biomek switch back to non-test 2025-06-08 17:05:48 +08:00
Guangxin Zhang
12c17ec26e 同步了Biomek.py 现在应可用 2025-06-08 16:58:19 +08:00
Guangxin Zhang
6577fe12eb 0608 DONE 2025-06-08 16:49:11 +08:00
qxw138
f1fee5fad9 Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-06-08 15:52:31 +08:00
qxw138
9b3377aedb Update biomek_test.py 2025-06-08 15:52:20 +08:00
Xuwznln
526327727d 取消raiseValueError提示 2025-06-08 15:34:56 +08:00
Xuwznln
aaa86314e3 同步执行状态信息 2025-06-08 15:34:16 +08:00
Xuwznln
6a14104e6b 正确发送return_info结果 2025-06-08 15:06:38 +08:00
Xuwznln
ab0c4b708b 修正物料上传时间
改用biomek_test
增加ResultInfoEncoder
支持返回结果上传
2025-06-08 14:43:07 +08:00
Xuwznln
c0b7f2decd host node新增resource add时间统计
create_resource新增handle
bump version to 0.9.2
2025-06-08 13:23:55 +08:00
Junhan Chang
b6c9530c61 Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-06-07 18:52:23 +08:00
Junhan Chang
8698821c52 fix liquid_handler.biomek handles 2025-06-07 18:52:20 +08:00
qxw138
3f53f88390 biomek_test.py 2025-06-07 15:21:20 +08:00
qxw138
e840516ba4 Update biomek.py 2025-06-06 22:50:11 +08:00
qxw138
146d8c5296 Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-06-06 22:49:35 +08:00
qxw138
6573c9e02e biomek_test.py
biomek_test.py是最新的版本,运行它会生成complete_biomek_protocol.json
2025-06-06 22:42:06 +08:00
Xuwznln
c7b9c6a825 fix handles not as default entry 2025-06-06 18:13:53 +08:00
Xuwznln
48c43d3303 fix biomek startup
add action handles
2025-06-06 17:45:54 +08:00
Xuwznln
55be5e8188 registry 2025-06-06 17:21:19 +08:00
qxw138
1b9f3c666d 1 2025-06-06 14:44:17 +08:00
qxw138
097114d38c new actions 2025-06-06 14:31:10 +08:00
qxw138
5bec899479 new actions 2025-06-06 13:56:39 +08:00
Guangxin Zhang
5e86112ebf Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-06-06 13:25:34 +08:00
Guangxin Zhang
24ecb13b79 Update 2025-06-06 13:22:15 +08:00
qxw138
2573d34713 Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-06-06 13:18:42 +08:00
Guangxin Zhang
106d71e1db Refine 2025-06-06 11:11:17 +08:00
Guangxin Zhang
3c2a4a64ac Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-06-06 11:11:10 +08:00
Guangxin Zhang
1e00a66a65 New parameter for biomek to run. 2025-06-06 11:05:36 +08:00
qxw138
46da42deef Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-06-06 00:13:11 +08:00
Xuwznln
101c1bc3cc fix key name typo 2025-06-05 22:15:57 +08:00
qxw138
a62112ae26 new action 2025-06-05 17:26:36 +08:00
Xuwznln
dd5a7cab75 支持Biomek创建 2025-06-05 16:04:44 +08:00
Xuwznln
39de3ac58e 更新transfer_biomek的msg 2025-06-05 15:41:16 +08:00
Xuwznln
b99969278c 更新transfer_biomek的msg 2025-06-05 15:30:51 +08:00
Guangxin Zhang
b957ad2f71 Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-06-04 21:49:27 +08:00
Guangxin Zhang
e1a7c3a103 Updated transfer_biomek 2025-06-04 21:49:22 +08:00
Guangxin Zhang
e63c15997c New transfer_biomek 2025-06-04 21:29:54 +08:00
Xuwznln
c5a495f409 新增transfer_biomek的msg 2025-06-04 19:03:00 +08:00
Guangxin Zhang
5b240cb0ea Update biomek.py 2025-06-04 17:30:53 +08:00
Guangxin Zhang
147b8f47c0 Biomek test 2025-06-04 16:38:18 +08:00
Guangxin Zhang
6d2489af5f Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-06-04 13:27:11 +08:00
Guangxin Zhang
807dcdd226 Update biomek.py 2025-06-04 13:27:05 +08:00
Guangxin Zhang
8a29bc5597 Remove warnings 2025-06-04 13:20:12 +08:00
Guangxin Zhang
6f6c70ee57 delete 's' 2025-06-04 13:11:45 +08:00
Xuwznln
478a85951c 修复biomek缺少的字段 2025-05-31 00:00:55 +08:00
Xuwznln
0f2555c90c 注册表上报handle和schema (param input) 2025-05-31 00:00:39 +08:00
Guangxin Zhang
d2dda6ee03 Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-05-30 17:11:23 +08:00
Guangxin Zhang
208540b307 Update biomek.py 2025-05-30 17:08:19 +08:00
Guangxin Zhang
cb7c56a1d9 Convert LH action to biomek. 2025-05-30 17:00:06 +08:00
Xuwznln
ea2e9c3e3a fix biomek success type 2025-05-30 16:50:13 +08:00
Guangxin Zhang
0452a68180 Test 2025-05-30 16:03:49 +08:00
Xuwznln
90a0f3db9b merge 2025-05-30 15:40:14 +08:00
Junhan Chang
055d120ba8 更新LiquidHandlerBiomek类,添加资源创建功能,优化协议创建方法,修复部分代码格式问题,更新YAML配置以支持新功能。 2025-05-30 15:38:23 +08:00
Junhan Chang
a948f09f60 add biomek.py demo implementation 2025-05-30 13:33:10 +08:00
Xuwznln
c2c2c2f020 Merge branch 'main' into dev
# Conflicts:
#	unilabos/registry/devices/liquid_handler.yaml
#	unilabos_msgs/action/ResourceCreateFromOuterEasy.action
2025-05-29 20:45:12 +08:00
wznln
4decd9a174 Merge branch '24-high-level-liquidhandler' into dev
# Conflicts:
#	unilabos/app/main.py
#	unilabos/registry/devices/liquid_handler.yaml
#	unilabos_msgs/CMakeLists.txt
2025-05-14 22:35:56 +08:00
Junhan Chang
83c765f0ab unify liquid_handler definition 2025-05-14 22:14:14 +08:00
wznln
3600b6f934 mq client id 2025-05-13 19:17:21 +08:00
wznln
f0576e5666 identify debug msg 2025-05-13 19:03:39 +08:00
wznln
8e1dbb56b1 add resource creat easy action 2025-05-13 18:36:02 +08:00
wznln
013c25f3aa Merge remote-tracking branch 'origin/dev' into fork/q434343/device_visualization 2025-05-07 04:10:25 +08:00
zhangshixiang
3d71c8bc78 Merge branch 'dev' into device_visualization 2025-05-07 04:05:12 +08:00
zhangshixiang
42f0994147 tijiao 2025-05-07 04:04:42 +08:00
wznln
4223f9b72c fix: msg converter 2025-05-07 04:04:02 +08:00
wznln
bec58e1301 fix: jobadd 2025-05-07 03:33:13 +08:00
wznln
6f9773157c fix: jobadd 2025-05-07 03:26:22 +08:00
zhangshixiang
da50e435c1 提交 2025-05-07 03:19:30 +08:00
wznln
34e03bbd6e fix: aspirate 2025-05-07 03:09:46 +08:00
zhangshixiang
ad5168c3eb Merge branch 'dev' into device_visualization 2025-05-07 03:06:41 +08:00
wznln
2dde5b6aae fix: aspirate 2025-05-07 03:02:35 +08:00
wznln
45a73e2f6d fix: aspirate 2025-05-07 02:51:56 +08:00
wznln
fbff27a52d fix: aspirate 2025-05-07 02:46:33 +08:00
zhangshixiang
1b190ee62f Merge remote-tracking branch 'upstream/dev' into device_visualization 2025-05-07 02:38:32 +08:00
wznln
83abf877b5 fix: multi channel 2025-05-07 02:36:53 +08:00
q434343
f3637d4043 Device visualization (#22)
* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

* 编写mesh添加action

* add action

* fix

* fix: browser on rviz

* fix: cloud bridge error fallback to local

* fix: salve auto run rviz

* 初始化两个plate

---------

Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com>
2025-05-07 02:12:29 +08:00
zhangshixiang
c12c2a876c 初始化两个plate 2025-05-07 02:06:01 +08:00
wznln
6cdd8c18e8 fix: salve auto run rviz 2025-05-07 00:45:37 +08:00
wznln
3d60cb36b8 fix: cloud bridge error fallback to local 2025-05-07 00:31:05 +08:00
wznln
5df304bc64 fix: browser on rviz 2025-05-07 00:11:29 +08:00
wznln
6d5ada06de Merge remote-tracking branch 'q434343/device_visualization' into device_visualization 2025-05-07 00:06:56 +08:00
zhangshixiang
aad23596b6 fix 2025-05-07 00:01:59 +08:00
wznln
b43f2321cd Merge remote-tracking branch 'origin/dev' into device_visualization 2025-05-06 23:58:56 +08:00
zhangshixiang
8617b1284f Merge remote-tracking branch 'upstream/dev' into device_visualization 2025-05-06 23:39:22 +08:00
wznln
cd1e9a9f7d feat: vis 2d for plr 2025-05-06 23:32:54 +08:00
zhangshixiang
3d607db49a add action 2025-05-06 23:27:42 +08:00
wznln
3dc62e3e99 feat: append resource 2025-05-06 23:13:29 +08:00
zhangshixiang
d199fda9a5 编写mesh添加action 2025-05-06 22:01:23 +08:00
wznln
ed2858a610 feat: add outer resource 2025-05-06 21:57:34 +08:00
wznln
de28c50d8b feat: fix boolean null in registry action data 2025-05-06 20:33:32 +08:00
wznln
e373220ce3 feat: add more necessary params 2025-05-06 20:18:49 +08:00
wznln
b6a3f17e9b feat: resource tracker support dict 2025-05-06 17:28:06 +08:00
wznln
49a9f05c51 fix: host node should not be re_discovered 2025-05-06 16:26:55 +08:00
wznln
32e370a562 add: bind_parent_ids to resource create action
fix: message convert string
2025-05-06 16:24:19 +08:00
wznln
852d10d751 pass device config to device class 2025-05-06 14:44:42 +08:00
wznln
b47f67d129 host node add_resource_from_outer
fix cmake list
2025-05-06 13:28:24 +08:00
wznln
194985222e update actions 2025-05-06 12:55:24 +08:00
wznln
948f590b47 update actions 2025-05-06 12:30:48 +08:00
wznln
164417e1cf Merge remote-tracking branch 'origin/main' into dev 2025-05-06 11:15:47 +08:00
wznln
1a107cfd18 fix type hint 2025-05-06 11:15:36 +08:00
wznln
65d0cbe28a Merge remote-tracking branch 'origin/main' into dev
# Conflicts:
#	unilabos/app/main.py
#	unilabos/ros/main_slave_run.py
2025-05-06 11:04:34 +08:00
wznln
3c98c77cab fix startup
add ResourceCreateFromOuter.action
2025-05-06 10:39:54 +08:00
wznln
d6b8104824 fix: missing paho-mqtt package
bump version to 0.9.0
2025-05-06 09:43:29 +08:00
wznln
1223e05dcc fix: missing hostname in devices_names
fix: upload_file for model file
2025-05-06 09:40:33 +08:00
q434343
a52133b7d0 Device visualization (#14)
* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* add 3d visualization

* 完成在main中启动设备可视化

完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集

* 完成TF发布

* 修改模型方向,在yaml中添加变换属性

* 添加物料tf变化时,发送topic到前端

另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题

* 添加关节发布节点与物料可视化节点进入unilab

* 使用json启动plr与3D模型仿真

* 完成启动OT并联动rviz

* 修复rviz位置问题,

修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法

* fix: running logic

* fix: running logic

* fix: missing ot

* 在main中直接初始化republisher和物料的mesh节点

* 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中

---------

Co-authored-by: zhangshixiang <@zhangshixiang>
Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com>
2025-05-06 09:37:57 +08:00
zhangshixiang
80380d1f4b 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中 2025-05-02 23:45:43 +08:00
zhangshixiang
5668310401 在main中直接初始化republisher和物料的mesh节点 2025-05-02 07:40:28 +08:00
wznln
78239ab1a3 fix: missing ot 2025-05-01 17:53:47 +08:00
wznln
fa5db06347 fix: running logic 2025-05-01 17:46:53 +08:00
wznln
2b428080e7 fix: running logic 2025-05-01 17:42:46 +08:00
wznln
9eb271f64e Merge remote-tracking branch 'origin/dev' into fork/q434343/device_visualization 2025-05-01 16:33:51 +08:00
wznln
752442cb37 feat: 支持env设置config 2025-05-01 14:52:50 +08:00
wznln
9d2bfec1dd feat: 多ProtocolNode 允许子设备ID相同
feat: 上报发现的ActionClient
feat: Host重启动,通过discover机制要求slaveNode重新注册,实现信息及时上报
2025-05-01 14:36:15 +08:00
zhangshixiang
5212d2d8eb 修复rviz位置问题,
修复rviz位置问题,
在无tf变动时减缓发送频率
在backend中添加物料跟随方法
2025-04-30 22:18:29 +08:00
zhangshixiang
44c191fe90 Merge branch 'device_visualization' of https://github.com/q434343/Uni-Lab-OS into device_visualization 2025-04-30 16:47:31 +08:00
wznln
7a51b2adc1 fix: slave mode spin not working 2025-04-30 15:48:33 +08:00
wznln
2d034f728a fix: slave mode spin not working 2025-04-30 15:21:29 +08:00
wznln
8ab108c489 fix: HPLC additions with online service 2025-04-30 11:53:10 +08:00
wznln
4dbb6649b4 fix: device.class possible null 2025-04-29 22:48:25 +08:00
zhangshixiang
dc197bffe8 完成启动OT并联动rviz 2025-04-29 22:15:39 +08:00
zhangshixiang
49bb11b2a3 使用json启动plr与3D模型仿真 2025-04-29 22:15:39 +08:00
zhangshixiang
d407423aaa 添加关节发布节点与物料可视化节点进入unilab 2025-04-29 22:15:39 +08:00
zhangshixiang
111c3f42e4 添加物料tf变化时,发送topic到前端
另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题
2025-04-29 22:15:02 +08:00
zhangshixiang
2990e70c25 修改模型方向,在yaml中添加变换属性 2025-04-29 22:15:02 +08:00
zhangshixiang
0d24606d46 完成TF发布 2025-04-29 22:15:02 +08:00
zhangshixiang
2baa232b86 完成在main中启动设备可视化
完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集
2025-04-29 22:15:02 +08:00
zhangshixiang
b7a16cdfc8 add 3d visualization 2025-04-29 22:14:18 +08:00
zhangshixiang
8921bcd9fb 完成启动OT并联动rviz 2025-04-29 22:13:34 +08:00
wznln
5038219fe6 fix: devices/ 2025-04-29 16:08:45 +08:00
wznln
0d2f1be37a fix: hplc status typo 2025-04-29 14:56:37 +08:00
wznln
6b649bfdec feat: add hplc registry 2025-04-29 14:52:02 +08:00
wznln
ba6a43c594 feat: add hplc registry 2025-04-29 14:50:33 +08:00
wznln
ea6f25d1ce feat: show machine name
fix: host node registry not uploaded
2025-04-29 14:39:14 +08:00
wznln
e5749a8058 close #12
feat: slave node registry
2025-04-29 13:42:30 +08:00
wznln
09fc17429e feat: node_info_update srv
fix: OTDeck cant create
2025-04-29 11:29:25 +08:00
zhangshixiang
bdf97be256 使用json启动plr与3D模型仿真 2025-04-29 10:08:34 +08:00
wznln
dbd1557095 Merge branch 'refs/heads/main' into dev 2025-04-29 10:04:56 +08:00
zhangshixiang
ff8b75bf1f 添加关节发布节点与物料可视化节点进入unilab 2025-04-27 19:07:39 +08:00
zhangshixiang
bed9720de3 添加物料tf变化时,发送topic到前端
另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题
2025-04-25 19:20:18 +08:00
zhangshixiang
1e01eae896 修改模型方向,在yaml中添加变换属性 2025-04-25 10:47:46 +08:00
zhangshixiang
6155ec2798 完成TF发布 2025-04-24 01:51:26 +08:00
zhangshixiang
279c5ed519 完成在main中启动设备可视化
完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model

添加物料模型管理类,遍历物料与resource_model,完成TF数据收集
2025-04-24 00:59:43 +08:00
zhangshixiang
5b4f580a6f add 3d visualization 2025-04-23 11:01:58 +08:00
wznln
e971424220 add: registry description 2025-04-20 18:21:35 +08:00
wznln
82881f5882 feat: 支持local_config启动
add: 增加对crt path的说明,为传入config.py的相对路径
move: web component
2025-04-20 18:11:35 +08:00
wznln
bb1cac0dbd Merge remote-tracking branch 'origin/main' into dev 2025-04-20 18:10:42 +08:00
Harvey Que
275e3a36f7 Update README and MQTTClient for installation instructions and code improvements 2025-04-18 15:32:49 +08:00
16 changed files with 461 additions and 3206 deletions

View File

@@ -28,7 +28,7 @@
"config": {
"protocol_type": [
"CleanVesselProtocol",
"PumpTransferProtocol",
"PumpTransferProtocol",
"HeatChillProtocol",
"HeatChillStartProtocol",
"HeatChillStopProtocol"
@@ -148,7 +148,7 @@
"children": [],
"parent": "CleanVesselProtocolTestStation",
"type": "container",
"class": "container",
"class": null,
"position": {
"x": 50,
"y": 500,
@@ -172,7 +172,7 @@
"children": [],
"parent": "CleanVesselProtocolTestStation",
"type": "container",
"class": "container",
"class": null,
"position": {
"x": 150,
"y": 500,
@@ -196,7 +196,7 @@
"children": [],
"parent": "CleanVesselProtocolTestStation",
"type": "container",
"class": "container",
"class": null,
"position": {
"x": 250,
"y": 500,
@@ -220,7 +220,7 @@
"children": [],
"parent": "CleanVesselProtocolTestStation",
"type": "container",
"class": "container",
"class": null,
"position": {
"x": 350,
"y": 500,
@@ -239,7 +239,7 @@
"children": [],
"parent": "CleanVesselProtocolTestStation",
"type": "container",
"class": "container",
"class": null,
"position": {
"x": 600,
"y": 450,
@@ -263,7 +263,7 @@
"children": [],
"parent": "CleanVesselProtocolTestStation",
"type": "container",
"class": "container",
"class": null,
"position": {
"x": 800,
"y": 450,
@@ -287,7 +287,7 @@
"children": [],
"parent": "CleanVesselProtocolTestStation",
"type": "container",
"class": "container",
"class": null,
"position": {
"x": 700,
"y": 550,
@@ -301,9 +301,9 @@
}
}
],
"links": [
"links": [
{
"id": "link_pump1_to_valve1",
"id": "link_pump1_valve1",
"source": "transfer_pump_1",
"target": "multiway_valve_1",
"type": "fluid",
@@ -313,7 +313,7 @@
}
},
{
"id": "link_pump2_to_valve2",
"id": "link_pump2_valve2",
"source": "transfer_pump_2",
"target": "multiway_valve_2",
"type": "fluid",
@@ -323,123 +323,103 @@
}
},
{
"id": "link_valve1_to_water",
"id": "link_valve1_air",
"source": "multiway_valve_1",
"target": "flask_air",
"type": "fluid",
"port": {
"multiway_valve_1": "1",
"flask_air": "top"
}
},
{
"id": "link_valve1_water",
"source": "multiway_valve_1",
"target": "flask_water",
"type": "fluid",
"port": {
"multiway_valve_1": "2",
"flask_water": "top"
"flask_water": "outlet"
}
},
{
"id": "link_valve1_to_acetone",
"id": "link_valve1_acetone",
"source": "multiway_valve_1",
"target": "flask_acetone",
"type": "fluid",
"port": {
"multiway_valve_1": "3",
"flask_acetone": "top"
"flask_acetone": "outlet"
}
},
{
"id": "link_valve1_to_ethanol",
"id": "link_valve1_ethanol",
"source": "multiway_valve_1",
"target": "flask_ethanol",
"type": "fluid",
"port": {
"multiway_valve_1": "4",
"flask_ethanol": "top"
"flask_ethanol": "outlet"
}
},
{
"id": "link_valve1_to_air",
"source": "multiway_valve_1",
"target": "flask_air",
"type": "fluid",
"port": {
"multiway_valve_1": "6",
"flask_air": "top"
}
},
{
"id": "link_valve1_to_valve2_for_cleaning",
"id": "link_valve1_valve2",
"source": "multiway_valve_1",
"target": "multiway_valve_2",
"type": "fluid",
"port": {
"multiway_valve_1": "1",
"multiway_valve_2": "8"
"multiway_valve_1": "5",
"multiway_valve_2": "1"
}
},
{
"id": "link_valve2_to_main_reactor_in",
"id": "link_valve2_main_reactor",
"source": "multiway_valve_2",
"target": "main_reactor",
"type": "fluid",
"port": {
"multiway_valve_2": "2",
"main_reactor": "top"
"main_reactor": "inlet"
}
},
{
"id": "link_valve2_to_secondary_reactor_in",
"id": "link_valve2_secondary_reactor",
"source": "multiway_valve_2",
"target": "secondary_reactor",
"type": "fluid",
"port": {
"multiway_valve_2": "3",
"secondary_reactor": "top"
"secondary_reactor": "inlet"
}
},
{
"id": "link_main_reactor_out_to_valve2",
"source": "main_reactor",
"target": "multiway_valve_2",
"type": "fluid",
"port": {
"main_reactor": "bottom",
"multiway_valve_2": "6"
}
},
{
"id": "link_secondary_reactor_out_to_valve2",
"source": "secondary_reactor",
"target": "multiway_valve_2",
"type": "fluid",
"port": {
"secondary_reactor": "bottom",
"multiway_valve_2": "7"
}
},
{
"id": "link_valve2_to_waste",
"id": "link_valve2_waste",
"source": "multiway_valve_2",
"target": "waste_workup",
"type": "fluid",
"port": {
"multiway_valve_2": "4",
"waste_workup": "top"
"waste_workup": "inlet"
}
},
{
"id": "link_heatchill1_to_main_reactor",
"id": "link_valve2_air_return",
"source": "multiway_valve_2",
"target": "flask_air",
"type": "fluid",
"port": {
"multiway_valve_2": "5",
"flask_air": "bottom"
}
},
{
"id": "link_heatchill1_main_reactor",
"source": "heatchill_1",
"target": "main_reactor",
"type": "mechanical",
"port": {
"heatchill_1": "heatchill",
"main_reactor": "bind"
}
},
{
"id": "link_heatchill1_to_secondary_reactor",
"source": "heatchill_1",
"target": "secondary_reactor",
"type": "mechanical",
"port": {
"heatchill_1": "heatchill",
"secondary_reactor": "bind"
"main_reactor": "heating_jacket"
}
}
]

View File

@@ -1,778 +0,0 @@
{
"nodes": [
{
"id": "PumpTransferFilterThroughTestStation",
"name": "泵转移+过滤介质测试站",
"children": [
"transfer_pump_1",
"transfer_pump_2",
"multiway_valve_1",
"multiway_valve_2",
"reaction_mixture",
"crude_product",
"filter_celite",
"column_silica_gel",
"filter_C18",
"pure_product",
"collection_bottle_1",
"collection_bottle_2",
"collection_bottle_3",
"intermediate_vessel_1",
"intermediate_vessel_2",
"flask_water",
"flask_ethanol",
"flask_methanol",
"flask_ethyl_acetate",
"flask_acetone",
"flask_hexane",
"flask_air",
"waste_workup"
],
"parent": null,
"type": "device",
"class": "workstation",
"position": {
"x": 500,
"y": 200,
"z": 0
},
"config": {
"protocol_type": [
"PumpTransferProtocol",
"FilterThroughProtocol"
]
},
"data": {}
},
{
"id": "transfer_pump_1",
"name": "主转移泵",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "device",
"class": "virtual_transfer_pump",
"position": {
"x": 200,
"y": 300,
"z": 0
},
"config": {
"port": "VIRTUAL_PUMP1",
"max_volume": 25.0,
"transfer_rate": 2.0
},
"data": {
"position": 0.0,
"status": "Idle"
}
},
{
"id": "transfer_pump_2",
"name": "副转移泵",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "device",
"class": "virtual_transfer_pump",
"position": {
"x": 400,
"y": 300,
"z": 0
},
"config": {
"port": "VIRTUAL_PUMP2",
"max_volume": 25.0,
"transfer_rate": 2.0
},
"data": {
"position": 0.0,
"status": "Idle"
}
},
{
"id": "multiway_valve_1",
"name": "溶剂分配阀",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "device",
"class": "virtual_multiway_valve",
"position": {
"x": 200,
"y": 400,
"z": 0
},
"config": {
"port": "VIRTUAL_VALVE1",
"positions": 8
},
"data": {
"current_position": 1
}
},
{
"id": "multiway_valve_2",
"name": "样品分配阀",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "device",
"class": "virtual_multiway_valve",
"position": {
"x": 400,
"y": 400,
"z": 0
},
"config": {
"port": "VIRTUAL_VALVE2",
"positions": 8
},
"data": {
"current_position": 1
}
},
{
"id": "reaction_mixture",
"name": "反应混合物",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 100,
"y": 500,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": [
{
"liquid_type": "organic_reaction_mixture",
"liquid_volume": 250.0
}
]
}
},
{
"id": "crude_product",
"name": "粗产品",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 200,
"y": 500,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": [
{
"liquid_type": "crude_organic_compound",
"liquid_volume": 150.0
}
]
}
},
{
"id": "filter_celite",
"name": "硅藻土过滤器",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 600,
"y": 450,
"z": 0
},
"config": {
"max_volume": 300.0,
"filter_type": "celite_pad"
},
"data": {
"liquid": []
}
},
{
"id": "column_silica_gel",
"name": "硅胶柱",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 700,
"y": 450,
"z": 0
},
"config": {
"max_volume": 200.0,
"filter_type": "silica_gel_column"
},
"data": {
"liquid": []
}
},
{
"id": "filter_C18",
"name": "C18固相萃取柱",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 800,
"y": 450,
"z": 0
},
"config": {
"max_volume": 100.0,
"filter_type": "C18_cartridge"
},
"data": {
"liquid": []
}
},
{
"id": "pure_product",
"name": "纯产品",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 900,
"y": 500,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": []
}
},
{
"id": "collection_bottle_1",
"name": "收集瓶1",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 600,
"y": 550,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": []
}
},
{
"id": "collection_bottle_2",
"name": "收集瓶2",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 700,
"y": 550,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": []
}
},
{
"id": "collection_bottle_3",
"name": "收集瓶3",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 800,
"y": 550,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": []
}
},
{
"id": "intermediate_vessel_1",
"name": "中间容器1",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 300,
"y": 500,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": []
}
},
{
"id": "intermediate_vessel_2",
"name": "中间容器2",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 400,
"y": 500,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": []
}
},
{
"id": "flask_water",
"name": "蒸馏水瓶",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 100,
"y": 600,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": [
{
"liquid_type": "water",
"liquid_volume": 900.0
}
]
}
},
{
"id": "flask_ethanol",
"name": "乙醇瓶",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 200,
"y": 600,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": [
{
"liquid_type": "ethanol",
"liquid_volume": 800.0
}
]
}
},
{
"id": "flask_methanol",
"name": "甲醇瓶",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 300,
"y": 600,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": [
{
"liquid_type": "methanol",
"liquid_volume": 800.0
}
]
}
},
{
"id": "flask_ethyl_acetate",
"name": "乙酸乙酯瓶",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 400,
"y": 600,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": [
{
"liquid_type": "ethyl_acetate",
"liquid_volume": 800.0
}
]
}
},
{
"id": "flask_acetone",
"name": "丙酮瓶",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 500,
"y": 600,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": [
{
"liquid_type": "acetone",
"liquid_volume": 800.0
}
]
}
},
{
"id": "flask_hexane",
"name": "正己烷瓶",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 600,
"y": 600,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": [
{
"liquid_type": "hexane",
"liquid_volume": 800.0
}
]
}
},
{
"id": "flask_air",
"name": "空气瓶",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 700,
"y": 600,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": []
}
},
{
"id": "waste_workup",
"name": "废液瓶",
"children": [],
"parent": "PumpTransferFilterThroughTestStation",
"type": "container",
"class": null,
"position": {
"x": 800,
"y": 600,
"z": 0
},
"config": {
"max_volume": 2000.0
},
"data": {
"liquid": []
}
}
],
"links": [
{
"id": "link_pump1_valve1",
"source": "transfer_pump_1",
"target": "multiway_valve_1",
"type": "fluid",
"port": {
"transfer_pump_1": "transferpump",
"multiway_valve_1": "transferpump"
}
},
{
"id": "link_pump2_valve2",
"source": "transfer_pump_2",
"target": "multiway_valve_2",
"type": "fluid",
"port": {
"transfer_pump_2": "transferpump",
"multiway_valve_2": "transferpump"
}
},
{
"id": "link_valve1_air",
"source": "multiway_valve_1",
"target": "flask_air",
"type": "fluid",
"port": {
"multiway_valve_1": "1",
"flask_air": "top"
}
},
{
"id": "link_valve1_water",
"source": "multiway_valve_1",
"target": "flask_water",
"type": "fluid",
"port": {
"multiway_valve_1": "2",
"flask_water": "outlet"
}
},
{
"id": "link_valve1_ethanol",
"source": "multiway_valve_1",
"target": "flask_ethanol",
"type": "fluid",
"port": {
"multiway_valve_1": "3",
"flask_ethanol": "outlet"
}
},
{
"id": "link_valve1_methanol",
"source": "multiway_valve_1",
"target": "flask_methanol",
"type": "fluid",
"port": {
"multiway_valve_1": "4",
"flask_methanol": "outlet"
}
},
{
"id": "link_valve1_ethyl_acetate",
"source": "multiway_valve_1",
"target": "flask_ethyl_acetate",
"type": "fluid",
"port": {
"multiway_valve_1": "5",
"flask_ethyl_acetate": "outlet"
}
},
{
"id": "link_valve1_acetone",
"source": "multiway_valve_1",
"target": "flask_acetone",
"type": "fluid",
"port": {
"multiway_valve_1": "6",
"flask_acetone": "outlet"
}
},
{
"id": "link_valve1_hexane",
"source": "multiway_valve_1",
"target": "flask_hexane",
"type": "fluid",
"port": {
"multiway_valve_1": "7",
"flask_hexane": "outlet"
}
},
{
"id": "link_valve1_valve2",
"source": "multiway_valve_1",
"target": "multiway_valve_2",
"type": "fluid",
"port": {
"multiway_valve_1": "8",
"multiway_valve_2": "1"
}
},
{
"id": "link_valve2_reaction_mixture",
"source": "multiway_valve_2",
"target": "reaction_mixture",
"type": "fluid",
"port": {
"multiway_valve_2": "2",
"reaction_mixture": "inlet"
}
},
{
"id": "link_valve2_crude_product",
"source": "multiway_valve_2",
"target": "crude_product",
"type": "fluid",
"port": {
"multiway_valve_2": "3",
"crude_product": "inlet"
}
},
{
"id": "link_valve2_intermediate1",
"source": "multiway_valve_2",
"target": "intermediate_vessel_1",
"type": "fluid",
"port": {
"multiway_valve_2": "4",
"intermediate_vessel_1": "inlet"
}
},
{
"id": "link_valve2_intermediate2",
"source": "multiway_valve_2",
"target": "intermediate_vessel_2",
"type": "fluid",
"port": {
"multiway_valve_2": "5",
"intermediate_vessel_2": "inlet"
}
},
{
"id": "link_valve2_celite",
"source": "multiway_valve_2",
"target": "filter_celite",
"type": "fluid",
"port": {
"multiway_valve_2": "6",
"filter_celite": "inlet"
}
},
{
"id": "link_valve2_silica_gel",
"source": "multiway_valve_2",
"target": "column_silica_gel",
"type": "fluid",
"port": {
"multiway_valve_2": "7",
"column_silica_gel": "inlet"
}
},
{
"id": "link_valve2_C18",
"source": "multiway_valve_2",
"target": "filter_C18",
"type": "fluid",
"port": {
"multiway_valve_2": "8",
"filter_C18": "inlet"
}
},
{
"id": "link_celite_collection1",
"source": "filter_celite",
"target": "collection_bottle_1",
"type": "fluid",
"port": {
"filter_celite": "outlet",
"collection_bottle_1": "inlet"
}
},
{
"id": "link_silica_gel_collection2",
"source": "column_silica_gel",
"target": "collection_bottle_2",
"type": "fluid",
"port": {
"column_silica_gel": "outlet",
"collection_bottle_2": "inlet"
}
},
{
"id": "link_C18_collection3",
"source": "filter_C18",
"target": "collection_bottle_3",
"type": "fluid",
"port": {
"filter_C18": "outlet",
"collection_bottle_3": "inlet"
}
},
{
"id": "link_collection1_pure_product",
"source": "collection_bottle_1",
"target": "pure_product",
"type": "fluid",
"port": {
"collection_bottle_1": "outlet",
"pure_product": "inlet"
}
},
{
"id": "link_collection2_pure_product",
"source": "collection_bottle_2",
"target": "pure_product",
"type": "fluid",
"port": {
"collection_bottle_2": "outlet",
"pure_product": "inlet"
}
},
{
"id": "link_collection3_pure_product",
"source": "collection_bottle_3",
"target": "pure_product",
"type": "fluid",
"port": {
"collection_bottle_3": "outlet",
"pure_product": "inlet"
}
},
{
"id": "link_waste_connection",
"source": "pure_product",
"target": "waste_workup",
"type": "fluid",
"port": {
"pure_product": "waste_outlet",
"waste_workup": "inlet"
}
}
]
}

View File

@@ -1,432 +0,0 @@
{
"nodes": [
{
"id": "RunColumnTestStation",
"name": "柱层析测试工作站",
"children": [
"transfer_pump_1",
"multiway_valve_1",
"column_1",
"flask_sample",
"flask_hexane",
"flask_ethyl_acetate",
"flask_methanol",
"column_vessel",
"collection_flask_1",
"collection_flask_2",
"collection_flask_3",
"waste_flask",
"main_reactor"
],
"parent": null,
"type": "device",
"class": "workstation",
"position": {
"x": 500,
"y": 200,
"z": 0
},
"config": {
"protocol_type": ["RunColumnProtocol", "PumpTransferProtocol"]
},
"data": {}
},
{
"id": "transfer_pump_1",
"name": "转移泵",
"children": [],
"parent": "RunColumnTestStation",
"type": "device",
"class": "virtual_transfer_pump",
"position": {
"x": 300,
"y": 300,
"z": 0
},
"config": {
"port": "VIRTUAL_PUMP1",
"max_volume": 50.0,
"transfer_rate": 10.0
},
"data": {
"status": "Idle",
"position": 0.0
}
},
{
"id": "multiway_valve_1",
"name": "八通阀门",
"children": [],
"parent": "RunColumnTestStation",
"type": "device",
"class": "virtual_multiway_valve",
"position": {
"x": 300,
"y": 400,
"z": 0
},
"config": {
"port": "VIRTUAL_VALVE1",
"positions": 8
},
"data": {
"current_position": 1
}
},
{
"id": "column_1",
"name": "柱层析设备",
"children": [],
"parent": "RunColumnTestStation",
"type": "device",
"class": "virtual_column",
"position": {
"x": 600,
"y": 350,
"z": 0
},
"config": {
"port": "VIRTUAL_COLUMN1",
"max_flow_rate": 5.0,
"column_length": 30.0,
"column_diameter": 2.5
},
"data": {
"status": "Idle",
"column_state": "Ready"
}
},
{
"id": "flask_sample",
"name": "样品瓶",
"children": [],
"parent": "RunColumnTestStation",
"type": "container",
"class": null,
"position": {
"x": 100,
"y": 500,
"z": 0
},
"config": {
"max_volume": 500.0
},
"data": {
"liquid": [
{
"name": "crude_mixture",
"volume": 200.0,
"concentration": 70.0
}
]
}
},
{
"id": "flask_hexane",
"name": "正己烷洗脱剂",
"children": [],
"parent": "RunColumnTestStation",
"type": "container",
"class": null,
"position": {
"x": 200,
"y": 500,
"z": 0
},
"config": {
"max_volume": 2000.0
},
"data": {
"liquid": [
{
"name": "hexane",
"volume": 1500.0,
"concentration": 99.8
}
]
}
},
{
"id": "flask_ethyl_acetate",
"name": "乙酸乙酯洗脱剂",
"children": [],
"parent": "RunColumnTestStation",
"type": "container",
"class": null,
"position": {
"x": 300,
"y": 500,
"z": 0
},
"config": {
"max_volume": 2000.0
},
"data": {
"liquid": [
{
"name": "ethyl_acetate",
"volume": 1500.0,
"concentration": 99.5
}
]
}
},
{
"id": "flask_methanol",
"name": "甲醇洗脱剂",
"children": [],
"parent": "RunColumnTestStation",
"type": "container",
"class": null,
"position": {
"x": 400,
"y": 500,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": [
{
"name": "methanol",
"volume": 800.0,
"concentration": 99.9
}
]
}
},
{
"id": "column_vessel",
"name": "柱容器",
"children": [],
"parent": "RunColumnTestStation",
"type": "container",
"class": null,
"position": {
"x": 600,
"y": 450,
"z": 0
},
"config": {
"max_volume": 300.0
},
"data": {
"liquid": []
}
},
{
"id": "collection_flask_1",
"name": "收集瓶1",
"children": [],
"parent": "RunColumnTestStation",
"type": "container",
"class": null,
"position": {
"x": 700,
"y": 500,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": []
}
},
{
"id": "collection_flask_2",
"name": "收集瓶2",
"children": [],
"parent": "RunColumnTestStation",
"type": "container",
"class": null,
"position": {
"x": 800,
"y": 500,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": []
}
},
{
"id": "collection_flask_3",
"name": "收集瓶3",
"children": [],
"parent": "RunColumnTestStation",
"type": "container",
"class": null,
"position": {
"x": 900,
"y": 500,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": []
}
},
{
"id": "waste_flask",
"name": "废液瓶",
"children": [],
"parent": "RunColumnTestStation",
"type": "container",
"class": null,
"position": {
"x": 1000,
"y": 500,
"z": 0
},
"config": {
"max_volume": 2000.0
},
"data": {
"liquid": []
}
},
{
"id": "main_reactor",
"name": "反应器",
"children": [],
"parent": "RunColumnTestStation",
"type": "container",
"class": null,
"position": {
"x": 600,
"y": 300,
"z": 0
},
"config": {
"max_volume": 1000.0
},
"data": {
"liquid": [
{
"name": "reaction_mixture",
"volume": 300.0,
"concentration": 85.0
}
]
}
}
],
"links": [
{
"id": "link_pump_valve",
"source": "transfer_pump_1",
"target": "multiway_valve_1",
"type": "fluid",
"port": {
"transfer_pump_1": "transferpump",
"multiway_valve_1": "transferpump"
}
},
{
"id": "link_valve_sample",
"source": "multiway_valve_1",
"target": "flask_sample",
"type": "fluid",
"port": {
"multiway_valve_1": "1",
"flask_sample": "outlet"
}
},
{
"id": "link_valve_hexane",
"source": "multiway_valve_1",
"target": "flask_hexane",
"type": "fluid",
"port": {
"multiway_valve_1": "2",
"flask_hexane": "outlet"
}
},
{
"id": "link_valve_ethyl_acetate",
"source": "multiway_valve_1",
"target": "flask_ethyl_acetate",
"type": "fluid",
"port": {
"multiway_valve_1": "3",
"flask_ethyl_acetate": "outlet"
}
},
{
"id": "link_valve_methanol",
"source": "multiway_valve_1",
"target": "flask_methanol",
"type": "fluid",
"port": {
"multiway_valve_1": "4",
"flask_methanol": "outlet"
}
},
{
"id": "link_valve_column_vessel",
"source": "multiway_valve_1",
"target": "column_vessel",
"type": "fluid",
"port": {
"multiway_valve_1": "5",
"column_vessel": "inlet"
}
},
{
"id": "link_valve_collection1",
"source": "multiway_valve_1",
"target": "collection_flask_1",
"type": "fluid",
"port": {
"multiway_valve_1": "6",
"collection_flask_1": "inlet"
}
},
{
"id": "link_valve_collection2",
"source": "multiway_valve_1",
"target": "collection_flask_2",
"type": "fluid",
"port": {
"multiway_valve_1": "7",
"collection_flask_2": "inlet"
}
},
{
"id": "link_valve_waste",
"source": "multiway_valve_1",
"target": "waste_flask",
"type": "fluid",
"port": {
"multiway_valve_1": "8",
"waste_flask": "inlet"
}
},
{
"id": "link_column_device_vessel",
"source": "column_1",
"target": "column_vessel",
"type": "transport",
"port": {
"column_1": "columnin",
"column_vessel": "column_port"
}
},
{
"id": "link_column_collection3",
"source": "column_1",
"target": "collection_flask_3",
"type": "transport",
"port": {
"column_1": "columnout",
"collection_flask_3": "column_outlet"
}
}
]
}

View File

@@ -29,8 +29,6 @@
这个重复了删掉TransferProtocol: generate_transfer_protocol,
CleanVesselProtocol: generate_clean_vessel_protocol, (√)
DissolveProtocol: generate_dissolve_protocol, (√)
FilterThroughProtocol: generate_filter_through_protocol, (√)
FilterThroughProtocol: generate_filter_through_protocol, (×)
RunColumnProtocol: generate_run_column_protocol, (×)
WashSolidProtocol: generate_wash_solid_protocol, (×)
上下文体积搜索

View File

@@ -1,8 +1,8 @@
{
"nodes": [
{
"id": "OrganicSynthesisStation",
"name": "有机化学流程综合测试工作站",
"id": "ComprehensiveProtocolStation",
"name": "综合协议测试工作站",
"children": [
"multiway_valve_1",
"multiway_valve_2",
@@ -69,7 +69,7 @@
"id": "multiway_valve_1",
"name": "八通阀门1",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_multiway_valve",
"position": {
@@ -89,7 +89,7 @@
"id": "multiway_valve_2",
"name": "八通阀门2",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_multiway_valve",
"position": {
@@ -109,7 +109,7 @@
"id": "transfer_pump_1",
"name": "转移泵1",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_transfer_pump",
"position": {
@@ -130,7 +130,7 @@
"id": "transfer_pump_2",
"name": "转移泵2",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_transfer_pump",
"position": {
@@ -151,7 +151,7 @@
"id": "reagent_bottle_1",
"name": "试剂瓶1-DMF",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -172,7 +172,7 @@
"id": "reagent_bottle_2",
"name": "试剂瓶2-乙酸乙酯",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -193,7 +193,7 @@
"id": "reagent_bottle_3",
"name": "试剂瓶3-己烷",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -214,7 +214,7 @@
"id": "reagent_bottle_4",
"name": "试剂瓶4-甲醇",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -235,7 +235,7 @@
"id": "reagent_bottle_5",
"name": "试剂瓶5-水",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -256,7 +256,7 @@
"id": "centrifuge_1",
"name": "离心机",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_centrifuge",
"position": {
@@ -278,7 +278,7 @@
"id": "rotavap_1",
"name": "旋转蒸发仪",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_rotavap",
"position": {
@@ -300,7 +300,7 @@
"id": "main_reactor",
"name": "主反应器",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -324,7 +324,7 @@
"id": "heater_1",
"name": "加热器",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_heatchill",
"position": {
@@ -345,7 +345,7 @@
"id": "stirrer_1",
"name": "搅拌器1",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_stirrer",
"position": {
@@ -361,11 +361,11 @@
"current_speed": 0.0
}
},
{
{
"id": "stirrer_2",
"name": "搅拌器2",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_stirrer",
"position": {
@@ -385,7 +385,7 @@
"id": "waste_bottle_1",
"name": "废液瓶1",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -404,7 +404,7 @@
"id": "waste_bottle_2",
"name": "废液瓶2",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -423,7 +423,7 @@
"id": "solenoid_valve_1",
"name": "电磁阀1",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_solenoid_valve",
"position": {
@@ -444,7 +444,7 @@
"id": "solenoid_valve_2",
"name": "电磁阀2",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_solenoid_valve",
"position": {
@@ -465,7 +465,7 @@
"id": "vacuum_pump_1",
"name": "真空泵",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_vacuum_pump",
"position": {
@@ -486,7 +486,7 @@
"id": "gas_source_1",
"name": "气源",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_gas_source",
"position": {
@@ -504,7 +504,7 @@
"id": "filter_1",
"name": "过滤器",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_filter",
"position": {
@@ -525,7 +525,7 @@
"id": "column_1",
"name": "洗脱柱",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_column",
"position": {
@@ -547,7 +547,7 @@
"id": "separator_1",
"name": "分液器",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "device",
"class": "virtual_separator",
"position": {
@@ -568,7 +568,7 @@
"id": "collection_bottle_1",
"name": "接收瓶1",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -587,7 +587,7 @@
"id": "collection_bottle_2",
"name": "接收瓶2",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -606,7 +606,7 @@
"id": "collection_bottle_3",
"name": "接收瓶3",
"children": [],
"parent": "OrganicSynthesisStation",
"parent": "ComprehensiveProtocolStation",
"type": "container",
"class": "container",
"position": {
@@ -624,13 +624,13 @@
],
"links": [
{
"id": "link_pump1_valve1",
"source": "transfer_pump_1",
"target": "multiway_valve_1",
"id": "link_valve1_pump1",
"source": "multiway_valve_1",
"target": "transfer_pump_1",
"type": "fluid",
"port": {
"transfer_pump_1": "transferpump",
"multiway_valve_1": "transferpump"
"multiway_valve_1": "transferpump",
"transfer_pump_1": "transferpump"
}
},
{
@@ -667,7 +667,7 @@
"id": "link_valve1_centrifuge",
"source": "multiway_valve_1",
"target": "centrifuge_1",
"type": "transport",
"type": "fluid",
"port": {
"multiway_valve_1": "4",
"centrifuge_1": "centrifuge"
@@ -680,7 +680,7 @@
"type": "fluid",
"port": {
"multiway_valve_1": "5",
"rotavap_1": "sample_in"
"rotavap_1": "rotavap-sample"
}
},
{
@@ -714,13 +714,13 @@
}
},
{
"id": "link_pump2_valve2",
"source": "transfer_pump_2",
"target": "multiway_valve_2",
"id": "link_valve2_pump2",
"source": "multiway_valve_2",
"target": "transfer_pump_2",
"type": "fluid",
"port": {
"transfer_pump_2": "transferpump",
"multiway_valve_2": "transferpump"
"multiway_valve_2": "transferpump",
"transfer_pump_2": "transferpump"
}
},
{
@@ -734,13 +734,13 @@
}
},
{
"id": "link_vacuum_solenoid1",
"source": "vacuum_pump_1",
"target": "solenoid_valve_1",
"id": "link_solenoid1_vacuum",
"source": "solenoid_valve_1",
"target": "vacuum_pump_1",
"type": "fluid",
"port": {
"vacuum_pump_1": "vacuumpump",
"solenoid_valve_1": "out"
"solenoid_valve_1": "out",
"vacuum_pump_1": "vacuumpump"
}
},
{
@@ -754,30 +754,40 @@
}
},
{
"id": "link_gas_solenoid2",
"source": "gas_source_1",
"target": "solenoid_valve_2",
"id": "link_solenoid2_gas",
"source": "solenoid_valve_2",
"target": "gas_source_1",
"type": "fluid",
"port": {
"gas_source_1": "gassource",
"solenoid_valve_2": "out"
"solenoid_valve_2": "out",
"gas_source_1": "gassource"
}
},
{
"id": "link_valve2_filter",
"source": "multiway_valve_2",
"target": "filter_1",
"type": "transport",
"type": "fluid",
"port": {
"multiway_valve_2": "4",
"filter_1": "filter_in"
"filter_1": "filterin"
}
},
{
"id": "link_filter_collection1",
"source": "filter_1",
"target": "collection_bottle_1",
"type": "fluid",
"port": {
"filter_1": "filtrate_out",
"collection_bottle_1": "top"
}
},
{
"id": "link_valve2_column",
"source": "multiway_valve_2",
"target": "column_1",
"type": "transport",
"type": "fluid",
"port": {
"multiway_valve_2": "5",
"column_1": "columnin"
@@ -787,7 +797,7 @@
"id": "link_column_collection2",
"source": "column_1",
"target": "collection_bottle_2",
"type": "transport",
"type": "fluid",
"port": {
"column_1": "columnout",
"collection_bottle_2": "top"
@@ -800,7 +810,7 @@
"type": "fluid",
"port": {
"multiway_valve_2": "6",
"separator_1": "separator_in"
"separator_1": "separatorin"
}
},
{
@@ -809,10 +819,30 @@
"target": "collection_bottle_3",
"type": "fluid",
"port": {
"separator_1": "bottom_phase_out",
"separator_1": "separatorout",
"collection_bottle_3": "top"
}
},
{
"id": "link_separator_stirrer_2",
"source": "separator_1",
"target": "stirrer_2",
"type": "fluid",
"port": {
"separator_1": "separatorout",
"stirrer_2": "stirrer"
}
},
{
"id": "link_separator_waste2",
"source": "separator_1",
"target": "waste_bottle_2",
"type": "fluid",
"port": {
"separator_1": "separatorout",
"waste_bottle_2": "top"
}
},
{
"id": "link_valve2_reagent4",
"source": "multiway_valve_2",
@@ -837,60 +867,20 @@
"id": "mech_stirrer_reactor",
"source": "stirrer_1",
"target": "main_reactor",
"type": "mechanical",
"type": "fluid",
"port": {
"stirrer_1": "stirrer",
"main_reactor": "bind"
"main_reactor": "top"
}
},
{
"id": "thermal_heater_reactor",
"source": "heater_1",
"target": "main_reactor",
"type": "mechanical",
"port": {
"heater_1": "heatchill",
"main_reactor": "bind"
}
},
{
"id": "link_separator_waste2",
"source": "separator_1",
"target": "waste_bottle_2",
"type": "fluid",
"port": {
"separator_1": "top_phase_out",
"waste_bottle_2": "top"
}
},
{
"id": "mech_stirrer2_separator",
"source": "stirrer_2",
"target": "separator_1",
"type": "mechanical",
"port": {
"stirrer_2": "stirrer",
"separator_1": "bind"
}
},
{
"id": "link_filter_filtrate_to_collection1",
"source": "filter_1",
"target": "collection_bottle_1",
"type": "transport",
"port": {
"filter_1": "filtrate_out",
"collection_bottle_1": "top"
}
},
{
"id": "link_filter_retentate_to_waste1",
"source": "filter_1",
"target": "waste_bottle_1",
"type": "transport",
"port": {
"filter_1": "retentate_out",
"waste_bottle_1": "top"
"heater_1": "heatchill",
"main_reactor": "bottom"
}
}
]

View File

@@ -140,8 +140,8 @@
}
},
{
"source": "vacuum_pump",
"target": "vacuum_valve",
"source": "vacuum_valve",
"target": "vacuum_pump",
"type": "fluid",
"port": {
"vacuum_pump": "out",
@@ -149,8 +149,8 @@
}
},
{
"source": "gas_source",
"target": "gas_valve",
"source": "gas_valve",
"target": "gas_source",
"type": "fluid",
"port": {
"gas_source": "out",

View File

@@ -25,25 +25,26 @@ from .wash_solid_protocol import generate_wash_solid_protocol
# Define a dictionary of protocol generators.
action_protocol_generators = {
AddProtocol: generate_add_protocol,
PumpTransferProtocol: generate_pump_protocol_with_rinsing,
CleanProtocol: generate_clean_protocol,
SeparateProtocol: generate_separate_protocol,
EvaporateProtocol: generate_evaporate_protocol,
EvacuateAndRefillProtocol: generate_evacuateandrefill_protocol,
AGVTransferProtocol: generate_agv_transfer_protocol,
CentrifugeProtocol: generate_centrifuge_protocol,
CleanProtocol: generate_clean_protocol,
CleanVesselProtocol: generate_clean_vessel_protocol,
DissolveProtocol: generate_dissolve_protocol,
EvacuateAndRefillProtocol: generate_evacuateandrefill_protocol,
EvaporateProtocol: generate_evaporate_protocol,
AddProtocol: generate_add_protocol,
FilterProtocol: generate_filter_protocol,
FilterThroughProtocol: generate_filter_through_protocol,
HeatChillProtocol: generate_heat_chill_protocol,
HeatChillStartProtocol: generate_heat_chill_start_protocol,
HeatChillStopProtocol: generate_heat_chill_stop_protocol,
PumpTransferProtocol: generate_pump_protocol_with_rinsing,
RunColumnProtocol: generate_run_column_protocol,
SeparateProtocol: generate_separate_protocol,
StartStirProtocol: generate_start_stir_protocol,
# HeatChillToTempProtocol: generate_heat_chill_to_temp_protocol, # **移除这行**
StirProtocol: generate_stir_protocol,
StartStirProtocol: generate_start_stir_protocol,
StopStirProtocol: generate_stop_stir_protocol,
TransferProtocol: generate_transfer_protocol,
CleanVesselProtocol: generate_clean_vessel_protocol,
DissolveProtocol: generate_dissolve_protocol,
FilterThroughProtocol: generate_filter_through_protocol,
RunColumnProtocol: generate_run_column_protocol,
WashSolidProtocol: generate_wash_solid_protocol,
}
}

View File

@@ -5,10 +5,7 @@ from .pump_protocol import generate_pump_protocol_with_rinsing
def find_reagent_vessel(G: nx.DiGraph, reagent: str) -> str:
"""
根据试剂名称查找对应的试剂瓶,支持多种匹配模式:
1. 容器名称匹配(如 flask_DMF, reagent_bottle_1-DMF
2. 容器内液体类型匹配(如 liquid_type: "DMF", name: "ethanol"
3. 试剂名称匹配(如 reagent_name: "DMF", config.reagent: "ethyl_acetate"
根据试剂名称查找对应的试剂瓶
Args:
G: 网络图
@@ -20,184 +17,23 @@ def find_reagent_vessel(G: nx.DiGraph, reagent: str) -> str:
Raises:
ValueError: 如果找不到对应的试剂瓶
"""
print(f"ADD_PROTOCOL: 正在查找试剂 '{reagent}' 的容器...")
# 按照pump_protocol的命名规则查找试剂瓶
reagent_vessel_id = f"flask_{reagent}"
# 第一步:通过容器名称匹配
possible_names = [
f"flask_{reagent}", # flask_DMF, flask_ethanol
f"bottle_{reagent}", # bottle_DMF, bottle_ethanol
f"vessel_{reagent}", # vessel_DMF, vessel_ethanol
f"{reagent}_flask", # DMF_flask, ethanol_flask
f"{reagent}_bottle", # DMF_bottle, ethanol_bottle
f"{reagent}", # 直接用试剂名
f"reagent_{reagent}", # reagent_DMF, reagent_ethanol
f"reagent_bottle_{reagent}", # reagent_bottle_DMF
]
if reagent_vessel_id in G.nodes():
return reagent_vessel_id
# 尝试名称匹配
for vessel_name in possible_names:
if vessel_name in G.nodes():
print(f"ADD_PROTOCOL: 通过名称匹配找到容器: {vessel_name}")
return vessel_name
# 如果直接匹配失败,尝试模糊匹配
for node in G.nodes():
if node.startswith('flask_') and reagent.lower() in node.lower():
return node
# 第二步:通过模糊名称匹配(名称中包含试剂名)
for node_id in G.nodes():
if G.nodes[node_id].get('type') == 'container':
# 检查节点ID或名称中是否包含试剂名
node_name = G.nodes[node_id].get('name', '').lower()
if (reagent.lower() in node_id.lower() or
reagent.lower() in node_name):
print(f"ADD_PROTOCOL: 通过模糊名称匹配找到容器: {node_id} (名称: {node_name})")
return node_id
# 如果还是找不到,列出所有可用的试剂瓶
available_flasks = [node for node in G.nodes()
if node.startswith('flask_')
and G.nodes[node].get('type') == 'container']
# 第三步:通过液体类型匹配
for node_id in G.nodes():
if G.nodes[node_id].get('type') == 'container':
vessel_data = G.nodes[node_id].get('data', {})
liquids = vessel_data.get('liquid', [])
for liquid in liquids:
if isinstance(liquid, dict):
# 支持两种格式的液体类型字段
liquid_type = liquid.get('liquid_type') or liquid.get('name', '')
reagent_name = vessel_data.get('reagent_name', '')
config_reagent = G.nodes[node_id].get('config', {}).get('reagent', '')
# 检查多个可能的字段
if (liquid_type.lower() == reagent.lower() or
reagent_name.lower() == reagent.lower() or
config_reagent.lower() == reagent.lower()):
print(f"ADD_PROTOCOL: 通过液体类型匹配找到容器: {node_id}")
print(f" - liquid_type: {liquid_type}")
print(f" - reagent_name: {reagent_name}")
print(f" - config.reagent: {config_reagent}")
return node_id
# 第四步:列出所有可用的容器信息帮助调试
available_containers = []
for node_id in G.nodes():
if G.nodes[node_id].get('type') == 'container':
vessel_data = G.nodes[node_id].get('data', {})
config_data = G.nodes[node_id].get('config', {})
liquids = vessel_data.get('liquid', [])
container_info = {
'id': node_id,
'name': G.nodes[node_id].get('name', ''),
'liquid_types': [],
'reagent_name': vessel_data.get('reagent_name', ''),
'config_reagent': config_data.get('reagent', '')
}
for liquid in liquids:
if isinstance(liquid, dict):
liquid_type = liquid.get('liquid_type') or liquid.get('name', '')
if liquid_type:
container_info['liquid_types'].append(liquid_type)
available_containers.append(container_info)
print(f"ADD_PROTOCOL: 可用容器列表:")
for container in available_containers:
print(f" - {container['id']}: {container['name']}")
print(f" 液体类型: {container['liquid_types']}")
print(f" 试剂名称: {container['reagent_name']}")
print(f" 配置试剂: {container['config_reagent']}")
raise ValueError(f"找不到试剂 '{reagent}' 对应的试剂瓶。尝试了名称匹配: {possible_names}")
def find_reagent_vessel_by_any_match(G: nx.DiGraph, reagent: str) -> str:
"""
增强版试剂容器查找,支持各种匹配方式的别名函数
"""
return find_reagent_vessel(G, reagent)
def get_vessel_reagent_volume(G: nx.DiGraph, vessel: str) -> float:
"""获取容器中的试剂体积"""
if vessel not in G.nodes():
return 0.0
vessel_data = G.nodes[vessel].get('data', {})
liquids = vessel_data.get('liquid', [])
total_volume = 0.0
for liquid in liquids:
if isinstance(liquid, dict):
# 支持两种格式:新格式 (name, volume) 和旧格式 (liquid_type, liquid_volume)
volume = liquid.get('volume') or liquid.get('liquid_volume', 0.0)
total_volume += volume
return total_volume
def get_vessel_reagent_types(G: nx.DiGraph, vessel: str) -> List[str]:
"""获取容器中所有试剂的类型"""
if vessel not in G.nodes():
return []
vessel_data = G.nodes[vessel].get('data', {})
liquids = vessel_data.get('liquid', [])
reagent_types = []
for liquid in liquids:
if isinstance(liquid, dict):
# 支持两种格式的试剂类型字段
reagent_type = liquid.get('liquid_type') or liquid.get('name', '')
if reagent_type:
reagent_types.append(reagent_type)
# 同时检查配置中的试剂信息
config_reagent = G.nodes[vessel].get('config', {}).get('reagent', '')
reagent_name = vessel_data.get('reagent_name', '')
if config_reagent and config_reagent not in reagent_types:
reagent_types.append(config_reagent)
if reagent_name and reagent_name not in reagent_types:
reagent_types.append(reagent_name)
return reagent_types
def find_vessels_by_reagent(G: nx.DiGraph, reagent: str) -> List[str]:
"""
根据试剂类型查找所有匹配的容器
返回匹配容器的ID列表
"""
matching_vessels = []
for node_id in G.nodes():
if G.nodes[node_id].get('type') == 'container':
# 检查容器名称匹配
node_name = G.nodes[node_id].get('name', '').lower()
if reagent.lower() in node_id.lower() or reagent.lower() in node_name:
matching_vessels.append(node_id)
continue
# 检查试剂类型匹配
vessel_data = G.nodes[node_id].get('data', {})
liquids = vessel_data.get('liquid', [])
config_data = G.nodes[node_id].get('config', {})
# 检查 reagent_name 和 config.reagent
reagent_name = vessel_data.get('reagent_name', '').lower()
config_reagent = config_data.get('reagent', '').lower()
if (reagent.lower() == reagent_name or
reagent.lower() == config_reagent):
matching_vessels.append(node_id)
continue
# 检查液体列表
for liquid in liquids:
if isinstance(liquid, dict):
liquid_type = liquid.get('liquid_type') or liquid.get('name', '')
if liquid_type.lower() == reagent.lower():
matching_vessels.append(node_id)
break
return matching_vessels
raise ValueError(f"找不到试剂 '{reagent}' 对应的试剂瓶。可用试剂瓶: {available_flasks}")
def find_connected_stirrer(G: nx.DiGraph, vessel: str) -> str:
@@ -213,7 +49,7 @@ def find_connected_stirrer(G: nx.DiGraph, vessel: str) -> str:
"""
# 查找所有搅拌器节点
stirrer_nodes = [node for node in G.nodes()
if (G.nodes[node].get('class') or '') == 'virtual_stirrer']
if G.nodes[node].get('class') == 'virtual_stirrer']
# 检查哪个搅拌器与目标容器相连
for stirrer in stirrer_nodes:
@@ -238,10 +74,10 @@ def generate_add_protocol(
purpose: str = "添加试剂"
) -> List[Dict[str, Any]]:
"""
生成添加试剂的协议序列,支持智能试剂匹配
生成添加试剂的协议序列
基于pump_protocol的成熟算法实现试剂添加功能
1. 智能查找试剂瓶(支持名称匹配、液体类型匹配、试剂配置匹配)
1. 自动查找试剂瓶
2. **先启动搅拌,再进行转移** - 确保试剂添加更均匀
3. 使用pump_protocol实现液体转移
@@ -266,41 +102,24 @@ def generate_add_protocol(
"""
action_sequence = []
print(f"ADD_PROTOCOL: 开始生成添加试剂协议")
print(f" - 目标容器: {vessel}")
print(f" - 试剂: {reagent}")
print(f" - 体积: {volume} mL")
print(f" - 质量: {mass} g")
print(f" - 搅拌: {stir} (速度: {stir_speed} RPM)")
print(f" - 粘稠: {viscous}")
print(f" - 目的: {purpose}")
# 1. 验证目标容器存在
if vessel not in G.nodes():
raise ValueError(f"目标容器 '{vessel}' 不存在于系统中")
# 2. 智能查找试剂瓶
# 2. 查找试剂瓶
try:
reagent_vessel = find_reagent_vessel(G, reagent)
print(f"ADD_PROTOCOL: 找到试剂容器: {reagent_vessel}")
except ValueError as e:
raise ValueError(f"无法找到试剂 '{reagent}': {str(e)}")
# 3. 验证试剂容器中的试剂体积
available_volume = get_vessel_reagent_volume(G, reagent_vessel)
print(f"ADD_PROTOCOL: 试剂容器 {reagent_vessel} 中有 {available_volume} mL 试剂")
if available_volume < volume:
print(f"ADD_PROTOCOL: 警告 - 试剂容器中的试剂不足!需要 {volume} mL可用 {available_volume} mL")
# 4. 验证是否存在从试剂瓶到目标容器的路径
# 3. 验证是否存在从试剂瓶到目标容器的路径
try:
path = nx.shortest_path(G, source=reagent_vessel, target=vessel)
print(f"ADD_PROTOCOL: 找到路径 {reagent_vessel} -> {vessel}: {path}")
except nx.NetworkXNoPath:
raise ValueError(f"从试剂瓶 '{reagent_vessel}' 到目标容器 '{vessel}' 没有可用路径")
# 5. **先启动搅拌** - 关键改进!
# 4. **先启动搅拌** - 关键改进!
if stir:
try:
stirrer_id = find_connected_stirrer(G, vessel)
@@ -321,21 +140,15 @@ def generate_add_protocol(
action_sequence.append(stir_action)
print(f"ADD_PROTOCOL: 已添加搅拌动作,速度 {stir_speed} RPM")
# 等待搅拌稳定
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": 5}
})
else:
print(f"ADD_PROTOCOL: 警告 - 需要搅拌但未找到与容器 {vessel} 相连的搅拌器")
except Exception as e:
print(f"ADD_PROTOCOL: 搅拌器配置出错: {str(e)}")
# 6. 如果指定了体积,执行液体转移
# 5. 如果指定了体积,执行液体转移
if volume > 0:
# 6.1 计算流速参数
# 5.1 计算流速参数
if time > 0:
# 根据时间计算流速
transfer_flowrate = volume / time
@@ -352,7 +165,7 @@ def generate_add_protocol(
print(f"ADD_PROTOCOL: 准备转移 {volume} mL 从 {reagent_vessel}{vessel}")
print(f"ADD_PROTOCOL: 转移流速={transfer_flowrate} mL/s, 注入流速={flowrate} mL/s")
# 6.2 使用pump_protocol的核心算法实现液体转移
# 5.2 使用pump_protocol的核心算法实现液体转移
try:
pump_actions = generate_pump_protocol_with_rinsing(
G=G,
@@ -377,8 +190,6 @@ def generate_add_protocol(
raise ValueError(f"生成泵协议时出错: {str(e)}")
print(f"ADD_PROTOCOL: 生成了 {len(action_sequence)} 个动作")
print(f"ADD_PROTOCOL: 添加试剂协议生成完成")
return action_sequence
@@ -399,7 +210,7 @@ def generate_add_protocol_with_cleaning(
cleaning_repeats: int = 1
) -> List[Dict[str, Any]]:
"""
生成带清洗的添加试剂协议,支持智能试剂匹配
生成带清洗的添加试剂协议
与普通添加协议的区别是会在添加后进行管道清洗
@@ -424,7 +235,7 @@ def generate_add_protocol_with_cleaning(
"""
action_sequence = []
# 1. 智能查找试剂瓶
# 1. 查找试剂瓶
reagent_vessel = find_reagent_vessel(G, reagent)
# 2. **先启动搅拌**
@@ -440,12 +251,6 @@ def generate_add_protocol_with_cleaning(
"purpose": f"{purpose}: 启动搅拌,准备添加 {reagent}"
}
})
# 等待搅拌稳定
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": 5}
})
# 3. 计算流速
if time > 0:
@@ -491,7 +296,7 @@ def generate_sequential_add_protocol(
final_stir_time: float = 300.0
) -> List[Dict[str, Any]]:
"""
生成连续添加多种试剂的协议,支持智能试剂匹配
生成连续添加多种试剂的协议
Args:
G: 网络图
@@ -508,13 +313,13 @@ def generate_sequential_add_protocol(
Example:
reagents = [
{
"reagent": "DMF", # 会匹配 reagent_bottle_1 (reagent_name: "DMF")
"reagent": "DMF",
"volume": 10.0,
"viscous": False,
"stir_speed": 300.0
},
{
"reagent": "ethyl_acetate", # 会匹配 reagent_bottle_2 (reagent_name: "ethyl_acetate")
"reagent": "ethyl_acetate",
"volume": 5.0,
"viscous": False,
"stir_speed": 350.0
@@ -523,17 +328,14 @@ def generate_sequential_add_protocol(
"""
action_sequence = []
print(f"ADD_PROTOCOL: 开始连续添加 {len(reagents)} 种试剂到容器 {vessel}")
for i, reagent_params in enumerate(reagents):
reagent_name = reagent_params.get('reagent')
print(f"ADD_PROTOCOL: 处理第 {i+1}/{len(reagents)} 个试剂: {reagent_name}")
print(f"ADD_PROTOCOL: 处理第 {i+1}/{len(reagents)} 个试剂: {reagent_params.get('reagent')}")
# 生成单个试剂的添加协议
add_actions = generate_add_protocol(
G=G,
vessel=vessel,
reagent=reagent_name,
reagent=reagent_params.get('reagent'),
volume=reagent_params.get('volume', 0.0),
mass=reagent_params.get('mass', 0.0),
amount=reagent_params.get('amount', ''),
@@ -541,7 +343,7 @@ def generate_sequential_add_protocol(
stir=stir_between_additions,
stir_speed=reagent_params.get('stir_speed', 300.0),
viscous=reagent_params.get('viscous', False),
purpose=reagent_params.get('purpose', f'添加试剂 {reagent_name} ({i+1}/{len(reagents)})')
purpose=reagent_params.get('purpose', f'添加试剂 {i+1}')
)
action_sequence.extend(add_actions)
@@ -550,23 +352,17 @@ def generate_sequential_add_protocol(
if i < len(reagents) - 1: # 不是最后一个试剂
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": 10} # 试剂混合时间
"action_kwargs": {"time": 2}
})
# 最终搅拌
if final_stir:
stirrer_id = find_connected_stirrer(G, vessel)
if stirrer_id:
print(f"ADD_PROTOCOL: 添加最终搅拌动作,速度 {final_stir_speed} RPM时间 {final_stir_time}")
action_sequence.extend([
{
"device_id": stirrer_id,
"action_name": "stir",
"action_kwargs": {
"stir_time": final_stir_time,
"stir_speed": final_stir_speed,
"settling_time": 30.0
}
"action_name": "wait",
"action_kwargs": {"time": final_stir_time}
}
])
@@ -574,52 +370,10 @@ def generate_sequential_add_protocol(
return action_sequence
# 便捷函数:常用添加方案
def generate_organic_add_protocol(
G: nx.DiGraph,
vessel: str,
organic_reagent: str,
volume: float,
stir_speed: float = 400.0
) -> List[Dict[str, Any]]:
"""有机试剂添加:慢速、搅拌"""
return generate_add_protocol(
G, vessel, organic_reagent, volume, 0.0, "", 0.0,
True, stir_speed, False, f"添加有机试剂 {organic_reagent}"
)
def generate_viscous_add_protocol(
G: nx.DiGraph,
vessel: str,
viscous_reagent: str,
volume: float,
addition_time: float = 120.0
) -> List[Dict[str, Any]]:
"""粘稠试剂添加:慢速、长时间"""
return generate_add_protocol(
G, vessel, viscous_reagent, volume, 0.0, "", addition_time,
True, 250.0, True, f"缓慢添加粘稠试剂 {viscous_reagent}"
)
def generate_solvent_add_protocol(
G: nx.DiGraph,
vessel: str,
solvent: str,
volume: float
) -> List[Dict[str, Any]]:
"""溶剂添加:快速、无需特殊处理"""
return generate_add_protocol(
G, vessel, solvent, volume, 0.0, "", 0.0,
False, 300.0, False, f"添加溶剂 {solvent}"
)
# 使用示例和测试函数
def test_add_protocol():
"""测试添加协议的示例"""
print("=== ADD PROTOCOL 智能匹配测试 ===")
print("=== ADD PROTOCOL 测试 ===")
print("测试完成")

View File

@@ -5,13 +5,9 @@ from .pump_protocol import generate_pump_protocol
def find_solvent_vessel(G: nx.DiGraph, solvent: str) -> str:
"""
查找溶剂容器,支持多种匹配模式
1. 容器名称匹配(如 flask_water, reagent_bottle_1-DMF
2. 容器内液体类型匹配(如 liquid_type: "DMF", "ethanol"
查找溶剂容器,支持多种命名模式
"""
print(f"CLEAN_VESSEL: 正在查找溶剂 '{solvent}' 的容器...")
# 第一步:通过容器名称匹配
# 可能的溶剂容器命名模式
possible_names = [
f"flask_{solvent}", # flask_water, flask_ethanol
f"bottle_{solvent}", # bottle_water, bottle_ethanol
@@ -20,87 +16,13 @@ def find_solvent_vessel(G: nx.DiGraph, solvent: str) -> str:
f"{solvent}_bottle", # water_bottle, ethanol_bottle
f"{solvent}", # 直接用溶剂名
f"solvent_{solvent}", # solvent_water, solvent_ethanol
f"reagent_bottle_{solvent}", # reagent_bottle_DMF
]
# 尝试名称匹配
for vessel_name in possible_names:
if vessel_name in G.nodes():
print(f"CLEAN_VESSEL: 通过名称匹配找到容器: {vessel_name}")
return vessel_name
# 第二步:通过模糊名称匹配(名称中包含溶剂名)
for node_id in G.nodes():
if G.nodes[node_id].get('type') == 'container':
# 检查节点ID或名称中是否包含溶剂名
node_name = G.nodes[node_id].get('name', '').lower()
if (solvent.lower() in node_id.lower() or
solvent.lower() in node_name):
print(f"CLEAN_VESSEL: 通过模糊名称匹配找到容器: {node_id} (名称: {node_name})")
return node_id
# 第三步:通过液体类型匹配
for node_id in G.nodes():
if G.nodes[node_id].get('type') == 'container':
vessel_data = G.nodes[node_id].get('data', {})
liquids = vessel_data.get('liquid', [])
for liquid in liquids:
if isinstance(liquid, dict):
# 支持两种格式的液体类型字段
liquid_type = liquid.get('liquid_type') or liquid.get('name', '')
reagent_name = vessel_data.get('reagent_name', '')
config_reagent = G.nodes[node_id].get('config', {}).get('reagent', '')
# 检查多个可能的字段
if (liquid_type.lower() == solvent.lower() or
reagent_name.lower() == solvent.lower() or
config_reagent.lower() == solvent.lower()):
print(f"CLEAN_VESSEL: 通过液体类型匹配找到容器: {node_id}")
print(f" - liquid_type: {liquid_type}")
print(f" - reagent_name: {reagent_name}")
print(f" - config.reagent: {config_reagent}")
return node_id
# 第四步:列出所有可用的容器信息帮助调试
available_containers = []
for node_id in G.nodes():
if G.nodes[node_id].get('type') == 'container':
vessel_data = G.nodes[node_id].get('data', {})
config_data = G.nodes[node_id].get('config', {})
liquids = vessel_data.get('liquid', [])
container_info = {
'id': node_id,
'name': G.nodes[node_id].get('name', ''),
'liquid_types': [],
'reagent_name': vessel_data.get('reagent_name', ''),
'config_reagent': config_data.get('reagent', '')
}
for liquid in liquids:
if isinstance(liquid, dict):
liquid_type = liquid.get('liquid_type') or liquid.get('name', '')
if liquid_type:
container_info['liquid_types'].append(liquid_type)
available_containers.append(container_info)
print(f"CLEAN_VESSEL: 可用容器列表:")
for container in available_containers:
print(f" - {container['id']}: {container['name']}")
print(f" 液体类型: {container['liquid_types']}")
print(f" 试剂名称: {container['reagent_name']}")
print(f" 配置试剂: {container['config_reagent']}")
raise ValueError(f"未找到溶剂 '{solvent}' 的容器。尝试了名称匹配: {possible_names}")
def find_solvent_vessel_by_any_match(G: nx.DiGraph, solvent: str) -> str:
"""
增强版溶剂容器查找,支持各种匹配方式的别名函数
"""
return find_solvent_vessel(G, solvent)
raise ValueError(f"未找到溶剂 '{solvent}' 的容器。尝试了以下名称: {possible_names}")
def find_waste_vessel(G: nx.DiGraph) -> str:
@@ -359,81 +281,4 @@ def generate_organic_clean_protocol(
)
action_sequence.extend(water_actions)
return action_sequence
def get_vessel_liquid_volume(G: nx.DiGraph, vessel: str) -> float:
"""获取容器中的液体体积(修复版)"""
if vessel not in G.nodes():
return 0.0
vessel_data = G.nodes[vessel].get('data', {})
liquids = vessel_data.get('liquid', [])
total_volume = 0.0
for liquid in liquids:
if isinstance(liquid, dict):
# 支持两种格式:新格式 (name, volume) 和旧格式 (liquid_type, liquid_volume)
volume = liquid.get('volume') or liquid.get('liquid_volume', 0.0)
total_volume += volume
return total_volume
def get_vessel_liquid_types(G: nx.DiGraph, vessel: str) -> List[str]:
"""获取容器中所有液体的类型"""
if vessel not in G.nodes():
return []
vessel_data = G.nodes[vessel].get('data', {})
liquids = vessel_data.get('liquid', [])
liquid_types = []
for liquid in liquids:
if isinstance(liquid, dict):
# 支持两种格式的液体类型字段
liquid_type = liquid.get('liquid_type') or liquid.get('name', '')
if liquid_type:
liquid_types.append(liquid_type)
return liquid_types
def find_vessel_by_content(G: nx.DiGraph, content: str) -> List[str]:
"""
根据内容物查找所有匹配的容器
返回匹配容器的ID列表
"""
matching_vessels = []
for node_id in G.nodes():
if G.nodes[node_id].get('type') == 'container':
# 检查容器名称匹配
node_name = G.nodes[node_id].get('name', '').lower()
if content.lower() in node_id.lower() or content.lower() in node_name:
matching_vessels.append(node_id)
continue
# 检查液体类型匹配
vessel_data = G.nodes[node_id].get('data', {})
liquids = vessel_data.get('liquid', [])
config_data = G.nodes[node_id].get('config', {})
# 检查 reagent_name 和 config.reagent
reagent_name = vessel_data.get('reagent_name', '').lower()
config_reagent = config_data.get('reagent', '').lower()
if (content.lower() == reagent_name or
content.lower() == config_reagent):
matching_vessels.append(node_id)
continue
# 检查液体列表
for liquid in liquids:
if isinstance(liquid, dict):
liquid_type = liquid.get('liquid_type') or liquid.get('name', '')
if liquid_type.lower() == content.lower():
matching_vessels.append(node_id)
break
return matching_vessels
return action_sequence

View File

@@ -1,72 +1,5 @@
from typing import List, Dict, Any
import networkx as nx
from .pump_protocol import generate_pump_protocol
def get_vessel_liquid_volume(G: nx.DiGraph, vessel: str) -> float:
"""获取容器中的液体体积"""
if vessel not in G.nodes():
return 0.0
vessel_data = G.nodes[vessel].get('data', {})
liquids = vessel_data.get('liquid', [])
total_volume = 0.0
for liquid in liquids:
if isinstance(liquid, dict) and 'liquid_volume' in liquid:
total_volume += liquid['liquid_volume']
return total_volume
def find_filter_through_vessel(G: nx.DiGraph, filter_through: str) -> str:
"""查找过滤介质容器"""
# 直接使用 filter_through 参数作为容器名称
if filter_through in G.nodes():
return filter_through
# 尝试常见的过滤介质容器命名
possible_names = [
f"filter_{filter_through}",
f"{filter_through}_filter",
f"column_{filter_through}",
f"{filter_through}_column",
"filter_through_vessel",
"column_vessel",
"chromatography_column",
"filter_column"
]
for vessel_name in possible_names:
if vessel_name in G.nodes():
return vessel_name
raise ValueError(f"未找到过滤介质容器 '{filter_through}'。尝试了以下名称: {[filter_through] + possible_names}")
def find_eluting_solvent_vessel(G: nx.DiGraph, eluting_solvent: str) -> str:
"""查找洗脱溶剂容器"""
if not eluting_solvent:
return ""
# 按照命名规则查找溶剂瓶
solvent_vessel_id = f"flask_{eluting_solvent}"
if solvent_vessel_id in G.nodes():
return solvent_vessel_id
# 如果直接匹配失败,尝试模糊匹配
for node in G.nodes():
if node.startswith('flask_') and eluting_solvent.lower() in node.lower():
return node
# 如果还是找不到,列出所有可用的溶剂瓶
available_flasks = [node for node in G.nodes()
if node.startswith('flask_')
and G.nodes[node].get('type') == 'container']
raise ValueError(f"找不到洗脱溶剂 '{eluting_solvent}' 对应的溶剂瓶。可用溶剂瓶: {available_flasks}")
def generate_filter_through_protocol(
G: nx.DiGraph,
@@ -79,15 +12,10 @@ def generate_filter_through_protocol(
residence_time: float = 0.0
) -> List[Dict[str, Any]]:
"""
生成通过过滤介质过滤的协议序列,复用 pump_protocol 的成熟算法
过滤流程:
1. 液体转移:将样品从源容器转移到过滤介质
2. 重力过滤:液体通过过滤介质自动流到目标容器
3. 洗脱操作:将洗脱溶剂通过过滤介质洗脱目标物质
生成通过过滤介质过滤的协议序列
Args:
G: 有向图,节点为设备和容器,边为流体管道
G: 有向图,节点为设备和容器
from_vessel: 源容器的名称,即物质起始所在的容器
to_vessel: 目标容器的名称,物质过滤后要到达的容器
filter_through: 过滤时所通过的介质,如滤纸、柱子等
@@ -100,288 +28,123 @@ def generate_filter_through_protocol(
List[Dict[str, Any]]: 过滤操作的动作序列
Raises:
ValueError: 当找不到必要的设备或容器
ValueError: 当找不到必要的设备时抛出异常
Examples:
filter_through_actions = generate_filter_through_protocol(
G, "reaction_mixture", "collection_bottle_1", "celite", "ethanol", 20.0, 2, 30.0
filter_through_protocol = generate_filter_through_protocol(
G, "reactor", "collection_flask", "celite", "ethanol", 50.0, 2, 60.0
)
"""
action_sequence = []
print(f"FILTER_THROUGH: 开始生成通过过滤协议")
print(f" - 源容器: {from_vessel}")
print(f" - 目标容器: {to_vessel}")
print(f" - 过滤介质: {filter_through}")
print(f" - 洗脱溶剂: {eluting_solvent}")
print(f" - 洗脱体积: {eluting_volume} mL" if eluting_volume > 0 else " - 洗脱体积: 无")
print(f" - 洗脱重复次数: {eluting_repeats}")
print(f" - 停留时间: {residence_time}s" if residence_time > 0 else " - 停留时间: 无")
# 验证源容器和目标容器存在
# 验证容器是否存在
if from_vessel not in G.nodes():
raise ValueError(f"源容器 '{from_vessel}' 不存在于系统")
raise ValueError(f"源容器 {from_vessel} 不存在于")
if to_vessel not in G.nodes():
raise ValueError(f"目标容器 '{to_vessel}' 不存在于系统")
raise ValueError(f"目标容器 {to_vessel} 不存在于")
# 获取源容器中的液体体积
source_volume = get_vessel_liquid_volume(G, from_vessel)
print(f"FILTER_THROUGH: 源容器 {from_vessel} 中有 {source_volume} mL 液体")
# 查找转移泵设备(用于液体转移)
pump_nodes = [node for node in G.nodes()
if G.nodes[node].get('class') == 'virtual_transfer_pump']
# 查找过滤介质容器
try:
filter_through_vessel = find_filter_through_vessel(G, filter_through)
print(f"FILTER_THROUGH: 找到过滤介质容器: {filter_through_vessel}")
except ValueError as e:
raise ValueError(f"无法找到过滤介质容器: {str(e)}")
if not pump_nodes:
raise ValueError("没有找到可用的转移泵设备")
# 查找洗脱溶剂容器(如果需要)
eluting_vessel = ""
if eluting_solvent and eluting_volume > 0 and eluting_repeats > 0:
try:
eluting_vessel = find_eluting_solvent_vessel(G, eluting_solvent)
print(f"FILTER_THROUGH: 找到洗脱溶剂容器: {eluting_vessel}")
except ValueError as e:
raise ValueError(f"无法找到洗脱溶剂容器: {str(e)}")
pump_id = pump_nodes[0]
# === 第一步:将样品从源容器转移到过滤介质 ===
transfer_volume = source_volume if source_volume > 0 else 100.0 # 默认100mL
print(f"FILTER_THROUGH: 将 {transfer_volume} mL 样品从 {from_vessel} 转移到 {filter_through_vessel}")
# 查找过滤设备(可选,如果有专门的过滤设备)
filter_nodes = [node for node in G.nodes()
if G.nodes[node].get('class') == 'virtual_filter']
try:
# 使用成熟的 pump_protocol 算法进行液体转移
sample_transfer_actions = generate_pump_protocol(
G=G,
from_vessel=from_vessel,
to_vessel=filter_through_vessel,
volume=transfer_volume,
flowrate=0.8, # 较慢的流速,避免冲击过滤介质
transfer_flowrate=1.2
)
action_sequence.extend(sample_transfer_actions)
except Exception as e:
raise ValueError(f"无法将样品转移到过滤介质: {str(e)}")
filter_id = filter_nodes[0] if filter_nodes else None
# === 第二步:等待样品通过过滤介质(停留时间) ===
if residence_time > 0:
print(f"FILTER_THROUGH: 等待样品在过滤介质中停留 {residence_time}s")
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": residence_time}
})
else:
# 即使没有指定停留时间,也等待一段时间让液体通过
default_wait_time = max(10, transfer_volume / 10) # 根据体积估算等待时间
print(f"FILTER_THROUGH: 等待样品通过过滤介质 {default_wait_time}s")
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": default_wait_time}
})
# 查找洗脱溶剂容器(如果需要洗脱)
eluting_vessel = None
if eluting_solvent and eluting_volume > 0:
eluting_vessel = f"flask_{eluting_solvent}"
if eluting_vessel not in G.nodes():
# 查找可用的溶剂容器
available_vessels = [node for node in G.nodes()
if node.startswith('flask_') and
G.nodes[node].get('type') == 'container']
if available_vessels:
eluting_vessel = available_vessels[0]
else:
raise ValueError(f"没有找到洗脱溶剂容器 {eluting_solvent}")
# === 第三步:洗脱操作(如果指定了洗脱参数) ===
if eluting_solvent and eluting_volume > 0 and eluting_repeats > 0 and eluting_vessel:
print(f"FILTER_THROUGH: 开始洗脱操作 - {eluting_repeats} 次,每次 {eluting_volume} mL {eluting_solvent}")
for repeat_idx in range(eluting_repeats):
print(f"FILTER_THROUGH: 第 {repeat_idx + 1}/{eluting_repeats} 次洗脱")
try:
# 将洗脱溶剂转移到过滤介质
eluting_transfer_actions = generate_pump_protocol(
G=G,
from_vessel=eluting_vessel,
to_vessel=filter_through_vessel,
volume=eluting_volume,
flowrate=0.6, # 洗脱用更慢的流速
transfer_flowrate=1.0
)
action_sequence.extend(eluting_transfer_actions)
except Exception as e:
raise ValueError(f"{repeat_idx + 1} 次洗脱转移失败: {str(e)}")
# 等待洗脱溶剂通过过滤介质
eluting_wait_time = max(30, eluting_volume / 5) # 根据洗脱体积估算等待时间
print(f"FILTER_THROUGH: 等待第 {repeat_idx + 1} 次洗脱液通过 {eluting_wait_time}s")
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": eluting_wait_time}
})
# 洗脱间隔等待
if repeat_idx < eluting_repeats - 1: # 不是最后一次洗脱
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": 10}
})
# 步骤1将样品从源容器转移到过滤装置模拟通过过滤介质
# 这里我们将过滤过程分解为多个转移步骤来模拟通过介质的过程
# === 第四步:最终等待,确保所有液体完全通过 ===
print(f"FILTER_THROUGH: 最终等待,确保所有液体完全通过过滤介质")
# 首先转移样品(模拟样品通过过滤介质)
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": 20}
"device_id": pump_id,
"action_name": "transfer",
"action_kwargs": {
"from_vessel": from_vessel,
"to_vessel": to_vessel,
"volume": 0.0, # 转移所有液体,体积由系统确定
"amount": f"通过 {filter_through} 过滤",
"time": residence_time if residence_time > 0 else 0.0,
"viscous": False,
"rinsing_solvent": "",
"rinsing_volume": 0.0,
"rinsing_repeats": 0,
"solid": True # 通过过滤介质可能涉及固体分离
}
})
print(f"FILTER_THROUGH: 生成了 {len(action_sequence)} 个动作")
print(f"FILTER_THROUGH: 通过过滤协议生成完成")
print(f"FILTER_THROUGH: 样品从 {from_vessel} 通过 {filter_through} 到达 {to_vessel}")
if eluting_repeats > 0:
total_eluting_volume = eluting_volume * eluting_repeats
print(f"FILTER_THROUGH: 总洗脱体积: {total_eluting_volume} mL {eluting_solvent}")
return action_sequence
# 便捷函数:常用过滤方案
def generate_gravity_column_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
column_material: str = "silica_gel"
) -> List[Dict[str, Any]]:
"""重力柱层析:简单重力过滤,无洗脱"""
return generate_filter_through_protocol(G, from_vessel, to_vessel, column_material, "", 0.0, 0, 0.0)
def generate_celite_filter_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
wash_solvent: str = "ethanol",
wash_volume: float = 20.0
) -> List[Dict[str, Any]]:
"""硅藻土过滤:用于去除固体杂质"""
return generate_filter_through_protocol(G, from_vessel, to_vessel, "celite", wash_solvent, wash_volume, 1, 30.0)
def generate_column_chromatography_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
column_material: str = "silica_gel",
eluting_solvent: str = "ethyl_acetate",
eluting_volume: float = 30.0,
eluting_repeats: int = 3
) -> List[Dict[str, Any]]:
"""柱层析:多次洗脱分离"""
return generate_filter_through_protocol(
G, from_vessel, to_vessel, column_material, eluting_solvent, eluting_volume, eluting_repeats, 60.0
)
def generate_solid_phase_extraction_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
spe_cartridge: str = "C18",
eluting_solvent: str = "methanol",
eluting_volume: float = 15.0,
eluting_repeats: int = 2
) -> List[Dict[str, Any]]:
"""固相萃取C18柱或其他SPE柱"""
return generate_filter_through_protocol(
G, from_vessel, to_vessel, spe_cartridge, eluting_solvent, eluting_volume, eluting_repeats, 120.0
)
def generate_resin_filter_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
resin_type: str = "ion_exchange",
regeneration_solvent: str = "NaCl_solution",
regeneration_volume: float = 25.0
) -> List[Dict[str, Any]]:
"""树脂过滤:离子交换树脂或其他功能树脂"""
return generate_filter_through_protocol(
G, from_vessel, to_vessel, resin_type, regeneration_solvent, regeneration_volume, 1, 180.0
)
def generate_multi_step_purification_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
filter_steps: List[Dict[str, Any]]
) -> List[Dict[str, Any]]:
"""
多步骤纯化:连续多个过滤介质
Args:
G: 网络图
from_vessel: 源容器
to_vessel: 最终目标容器
filter_steps: 过滤步骤列表,每个元素包含过滤参数
Returns:
List[Dict[str, Any]]: 完整的动作序列
Example:
filter_steps = [
{
"to_vessel": "intermediate_vessel_1",
"filter_through": "celite",
"eluting_solvent": "",
"eluting_volume": 0.0,
"eluting_repeats": 0,
"residence_time": 30.0
},
{
"from_vessel": "intermediate_vessel_1",
"to_vessel": "final_vessel",
"filter_through": "silica_gel",
"eluting_solvent": "ethyl_acetate",
"eluting_volume": 20.0,
"eluting_repeats": 2,
"residence_time": 60.0
# 步骤2如果有专门的过滤设备使用过滤设备处理
if filter_id:
action_sequence.append({
"device_id": filter_id,
"action_name": "filter_sample",
"action_kwargs": {
"vessel": to_vessel,
"filtrate_vessel": to_vessel,
"stir": False,
"stir_speed": 0.0,
"temp": 25.0,
"continue_heatchill": False,
"volume": 0.0
}
]
"""
action_sequence = []
})
current_from_vessel = from_vessel
for i, step in enumerate(filter_steps):
print(f"FILTER_THROUGH: 处理第 {i+1}/{len(filter_steps)} 个过滤步骤")
# 使用步骤中指定的参数,或使用默认值
step_from_vessel = step.get('from_vessel', current_from_vessel)
step_to_vessel = step.get('to_vessel', to_vessel if i == len(filter_steps) - 1 else f"intermediate_vessel_{i+1}")
# 生成单个过滤步骤的协议
step_actions = generate_filter_through_protocol(
G=G,
from_vessel=step_from_vessel,
to_vessel=step_to_vessel,
filter_through=step.get('filter_through', 'silica_gel'),
eluting_solvent=step.get('eluting_solvent', ''),
eluting_volume=step.get('eluting_volume', 0.0),
eluting_repeats=step.get('eluting_repeats', 0),
residence_time=step.get('residence_time', 0.0)
)
action_sequence.extend(step_actions)
# 更新下一步的源容器
current_from_vessel = step_to_vessel
# 在步骤之间加入等待时间
if i < len(filter_steps) - 1: # 不是最后一个步骤
# 步骤3洗脱操作如果指定了洗脱溶剂和重复次数
if eluting_solvent and eluting_volume > 0 and eluting_repeats > 0 and eluting_vessel:
for repeat in range(eluting_repeats):
# 添加洗脱溶剂
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": 15}
"device_id": pump_id,
"action_name": "transfer",
"action_kwargs": {
"from_vessel": eluting_vessel,
"to_vessel": to_vessel,
"volume": eluting_volume,
"amount": f"洗脱溶剂 {eluting_solvent} - 第 {repeat + 1}",
"time": 0.0,
"viscous": False,
"rinsing_solvent": "",
"rinsing_volume": 0.0,
"rinsing_repeats": 0,
"solid": False
}
})
# 如果有过滤设备,再次过滤洗脱液
if filter_id:
action_sequence.append({
"device_id": filter_id,
"action_name": "filter_sample",
"action_kwargs": {
"vessel": to_vessel,
"filtrate_vessel": to_vessel,
"stir": False,
"stir_speed": 0.0,
"temp": 25.0,
"continue_heatchill": False,
"volume": eluting_volume
}
})
print(f"FILTER_THROUGH: 多步骤纯化协议生成完成,共 {len(action_sequence)} 个动作")
return action_sequence
# 测试函数
def test_filter_through_protocol():
"""测试通过过滤协议的示例"""
print("=== FILTER THROUGH PROTOCOL 测试 ===")
print("测试完成")
if __name__ == "__main__":
test_filter_through_protocol()
return action_sequence

View File

@@ -8,8 +8,7 @@ def is_integrated_pump(node_name):
def find_connected_pump(G, valve_node):
for neighbor in G.neighbors(valve_node):
node_class = G.nodes[neighbor].get("class") or "" # 防止 None
if "pump" in node_class:
if "pump" in G.nodes[neighbor]["class"]:
return neighbor
raise ValueError(f"未找到与阀 {valve_node} 唯一相连的泵节点")

View File

@@ -1,87 +1,5 @@
from typing import List, Dict, Any
import networkx as nx
from .pump_protocol import generate_pump_protocol
def get_vessel_liquid_volume(G: nx.DiGraph, vessel: str) -> float:
"""获取容器中的液体体积"""
if vessel not in G.nodes():
return 0.0
vessel_data = G.nodes[vessel].get('data', {})
liquids = vessel_data.get('liquid', [])
total_volume = 0.0
for liquid in liquids:
if isinstance(liquid, dict):
# 支持两种格式:新格式 (name, volume) 和旧格式 (liquid_type, liquid_volume)
volume = liquid.get('volume') or liquid.get('liquid_volume', 0.0)
total_volume += volume
return total_volume
def find_column_device(G: nx.DiGraph, column: str) -> str:
"""查找柱层析设备"""
# 首先检查是否有虚拟柱设备
column_nodes = [node for node in G.nodes()
if (G.nodes[node].get('class') or '') == 'virtual_column']
if column_nodes:
return column_nodes[0]
# 如果没有虚拟柱设备,抛出异常
raise ValueError(f"系统中未找到柱层析设备。请确保配置了 virtual_column 设备")
def find_column_vessel(G: nx.DiGraph, column: str) -> str:
"""查找柱容器"""
# 直接使用 column 参数作为容器名称
if column in G.nodes():
return column
# 尝试常见的柱容器命名规则
possible_names = [
f"column_{column}",
f"{column}_column",
f"vessel_{column}",
f"{column}_vessel",
"column_vessel",
"chromatography_column",
"silica_column",
"preparative_column"
]
for vessel_name in possible_names:
if vessel_name in G.nodes():
return vessel_name
raise ValueError(f"未找到柱容器 '{column}'。尝试了以下名称: {[column] + possible_names}")
def find_eluting_solvent_vessel(G: nx.DiGraph, eluting_solvent: str) -> str:
"""查找洗脱溶剂容器"""
if not eluting_solvent:
return ""
# 按照命名规则查找溶剂瓶
solvent_vessel_id = f"flask_{eluting_solvent}"
if solvent_vessel_id in G.nodes():
return solvent_vessel_id
# 如果直接匹配失败,尝试模糊匹配
for node in G.nodes():
if node.startswith('flask_') and eluting_solvent.lower() in node.lower():
return node
# 如果还是找不到,列出所有可用的溶剂瓶
available_flasks = [node for node in G.nodes()
if node.startswith('flask_')
and G.nodes[node].get('type') == 'container']
raise ValueError(f"找不到洗脱溶剂 '{eluting_solvent}' 对应的溶剂瓶。可用溶剂瓶: {available_flasks}")
def generate_run_column_protocol(
G: nx.DiGraph,
@@ -93,220 +11,92 @@ def generate_run_column_protocol(
生成柱层析分离的协议序列
Args:
G: 有向图,节点为设备和容器,边为流体管道
G: 有向图,节点为设备和容器
from_vessel: 源容器的名称,即样品起始所在的容器
to_vessel: 目标容器的名称,分离后的样品要到达的容器
column: 所使用的柱子的名称
Returns:
List[Dict[str, Any]]: 柱层析分离操作的动作序列
Raises:
ValueError: 当找不到必要的设备时抛出异常
Examples:
run_column_protocol = generate_run_column_protocol(G, "reactor", "collection_flask", "silica_column")
"""
action_sequence = []
print(f"RUN_COLUMN: 开始生成柱层析协议")
print(f" - 源容器: {from_vessel}")
print(f" - 目标容器: {to_vessel}")
print(f" - 柱子: {column}")
# 验证源容器和目标容器存在
# 验证容器是否存在
if from_vessel not in G.nodes():
raise ValueError(f"源容器 '{from_vessel}' 不存在于系统")
raise ValueError(f"源容器 {from_vessel} 不存在于")
if to_vessel not in G.nodes():
raise ValueError(f"目标容器 '{to_vessel}' 不存在于系统")
raise ValueError(f"目标容器 {to_vessel} 不存在于")
# 查找转移泵设备(用于样品转移)
pump_nodes = [node for node in G.nodes()
if G.nodes[node].get('class') == 'virtual_transfer_pump']
if not pump_nodes:
raise ValueError("没有找到可用的转移泵设备")
pump_id = pump_nodes[0]
# 查找柱层析设备
column_device_id = None
column_nodes = [node for node in G.nodes()
if (G.nodes[node].get('class') or '') == 'virtual_column']
if G.nodes[node].get('class') == 'virtual_column']
if column_nodes:
column_device_id = column_nodes[0]
print(f"RUN_COLUMN: 找到柱层析设备: {column_device_id}")
else:
print(f"RUN_COLUMN: 警告 - 未找到柱层析设备")
if not column_nodes:
raise ValueError("没有找到可用的柱层析设备")
# 获取源容器中的液体体积
source_volume = get_vessel_liquid_volume(G, from_vessel)
print(f"RUN_COLUMN: 源容器 {from_vessel} 中有 {source_volume} mL 液体")
column_id = column_nodes[0]
# === 第一步:样品转移到柱子(如果柱子是容器) ===
if column in G.nodes() and G.nodes[column].get('type') == 'container':
print(f"RUN_COLUMN: 样品转移 - {source_volume} mL 从 {from_vessel}{column}")
try:
sample_transfer_actions = generate_pump_protocol(
G=G,
from_vessel=from_vessel,
to_vessel=column,
volume=source_volume if source_volume > 0 else 100.0,
flowrate=2.0
)
action_sequence.extend(sample_transfer_actions)
except Exception as e:
print(f"RUN_COLUMN: 样品转移失败: {str(e)}")
# === 第二步:使用柱层析设备执行分离 ===
if column_device_id:
print(f"RUN_COLUMN: 使用柱层析设备执行分离")
column_separation_action = {
"device_id": column_device_id,
"action_name": "run_column",
"action_kwargs": {
"from_vessel": from_vessel,
"to_vessel": to_vessel,
"column": column
}
# 步骤1将样品从源容器转移到柱子上
action_sequence.append({
"device_id": pump_id,
"action_name": "transfer",
"action_kwargs": {
"from_vessel": from_vessel,
"to_vessel": column_id, # 将样品转移到柱子设备
"volume": 0.0, # 转移所有液体,体积由系统确定
"amount": f"样品上柱 - 使用 {column}",
"time": 0.0,
"viscous": False,
"rinsing_solvent": "",
"rinsing_volume": 0.0,
"rinsing_repeats": 0,
"solid": False
}
action_sequence.append(column_separation_action)
# 等待柱层析设备完成分离
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": 60}
})
})
# === 第三步:从柱子转移到目标容器(如果需要) ===
if column in G.nodes() and column != to_vessel:
print(f"RUN_COLUMN: 产物转移 - 从 {column}{to_vessel}")
try:
product_transfer_actions = generate_pump_protocol(
G=G,
from_vessel=column,
to_vessel=to_vessel,
volume=source_volume * 0.8 if source_volume > 0 else 80.0, # 假设有一些损失
flowrate=1.5
)
action_sequence.extend(product_transfer_actions)
except Exception as e:
print(f"RUN_COLUMN: 产物转移失败: {str(e)}")
# 步骤2运行柱层析分离
action_sequence.append({
"device_id": column_id,
"action_name": "run_column",
"action_kwargs": {
"from_vessel": from_vessel,
"to_vessel": to_vessel,
"column": column
}
})
print(f"RUN_COLUMN: 生成了 {len(action_sequence)} 个动作")
return action_sequence
# 便捷函数:常用柱层析方案
def generate_flash_column_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
column_material: str = "silica_gel",
mobile_phase: str = "ethyl_acetate",
mobile_phase_volume: float = 100.0
) -> List[Dict[str, Any]]:
"""快速柱层析:高流速分离"""
return generate_run_column_protocol(
G, from_vessel, to_vessel, column_material,
mobile_phase, mobile_phase_volume, 1, "", 0.0, 3.0
)
def generate_preparative_column_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
column_material: str = "silica_gel",
equilibration_solvent: str = "hexane",
eluting_solvent: str = "ethyl_acetate",
eluting_volume: float = 50.0,
eluting_repeats: int = 3
) -> List[Dict[str, Any]]:
"""制备柱层析:带平衡和多次洗脱"""
return generate_run_column_protocol(
G, from_vessel, to_vessel, column_material,
eluting_solvent, eluting_volume, eluting_repeats,
equilibration_solvent, 30.0, 1.5
)
def generate_gradient_column_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
column_material: str = "silica_gel",
gradient_solvents: List[str] = None,
gradient_volumes: List[float] = None
) -> List[Dict[str, Any]]:
"""梯度洗脱柱层析:多种溶剂系统"""
if gradient_solvents is None:
gradient_solvents = ["hexane", "ethyl_acetate", "methanol"]
if gradient_volumes is None:
gradient_volumes = [50.0, 50.0, 30.0]
# 步骤3将分离后的产物从柱子转移到目标容器
action_sequence.append({
"device_id": pump_id,
"action_name": "transfer",
"action_kwargs": {
"from_vessel": column_id, # 从柱子设备转移
"to_vessel": to_vessel,
"volume": 0.0, # 转移所有液体,体积由系统确定
"amount": f"收集分离产物 - 来自 {column}",
"time": 0.0,
"viscous": False,
"rinsing_solvent": "",
"rinsing_volume": 0.0,
"rinsing_repeats": 0,
"solid": False
}
})
action_sequence = []
# 每种溶剂单独执行一次柱层析
for i, (solvent, volume) in enumerate(zip(gradient_solvents, gradient_volumes)):
print(f"RUN_COLUMN: 梯度洗脱第 {i+1}/{len(gradient_solvents)} 步: {volume} mL {solvent}")
# 第一步使用源容器,后续步骤使用柱子作为源
step_from_vessel = from_vessel if i == 0 else column_material
# 最后一步使用目标容器,其他步骤使用柱子作为目标
step_to_vessel = to_vessel if i == len(gradient_solvents) - 1 else column_material
step_actions = generate_run_column_protocol(
G, step_from_vessel, step_to_vessel, column_material,
solvent, volume, 1, "", 0.0, 1.0
)
action_sequence.extend(step_actions)
# 在梯度步骤之间加入等待时间
if i < len(gradient_solvents) - 1:
action_sequence.append({
"action_name": "wait",
"action_kwargs": {"time": 20}
})
return action_sequence
def generate_reverse_phase_column_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
column_material: str = "C18",
aqueous_phase: str = "water",
organic_phase: str = "methanol",
gradient_ratio: float = 0.5
) -> List[Dict[str, Any]]:
"""反相柱层析C18柱水-有机相梯度"""
# 先用水相平衡
equilibration_volume = 20.0
# 然后用有机相洗脱
eluting_volume = 30.0 * gradient_ratio
return generate_run_column_protocol(
G, from_vessel, to_vessel, column_material,
organic_phase, eluting_volume, 2,
aqueous_phase, equilibration_volume, 0.8
)
def generate_ion_exchange_column_protocol(
G: nx.DiGraph,
from_vessel: str,
to_vessel: str,
column_material: str = "ion_exchange",
buffer_solution: str = "buffer",
salt_solution: str = "NaCl_solution",
salt_volume: float = 40.0
) -> List[Dict[str, Any]]:
"""离子交换柱层析:缓冲液平衡,盐溶液洗脱"""
return generate_run_column_protocol(
G, from_vessel, to_vessel, column_material,
salt_solution, salt_volume, 1,
buffer_solution, 25.0, 0.5
)
# 测试函数
def test_run_column_protocol():
"""测试柱层析协议的示例"""
print("=== RUN COLUMN PROTOCOL 测试 ===")
print("测试完成")
if __name__ == "__main__":
test_run_column_protocol()
return action_sequence

View File

@@ -26,7 +26,7 @@ vacuum_pump.mock:
- handler_key: out
label: out
data_type: fluid
io_type: source
io_type: target
data_source: handle
data_key: fluid_in
init_param_schema:

View File

@@ -2,17 +2,17 @@
# 1. virtual_pump - 虚拟泵
# 描述具有多通道阀门特性的泵根据valve_position可连接多个容器
# 连接特性1个输入口 + 1个输出口
# 连接特性1个输入口 + 1个输出口(当前配置,实际应该有多个输出口)
# 数据类型fluid流体连接
# 2. virtual_stirrer - 虚拟搅拌器
# 描述:机械连接设备,提供搅拌功能
# 连接特性1个连接点
# 连接特性1个双向连接点undirected
# 数据类型mechanical机械连接
# 3a. virtual_valve - 虚拟八通阀门
# 描述8通阀门可切换流向
# 连接特性1个口连接注射泵 + 个输出口
# 描述8通阀门实际配置为7通,可切换流向
# 连接特性1个口连接注射泵 + 7个输出口
# 数据类型fluid流体连接
# 3b. virtual_solenoid_valve (电磁阀门)
@@ -32,12 +32,12 @@
# 6. virtual_heatchill - 虚拟加热/冷却器
# 描述:温控设备,容器直接放置在设备上进行温度控制
# 连接特性1个连接点
# 连接特性1个双向连接点undirected
# 数据类型mechanical机械/物理接触连接)
# 7. virtual_transfer_pump - 虚拟转移泵(注射器式)
# 描述:注射器式转移泵,通过同一个口吸入和排出液体
# 连接特性1个连接点
# 连接特性1个双向连接点undirected
# 数据类型fluid流体连接
# 8. virtual_column - 虚拟色谱柱
@@ -57,23 +57,26 @@
# 11. virtual_vacuum_pump - 虚拟真空泵
# 描述:真空泵设备,用于抽真空操作和真空/充气循环
# 连接特性1个输口(连接需要抽真空的系统)
# 连接特性1个输口(连接需要抽真空的系统)
# 数据类型fluid流体连接
# 主要功能:开启/关闭、状态控制ON/OFF
# 12. virtual_gas_source - 虚拟气源
# 描述:气源设备,用于充气操作和真空/充气循环
# 连接特性1个输出口向系统提供加压气体
# 数据类型fluid流体连接
# 主要功能:开启/关闭、状态控制ON/OFF
virtual_pump:
description: Virtual Pump for PumpTransferProtocol Testing
#icon: 这个注册的设备应该是写错了,后续删掉
class:
module: unilabos.devices.virtual.virtual_pump:VirtualPump
type: python
status_types:
status: String
position: Float64
valve_position: Int32
valve_position: Int32 # 修复:使用 Int32 而不是 String
max_volume: Float64
current_volume: Float64
action_value_mappings:
@@ -102,6 +105,7 @@ virtual_pump:
status: status
result:
success: success
# 虚拟泵节点配置 - 具有多通道阀门特性根据valve_position可连接多个容器
handles:
- handler_key: pumpio
label: pumpio
@@ -109,7 +113,7 @@ virtual_pump:
io_type: source
data_source: handle
data_key: fluid_in
description: "泵的输出口"
description: "泵的进液口,连接源容器"
schema:
type: object
properties:
@@ -129,11 +133,11 @@ virtual_stirrer:
type: python
status_types:
status: String
operation_mode: String
current_vessel: String
current_speed: Float64
is_stirring: Bool
remaining_time: Float64
operation_mode: String # 操作模式
current_vessel: String # 当前容器
current_speed: Float64 # 当前搅拌速度
is_stirring: Bool # 是否搅拌
remaining_time: Float64 # 剩余时间
action_value_mappings:
stir:
type: Stir
@@ -163,15 +167,16 @@ virtual_stirrer:
status: status
result:
success: success
# 虚拟搅拌器节点配置 - 机械连接设备,双向连接点用于搅拌容器
handles:
- handler_key: stirrer
label: stirrer
data_type: mechanical
side: NORTH
io_type: source
io_type: undirected
data_source: handle
data_key: vessel
description: "搅拌器的机械连接口"
description: "搅拌器的机械连接口,容器通过机械连接进行搅拌"
schema:
type: object
properties:
@@ -213,6 +218,7 @@ virtual_multiway_valve:
feedback: {}
result:
success: success
# 八通阀门节点配置 - 1个输入口8个输出口可切换流向
handles:
- handler_key: transferpump
label: transferpump
@@ -221,7 +227,7 @@ virtual_multiway_valve:
io_type: target
data_source: handle
data_key: fluid_in
description: "八通阀门进液口"
description: "八通阀门进液口,接收来源流体"
- handler_key: 1
label: 1
data_type: fluid
@@ -229,7 +235,7 @@ virtual_multiway_valve:
io_type: source
data_source: executor
data_key: fluid_port_1
description: "八通阀门端口1"
description: "八通阀门端口1position=1时流体从此口流出"
- handler_key: 2
label: 2
data_type: fluid
@@ -237,7 +243,7 @@ virtual_multiway_valve:
io_type: source
data_source: executor
data_key: fluid_port_2
description: "八通阀门端口2"
description: "八通阀门端口2position=2时流体从此口流出"
- handler_key: 3
label: 3
data_type: fluid
@@ -245,7 +251,7 @@ virtual_multiway_valve:
io_type: source
data_source: executor
data_key: fluid_port_3
description: "八通阀门端口3"
description: "八通阀门端口3position=3时流体从此口流出"
- handler_key: 4
label: 4
data_type: fluid
@@ -253,7 +259,7 @@ virtual_multiway_valve:
io_type: source
data_source: executor
data_key: fluid_port_4
description: "八通阀门端口4"
description: "八通阀门端口4position=4时流体从此口流出"
- handler_key: 5
label: 5
data_type: fluid
@@ -261,15 +267,7 @@ virtual_multiway_valve:
io_type: source
data_source: executor
data_key: fluid_port_5
description: "八通阀门端口5"
- handler_key: 6
label: 6
data_type: fluid
side: WEST
io_type: source
data_source: executor
data_key: fluid_port_6
description: "八通阀门端口6"
description: "八通阀门端口5position=5时流体从此口流出"
- handler_key: 7
label: 7
data_type: fluid
@@ -277,7 +275,15 @@ virtual_multiway_valve:
io_type: source
data_source: executor
data_key: fluid_port_7
description: "八通阀门端口7"
description: "八通阀门端口7position=7时流体从此口流出"
- handler_key: 6
label: 6
data_type: fluid
side: WEST
io_type: source
data_source: executor
data_key: fluid_port_6
description: "八通阀门端口6position=6时流体从此口流出"
- handler_key: 8
label: 8
data_type: fluid
@@ -285,7 +291,7 @@ virtual_multiway_valve:
io_type: source
data_source: executor
data_key: fluid_port_8
description: "八通阀门端口8"
description: "八通阀门端口8position=8时流体从此口流出"
schema:
type: object
properties:
@@ -296,21 +302,21 @@ virtual_multiway_valve:
type: integer
default: 8
additionalProperties: false
virtual_solenoid_valve:
description: Virtual Solenoid Valve for simple on/off flow control
#icon: SolenoidValve.webp暂时还没有
class:
module: unilabos.devices.virtual.virtual_solenoid_valve:VirtualSolenoidValve
type: python
status_types:
status: String
valve_state: String
valve_state: String # "open" or "closed"
is_open: Bool
action_value_mappings:
set_valve_position:
type: SendCmd
goal:
command: command
command: command # 确保参数名匹配
feedback: {}
result:
success: success
@@ -335,17 +341,18 @@ virtual_solenoid_valve:
feedback: {}
result:
success: success
# 电磁阀门节点配置 - 双向流通的开关型阀门,流动方向由泵决定
handles:
- handler_key: in
label: in
- handler_key: inlet
label: inlet
data_type: fluid
side: NORTH
io_type: target
data_source: handle
data_key: fluid_port_in
description: "电磁阀的进液口"
- handler_key: out
label: out
- handler_key: outlet
label: outlet
data_type: fluid
side: SOUTH
io_type: source
@@ -365,9 +372,9 @@ virtual_solenoid_valve:
type: number
default: 0.1
additionalProperties: false
virtual_centrifuge:
description: Virtual Centrifuge for CentrifugeProtocol Testing
#icon: Centrifuge.webp暂时还没有
class:
module: unilabos.devices.virtual.virtual_centrifuge:VirtualCentrifuge
type: python
@@ -382,8 +389,8 @@ virtual_centrifuge:
min_temp: Float64
centrifuge_state: String
time_remaining: Float64
progress: Float64
message: String
progress: Float64 # 添加这个状态
message: String # 添加这个状态
action_value_mappings:
centrifuge:
type: Centrifuge
@@ -400,6 +407,7 @@ virtual_centrifuge:
result:
success: success
message: message
# 虚拟离心机节点配置 - 单个样品处理设备,输入输出都是同一个样品容器
handles:
- handler_key: centrifuge
label: centrifuge
@@ -428,6 +436,7 @@ virtual_centrifuge:
virtual_filter:
description: Virtual Filter for FilterProtocol Testing
#icon: Filter.webp暂时还没有
class:
module: unilabos.devices.virtual.virtual_filter:VirtualFilter
type: python
@@ -461,31 +470,16 @@ virtual_filter:
success: success
message: message
return_info: message
# 过滤器节点配置 - 固液分离设备
handles:
- handler_key: filter_in
label: filter_in
- handler_key: filter
label: filter
data_type: transport
side: NORTH
io_type: target
io_type: source
data_source: handle
data_key: vessel_in
data_key: vessel
description: "需要过滤的样品容器"
- handler_key: filtrate_out
label: filtrate_out
data_type: transport
side: SOUTH
io_type: source
data_source: handle
data_key: filtrate_out
description: "滤液出口"
- handler_key: retentate_out
label: retentate_out
data_type: transport
side: EAST
io_type: source
data_source: handle
data_key: retentate_out
description: "滤渣/固体出口"
schema:
type: object
properties:
@@ -511,9 +505,10 @@ virtual_heatchill:
type: python
status_types:
status: String
operation_mode: String
is_stirring: Bool
stir_speed: Float64
operation_mode: String # 保留:操作模式
is_stirring: Bool # 保留:是否搅拌
stir_speed: Float64 # 保留:搅拌速度
# remaining_time: Float64 # 保留:剩余时间
action_value_mappings:
heat_chill:
type: HeatChill
@@ -546,6 +541,7 @@ virtual_heatchill:
status: status
result:
success: success
# 虚拟加热/冷却器节点配置
handles:
- handler_key: heatchill
label: heatchill
@@ -554,7 +550,7 @@ virtual_heatchill:
io_type: source
data_source: handle
data_key: vessel
description: "加热/冷却器的物理连接口"
description: "加热/冷却器的物理连接口,容器直接放置在设备上进行温度控制"
schema:
type: object
properties:
@@ -606,10 +602,10 @@ virtual_transfer_pump:
success: success
message: message
set_position:
type: SetPumpPosition
type: SetPumpPosition # ← 使用新的动作类型
goal:
position: position
max_velocity: max_velocity
position: position # ← 直接映射参数名
max_velocity: max_velocity # ← 直接映射参数名
feedback:
status: status
current_position: current_position
@@ -617,6 +613,7 @@ virtual_transfer_pump:
result:
success: success
message: message
# 注射器式转移泵节点配置 - 只有一个双向连接口,可吸入和排出液体
handles:
- handler_key: transferpump
label: transferpump
@@ -625,7 +622,7 @@ virtual_transfer_pump:
io_type: source
data_source: handle
data_key: fluid_port
description: "注射器式转移泵的连接口"
description: "注射器式转移泵的唯一连接口,通过阀门切换实现吸入和排出"
schema:
type: object
properties:
@@ -644,7 +641,8 @@ virtual_transfer_pump:
additionalProperties: false
virtual_column:
description: Virtual Column Chromatography Device for RunColumn Protocol Testing
description: Virtual Column for RunColumn Protocol Testing
#icon: Column.webp暂时还没有
class:
module: unilabos.devices.virtual.virtual_column:VirtualColumn
type: python
@@ -666,30 +664,29 @@ virtual_column:
to_vessel: to_vessel
column: column
feedback:
status: current_status
progress: progress
processed_volume: processed_volume
current_status: current_status
result:
success: success
message: current_status
return_info: current_status
message: message
# 虚拟色谱柱节点配置 - 分离纯化设备1个样品输入口1个纯化产物输出口
handles:
- handler_key: columnin
label: columnin
data_type: transport
side: WEST
data_type: fluid
side: NORTH
io_type: target
data_source: handle
data_key: from_vessel
description: "样品输入口"
description: "需要纯化的样品输入口"
- handler_key: columnout
label: columnout
data_type: transport
side: EAST
data_type: fluid
side: SOUTH
io_type: source
data_source: handle
data_source: executor
data_key: to_vessel
description: "产物输出口"
description: "经过色谱柱纯化的产物输出口"
schema:
type: object
properties:
@@ -742,31 +739,16 @@ virtual_rotavap:
result:
success: success
message: message
# 虚拟旋转蒸发仪节点配置 - 1个样品口
handles:
- handler_key: sample_in
label: sample_in
- handler_key: rotavap-sample
label: rotavap-sample
data_type: fluid
side: NORTH
io_type: target
data_source: handle
data_key: vessel_in
description: "样品连接口"
- handler_key: product_out
label: product_out
data_type: fluid
side: SOUTH
io_type: source
data_source: handle
data_key: product_out
description: "浓缩产物出口"
- handler_key: solvent_out
label: solvent_out
data_type: fluid
side: EAST
io_type: source
data_source: handle
data_key: solvent_out
description: "冷凝溶剂出口"
data_key: vessel
description: "样品连接口,放入需要蒸发的样品"
schema:
type: object
properties:
@@ -820,39 +802,24 @@ virtual_separator:
result:
success: success
message: message
# 虚拟分液器节点配置 - 分离设备1个输入口(混合液)2个输出口(上相和下相)
handles:
- handler_key: separator_in
label: separator_in
- handler_key: separatorin
label: separatorin
data_type: fluid
side: NORTH
io_type: target
data_source: handle
data_key: from_vessel
description: "需要分离的混合液体输入口"
- handler_key: bottom_phase_out
label: bottom_phase_out
- handler_key: separatorout
label: separatorout
data_type: fluid
side: SOUTH
io_type: source
data_source: executor
data_key: bottom_outlet
description: "下相(重相)液体输出口"
- handler_key: top_phase_out
label: top_phase_out
data_type: fluid
side: EAST
io_type: source
data_source: executor
data_key: top_outlet
description: "上相(轻相)液体输出口"
- handler_key: bind
label: bind
io_type: target
data_type: mechanical
side: WEST
data_source: handle
data_key: mechanical_port
description: "用于连接搅拌器等机械设备的接口"
schema:
type: object
properties:
@@ -892,6 +859,7 @@ virtual_vacuum_pump:
string: string
feedback: {}
result: {}
# 虚拟真空泵节点配置 - 真空设备1个输入口连接需要抽真空的系统
handles:
- handler_key: vacuumpump
label: vacuumpump
@@ -900,7 +868,7 @@ virtual_vacuum_pump:
io_type: source
data_source: handle
data_key: fluid_in
description: "真空泵进气口"
description: "真空泵进气口,连接需要抽真空的容器或管路"
schema:
type: object
properties:
@@ -912,6 +880,7 @@ virtual_vacuum_pump:
virtual_gas_source:
description: Virtual gas source
#icon: GasSource.webp暂时还没有
class:
module: unilabos.devices.virtual.virtual_gas_source:VirtualGasSource
type: python
@@ -934,6 +903,7 @@ virtual_gas_source:
string: string
feedback: {}
result: {}
# 虚拟气源节点配置 - 气体供应设备1个输出口提供加压气体
handles:
- handler_key: gassource
label: gassource
@@ -942,7 +912,7 @@ virtual_gas_source:
io_type: source
data_source: executor
data_key: fluid_out
description: "气源出气口"
description: "气源出气口,向容器或管路提供加压气体"
schema:
type: object
properties:
@@ -958,4 +928,4 @@ virtual_gas_source:
type: number
default: 5.0
description: "最大输出压力 (bar)"
additionalProperties: false
additionalProperties: false

View File

@@ -3,623 +3,5 @@ workstation:
class:
module: unilabos.ros.nodes.presets.protocol_node:ROS2ProtocolNode
type: ros2
action_value_mappings:
AddProtocol:
type: Add
goal:
vessel: vessel
reagent: reagent
volume: volume
mass: mass
amount: amount
time: time
stir: stir
stir_speed: stir_speed
viscous: viscous
purpose: purpose
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: reagent
label: Reagent
data_type: resource
data_source: handle
data_key: reagent
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
AGVTransferProtocol:
type: AGVTransfer
goal:
from_repo: from_repo
from_repo_position: from_repo_position
to_repo: to_repo
to_repo_position: to_repo_position
feedback: {}
result: {}
CentrifugeProtocol:
type: Centrifuge
goal:
vessel: vessel
speed: speed
time: time
temp: temp
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
CleanProtocol:
type: Clean
goal:
vessel: vessel
solvent: solvent
volume: volume
temp: temp
repeats: repeats
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: solvent
label: Solvent
data_type: resource
data_source: handle
data_key: solvent
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
CleanVesselProtocol:
type: CleanVessel
goal:
vessel: vessel
solvent: solvent
volume: volume
temp: temp
repeats: repeats
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: solvent
label: Solvent
data_type: resource
data_source: handle
data_key: solvent
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
DissolveProtocol:
type: Dissolve
goal:
vessel: vessel
solvent: solvent
volume: volume
amount: amount
temp: temp
time: time
stir_speed: stir_speed
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: solvent
label: Solvent
data_type: resource
data_source: handle
data_key: solvent
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
EvacuateAndRefillProtocol:
type: EvacuateAndRefill
goal:
vessel: vessel
gas: gas
repeats: repeats
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
EvaporateProtocol:
type: Evaporate
goal:
vessel: vessel
pressure: pressure
temp: temp
time: time
stir_speed: stir_speed
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
FilterProtocol:
type: Filter
goal:
vessel: vessel
filtrate_vessel: filtrate_vessel
stir: stir
stir_speed: stir_speed
temp: temp
continue_heatchill: continue_heatchill
volume: volume
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: filtrate_vessel
label: Filtrate Vessel
data_type: resource
data_source: handle
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
- handler_key: filtrate_out
label: Filtrate Vessel
data_type: resource
data_source: executor
data_key: vessel
FilterThroughProtocol:
type: FilterThrough
goal:
from_vessel: from_vessel
to_vessel: to_vessel
filter_through: filter_through
eluting_solvent: eluting_solvent
eluting_volume: eluting_volume
eluting_repeats: eluting_repeats
residence_time: residence_time
feedback: {}
result: {}
handles:
input:
- handler_key: from_vessel
label: From Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: to_vessel
label: To Vessel
data_type: resource
data_source: executor
data_key: vessel
- handler_key: solvent
label: Eluting Solvent
data_type: resource
data_source: handle
data_key: solvent
output:
- handler_key: from_vessel_out
label: From Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: to_vessel_out
label: To Vessel
data_type: resource
data_source: executor
data_key: vessel
HeatChillProtocol:
type: HeatChill
goal:
vessel: vessel
temp: temp
time: time
stir: stir
stir_speed: stir_speed
purpose: purpose
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
HeatChillStartProtocol:
type: HeatChillStart
goal:
vessel: vessel
temp: temp
purpose: purpose
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
HeatChillStopProtocol:
type: HeatChillStop
goal:
vessel: vessel
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
PumpTransferProtocol:
type: PumpTransfer
goal:
from_vessel: from_vessel
to_vessel: to_vessel
volume: volume
amount: amount
time: time
viscous: viscous
rinsing_solvent: rinsing_solvent
rinsing_volume: rinsing_volume
rinsing_repeats: rinsing_repeats
solid: solid
feedback: {}
result: {}
handles:
input:
- handler_key: from_vessel
label: From Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: to_vessel
label: To Vessel
data_type: resource
data_source: executor
data_key: vessel
- handler_key: solvent
label: Rinsing Solvent
data_type: resource
data_source: handle
data_key: solvent
output:
- handler_key: from_vessel_out
label: From Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: to_vessel_out
label: To Vessel
data_type: resource
data_source: executor
data_key: vessel
RunColumnProtocol:
type: RunColumn
goal:
from_vessel: from_vessel
to_vessel: to_vessel
column: column
feedback: {}
result: {}
handles:
input:
- handler_key: from_vessel
label: From Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: to_vessel
label: To Vessel
data_type: resource
data_source: executor
data_key: vessel
output:
- handler_key: from_vessel_out
label: From Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: to_vessel_out
label: To Vessel
data_type: resource
data_source: executor
data_key: vessel
SeparateProtocol:
type: Separate
goal:
purpose: purpose
product_phase: product_phase
from_vessel: from_vessel
separation_vessel: separation_vessel
to_vessel: to_vessel
waste_phase_to_vessel: waste_phase_to_vessel
solvent: solvent
solvent_volume: solvent_volume
through: through
repeats: repeats
stir_time: stir_time
stir_speed: stir_speed
settling_time: settling_time
feedback: {}
result: {}
handles:
input:
- handler_key: from_vessel
label: From Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: to_vessel
label: To Vessel
data_type: resource
data_source: executor
data_key: vessel
- handler_key: solvent
label: Solvent
data_type: resource
data_source: handle
data_key: solvent
output:
- handler_key: from_vessel_out
label: From Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: to_vessel_out
label: To Vessel
data_type: resource
data_source: executor
data_key: vessel
StartStirProtocol:
type: StartStir
goal:
vessel: vessel
stir_speed: stir_speed
purpose: purpose
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
StirProtocol:
type: Stir
goal:
stir_time: stir_time
stir_speed: stir_speed
settling_time: settling_time
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
StopStirProtocol:
type: StopStir
goal:
vessel: vessel
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel
data_type: resource
data_source: executor
data_key: vessel
TransferProtocol:
type: Transfer
goal:
from_vessel: from_vessel
to_vessel: to_vessel
volume: volume
amount: amount
time: time
viscous: viscous
rinsing_solvent: rinsing_solvent
rinsing_volume: rinsing_volume
rinsing_repeats: rinsing_repeats
solid: solid
feedback: {}
result: {}
handles:
input:
- handler_key: from_vessel
label: From Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: to_vessel
label: To Vessel
data_type: resource
data_source: executor
data_key: vessel
- handler_key: solvent
label: Rinsing Solvent
data_type: resource
data_source: handle
data_key: solvent
output:
- handler_key: from_vessel_out
label: From Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: to_vessel_out
label: To Vessel
data_type: resource
data_source: executor
data_key: vessel
WashSolidProtocol:
type: WashSolid
goal:
vessel: vessel
solvent: solvent
volume: volume
filtrate_vessel: filtrate_vessel
temp: temp
stir: stir
stir_speed: stir_speed
time: time
repeats: repeats
feedback: {}
result: {}
handles:
input:
- handler_key: vessel
label: Vessel
data_type: resource
data_source: handle
data_key: vessel
- handler_key: solvent
label: Solvent
data_type: resource
data_source: handle
data_key: solvent
- handler_key: filtrate_vessel
label: Filtrate Vessel
data_type: resource
data_source: executor
data_key: vessel
output:
- handler_key: vessel_out
label: Vessel Out
data_type: resource
data_source: handle
data_key: vessel
- handler_key: filtrate_vessel_out
label: Filtrate Vessel
data_type: resource
data_source: executor
data_key: vessel
schema:
properties: {}

View File

@@ -1,6 +1,5 @@
container:
description: regular organic container
icon: Flask.webp
class:
module: unilabos.resources.container:RegularContainer
type: unilabos
@@ -10,19 +9,13 @@ container:
io_type: target
data_type: fluid
side: NORTH
data_source: handle
data_key: fluid_in
- handler_key: bottom
label: bottom
io_type: source
data_type: fluid
side: SOUTH
data_source: handle
data_key: fluid_out
- handler_key: bind
label: bind
io_type: target
data_type: mechanical
side: SOUTH
data_source: handle
data_key: mechanical_port
side: SOUTH