Skip to content

Commit

Permalink
fix(app): fix cal check step numbers and return tip, labware offset d…
Browse files Browse the repository at this point in the history
…ata help copy

Fix logic that calculates the step number within the newly redesigned calibration health check flow
based on how many pipettes are being checked. Modernize contents of return tip step in cal check.
fix help copy in learn more about labware position check offsets.

Closes RQA-611, Closes RQA-609, Closes RAUT-393
  • Loading branch information
b-cooper committed Apr 3, 2023
1 parent f420566 commit 7d3d845
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 53 deletions.
2 changes: 1 addition & 1 deletion app/src/assets/localization/en/labware_position_check.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"slot": "Slot {{slotName}}",
"robot_has_offsets_from_previous_runs": "This robot has offsets for labware used in this protocol. If you apply these offsets, you can still adjust them with Labware Position Check.",
"no_offset_data_on_robot": "This robot has no useable labware offset data for this run.",
"what_labware_offset": "What is labware offset?",
"what_is_labware_offset_data": "What is labware offset data?",
"robot_has_no_offsets_from_previous_runs": "<block>Labware offset data references previous protocol run labware locations to save you time. Labware that has been used in the same slot as a protocol you are running will not need additional calibration. If all the labware in a new protocol have been checked in previous runs, you do not have to run Labware Position Check.</block> <block>You can add new offsets with Labware Position Check in later steps if you desire.</block>",
"see_how_offsets_work": "See how labware offsets work",
"stored_offset_data": "Stored Labware Offset data",
Expand Down
4 changes: 3 additions & 1 deletion app/src/assets/localization/en/robot_calibration.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"check_tip_on_block": "Check tip on block",
"check_tip_on_trash": "Check tip on trash bin",
"check_xy_axes": "Check x- and y-axis in slot {{slotName}}",
"check_z_axis_on_slot": "Check z-axis on slot 5",
"check_z_axis_on_block": "Check z-axis on block",
"check_z_axis_on_trash": "Check z-axis on trash bin",
"clear_other_slots": "Clear all other deck slots",
Expand Down Expand Up @@ -126,5 +127,6 @@
"confirm_tip_rack": "Confirm tip rack",
"recalibrate_pipette": "Recalibrate pipette",
"return_tip_and_continue": "Return tip and continue to next pipette",
"return_tip_and_exit": "Return tip and see calibration health check results"
"return_tip_and_exit": "Return tip and see calibration health check results",
"return_tip": "Return tip"
}
34 changes: 12 additions & 22 deletions app/src/organisms/ApplyHistoricOffsets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import type {
LoadedModule,
RunTimeCommand,
} from '@opentrons/shared-data'
import { ExternalLink } from '../../atoms/Link/ExternalLink'

