mirror of
https://github.com/deepmodeling/Uni-Lab-OS
synced 2026-03-25 17:29:40 +00:00
feat: 升级Resource消息系统,增加uuid和klass字段
Resource.msg新增uuid和klass字段支持ResourceDictInstance完整序列化, message_converter增加Resource消息与Python dict的双向转换, workstation和base_device_node增加资源同步相关功能。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -197,6 +197,28 @@ class WorkstationBase(ABC):
|
||||
self._ros_node = workstation_node
|
||||
logger.info(f"工作站 {self._ros_node.device_id} 关联协议节点")
|
||||
|
||||
# ============ 物料转运回调 ============
|
||||
|
||||
def resource_tree_batch_transfer(
|
||||
self,
|
||||
transfers: list,
|
||||
old_parents: list,
|
||||
new_parents: list,
|
||||
) -> None:
|
||||
"""批量物料转运完成后的回调,供子类重写
|
||||
|
||||
默认实现:逐个调用 resource_tree_transfer(如存在)。
|
||||
|
||||
Args:
|
||||
transfers: 转移列表,每项包含 resource, from_parent, to_parent, to_site 等
|
||||
old_parents: 每个物料转移前的原父节点
|
||||
new_parents: 每个物料转移后的新父节点
|
||||
"""
|
||||
func = getattr(self, "resource_tree_transfer", None)
|
||||
if callable(func):
|
||||
for t, old_parent, new_parent in zip(transfers, old_parents, new_parents):
|
||||
func(old_parent, t["resource"], new_parent)
|
||||
|
||||
# ============ 设备操作接口 ============
|
||||
|
||||
def call_device_method(self, method: str, *args, **kwargs) -> Any:
|
||||
|
||||
Reference in New Issue
Block a user