Skip to content

Commit 04554a5

Browse files
authored
fix(protocol-designer): wire up all OT-2 default advanced settings (#18816)
Complete the behavior for getting OT-2 default values when resetting advanced transfer settings or creating a new transfer form. Closes RQA-4344
1 parent 770e82c commit 04554a5

File tree

1 file changed

+68
-4
lines changed
  • protocol-designer/src/steplist/formLevel/handleFormChange

1 file changed

+68
-4
lines changed

protocol-designer/src/steplist/formLevel/handleFormChange/utils.ts

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ import {
1818

1919
import { CHANNELS_MAPPED_TO_MAX_SPEED } from '../../../constants'
2020
import { getPipetteCapacity } from '../../../pipettes/pipetteData'
21-
import { canPipetteUseLabware, getWellSetForMultichannel } from '../../../utils'
21+
import {
22+
canPipetteUseLabware,
23+
getDefaultPushOutVolume,
24+
getWellSetForMultichannel,
25+
} from '../../../utils'
2226
import { getDefaultsForStepType } from '../getDefaultsForStepType'
2327

2428
import type {
@@ -485,14 +489,19 @@ const getNoLiquidClassValuesMoveLiquid = (
485489
convertedPipetteName: string,
486490
liquidHandlingAction: LiquidClassSettingsType,
487491
robotType: RobotType,
488-
pipetteSpecs: PipetteV2Specs
492+
pipetteSpecs: PipetteV2Specs,
493+
labwareEntities: LabwareEntities
489494
): Record<string, any> => {
490495
const { tipRack: tiprack, path, volume: rawVolume, stepType } = rawForm
491496
if (stepType !== 'moveLiquid') {
492497
console.warn(`invalid step type for liquid classes: ${stepType}`)
493498
return {}
494499
}
495500
const volume = Number(rawVolume)
501+
const tiprackEntity =
502+
Object.values(labwareEntities).find(
503+
({ labwareDefURI }) => labwareDefURI === tiprack
504+
) ?? null
496505
const referenceLiquidClass = getAllLiquidClassDefs()[WATER_LIQUID_CLASS_NAME]
497506
const liquidClassValuesForPipette = referenceLiquidClass.byPipette.find(
498507
({ pipetteModel }) => convertedPipetteName === pipetteModel
@@ -511,17 +520,71 @@ const getNoLiquidClassValuesMoveLiquid = (
511520
blowout_location: SOURCE_WELL_BLOWOUT_DESTINATION,
512521
}
513522
: {}
514-
return {
523+
const allOT2Defaults = getDefaultsForStepType('moveLiquid')
524+
const aspirateOT2Defaults = {
525+
aspirate_wellOrder_first: allOT2Defaults.aspirate_wellOrder_first,
526+
aspirate_wellOrder_second: allOT2Defaults.aspirate_wellOrder_second,
527+
preWetTip: allOT2Defaults.preWetTip,
528+
aspirate_airGap_checkbox: allOT2Defaults.aspirate_airGap_checkbox,
529+
aspirate_airGap_volume: allOT2Defaults.aspirate_airGap_volume,
530+
aspirate_mix_checkbox: allOT2Defaults.aspirate_mix_checkbox,
531+
aspirate_mix_times: allOT2Defaults.aspirate_mix_times,
532+
aspirate_delay_checkbox: allOT2Defaults.aspirate_delay_checkbox,
533+
aspirate_delay_seconds: allOT2Defaults.aspirate_delay_seconds,
534+
aspirate_flowRate: allOT2Defaults.aspirate_flowRate,
535+
aspirate_mmFromBottom: allOT2Defaults.aspirate_mmFromBottom,
536+
aspirate_position_reference: allOT2Defaults.aspirate_position_reference,
537+
aspirate_touchTip_checkbox: allOT2Defaults.aspirate_touchTip_checkbox,
515538
aspirate_submerge_speed: zSpeedOT2,
516539
aspirate_submerge_mmFromBottom: SAFE_MOVE_TO_WELL_OFFSET_FROM_TOP_MM,
540+
aspirate_submerge_delay_seconds:
541+
allOT2Defaults.aspirate_submerge_delay_seconds,
517542
aspirate_retract_speed: zSpeedOT2,
518543
aspirate_retract_mmFromBottom: SAFE_MOVE_TO_WELL_OFFSET_FROM_TOP_MM,
544+
aspirate_retract_delay_seconds:
545+
allOT2Defaults.aspirate_retract_delay_seconds,
546+
}
547+
const pushOutVolume =
548+
tiprackEntity != null
549+
? getDefaultPushOutVolume(
550+
Number(rawForm.volume),
551+
pipetteSpecs,
552+
tiprackEntity.def
553+
)
554+
: 0
555+
const dispenseOT2Defaults = {
556+
dispense_wellOrder_first: allOT2Defaults.dispense_wellOrder_first,
557+
dispense_wellOrder_second: allOT2Defaults.dispense_wellOrder_second,
558+
dispense_airGap_checkbox: allOT2Defaults.dispense_airGap_checkbox,
559+
dispense_airGap_volume: allOT2Defaults.dispense_airGap_volume,
560+
dispense_mix_checkbox: allOT2Defaults.dispense_mix_checkbox,
561+
dispense_mix_times: allOT2Defaults.dispense_mix_times,
562+
dispense_delay_checkbox: allOT2Defaults.dispense_delay_checkbox,
563+
dispense_delay_seconds: allOT2Defaults.dispense_delay_seconds,
564+
dispense_flowRate: allOT2Defaults.dispense_flowRate,
565+
dispense_mmFromBottom: allOT2Defaults.dispense_mmFromBottom,
566+
dispense_position_reference: allOT2Defaults.dispense_position_reference,
567+
dispense_touchTip_checkbox: allOT2Defaults.dispense_touchTip_checkbox,
568+
pushOut_checkbox: pushOutVolume > 0,
569+
pushOut_volume: pushOutVolume,
519570
dispense_submerge_speed: zSpeedOT2,
520571
dispense_submerge_mmFromBottom: SAFE_MOVE_TO_WELL_OFFSET_FROM_TOP_MM,
572+
dispense_submerge_delay_seconds:
573+
allOT2Defaults.dispense_submerge_delay_seconds,
521574
dispense_retract_speed: zSpeedOT2,
522575
dispense_retract_mmFromBottom: SAFE_MOVE_TO_WELL_OFFSET_FROM_TOP_MM,
576+
dispense_retract_delay_seconds:
577+
allOT2Defaults.dispense_retract_delay_seconds,
523578
...dipsosalFields,
524579
}
580+
return {
581+
...(liquidHandlingAction === 'all' || liquidHandlingAction === 'aspirate'
582+
? aspirateOT2Defaults
583+
: {}),
584+
...(liquidHandlingAction === 'all' || liquidHandlingAction === 'dispense'
585+
? dispenseOT2Defaults
586+
: {}),
587+
}
525588
}
526589
if (liquidClassValuesForTip == null) {
527590
return {}
@@ -1064,7 +1127,8 @@ export const getLiquidClassesValues = (args: {
10641127
convertedPipetteName,
10651128
liquidHandlingAction,
10661129
robotType,
1067-
pipetteSpecs
1130+
pipetteSpecs,
1131+
labwareEntities
10681132
)
10691133
: getNoLiquidClassValuesMix(
10701134
rawForm,

0 commit comments

Comments
 (0)