@@ -22,11 +22,20 @@ import {
22
22
} from '@opentrons/components'
23
23
import { useModulesQuery } from '@opentrons/react-api-client'
24
24
import {
25
+ FAKE_STAGING_AREA_RIGHT_SLOT ,
25
26
FLEX_ROBOT_TYPE ,
27
+ FLEX_STACKER_FIXTURES ,
28
+ getAAByAAId ,
29
+ getAADisplayName ,
30
+ getAASlotNameForAA ,
26
31
getCutoutDisplayName ,
27
32
getDeckDefFromRobotType ,
33
+ getDeckDefWithFakes ,
28
34
getFixtureDisplayName ,
35
+ replaceFixtureToFakeFixtureAndTransformCutoutFixturesToAA ,
36
+ SINGLE_RIGHT_CUTOUTS ,
29
37
SINGLE_SLOT_FIXTURES ,
38
+ STAGING_AREA_RIGHT_SLOT_FIXTURE ,
30
39
} from '@opentrons/shared-data'
31
40
32
41
import { useIsRobotViewable } from '/app/redux-resources/robots'
@@ -67,6 +76,10 @@ export function DeviceDetailsDeckConfiguration({
67
76
useNotifyDeckConfigurationQuery ( {
68
77
refetchInterval : DECK_CONFIG_REFETCH_INTERVAL ,
69
78
} ) . data ?? [ ]
79
+
80
+ const deckConfigWithAA = replaceFixtureToFakeFixtureAndTransformCutoutFixturesToAA (
81
+ deckConfig
82
+ )
70
83
const deckDef = getDeckDefFromRobotType ( FLEX_ROBOT_TYPE )
71
84
const { isRunRunning } = useRunStatuses ( )
72
85
const { data : maintenanceRunData } = useNotifyCurrentMaintenanceRun ( {
@@ -83,14 +96,17 @@ export function DeviceDetailsDeckConfiguration({
83
96
} = useDeckConfigurationEditingTools ( false )
84
97
85
98
// do not show standard slot in fixture display list
86
- const { displayList : fixtureDisplayList } = deckConfig . reduce < {
99
+ const { displayList : fixtureDisplayList } = deckConfigWithAA . reduce < {
87
100
displayList : Array < { displayLocation : string ; displayName : string } >
88
101
groupedCutoutIds : CutoutId [ ]
89
102
} > (
90
- ( acc , { cutoutId, cutoutFixtureId, opentronsModuleSerialNumber } ) => {
103
+ ( acc , { cutoutId, cutoutFixtureId, opentronsModuleSerialNumber, addressableAreaId } ) => {
104
+ const areaInCheck = getAAByAAId ( addressableAreaId , deckDef )
105
+ const shouldShow = areaInCheck . areaType != 'slot' && areaInCheck . areaType != 'stagingSlot'
91
106
if (
92
107
cutoutFixtureId == null ||
93
108
SINGLE_SLOT_FIXTURES . includes ( cutoutFixtureId )
109
+ || FAKE_STAGING_AREA_RIGHT_SLOT === cutoutFixtureId || ! shouldShow
94
110
) {
95
111
return acc
96
112
}
@@ -102,9 +118,11 @@ export function DeviceDetailsDeckConfiguration({
102
118
? `${ usbPort . port } .${ usbPort . hubPort } `
103
119
: usbPort ?. port
104
120
const displayName = getFixtureDisplayName ( cutoutFixtureId , portDisplay )
121
+ console . log ( "displayName: " , displayName )
105
122
const fixtureGroup =
106
123
deckDef . cutoutFixtures . find ( cf => cf . id === cutoutFixtureId )
107
124
?. fixtureGroup ?? { }
125
+ const name = getAASlotNameForAA ( cutoutId , cutoutFixtureId , addressableAreaId )
108
126
if ( cutoutId in fixtureGroup ) {
109
127
const groupMap =
110
128
fixtureGroup [ cutoutId ] ?. find ( group =>
@@ -117,11 +135,14 @@ export function DeviceDetailsDeckConfiguration({
117
135
) ?? { }
118
136
const groupedCutoutIds = Object . keys ( groupMap ) as CutoutId [ ]
119
137
const displayLocation = getDisplayLocationForCutoutIds ( groupedCutoutIds )
138
+ console . log ( "displayLocation: " , displayLocation
139
+ )
120
140
if ( acc . groupedCutoutIds . includes ( cutoutId ) ) {
121
141
return acc // only list grouped fixtures once
122
142
} else {
143
+ console . log ( "in elsse" )
123
144
return {
124
- displayList : [ ...acc . displayList , { displayLocation, displayName } ] ,
145
+ displayList : [ ...acc . displayList , { displayLocation : ( name ?? displayLocation ) , displayName } ] ,
125
146
groupedCutoutIds : [ ...acc . groupedCutoutIds , ...groupedCutoutIds ] ,
126
147
}
127
148
}
@@ -131,7 +152,7 @@ export function DeviceDetailsDeckConfiguration({
131
152
displayList : [
132
153
...acc . displayList ,
133
154
{
134
- displayLocation : getDisplayLocationForCutoutIds ( [ cutoutId ] ) ,
155
+ displayLocation : name ? name . replace ( 'fake' , '' ) : getDisplayLocationForCutoutIds ( [ cutoutId ] ) ,
135
156
displayName,
136
157
} ,
137
158
] ,
0 commit comments