const HOW_OFFSETS_WORK_SUPPORT_URL =
'https://support.opentrons.com/s/article/How-Labware-Offsets-work-on-the-OT-2'
Expand Down Expand Up @@ -110,8 +111,9 @@ export function ApplyHistoricOffsets(
<ModalHeader
title={t(
noOffsetData
? 'no_offset_data_available'
? 'what_is_labware_offset_data'
: 'stored_offset_data'

)}
onClose={() => setShowOffsetDataModal(false)}
/>
Expand All @@ -126,36 +128,24 @@ export function ApplyHistoricOffsets(
}
>
{noOffsetData ? (
<>
<StyledText as="p" marginBottom={SPACING.spacing3}>
{t('no_offset_data_on_robot')}
</StyledText>
<StyledText css={TYPOGRAPHY.pSemiBold}>
{t('what_labware_offset')}
</StyledText>
<Trans
t={t}
i18nKey={'robot_has_no_offsets_from_previous_runs'}
components={{
block: (
<StyledText as="p" marginBottom={SPACING.spacing3} />
),
}}
/>
</>
<Trans
t={t}
i18nKey={'robot_has_no_offsets_from_previous_runs'}
components={{
block: <StyledText as="p" marginBottom={SPACING.spacing3} />,
}}
/>
) : (
<StyledText as="p">
{t('robot_has_offsets_from_previous_runs')}
</StyledText>
)}
<Link
external
css={TYPOGRAPHY.linkPSemiBold}
<ExternalLink
marginTop={noOffsetData ? '0px' : SPACING.spacing3}
href={HOW_OFFSETS_WORK_SUPPORT_URL}
>
{t('see_how_offsets_work')}
</Link>
</ExternalLink>
{!noOffsetData ? (
isLabwareOffsetCodeSnippetsOn ? (
<LabwareOffsetTabs
Expand Down
28 changes: 11 additions & 17 deletions app/src/organisms/CalibrationPanels/SaveZPoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,23 @@ export function SaveZPoint(props: CalibrationPanelProps): JSX.Element {
const proceed: React.MouseEventHandler<HTMLButtonElement> = _event => {
isHealthCheck
? sendCommands(
{ command: Sessions.checkCommands.COMPARE_POINT },
{ command: Sessions.sharedCalCommands.MOVE_TO_POINT_ONE }
)
{ command: Sessions.checkCommands.COMPARE_POINT },
{ command: Sessions.sharedCalCommands.MOVE_TO_POINT_ONE }
)
: sendCommands(
{ command: Sessions.sharedCalCommands.SAVE_OFFSET },
{ command: Sessions.sharedCalCommands.MOVE_TO_POINT_ONE }
)
{ command: Sessions.sharedCalCommands.SAVE_OFFSET },
{ command: Sessions.sharedCalCommands.MOVE_TO_POINT_ONE }
)
}

const [confirmLink, crashRecoveryConfirmation] = useConfirmCrashRecovery(
props
)

let title = t('calibrate_z_axis_on_slot')
let bodyTranlsationKey = 'jog_pipette_to_touch_slot'
const bodyTranslationKey = 'jog_pipette_to_touch_slot'
if (isHealthCheck) {
title =
calBlock != null ? t('check_z_axis_on_block') : t('check_z_axis_on_trash')
bodyTranlsationKey =
calBlock != null
? 'jog_pipette_to_touch_block'
: 'jog_pipette_to_touch_trash'
title = t('check_z_axis_on_slot')
}

return (
Expand All @@ -109,7 +104,7 @@ export function SaveZPoint(props: CalibrationPanelProps): JSX.Element {
</StyledText>
<Trans
t={t}
i18nKey={bodyTranlsationKey}
i18nKey={bodyTranslationKey}
components={{
block: <StyledText as="p" marginBottom={SPACING.spacing3} />,
}}
Expand All @@ -125,9 +120,8 @@ export function SaveZPoint(props: CalibrationPanelProps): JSX.Element {
autoPlay={true}
loop={true}
controls={false}
aria-label={`${mount} ${
isMulti ? 'multi' : 'single'
} channel pipette moving to slot 5`}
aria-label={`${mount} ${isMulti ? 'multi' : 'single'
} channel pipette moving to slot 5`}
>
<source src={demoAsset} />
</video>
Expand Down
30 changes: 18 additions & 12 deletions app/src/organisms/CheckCalibration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,16 @@ const STEPS_IN_ORDER_ONE_PIPETTE: RobotCalibrationCheckStep[] = [
Sessions.CHECK_STEP_RETURNING_TIP,
Sessions.CHECK_STEP_RESULTS_SUMMARY,
]
const STEPS_IN_ORDER_SECOND_PIPETTE: RobotCalibrationCheckStep[] = [
const STEPS_IN_ORDER_BOTH_PIPETTES: RobotCalibrationCheckStep[] = [
Sessions.CHECK_STEP_SESSION_STARTED,
Sessions.CHECK_STEP_LABWARE_LOADED,
Sessions.CHECK_STEP_COMPARING_NOZZLE,
Sessions.CHECK_STEP_PREPARING_PIPETTE,
Sessions.CHECK_STEP_INSPECTING_TIP,
Sessions.CHECK_STEP_COMPARING_TIP,
Sessions.CHECK_STEP_COMPARING_HEIGHT,
Sessions.CHECK_STEP_COMPARING_POINT_ONE,
Sessions.CHECK_STEP_RETURNING_TIP,
Sessions.CHECK_STEP_LABWARE_LOADED,
Sessions.CHECK_STEP_COMPARING_NOZZLE,
Sessions.CHECK_STEP_PREPARING_PIPETTE,
Expand All @@ -83,15 +92,12 @@ const STEPS_IN_ORDER_SECOND_PIPETTE: RobotCalibrationCheckStep[] = [
]
function getStepIndexCheckingBothPipettes(
currentStep: RobotCalibrationCheckStep | null,
rank: RobotCalibrationCheckPipetteRank | null
rank: RobotCalibrationCheckPipetteRank | null,
): number {
if (currentStep == null || rank == null) return 0
return (
(rank === CHECK_PIPETTE_RANK_FIRST
? STEPS_IN_ORDER_ONE_PIPETTE.findIndex(step => step === currentStep)
: STEPS_IN_ORDER_SECOND_PIPETTE.findIndex(step => step === currentStep) +
7) ?? 0
)
return rank === CHECK_PIPETTE_RANK_FIRST
? STEPS_IN_ORDER_BOTH_PIPETTES.findIndex(step => step === currentStep)
: STEPS_IN_ORDER_BOTH_PIPETTES.slice(9).findIndex(step => step === currentStep) + 9
}

export function CheckCalibration(
Expand Down Expand Up @@ -152,9 +158,9 @@ export function CheckCalibration(
const checkBothPipettes = instruments?.length === 2
const stepIndex = checkBothPipettes
? getStepIndexCheckingBothPipettes(
currentStep ?? null,
activePipette?.rank ?? null
)
currentStep ?? null,
activePipette?.rank ?? null
)
: STEPS_IN_ORDER_ONE_PIPETTE.findIndex(step => step === currentStep) ?? 0

if (!session || !activeTipRack) {
Expand All @@ -175,7 +181,7 @@ export function CheckCalibration(
currentStep={stepIndex}
totalSteps={
checkBothPipettes
? STEPS_IN_ORDER_SECOND_PIPETTE.length - 1 + 7
? STEPS_IN_ORDER_BOTH_PIPETTES.length - 1
: STEPS_IN_ORDER_ONE_PIPETTE.length - 1
}
onExit={confirmExit}
Expand Down

0 comments on commit 7d3d845

Please sign in to comment.