1
1
import * as React from 'react'
2
- import { useDispatch } from 'react-redux'
3
2
import { useTranslation } from 'react-i18next'
4
3
import isEqual from 'lodash/isEqual'
5
4
import { getCommand } from '@opentrons/api-client'
@@ -8,24 +7,19 @@ import {
8
7
getLabwareDefIsStandard ,
9
8
getLabwareDisplayName ,
10
9
IDENTITY_VECTOR ,
11
- THERMOCYCLER_MODULE_TYPE ,
12
10
} from '@opentrons/shared-data'
13
11
import {
14
12
useHost ,
15
13
useCreateLabwareDefinitionMutation ,
16
14
useCreateCommandMutation ,
17
15
} from '@opentrons/react-api-client'
18
16
import { useTrackEvent } from '../../../redux/analytics'
19
- import { sendModuleCommand } from '../../../redux/modules'
20
17
import {
21
18
useCurrentRunId ,
22
19
useCurrentRunCommands ,
23
20
useCurrentProtocol ,
24
21
} from '../../ProtocolUpload/hooks'
25
- import {
26
- useAttachedModules ,
27
- useProtocolDetailsForRun ,
28
- } from '../../Devices/hooks'
22
+ import { useProtocolDetailsForRun } from '../../Devices/hooks'
29
23
import { getLabwareLocation } from '../../Devices/ProtocolRun/utils/getLabwareLocation'
30
24
import { getModuleInitialLoadInfo } from '../../Devices/ProtocolRun/utils/getModuleInitialLoadInfo'
31
25
import { useSteps } from './useSteps'
@@ -256,9 +250,6 @@ export function useLabwarePositionCheck(
256
250
const host = useHost ( )
257
251
const trackEvent = useTrackEvent ( )
258
252
const LPCSteps = useSteps ( currentRunId )
259
- const dispatch = useDispatch ( )
260
- const robotName = host ?. robotName ?? ''
261
- const attachedModules = useAttachedModules ( )
262
253
263
254
const LPCCommands = LPCSteps . reduce < LabwarePositionCheckCreateCommand [ ] > (
264
255
( commands , currentStep ) => {
@@ -558,27 +549,13 @@ export function useLabwarePositionCheck(
558
549
559
550
// execute prep commands
560
551
prepCommands . forEach ( prepCommand => {
561
- // 11/18/21 intercept TCOpenLidCommand and use legacy modules endpoint
562
- // delete this once PE supports themocycler open lid command
563
- if ( prepCommand . commandType === 'thermocycler/openLid' ) {
564
- const serial = attachedModules . find (
565
- module => module . moduleType === THERMOCYCLER_MODULE_TYPE
566
- ) ?. serialNumber
567
- if ( serial == null ) {
568
- throw new Error (
569
- 'Expected to be able to find thermocycler serial number, but could not.'
570
- )
571
- }
572
- dispatch ( sendModuleCommand ( robotName , serial , 'open' ) )
573
- } else {
574
- createCommand ( {
575
- runId : currentRunId ,
576
- command : createCommandData ( prepCommand ) ,
577
- } ) . catch ( ( e : Error ) => {
578
- console . error ( `error issuing command to robot: ${ e . message } ` )
579
- setError ( e )
580
- } )
581
- }
552
+ createCommand ( {
553
+ runId : currentRunId ,
554
+ command : createCommandData ( prepCommand ) ,
555
+ } ) . catch ( ( e : Error ) => {
556
+ console . error ( `error issuing command to robot: ${ e . message } ` )
557
+ setError ( e )
558
+ } )
582
559
} )
583
560
// issue first movement command
584
561
createCommand ( {
0 commit comments