Skip to content

Commit

Permalink
fix(protocol-designer): ot-2 TC labware highlight in protocol steps (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader authored Jan 13, 2025
1 parent cec46ef commit 8ed9feb
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions protocol-designer/src/pages/Designer/DeckSetup/HighlightItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
STANDARD_FLEX_SLOTS,
STANDARD_OT2_SLOTS,
THERMOCYCLER_MODULE_TYPE,
THERMOCYCLER_MODULE_V2,
WASTE_CHUTE_CUTOUT,
getAddressableAreaFromSlotId,
getPositionFromSlotId,
Expand All @@ -26,6 +27,7 @@ import type {
DeckDefinition,
CutoutId,
AddressableAreaName,
CoordinateTuple,
} from '@opentrons/shared-data'
import type { LabwareOnDeck, ModuleOnDeck } from '../../../step-forms'
import type { Fixture } from './constants'
Expand All @@ -34,6 +36,10 @@ interface HighlightItemsProps {
deckDef: DeckDefinition
robotType: RobotType
}
// TODO(ja, 1/13/25): get actual coordinates from thermocycler and deck definitions
const FLEX_TC_POSITION: CoordinateTuple = [-20, 282, 0]
const OT2_TC_GEN_1_POSITION: CoordinateTuple = [0, 264, 0]
const OT2_TC_GEN_2_POSITION: CoordinateTuple = [0, 250, 0]

const SLOTS = [
...STANDARD_FLEX_SLOTS,
Expand Down Expand Up @@ -120,9 +126,9 @@ export function HighlightItems(props: HighlightItemsProps): JSX.Element | null {
}

let labwareSlot = labwareOnDeck.slot
const hasTC = Object.values(modules).some(
const tcModel = Object.values(modules).find(
module => module.type === THERMOCYCLER_MODULE_TYPE
)
)?.model

if (modules[labwareSlot]) {
labwareSlot = modules[labwareSlot].slot
Expand All @@ -133,16 +139,22 @@ export function HighlightItems(props: HighlightItemsProps): JSX.Element | null {

const position = getPositionFromSlotId(labwareSlot, deckDef)
if (position != null) {
let tcPosition: CoordinateTuple = FLEX_TC_POSITION
if (labwareSlot === '7') {
tcPosition =
tcModel === THERMOCYCLER_MODULE_V2
? OT2_TC_GEN_2_POSITION
: OT2_TC_GEN_1_POSITION
}

items.push(
<LabwareLabel
key={`${labwareOnDeck.id}_${index}`}
isSelected={selectedItemLabwares.some(
selected => selected.id === labwareOnDeck.id
)}
isLast={true}
position={
hasTC && labwareSlot === 'B1' ? [-20, 282, 0] : position
}
position={tcModel != null ? tcPosition : position}
labwareDef={labwareOnDeck.def}
labelText={
hoveredItemLabware == null
Expand Down

0 comments on commit 8ed9feb

Please sign in to comment.