Skip to content

Commit

Permalink
filter adapter/labware combos via stackingOffset info
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Aug 20, 2024
1 parent 6799aa7 commit 87cd4c5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ import { getOnlyLatestDefs } from '../../labware-defs'
import {
ADAPTER_96_CHANNEL,
getLabwareIsCompatible as _getLabwareIsCompatible,
getLabwareCompatibleWithAdapter,
} from '../../utils/labwareModuleCompatibility'
import { getHas96Channel } from '../../utils'
import { createCustomLabwareDef } from '../../labware-defs/actions'
import { getRobotType } from '../../file-data/selectors'
import { getCustomLabwareDefsByURI } from '../../labware-defs/selectors'
import { getPipetteEntities } from '../../step-forms/selectors'
import { ORDERED_CATEGORIES } from './constants'
import { getLabwareIsRecommended } from './utils'
import {
getLabwareIsRecommended,
getLabwareCompatibleWithAdapter,
} from './utils'

import type {
DeckSlotId,
Expand Down
18 changes: 18 additions & 0 deletions protocol-designer/src/pages/StartingDeckState/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
THERMOCYCLER_MODULE_V2,
getModuleType,
} from '@opentrons/shared-data'
import { getOnlyLatestDefs } from '../../labware-defs'
import {
FLEX_MODULE_MODELS,
OT2_MODULE_MODELS,
Expand Down Expand Up @@ -106,3 +107,20 @@ export const getLabwareIsRecommended = (
: false
}
}

export const getLabwareCompatibleWithAdapter = (
adapterLoadName?: string
): string[] => {
const defs = getOnlyLatestDefs()

if (adapterLoadName == null) {
return []
}

return Object.entries(defs)
.filter(
([, { stackingOffsetWithLabware }]) =>
stackingOffsetWithLabware?.[adapterLoadName] != null
)
.map(([labwareDefUri]) => labwareDefUri)
}

0 comments on commit 87cd4c5

Please sign in to comment.