fix biomek startup

add action handles
This commit is contained in:
Xuwznln
2025-06-06 17:45:54 +08:00
parent 55be5e8188
commit 48c43d3303
2 changed files with 257 additions and 234 deletions

View File

@@ -23,8 +23,8 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
该类用于处理Biomek液体处理器的特定操作。
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def __init__(self, backend=None, deck=None, *args, **kwargs):
super().__init__(backend, deck, *args, **kwargs)
self._status = "Idle" # 初始状态为 Idle
self._success = False # 初始成功状态为 False
self._status_queue = kwargs.get("status_queue", None) # 状态队列
@@ -421,7 +421,6 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
if __name__ == "__main__":
steps_info = '''
{
"steps": [
@@ -684,11 +683,8 @@ if __name__ == "__main__":
]
}
'''
labware_with_liquid = '''
[ {
labware_with_liquid = '''
[ {
"id": "stock plate on P1",
"parent": "deck",
"slot_on_deck": "P1",
@@ -897,21 +893,18 @@ labware_with_liquid = '''
]
'''
handler = LiquidHandlerBiomek()
handler = LiquidHandlerBiomek()
handler.temp_protocol = {
handler.temp_protocol = {
"meta": {},
"labwares": [],
"steps": []
}
}
input_steps = json.loads(steps_info)
labwares = json.loads(labware_with_liquid)
input_steps = json.loads(steps_info)
labwares = json.loads(labware_with_liquid)
for step in input_steps['steps']:
for step in input_steps['steps']:
operation = step['operation']
parameters = step['parameters']
@@ -931,6 +924,6 @@ for step in input_steps['steps']:
elif operation == 'incubation':
handler.incubation_biomek(time=parameters['time'])
print(json.dumps(handler.temp_protocol, indent=4))
print(json.dumps(handler.temp_protocol, indent=4))

View File

@@ -340,6 +340,21 @@ liquid_handler.biomek:
none_keys: none_keys
feedback: {}
result: {}
handles:
input:
- handler_key: liquid-input
label: Liquid Input
data_type: resource
io_type: target
data_source: handle
data_key: liquid
output:
- handler_key: liquid-output
label: Liquid Output
data_type: resource
io_type: source
data_source: executor
data_key: liquid
transfer_biomek:
type: LiquidHandlerTransferBiomek
goal:
@@ -351,6 +366,21 @@ liquid_handler.biomek:
dispense_techniques: dispense_techniques
feedback: {}
result: {}
handles:
input:
- handler_key: liquid-input
label: Liquid Input
data_type: resource
io_type: target
data_source: handle
data_key: liquid
output:
- handler_key: liquid-output
label: Liquid Output
data_type: resource
io_type: source
data_source: executor
data_key: liquid
schema:
type: object
properties: {}