Skip to content

Commit a9e9f58

Browse files
committed
(draft): try updating labware location for move labware intervention
1 parent f8c138d commit a9e9f58

File tree

4 files changed

+34
-14
lines changed

4 files changed

+34
-14
lines changed

app/src/assets/localization/en/protocol_command_text.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@
8989
"single": "single",
9090
"single_nozzle_layout": "single nozzle layout",
9191
"slot": "Slot {{slot_name}}",
92-
"stacker_display_name": "Stacker {{stacker_slot}}",
93-
"stacker_column_display_name": "Stacker in Column {{stacker_slot}}",
92+
"stacker_hopper_display": "Stacker {{row}}",
9493
"target_temperature": "target temperature",
9594
"tc_awaiting_for_duration": "Waiting for Thermocycler profile to complete",
9695
"tc_run_profile_steps": "Temperature: {{celsius}}°C, hold time: {{duration}}",

app/src/organisms/InterventionModal/MoveLabwareInterventionContent.tsx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
DIRECTION_COLUMN,
1111
DISPLAY_NONE,
1212
Flex,
13+
getLabwareDisplayLocation,
1314
getLoadedLabware,
1415
getLoadedModule,
1516
Icon,
@@ -184,19 +185,27 @@ export function MoveLabwareInterventionContent({
184185
</Flex>
185186
<Divider css={DIVIDER_STYLE} />
186187
<Flex css={LABWARE_DIRECTION_STYLE}>
187-
<LabwareDisplayLocation
188-
protocolData={run}
189-
location={oldLabwareLocation}
190-
robotType={robotType}
191-
labwareDefsByUri={labwareDefsByUri}
188+
<DeckInfoLabel
189+
deckLabel={getLabwareDisplayLocation({
190+
location: oldLabwareLocation,
191+
loadedModules: run.modules,
192+
loadedLabwares: run.labware,
193+
robotType: 'OT-3 Standard',
194+
detailLevel: 'slot-only',
195+
t,
196+
})}
192197
/>
193198

194199
<Icon name="arrow-right" css={ICON_STYLE} />
195-
<LabwareDisplayLocation
196-
protocolData={run}
197-
location={command.params.newLocation}
198-
robotType={robotType}
199-
labwareDefsByUri={labwareDefsByUri}
200+
<DeckInfoLabel
201+
deckLabel={getLabwareDisplayLocation({
202+
location: command.params.newLocation,
203+
loadedModules: run.modules,
204+
loadedLabwares: run.labware,
205+
robotType: 'OT-3 Standard',
206+
detailLevel: 'slot-only',
207+
t,
208+
})}
200209
/>
201210
</Flex>
202211
</Flex>

components/src/organisms/CommandText/useCommandTextString/utils/getLabwareLocation.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {
22
FLEX_STACKER_MODULE_V1,
33
getCutoutDisplayName,
4+
getModuleType,
5+
FLEX_STACKER_MODULE_TYPE,
46
getLabwareDefURI,
57
getLabwareDisplayName,
68
getModuleModelFromAddressableArea,
@@ -204,7 +206,9 @@ export function getLabwareLocation(
204206

205207
return {
206208
slotName,
207-
moduleModel,
209+
moduleModel: getModuleType(moduleModel) === FLEX_STACKER_MODULE_TYPE
210+
? undefined
211+
: moduleModel,
208212
}
209213
} else if ('labwareId' in location) {
210214
if (!Array.isArray(loadedLabwares)) {

components/src/organisms/CommandText/useCommandTextString/utils/getModuleDisplayLocation.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { FLEX_STACKER_MODULE_TYPE, getModuleType } from '@opentrons/shared-data'
12
import { getLoadedModule } from './getLoadedModule'
23

34
import type { LoadedModules } from './types'
@@ -7,5 +8,12 @@ export function getModuleDisplayLocation(
78
moduleId: string
89
): string {
910
const loadedModule = getLoadedModule(loadedModules, moduleId)
10-
return loadedModule != null ? loadedModule.location.slotName : ''
11+
if (loadedModule == null) {
12+
console.warn(`Module with ID ${moduleId} not found in loaded modules`)
13+
return ''
14+
}
15+
const slotName = loadedModule.location.slotName
16+
return getModuleType(loadedModule.model) === FLEX_STACKER_MODULE_TYPE
17+
? `${slotName[0]}4`
18+
: slotName
1119
}

0 commit comments

Comments
 (0)