Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(protocol-designer,-step-generation): update plate reader types and introduce step form #17263

Merged
merged 5 commits into from
Jan 14, 2025
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
5 changes: 5 additions & 0 deletions protocol-designer/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,8 @@ export const STAGING_AREA_CUTOUTS_ORDERED: CutoutId[] = [
'cutoutD3',
'cutoutA3',
]
export const ABSORBANCE_READER_INITIALIZE_MODE_SINGLE = 'single'
export const ABSORBANCE_READER_INITIALIZE_MODE_MULTI = 'multi'
export const ABSORBANCE_READER_INITIALIZE: 'initialize' = 'initialize'
export const ABSORBANCE_READER_READ: 'read' = 'read'
export const ABSORBANCE_READER_LID: 'lid' = 'lid'
24 changes: 22 additions & 2 deletions protocol-designer/src/form-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import type {
ABSORBANCE_READER_INITIALIZE,
ABSORBANCE_READER_INITIALIZE_MODE_MULTI,
ABSORBANCE_READER_INITIALIZE_MODE_SINGLE,
ABSORBANCE_READER_LID,
ABSORBANCE_READER_READ,
PAUSE_UNTIL_RESUME,
PAUSE_UNTIL_TEMP,
PAUSE_UNTIL_TIME,
Expand Down Expand Up @@ -133,6 +138,7 @@ export type StepFieldName = string

// TODO Ian 2019-01-16 factor out to some constants.js ? See #2926
export type StepType =
| 'absorbanceReader'
| 'comment'
| 'heaterShaker'
| 'magnet'
Expand All @@ -143,9 +149,9 @@ export type StepType =
| 'pause'
| 'temperature'
| 'thermocycler'
| 'plateReader'

export const stepIconsByType: Record<StepType, IconName> = {
absorbanceReader: 'ot-absorbance',
comment: 'comment',
moveLabware: 'ot-move',
moveLiquid: 'transfer',
Expand All @@ -156,7 +162,6 @@ export const stepIconsByType: Record<StepType, IconName> = {
temperature: 'ot-temperature-v2',
thermocycler: 'ot-thermocycler',
heaterShaker: 'ot-heater-shaker',
plateReader: 'ot-absorbance',
}
// ===== Unprocessed form types =====
export interface AnnotationFields {
Expand Down Expand Up @@ -374,6 +379,21 @@ export interface HydratedHeaterShakerFormData {
targetHeaterShakerTemperature: string | null
targetSpeed: string | null
}
export interface HydratedAbsorbanceReaderFormData {
absorbanceReaderFormType:
| typeof ABSORBANCE_READER_INITIALIZE
| typeof ABSORBANCE_READER_READ
| typeof ABSORBANCE_READER_LID
filePath: string | null
lidOpen: boolean | null
mode:
| typeof ABSORBANCE_READER_INITIALIZE_MODE_MULTI
| typeof ABSORBANCE_READER_INITIALIZE_MODE_SINGLE
| null
moduleId: string
referenceWavelength: number | null
wavelengths: number[] | null
}
// TODO: Ian 2019-01-17 Moving away from this and towards nesting all form fields
// inside `fields` key, but deprecating transfer/consolidate/distribute is a pre-req
export type HydratedMoveLiquidFormDataLegacy = AnnotationFields &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ import {
FORM_WARNINGS_EVENT,
} from '../../../../analytics/constants'
import {
AbsorbanceReaderTools,
CommentTools,
HeaterShakerTools,
MagnetTools,
MixTools,
MoveLabwareTools,
MoveLiquidTools,
PauseTools,
PlateReaderTools,
TemperatureTools,
ThermocyclerTools,
} from './StepTools'
Expand Down Expand Up @@ -87,7 +87,7 @@ const STEP_FORM_MAP: StepFormMap = {
thermocycler: ThermocyclerTools,
heaterShaker: HeaterShakerTools,
comment: CommentTools,
plateReader: PlateReaderTools,
absorbanceReader: AbsorbanceReaderTools,
}

interface StepFormToolboxProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { StepFormProps } from '../../types'

export function PlateReaderTools(props: StepFormProps): JSX.Element {
export function AbsorbanceReaderTools(props: StepFormProps): JSX.Element {
return <div>TODO: ADD PLATE READER TOOLS</div>
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export { AbsorbanceReaderTools } from './AbsorbanceReaderTools'
export { CommentTools } from './CommentTools'
export { HeaterShakerTools } from './HeaterShakerTools'
export { MagnetTools } from './MagnetTools'
export { MixTools } from './MixTools'
export { MoveLabwareTools } from './MoveLabwareTools'
export { MoveLiquidTools } from './MoveLiquidTools'
export { PlateReaderTools } from './PlateReaderTools'
export { PauseTools } from './PauseTools'
export { TemperatureTools } from './TemperatureTools'
export { ThermocyclerTools } from './ThermocyclerTools'
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export function AddStepButton({ hasText }: AddStepButtonProps): JSX.Element {
const getSupportedSteps = (): Array<
Exclude<StepType, 'manualIntervention'>
> => [
'absorbanceReader',
'comment',
'moveLabware',
'moveLiquid',
Expand All @@ -101,7 +102,6 @@ export function AddStepButton({ hasText }: AddStepButtonProps): JSX.Element {
'magnet',
'temperature',
'thermocycler',
'plateReader',
]
const isStepTypeEnabled: Record<
Exclude<StepType, 'manualIntervention'>,
Expand All @@ -116,7 +116,7 @@ export function AddStepButton({ hasText }: AddStepButtonProps): JSX.Element {
temperature: getIsModuleOnDeck(modules, TEMPERATURE_MODULE_TYPE),
thermocycler: getIsModuleOnDeck(modules, THERMOCYCLER_MODULE_TYPE),
heaterShaker: getIsModuleOnDeck(modules, HEATERSHAKER_MODULE_TYPE),
plateReader:
absorbanceReader:
getIsModuleOnDeck(modules, ABSORBANCE_READER_TYPE) &&
enableAbsorbanceReader,
}
Expand Down
1 change: 1 addition & 0 deletions protocol-designer/src/step-forms/selectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const MAGNETIC_BLOCK_INITIAL_STATE: MagneticBlockState = {
const ABSORBANCE_READER_INITIAL_STATE: AbsorbanceReaderState = {
type: ABSORBANCE_READER_TYPE,
lidOpen: null,
initialization: null,
}

const _getInitialDeckSetup = (
Expand Down
7 changes: 7 additions & 0 deletions protocol-designer/src/step-forms/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,16 @@ export interface HeaterShakerModuleState {
export interface MagneticBlockState {
type: typeof MAGNETIC_BLOCK_TYPE
}
export interface Initialization {
mode: 'single' | 'multi'
wavelengths: number[]
referenceWavelength?: number
}

export interface AbsorbanceReaderState {
type: typeof ABSORBANCE_READER_TYPE
lidOpen: boolean | null
initialization: Initialization | null
}
export interface ModuleTemporalProperties {
slot: DeckSlot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,16 @@ export function getDefaultsForStepType(
profileVolume: null,
thermocyclerFormType: 'thermocyclerState',
}

case 'absorbanceReader':
return {
absorbanceReaderFormType: 'initialize',
filePath: null,
lidOpen: null,
mode: null,
moduleId: null,
referenceWavelength: null,
wavelengths: null,
}
default:
return {}
}
Expand Down
4 changes: 2 additions & 2 deletions step-generation/src/commandCreators/atomic/moveLabware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const moveLabware: CommandCreator<MoveLabwareArgs> = (
initialModuleState.type === ABSORBANCE_READER_TYPE &&
initialModuleState.lidOpen !== true
) {
errors.push(errorCreators.plateReaderLidClosed())
errors.push(errorCreators.absorbanceReaderLidClosed())
}
}
const destModuleId =
Expand Down Expand Up @@ -181,7 +181,7 @@ export const moveLabware: CommandCreator<MoveLabwareArgs> = (
}
} else if (destModuleState.type === ABSORBANCE_READER_TYPE) {
if (destModuleState.lidOpen !== true) {
errors.push(errorCreators.plateReaderLidClosed())
errors.push(errorCreators.absorbanceReaderLidClosed())
}
}
}
Expand Down
1 change: 1 addition & 0 deletions step-generation/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const HEATERSHAKER_MODULE_INITIAL_STATE: HeaterShakerModuleState = {
const ABSORBANCE_READER_INITIAL_STATE: AbsorbanceReaderState = {
type: 'absorbanceReaderType',
lidOpen: null,
initialization: null,
}
const MAGNETIC_BLOCK_INITIAL_STATE: MagneticBlockState = {
type: 'magneticBlockType',
Expand Down
4 changes: 2 additions & 2 deletions step-generation/src/errorCreators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ export const heaterShakerLatchClosed = (): CommandCreatorError => {
}
}

export const plateReaderLidClosed = (): CommandCreatorError => {
export const absorbanceReaderLidClosed = (): CommandCreatorError => {
return {
type: 'PLATE_READER_LID_CLOSED',
type: 'ABSORBANCE_READER_LID_CLOSED',
message:
'Attempted to interact with contents of an absorbance reader with the lid closed.',
}
Expand Down
9 changes: 8 additions & 1 deletion step-generation/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,16 @@ export interface MagneticBlockState {
type: typeof MAGNETIC_BLOCK_TYPE
}

export interface Initialization {
mode: 'single' | 'multi'
wavelengths: number[]
referenceWavelength?: number
}

export interface AbsorbanceReaderState {
type: typeof ABSORBANCE_READER_TYPE
lidOpen: boolean | null
initialization: Initialization | null
}

export type ModuleState =
Expand Down Expand Up @@ -532,6 +539,7 @@ export interface TimelineFrame {
export type RobotState = TimelineFrame // legacy name alias

export type ErrorType =
| 'ABSORBANCE_READER_LID_CLOSED'
| 'CANNOT_MOVE_WITH_GRIPPER'
| 'DROP_TIP_LOCATION_DOES_NOT_EXIST'
| 'EQUIPMENT_DOES_NOT_EXIST'
Expand Down Expand Up @@ -560,7 +568,6 @@ export type ErrorType =
| 'PIPETTE_HAS_TIP'
| 'PIPETTE_VOLUME_EXCEEDED'
| 'PIPETTING_INTO_COLUMN_4'
| 'PLATE_READER_LID_CLOSED'
| 'POSSIBLE_PIPETTE_COLLISION'
| 'REMOVE_96_CHANNEL_TIPRACK_ADAPTER'
| 'TALL_LABWARE_EAST_WEST_OF_HEATER_SHAKER'
Expand Down
Loading