1
1
from __future__ import annotations
2
2
3
3
from abc import ABCMeta , abstractmethod
4
- from typing import List , Optional , Union
4
+ from typing import Dict , List , Optional , Union
5
5
6
6
from pylabrobot .liquid_handling .standard import (
7
7
Aspiration ,
20
20
)
21
21
from pylabrobot .machines .backends import MachineBackend
22
22
from pylabrobot .resources import Deck , Resource
23
+ from pylabrobot .resources .tip_tracker import TipTracker
23
24
24
25
25
26
class LiquidHandlerBackend (MachineBackend , metaclass = ABCMeta ):
@@ -36,17 +37,34 @@ class LiquidHandlerBackend(MachineBackend, metaclass=ABCMeta):
36
37
def __init__ (self ):
37
38
self .setup_finished = False
38
39
self ._deck : Optional [Deck ] = None
40
+ self ._head : Optional [Dict [int , TipTracker ]] = None
41
+ self ._head96 : Optional [Dict [int , TipTracker ]] = None
39
42
40
43
def set_deck (self , deck : Deck ):
41
44
"""Set the deck for the robot. Called automatically by `LiquidHandler.setup` or can be called
42
45
manually if interacting with the backend directly. A deck must be set before setup."""
43
46
self ._deck = deck
44
47
48
+ def set_heads (self , head : Dict [int , TipTracker ], head96 : Optional [Dict [int , TipTracker ]] = None ):
49
+ """Set the tip tracker for the robot. Called automatically by `LiquidHandler.setup` or can be
50
+ called manually if interacting with the backend directly. A head must be set before setup."""
51
+ self ._head = head
52
+ self ._head96 = head96
53
+
45
54
@property
46
55
def deck (self ) -> Deck :
47
56
assert self ._deck is not None , "Deck not set"
48
57
return self ._deck
49
58
59
+ @property
60
+ def head (self ) -> Dict [int , TipTracker ]:
61
+ assert self ._head is not None , "Head not set"
62
+ return self ._head
63
+
64
+ @property
65
+ def head96 (self ) -> Optional [Dict [int , TipTracker ]]:
66
+ return self ._head96
67
+
50
68
async def setup (self ):
51
69
"""Set up the robot. This method should be called before any other method is called."""
52
70
assert self ._deck is not None , "Deck not set"
0 commit comments