Skip to content

Commit

Permalink
fix up ot2 standard slot filter
Browse files Browse the repository at this point in the history
  • Loading branch information
b-cooper committed Nov 9, 2023
1 parent 3359a3b commit 9d0df27
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/src/hooks/useSelectDeckLocation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function DeckLocationSelect({
{deckDef.locations.addressableAreas
// only render standard slot fixture components
.filter(addressableArea =>
isAddressableAreaStandardSlot(addressableArea.id)
isAddressableAreaStandardSlot(addressableArea.id, deckDef)
)
.map(slot => {
const slotLocation = { slotName: slot.id }
Expand Down
10 changes: 8 additions & 2 deletions protocol-designer/src/components/DeckSetup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ export const DeckSetupContents = (props: ContentsProps): JSX.Element => {
])
: []

console.log('AA',
deckDef.locations.addressableAreas
.filter(
addressableArea =>
isAddressableAreaStandardSlot(addressableArea.id, deckDef)
))
return (
<>
{/* all modules */}
Expand Down Expand Up @@ -335,7 +341,7 @@ export const DeckSetupContents = (props: ContentsProps): JSX.Element => {
// only render standard slot fixture components
.filter(
addressableArea =>
isAddressableAreaStandardSlot(addressableArea.id) &&
isAddressableAreaStandardSlot(addressableArea.id, deckDef) &&
!slotIdsBlockedBySpanning.includes(addressableArea.id) &&
getSlotIsEmpty(activeDeckSetup, addressableArea.id) &&
addressableArea.id !== trashSlot
Expand Down Expand Up @@ -526,7 +532,7 @@ export const DeckSetup = (): JSX.Element => {
).filter(aE => aE.name === STAGING_AREA_LOAD_NAME)

const filteredAddressableAreas = deckDef.locations.addressableAreas.filter(
aa => isAddressableAreaStandardSlot(aa.id)
aa => isAddressableAreaStandardSlot(aa.id, deckDef)
)

return (
Expand Down
20 changes: 18 additions & 2 deletions shared-data/js/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ export function getFixtureDisplayName(loadName: FixtureLoadName): string {
}
}


const STANDARD_OT2_SLOTS = [
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10',
'11',
]

const STANDARD_FLEX_SLOTS = [
'A1',
'A2',
Expand All @@ -121,5 +136,6 @@ const STANDARD_FLEX_SLOTS = [
]

export const isAddressableAreaStandardSlot = (
addressableAreaId: string
): boolean => STANDARD_FLEX_SLOTS.includes(addressableAreaId)
addressableAreaId: string,
deckDef: DeckDefinition
): boolean => (deckDef.robot.model === FLEX_ROBOT_TYPE ? STANDARD_FLEX_SLOTS : STANDARD_OT2_SLOTS).includes(addressableAreaId)

0 comments on commit 9d0df27

Please sign in to comment.