diff --git a/unilabos/devices/workstation/coin_cell_assembly/button_battery_station.py b/unilabos/devices/workstation/coin_cell_assembly/button_battery_station.py index ffce04be..f663a217 100644 --- a/unilabos/devices/workstation/coin_cell_assembly/button_battery_station.py +++ b/unilabos/devices/workstation/coin_cell_assembly/button_battery_station.py @@ -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 diff --git a/unilabos/devices/workstation/coin_cell_assembly/coin_cell_assembly.py b/unilabos/devices/workstation/coin_cell_assembly/coin_cell_assembly.py index 4b8ba73d..4758bdda 100644 --- a/unilabos/devices/workstation/coin_cell_assembly/coin_cell_assembly.py +++ b/unilabos/devices/workstation/coin_cell_assembly/coin_cell_assembly.py @@ -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(): diff --git a/unilabos/registry/registry.py b/unilabos/registry/registry.py index dc4d2446..caeafa5c 100644 --- a/unilabos/registry/registry.py +++ b/unilabos/registry/registry.py @@ -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作为下拉框可选择 diff --git a/unilabos/ros/main_slave_run.py b/unilabos/ros/main_slave_run.py index aca3beba..c903a4be 100644 --- a/unilabos/ros/main_slave_run.py +++ b/unilabos/ros/main_slave_run.py @@ -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模式不允许新增非设备节点下的物料") diff --git a/unilabos/ros/nodes/base_device_node.py b/unilabos/ros/nodes/base_device_node.py index 02d0dd76..b62ad2d9 100644 --- a/unilabos/ros/nodes/base_device_node.py +++ b/unilabos/ros/nodes/base_device_node.py @@ -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无法认出 diff --git a/unilabos/ros/nodes/presets/host_node.py b/unilabos/ros/nodes/presets/host_node.py index 0c139b89..3e2f4d49 100644 --- a/unilabos/ros/nodes/presets/host_node.py +++ b/unilabos/ros/nodes/presets/host_node.py @@ -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: