Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(protocol-designer): add submerge for aspirate and dispense #17368

Open
wants to merge 13 commits into
base: edge
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"microliter": "µL",
"microliterPerSec": "µL/s",
"millimeter": "mm",
"millimeterPerSec": "mm/s",
"nanometer": "nm",
"minutes": "m",
"rpm": "rpm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
"speed": "Speed",
"starting_deck": "Starting deck",
"step_substeps": "{{stepType}} details",
"submerge": "Submerge",
"submerge_speed": "Submerge speed",
"temperature": "Temperature",
"temperature_module": {
"active": "<semiBoldText>{{module}}</semiBoldText><text>set to</text><tag/>",
Expand Down
2 changes: 2 additions & 0 deletions protocol-designer/src/assets/localization/en/tooltip.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"aspirate_mmFromBottom": "Adjust tip position for aspirate",
"aspirate_touchTip_checkbox": "Touch tip to each side of the well after aspirating",
"aspirate_touchTip_mmFromTop": "Distance from the top of the well",
"aspirate_submerge": "Lower the tip into the liquid before aspirating",
"aspirate_wells": "First select a source labware",
"blowout_checkbox": "Blow extra air through the tip",
"blowout_flowRate": "Blowout speed",
Expand All @@ -50,6 +51,7 @@
"dispense_labware": "Pipette unable to access labware in staging area",
"dispense_mix_checkbox": "Aspirate and dispense repeatedly after main dispense",
"dispense_mmFromBottom": "Adjust tip position for dispense",
"dispense_submerge": "Lower the tip into the liquid before dispensing",
"dispense_touchTip_checkbox": "Touch tip to each side of the well after dispensing",
"dispense_touchTip_mmFromTop": "Distance from the top of the well",
"dispense_wells": "First select a destination labware",
Expand Down
6 changes: 6 additions & 0 deletions protocol-designer/src/form-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type StepFieldName = string
// | 'aspirate_mix_times'
// | 'aspirate_mix_volume'
// | 'aspirate_mmFromBottom'
// | 'aspirate_submerge_speed'
// | 'aspirate_touchTip_checkbox'
// | 'aspirate_touchTip_mmFromTop'
// | 'aspirate_wellOrder_first'
Expand All @@ -51,6 +52,7 @@ export type StepFieldName = string
// | 'dispense_mix_times'
// | 'dispense_mix_volume'
// | 'dispense_mmFromBottom'
// | 'dispense_submerge_speed'
// | 'dispense_touchTip_checkbox'
// | 'dispense_touchTip_mmFromTop'
// | 'dispense_wellOrder_first'
Expand Down Expand Up @@ -252,6 +254,8 @@ export interface HydratedMoveLiquidFormData extends AnnotationFields {
aspirate_mix_times?: number | null
aspirate_mix_volume?: number | null
aspirate_mmFromBottom?: number | null
aspirate_submerge_delay_seconds?: number | null
aspirate_submerge_speed?: number | null
syao1226 marked this conversation as resolved.
Show resolved Hide resolved
aspirate_touchTip_mmFromTop?: number | null
aspirate_wells_grouped?: boolean | null
aspirate_x_position?: number | null
Expand All @@ -266,6 +270,8 @@ export interface HydratedMoveLiquidFormData extends AnnotationFields {
dispense_mix_times?: number | null
dispense_mix_volume?: number | null
dispense_mmFromBottom?: number | null
dispense_submerge_delay_seconds?: number | null
dispense_submerge_speed?: number | null
dispense_touchTip_mmFromTop?: number | null
dispense_x_position?: number | null
dispense_y_position?: number | null
Expand Down
8 changes: 8 additions & 0 deletions protocol-designer/src/load-file/migration/8_5_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export const migrateFile = (
dispense_touchTip_mmFromBottom,
aspirate_labware,
dispense_labware,
aspirate_submerge_delay_seconds,
dispense_submerge_delay_seconds,
aspirate_submerge_speed,
dispense_submerge_speed,
...rest
} = form
const matchingAspirateLabwareWellDepth = getMigratedPositionFromTop(
Expand Down Expand Up @@ -110,6 +114,10 @@ export const migrateFile = (
matchingDispenseLabwareWellDepth,
1
),
aspirate_submerge_delay_seconds: null,
dispense_submerge_delay_seconds: null,
aspirate_submerge_speed: null,
dispense_submerge_speed: null,
},
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import { useSelector } from 'react-redux'
import { useTranslation } from 'react-i18next'
import {
ALIGN_CENTER,
COLORS,
DIRECTION_COLUMN,
Divider,
Flex,
Icon,
ListItem,
SPACING,
StyledText,
Tabs,
Tooltip,
useHoverTooltip,
} from '@opentrons/components'
import { getTrashOrLabware } from '@opentrons/step-generation'
import { getEnableReturnTip } from '../../../../../../feature-flags/selectors'
import {
getEnableLiquidClasses,
getEnableReturnTip,
} from '../../../../../../feature-flags/selectors'
import {
getAdditionalEquipmentEntities,
getLabwareEntities,
Expand Down Expand Up @@ -61,11 +70,13 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {
tab,
setTab,
} = props
const [targetProps, tooltipProps] = useHoverTooltip()
const { t, i18n } = useTranslation(['protocol_steps', 'form', 'tooltip'])
const { path } = formData
const additionalEquipmentEntities = useSelector(
getAdditionalEquipmentEntities
)
const enableLiquidClasses = useSelector(getEnableLiquidClasses)
const enableReturnTip = useSelector(getEnableReturnTip)
const labwares = useSelector(getLabwareEntities)
const pipettes = useSelector(getPipetteEntities)
Expand Down Expand Up @@ -316,6 +327,67 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {
]
}
/>
{enableLiquidClasses ? (
<>
<Divider marginY="0" />
<Flex
flexDirection={DIRECTION_COLUMN}
gridGap={SPACING.spacing8}
padding={`0 ${SPACING.spacing16}`}
>
<Flex gridGap={SPACING.spacing8} alignItems={ALIGN_CENTER}>
<StyledText
desktopStyle="bodyDefaultRegular"
color={COLORS.grey60}
>
{t('protocol_steps:submerge')}
</StyledText>
<Flex {...targetProps}>
<Icon
name="information"
size={SPACING.spacing12}
color={COLORS.grey60}
data-testid="information_icon"
/>
</Flex>
<Tooltip tooltipProps={tooltipProps}>
{t(`tooltip:step_fields.defaults.${tab}_submerge`)}
</Tooltip>
</Flex>
<ListItem type="noActive">
<Flex
padding={SPACING.spacing12}
width="100%"
flexDirection={DIRECTION_COLUMN}
gridGap={SPACING.spacing8}
>
<InputStepFormField
showTooltip={false}
padding="0"
title={t('protocol_steps:submerge_speed')}
{...propsForFields[`${tab}_submerge_speed`]}
units={t('application:units.millimeterPerSec')}
errorToShow={getFormLevelError(
`${tab}_submerge_speed`,
mappedErrorsToField
)}
/>
<InputStepFormField
showTooltip={false}
padding="0"
title={t('protocol_steps:delay_duration')}
{...propsForFields[`${tab}_submerge_delay_seconds`]}
units={t('application:units.seconds')}
errorToShow={getFormLevelError(
`${tab}_submerge_delay_seconds`,
mappedErrorsToField
)}
/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll need to add our position field/modal here like designs specify for retract (see comment)

</Flex>
</ListItem>
</Flex>
</>
) : null}
<Divider marginY="0" />
<Flex
flexDirection={DIRECTION_COLUMN}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ describe('createPresavedStepForm', () => {
aspirate_mix_times: null,
aspirate_mix_volume: null,
aspirate_mmFromBottom: null,
aspirate_submerge_delay_seconds: null,
aspirate_submerge_speed: null,
syao1226 marked this conversation as resolved.
Show resolved Hide resolved
aspirate_touchTip_checkbox: false,
aspirate_touchTip_mmFromTop: null,
aspirate_wellOrder_first: 't2b',
Expand All @@ -177,6 +179,8 @@ describe('createPresavedStepForm', () => {
dispense_mix_times: null,
dispense_mix_volume: null,
dispense_mmFromBottom: null,
dispense_submerge_delay_seconds: null,
dispense_submerge_speed: null,
dispense_touchTip_checkbox: false,
dispense_touchTip_mmFromTop: null,
dispense_wellOrder_first: 't2b',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export function getDefaultsForStepType(
aspirate_mix_times: null,
aspirate_mix_volume: null,
aspirate_mmFromBottom: null,
aspirate_submerge_delay_seconds: null,
aspirate_submerge_speed: null,
syao1226 marked this conversation as resolved.
Show resolved Hide resolved
aspirate_touchTip_checkbox: false,
aspirate_touchTip_mmFromTop: null,
aspirate_wellOrder_first: DEFAULT_WELL_ORDER_FIRST_OPTION,
Expand All @@ -85,6 +87,8 @@ export function getDefaultsForStepType(
dispense_mix_times: null,
dispense_mix_volume: null,
dispense_mmFromBottom: null,
dispense_submerge_delay_seconds: null,
dispense_submerge_speed: null,
dispense_touchTip_checkbox: false,
dispense_touchTip_mmFromTop: null,
dispense_wellOrder_first: DEFAULT_WELL_ORDER_FIRST_OPTION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ describe('getDefaultsForStepType', () => {
aspirate_mix_times: null,
aspirate_mix_volume: null,
aspirate_mmFromBottom: null,
aspirate_submerge_delay_seconds: null,
aspirate_submerge_speed: null,
syao1226 marked this conversation as resolved.
Show resolved Hide resolved
aspirate_touchTip_checkbox: false,
aspirate_touchTip_mmFromTop: null,

Expand All @@ -46,6 +48,8 @@ describe('getDefaultsForStepType', () => {
dispense_mix_times: null,
dispense_mix_volume: null,
dispense_mmFromBottom: null,
dispense_submerge_delay_seconds: null,
dispense_submerge_speed: null,
dispense_touchTip_checkbox: false,
dispense_touchTip_mmFromTop: null,

Expand Down
43 changes: 43 additions & 0 deletions protocol-designer/src/ui/steps/test/selectors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,18 +432,23 @@ describe('_getSavedMultiSelectFieldValues', () => {
},
aspirate_x_position: {
isIndeterminate: false,
value: undefined,
},
aspirate_y_position: {
isIndeterminate: false,
value: undefined,
},
dispense_x_position: {
isIndeterminate: false,
value: undefined,
},
dispense_y_position: {
isIndeterminate: false,
value: undefined,
},
blowout_z_offset: {
isIndeterminate: false,
value: undefined,
},
aspirate_wells: {
isIndeterminate: true,
Expand Down Expand Up @@ -512,6 +517,14 @@ describe('_getSavedMultiSelectFieldValues', () => {
value: -1,
isIndeterminate: false,
},
aspirate_submerge_delay_seconds: {
isIndeterminate: false,
value: undefined,
},
aspirate_submerge_speed: {
syao1226 marked this conversation as resolved.
Show resolved Hide resolved
isIndeterminate: false,
value: undefined,
},
// dispense settings
dispense_labware: {
value: 'dispense_labware_id',
Expand Down Expand Up @@ -573,6 +586,14 @@ describe('_getSavedMultiSelectFieldValues', () => {
value: -1,
isIndeterminate: false,
},
dispense_submerge_delay_seconds: {
isIndeterminate: false,
value: undefined,
},
dispense_submerge_speed: {
isIndeterminate: false,
value: undefined,
},
blowout_checkbox: {
value: true,
isIndeterminate: false,
Expand Down Expand Up @@ -689,6 +710,7 @@ describe('_getSavedMultiSelectFieldValues', () => {
},
tipRack: {
isIndeterminate: false,
value: undefined,
},
blowout_flowRate: {
isIndeterminate: true,
Expand All @@ -710,18 +732,23 @@ describe('_getSavedMultiSelectFieldValues', () => {
},
aspirate_x_position: {
isIndeterminate: false,
value: undefined,
},
aspirate_y_position: {
isIndeterminate: false,
value: undefined,
},
dispense_x_position: {
isIndeterminate: false,
value: undefined,
},
dispense_y_position: {
isIndeterminate: false,
value: undefined,
},
blowout_z_offset: {
isIndeterminate: false,
value: undefined,
},
preWetTip: {
isIndeterminate: true,
Expand Down Expand Up @@ -762,6 +789,14 @@ describe('_getSavedMultiSelectFieldValues', () => {
isIndeterminate: false,
value: -1,
},
aspirate_submerge_delay_seconds: {
isIndeterminate: false,
value: undefined,
},
aspirate_submerge_speed: {
isIndeterminate: false,
value: undefined,
},
// dispense settings
dispense_labware: {
isIndeterminate: true,
Expand Down Expand Up @@ -814,6 +849,14 @@ describe('_getSavedMultiSelectFieldValues', () => {
isIndeterminate: false,
value: -1,
},
dispense_submerge_delay_seconds: {
isIndeterminate: false,
value: undefined,
},
dispense_submerge_speed: {
isIndeterminate: false,
value: undefined,
},
blowout_checkbox: {
isIndeterminate: true,
},
Expand Down
Loading