1
1
import { useState } from 'react'
2
2
import { useTranslation } from 'react-i18next'
3
- import { useSelector } from 'react-redux'
4
3
import { round } from 'lodash'
5
4
6
5
import { DropdownMenu } from '@opentrons/components'
@@ -10,19 +9,9 @@ import {
10
9
POSITION_REFERENCE_TOP ,
11
10
} from '@opentrons/shared-data'
12
11
13
- import { getRobotType } from '../../../file-data/selectors'
14
- import {
15
- getAdditionalEquipmentEntities ,
16
- getLabwareEntities ,
17
- getPipetteEntities ,
18
- } from '../../../step-forms/selectors'
19
- import { getLiquidClassesValues } from '../../../steplist/formLevel/handleFormChange/utils'
20
-
21
12
import type { Dispatch , SetStateAction } from 'react'
22
13
import type { DropdownOption } from '@opentrons/components'
23
- import type { PositionReference , WellLocation } from '@opentrons/shared-data'
24
- import type { FormData } from '../../../form-types'
25
- import type { MoveLiquidPrefixType } from '../../../resources/types'
14
+ import type { PositionReference } from '@opentrons/shared-data'
26
15
27
16
interface UsePositionReferenceResult {
28
17
positionReferenceDropdown : JSX . Element
@@ -123,33 +112,3 @@ export function usePositionReference(args: {
123
112
setReference,
124
113
}
125
114
}
126
-
127
- export function useDefaultPosition (
128
- formData : FormData | null ,
129
- prefix : MoveLiquidPrefixType
130
- ) : WellLocation {
131
- const pipetteEntities = useSelector ( getPipetteEntities )
132
- const labwareEntities = useSelector ( getLabwareEntities )
133
- const additionalEquipmentEntities = useSelector (
134
- getAdditionalEquipmentEntities
135
- )
136
- const robotType = useSelector ( getRobotType )
137
- if ( formData == null ) {
138
- return { }
139
- }
140
- const liquidClassDefaultValues = getLiquidClassesValues ( {
141
- rawForm : formData ,
142
- pipetteEntities,
143
- labwareEntities,
144
- additionalEquipmentEntities,
145
- robotType,
146
- } )
147
- return {
148
- origin : liquidClassDefaultValues [ `${ prefix } _position_reference` ] ,
149
- offset : {
150
- x : liquidClassDefaultValues [ `${ prefix } _x_position` ] ,
151
- y : liquidClassDefaultValues [ `${ prefix } _y_position` ] ,
152
- z : liquidClassDefaultValues [ `${ prefix } _mmFromBottom` ] ,
153
- } ,
154
- }
155
- }
0 commit comments