Skip to content

Commit

Permalink
feat(app): DTWiz: use unsafe commands
Browse files Browse the repository at this point in the history
By using the new unsafe/blowOutInPlace and unsafe/dropTipInPlace
commands in the drop tip wizard's blowout and drop tip modals, we can
make sure that it will work on a flex even if the machine was
interrupted while executing a liquid handling command.

Closes EXEC-401
  • Loading branch information
sfoster1 committed Jul 26, 2024
1 parent dd1e44d commit a4bd7ac
Showing 1 changed file with 41 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ import { useDeleteMaintenanceRunMutation } from '@opentrons/react-api-client'
import { MANAGED_PIPETTE_ID, POSITION_AND_BLOWOUT } from '../../constants'
import { getAddressableAreaFromConfig } from '../../getAddressableAreaFromConfig'
import { useNotifyDeckConfigurationQuery } from '../../../../resources/deck_configuration'

import type {
CreateCommand,
AddressableAreaName,
PipetteModelSpecs,
BlowoutInPlaceCreateCommand,
UnsafeBlowoutInPlaceCreateCommand,
DropTipInPlaceCreateCommand,
UnsafeDropTipInPlaceCreateCommand,
} from '@opentrons/shared-data'
import { FLEX_ROBOT_TYPE } from '@opentrons/shared-data'
import type { CommandData, PipetteData } from '@opentrons/api-client'
import type {
Axis,
Expand Down Expand Up @@ -61,6 +65,7 @@ export function useDropTipCommands({
robotType,
fixitCommandTypeUtils,
}: UseDropTipSetupCommandsParams): UseDropTipCommandsResult {
const isFlex = robotType === FLEX_ROBOT_TYPE
const [hasSeenClose, setHasSeenClose] = React.useState(false)

const { deleteMaintenanceRun } = useDeleteMaintenanceRunMutation({
Expand Down Expand Up @@ -177,10 +182,12 @@ export function useDropTipCommands({
proceed: () => void
): Promise<void> => {
return new Promise((resolve, reject) => {
const blowoutCommand = buildBlowoutInPlaceCommand(instrumentModelSpecs)

chainRunCommands(
[currentStep === POSITION_AND_BLOWOUT ? blowoutCommand : DROP_TIP],
[
currentStep === POSITION_AND_BLOWOUT
? buildBlowoutInPlaceCommand(instrumentModelSpecs, isFlex)
: buildDropTipInPlaceCommand(isFlex),
],
true
)
.then((commandData: CommandData[]) => {
Expand Down Expand Up @@ -260,22 +267,38 @@ const HOME_EXCEPT_PLUNGERS: CreateCommand = {
params: { axes: ['leftZ', 'rightZ', 'x', 'y'] },
}

const DROP_TIP: CreateCommand = {
commandType: 'dropTipInPlace',
params: { pipetteId: MANAGED_PIPETTE_ID },
}
const buildDropTipInPlaceCommand = (
isFlex: boolean
): DropTipInPlaceCreateCommand | UnsafeDropTipInPlaceCreateCommand =>
isFlex
? {
commandType: 'unsafe/dropTipInPlace',
params: { pipetteId: MANAGED_PIPETTE_ID },
}
: {
commandType: 'dropTipInPlace',
params: { pipetteId: MANAGED_PIPETTE_ID },
}

const buildBlowoutInPlaceCommand = (
specs: PipetteModelSpecs
): CreateCommand => {
return {
commandType: 'blowOutInPlace',
params: {
pipetteId: MANAGED_PIPETTE_ID,
flowRate: specs.defaultBlowOutFlowRate.value,
},
}
}
specs: PipetteModelSpecs,
isFlex: boolean
): BlowoutInPlaceCreateCommand | UnsafeBlowoutInPlaceCreateCommand =>
isFlex
? {
commandType: 'unsafe/blowOutInPlace',
params: {
pipetteId: MANAGED_PIPETTE_ID,
flowRate: specs.defaultBlowOutFlowRate.value,
},
}
: {
commandType: 'blowOutInPlace',
params: {
pipetteId: MANAGED_PIPETTE_ID,
flowRate: specs.defaultBlowOutFlowRate.value,
},
}

const buildMoveToAACommand = (
addressableAreaFromConfig: AddressableAreaName
Expand Down

0 comments on commit a4bd7ac

Please sign in to comment.