diff --git a/app/src/assets/localization/en/protocol_command_text.json b/app/src/assets/localization/en/protocol_command_text.json index f7eaf48e493..f026cd6e865 100644 --- a/app/src/assets/localization/en/protocol_command_text.json +++ b/app/src/assets/localization/en/protocol_command_text.json @@ -9,6 +9,7 @@ "deactivating_hs_heater": "Deactivating heater", "deactivating_tc_block": "Deactivating Thermocycler block", "deactivating_tc_lid": "Deactivating Thermocycler lid", + "degrees_c": "{{temp}}°C", "disengaging_magnetic_module": "Disengaging Magnetic Module", "dispense": "Dispensing {{volume}} µL into well {{well_name}} of {{labware}} in {{labware_location}} at {{flow_rate}} µL/sec", "drop_tip": "Dropping tip in {{well_name}} of {{labware}}", @@ -35,11 +36,12 @@ "pickup_tip": "Picking up tip from {{well_name}} of {{labware}} in {{labware_location}}", "save_position": "Saving position", "set_and_await_hs_shake": "Setting Heater-Shaker to shake at {{rpm}} rpm and waiting until reached", - "setting_hs_temp": "Setting Target Temperature of Heater-Shaker to {{temp}}°C", - "setting_temperature_module_temp": "Setting Temperature Module to {{temp}}°C (rounded to nearest integer)", - "setting_thermocycler_block_temp": "Setting Thermocycler block temperature to {{temp}}°C with hold time of {{hold_time_seconds}} seconds after target reached", - "setting_thermocycler_lid_temp": "Setting Thermocycler lid temperature to {{temp}}°C", + "setting_hs_temp": "Setting Target Temperature of Heater-Shaker to {{temp}}", + "setting_temperature_module_temp": "Setting Temperature Module to {{temp}} (rounded to nearest integer)", + "setting_thermocycler_block_temp": "Setting Thermocycler block temperature to {{temp}} with hold time of {{hold_time_seconds}} seconds after target reached", + "setting_thermocycler_lid_temp": "Setting Thermocycler lid temperature to {{temp}}", "slot": "Slot {{slot_name}}", + "target_temperature": "target temperature", "tc_awaiting_for_duration": "Waiting for Thermocycler profile to complete", "tc_run_profile_steps": "temperature: {{celsius}}°C, seconds: {{seconds}}", "tc_starting_profile": "Thermocycler starting {{repetitions}} repetitions of cycle composed of the following steps:", @@ -50,5 +52,5 @@ "waiting_for_hs_to_reach": "Waiting for Heater-Shaker to reach target temperature", "waiting_for_tc_block_to_reach": "Waiting for Thermocycler block to reach target temperature and holding for specified time", "waiting_for_tc_lid_to_reach": "Waiting for Thermocycler lid to reach target temperature", - "waiting_to_reach_temp_module": "Waiting for Temperature Module to reach {{temp}}°C (rounded to nearest integer)" + "waiting_to_reach_temp_module": "Waiting for Temperature Module to reach {{temp}}" } diff --git a/app/src/organisms/CommandText/TemperatureCommandText.tsx b/app/src/organisms/CommandText/TemperatureCommandText.tsx index 6512f36272b..5040092166f 100644 --- a/app/src/organisms/CommandText/TemperatureCommandText.tsx +++ b/app/src/organisms/CommandText/TemperatureCommandText.tsx @@ -34,7 +34,10 @@ export const TemperatureCommandText = ({ const { t } = useTranslation('protocol_command_text') return t(T_KEYS_BY_COMMAND_TYPE[command.commandType], { - temp: command.params.celsius, + temp: + command.params?.celsius != null + ? t('degrees_c', { temp: command.params.celsius }) + : t('target_temperature'), hold_time_seconds: 'holdTimeSeconds' in command.params ? command.params.holdTimeSeconds ?? '0' diff --git a/app/src/organisms/CommandText/__tests__/CommandText.test.tsx b/app/src/organisms/CommandText/__tests__/CommandText.test.tsx index 2ab867e91bc..42455079ebb 100644 --- a/app/src/organisms/CommandText/__tests__/CommandText.test.tsx +++ b/app/src/organisms/CommandText/__tests__/CommandText.test.tsx @@ -322,7 +322,7 @@ describe('CommandText', () => { )[0] getByText('Setting Temperature Module to 20°C (rounded to nearest integer)') }) - it('renders correct text for temperatureModule/waitForTemperature', () => { + it('renders correct text for temperatureModule/waitForTemperature with target temp', () => { const mockTemp = 20 const { getByText } = renderWithProviders( { i18nInstance: i18n, } )[0] - getByText( - 'Waiting for Temperature Module to reach 20°C (rounded to nearest integer)' - ) + getByText('Waiting for Temperature Module to reach 20°C') + }) + it('renders correct text for temperatureModule/waitForTemperature with no specified temp', () => { + const { getByText } = renderWithProviders( + , + { + i18nInstance: i18n, + } + )[0] + getByText('Waiting for Temperature Module to reach target temperature') }) it('renders correct text for thermocycler/setTargetBlockTemperature', () => { const mockTemp = 20 diff --git a/shared-data/protocol/types/schemaV7/command/module.ts b/shared-data/protocol/types/schemaV7/command/module.ts index 759a80de544..ff2787bfa25 100644 --- a/shared-data/protocol/types/schemaV7/command/module.ts +++ b/shared-data/protocol/types/schemaV7/command/module.ts @@ -88,10 +88,15 @@ export interface TemperatureModuleDeactivateRunTimeCommand TemperatureModuleDeactivateCreateCommand { result?: any } +export interface TemperatureModuleAwaitTemperatureParams { + // same params as TemperatureParams except celsius is optional + moduleId: string + celsius?: number +} export interface TemperatureModuleAwaitTemperatureCreateCommand extends CommonCommandCreateInfo { commandType: 'temperatureModule/waitForTemperature' - params: TemperatureParams + params: TemperatureModuleAwaitTemperatureParams } export interface TemperatureModuleAwaitTemperatureRunTimeCommand extends CommonCommandRunTimeInfo, diff --git a/step-generation/src/getNextRobotStateAndWarnings/temperatureUpdates.ts b/step-generation/src/getNextRobotStateAndWarnings/temperatureUpdates.ts index 591ae022ec1..f4650580eb0 100644 --- a/step-generation/src/getNextRobotStateAndWarnings/temperatureUpdates.ts +++ b/step-generation/src/getNextRobotStateAndWarnings/temperatureUpdates.ts @@ -6,9 +6,10 @@ import { TEMPERATURE_AT_TARGET, } from '../constants' import type { + TemperatureModuleAwaitTemperatureParams, TemperatureParams, ModuleOnlyParams, -} from '@opentrons/shared-data/protocol/types/schemaV6/command/module' +} from '@opentrons/shared-data/protocol/types/schemaV7/command/module' import type { InvariantContext, RobotStateAndWarnings, @@ -39,7 +40,7 @@ export function forSetTemperature( _setTemperatureAndStatus(moduleState, celsius, TEMPERATURE_APPROACHING_TARGET) } export function forAwaitTemperature( - params: TemperatureParams, + params: TemperatureModuleAwaitTemperatureParams, invariantContext: InvariantContext, robotStateAndWarnings: RobotStateAndWarnings ): void {