Skip to content

Commit 43bb139

Browse files
ahiuchingausmb2268
authored andcommitted
use new method in module protocol setup
1 parent d2e6dce commit 43bb139

File tree

4 files changed

+18
-34
lines changed

4 files changed

+18
-34
lines changed

app/src/organisms/Desktop/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesList.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ import {
2828
getCutoutIdForSlotName,
2929
getDeckDefFromRobotType,
3030
getFixtureDisplayName,
31-
getModuleType,
31+
getModuleDeckLabel,
3232
HEATERSHAKER_MODULE_TYPE,
3333
HEATERSHAKER_MODULE_V1,
3434
MAGNETIC_BLOCK_TYPE,
3535
MAGNETIC_BLOCK_V1,
3636
OT2_ROBOT_TYPE,
37-
TC_MODULE_LOCATION_OT2,
38-
TC_MODULE_LOCATION_OT3,
3937
WASTE_CHUTE_FLEX_STACKER_FIXTURES,
4038
} from '@opentrons/shared-data'
4139

@@ -68,6 +66,7 @@ import type {
6866
CutoutFixtureId,
6967
DeckDefinition,
7068
ModuleModel,
69+
ModuleType,
7170
} from '@opentrons/shared-data'
7271
import type { ModulePrepCommandsType } from '/app/local-resources/modules'
7372
import type { AttachedModule } from '/app/redux/modules/types'
@@ -126,11 +125,11 @@ export const SetupModulesList = (props: SetupModulesListProps): JSX.Element => {
126125
}) => {
127126
// filter out the magnetic block here, because it is handled by the SetupFixturesList
128127
if (moduleDef.moduleType === MAGNETIC_BLOCK_TYPE) return null
129-
// if the module is a flex stacker in D4, check if it needs a waste chute
128+
// if the module is a flex stacker in row D, check if it needs a waste chute
130129
// combo fixture
131130
if (
132131
moduleDef.moduleType === FLEX_STACKER_MODULE_TYPE &&
133-
slotName === 'D4'
132+
slotName[0] === 'D'
134133
) {
135134
const deckConfigCompatabilityD3 = deckConfigCompatibility?.find(
136135
configItem => configItem.cutoutId === 'cutoutD3'
@@ -153,6 +152,7 @@ export const SetupModulesList = (props: SetupModulesListProps): JSX.Element => {
153152
moduleDef.model
154153
)}_slot_${slotName}`}
155154
moduleModel={moduleDef.model}
155+
moduleType={moduleDef.moduleType}
156156
displayName={moduleDef.displayName}
157157
slotName={slotName}
158158
attachedModuleMatch={attachedModuleMatch}
@@ -175,6 +175,7 @@ export const SetupModulesList = (props: SetupModulesListProps): JSX.Element => {
175175
moduleDef.model
176176
)}_slot_${slotName}`}
177177
moduleModel={moduleDef.model}
178+
moduleType={moduleDef.moduleType}
178179
displayName={moduleDef.displayName}
179180
slotName={slotName}
180181
attachedModuleMatch={attachedModuleMatch}
@@ -200,6 +201,7 @@ export const SetupModulesList = (props: SetupModulesListProps): JSX.Element => {
200201

201202
interface ModulesListItemProps {
202203
moduleModel: ModuleModel
204+
moduleType: ModuleType
203205
displayName: string
204206
slotName: string
205207
attachedModuleMatch: AttachedModule | null
@@ -218,6 +220,7 @@ interface ModulesListItemProps {
218220

219221
export function ModulesListItem({
220222
moduleModel,
223+
moduleType,
221224
displayName,
222225
slotName,
223226
attachedModuleMatch,
@@ -470,11 +473,7 @@ export function ModulesListItem({
470473
justifyContent={JUSTIFY_CENTER}
471474
>
472475
<LegacyStyledText as="p">
473-
{getModuleType(moduleModel) === 'thermocyclerModuleType'
474-
? isFlex
475-
? TC_MODULE_LOCATION_OT3
476-
: TC_MODULE_LOCATION_OT2
477-
: slotName}
476+
{getModuleDeckLabel(moduleType, slotName)}
478477
</LegacyStyledText>
479478
{portDisplay != null ? (
480479
<LegacyStyledText as="p">{portDisplay}</LegacyStyledText>

app/src/organisms/Desktop/Devices/ProtocolRun/SetupModuleAndDeck/__tests__/SetupModulesList.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const MOCK_SECOND_MAGNETIC_MODULE_COORDS = [100, 200, 0]
5252
const mockMagneticModule = {
5353
moduleId: 'someMagneticModule',
5454
model: 'magneticModuleV2' as ModuleModel,
55-
type: 'magneticModuleType' as ModuleType,
55+
moduleType: 'magneticModuleType' as ModuleType,
5656
labwareOffset: { x: 5, y: 5, z: 5 },
5757
cornerOffsetFromSlot: { x: 1, y: 1, z: 1 },
5858
calibrationPoint: { x: 0, y: 0 },
@@ -65,7 +65,7 @@ const mockTCModule = {
6565
labwareOffset: { x: 3, y: 3, z: 3 },
6666
moduleId: 'TCModuleId',
6767
model: 'thermocyclerModuleV1' as ModuleModel,
68-
type: 'thermocyclerModuleType' as ModuleType,
68+
moduleType: 'thermocyclerModuleType' as ModuleType,
6969
displayName: 'Thermocycler Module',
7070
}
7171

@@ -219,7 +219,7 @@ describe('SetupModulesList', () => {
219219
nestedLabwareDef: null,
220220
nestedLabwareId: null,
221221
protocolLoadOrder: 0,
222-
slotName: '7',
222+
slotName: 'B1',
223223
attachedModuleMatch: mockThermocycler,
224224
},
225225
} as any)
@@ -282,7 +282,7 @@ describe('SetupModulesList', () => {
282282
nestedLabwareDef: null,
283283
nestedLabwareId: null,
284284
protocolLoadOrder: 0,
285-
slotName: '7',
285+
slotName: 'B1',
286286
attachedModuleMatch: {
287287
...mockThermocycler,
288288
moduleOffset: mockCalibratedData,

app/src/organisms/ODD/ProtocolSetup/ProtocolSetupModulesAndDeck/ModuleTableItem.tsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ import {
1818
ABSORBANCE_READER_TYPE,
1919
FLEX_STACKER_MODULE_TYPE,
2020
getFixtureDisplayName,
21+
getModuleDeckLabel,
2122
getModuleDisplayName,
22-
getModuleType,
23-
TC_MODULE_LOCATION_OT3,
24-
THERMOCYCLER_MODULE_TYPE,
2523
} from '@opentrons/shared-data'
2624

2725
import { SmallButton } from '/app/atoms/buttons'
@@ -285,17 +283,6 @@ export function ModuleTableItem({
285283
}
286284
}
287285

288-
const getModuleLocation = (moduleModel: ModuleModel): string => {
289-
const moduleType = getModuleType(moduleModel)
290-
if (moduleType === THERMOCYCLER_MODULE_TYPE) {
291-
return TC_MODULE_LOCATION_OT3
292-
} else if (moduleType === FLEX_STACKER_MODULE_TYPE) {
293-
return `${module.slotName.charAt(0)}4`
294-
} else {
295-
return module.slotName
296-
}
297-
}
298-
299286
return (
300287
<>
301288
{showModuleWizard && module.attachedModuleMatch != null ? (
@@ -340,7 +327,10 @@ export function ModuleTableItem({
340327
</Flex>
341328
<Flex alignItems={ALIGN_CENTER} flex="2 0 0">
342329
<DeckInfoLabel
343-
deckLabel={getModuleLocation(module.moduleDef.model)}
330+
deckLabel={getModuleDeckLabel(
331+
module.moduleDef.moduleType,
332+
module.slotName
333+
)}
344334
/>
345335
</Flex>
346336
<Flex

app/src/resources/runs/useModuleRenderInfoForProtocolById.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
checkModuleCompatibility,
33
FLEX_ROBOT_TYPE,
4-
FLEX_STACKER_MODULE_TYPE,
54
getCutoutFixturesForModuleModel,
65
getCutoutIdsFromModuleSlotName,
76
getDeckDefFromRobotType,
@@ -120,10 +119,6 @@ export function useModuleRenderInfoForProtocolById(
120119
...acc,
121120
[moduleInfo.moduleId]: {
122121
...moduleInfo,
123-
slotName:
124-
moduleInfo.moduleDef.moduleType === FLEX_STACKER_MODULE_TYPE
125-
? `${moduleInfo.slotName.charAt(0)}4`
126-
: moduleInfo.slotName,
127122
},
128123
}),
129124
{}

0 commit comments

Comments
 (0)