Skip to content

Commit

Permalink
feat(robot-server,app): extend pipette offset cal to include tip leng…
Browse files Browse the repository at this point in the history
…th cal if needed (#6641)
  • Loading branch information
b-cooper authored Oct 7, 2020
1 parent 2e4ad6a commit 5819f29
Show file tree
Hide file tree
Showing 37 changed files with 573 additions and 415 deletions.
5 changes: 5 additions & 0 deletions app/src/components/CalibratePipetteOffset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import {
SaveXYPoint,
CompleteConfirmation,
ConfirmExitModal,
MeasureNozzle,
MeasureTip,
} from '../CalibrationPanels'

import type { StyleProps } from '@opentrons/components'
Expand Down Expand Up @@ -69,6 +71,8 @@ const PANEL_BY_STEP: {
} = {
[Sessions.PIP_OFFSET_STEP_SESSION_STARTED]: Introduction,
[Sessions.PIP_OFFSET_STEP_LABWARE_LOADED]: DeckSetup,
[Sessions.PIP_OFFSET_STEP_MEASURING_NOZZLE_OFFSET]: MeasureNozzle,
[Sessions.PIP_OFFSET_STEP_MEASURING_TIP_OFFSET]: MeasureTip,
[Sessions.PIP_OFFSET_STEP_PREPARING_PIPETTE]: TipPickUp,
[Sessions.PIP_OFFSET_STEP_INSPECTING_TIP]: TipConfirmation,
[Sessions.PIP_OFFSET_STEP_JOGGING_TO_DECK]: SaveZPoint,
Expand Down Expand Up @@ -168,6 +172,7 @@ export function CalibratePipetteOffset(
mount={instrument?.mount.toLowerCase()}
currentStep={currentStep}
sessionType={session.sessionType}
hasCalibratedTipLength={session.details.hasCalibratedTipLength}
/>
</ModalPage>
{showConfirmExit && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import {
TipPickUp,
TipConfirmation,
CompleteConfirmation,
MeasureNozzle,
MeasureTip,
} from '../../CalibrationPanels'
import { MeasureNozzle } from '../MeasureNozzle'
import { MeasureTip } from '../MeasureTip'

import type { TipLengthCalibrationStep } from '../../../sessions/types'

Expand Down
4 changes: 2 additions & 2 deletions app/src/components/CalibrateTipLength/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import {
TipConfirmation,
CompleteConfirmation,
ConfirmExitModal,
MeasureNozzle,
MeasureTip,
} from '../CalibrationPanels'
import { MeasureNozzle } from './MeasureNozzle'
import { MeasureTip } from './MeasureTip'

import type { CalibrateTipLengthParentProps } from './types'

Expand Down
187 changes: 0 additions & 187 deletions app/src/components/CalibrateTipLength/styles.css
Original file line number Diff line number Diff line change
@@ -1,197 +1,10 @@
@import '@opentrons/components';

.success_status_icon {
width: 2.5rem;
margin-right: 0.75rem;
color: var(--c-success);
}

.intro_header {
@apply --font-header-dark;

margin-bottom: 1rem;
text-transform: uppercase;
}

.intro_content {
@apply --font-body-2-dark;

margin-bottom: 1.5rem;
}

.alert_modal_padding {
padding: 4rem 1rem;
}

.terminal_modal_contents,
.modal_contents {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
max-width: 48rem;
min-height: 14rem;
padding: 1rem;
}

.terminal_modal_contents {
padding: 1rem 1.5rem;
}

.complete_summary {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
margin: 2rem 0;
}

.continue_button {
margin: 1.5rem 5rem 1rem;
}

.block_image {
max-height: 20rem;
max-width: 16rem;
}

.required_tiprack {
width: 50%;
border: 1px solid var('--c-med-gray');
padding: 0 1rem;
display: flex;
flex-direction: column;
align-items: center;
}

.required_tiprack:not(:last-child) {
margin-right: 0.625rem;
}

.tiprack_image_container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 1rem 0;
height: 70%;
}

.tiprack_image {
width: 100%;
max-height: 100%;
}

.tiprack_display_name {
font-size: var('--fs-body-2');
}

/*
TODO: BC 2020-04-01 consider abstracting this to a shared place
these styles were mostly copped from PD's VIEW MEASUREMENTs button
ideally these would both use the same component
*/
.tiprack_measurements_link {
padding: 1rem 0.5rem;
flex: 0.6;
text-transform: uppercase;
text-align: center;
cursor: pointer;
text-decoration: none;
color: inherit;
font-size: var('--fs-body-2');

&:hover {
background-color: var(--c-bg-hover);
}
}

.tipracks_note_header {
text-transform: uppercase;
}

/* end copped styles */

.prompt {
flex: none;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.prompt_text {
@apply --font-header-light;

font-weight: normal;
margin: 0.5rem 0;
text-align: center;
}

.prompt_button {
display: block;
width: auto;
margin: 0.5rem 0 1rem 0;
padding-left: 3rem;
padding-right: 3rem;
}

.page_content_dark {
display: flex;
padding: 1rem;
flex-direction: column;
align-items: center;
background-color: transparent;
height: 100%;
}

.deck_map_wrapper {
flex: 1 1 0;
align-self: stretch;
display: flex;
background-color: var(--c-bg-light);
border-radius: 6px;
}

.deck_map {
flex: 1;
}

.labware_ui_wrapper {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
justify-content: flex-end;
}

.display_name {
@apply --truncate;

font-weight: var(--fw-semibold);
color: var(--c-font-light);
text-transform: uppercase;
}

.command_button {
margin: 0 5rem;
}

.pick_up_tip_confirmation_button {
margin-top: 1rem;
width: 80%;
}

.step_check_video_wrapper {
margin-left: 1rem;
}

.step_check_video {
max-width: 100%;
max-height: 15rem;
}

.loading_spinner {
width: 7.5rem;
margin-bottom: 3rem;
}
36 changes: 30 additions & 6 deletions app/src/components/CalibrationPanels/CompleteConfirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const PIP_OFFSET_CAL_HEADER = 'Pipette Offset Calibration complete'
const TIP_CAL_HEADER = 'Tip Length Calibration complete'
const REMOVE_BLOCK = 'Remove Calibration Block from the deck.'
const RETURN_TIP = 'Return tip to tip rack and exit'
const EXIT = 'exit'
const PROCEED_TO_PIP_OFFSET = 'continue to Pipette Offset Calibration'

const contentsBySessionType: { [SessionType]: { headerText: string } } = {
[Sessions.SESSION_TYPE_DECK_CALIBRATION]: { headerText: DECK_CAL_HEADER },
Expand All @@ -44,12 +46,19 @@ const contentsBySessionType: { [SessionType]: { headerText: string } } = {
}

export function CompleteConfirmation(props: CalibrationPanelProps): React.Node {
const { sessionType, calBlock } = props
const {
sessionType,
calBlock,
hasCalibratedTipLength,
cleanUpAndExit,
sendCommands,
} = props
const { headerText } = contentsBySessionType[sessionType]

const exitSession = () => {
props.cleanUpAndExit()
const proceed = () => {
sendCommands({ command: Sessions.sharedCalCommands.MOVE_TO_DECK })
}

return (
<Flex
flexDirection={DIRECTION_COLUMN}
Expand Down Expand Up @@ -88,9 +97,24 @@ export function CompleteConfirmation(props: CalibrationPanelProps): React.Node {
</>
)}

<Flex width="100%" justifyContent={JUSTIFY_CENTER} marginY={SPACING_3}>
<PrimaryBtn title={RETURN_TIP} flex="1" onClick={exitSession}>
{RETURN_TIP}
<Flex
width="100%"
flexDirection={DIRECTION_COLUMN}
justifyContent={JUSTIFY_CENTER}
marginY={SPACING_3}
>
{hasCalibratedTipLength === false && (
<PrimaryBtn
title={RETURN_TIP}
flex="1"
marginY={SPACING_3}
onClick={proceed}
>
{PROCEED_TO_PIP_OFFSET}
</PrimaryBtn>
)}
<PrimaryBtn title={RETURN_TIP} flex="1" onClick={cleanUpAndExit}>
{hasCalibratedTipLength === false ? EXIT : RETURN_TIP}
</PrimaryBtn>
</Flex>
</Flex>
Expand Down
23 changes: 19 additions & 4 deletions app/src/components/CalibrationPanels/DeckSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,33 @@ const contentsBySessionType: {
moveCommandString: Sessions.sharedCalCommands.MOVE_TO_TIP_RACK,
},
[Sessions.SESSION_TYPE_TIP_LENGTH_CALIBRATION]: {
moveCommandString: Sessions.tipCalCommands.MOVE_TO_REFERENCE_POINT,
moveCommandString: Sessions.sharedCalCommands.MOVE_TO_REFERENCE_POINT,
},
}

export function DeckSetup(props: CalibrationPanelProps): React.Node {
const deckDef = React.useMemo(() => getDeckDefinitions()['ot2_standard'], [])

const { tipRack, calBlock, sendCommands, sessionType } = props
const { moveCommandString } = contentsBySessionType[sessionType]
const {
tipRack,
calBlock,
sendCommands,
sessionType,
hasCalibratedTipLength,
} = props

const isExtendedPipOffset =
sessionType === Sessions.SESSION_TYPE_PIPETTE_OFFSET_CALIBRATION &&
hasCalibratedTipLength === false

const lookupType = isExtendedPipOffset
? Sessions.SESSION_TYPE_TIP_LENGTH_CALIBRATION
: sessionType

const proceed = () => {
sendCommands({ command: moveCommandString })
sendCommands({
command: contentsBySessionType[lookupType].moveCommandString,
})
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import {
import { JogControls } from '../JogControls'
import * as Sessions from '../../sessions'
import type { JogAxis, JogDirection, JogStep } from '../../http-api-client'
import type { CalibrationPanelProps } from '../CalibrationPanels/types'
import type { CalibrationPanelProps } from './types'

import { formatJogVector } from '../CalibrationPanels/utils'
import { formatJogVector } from './utils'
import leftMultiBlockAsset from '../../assets/videos/tip-length-cal/Left_Multi_CalBlock_NO_TIP_(330x260)REV1.webm'
import leftMultiTrashAsset from '../../assets/videos/tip-length-cal/Left_Multi_Trash_NO_TIP_(330x260)REV1.webm'
import leftSingleBlockAsset from '../../assets/videos/tip-length-cal/Left_Single_CalBlock_NO_TIP_(330x260)REV1.webm'
Expand Down Expand Up @@ -95,7 +95,7 @@ export function MeasureNozzle(props: CalibrationPanelProps): React.Node {

const jog = (axis: JogAxis, dir: JogDirection, step: JogStep) => {
sendCommands({
command: Sessions.tipCalCommands.JOG,
command: Sessions.sharedCalCommands.JOG,
data: {
vector: formatJogVector(axis, dir, step),
},
Expand All @@ -104,8 +104,8 @@ export function MeasureNozzle(props: CalibrationPanelProps): React.Node {

const proceed = () => {
sendCommands(
{ command: Sessions.tipCalCommands.SAVE_OFFSET },
{ command: Sessions.tipCalCommands.MOVE_TO_TIP_RACK }
{ command: Sessions.sharedCalCommands.SAVE_OFFSET },
{ command: Sessions.sharedCalCommands.MOVE_TO_TIP_RACK }
)
}

Expand Down
Loading

0 comments on commit 5819f29

Please sign in to comment.