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): Home pipette after tip probe confirmed #2586

Merged
merged 2 commits into from
Oct 31, 2018
Merged
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
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,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add meta: {|robotCommand: true|}, to the existing ConfirmProbedAction

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