Skip to content

Commit

Permalink
Swap out 96 well plate defs for ones with big enough touch targets
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Aug 6, 2024
1 parent b35dfac commit 5cd17ef
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
17 changes: 15 additions & 2 deletions app/src/organisms/QuickTransferFlow/SelectDestWells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ import {
LegacyStyledText,
JUSTIFY_CENTER,
} from '@opentrons/components'
import { getAllDefinitions } from '@opentrons/shared-data'

import { getTopPortalEl } from '../../App/portal'
import { OddModal } from '../../molecules/OddModal'
import { ChildNavigation } from '../../organisms/ChildNavigation'
import { useToaster } from '../../organisms/ToasterOven'
import { WellSelection } from '../../organisms/WellSelection'
import {
CIRCULAR_WELL_96_PLATE_DEFINITION_URI,
RECTANGULAR_WELL_96_PLATE_DEFINITION_URI,
} from './SelectSourceWells'

import type { SmallButton } from '../../atoms/buttons'
import type { OddModalHeaderBaseProps } from '../../molecules/OddModal/types'
Expand Down Expand Up @@ -107,9 +112,17 @@ export function SelectDestWells(props: SelectDestWellsProps): JSX.Element {
setSelectedWells({})
},
}
const labwareDefinition =
let labwareDefinition =
state.destination === 'source' ? state.source : state.destination

if (labwareDefinition?.parameters.format === '96Standard') {
const allDefinitions = getAllDefinitions()
if (Object.values(labwareDefinition.wells)[0].shape === 'circular') {
labwareDefinition = allDefinitions[CIRCULAR_WELL_96_PLATE_DEFINITION_URI]
} else {
labwareDefinition =
allDefinitions[RECTANGULAR_WELL_96_PLATE_DEFINITION_URI]
}
}
return (
<>
{createPortal(
Expand Down
24 changes: 22 additions & 2 deletions app/src/organisms/QuickTransferFlow/SelectSourceWells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
POSITION_FIXED,
SPACING,
} from '@opentrons/components'
import { getAllDefinitions } from '@opentrons/shared-data'

import { ChildNavigation } from '../../organisms/ChildNavigation'
import { WellSelection } from '../../organisms/WellSelection'
Expand All @@ -24,6 +25,11 @@ interface SelectSourceWellsProps {
dispatch: React.Dispatch<QuickTransferWizardAction>
}

export const CIRCULAR_WELL_96_PLATE_DEFINITION_URI =
'opentrons/thermoscientificnunc_96_wellplate_2000ul/1'
export const RECTANGULAR_WELL_96_PLATE_DEFINITION_URI =
'opentrons/usascientific_96_wellplate_2.4ml_deep/1'

export function SelectSourceWells(props: SelectSourceWellsProps): JSX.Element {
const { onNext, onBack, state, dispatch } = props
const { i18n, t } = useTranslation(['quick_transfer', 'shared'])
Expand All @@ -50,6 +56,20 @@ export function SelectSourceWells(props: SelectSourceWellsProps): JSX.Element {
setSelectedWells({})
},
}
let displayLabwareDefinition = state.source
if (state.source?.parameters.format === '96Standard') {
const allDefinitions = getAllDefinitions()
if (Object.values(state.source.wells)[0].shape === 'circular') {
displayLabwareDefinition =
allDefinitions[CIRCULAR_WELL_96_PLATE_DEFINITION_URI]
console.log('circle')
} else {
displayLabwareDefinition =
allDefinitions[RECTANGULAR_WELL_96_PLATE_DEFINITION_URI]
console.log('rect')
}
console.log(displayLabwareDefinition)
}

return (
<>
Expand All @@ -71,14 +91,14 @@ export function SelectSourceWells(props: SelectSourceWellsProps): JSX.Element {
left="0"
width="100%"
>
{state.source != null ? (
{state.source != null && displayLabwareDefinition != null ? (
<Flex
width={
state.source.parameters.format === '384Standard' ? '100%' : '75%'
}
>
<WellSelection
definition={state.source}
definition={displayLabwareDefinition}
deselectWells={(wells: string[]) => {
setSelectedWells(prevWells =>
without(Object.keys(prevWells), ...wells).reduce(
Expand Down

0 comments on commit 5cd17ef

Please sign in to comment.