Merge branch 'dev' into pr/169 and fix conflicts

This commit is contained in:
ZiWei
2026-01-11 18:14:19 +08:00
138 changed files with 84560 additions and 16444 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
],
"parent": null,
"type": "device",
"class": "mock_chiller",
"class": "virtual_heatchill",
"position": {
"x": 620.6111111111111,
"y": 171,
@@ -49,7 +49,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_filter",
"class": "virtual_filter",
"position": {
"x": 620.6111111111111,
"y": 171,
@@ -80,7 +80,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_heater",
"class": "virtual_heatchill",
"position": {
"x": 620.6111111111111,
"y": 171,
@@ -108,7 +108,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_pump",
"class": "virtual_transfer_pump",
"position": {
"x": 620.6111111111111,
"y": 171,
@@ -147,7 +147,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_rotavap",
"class": "virtual_rotavap",
"position": {
"x": 620.6111111111111,
"y": 171,
@@ -175,7 +175,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_separator",
"class": "virtual_separator",
"position": {
"x": 620.6111111111111,
"y": 171,
@@ -213,7 +213,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_solenoid_valve",
"class": "virtual_solenoid_valve",
"position": {
"x": 620.6111111111111,
"y": 171,
@@ -233,7 +233,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_stirrer_new",
"class": "virtual_stirrer",
"position": {
"x": 620.6111111111111,
"y": 171,
@@ -261,7 +261,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_stirrer",
"class": "virtual_stirrer",
"position": {
"x": 620.6111111111111,
"y": 171,
@@ -289,7 +289,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_vacuum",
"class": "virtual_vacuum_pump",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -6,7 +6,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_chiller",
"class": "virtual_heatchill",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -6,7 +6,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_filter",
"class": "virtual_filter",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -6,7 +6,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_heater",
"class": "virtual_heatchill",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -6,7 +6,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_pump",
"class": "virtual_transfer_pump",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -6,7 +6,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_rotavap",
"class": "virtual_rotavap",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -6,7 +6,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_separator",
"class": "virtual_separator",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -6,7 +6,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_solenoid_valve",
"class": "virtual_solenoid_valve",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -6,7 +6,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_stirrer",
"class": "virtual_stirrer",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -6,7 +6,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_stirrer_new",
"class": "virtual_stirrer",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -6,7 +6,7 @@
"children": [],
"parent": null,
"type": "device",
"class": "mock_vacuum",
"class": "virtual_vacuum_pump",
"position": {
"x": 620.6111111111111,
"y": 171,

View File

@@ -32,7 +32,7 @@
"children": [],
"parent": "CentrifugeTestStation",
"type": "device",
"class": "virtual_pump",
"class": "virtual_transfer_pump",
"position": {
"x": 520.6111111111111,
"y": 300,

View File

@@ -32,7 +32,7 @@
"children": [],
"parent": "FilterTestStation",
"type": "device",
"class": "virtual_pump",
"class": "virtual_transfer_pump",
"position": {
"x": 520.6111111111111,
"y": 300,

View File

@@ -32,7 +32,7 @@
"children": [],
"parent": "HeatChillTestStation",
"type": "device",
"class": "virtual_pump",
"class": "virtual_transfer_pump",
"position": {
"x": 520.6111111111111,
"y": 300,

View File

@@ -32,7 +32,7 @@
"children": [],
"parent": "StirTestStation",
"type": "device",
"class": "virtual_pump",
"class": "virtual_transfer_pump",
"position": {
"x": 520.6111111111111,
"y": 300,

File diff suppressed because it is too large Load Diff

View File

@@ -7,49 +7,18 @@ from typing import Dict, Any, List
from unilabos.ros.nodes.base_device_node import BaseROS2DeviceNode
class SmartPumpController:
"""
智能泵控制器
class AnyDevice:
@property
def status(self) -> str:
return "Idle"
支持多种泵送模式,具有高精度流量控制和自动校准功能。
适用于实验室自动化系统中的液体处理任务。
"""
_ros_node: BaseROS2DeviceNode
def __init__(self, device_id: str = "smart_pump_01", port: str = "/dev/ttyUSB0"):
"""
初始化智能泵控制器
Args:
device_id: 设备唯一标识符
port: 通信端口
"""
self.device_id = device_id
self.port = port
self.is_connected = False
self.current_flow_rate = 0.0
self.total_volume_pumped = 0.0
self.calibration_factor = 1.0
self.pump_mode = "continuous" # continuous, volume, rate
def post_init(self, ros_node: BaseROS2DeviceNode):
self._ros_node = ros_node
def connect_device(self, timeout: int = 10) -> bool:
"""
连接到泵设备
Args:
timeout: 连接超时时间(秒)
Returns:
bool: 连接是否成功
"""
# 模拟连接过程
self.is_connected = True
async def action(self, addr: str) -> bool:
return True
def disconnect_device(self) -> bool:
"""
断开设备连接