update todo

This commit is contained in:
Xuwznln
2025-10-11 13:53:17 +08:00
parent 25d46dc9d5
commit c8d16c7024
6 changed files with 11 additions and 15 deletions

View File

@@ -61,7 +61,6 @@ class ElectrodeSheet(Resource):
info=None
)
# TODO: 这个还要不要给self._unilabos_state赋值的
def load_state(self, state: Dict[str, Any]) -> None:
"""格式不变"""
super().load_state(state)
@@ -665,7 +664,6 @@ class BatteryPressSlot(Resource):
reassign: bool = True,
):
"""放置极片"""
# TODO: 让高京看下槽位只有一个电池时是否这么写。
if self.has_battery():
raise ValueError(f"槽位已含有一个电池,无法再放置其他电池")
super().assign_child_resource(resource, location, reassign)
@@ -674,7 +672,6 @@ class BatteryPressSlot(Resource):
def get_battery_info(self, index: int) -> Battery:
return self.children[0]
# TODO:这个移液枪架子看一下从哪继承
class TipBox64State(TypedDict):
"""电池状态字典"""
tip_diameter: float = 5.0

View File

@@ -1012,7 +1012,7 @@ class CoinCellAssemblyWorkstation(WorkstationBase):
# else:
# print("子弹夹洞位0没有极片")
#
# # TODO:#把电解液从瓶中取到电池夹子中
# #把电解液从瓶中取到电池夹子中
# battery_site = deck.get_resource("battery_press_1")
# clip_magazine_battery = deck.get_resource("clip_magazine_battery")
# if battery_site.has_battery():

View File

@@ -131,7 +131,6 @@ class Registry:
}
]
},
# todo: support nested keys, switch to non ros message schema
"placeholder_keys": {
"res_id": "unilabos_resources", # 将当前实验室的全部物料id作为下拉框可选择
"device_id": "unilabos_devices", # 将当前实验室的全部设备id作为下拉框可选择

View File

@@ -189,8 +189,8 @@ def slave(
# 只有二级子设备
if sub_node.res_content.type != "device":
device_tracker = devices_instances[node.res_content.id].resource_tracker
resource_instance = device_tracker.figure_resource( # todo: 要换成uuid进行figure
{"name": sub_node.res_content.name})
resource_instance = device_tracker.figure_resource(
{"uuid": sub_node.res_content.uuid})
device_tracker.loop_update_uuid(resource_instance, uuid_mapping)
else:
logger.error("Slave模式不允许新增非设备节点下的物料")

View File

@@ -256,9 +256,10 @@ class BaseROS2DeviceNode(Node, Generic[T]):
node_name: str
namespace: str
# TODO 要删除,添加时间相关的属性,避免动态添加属性的警告
time_spent = 0.0
time_remaining = 0.0
# 内部共享变量
_time_spent = 0.0
_time_remaining = 0.0
# 是否创建Action
create_action_server = True
def __init__(
@@ -998,8 +999,8 @@ class BaseROS2DeviceNode(Node, Generic[T]):
goal_handle.canceled()
return action_type.Result()
self.time_spent = time.time() - time_start
self.time_remaining = time_overall - self.time_spent
self._time_spent = time.time() - time_start
self._time_remaining = time_overall - self._time_spent
# 发布反馈
feedback_values = {}
@@ -1393,7 +1394,6 @@ class ROS2DeviceNode:
or driver_class.__name__ == "PRCXI9300Handler"
)
# TODO: 要在创建之前预先请求服务器是否有当前id的物料放到resource_tracker中让pylabrobot进行创建
# 创建设备类实例
if use_pylabrobot_creator:
# 先对pylabrobot的子资源进行加载不然subclass无法认出

View File

@@ -260,8 +260,8 @@ class HostNode(BaseROS2DeviceNode):
if sub_node.res_content.type != "device":
# slave节点走c2s更新接口拿到add自行update uuid
device_tracker = self.devices_instances[node.res_content.id].resource_tracker
resource_instance = device_tracker.figure_resource( # todo: 要换成uuid进行figure
{"name": sub_node.res_content.name})
resource_instance = device_tracker.figure_resource(
{"uuid": sub_node.res_content.uuid})
device_tracker.loop_update_uuid(resource_instance, uuid_mapping)
else:
try: