Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions protocol-designer/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export const ABSORBANCE_READER_COLOR_BY_WAVELENGTH: Record<number, string> = {
650: 'Red',
}

// Values for flex stacker
export const FLEX_STACKER_RETRIEVE: 'retrieve' = 'retrieve'
export const FLEX_STACKER_STORE: 'store' = 'store'
export const FLEX_STACKER_FILL: 'fill' = 'fill'
export const FLEX_STACKER_EMPTY: 'empty' = 'empty'

export const OFFDECK: 'offDeck' = 'offDeck'

export const PROTOCOL_DESIGNER_SOURCE: 'Protocol Designer' = 'Protocol Designer' // protocolSource for tracking analytics in the app
Expand Down
27 changes: 21 additions & 6 deletions protocol-designer/src/form-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import type {
ABSORBANCE_READER_INITIALIZE_MODE_SINGLE,
ABSORBANCE_READER_LID,
ABSORBANCE_READER_READ,
FLEX_STACKER_EMPTY,
FLEX_STACKER_FILL,
FLEX_STACKER_RETRIEVE,
FLEX_STACKER_STORE,
PAUSE_UNTIL_RESUME,
PAUSE_UNTIL_TC_PROFILE_COMPLETE,
PAUSE_UNTIL_TEMP,
Expand Down Expand Up @@ -163,6 +167,7 @@ export type StepType =
| 'absorbanceReader'
| 'camera'
| 'comment'
| 'flexStacker'
| 'heaterShaker'
| 'magnet'
| 'manualIntervention'
Expand All @@ -178,16 +183,16 @@ export const stepIconsByType: Record<StepType, IconName> = {
absorbanceReader: 'ot-absorbance',
camera: 'camera',
comment: 'comment',
flexStacker: 'ot-flex-stacker',
heaterShaker: 'ot-heater-shaker',
magnet: 'ot-magnet-v2',
manualIntervention: 'pause-circle',
mix: 'mix',
moveLabware: 'ot-move',
moveLiquid: 'transfer',
mix: 'mix',
pause: 'pause-circle',
manualIntervention: 'pause-circle',
magnet: 'ot-magnet-v2',
temperature: 'ot-temperature-v2',
thermocycler: 'ot-thermocycler',
heaterShaker: 'ot-heater-shaker',
flexStacker: 'ot-flex-stacker',
}
// ===== Unprocessed form types =====
export interface AnnotationFields {
Expand Down Expand Up @@ -500,10 +505,19 @@ export interface HydratedAbsorbanceReaderFormData extends AnnotationFields {
wavelengths: string[]
}

// TODO(TZ, 2025-12-03): not fully flushed out, but this is the initial hydrated form data for the flex stacker form
export type FlexStackerFormType =
| typeof FLEX_STACKER_RETRIEVE
| typeof FLEX_STACKER_STORE
| typeof FLEX_STACKER_FILL
| typeof FLEX_STACKER_EMPTY

export interface HydratedFlexStackerFormData extends AnnotationFields {
stepType: 'flexStacker'
id: string
fillLabwareUri: string | null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these the only args to add to the form data?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think empty has a message

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the catch, i will rename this variable to be more generic

fillQuantity: number | null
flexStackerFormType: FlexStackerFormType | null
interventionMessage: string | null
moduleId: string
}

Expand Down Expand Up @@ -616,6 +630,7 @@ export type CountPerStepType = Partial<Record<StepType, number>>
export type HydratedFormData =
| HydratedAbsorbanceReaderFormData
| HydratedCameraFormData
| HydratedFlexStackerFormData
| HydratedCommentFormData
| HydratedHeaterShakerFormData
| HydratedMagnetFormData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,13 @@ export function getDefaultsForStepType(
referenceWavelengthActive: false,
wavelengths: [Object.keys(ABSORBANCE_READER_COLOR_BY_WAVELENGTH)[0]], // default to first known wavelength
}
// TODO(TZ, 2025-12-03): not fully flushed out, but this is the initial state for the flex stacker form
case 'flexStacker':
return {
fillLabwareUri: null,
fillQuantity: null,
flexStackerFormType: null,
interventionMessage: null,
moduleId: null,
labwareInHopper: null,
labwareOnShuttle: null,
maxPoolCount: 0,
storedLabwareDetails: null,
}
default:
return {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,15 @@ describe('getDefaultsForStepType', () => {
expect(getDefaultsForStepType('')).toEqual({})
})
})
describe('flex stacker step', () => {
it('should get the correct defaults', () => {
expect(getDefaultsForStepType('flexStacker')).toEqual({
fillLabwareUri: null,
fillQuantity: null,
flexStackerFormType: null,
interventionMessage: null,
moduleId: null,
})
})
})
})
Loading