-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(protocol-designer): save v3/v4 files correctly (#5100)
Closes #4919
- Loading branch information
Showing
11 changed files
with
556 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
protocol-designer/src/file-data/__fixtures__/createFile/commonFields.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// @flow | ||
// Named arguments to createFile selector. This data would be the result of several selectors. | ||
import { fixtureP10Single } from '@opentrons/shared-data/pipette/fixtures/name' | ||
import fixture_96_plate from '@opentrons/shared-data/labware/fixtures/2/fixture_96_plate.json' | ||
import fixture_tiprack_10_ul from '@opentrons/shared-data/labware/fixtures/2/fixture_tiprack_10_ul.json' | ||
import fixture_trash from '@opentrons/shared-data/labware/fixtures/2/fixture_trash.json' | ||
import type { DismissedWarningState } from '../../../dismiss/reducers' | ||
import type { IngredientsState } from '../../../labware-ingred/reducers' | ||
import type { LabwareDefByDefURI } from '../../../labware-defs' | ||
import type { LabwareEntities, PipetteEntities } from '../../../step-forms' | ||
import type { LabwareLiquidState } from '../../../step-generation' | ||
import type { FileMetadataFields } from '../../types' | ||
|
||
export const fileMetadata: FileMetadataFields = { | ||
protocolName: 'Test Protocol', | ||
author: 'The Author', | ||
description: 'Protocol description', | ||
created: 1582667312515, | ||
} | ||
|
||
export const dismissedWarnings: DismissedWarningState = { | ||
form: {}, | ||
timeline: {}, | ||
} | ||
|
||
export const ingredients: IngredientsState = {} | ||
|
||
export const ingredLocations: LabwareLiquidState = {} | ||
|
||
export const labwareEntities: LabwareEntities = { | ||
trashId: { | ||
labwareDefURI: 'opentrons/opentrons_1_trash_1100ml_fixed/1', | ||
id: 'trashId', | ||
def: fixture_trash, | ||
}, | ||
tiprackId: { | ||
labwareDefURI: 'opentrons/opentrons_96_tiprack_10ul/1', | ||
id: 'tiprackId', | ||
def: fixture_tiprack_10_ul, | ||
}, | ||
plateId: { | ||
labwareDefURI: 'opentrons/nest_96_wellplate_100ul_pcr_full_skirt/1', | ||
id: 'plateId', | ||
def: fixture_96_plate, | ||
}, | ||
} | ||
|
||
export const pipetteEntities: PipetteEntities = { | ||
pipetteId: { | ||
id: 'pipetteId', | ||
name: 'p10_single', | ||
spec: fixtureP10Single, | ||
tiprackDefURI: 'opentrons/opentrons_96_tiprack_10ul/1', | ||
tiprackLabwareDef: fixture_tiprack_10_ul, | ||
}, | ||
} | ||
export const labwareNicknamesById: { [labwareId: string]: string } = { | ||
trashId: 'Trash', | ||
tiprackId: 'Opentrons 96 Tip Rack 10 µL', | ||
plateId: 'NEST 96 Well Plate 100 µL PCR Full Skirt', | ||
} | ||
export const labwareDefsByURI: LabwareDefByDefURI = { | ||
'opentrons/opentrons_96_tiprack_10ul/1': fixture_tiprack_10_ul, | ||
'opentrons/nest_96_wellplate_100ul_pcr_full_skirt/1': fixture_96_plate, | ||
'opentrons/opentrons_1_trash_1100ml_fixed/1': fixture_trash, | ||
} |
90 changes: 90 additions & 0 deletions
90
protocol-designer/src/file-data/__fixtures__/createFile/engageMagnet.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// @flow | ||
// Named arguments to createFile selector. This data would be the result of several selectors. | ||
import type { SavedStepFormState, ModuleEntities } from '../../../step-forms' | ||
import type { RobotState, Timeline } from '../../../step-generation' | ||
import type { StepIdType } from '../../../form-types' | ||
|
||
export const initialRobotState: RobotState = { | ||
labware: { | ||
trashId: { | ||
slot: '12', | ||
}, | ||
tiprackId: { | ||
slot: '2', | ||
}, | ||
plateId: { | ||
slot: 'magneticModuleId', | ||
}, | ||
}, | ||
modules: { | ||
magneticModuleId: { | ||
slot: '1', | ||
moduleState: { | ||
type: 'magneticModuleType', | ||
engaged: true, | ||
}, | ||
}, | ||
}, | ||
pipettes: { | ||
pipetteId: { | ||
mount: 'left', | ||
}, | ||
}, | ||
liquidState: { labware: {}, pipettes: {} }, | ||
tipState: { tipracks: {}, pipettes: {} }, | ||
} | ||
|
||
export const robotStateTimeline: Timeline = { | ||
timeline: [ | ||
{ | ||
commands: [ | ||
{ | ||
command: 'magneticModule/engageMagnet', | ||
params: { | ||
module: 'magneticModuleId', | ||
engageHeight: 16, | ||
}, | ||
}, | ||
], | ||
robotState: initialRobotState, | ||
}, | ||
], | ||
errors: null, | ||
} | ||
|
||
export const savedStepForms: SavedStepFormState = { | ||
__INITIAL_DECK_SETUP_STEP__: { | ||
stepType: 'manualIntervention', | ||
id: '__INITIAL_DECK_SETUP_STEP__', | ||
labwareLocationUpdate: { | ||
trashId: '12', | ||
tiprackId: '2', | ||
plateId: 'magneticModuleId', | ||
}, | ||
pipetteLocationUpdate: { | ||
pipetteId: 'left', | ||
}, | ||
moduleLocationUpdate: { | ||
magneticModuleId: '1', | ||
}, | ||
}, | ||
engageMagnetStepId: { | ||
id: 'engageMagnetStepId', | ||
stepType: 'magnet', | ||
stepName: 'magnet', | ||
stepDetails: '', | ||
moduleId: 'magneticModuleId', | ||
magnetAction: 'engage', | ||
engageHeight: '16', | ||
}, | ||
} | ||
|
||
export const orderedStepIds: Array<StepIdType> = ['engageMagnetStepId'] | ||
|
||
export const moduleEntities: ModuleEntities = { | ||
magneticModuleId: { | ||
id: 'magneticModuleId', | ||
type: 'magneticModuleType', | ||
model: 'magneticModuleV1', | ||
}, | ||
} |
176 changes: 176 additions & 0 deletions
176
protocol-designer/src/file-data/__fixtures__/createFile/noModules.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
// @flow | ||
// Named arguments to createFile selector. This data would be the result of several selectors. | ||
import type { SavedStepFormState, ModuleEntities } from '../../../step-forms' | ||
import type { RobotState, Timeline } from '../../../step-generation' | ||
import type { StepIdType } from '../../../form-types' | ||
|
||
export const initialRobotState: RobotState = { | ||
labware: { | ||
trashId: { | ||
slot: '12', | ||
}, | ||
tiprackId: { | ||
slot: '2', | ||
}, | ||
plateId: { | ||
slot: '1', | ||
}, | ||
}, | ||
modules: {}, | ||
pipettes: { | ||
pipetteId: { | ||
mount: 'left', | ||
}, | ||
}, | ||
liquidState: { | ||
pipettes: {}, | ||
labware: {}, | ||
}, | ||
tipState: { | ||
pipettes: {}, | ||
tipracks: {}, | ||
}, | ||
} | ||
|
||
export const robotStateTimeline: Timeline = { | ||
timeline: [ | ||
{ | ||
commands: [ | ||
{ | ||
command: 'pickUpTip', | ||
params: { | ||
pipette: 'pipetteId', | ||
labware: 'tiprackId', | ||
well: 'A1', | ||
}, | ||
}, | ||
{ | ||
command: 'aspirate', | ||
params: { | ||
pipette: 'pipetteId', | ||
volume: 6, | ||
labware: 'plateId', | ||
well: 'A1', | ||
offsetFromBottomMm: 1, | ||
flowRate: 3.78, | ||
}, | ||
}, | ||
{ | ||
command: 'dispense', | ||
params: { | ||
pipette: 'pipetteId', | ||
volume: 6, | ||
labware: 'trashId', | ||
well: 'A1', | ||
offsetFromBottomMm: 0.5, | ||
flowRate: 3.78, | ||
}, | ||
}, | ||
{ | ||
command: 'dropTip', | ||
params: { | ||
pipette: 'pipetteId', | ||
labware: 'trashId', | ||
well: 'A1', | ||
}, | ||
}, | ||
{ | ||
command: 'pickUpTip', | ||
params: { | ||
pipette: 'pipetteId', | ||
labware: 'tiprackId', | ||
well: 'B1', | ||
}, | ||
}, | ||
{ | ||
command: 'aspirate', | ||
params: { | ||
pipette: 'pipetteId', | ||
volume: 6, | ||
labware: 'plateId', | ||
well: 'B1', | ||
offsetFromBottomMm: 1, | ||
flowRate: 3.78, | ||
}, | ||
}, | ||
{ | ||
command: 'dispense', | ||
params: { | ||
pipette: 'pipetteId', | ||
volume: 6, | ||
labware: 'trashId', | ||
well: 'A1', | ||
offsetFromBottomMm: 0.5, | ||
flowRate: 3.78, | ||
}, | ||
}, | ||
{ | ||
command: 'dropTip', | ||
params: { | ||
pipette: 'pipetteId', | ||
labware: 'trashId', | ||
well: 'A1', | ||
}, | ||
}, | ||
], | ||
robotState: initialRobotState, | ||
warnings: [], | ||
}, | ||
], | ||
errors: null, | ||
} | ||
|
||
export const savedStepForms: SavedStepFormState = { | ||
__INITIAL_DECK_SETUP_STEP__: { | ||
stepType: 'manualIntervention', | ||
id: '__INITIAL_DECK_SETUP_STEP__', | ||
labwareLocationUpdate: { | ||
trashId: '12', | ||
tiprackId: '2', | ||
plateId: '1', | ||
}, | ||
pipetteLocationUpdate: { | ||
pipetteId: 'left', | ||
}, | ||
moduleLocationUpdate: {}, | ||
}, | ||
moveLiquidStepId: { | ||
id: 'moveLiquidStepId', | ||
stepType: 'moveLiquid', | ||
stepName: 'transfer', | ||
stepDetails: '', | ||
pipette: 'pipetteId', | ||
volume: '6', | ||
changeTip: 'always', | ||
path: 'single', | ||
aspirate_wells_grouped: false, | ||
aspirate_flowRate: null, | ||
aspirate_labware: 'plateId', | ||
aspirate_wells: ['A1', 'B1'], | ||
aspirate_wellOrder_first: 't2b', | ||
aspirate_wellOrder_second: 'l2r', | ||
aspirate_mix_checkbox: false, | ||
aspirate_mix_times: null, | ||
aspirate_mix_volume: null, | ||
aspirate_mmFromBottom: 1, | ||
aspirate_touchTip_checkbox: false, | ||
dispense_flowRate: null, | ||
dispense_labware: 'trashId', | ||
dispense_wells: ['A1'], | ||
dispense_wellOrder_first: 't2b', | ||
dispense_wellOrder_second: 'l2r', | ||
dispense_mix_checkbox: false, | ||
dispense_mix_times: null, | ||
dispense_mix_volume: null, | ||
dispense_mmFromBottom: 0.5, | ||
dispense_touchTip_checkbox: false, | ||
disposalVolume_checkbox: true, | ||
disposalVolume_volume: '1', | ||
blowout_checkbox: false, | ||
blowout_location: 'trashId', | ||
preWetTip: false, | ||
}, | ||
} | ||
export const orderedStepIds: Array<StepIdType> = ['moveLiquidStepId'] | ||
|
||
export const moduleEntities: ModuleEntities = {} |
Oops, something went wrong.