mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-15 12:15:11 +00:00
Compare commits
11 Commits
106d71e1db
...
c7b9c6a825
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7b9c6a825 | ||
|
|
48c43d3303 | ||
|
|
55be5e8188 | ||
|
|
1b9f3c666d | ||
|
|
097114d38c | ||
|
|
5bec899479 | ||
|
|
5e86112ebf | ||
|
|
24ecb13b79 | ||
|
|
2573d34713 | ||
|
|
46da42deef | ||
|
|
a62112ae26 |
@@ -32,46 +32,63 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
|
|||||||
self.py32_path = "/opt/py32" # Biomek的Python 3.2路径
|
self.py32_path = "/opt/py32" # Biomek的Python 3.2路径
|
||||||
self.aspirate_techniques = {
|
self.aspirate_techniques = {
|
||||||
'MC P300 high':{
|
'MC P300 high':{
|
||||||
"Solvent": "Water",
|
'Position': 'P1',
|
||||||
|
'Height': -2.0,
|
||||||
|
'Volume': '50',
|
||||||
|
'liquidtype': 'Well Contents',
|
||||||
|
'WellsX': 12,
|
||||||
|
'LabwareClass': 'Matrix96_750uL',
|
||||||
|
'AutoSelectPrototype': True,
|
||||||
|
'ColsFirst': True,
|
||||||
|
'CustomHeight': False,
|
||||||
|
'DataSetPattern': False,
|
||||||
|
'HeightFrom': 0,
|
||||||
|
'LocalPattern': True,
|
||||||
|
'Operation': 'Aspirate',
|
||||||
|
'OverrideHeight': False,
|
||||||
|
'Pattern': (True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True),
|
||||||
|
'Prototype': 'MC P300 High',
|
||||||
|
'ReferencedPattern': '',
|
||||||
|
'RowsFirst': False,
|
||||||
|
'SectionExpression': '',
|
||||||
|
'SelectionInfo': (1,),
|
||||||
|
'SetMark': True,
|
||||||
|
'Source': True,
|
||||||
|
'StartAtMark': False,
|
||||||
|
'StartAtSelection': True,
|
||||||
|
'UseExpression': False},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
self.dispense_techniques = {
|
self.dispense_techniques = {
|
||||||
'MC P300 high':{
|
'MC P300 high':{
|
||||||
"Span8": False,
|
'Position': 'P11',
|
||||||
"Pod": "Pod1",
|
'Height': -2.0,
|
||||||
"Wash": False,
|
'Volume': '50',
|
||||||
"Dynamic?": True,
|
'liquidtype': 'Tip Contents',
|
||||||
"AutoSelectActiveWashTechnique": False,
|
'WellsX': 12,
|
||||||
"ActiveWashTechnique": "",
|
'LabwareClass': 'Matrix96_750uL',
|
||||||
"ChangeTipsBetweenDests": True,
|
'AutoSelectPrototype': True,
|
||||||
"ChangeTipsBetweenSources": False,
|
'ColsFirst': True,
|
||||||
"DefaultCaption": "",
|
'CustomHeight': False,
|
||||||
"UseExpression": False,
|
'DataSetPattern': False,
|
||||||
"LeaveTipsOn": False,
|
'HeightFrom': 0,
|
||||||
"MandrelExpression": "",
|
'LocalPattern': True,
|
||||||
"Repeats": "1",
|
'Operation': 'Dispense',
|
||||||
"RepeatsByVolume": False,
|
'OverrideHeight': False,
|
||||||
"Replicates": "1",
|
'Pattern': (True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True),
|
||||||
"ShowTipHandlingDetails": False,
|
'Prototype': 'MC P300 High',
|
||||||
"ShowTransferDetails": True,
|
'ReferencedPattern': '',
|
||||||
"Span8Wash": False,
|
'RowsFirst': False,
|
||||||
"Span8WashVolume": "2",
|
'SectionExpression': '',
|
||||||
"Span8WasteVolume": "1",
|
'SelectionInfo': (1,),
|
||||||
"SplitVolume": False,
|
'SetMark': True,
|
||||||
"SplitVolumeCleaning": False,
|
'Source': False,
|
||||||
"Stop": "Destinations",
|
'StartAtMark': False,
|
||||||
"UseCurrentTips": False,
|
'StartAtSelection': True,
|
||||||
"UseDisposableTips": False,
|
'UseExpression': False}
|
||||||
"UseFixedTips": False,
|
|
||||||
"UseJIT": True,
|
|
||||||
"UseMandrelSelection": True,
|
|
||||||
"UseProbes": [True, True, True, True, True, True, True, True],
|
|
||||||
"WashCycles": "3",
|
|
||||||
"WashVolume": "110%",
|
|
||||||
"Wizard": False
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def deserialize(cls, data: dict, allow_marshal: bool = False) -> LiquidHandler:
|
def deserialize(cls, data: dict, allow_marshal: bool = False) -> LiquidHandler:
|
||||||
return LiquidHandler.deserialize(data, allow_marshal)
|
return LiquidHandler.deserialize(data, allow_marshal)
|
||||||
@@ -347,9 +364,63 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def move_biomek(
|
||||||
|
self,
|
||||||
|
source: str,
|
||||||
|
target: str,
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
处理Biomek移动板子的操作。
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
move_params = {
|
||||||
|
"Pod": "Pod1",
|
||||||
|
"GripSide": "A1 near",
|
||||||
|
"Source": source,
|
||||||
|
"Target": target,
|
||||||
|
"LeaveBottomLabware": False,
|
||||||
|
}
|
||||||
|
self.temp_protocol["steps"].append(move_params)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
def incubation_biomek(
|
||||||
|
self,
|
||||||
|
time: int,
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
处理Biomek的孵育操作。
|
||||||
|
"""
|
||||||
|
incubation_params = {
|
||||||
|
"Message": "Paused",
|
||||||
|
"Location": "the whole system",
|
||||||
|
"Time": time,
|
||||||
|
"Mode": "TimedResource"
|
||||||
|
}
|
||||||
|
self.temp_protocol["steps"].append(incubation_params)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
def oscillation_biomek(
|
||||||
|
self,
|
||||||
|
rpm: int,
|
||||||
|
time: int,
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
处理Biomek的振荡操作。
|
||||||
|
"""
|
||||||
|
oscillation_params = {
|
||||||
|
'Device': 'OrbitalShaker0',
|
||||||
|
'Parameters': (str(rpm), '2', str(time), 'CounterClockwise'),
|
||||||
|
'Command': 'Timed Shake'
|
||||||
|
}
|
||||||
|
self.temp_protocol["steps"].append(oscillation_params)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
steps_info = '''
|
steps_info = '''
|
||||||
{
|
{
|
||||||
"steps": [
|
"steps": [
|
||||||
@@ -612,33 +683,20 @@ if __name__ == "__main__":
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
labware_with_liquid = '''
|
||||||
|
[ {
|
||||||
|
"id": "stock plate on P1",
|
||||||
labware_with_liquid = '''
|
"parent": "deck",
|
||||||
[ {
|
"slot_on_deck": "P1",
|
||||||
"id": "stock plate on P1",
|
"class_name": "nest_12_reservoir_15ml",
|
||||||
"parent": "deck",
|
"liquid_type": [
|
||||||
"slot_on_deck": "P1",
|
"master_mix"
|
||||||
"class_name": "nest_12_reservoir_15ml",
|
],
|
||||||
"liquid_type": [
|
"liquid_volume": [10000],
|
||||||
"master_mix"
|
"liquid_input_wells": [
|
||||||
],
|
"A1"
|
||||||
"liquid_volume": [10000],
|
]
|
||||||
"liquid_input_wells": [
|
},
|
||||||
"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",
|
||||||
@@ -650,206 +708,222 @@ labware_with_liquid = '''
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 on TL3",
|
"id": "Tip Rack BC230 TL2",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "TL3",
|
"slot_on_deck": "TL2",
|
||||||
"class_name": "BC230",
|
"class_name": "BC230",
|
||||||
"liquid_type": [],
|
"liquid_type": [],
|
||||||
"liquid_volume": [],
|
"liquid_volume": [],
|
||||||
"liquid_input_wells": [
|
"liquid_input_wells": [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "Tip Rack BC230 on TL4",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "TL4",
|
|
||||||
"class_name": "BC230",
|
|
||||||
"liquid_type": [],
|
|
||||||
"liquid_volume": [],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "Tip Rack BC230 on TL5",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "TL5",
|
|
||||||
"class_name": "BC230",
|
|
||||||
"liquid_type": [],
|
|
||||||
"liquid_volume": [],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 on P5",
|
"id": "Tip Rack BC230 on TL3",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P5",
|
"slot_on_deck": "TL3",
|
||||||
"class_name": "BC230",
|
"class_name": "BC230",
|
||||||
"liquid_type": [],
|
"liquid_type": [],
|
||||||
"liquid_volume": [],
|
"liquid_volume": [],
|
||||||
"liquid_input_wells": [
|
"liquid_input_wells": [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "Tip Rack BC230 on TL4",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "TL4",
|
||||||
|
"class_name": "BC230",
|
||||||
|
"liquid_type": [],
|
||||||
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Tip Rack BC230 on TL5",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "TL5",
|
||||||
|
"class_name": "BC230",
|
||||||
|
"liquid_type": [],
|
||||||
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 on P6",
|
"id": "Tip Rack BC230 on P5",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P6",
|
"slot_on_deck": "P5",
|
||||||
"class_name": "BC230",
|
"class_name": "BC230",
|
||||||
"liquid_type": [],
|
"liquid_type": [],
|
||||||
"liquid_volume": [],
|
"liquid_volume": [],
|
||||||
"liquid_input_wells": [
|
"liquid_input_wells": [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 on P7",
|
"id": "Tip Rack BC230 on P6",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P7",
|
"slot_on_deck": "P6",
|
||||||
"class_name": "BC230",
|
"class_name": "BC230",
|
||||||
"liquid_type": [],
|
"liquid_type": [],
|
||||||
"liquid_volume": [],
|
"liquid_volume": [],
|
||||||
"liquid_input_wells": [
|
"liquid_input_wells": [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 on P8",
|
"id": "Tip Rack BC230 on P7",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P8",
|
"slot_on_deck": "P7",
|
||||||
"class_name": "BC230",
|
"class_name": "BC230",
|
||||||
"liquid_type": [],
|
"liquid_type": [],
|
||||||
"liquid_volume": [],
|
"liquid_volume": [],
|
||||||
"liquid_input_wells": [
|
"liquid_input_wells": [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 P16",
|
"id": "Tip Rack BC230 on P8",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P16",
|
"slot_on_deck": "P8",
|
||||||
"class_name": "BC230",
|
"class_name": "BC230",
|
||||||
"liquid_type": [],
|
"liquid_type": [],
|
||||||
"liquid_volume": [],
|
"liquid_volume": [],
|
||||||
"liquid_input_wells": [
|
"liquid_input_wells": [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "stock plate on 4",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "P2",
|
|
||||||
"class_name": "nest_12_reservoir_15ml",
|
|
||||||
"liquid_type": [
|
|
||||||
"bind beads"
|
|
||||||
],
|
|
||||||
"liquid_volume": [10000],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
"A1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "stock plate on P2",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "P2",
|
|
||||||
"class_name": "nest_12_reservoir_15ml",
|
|
||||||
"liquid_type": [
|
|
||||||
"bind beads"
|
|
||||||
],
|
|
||||||
"liquid_volume": [10000],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
"A1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "stock plate on P3",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "P3",
|
|
||||||
"class_name": "nest_12_reservoir_15ml",
|
|
||||||
"liquid_type": [
|
|
||||||
"ethyl alcohol"
|
|
||||||
],
|
|
||||||
"liquid_volume": [10000],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
"A1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "oscillation",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "Orbital1",
|
|
||||||
"class_name": "Orbital",
|
|
||||||
"liquid_type": [],
|
|
||||||
"liquid_volume": [],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "working plate on P11",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "P11",
|
|
||||||
"class_name": "NEST 2ml Deep Well Plate",
|
|
||||||
"liquid_type": [
|
|
||||||
],
|
|
||||||
"liquid_volume": [],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "magnetics module on P12",
|
"id": "Tip Rack BC230 P16",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P12",
|
"slot_on_deck": "P16",
|
||||||
"class_name": "magnetics module",
|
"class_name": "BC230",
|
||||||
"liquid_type": [],
|
"liquid_type": [],
|
||||||
"liquid_volume": [],
|
"liquid_volume": [],
|
||||||
"liquid_input_wells": [
|
"liquid_input_wells": [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "working plate on P13",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "P13",
|
|
||||||
"class_name": "NEST 2ml Deep Well Plate",
|
|
||||||
"liquid_type": [
|
|
||||||
],
|
|
||||||
"liquid_volume": [],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "waste on P22",
|
"id": "stock plate on 4",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P22",
|
"slot_on_deck": "P2",
|
||||||
"class_name": "nest_1_reservoir_195ml",
|
"class_name": "nest_12_reservoir_15ml",
|
||||||
"liquid_type": [
|
"liquid_type": [
|
||||||
],
|
"bind beads"
|
||||||
"liquid_volume": [],
|
],
|
||||||
"liquid_input_wells": [
|
"liquid_volume": [10000],
|
||||||
]
|
"liquid_input_wells": [
|
||||||
}
|
"A1"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
'''
|
{
|
||||||
|
"id": "stock plate on P2",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "P2",
|
||||||
handler = LiquidHandlerBiomek()
|
"class_name": "nest_12_reservoir_15ml",
|
||||||
|
"liquid_type": [
|
||||||
handler.temp_protocol = {
|
"bind beads"
|
||||||
"meta": {},
|
],
|
||||||
"labwares": [],
|
"liquid_volume": [10000],
|
||||||
"steps": []
|
"liquid_input_wells": [
|
||||||
}
|
"A1"
|
||||||
|
]
|
||||||
input_steps = json.loads(steps_info)
|
},
|
||||||
labwares = json.loads(labware_with_liquid)
|
{
|
||||||
|
"id": "stock plate on P3",
|
||||||
for step in input_steps['steps']:
|
"parent": "deck",
|
||||||
if step['operation'] != 'transfer':
|
"slot_on_deck": "P3",
|
||||||
continue
|
"class_name": "nest_12_reservoir_15ml",
|
||||||
parameters = step['parameters']
|
"liquid_type": [
|
||||||
|
"ethyl alcohol"
|
||||||
handler.transfer_biomek(source=parameters['source'],
|
],
|
||||||
target=parameters['target'],
|
"liquid_volume": [10000],
|
||||||
volume=parameters['volume'],
|
"liquid_input_wells": [
|
||||||
tip_rack=parameters['tip_rack'],
|
"A1"
|
||||||
aspirate_techniques='MC P300 high',
|
]
|
||||||
dispense_techniques='MC P300 high'
|
},
|
||||||
)
|
|
||||||
|
{
|
||||||
|
"id": "oscillation",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "Orbital1",
|
||||||
|
"class_name": "Orbital",
|
||||||
|
"liquid_type": [],
|
||||||
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "working plate on P11",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "P11",
|
||||||
|
"class_name": "NEST 2ml Deep Well Plate",
|
||||||
|
"liquid_type": [
|
||||||
|
],
|
||||||
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "magnetics module on P12",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "P12",
|
||||||
|
"class_name": "magnetics module",
|
||||||
|
"liquid_type": [],
|
||||||
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "working plate on P13",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "P13",
|
||||||
|
"class_name": "NEST 2ml Deep Well Plate",
|
||||||
|
"liquid_type": [
|
||||||
|
],
|
||||||
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "waste on P22",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "P22",
|
||||||
|
"class_name": "nest_1_reservoir_195ml",
|
||||||
|
"liquid_type": [
|
||||||
|
],
|
||||||
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
'''
|
||||||
|
handler = LiquidHandlerBiomek()
|
||||||
|
|
||||||
|
handler.temp_protocol = {
|
||||||
|
"meta": {},
|
||||||
|
"labwares": [],
|
||||||
|
"steps": []
|
||||||
|
}
|
||||||
|
|
||||||
|
input_steps = json.loads(steps_info)
|
||||||
|
labwares = json.loads(labware_with_liquid)
|
||||||
|
|
||||||
|
for step in input_steps['steps']:
|
||||||
|
operation = step['operation']
|
||||||
|
parameters = step['parameters']
|
||||||
|
|
||||||
|
if operation == 'transfer':
|
||||||
|
handler.transfer_biomek(source=parameters['source'],
|
||||||
|
target=parameters['target'],
|
||||||
|
volume=parameters['volume'],
|
||||||
|
tip_rack=parameters['tip_rack'],
|
||||||
|
aspirate_techniques='MC P300 high',
|
||||||
|
dispense_techniques='MC P300 high')
|
||||||
|
elif operation == 'move_labware':
|
||||||
|
handler.move_biomek(source=parameters['source'],
|
||||||
|
target=parameters['target'])
|
||||||
|
elif operation == 'oscillation':
|
||||||
|
handler.oscillation_biomek(rpm=parameters['rpm'],
|
||||||
|
time=parameters['time'])
|
||||||
|
elif operation == 'incubation':
|
||||||
|
handler.incubation_biomek(time=parameters['time'])
|
||||||
|
|
||||||
|
print(json.dumps(handler.temp_protocol, indent=4))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
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 unilabos_msgs.msg import Resource
|
||||||
from pylabrobot.resources import (
|
# from pylabrobot.resources import (
|
||||||
Resource,
|
# Resource,
|
||||||
TipRack,
|
# TipRack,
|
||||||
Container,
|
# Container,
|
||||||
Coordinate,
|
# Coordinate,
|
||||||
Well
|
# Well
|
||||||
)
|
# )
|
||||||
# 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
|
# from .liquid_handler_abstract import LiquidHandlerAbstract
|
||||||
|
|
||||||
@@ -268,7 +268,63 @@ class LiquidHandlerBiomek:
|
|||||||
transfer_params["TipLocation"] = tip_rack
|
transfer_params["TipLocation"] = tip_rack
|
||||||
self.temp_protocol["steps"].append(transfer_params)
|
self.temp_protocol["steps"].append(transfer_params)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def move_biomek(
|
||||||
|
self,
|
||||||
|
source: str,
|
||||||
|
target: str,
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
处理Biomek移动板子的操作。
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
move_params = {
|
||||||
|
"Pod": "Pod1",
|
||||||
|
"GripSide": "A1 near",
|
||||||
|
"Source": source,
|
||||||
|
"Target": target,
|
||||||
|
"LeaveBottomLabware": False,
|
||||||
|
}
|
||||||
|
self.temp_protocol["steps"].append(move_params)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
def incubation_biomek(
|
||||||
|
self,
|
||||||
|
time: int,
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
处理Biomek的孵育操作。
|
||||||
|
"""
|
||||||
|
incubation_params = {
|
||||||
|
"Message": "Paused",
|
||||||
|
"Location": "the whole system",
|
||||||
|
"Time": time,
|
||||||
|
"Mode": "TimedResource"
|
||||||
|
}
|
||||||
|
self.temp_protocol["steps"].append(incubation_params)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
def oscillation_biomek(
|
||||||
|
self,
|
||||||
|
rpm: int,
|
||||||
|
time: int,
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
处理Biomek的振荡操作。
|
||||||
|
"""
|
||||||
|
oscillation_params = {
|
||||||
|
'Device': 'OrbitalShaker0',
|
||||||
|
'Parameters': (str(rpm), '2', str(time), 'CounterClockwise'),
|
||||||
|
'Command': 'Timed Shake'
|
||||||
|
}
|
||||||
|
self.temp_protocol["steps"].append(oscillation_params)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@@ -763,16 +819,23 @@ 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']:
|
||||||
if step['operation'] != 'transfer':
|
operation = step['operation']
|
||||||
continue
|
|
||||||
parameters = step['parameters']
|
parameters = step['parameters']
|
||||||
|
|
||||||
handler.transfer_biomek(source=parameters['source'],
|
if operation == 'transfer':
|
||||||
target=parameters['target'],
|
handler.transfer_biomek(source=parameters['source'],
|
||||||
volume=parameters['volume'],
|
target=parameters['target'],
|
||||||
tip_rack=parameters['tip_rack'],
|
volume=parameters['volume'],
|
||||||
aspirate_techniques='MC P300 high',
|
tip_rack=parameters['tip_rack'],
|
||||||
dispense_techniques='MC P300 high'
|
aspirate_techniques='MC P300 high',
|
||||||
)
|
dispense_techniques='MC P300 high')
|
||||||
|
elif operation == 'move_labware':
|
||||||
|
handler.move_biomek(source=parameters['source'],
|
||||||
|
target=parameters['target'])
|
||||||
|
elif operation == 'oscillation':
|
||||||
|
handler.oscillation_biomek(rpm=parameters['rpm'],
|
||||||
|
time=parameters['time'])
|
||||||
|
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))
|
||||||
|
|||||||
@@ -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: {}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ class Registry:
|
|||||||
"goal_default": yaml.safe_load(
|
"goal_default": yaml.safe_load(
|
||||||
io.StringIO(get_yaml_from_goal_type(self.ResourceCreateFromOuter.Goal))
|
io.StringIO(get_yaml_from_goal_type(self.ResourceCreateFromOuter.Goal))
|
||||||
),
|
),
|
||||||
|
"handles": {},
|
||||||
},
|
},
|
||||||
"create_resource": {
|
"create_resource": {
|
||||||
"type": self.ResourceCreateFromOuterEasy,
|
"type": self.ResourceCreateFromOuterEasy,
|
||||||
@@ -84,6 +85,7 @@ class Registry:
|
|||||||
"goal_default": yaml.safe_load(
|
"goal_default": yaml.safe_load(
|
||||||
io.StringIO(get_yaml_from_goal_type(self.ResourceCreateFromOuterEasy.Goal))
|
io.StringIO(get_yaml_from_goal_type(self.ResourceCreateFromOuterEasy.Goal))
|
||||||
),
|
),
|
||||||
|
"handles": {},
|
||||||
},
|
},
|
||||||
"test_latency": {
|
"test_latency": {
|
||||||
"type": self.EmptyIn,
|
"type": self.EmptyIn,
|
||||||
@@ -92,6 +94,7 @@ class Registry:
|
|||||||
"result": {"latency_ms": "latency_ms", "time_diff_ms": "time_diff_ms"},
|
"result": {"latency_ms": "latency_ms", "time_diff_ms": "time_diff_ms"},
|
||||||
"schema": ros_action_to_json_schema(self.EmptyIn),
|
"schema": ros_action_to_json_schema(self.EmptyIn),
|
||||||
"goal_default": {},
|
"goal_default": {},
|
||||||
|
"handles": {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -214,6 +217,8 @@ class Registry:
|
|||||||
# 处理动作值映射
|
# 处理动作值映射
|
||||||
if "action_value_mappings" in device_config["class"]:
|
if "action_value_mappings" in device_config["class"]:
|
||||||
for action_name, action_config in device_config["class"]["action_value_mappings"].items():
|
for action_name, action_config in device_config["class"]["action_value_mappings"].items():
|
||||||
|
if "handles" not in action_config:
|
||||||
|
action_config["handles"] = []
|
||||||
if "type" in action_config:
|
if "type" in action_config:
|
||||||
action_config["type"] = self._replace_type_with_class(
|
action_config["type"] = self._replace_type_with_class(
|
||||||
action_config["type"], device_id, f"动作 {action_name}"
|
action_config["type"], device_id, f"动作 {action_name}"
|
||||||
|
|||||||
6
unilabos_msgs/action/LiquidHandlerMoveBiomek.action
Normal file
6
unilabos_msgs/action/LiquidHandlerMoveBiomek.action
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
string source
|
||||||
|
string target
|
||||||
|
|
||||||
|
---
|
||||||
|
bool success
|
||||||
|
---
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
int32 rpm
|
||||||
|
int32 time
|
||||||
|
|
||||||
|
---
|
||||||
|
bool success
|
||||||
|
---
|
||||||
5
unilabos_msgs/action/LiquidHandlerPauseBiomek.action
Normal file
5
unilabos_msgs/action/LiquidHandlerPauseBiomek.action
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
int32 time
|
||||||
|
|
||||||
|
---
|
||||||
|
bool success
|
||||||
|
---
|
||||||
@@ -6,5 +6,5 @@ string aspirate_technique
|
|||||||
string dispense_technique
|
string dispense_technique
|
||||||
|
|
||||||
---
|
---
|
||||||
|
bool success
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user