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(robot-server,app): extend pipette offset cal to include tip length cal if needed #6641

Merged
merged 22 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5ad3818
add new states and transitions to accomodate tlc at beginning of pip …
b-cooper Sep 8, 2020
942abc4
initialize deck
b-cooper Sep 9, 2020
d01dcb1
move to reference point in shared utils
b-cooper Sep 9, 2020
51516a1
raise if wrong branch attempted
b-cooper Sep 10, 2020
e9d43e0
create flag unment req method
b-cooper Sep 15, 2020
022985a
update save offset func internals
b-cooper Sep 15, 2020
acd2dfa
iron out merge conflicts
b-cooper Sep 24, 2020
45b36be
make move to reference point shared command
b-cooper Sep 25, 2020
eeba86d
wire up extended pip offset flow with branching in app
b-cooper Sep 25, 2020
383818e
feat(robot-server,app): extend pipette offset cal to include tip leng…
b-cooper Sep 28, 2020
8607c78
a bit of clean up
b-cooper Sep 28, 2020
344dc59
remove log
b-cooper Sep 28, 2020
d91f8c1
start splitting state machines into the two cases
sfoster1 Sep 29, 2020
75bcbf7
Fixup: Tests, add generic state enum and decide which flow to use on …
Laura-Danielle Oct 5, 2020
d288172
Fixup: Tavern test failure
Laura-Danielle Oct 5, 2020
809cdaf
Fixup: make dataclass and have a load tip length flag
Laura-Danielle Oct 6, 2020
f460c93
Fixup: Add app side of calibration
Laura-Danielle Oct 6, 2020
820efea
Temporary Commit For QA
Laura-Danielle Oct 6, 2020
30d099d
Fixup: logic for has tip length calibration
Laura-Danielle Oct 7, 2020
ac73dfd
Remove unnecessary logs
Laura-Danielle Oct 7, 2020
3c792ae
Fixup: JS mock
Laura-Danielle Oct 7, 2020
9f2a39d
Actually fix fixture
Laura-Danielle Oct 7, 2020
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
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 {
Copy link
Member

Choose a reason for hiding this comment

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

If we add an intermediate complete state we can get rid of the bool

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