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

fix(app): Verify attached/protocol pipettes #3458

Merged
merged 1 commit into from
May 14, 2019
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
6 changes: 4 additions & 2 deletions app/src/components/FileInfo/ProtocolPipettesCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ function ProtocolPipettes(props: Props) {

const pipetteInfo = pipettes.map(p => {
const pipetteConfig = getPipetteModelSpecs(p.name)
const actualPipetteConfig = getPipetteModelSpecs(
actualPipettes?.[p.mount].model || ''
)
const displayName = !pipetteConfig ? 'N/A' : pipetteConfig.displayName

const actualModel = actualPipettes && actualPipettes[p.mount].model
let pipettesMatch = true

if (pipetteConfig && actualModel !== p.name) {
if (pipetteConfig && pipetteConfig.name !== actualPipetteConfig?.name) {
pipettesMatch = false
}

Expand Down
15 changes: 10 additions & 5 deletions app/src/components/calibrate-pipettes/Pipettes.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,33 @@ export default function Pipettes(props: Props) {

const infoByMount = PIPETTE_MOUNTS.reduce((result, mount) => {
const pipette = pipettes.find(p => p.mount === mount)
// TODO(mc, 2018-04-25)

const pipetteConfig = pipette ? getPipetteModelSpecs(pipette.name) : null
const actualPipetteConfig = getPipetteModelSpecs(
actualPipettes?.[mount].model || ''
)

const isDisabled = !pipette || mount !== currentMount
const details = !pipetteConfig
? { description: 'N/A', tipType: 'N/A' }
: {
description: pipetteConfig.displayName,
tipType: `${pipetteConfig.maxVolume} ul`,
tipType: `${pipetteConfig.maxVolume} µL`,
channels: pipetteConfig.channels,
}

const actualModel = actualPipettes && actualPipettes[mount].model
let showAlert = false
let alertType = ''

// only show alert if a pipette is on this mount in the protocol
if (pipetteConfig) {
if (actualModel == null) {
if (!actualPipetteConfig) {
showAlert = true
alertType = 'attach'
} else if (pipette && pipette.name !== actualModel) {
} else if (
actualPipetteConfig &&
actualPipetteConfig.name !== pipetteConfig.name
) {
showAlert = true
alertType = 'change'
}
Expand Down