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): add skeleton for plate reader steps #17158

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions protocol-designer/src/form-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export type StepType =
| 'pause'
| 'temperature'
| 'thermocycler'
| 'plateReader'

export const stepIconsByType: Record<StepType, IconName> = {
comment: 'comment',
Expand All @@ -155,6 +156,7 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
MoveLabwareTools,
MoveLiquidTools,
PauseTools,
PlateReaderTools,
TemperatureTools,
ThermocyclerTools,
} from './StepTools'
Expand Down Expand Up @@ -84,6 +85,7 @@ const STEP_FORM_MAP: StepFormMap = {
thermocycler: ThermocyclerTools,
heaterShaker: HeaterShakerTools,
comment: CommentTools,
plateReader: PlateReaderTools,
}

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

export function PlateReaderTools(props: StepFormProps): JSX.Element {
return <div>TODO: ADD PLATE READER TOOLS</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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 @@ -17,6 +17,7 @@ import {
SecondaryButton,
} from '@opentrons/components'
import {
ABSORBANCE_READER_TYPE,
HEATERSHAKER_MODULE_TYPE,
MAGNETIC_MODULE_TYPE,
TEMPERATURE_MODULE_TYPE,
Expand All @@ -35,7 +36,10 @@ import {
ConfirmDeleteModal,
getMainPagePortalEl,
} from '../../../../organisms'
import { getEnableComment } from '../../../../feature-flags/selectors'
import {
getEnableAbsorbanceReader,
getEnableComment,
} from '../../../../feature-flags/selectors'

import { AddStepOverflowButton } from './AddStepOverflowButton'

Expand Down Expand Up @@ -71,32 +75,22 @@ export function AddStepButton(): JSX.Element {
const [enqueuedStepType, setEnqueuedStepType] = useState<StepType | null>(
null
)
const enableAbsorbanceReader = useSelector(getEnableAbsorbanceReader)

const getSupportedSteps = (): Array<
Exclude<StepType, 'manualIntervention'>
> =>
enableComment
? [
'comment',
'moveLabware',
'moveLiquid',
'mix',
'pause',
'heaterShaker',
'magnet',
'temperature',
'thermocycler',
]
: [
'moveLabware',
'moveLiquid',
'mix',
'pause',
'heaterShaker',
'magnet',
'temperature',
'thermocycler',
]
> => [
'comment',
'moveLabware',
'moveLiquid',
'mix',
'pause',
'heaterShaker',
'magnet',
'temperature',
'thermocycler',
'plateReader',
]
const isStepTypeEnabled: Record<
Exclude<StepType, 'manualIntervention'>,
boolean
Expand All @@ -110,6 +104,9 @@ export function AddStepButton(): JSX.Element {
temperature: getIsModuleOnDeck(modules, TEMPERATURE_MODULE_TYPE),
thermocycler: getIsModuleOnDeck(modules, THERMOCYCLER_MODULE_TYPE),
heaterShaker: getIsModuleOnDeck(modules, HEATERSHAKER_MODULE_TYPE),
plateReader:
getIsModuleOnDeck(modules, ABSORBANCE_READER_TYPE) &&
enableAbsorbanceReader,
}

const addStep = (stepType: StepType): ReturnType<any> =>
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 @@ -209,6 +209,7 @@ const MAGNETIC_BLOCK_INITIAL_STATE: MagneticBlockState = {
}
const ABSORBANCE_READER_INITIAL_STATE: AbsorbanceReaderState = {
type: ABSORBANCE_READER_TYPE,
lidOpen: null,
}

const _getInitialDeckSetup = (
Expand Down
1 change: 1 addition & 0 deletions protocol-designer/src/step-forms/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export interface MagneticBlockState {
}
export interface AbsorbanceReaderState {
type: typeof ABSORBANCE_READER_TYPE
lidOpen: boolean | null
Copy link
Collaborator

Choose a reason for hiding this comment

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

null means we don't know what the lid state is?

Copy link
Collaborator Author

@ncdiehl11 ncdiehl11 Dec 20, 2024

Choose a reason for hiding this comment

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

yes, at the beginning of the protocol, since the lid state is unknown (Schrodingers lid). We follow this paradigm for HS latch and TC lid

}
export interface ModuleTemporalProperties {
slot: DeckSlot
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 @@ -58,6 +58,7 @@ export const HEATERSHAKER_MODULE_INITIAL_STATE: HeaterShakerModuleState = {

const ABSORBANCE_READER_INITIAL_STATE: AbsorbanceReaderState = {
type: 'absorbanceReaderType',
lidOpen: null,
}
const MAGNETIC_BLOCK_INITIAL_STATE: MagneticBlockState = {
type: 'magneticBlockType',
Expand Down
1 change: 1 addition & 0 deletions step-generation/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export interface MagneticBlockState {

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

export type ModuleState =
Expand Down
Loading