diff --git a/app/src/organisms/LabwarePositionCheck/LPCFlows/hooks/useLPCLabwareInfo/getUniqueValidLwLocationInfoByAnalysis/getLPCUniqValidLabwareLocationInfo/appendUniqValidLocCombo.ts b/app/src/organisms/LabwarePositionCheck/LPCFlows/hooks/useLPCLabwareInfo/getUniqueValidLwLocationInfoByAnalysis/getLPCUniqValidLabwareLocationInfo/appendUniqValidLocCombo.ts index 6bb4c918b292..c6386d77b949 100644 --- a/app/src/organisms/LabwarePositionCheck/LPCFlows/hooks/useLPCLabwareInfo/getUniqueValidLwLocationInfoByAnalysis/getLPCUniqValidLabwareLocationInfo/appendUniqValidLocCombo.ts +++ b/app/src/organisms/LabwarePositionCheck/LPCFlows/hooks/useLPCLabwareInfo/getUniqueValidLwLocationInfoByAnalysis/getLPCUniqValidLabwareLocationInfo/appendUniqValidLocCombo.ts @@ -1,8 +1,14 @@ import isEqual from 'lodash/isEqual' -import { getLabwareDefURI } from '@opentrons/shared-data' +import { + FLEX_STAGING_ADDRESSABLE_AREAS, + getLabwareDefURI, +} from '@opentrons/shared-data' -import type { LabwareDefinition2 } from '@opentrons/shared-data' +import type { + LabwareDefinition2, + LabwareLocationSequence, +} from '@opentrons/shared-data' import type { LabwareLocationInfoWithLocSeq } from '.' // Appends the labware location combo if it is "unique" to the existing list of combos @@ -38,9 +44,12 @@ function isValidLocCombo( ) const topMostLocSeqComponentKind = combo.locationSequence[combo.locationSequence.length - 1].kind + const isInStagingAreaSlot = getIsInStagingAreaSlot(combo.locationSequence) + const isNotAnLPCablComponentKind = topMostLocSeqComponentKind === 'notOnDeck' || - topMostLocSeqComponentKind === 'inStackerHopper' + topMostLocSeqComponentKind === 'inStackerHopper' || + isInStagingAreaSlot const notLPCable = lwDef == null || @@ -61,3 +70,20 @@ function isValidLocCombo( ) } } + +function getIsInStagingAreaSlot(ls: LabwareLocationSequence): boolean { + const aaLocComponent = ls.find( + component => component.kind === 'onAddressableArea' + ) + + if (aaLocComponent != null) { + return ( + aaLocComponent.kind === 'onAddressableArea' && + FLEX_STAGING_ADDRESSABLE_AREAS.includes( + aaLocComponent.addressableAreaName + ) + ) + } else { + return false + } +} diff --git a/shared-data/js/constants.ts b/shared-data/js/constants.ts index 5dcf54e54d5e..eba1023a885c 100644 --- a/shared-data/js/constants.ts +++ b/shared-data/js/constants.ts @@ -465,6 +465,18 @@ export const FLEX_MODULE_ADDRESSABLE_AREAS: AddressableAreaName[] = [ ...MAGNETIC_BLOCK_ADDRESSABLE_AREAS, ] +export const FLEX_STAGING_ADDRESSABLE_AREAS: AddressableAreaName[] = [ + ...FLEX_STACKER_ADDRESSABLE_AREAS, + A4_ADDRESSABLE_AREA, + B4_ADDRESSABLE_AREA, + C4_ADDRESSABLE_AREA, + D4_ADDRESSABLE_AREA, + ABSORBANCE_READER_LID_DOCK_A4_ADDRESSABLE_AREA, + ABSORBANCE_READER_LID_DOCK_B4_ADDRESSABLE_AREA, + ABSORBANCE_READER_LID_DOCK_C4_ADDRESSABLE_AREA, + ABSORBANCE_READER_LID_DOCK_D4_ADDRESSABLE_AREA, +] + export const ADDRESSABLE_AREA_1: '1' = '1' export const ADDRESSABLE_AREA_2: '2' = '2' export const ADDRESSABLE_AREA_3: '3' = '3'