diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesMap.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesMap.tsx index 976a3ae034d..72687bc8324 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesMap.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesMap.tsx @@ -54,7 +54,8 @@ export const SetupModulesMap = ({ const attachedProtocolModuleMatches = getAttachedProtocolModuleMatches( attachedModules, protocolModulesInfo, - actualDeckConfig + actualDeckConfig, + robotType ) const modulesOnDeck = attachedProtocolModuleMatches.map(module => ({ diff --git a/app/src/organisms/ProtocolSetupModulesAndDeck/utils.ts b/app/src/organisms/ProtocolSetupModulesAndDeck/utils.ts index cc921ef6049..709d357c511 100644 --- a/app/src/organisms/ProtocolSetupModulesAndDeck/utils.ts +++ b/app/src/organisms/ProtocolSetupModulesAndDeck/utils.ts @@ -2,6 +2,8 @@ import { DeckConfiguration, FLEX_ROBOT_TYPE, NON_CONNECTING_MODULE_TYPES, + OT2_ROBOT_TYPE, + RobotType, checkModuleCompatibility, getCutoutFixturesForModuleModel, getCutoutIdsFromModuleSlotName, @@ -16,14 +18,15 @@ export type AttachedProtocolModuleMatch = ProtocolModuleInfo & { attachedModuleMatch: AttachedModule | null } -// NOTE: this is a FLEX only function -// some logic copied from useModuleRenderInfoForProtocolById +// NOTE: some logic copied from useModuleRenderInfoForProtocolById export function getAttachedProtocolModuleMatches( attachedModules: AttachedModule[], protocolModulesInfo: ProtocolModuleInfo[], - deckConfig: DeckConfiguration + deckConfig: DeckConfiguration, + robotType: RobotType = FLEX_ROBOT_TYPE ): AttachedProtocolModuleMatch[] { - const deckDef = getDeckDefFromRobotType(FLEX_ROBOT_TYPE) // this is only used for Flex ODD + const deckDef = getDeckDefFromRobotType(robotType) + const robotSupportsModuleConfig = robotType !== OT2_ROBOT_TYPE const matchedAttachedModules: AttachedModule[] = [] const attachedProtocolModuleMatches = protocolModulesInfo.map( protocolModule => { @@ -49,12 +52,14 @@ export function getAttachedProtocolModuleMatches( matchedAttachedModule.serialNumber === attachedModule.serialNumber ) && - // check deck config has module with expected serial number in expected location - deckConfig.some( - ({ cutoutId, opentronsModuleSerialNumber }) => - attachedModule.serialNumber === opentronsModuleSerialNumber && - moduleCutoutIds.includes(cutoutId) - ) + // then if robotType supports configurable modules check the deck config has a + // a module with the expected serial number in the expected location + (!robotSupportsModuleConfig || + deckConfig.some( + ({ cutoutId, opentronsModuleSerialNumber }) => + attachedModule.serialNumber === opentronsModuleSerialNumber && + moduleCutoutIds.includes(cutoutId) + )) ) ?? null if (compatibleAttachedModule !== null) { matchedAttachedModules.push(compatibleAttachedModule)