Skip to content

Commit

Permalink
fix(protocol-designer): filter out module addressable area names from… (
Browse files Browse the repository at this point in the history
#16931)

… avail slot

closes RQA-3662
  • Loading branch information
jerader authored Nov 21, 2024
1 parent 060bde1 commit 7d50f2d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
1 change: 0 additions & 1 deletion protocol-designer/src/labware-ingred/actions/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export const createContainer: (
args.slot ||
getNextAvailableDeckSlot(initialDeckSetup, robotType, labwareDef)
const isTiprack = getIsTiprack(labwareDef)

if (slot) {
const id = `${uuid()}:${args.labwareDefURI}`
const adapterId =
Expand Down
19 changes: 18 additions & 1 deletion protocol-designer/src/labware-ingred/utils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import {
FIXED_TRASH_ID,
FLEX_MODULE_ADDRESSABLE_AREAS,
getAreSlotsAdjacent,
getDeckDefFromRobotType,
getIsLabwareAboveHeight,
HEATERSHAKER_MODULE_TYPE,
MAX_LABWARE_HEIGHT_EAST_WEST_HEATER_SHAKER_MM,
MOVABLE_TRASH_ADDRESSABLE_AREAS,
OT2_ROBOT_TYPE,
THERMOCYCLER_MODULE_TYPE,
WASTE_CHUTE_ADDRESSABLE_AREAS,
} from '@opentrons/shared-data'
import { COLUMN_4_SLOTS } from '@opentrons/step-generation'
Expand All @@ -30,6 +32,16 @@ export function getNextAvailableDeckSlot(
module => module.type === HEATERSHAKER_MODULE_TYPE
)?.slot

const hasTC = Object.values(initialDeckSetup.modules).find(
module => module.type === THERMOCYCLER_MODULE_TYPE
)
let moduleSlots = Object.values(initialDeckSetup.modules)
.filter(module => module.slot)
.map(mod => mod.slot)
if (hasTC) {
moduleSlots = [...moduleSlots, '8', '10', '11']
}

return deckDef.locations.addressableAreas.find(slot => {
const cutoutIds = Object.values(initialDeckSetup.additionalEquipmentOnDeck)
.filter(ae => ae.name === 'stagingArea')
Expand All @@ -47,12 +59,17 @@ export function getNextAvailableDeckSlot(
MOVABLE_TRASH_ADDRESSABLE_AREAS.includes(slot.id) ||
WASTE_CHUTE_ADDRESSABLE_AREAS.includes(slot.id) ||
slot.id === FIXED_TRASH_ID
) {
isSlotEmpty = false
} else if (
moduleSlots.includes(slot.id) ||
FLEX_MODULE_ADDRESSABLE_AREAS.includes(slot.id)
) {
isSlotEmpty = false
// return slot as full if slot is adjacent to heater-shaker for ot-2 and taller than 53mm
} else if (
heaterShakerSlot != null &&
deckDef.robot.model === OT2_ROBOT_TYPE &&
robotType === OT2_ROBOT_TYPE &&
isSlotEmpty &&
labwareDefinition != null
) {
Expand Down

0 comments on commit 7d50f2d

Please sign in to comment.