mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 13:01:12 +00:00
biomek switch back to non-test
This commit is contained in:
1710
test/experiments/plr_test_converted_slim.json
Normal file
1710
test/experiments/plr_test_converted_slim.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,8 @@ from copy import deepcopy
|
|||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
from unilabos.resources.graphio import tree_to_list
|
||||||
|
|
||||||
# 首先添加项目根目录到路径
|
# 首先添加项目根目录到路径
|
||||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
unilabos_dir = os.path.dirname(os.path.dirname(current_dir))
|
unilabos_dir = os.path.dirname(os.path.dirname(current_dir))
|
||||||
@@ -145,9 +147,8 @@ def main():
|
|||||||
)
|
)
|
||||||
devices_and_resources = dict_from_graph(graph_res.physical_setup_graph)
|
devices_and_resources = dict_from_graph(graph_res.physical_setup_graph)
|
||||||
args_dict["resources_config"] = initialize_resources(list(deepcopy(devices_and_resources).values()))
|
args_dict["resources_config"] = initialize_resources(list(deepcopy(devices_and_resources).values()))
|
||||||
|
args_dict["resources_config"] = list(devices_and_resources.values())
|
||||||
args_dict["devices_config"] = dict_to_nested_dict(deepcopy(devices_and_resources), devices_only=False)
|
args_dict["devices_config"] = dict_to_nested_dict(deepcopy(devices_and_resources), devices_only=False)
|
||||||
# args_dict["resources_config"] = dict_to_tree(devices_and_resources, devices_only=False)
|
|
||||||
|
|
||||||
args_dict["graph"] = graph_res.physical_setup_graph
|
args_dict["graph"] = graph_res.physical_setup_graph
|
||||||
else:
|
else:
|
||||||
if args_dict["devices"] is None or args_dict["resources"] is None:
|
if args_dict["devices"] is None or args_dict["resources"] is None:
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
|
import json
|
||||||
|
import pathlib
|
||||||
|
from typing import Sequence, Optional, List, Union, Literal
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from typing import List, Sequence, Optional, Union, Literal
|
|
||||||
from geometry_msgs.msg import Point
|
from geometry_msgs.msg import Point
|
||||||
from pylabrobot.liquid_handling import LiquidHandler
|
from pylabrobot.liquid_handling import LiquidHandler
|
||||||
from unilabos_msgs.msg import Resource
|
|
||||||
|
|
||||||
from pylabrobot.resources import (
|
from pylabrobot.resources import (
|
||||||
TipRack,
|
TipRack,
|
||||||
Container,
|
Container,
|
||||||
Coordinate,
|
Coordinate,
|
||||||
)
|
)
|
||||||
|
from unilabos_msgs.msg import Resource
|
||||||
|
|
||||||
from unilabos.ros.nodes.resource_tracker import DeviceNodeResourceTracker # type: ignore
|
from unilabos.ros.nodes.resource_tracker import DeviceNodeResourceTracker # type: ignore
|
||||||
from .liquid_handler_abstract import LiquidHandlerAbstract
|
|
||||||
|
|
||||||
import json
|
|
||||||
from typing import Sequence, Optional, List, Union, Literal
|
|
||||||
|
|
||||||
#class LiquidHandlerBiomek(LiquidHandlerAbstract):
|
|
||||||
class LiquidHandlerBiomek:
|
class LiquidHandlerBiomek:
|
||||||
"""
|
"""
|
||||||
Biomek液体处理器的实现类,继承自LiquidHandlerAbstract。
|
Biomek液体处理器的实现类,继承自LiquidHandlerAbstract。
|
||||||
@@ -214,7 +212,6 @@ class LiquidHandlerBiomek:
|
|||||||
liquid_type: list[str],
|
liquid_type: list[str],
|
||||||
liquid_volume: list[int],
|
liquid_volume: list[int],
|
||||||
slot_on_deck: int,
|
slot_on_deck: int,
|
||||||
|
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
创建一个新的资源。
|
创建一个新的资源。
|
||||||
@@ -236,26 +233,25 @@ class LiquidHandlerBiomek:
|
|||||||
# TODO:需要对好接口,下面这个是临时的
|
# TODO:需要对好接口,下面这个是临时的
|
||||||
for resource in resources:
|
for resource in resources:
|
||||||
res_id = resource.id
|
res_id = resource.id
|
||||||
class_name = resource.class_name
|
class_name = resource.name
|
||||||
parent = bind_parent_id
|
parent = bind_parent_id
|
||||||
bind_locations = Coordinate.from_point(resource.bind_location)
|
|
||||||
liquid_input_slot = liquid_input_slot
|
liquid_input_slot = liquid_input_slot
|
||||||
liquid_type = liquid_type
|
liquid_type = liquid_type
|
||||||
liquid_volume = liquid_volume
|
liquid_volume = liquid_volume
|
||||||
slot_on_deck = slot_on_deck
|
slot_on_deck = slot_on_deck
|
||||||
|
|
||||||
resource = {
|
resource = {
|
||||||
"id": res_id,
|
"id": res_id,
|
||||||
"class": class_name,
|
"class": class_name,
|
||||||
"parent": parent,
|
"parent": parent,
|
||||||
"bind_locations": bind_locations.to_dict(),
|
"bind_locations": bind_location,
|
||||||
"liquid_input_slot": liquid_input_slot,
|
"liquid_input_slot": liquid_input_slot,
|
||||||
"liquid_type": liquid_type,
|
"liquid_type": liquid_type,
|
||||||
"liquid_volume": liquid_volume,
|
"liquid_volume": liquid_volume,
|
||||||
"slot_on_deck": slot_on_deck,
|
"slot_on_deck": slot_on_deck,
|
||||||
}
|
}
|
||||||
self.temp_protocol["labwares"].append(resource)
|
self.temp_protocol["labwares"].append(resource)
|
||||||
return resource
|
return resources
|
||||||
|
|
||||||
def transfer_liquid(
|
def transfer_liquid(
|
||||||
self,
|
self,
|
||||||
@@ -439,16 +435,14 @@ class LiquidHandlerBiomek:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def transfer_biomek(
|
def transfer_biomek(
|
||||||
self,
|
self,
|
||||||
source: str,
|
source: str,
|
||||||
target: str,
|
target: str,
|
||||||
tip_rack: str,
|
tip_rack: str,
|
||||||
volume: float,
|
volume: float,
|
||||||
aspirate_techniques: str,
|
aspirate_techniques: str,
|
||||||
dispense_techniques: str,
|
dispense_techniques: str,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
处理Biomek的液体转移操作。
|
处理Biomek的液体转移操作。
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ liquid_handler.biomek:
|
|||||||
description: Biomek液体处理器设备,基于pylabrobot控制
|
description: Biomek液体处理器设备,基于pylabrobot控制
|
||||||
icon: icon_yiyezhan.webp
|
icon: icon_yiyezhan.webp
|
||||||
class:
|
class:
|
||||||
module: unilabos.devices.liquid_handling.biomek_test:LiquidHandlerBiomek
|
module: unilabos.devices.liquid_handling.biomek:LiquidHandlerBiomek
|
||||||
type: python
|
type: python
|
||||||
status_types: {}
|
status_types: {}
|
||||||
action_value_mappings:
|
action_value_mappings:
|
||||||
|
|||||||
Reference in New Issue
Block a user