Skip to content

Commit

Permalink
feat(app): adding support for v6 commands in run log
Browse files Browse the repository at this point in the history
fix #11247
  • Loading branch information
smb2268 committed Jul 28, 2022
1 parent 6d7e83b commit 80304fb
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/assets/localization/en/run_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,9 @@
"latching_hs_latch": "Latching labware on Heater-Shaker",
"deactivate_hs_shake": "Deactivating shaker",
"wait_for_duration": "Pause for {{seconds}} seconds",
"tc_run_profile_steps": "temperature: {{celsius}}°C, seconds: {{seconds}}"
"tc_run_profile_steps": "temperature: {{celsius}}°C, seconds: {{seconds}}",
"aspirate": "Aspirating {{volume}} uL from {{well_name}} of {{labware}} in {{labware_location}} at {{flowRate}} uL/sec",
"dispense": "Dispensing {{volume}} uL into {{well_name}} of {{labware}} in {{labware_location}} at {{flowRate}} uL/sec",
"blowout": "Blowing out at {{well_name}} of {{labware}} in {{labware_location}} at {{flowRate}} uL/sec",
"touch_tip": "Touching tip"
}
76 changes: 76 additions & 0 deletions app/src/organisms/Devices/ProtocolRun/StepText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,82 @@ export function StepText(props: Props): JSX.Element | null {
messageNode = t('wait_for_duration', { seconds: seconds })
break
}
case 'aspirate': {
const { wellName, labwareId, volume, flowRate } = displayCommand.params
const labwareLocation = getLabwareLocation(
labwareId,
protocolData.commands
)
messageNode = (
<Trans
t={t}
i18nKey={'aspirate'}
values={{
well_name: wellName,
labware: getLabwareDisplayName(
labwareRenderInfoById[labwareId].labwareDef
),
labware_location: labwareLocation.slotName,
volume: volume,
flowRate: flowRate,
}}
/>
)

break
}
case 'dispense': {
const { wellName, labwareId, volume, flowRate } = displayCommand.params
const labwareLocation = getLabwareLocation(
labwareId,
protocolData.commands
)
messageNode = (
<Trans
t={t}
i18nKey={'dispense'}
values={{
well_name: wellName,
labware: getLabwareDisplayName(
labwareRenderInfoById[labwareId].labwareDef
),
labware_location: labwareLocation.slotName,
volume: volume,
flowRate: flowRate,
}}
/>
)

break
}
case 'blowout': {
const { wellName, labwareId, flowRate } = displayCommand.params
const labwareLocation = getLabwareLocation(
labwareId,
protocolData.commands
)
messageNode = (
<Trans
t={t}
i18nKey={'blowout'}
values={{
well_name: wellName,
labware: getLabwareDisplayName(
labwareRenderInfoById[labwareId].labwareDef
),
labware_location: labwareLocation.slotName,
flowRate: flowRate,
}}
/>
)

break
}
case 'touchTip': {
messageNode = t('touch_tip')
break
}

case 'custom': {
const { legacyCommandText } = displayCommand.params ?? {}
const sanitizedCommandText =
Expand Down
107 changes: 107 additions & 0 deletions app/src/organisms/Devices/ProtocolRun/__tests__/StepText.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -702,4 +702,111 @@ describe('StepText', () => {
})
getByText('Pause for 60 seconds')
})
it('renders correct command text for aspirate', () => {
const labwareId = 'labwareId'
when(mockGetLabwareDisplayName)
.calledWith('fake_def' as any)
.mockReturnValue('fake_display_name')
when(mockGetLabwareLocation)
.calledWith(labwareId, [])
.mockReturnValue({ slotName: 'fake_labware_location' })
mockUseLabwareRenderInfoForRunById.mockReturnValue({
labwareId: {
labwareDef: 'fake_def',
},
} as any)
const { getByText } = render({
robotName: ROBOT_NAME,
runId: RUN_ID,
analysisCommand: null,
runCommand: {
...MOCK_COMMAND_SUMMARY,
commandType: 'aspirate',
params: {
volume: 100,
flowRate: 130,
wellName: 'wellName',
labwareId: 'labwareId',
},
},
})
getByText(
'Aspirating 100 uL from wellName of fake_display_name in fake_labware_location at 130 uL/sec'
)
})
it('renders correct command text for dispense', () => {
const labwareId = 'labwareId'
when(mockGetLabwareDisplayName)
.calledWith('fake_def' as any)
.mockReturnValue('fake_display_name')
when(mockGetLabwareLocation)
.calledWith(labwareId, [])
.mockReturnValue({ slotName: 'fake_labware_location' })
mockUseLabwareRenderInfoForRunById.mockReturnValue({
labwareId: {
labwareDef: 'fake_def',
},
} as any)
const { getByText } = render({
robotName: ROBOT_NAME,
runId: RUN_ID,
analysisCommand: null,
runCommand: {
...MOCK_COMMAND_SUMMARY,
commandType: 'dispense',
params: {
volume: 100,
flowRate: 130,
wellName: 'wellName',
labwareId: 'labwareId',
},
},
})
getByText(
'Dispensing 100 uL into wellName of fake_display_name in fake_labware_location at 130 uL/sec'
)
})
it('renders correct command text for blowout', () => {
const labwareId = 'labwareId'
when(mockGetLabwareDisplayName)
.calledWith('fake_def' as any)
.mockReturnValue('fake_display_name')
when(mockGetLabwareLocation)
.calledWith(labwareId, [])
.mockReturnValue({ slotName: 'fake_labware_location' })
mockUseLabwareRenderInfoForRunById.mockReturnValue({
labwareId: {
labwareDef: 'fake_def',
},
} as any)
const { getByText } = render({
robotName: ROBOT_NAME,
runId: RUN_ID,
analysisCommand: null,
runCommand: {
...MOCK_COMMAND_SUMMARY,
commandType: 'blowout',
params: {
flowRate: 130,
wellName: 'wellName',
labwareId: 'labwareId',
},
},
})
getByText(
'Blowing out at wellName of fake_display_name in fake_labware_location at 130 uL/sec'
)
})
it('renders correct command text for touchTip', () => {
const { getByText } = render({
robotName: ROBOT_NAME,
runId: RUN_ID,
analysisCommand: null,
runCommand: {
...MOCK_COMMAND_SUMMARY,
commandType: 'touchTip',
},
})
getByText('Touching tip')
})
})

0 comments on commit 80304fb

Please sign in to comment.