Skip to content

Commit 737865d

Browse files
authored
fix(app): properly fall back to load order module matching on map view OT2 module setup (#15204)
Don't look to deck configuration for matching specced modules to attached modules within the module setup step of the OT-2 Closes [RQA-2735](https://opentrons.atlassian.net/browse/RQA-2735)
1 parent 97da85c commit 737865d

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesMap.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export const SetupModulesMap = ({
5454
const attachedProtocolModuleMatches = getAttachedProtocolModuleMatches(
5555
attachedModules,
5656
protocolModulesInfo,
57-
actualDeckConfig
57+
actualDeckConfig,
58+
robotType
5859
)
5960

6061
const modulesOnDeck = attachedProtocolModuleMatches.map(module => ({

app/src/organisms/ProtocolSetupModulesAndDeck/utils.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import {
22
DeckConfiguration,
33
FLEX_ROBOT_TYPE,
44
NON_CONNECTING_MODULE_TYPES,
5+
OT2_ROBOT_TYPE,
6+
RobotType,
57
checkModuleCompatibility,
68
getCutoutFixturesForModuleModel,
79
getCutoutIdsFromModuleSlotName,
@@ -16,14 +18,15 @@ export type AttachedProtocolModuleMatch = ProtocolModuleInfo & {
1618
attachedModuleMatch: AttachedModule | null
1719
}
1820

19-
// NOTE: this is a FLEX only function
20-
// some logic copied from useModuleRenderInfoForProtocolById
21+
// NOTE: some logic copied from useModuleRenderInfoForProtocolById
2122
export function getAttachedProtocolModuleMatches(
2223
attachedModules: AttachedModule[],
2324
protocolModulesInfo: ProtocolModuleInfo[],
24-
deckConfig: DeckConfiguration
25+
deckConfig: DeckConfiguration,
26+
robotType: RobotType = FLEX_ROBOT_TYPE
2527
): AttachedProtocolModuleMatch[] {
26-
const deckDef = getDeckDefFromRobotType(FLEX_ROBOT_TYPE) // this is only used for Flex ODD
28+
const deckDef = getDeckDefFromRobotType(robotType)
29+
const robotSupportsModuleConfig = robotType !== OT2_ROBOT_TYPE
2730
const matchedAttachedModules: AttachedModule[] = []
2831
const attachedProtocolModuleMatches = protocolModulesInfo.map(
2932
protocolModule => {
@@ -49,12 +52,14 @@ export function getAttachedProtocolModuleMatches(
4952
matchedAttachedModule.serialNumber ===
5053
attachedModule.serialNumber
5154
) &&
52-
// check deck config has module with expected serial number in expected location
53-
deckConfig.some(
54-
({ cutoutId, opentronsModuleSerialNumber }) =>
55-
attachedModule.serialNumber === opentronsModuleSerialNumber &&
56-
moduleCutoutIds.includes(cutoutId)
57-
)
55+
// then if robotType supports configurable modules check the deck config has a
56+
// a module with the expected serial number in the expected location
57+
(!robotSupportsModuleConfig ||
58+
deckConfig.some(
59+
({ cutoutId, opentronsModuleSerialNumber }) =>
60+
attachedModule.serialNumber === opentronsModuleSerialNumber &&
61+
moduleCutoutIds.includes(cutoutId)
62+
))
5863
) ?? null
5964
if (compatibleAttachedModule !== null) {
6065
matchedAttachedModules.push(compatibleAttachedModule)

0 commit comments

Comments
 (0)