@@ -12,6 +12,8 @@ import {
12
12
getIsHeaterShakerEastWestMultiChannelPipette ,
13
13
getIsHeaterShakerNorthSouthOfNonTiprackWithMultiChannelPipette ,
14
14
uuid ,
15
+ formatPyStr ,
16
+ formatPyWellLocation ,
15
17
} from '../../utils'
16
18
import { COLUMN_4_SLOTS } from '../../constants'
17
19
import type { CreateCommand , MoveToWellParams } from '@opentrons/shared-data'
@@ -34,9 +36,8 @@ export const moveToWell: CommandCreator<MoveToWellParams> = (
34
36
const actionName = 'moveToWell'
35
37
const errors : CommandCreatorError [ ] = [ ]
36
38
const labwareState = prevRobotState . labware
37
- // TODO(2020-07-30, IL): the below is duplicated or at least similar
38
- // across aspirate/dispense/blowout, we can probably DRY it up
39
- const pipetteSpec = invariantContext . pipetteEntities [ pipetteId ] ?. spec
39
+ const { pipetteEntities, labwareEntities } = invariantContext
40
+ const pipetteSpec = pipetteEntities [ pipetteId ] ?. spec
40
41
const isFlexPipette =
41
42
( pipetteSpec ?. displayCategory === 'FLEX' || pipetteSpec ?. channels === 96 ) ??
42
43
false
@@ -160,7 +161,7 @@ export const moveToWell: CommandCreator<MoveToWellParams> = (
160
161
prevRobotState . modules ,
161
162
slotName ,
162
163
pipetteSpec ,
163
- invariantContext . labwareEntities [ labwareId ]
164
+ labwareEntities [ labwareId ]
164
165
)
165
166
) {
166
167
errors . push (
@@ -174,6 +175,9 @@ export const moveToWell: CommandCreator<MoveToWellParams> = (
174
175
}
175
176
}
176
177
178
+ const pipettePythonName = pipetteEntities [ pipetteId ] . pythonName
179
+ const labwarePythonName = labwareEntities [ labwareId ] . pythonName
180
+
177
181
const commands : CreateCommand [ ] = [
178
182
{
179
183
commandType : 'moveToWell' ,
@@ -188,7 +192,11 @@ export const moveToWell: CommandCreator<MoveToWellParams> = (
188
192
} ,
189
193
} ,
190
194
]
195
+ // NOTE: forceDirect and minimumZHeight were never wired up in the form or stepArgs
191
196
return {
192
197
commands,
198
+ python : `${ pipettePythonName } .move_to(${ labwarePythonName } [${ formatPyStr (
199
+ wellName
200
+ ) } ]${ formatPyWellLocation ( wellLocation ) } )`,
193
201
}
194
202
}
0 commit comments