Skip to content

Commit

Permalink
fix(app): display only one conflict with thermocycler in run setup (#…
Browse files Browse the repository at this point in the history
…16228)

there are several combinations of labware, fixtures, and modules in A1
and B1 that generate two conflicts with a configured thermocycler. this
PR filters out one of 2 conflicts from display when both conflicts are
with single slot labware in a protocol. other scenarios should be
covered by the modules or fixtures lists.

closes RQA-3112
  • Loading branch information
brenthagen authored Sep 10, 2024
1 parent 9916a7c commit 176e494
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ export const LocationConflictModal = (
protocolSpecifiesDisplayName = getModuleDisplayName(requiredModule)
}

const displaySlotName = isThermocyclerRequired
? 'A1 + B1'
: getCutoutDisplayName(cutoutId)
const displaySlotName =
isThermocyclerRequired || isThermocyclerCurrentFixture
? 'A1 + B1'
: getCutoutDisplayName(cutoutId)

if (showModuleSelect && requiredModule != null) {
return createPortal(
Expand Down Expand Up @@ -232,7 +233,7 @@ export const LocationConflictModal = (
}
values={{
currentFixture: currentFixtureDisplayName,
cutout: getCutoutDisplayName(cutoutId),
cutout: displaySlotName,
}}
components={{
block: <LegacyStyledText as="p" />,
Expand Down Expand Up @@ -341,7 +342,7 @@ export const LocationConflictModal = (
}
values={{
currentFixture: currentFixtureDisplayName,
cutout: getCutoutDisplayName(cutoutId),
cutout: displaySlotName,
}}
components={{
block: <LegacyStyledText fontSize={TYPOGRAPHY.fontSizeH4} />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import {
getCutoutDisplayName,
getDeckDefFromRobotType,
getFixtureDisplayName,
TC_MODULE_LOCATION_OT3,
THERMOCYCLER_V2_FRONT_FIXTURE,
THERMOCYCLER_V2_REAR_FIXTURE,
} from '@opentrons/shared-data'
import { StatusLabel } from '../../../../atoms/StatusLabel'
import { TertiaryButton } from '../../../../atoms/buttons/TertiaryButton'
Expand All @@ -47,9 +50,32 @@ interface SetupFixtureListProps {
export const SetupFixtureList = (props: SetupFixtureListProps): JSX.Element => {
const { deckConfigCompatibility, robotName } = props
const deckDef = getDeckDefFromRobotType(FLEX_ROBOT_TYPE)

const hasTwoLabwareThermocyclerConflicts =
deckConfigCompatibility.some(
({ cutoutFixtureId, missingLabwareDisplayName }) =>
cutoutFixtureId === THERMOCYCLER_V2_FRONT_FIXTURE &&
missingLabwareDisplayName != null
) &&
deckConfigCompatibility.some(
({ cutoutFixtureId, missingLabwareDisplayName }) =>
cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE &&
missingLabwareDisplayName != null
)

// if there are two labware conflicts with the thermocycler, don't show the conflict with the thermocycler rear fixture
const filteredDeckConfigCompatibility = deckConfigCompatibility.filter(
({ cutoutFixtureId }) => {
return (
!hasTwoLabwareThermocyclerConflicts ||
!(cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE)
)
}
)

return (
<>
{deckConfigCompatibility.map(cutoutConfigAndCompatibility => {
{filteredDeckConfigCompatibility.map(cutoutConfigAndCompatibility => {
// filter out all fixtures that only provide usb module addressable areas
// (i.e. everything but MagBlockV1 and StagingAreaWithMagBlockV1)
// as they're handled in the Modules Table
Expand Down Expand Up @@ -89,6 +115,11 @@ export function FixtureListItem({
const isRequiredSingleSlotMissing = missingLabwareDisplayName != null
const isConflictingFixtureConfigured =
cutoutFixtureId != null && !SINGLE_SLOT_FIXTURES.includes(cutoutFixtureId)

const isThermocyclerCurrentFixture =
cutoutFixtureId === THERMOCYCLER_V2_FRONT_FIXTURE ||
cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE

let statusLabel
if (!isCurrentFixtureCompatible) {
statusLabel = (
Expand Down Expand Up @@ -215,7 +246,9 @@ export function FixtureListItem({
</Flex>
</Flex>
<LegacyStyledText as="p" width="15%">
{getCutoutDisplayName(cutoutId)}
{isThermocyclerCurrentFixture && isRequiredSingleSlotMissing
? TC_MODULE_LOCATION_OT3
: getCutoutDisplayName(cutoutId)}
</LegacyStyledText>
<Flex
width="15%"
Expand Down
40 changes: 38 additions & 2 deletions app/src/organisms/ProtocolSetupModulesAndDeck/FixtureTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import {
getFixtureDisplayName,
getSimplestDeckConfigForProtocol,
SINGLE_SLOT_FIXTURES,
TC_MODULE_LOCATION_OT3,
THERMOCYCLER_V2_FRONT_FIXTURE,
THERMOCYCLER_V2_REAR_FIXTURE,
} from '@opentrons/shared-data'

import { SmallButton } from '../../atoms/buttons'
Expand Down Expand Up @@ -74,8 +77,30 @@ export function FixtureTable({
deckConfigCompatibility
)

const hasTwoLabwareThermocyclerConflicts =
requiredDeckConfigCompatibility.some(
({ cutoutFixtureId, missingLabwareDisplayName }) =>
cutoutFixtureId === THERMOCYCLER_V2_FRONT_FIXTURE &&
missingLabwareDisplayName != null
) &&
requiredDeckConfigCompatibility.some(
({ cutoutFixtureId, missingLabwareDisplayName }) =>
cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE &&
missingLabwareDisplayName != null
)

// if there are two labware conflicts with the thermocycler, don't show the conflict with the thermocycler rear fixture
const filteredDeckConfigCompatibility = requiredDeckConfigCompatibility.filter(
({ cutoutFixtureId }) => {
return (
!hasTwoLabwareThermocyclerConflicts ||
!(cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE)
)
}
)

// list not configured/conflicted fixtures first
const sortedDeckConfigCompatibility = requiredDeckConfigCompatibility.sort(
const sortedDeckConfigCompatibility = filteredDeckConfigCompatibility.sort(
a =>
a.cutoutFixtureId != null &&
a.compatibleCutoutFixtureIds.includes(a.cutoutFixtureId)
Expand Down Expand Up @@ -139,6 +164,11 @@ function FixtureTableItem({
cutoutFixtureId != null &&
compatibleCutoutFixtureIds.includes(cutoutFixtureId)
const isRequiredSingleSlotMissing = missingLabwareDisplayName != null

const isThermocyclerCurrentFixture =
cutoutFixtureId === THERMOCYCLER_V2_FRONT_FIXTURE ||
cutoutFixtureId === THERMOCYCLER_V2_REAR_FIXTURE

let chipLabel: JSX.Element
if (!isCurrentFixtureCompatible) {
const isConflictingFixtureConfigured =
Expand Down Expand Up @@ -219,7 +249,13 @@ function FixtureTableItem({
</LegacyStyledText>
</Flex>
<Flex flex="2 0 0" alignItems={ALIGN_CENTER}>
<DeckInfoLabel deckLabel={getCutoutDisplayName(cutoutId)} />
<DeckInfoLabel
deckLabel={
isThermocyclerCurrentFixture && isRequiredSingleSlotMissing
? TC_MODULE_LOCATION_OT3
: getCutoutDisplayName(cutoutId)
}
/>
</Flex>
<Flex
flex="4 0 0"
Expand Down

0 comments on commit 176e494

Please sign in to comment.