Skip to content

Commit

Permalink
feat(app): Home pipette after tip probe confirmed (#2586)
Browse files Browse the repository at this point in the history
closes #2544
  • Loading branch information
Kadee80 authored Oct 31, 2018
1 parent fb96472 commit 3119379
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 99 deletions.
27 changes: 12 additions & 15 deletions app/src/components/TipProbe/RemoveTipPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import CalibrationInfoContent from '../CalibrationInfoContent'
import removeSingle from '../../img/remove_tip_single.png'
import removeMulti from '../../img/remove_tip_multi.png'

import {
actions as robotActions,
type Channels,
type Mount,
} from '../../robot'
import {actions as robotActions, type Channels, type Mount} from '../../robot'

type OwnProps = {
mount: Mount,
Expand All @@ -29,28 +25,27 @@ type RemoveTipProps = {
onConfirmClick: () => void,
}

export default connect(null, mapDispatchToProps)(RemoveTipPanel)
export default connect(
null,
mapDispatchToProps
)(RemoveTipPanel)

function RemoveTipPanel (props: RemoveTipProps) {
const {channels, onConfirmClick} = props

const imgSrc = channels === 1
? removeSingle
: removeMulti
const imgSrc = channels === 1 ? removeSingle : removeMulti

return (
<CalibrationInfoContent
leftChildren={(
leftChildren={
<div>
<p>Remove tip from pipette.</p>
<PrimaryButton onClick={onConfirmClick}>
Confirm Tip Removed
</PrimaryButton>
</div>
)}
rightChildren={(
<img src={imgSrc} alt='remove tip' />
)}
}
rightChildren={<img src={imgSrc} alt="remove tip" />}
/>
)
}
Expand All @@ -62,6 +57,8 @@ function mapDispatchToProps (
const {mount} = ownProps

return {
onConfirmClick: () => { dispatch(robotActions.confirmProbed(mount)) },
onConfirmClick: () => {
dispatch(robotActions.confirmProbed(mount))
},
}
}
44 changes: 19 additions & 25 deletions app/src/robot/actions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
// @flow
// robot actions and action types
import {_NAME as NAME} from './constants'
import type {
Mount,
Slot,
Axis,
Direction,
SessionUpdate,
} from './types'
import type {Mount, Slot, Axis, Direction, SessionUpdate} from './types'

// TODO(mc, 2017-11-22): rename this function to actionType
const makeRobotActionName = (action) => `${NAME}:${action}`
const tagForRobotApi = (action) => ({...action, meta: {robotCommand: true}})
const makeRobotActionName = action => `${NAME}:${action}`
const tagForRobotApi = action => ({...action, meta: {robotCommand: true}})

type Error = {message: string}

Expand Down Expand Up @@ -63,12 +57,13 @@ export type UnexpectedDisconnectAction = {|
export type ConfirmProbedAction = {|
type: 'robot:CONFIRM_PROBED',
payload: Mount,
meta: {|
robotCommand: true,
|},
|}

export type PipetteCalibrationAction = {|
type: (
| 'robot:JOG'
),
type: 'robot:JOG',
payload: {|
mount: Mount,
axis?: Axis,
Expand All @@ -86,14 +81,12 @@ export type SetJogDistanceAction = {|
|}

export type LabwareCalibrationAction = {|
type: (
| 'robot:MOVE_TO'
type: | 'robot:MOVE_TO'
| 'robot:PICKUP_AND_HOME'
| 'robot:DROP_TIP_AND_HOME'
| 'robot:CONFIRM_TIPRACK'
| 'robot:UPDATE_OFFSET'
| 'robot:SET_JOG_DISTANCE'
),
| 'robot:SET_JOG_DISTANCE',
payload: {|
mount: Mount,
slot: Slot,
Expand All @@ -104,31 +97,27 @@ export type LabwareCalibrationAction = {|
|}

export type CalibrationSuccessAction = {
type: (
| 'robot:MOVE_TO_SUCCESS'
type: | 'robot:MOVE_TO_SUCCESS'
| 'robot:JOG_SUCCESS'
| 'robot:PICKUP_AND_HOME_SUCCESS'
| 'robot:DROP_TIP_AND_HOME_SUCCESS'
| 'robot:CONFIRM_TIPRACK_SUCCESS'
| 'robot:UPDATE_OFFSET_SUCCESS'
| 'robot:RETURN_TIP_SUCCESS'
),
| 'robot:RETURN_TIP_SUCCESS',
payload: {
isTiprack?: boolean,
tipOn?: boolean,
},
}

export type CalibrationFailureAction = {|
type: (
| 'robot:MOVE_TO_FAILURE'
type: | 'robot:MOVE_TO_FAILURE'
| 'robot:JOG_FAILURE'
| 'robot:PICKUP_AND_HOME_FAILURE'
| 'robot:DROP_TIP_AND_HOME_FAILURE'
| 'robot:CONFIRM_TIPRACK_FAILURE'
| 'robot:UPDATE_OFFSET_FAILURE'
| 'robot:RETURN_TIP_FAILURE'
),
| 'robot:RETURN_TIP_FAILURE',
error: true,
payload: Error,
|}
Expand Down Expand Up @@ -387,8 +376,13 @@ export const actions = {
return action
},

// confirm tip removed + tip probed then home pipette on `mount`
confirmProbed (mount: Mount): ConfirmProbedAction {
return {type: 'robot:CONFIRM_PROBED', payload: mount}
return {
type: 'robot:CONFIRM_PROBED',
payload: mount,
meta: {robotCommand: true},
}
},

returnTip (mount: Mount) {
Expand Down
Loading

0 comments on commit 3119379

Please sign in to comment.