Compare commits

...

3 Commits

Author SHA1 Message Date
Junhan Chang
b6c9530c61 Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-Lab-OS into 37-biomek-i5i7 2025-06-07 18:52:23 +08:00
Junhan Chang
8698821c52 fix liquid_handler.biomek handles 2025-06-07 18:52:20 +08:00
qxw138
3f53f88390 biomek_test.py 2025-06-07 15:21:20 +08:00
7 changed files with 3866 additions and 21 deletions

View File

@@ -93,6 +93,15 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
def deserialize(cls, data: dict, allow_marshal: bool = False) -> LiquidHandler:
return LiquidHandler.deserialize(data, allow_marshal)
@property
def success(self):
"""
获取操作是否成功的状态。
Returns:
bool: 如果操作成功返回True否则返回False。
"""
return self._success
def create_protocol(
self,

View File

@@ -168,7 +168,7 @@ class LiquidHandlerBiomek:
"date": protocol_date,
"type": protocol_type,
},
"labwares": [],
"labwares": {}, # 改为字典格式以匹配DeckItems
"steps": [],
}
return self.temp_protocol
@@ -251,15 +251,16 @@ class LiquidHandlerBiomek:
liquid_input_wells: list[str],
):
"""
设置Biomek仪器的参数配置完全按照Biomek的实际格式
设置Biomek仪器的参数配置按照DeckItems格式
根据不同的仪器类型容器、tip rack等设置相应的参数结构
位置作为键,配置列表作为值
"""
# 判断仪器类型
instrument_type = self._get_instrument_type(class_name)
config = {} # 初始化为空字典,以便在各种情况下都能返回
config = None # 初始化为None
if instrument_type == "reservoir":
# 储液槽类型配置
@@ -325,17 +326,13 @@ class LiquidHandlerBiomek:
"DataSets": {"Volume": {}},
"RuntimeDataSets": {"Volume": {}}
}
else:
# 未知类型或空位置的默认配置
config = {}
# 将配置直接添加到labwares列表中
if config: # 只有非空配置才添加
# 添加Name字段用于标识
config["Name"] = id
config["Position"] = slot_on_deck
self.temp_protocol["labwares"].append(config)
# 按照DeckItems格式存储位置作为键配置列表作为值
if config is not None:
self.temp_protocol["labwares"][slot_on_deck] = [config]
else:
# 空位置
self.temp_protocol["labwares"][slot_on_deck] = []
return
@@ -1003,7 +1000,7 @@ if __name__ == "__main__":
script_dir = pathlib.Path(__file__).parent
# 保存完整协议
complete_output_path = script_dir / "complete_biomek_protocol.json"
complete_output_path = script_dir / "complete_biomek_protocol_0607.json"
with open(complete_output_path, 'w', encoding='utf-8') as f:
json.dump(handler.temp_protocol, f, indent=4, ensure_ascii=False)

File diff suppressed because it is too large Load Diff

View File

@@ -368,18 +368,91 @@ liquid_handler.biomek:
result: {}
handles:
input:
- handler_key: liquid-input
label: Liquid Input
- handler_key: sources
label: sources
data_type: resource
data_source: handle
data_key: liquid
- handler_key: targets
label: targets
data_type: resource
data_source: executor
data_key: liquid
- handler_key: tip_rack
label: tip_rack
data_type: resource
data_source: executor
data_key: liquid
output:
- handler_key: sources_out
label: sources
data_type: resource
data_source: handle
data_key: liquid
- handler_key: targets_out
label: targets
data_type: resource
data_source: executor
data_key: liquid
oscillation_biomek:
type: LiquidHandlerOscillateBiomek
goal:
rpm: rpm
time: time
feedback: {}
result: {}
handles:
input:
- handler_key: plate
label: plate
data_type: resource
io_type: target
data_source: handle
data_key: liquid
output:
- handler_key: liquid-output
label: Liquid Output
- handler_key: plate_out
label: plate
data_type: resource
io_type: source
data_source: executor
data_source: handle
data_key: liquid
move_biomek:
type: LiquidHandlerMoveBiomek
goal:
source: resource
target: target
feedback: {}
result:
name: name
handles:
input:
- handler_key: sources
label: sources
data_type: resource
data_source: handle
data_key: liquid
output:
- handler_key: targets
label: targets
data_type: resource
data_source: handle
data_key: liquid
incubation_biomek:
type: LiquidHandlerIncubateBiomek
goal:
time: time
feedback: {}
result: {}
handles:
input:
- handler_key: plate
label: plate
data_type: resource
data_source: handle
data_key: liquid
output:
- handler_key: plate_out
label: plate
data_type: resource
data_source: handle
data_key: liquid
schema:
type: object

View File

@@ -45,7 +45,11 @@ set(action_files
"action/LiquidHandlerReturnTips96.action"
"action/LiquidHandlerStamp.action"
"action/LiquidHandlerTransfer.action"
"action/LiquidHandlerTransferBiomek.action"
"action/LiquidHandlerIncubateBiomek.action"
"action/LiquidHandlerMoveBiomek.action"
"action/LiquidHandlerOscillateBiomek.action"
"action/LiquidHandlerAdd.action"
"action/LiquidHandlerMix.action"