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液体处理器的特定操作。 该类用于处理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) # 状态队列
@@ -421,7 +421,6 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
if __name__ == "__main__": if __name__ == "__main__":
steps_info = ''' steps_info = '''
{ {
"steps": [ "steps": [
@@ -684,11 +683,8 @@ if __name__ == "__main__":
] ]
} }
''' '''
labware_with_liquid = '''
[ {
labware_with_liquid = '''
[ {
"id": "stock plate on P1", "id": "stock plate on P1",
"parent": "deck", "parent": "deck",
"slot_on_deck": "P1", "slot_on_deck": "P1",
@@ -897,21 +893,18 @@ labware_with_liquid = '''
] ]
''' '''
handler = LiquidHandlerBiomek()
handler.temp_protocol = {
handler = LiquidHandlerBiomek()
handler.temp_protocol = {
"meta": {}, "meta": {},
"labwares": [], "labwares": [],
"steps": [] "steps": []
} }
input_steps = json.loads(steps_info) input_steps = json.loads(steps_info)
labwares = json.loads(labware_with_liquid) labwares = json.loads(labware_with_liquid)
for step in input_steps['steps']: for step in input_steps['steps']:
operation = step['operation'] operation = step['operation']
parameters = step['parameters'] parameters = step['parameters']
@@ -931,6 +924,6 @@ for step in input_steps['steps']:
elif operation == 'incubation': elif operation == 'incubation':
handler.incubation_biomek(time=parameters['time']) 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 none_keys: none_keys
feedback: {} feedback: {}
result: {} 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: transfer_biomek:
type: LiquidHandlerTransferBiomek type: LiquidHandlerTransferBiomek
goal: goal:
@@ -351,6 +366,21 @@ liquid_handler.biomek:
dispense_techniques: dispense_techniques dispense_techniques: dispense_techniques
feedback: {} feedback: {}
result: {} 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: schema:
type: object type: object
properties: {} properties: {}