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(app, robot-server): add module live command to home stacker shuttle #18051

Open
wants to merge 2 commits into
base: edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/assets/localization/en/device_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"overflow_menu_lid_temp": "Set lid temperature",
"overflow_menu_mod_temp": "Set module temperature",
"overflow_menu_set_block_temp": "Set block temperature",
"overflow_menu_home_shuttle": "Home stacker shuttle",
"pipette_cal_recommended": "Pipette Offset calibration recommended.",
"pipette_calibrations_differ": "The attached pipettes have very different calibration values. When properly calibrated, the values should be similar.",
"pipette_offset_calibration_needed": "Pipette Offset calibration needed.",
Expand Down
31 changes: 30 additions & 1 deletion app/src/organisms/ModuleCard/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
TCDeactivateLidCreateCommand,
TCOpenLidCreateCommand,
TemperatureModuleDeactivateCreateCommand,
FlexStackerPrepareShuttleCreateCommand,
} from '@opentrons/shared-data'

import type { AttachedModule } from '/app/redux/modules/types'
Expand Down Expand Up @@ -112,6 +113,20 @@
const { toggleLatch, isLatchClosed } = useLatchControls(module)
const [targetProps, tooltipProps] = useHoverTooltip()

const homeShuttleBtn = (
<>
<MenuItem
key={`home_shuttle_${String(module.moduleModel)}`}
data-testid={`home_shuttle_${String(module.moduleModel)}`}
onClick={() => {
homeShuttle()
}}

Check warning on line 123 in app/src/organisms/ModuleCard/hooks.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/organisms/ModuleCard/hooks.tsx#L116-L123

Added lines #L116 - L123 were not covered by tests
>
{t('overflow_menu_home_shuttle')}
</MenuItem>
</>

Check warning on line 127 in app/src/organisms/ModuleCard/hooks.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/organisms/ModuleCard/hooks.tsx#L125-L127

Added lines #L125 - L127 were not covered by tests
)

const isLatchDisabled =
module.moduleType === HEATERSHAKER_MODULE_TYPE &&
module.data.speedStatus !== 'idle'
Expand Down Expand Up @@ -237,6 +252,20 @@
})
}

const homeShuttleCommand: FlexStackerPrepareShuttleCreateCommand = {
commandType: 'flexStacker/prepareShuttle',
params: {
moduleId: module.id,
},
}
const homeShuttle = (): void => {
createLiveCommand({
command: homeShuttleCommand,
}).catch((e: Error) => {
console.error(`error homing flex stacker shuttle: ${e.message}`)
})
}

Check warning on line 267 in app/src/organisms/ModuleCard/hooks.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/organisms/ModuleCard/hooks.tsx#L255-L267

Added lines #L255 - L267 were not covered by tests

const sendBlockTempCommand =
module.moduleType === THERMOCYCLER_MODULE_TYPE &&
module.data.targetTemperature != null
Expand Down Expand Up @@ -374,7 +403,7 @@
setSetting: t('overflow_menu_about'),
isSecondary: false,
isSettingDisabled: false,
menuButtons: [],
menuButtons: [homeShuttleBtn],

Check warning on line 406 in app/src/organisms/ModuleCard/hooks.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/organisms/ModuleCard/hooks.tsx#L406

Added line #L406 was not covered by tests
onClick: handleAboutClick,
},
],
Expand Down
2 changes: 2 additions & 0 deletions robot-server/robot_server/commands/stateless_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
commands.heater_shaker.DeactivateShakerCreate,
commands.heater_shaker.OpenLabwareLatchCreate,
commands.heater_shaker.CloseLabwareLatchCreate,
commands.flex_stacker.PrepareShuttleCreate,
],
Field(discriminator="commandType"),
]
Expand All @@ -52,6 +53,7 @@
commands.heater_shaker.DeactivateShaker,
commands.heater_shaker.OpenLabwareLatch,
commands.heater_shaker.CloseLabwareLatch,
commands.flex_stacker.PrepareShuttle,
],
Field(discriminator="commandType"),
]
Loading