mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 13:01:12 +00:00
try fix add protocol
This commit is contained in:
@@ -169,7 +169,7 @@ def generate_add_protocol(
|
|||||||
|
|
||||||
# 固体加样
|
# 固体加样
|
||||||
add_kwargs = {
|
add_kwargs = {
|
||||||
"vessel": vessel_id, # 🔧 使用 vessel_id
|
"vessel": {"id": vessel_id}, # 🔧 使用 vessel_id
|
||||||
"reagent": reagent,
|
"reagent": reagent,
|
||||||
"purpose": purpose,
|
"purpose": purpose,
|
||||||
"event": event,
|
"event": event,
|
||||||
|
|||||||
@@ -636,11 +636,8 @@ class HostNode(BaseROS2DeviceNode):
|
|||||||
向设备发送目标请求
|
向设备发送目标请求
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
device_id: 设备ID
|
|
||||||
action_type: 动作类型
|
action_type: 动作类型
|
||||||
action_name: 动作名称
|
|
||||||
action_kwargs: 动作参数
|
action_kwargs: 动作参数
|
||||||
goal_uuid: 目标UUID,如果为None则自动生成
|
|
||||||
server_info: 服务器发送信息,包含发送时间戳等
|
server_info: 服务器发送信息,包含发送时间戳等
|
||||||
"""
|
"""
|
||||||
u = uuid.UUID(item.job_id)
|
u = uuid.UUID(item.job_id)
|
||||||
|
|||||||
@@ -191,12 +191,11 @@ class ROS2ProtocolNode(BaseROS2DeviceNode):
|
|||||||
execution_error = ""
|
execution_error = ""
|
||||||
execution_success = False
|
execution_success = False
|
||||||
protocol_return_value = None
|
protocol_return_value = None
|
||||||
self.get_logger().info(f"Executing {protocol_name} action...")
|
self.lab_logger().info(f"Executing {protocol_name} action...")
|
||||||
action_value_mapping = self._action_value_mappings[protocol_name]
|
action_value_mapping = self._action_value_mappings[protocol_name]
|
||||||
step_results = []
|
step_results = []
|
||||||
try:
|
try:
|
||||||
print("+" * 30)
|
self.lab_logger().warning("+" * 30)
|
||||||
print(protocol_steps_generator)
|
|
||||||
# 从目标消息中提取参数, 并调用Protocol生成器(根据设备连接图)生成action步骤
|
# 从目标消息中提取参数, 并调用Protocol生成器(根据设备连接图)生成action步骤
|
||||||
goal = goal_handle.request
|
goal = goal_handle.request
|
||||||
protocol_kwargs = convert_from_ros_msg_with_mapping(goal, action_value_mapping["goal"])
|
protocol_kwargs = convert_from_ros_msg_with_mapping(goal, action_value_mapping["goal"])
|
||||||
|
|||||||
@@ -284,9 +284,6 @@ class ProtocolNodeCreator(DeviceClassCreator[T]):
|
|||||||
"""
|
"""
|
||||||
super().__init__(cls, children, resource_tracker)
|
super().__init__(cls, children, resource_tracker)
|
||||||
|
|
||||||
def attach_resource(self):
|
|
||||||
pass # WorkstationNode不直接附加资源
|
|
||||||
|
|
||||||
def create_instance(self, data: Dict[str, Any]) -> T:
|
def create_instance(self, data: Dict[str, Any]) -> T:
|
||||||
"""
|
"""
|
||||||
从数据创建ProtocolNode设备实例
|
从数据创建ProtocolNode设备实例
|
||||||
|
|||||||
Reference in New Issue
Block a user