Skip to content

Commit

Permalink
Merge branch 'edge' into pd-build-and-test-speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
y3rsh committed Jan 30, 2025
2 parents 3021d84 + b1684cb commit 0a24c27
Show file tree
Hide file tree
Showing 62 changed files with 3,655 additions and 1,530 deletions.
4 changes: 2 additions & 2 deletions api/src/opentrons/drivers/flex_stacker/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
max_speed=10.0,
acceleration=100.0,
max_speed_discont=40,
current=1.8,
current=1.5,
),
"move": MoveParams(
StackerAxis.Z,
max_speed=200.0,
acceleration=500.0,
max_speed_discont=40,
current=1.8,
current=1.5,
),
},
StackerAxis.L: {
Expand Down
13 changes: 9 additions & 4 deletions api/src/opentrons/hardware_control/modules/flex_stacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ async def move_axis(
await self.reset_stall_detected()
motion_params = STACKER_MOTION_CONFIG[axis]["move"]
await self._driver.set_run_current(axis, current or motion_params.current or 0)
if any([speed, acceleration]):
if any([speed, acceleration, current]):
motion_params = self._reader.motion_params[axis]
motion_params.current = current or motion_params.current
motion_params.max_speed = speed or motion_params.max_speed
motion_params.acceleration = acceleration or motion_params.acceleration
distance = direction.distance(distance)
Expand Down Expand Up @@ -391,8 +393,11 @@ async def store_labware(self, labware_height: float) -> bool:

# Transfer
await self.open_latch()
await self.move_axis(StackerAxis.Z, Direction.EXTEND, (labware_height / 2))
await self.home_axis(StackerAxis.Z, Direction.EXTEND)
z_speed = (STACKER_MOTION_CONFIG[StackerAxis.Z]["move"].max_speed or 0) / 2
await self.move_axis(
StackerAxis.Z, Direction.EXTEND, (labware_height / 2), z_speed
)
await self.home_axis(StackerAxis.Z, Direction.EXTEND, z_speed)
await self.close_latch()

# Move Z then X axis
Expand Down Expand Up @@ -448,7 +453,7 @@ async def get_limit_switch_status(self) -> None:

async def get_motion_parameters(self) -> None:
"""Get the motion parameters used by the axis motors."""
self.move_params = {
self.motion_params = {
axis: await self._driver.get_motion_params(axis) for axis in StackerAxis
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/assets/localization/en/quick_transfer.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@
"touch_tip": "Touch tip",
"touch_tip_after_aspirating": "Touch tip after aspirating",
"touch_tip_before_dispensing": "Touch tip before dispensing",
"touch_tip_position_mm": "Touch tip position from bottom of well (mm)",
"touch_tip_position_mm": "Touch tip position from top of well (mm)",
"touch_tip_value": "{{position}} mm from bottom",
"use_deck_slots": "<block>Quick transfers use deck slots B2-D2. These slots hold a tip rack, a source labware, and a destination labware.</block><block>Make sure that your deck configuration is up to date to avoid collisions.</block>",
"value_out_of_range": "Value must be between {{min}}-{{max}}",
"value_out_of_range": "Value must be between {{min}} to {{max}}",
"too_many_pins_body": "Remove a quick transfer in order to add more transfers to your pinned list.",
"too_many_pins_header": "You've hit your max!",
"transfer_analysis_failed": "quick transfer analysis failed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ export function TouchTip(props: TouchTipProps): JSX.Element {
: state.touchTipDispense != null
)
const [currentStep, setCurrentStep] = useState<number>(1)
const [position, setPosition] = useState<number | null>(
kind === 'aspirate'
? state.touchTipAspirate ?? null
: state.touchTipDispense ?? null
const touchTipAspirate =
state.touchTipAspirate != null ? state.touchTipAspirate.toString() : null
const touchTipDispense =
state.touchTipDispense != null ? state.touchTipDispense.toString() : null
const [position, setPosition] = useState<string | null>(
kind === 'aspirate' ? touchTipAspirate : touchTipDispense
)

const touchTipAction =
Expand Down Expand Up @@ -94,7 +96,10 @@ export function TouchTip(props: TouchTipProps): JSX.Element {
setCurrentStep(2)
}
} else if (currentStep === 2) {
dispatch({ type: touchTipAction, position: position ?? undefined })
dispatch({
type: touchTipAction,
position: position != null ? parseInt(position) : undefined,
})
trackEventWithRobotSerial({
name: ANALYTICS_QUICK_TRANSFER_SETTING_SAVED,
properties: {
Expand Down Expand Up @@ -130,10 +135,13 @@ export function TouchTip(props: TouchTipProps): JSX.Element {
}

// the allowed range for touch tip is half the height of the well to 1x the height
const positionRange = { min: Math.round(wellHeight / 2), max: wellHeight }
const positionRange = { min: -Math.round(wellHeight / 2), max: 0 }
const positionError =
position !== null &&
(position < positionRange.min || position > positionRange.max)
(position === '-' ||
position.indexOf('-') !== position.lastIndexOf('-') ||
Number(position) < positionRange.min ||
Number(position) > positionRange.max)
? t(`value_out_of_range`, {
min: positionRange.min,
max: Math.floor(positionRange.max),
Expand Down Expand Up @@ -197,8 +205,8 @@ export function TouchTip(props: TouchTipProps): JSX.Element {
marginTop={SPACING.spacing68}
>
<InputField
type="number"
value={position}
type="text"
value={String(position ?? '')}
title={t('touch_tip_position_mm')}
error={positionError}
readOnly
Expand All @@ -211,10 +219,11 @@ export function TouchTip(props: TouchTipProps): JSX.Element {
borderRadius="0"
>
<NumericalKeyboard
hasHyphen
keyboardRef={keyboardRef}
initialValue={String(position ?? '')}
onChange={e => {
setPosition(Number(e))
setPosition(e)
}}
/>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe('AirGap', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Air gap volume (µL)',
error: 'Value must be between 1-180',
error: 'Value must be between 1 to 180',
readOnly: true,
type: 'number',
value: 0,
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('AirGap', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Air gap volume (µL)',
error: 'Value must be between 1-80',
error: 'Value must be between 1 to 80',
readOnly: true,
type: 'number',
value: 0,
Expand All @@ -179,7 +179,7 @@ describe('AirGap', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Air gap volume (µL)',
error: 'Value must be between 1-140',
error: 'Value must be between 1 to 140',
readOnly: true,
type: 'number',
value: 0,
Expand All @@ -204,7 +204,7 @@ describe('AirGap', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Air gap volume (µL)',
error: 'Value must be between 1-200',
error: 'Value must be between 1 to 200',
readOnly: true,
type: 'number',
value: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('Delay', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Delay duration (seconds)',
error: 'Value must be between 1-9999999999',
error: 'Value must be between 1 to 9999999999',
readOnly: true,
type: 'number',
value: 0,
Expand All @@ -158,7 +158,7 @@ describe('Delay', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Delay position from bottom of well (mm)',
error: 'Value must be between 1-100',
error: 'Value must be between 1 to 100',
readOnly: true,
type: 'number',
value: 0,
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('Delay', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Delay position from bottom of well (mm)',
error: 'Value must be between 1-400',
error: 'Value must be between 1 to 400',
readOnly: true,
type: 'number',
value: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ describe('FlowRate', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Aspirate flow rate (µL/s)',
error: 'Value must be between 1-92',
error: 'Value must be between 1 to 92',
readOnly: true,
type: 'number',
value: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('Mix', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Mix volume (µL)',
error: 'Value must be between 1-200',
error: 'Value must be between 1 to 200',
readOnly: true,
type: 'number',
value: 0,
Expand All @@ -158,7 +158,7 @@ describe('Mix', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Mix repetitions',
error: 'Value must be between 1-999',
error: 'Value must be between 1 to 999',
readOnly: true,
type: 'number',
value: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('PipettePath', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Disposal volume (µL)',
error: 'Value must be between 1-160',
error: 'Value must be between 1 to 160',
readOnly: true,
type: 'number',
value: 201,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('TipPosition', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Distance from bottom of well (mm)',
error: 'Value must be between 1-100',
error: 'Value must be between 1 to 100',
readOnly: true,
type: 'text',
value: 0,
Expand All @@ -153,7 +153,7 @@ describe('TipPosition', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Distance from bottom of well (mm)',
error: 'Value must be between 1-400',
error: 'Value must be between 1 to 400',
readOnly: true,
type: 'text',
value: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ describe('TouchTip', () => {
fireEvent.click(continueBtn)
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Touch tip position from bottom of well (mm)',
title: 'Touch tip position from top of well (mm)',
error: null,
readOnly: true,
type: 'number',
value: null,
type: 'text',
value: '',
},
{}
)
Expand All @@ -136,15 +136,19 @@ describe('TouchTip', () => {
fireEvent.click(enabledBtn)
const continueBtn = screen.getByText('Continue')
fireEvent.click(continueBtn)
const numButton = screen.getByText('0')
const negButton = screen.getByText('-')
fireEvent.click(negButton)
const numButton = screen.getByText('9')
fireEvent.click(numButton)
const secondNumButton = screen.getByText('8')
fireEvent.click(secondNumButton)
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Touch tip position from bottom of well (mm)',
error: 'Value must be between 25-50',
title: 'Touch tip position from top of well (mm)',
error: 'Value must be between -25 to 0',
readOnly: true,
type: 'number',
value: 0,
type: 'text',
value: '-98',
},
{}
)
Expand All @@ -162,15 +166,15 @@ describe('TouchTip', () => {
fireEvent.click(enabledBtn)
const continueBtn = screen.getByText('Continue')
fireEvent.click(continueBtn)
const numButton = screen.getByText('0')
const numButton = screen.getByText('1')
fireEvent.click(numButton)
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Touch tip position from bottom of well (mm)',
error: 'Value must be between 100-200',
title: 'Touch tip position from top of well (mm)',
error: 'Value must be between -100 to 0',
readOnly: true,
type: 'number',
value: 0,
type: 'text',
value: '1',
},
{}
)
Expand All @@ -184,7 +188,7 @@ describe('TouchTip', () => {
fireEvent.click(enabledBtn)
const continueBtn = screen.getByText('Continue')
fireEvent.click(continueBtn)
const numButton = screen.getByText('4')
const numButton = screen.getByText('0')
fireEvent.click(numButton)
fireEvent.click(numButton)
const saveBtn = screen.getByText('Save')
Expand All @@ -198,19 +202,19 @@ describe('TouchTip', () => {
...props,
state: {
...props.state,
touchTipAspirate: 32,
touchTipAspirate: -25,
},
}
render(props)
const continueBtn = screen.getByText('Continue')
fireEvent.click(continueBtn)
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Touch tip position from bottom of well (mm)',
title: 'Touch tip position from top of well (mm)',
error: null,
readOnly: true,
type: 'number',
value: 32,
type: 'text',
value: '-25',
},
{}
)
Expand All @@ -222,19 +226,19 @@ describe('TouchTip', () => {
kind: 'dispense',
state: {
...props.state,
touchTipDispense: 118,
touchTipDispense: -8,
},
}
render(props)
const continueBtn = screen.getByText('Continue')
fireEvent.click(continueBtn)
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Touch tip position from bottom of well (mm)',
title: 'Touch tip position from top of well (mm)',
error: null,
readOnly: true,
type: 'number',
value: 118,
type: 'text',
value: '-8',
},
{}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ describe('VolumeEntry', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Aspirate volume per well (µL)',
error: 'Value must be between 5-50',
error: 'Value must be between 5 to 50',
readOnly: true,
type: 'text',
value: '90',
Expand Down
Loading

0 comments on commit 0a24c27

Please sign in to comment.