diff --git a/shared-data/command/types/setup.ts b/shared-data/command/types/setup.ts index 1836f9cb93c..fdc98fb60e0 100644 --- a/shared-data/command/types/setup.ts +++ b/shared-data/command/types/setup.ts @@ -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 @@ -109,6 +118,7 @@ export type SetupRunTimeCommand = | MoveLabwareRunTimeCommand | LoadLidRunTimeCommand | LoadLidStackRunTimeCommand + | MoveLidCreateCommand export type SetupCreateCommand = | ConfigureNozzleLayoutCreateCommand @@ -120,6 +130,7 @@ export type SetupCreateCommand = | MoveLabwareCreateCommand | LoadLidCreateCommand | LoadLidRunTimeCommand + | MoveLidRunTimeCommand export type LabwareLocation = | 'offDeck' @@ -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 diff --git a/shared-data/js/helpers/getAddressableAreasInProtocol.ts b/shared-data/js/helpers/getAddressableAreasInProtocol.ts index 81222777db2..b97d5f43cc8 100644 --- a/shared-data/js/helpers/getAddressableAreasInProtocol.ts +++ b/shared-data/js/helpers/getAddressableAreasInProtocol.ts @@ -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) @@ -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) @@ -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)