1
- """Command models to home the stacker."""
1
+ """Command models to prepare the stacker shuttle for movement ."""
2
2
3
3
from __future__ import annotations
4
4
8
8
9
9
from pydantic import BaseModel , Field
10
10
11
- from .. flex_stacker . common import FlexStackerStallOrCollisionError
11
+ from .common import FlexStackerStallOrCollisionError
12
12
from opentrons_shared_data .errors .exceptions import FlexStackerStallError
13
13
14
14
from ..command import (
25
25
from ...state .state import StateView
26
26
from ...execution import EquipmentHandler
27
27
28
- HomeCommandType = Literal ["flexStacker/home " ]
28
+ PrepareShuttleCommandType = Literal ["flexStacker/prepareShuttle " ]
29
29
30
30
31
- class HomeParams (BaseModel ):
32
- """The parameters defining how a stacker should be emptied ."""
31
+ class PrepareShuttleParams (BaseModel ):
32
+ """The parameters for a PrepareShuttle command ."""
33
33
34
34
moduleId : str = Field (..., description = "Unique ID of the Flex Stacker" )
35
35
36
36
37
- class HomeResult (BaseModel ):
38
- """Result data from a stacker empty command."""
37
+ class PrepareShuttleResult (BaseModel ):
38
+ """Result data from a stacker PrepareShuttle command."""
39
39
40
40
41
41
_ExecuteReturn = Union [
42
- SuccessData [HomeResult ], DefinedErrorData [FlexStackerStallOrCollisionError ]
42
+ SuccessData [PrepareShuttleResult ],
43
+ DefinedErrorData [FlexStackerStallOrCollisionError ],
43
44
]
44
45
45
46
46
- class HomeImpl (AbstractCommandImpl [HomeParams , _ExecuteReturn ]):
47
- """Implementation of a stacker empty command."""
47
+ class PrepareShuttleImpl (AbstractCommandImpl [PrepareShuttleParams , _ExecuteReturn ]):
48
+ """Implementation of a stacker prepare shuttle command."""
48
49
49
50
def __init__ (
50
51
self ,
@@ -57,8 +58,8 @@ def __init__(
57
58
self ._equipment = equipment
58
59
self ._model_utils = model_utils
59
60
60
- async def execute (self , params : HomeParams ) -> _ExecuteReturn :
61
- """Execute the stacker empty command."""
61
+ async def execute (self , params : PrepareShuttleParams ) -> _ExecuteReturn :
62
+ """Execute the stacker prepare shuttle command."""
62
63
stacker_state = self ._state_view .modules .get_flex_stacker_substate (
63
64
params .moduleId
64
65
)
@@ -82,24 +83,27 @@ async def execute(self, params: HomeParams) -> _ExecuteReturn:
82
83
],
83
84
),
84
85
)
86
+ # TODO we should also add a check for shuttle not detected error
85
87
86
- return SuccessData (public = HomeResult ())
88
+ return SuccessData (public = PrepareShuttleResult ())
87
89
88
90
89
- class Home (BaseCommand [HomeParams , HomeResult , ErrorOccurrence ]):
90
- """A command to home a Flex Stacker."""
91
+ class PrepareShuttle (
92
+ BaseCommand [PrepareShuttleParams , PrepareShuttleResult , ErrorOccurrence ]
93
+ ):
94
+ """A command to prepare Flex Stacker shuttle."""
91
95
92
- commandType : HomeCommandType = "flexStacker/home "
93
- params : HomeParams
94
- result : HomeResult | None = None
96
+ commandType : PrepareShuttleCommandType = "flexStacker/prepareShuttle "
97
+ params : PrepareShuttleParams
98
+ result : PrepareShuttleResult | None = None
95
99
96
- _ImplementationCls : Type [HomeImpl ] = HomeImpl
100
+ _ImplementationCls : Type [PrepareShuttleImpl ] = PrepareShuttleImpl
97
101
98
102
99
- class HomeCreate (BaseCommandCreate [HomeParams ]):
100
- """A request to execute a Flex Stacker home command."""
103
+ class PrepareShuttleCreate (BaseCommandCreate [PrepareShuttleParams ]):
104
+ """A request to execute a Flex Stacker PrepareShuttle command."""
101
105
102
- commandType : HomeCommandType = "flexStacker/home "
103
- params : HomeParams
106
+ commandType : PrepareShuttleCommandType = "flexStacker/prepareShuttle "
107
+ params : PrepareShuttleParams
104
108
105
- _CommandCls : Type [Home ] = Home
109
+ _CommandCls : Type [PrepareShuttle ] = PrepareShuttle
0 commit comments