Skip to content

Commit

Permalink
Add move lid command, update getAddressableAreasForProtocol
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Jan 15, 2025
1 parent a61b745 commit 7aa2aa6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
20 changes: 19 additions & 1 deletion shared-data/command/types/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ export interface MoveLabwareRunTimeCommand
MoveLabwareCreateCommand {
result?: MoveLabwareResult
}
export interface MoveLidCreateCommand extends CommonCommandCreateInfo {
commandType: 'moveLid'
params: MoveLidParams
}
export interface MoveLidRunTimeCommand
extends CommonCommandRunTimeInfo,
MoveLidCreateCommand {
result?: MoveLidResult
}
export interface LoadModuleCreateCommand extends CommonCommandCreateInfo {
commandType: 'loadModule'
params: LoadModuleParams
Expand Down Expand Up @@ -109,6 +118,7 @@ export type SetupRunTimeCommand =
| MoveLabwareRunTimeCommand
| LoadLidRunTimeCommand
| LoadLidStackRunTimeCommand
| MoveLidCreateCommand

export type SetupCreateCommand =
| ConfigureNozzleLayoutCreateCommand
Expand All @@ -120,6 +130,7 @@ export type SetupCreateCommand =
| MoveLabwareCreateCommand
| LoadLidCreateCommand
| LoadLidRunTimeCommand
| MoveLidRunTimeCommand

export type LabwareLocation =
| 'offDeck'
Expand Down Expand Up @@ -184,7 +195,14 @@ export interface MoveLabwareParams {
interface MoveLabwareResult {
offsetId: string
}

interface MoveLidParams {
labwareId: string
newLocation: LabwareLocation
strategy: LabwareMovementStrategy
}
interface MoveLidResult {
offsetId: string
}
interface LoadModuleParams {
moduleId?: string
location: ModuleLocation
Expand Down
12 changes: 8 additions & 4 deletions shared-data/js/helpers/getAddressableAreasInProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function getAddressableAreasInProtocol(
(acc, command) => {
const { commandType, params } = command
if (
commandType === 'moveLabware' &&
(commandType === 'moveLabware' || commandType === 'moveLid') &&
params.newLocation !== 'offDeck' &&
'slotName' in params.newLocation &&
!acc.includes(params.newLocation.slotName as AddressableAreaName)
Expand All @@ -33,14 +33,16 @@ export function getAddressableAreasInProtocol(
return [...acc, addressableAreaName]
}
} else if (
commandType === 'moveLabware' &&
(commandType === 'moveLabware' || commandType === 'moveLid') &&
params.newLocation !== 'offDeck' &&
'addressableAreaName' in params.newLocation &&
!acc.includes(params.newLocation.addressableAreaName)
) {
return [...acc, params.newLocation.addressableAreaName]
} else if (
commandType === 'loadLabware' &&
(commandType === 'loadLabware' ||
commandType === 'loadLid' ||
commandType === 'loadLidStack') &&
params.location !== 'offDeck' &&
'slotName' in params.location &&
!acc.includes(params.location.slotName as AddressableAreaName)
Expand Down Expand Up @@ -72,7 +74,9 @@ export function getAddressableAreasInProtocol(

return [...acc, ...addressableAreaNames]
} else if (
commandType === 'loadLabware' &&
(commandType === 'loadLabware' ||
commandType === 'loadLid' ||
commandType === 'loadLidStack') &&
params.location !== 'offDeck' &&
'addressableAreaName' in params.location &&
!acc.includes(params.location.addressableAreaName)
Expand Down

0 comments on commit 7aa2aa6

Please sign in to comment.