mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-18 21:41:16 +00:00
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
import requests
|
import requests
|
||||||
from typing import List, Sequence, Optional, Union, Literal
|
from typing import List, Sequence, Optional, Union, Literal
|
||||||
from geometry_msgs.msg import Point
|
from geometry_msgs.msg import Point
|
||||||
#from unilabos_msgs.msg import Resource
|
from pylabrobot.liquid_handling import LiquidHandler
|
||||||
|
from unilabos_msgs.msg import Resource
|
||||||
|
|
||||||
from pylabrobot.resources import (
|
from pylabrobot.resources import (
|
||||||
TipRack,
|
TipRack,
|
||||||
@@ -22,8 +23,8 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
|
|||||||
该类用于处理Biomek液体处理器的特定操作。
|
该类用于处理Biomek液体处理器的特定操作。
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, backend=None, deck=None, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(backend, deck, *args, **kwargs)
|
||||||
self._status = "Idle" # 初始状态为 Idle
|
self._status = "Idle" # 初始状态为 Idle
|
||||||
self._success = False # 初始成功状态为 False
|
self._success = False # 初始成功状态为 False
|
||||||
self._status_queue = kwargs.get("status_queue", None) # 状态队列
|
self._status_queue = kwargs.get("status_queue", None) # 状态队列
|
||||||
@@ -71,6 +72,10 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def deserialize(cls, data: dict, allow_marshal: bool = False) -> LiquidHandler:
|
||||||
|
return LiquidHandler.deserialize(data, allow_marshal)
|
||||||
|
|
||||||
|
|
||||||
def create_protocol(
|
def create_protocol(
|
||||||
self,
|
self,
|
||||||
@@ -259,7 +264,7 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
|
|||||||
}
|
}
|
||||||
transfer_params["items"] = items
|
transfer_params["items"] = items
|
||||||
|
|
||||||
transfer_params["Solvent"] = solvent if solvent else "Water"
|
transfer_params["Solvent"] = "Water"
|
||||||
TipLocation = tip_racks[0].name
|
TipLocation = tip_racks[0].name
|
||||||
transfer_params["TipLocation"] = TipLocation
|
transfer_params["TipLocation"] = TipLocation
|
||||||
|
|
||||||
@@ -343,6 +348,8 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
steps_info = '''
|
steps_info = '''
|
||||||
{
|
{
|
||||||
"steps": [
|
"steps": [
|
||||||
@@ -622,6 +629,16 @@ labware_with_liquid = '''
|
|||||||
"A1"
|
"A1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "Tip Rack BC230 TL2",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "TL2",
|
||||||
|
"class_name": "BC230",
|
||||||
|
"liquid_type": [],
|
||||||
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 TL2",
|
"id": "Tip Rack BC230 TL2",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
@@ -809,6 +826,8 @@ labware_with_liquid = '''
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
handler = LiquidHandlerBiomek()
|
handler = LiquidHandlerBiomek()
|
||||||
|
|
||||||
handler.temp_protocol = {
|
handler.temp_protocol = {
|
||||||
|
|||||||
@@ -340,6 +340,17 @@ liquid_handler.biomek:
|
|||||||
none_keys: none_keys
|
none_keys: none_keys
|
||||||
feedback: {}
|
feedback: {}
|
||||||
result: {}
|
result: {}
|
||||||
|
transfer_biomek:
|
||||||
|
type: LiquidHandlerTransferBiomek
|
||||||
|
goal:
|
||||||
|
source: source
|
||||||
|
target: target
|
||||||
|
tip_rack: tip_rack
|
||||||
|
volume: volume
|
||||||
|
aspirate_techniques: aspirate_techniques
|
||||||
|
dispense_techniques: dispense_techniques
|
||||||
|
feedback: {}
|
||||||
|
result: {}
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
properties: {}
|
properties: {}
|
||||||
|
|||||||
@@ -805,7 +805,9 @@ class ROS2DeviceNode:
|
|||||||
self.resource_tracker = DeviceNodeResourceTracker()
|
self.resource_tracker = DeviceNodeResourceTracker()
|
||||||
|
|
||||||
# use_pylabrobot_creator 使用 cls的包路径检测
|
# use_pylabrobot_creator 使用 cls的包路径检测
|
||||||
use_pylabrobot_creator = driver_class.__module__.startswith("pylabrobot") or driver_class.__name__ == "LiquidHandlerAbstract"
|
use_pylabrobot_creator = (driver_class.__module__.startswith("pylabrobot")
|
||||||
|
or driver_class.__name__ == "LiquidHandlerAbstract"
|
||||||
|
or driver_class.__name__ == "LiquidHandlerBiomek")
|
||||||
|
|
||||||
# TODO: 要在创建之前预先请求服务器是否有当前id的物料,放到resource_tracker中,让pylabrobot进行创建
|
# TODO: 要在创建之前预先请求服务器是否有当前id的物料,放到resource_tracker中,让pylabrobot进行创建
|
||||||
# 创建设备类实例
|
# 创建设备类实例
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
Resource source
|
string source
|
||||||
Resource target
|
string target
|
||||||
Resource tip_rack
|
string tip_rack
|
||||||
|
float64 volume
|
||||||
string aspirate_technique
|
string aspirate_technique
|
||||||
string dispense_technique
|
string dispense_technique
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user