File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
pages/Designer/ProtocolSteps/StepForm/PipetteFields
steplist/formLevel/handleFormChange Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 9
9
InputStepFormField ,
10
10
} from '../../../../../components/molecules'
11
11
import { selectors as stepFormSelectors } from '../../../../../step-forms'
12
- import { getMaxDisposalVolumeForMultidispense } from '../../../../../steplist/formLevel/handleFormChange/utils'
12
+ import { getMaxDisposalVolumeForMultiDispense } from '../../../../../steplist/formLevel/handleFormChange/utils'
13
13
import { selectors as uiLabwareSelectors } from '../../../../../ui/labware'
14
14
import { getBlowoutLocationOptionsForForm } from '../utils'
15
15
import { FlowRateField } from './FlowRateField'
@@ -26,7 +26,6 @@ interface DisposalFieldProps {
26
26
volume : string | null
27
27
aspirate_airGap_checkbox ?: boolean | null
28
28
aspirate_airGap_volume ?: string | null
29
- tipRack ?: string | null
30
29
}
31
30
32
31
export function DisposalField ( props : DisposalFieldProps ) : JSX . Element {
@@ -38,7 +37,6 @@ export function DisposalField(props: DisposalFieldProps): JSX.Element {
38
37
propsForFields,
39
38
aspirate_airGap_checkbox,
40
39
aspirate_airGap_volume,
41
- tipRack,
42
40
formData,
43
41
} = props
44
42
const { t } = useTranslation ( [ 'application' , 'form' ] )
@@ -49,7 +47,8 @@ export function DisposalField(props: DisposalFieldProps): JSX.Element {
49
47
path,
50
48
stepType,
51
49
} )
52
- const maxDisposalVolume = getMaxDisposalVolumeForMultidispense (
50
+ const tipRack = formData . tipRack
51
+ const maxDisposalVolume = getMaxDisposalVolumeForMultiDispense (
53
52
{
54
53
aspirate_airGap_checkbox,
55
54
aspirate_airGap_volume,
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import {
22
22
getAllWellsFromPrimaryWells ,
23
23
getChannels ,
24
24
getDefaultWells ,
25
- getMaxDisposalVolumeForMultidispense ,
25
+ getMaxDisposalVolumeForMultiDispense ,
26
26
} from './utils'
27
27
28
28
import type { NozzleConfigurationStyle } from '@opentrons/shared-data'
@@ -416,7 +416,7 @@ const clampDisposalVolume = (
416
416
const isDecimalString = appliedPatch . disposalVolume_volume === '.'
417
417
// @ts -expect-error(sa, 2021-6-14): appliedPatch isn't well-typed, address in #3161
418
418
if ( appliedPatch . path !== 'multiDispense' || isDecimalString ) return patch
419
- const maxDisposalVolume = getMaxDisposalVolumeForMultidispense (
419
+ const maxDisposalVolume = getMaxDisposalVolumeForMultiDispense (
420
420
// @ts -expect-error(sa, 2021-6-14): appliedPatch isn't well-typed, address in #3161
421
421
appliedPatch ,
422
422
pipetteEntities
Original file line number Diff line number Diff line change
1
+ import max from 'lodash/max'
1
2
import min from 'lodash/min'
2
3
import round from 'lodash/round'
3
4
import uniq from 'lodash/uniq'
@@ -148,7 +149,7 @@ export function getChannels(
148
149
return pipette . spec . channels
149
150
}
150
151
export const DISPOSAL_VOL_DIGITS = 1
151
- export function getMaxDisposalVolumeForMultidispense (
152
+ export function getMaxDisposalVolumeForMultiDispense (
152
153
values : {
153
154
aspirate_airGap_checkbox ?: boolean | null
154
155
aspirate_airGap_volume ?: string | null
@@ -172,7 +173,10 @@ export function getMaxDisposalVolumeForMultidispense(
172
173
const airGapChecked = values . aspirate_airGap_checkbox
173
174
let airGapVolume = airGapChecked ? Number ( values . aspirate_airGap_volume ) : 0
174
175
airGapVolume = Number . isFinite ( airGapVolume ) ? airGapVolume : 0
175
- return round ( pipetteCapacity - volume * 2 - airGapVolume , DISPOSAL_VOL_DIGITS )
176
+ return max ( [
177
+ round ( pipetteCapacity - volume * 2 - airGapVolume , DISPOSAL_VOL_DIGITS ) ,
178
+ 0 ,
179
+ ] )
176
180
}
177
181
// Ensures that 2x volume can fit in pipette
178
182
// NOTE: ensuring that disposalVolume_volume will not exceed pipette capacity
You can’t perform that action at this time.
0 commit comments