Skip to content

Commit

Permalink
feat(protocol-designer): wire up staging areas to loadFixture commands (
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader authored Oct 16, 2023
1 parent 60aaf7d commit d16b7ec
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 53 deletions.
12 changes: 7 additions & 5 deletions protocol-designer/src/file-data/selectors/fileCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import {
SPAN7_8_10_11_SLOT,
Cutout,
} from '@opentrons/shared-data'
import { getFileMetadata, getRobotType } from './fileFields'
import { getInitialRobotState, getRobotStateTimeline } from './commands'
import { selectors as dismissSelectors } from '../../dismiss'
import {
selectors as labwareDefSelectors,
Expand All @@ -27,12 +25,16 @@ import { selectors as stepFormSelectors } from '../../step-forms'
import { selectors as uiLabwareSelectors } from '../../ui/labware'
import { getLoadLiquidCommands } from '../../load-file/migration/utils/getLoadLiquidCommands'
import { swatchColors } from '../../components/swatchColors'
import { getAdditionalEquipmentEntities } from '../../step-forms/selectors'
import {
DEFAULT_MM_FROM_BOTTOM_ASPIRATE,
DEFAULT_MM_FROM_BOTTOM_DISPENSE,
DEFAULT_MM_TOUCH_TIP_OFFSET_FROM_TOP,
DEFAULT_MM_BLOWOUT_OFFSET_FROM_TOP,
} from '../../constants'
import { getFileMetadata, getRobotType } from './fileFields'
import { getInitialRobotState, getRobotStateTimeline } from './commands'

import type {
PipetteEntity,
LabwareEntities,
Expand All @@ -44,14 +46,14 @@ import type {
CreateCommand,
ProtocolFile,
} from '@opentrons/shared-data/protocol/types/schemaV7'
import type { Selector } from '../../types'
import type {
LoadLabwareCreateCommand,
LoadModuleCreateCommand,
LoadPipetteCreateCommand,
LoadFixtureCreateCommand,
} from '@opentrons/shared-data/protocol/types/schemaV7/command/setup'
import { getAdditionalEquipmentEntities } from '../../step-forms/selectors'
import type { Selector } from '../../types'

// TODO: BC: 2018-02-21 uncomment this assert, causes test failures
// assert(!isEmpty(process.env.OT_PD_VERSION), 'Could not find application version!')
if (isEmpty(process.env.OT_PD_VERSION))
Expand Down Expand Up @@ -290,7 +292,7 @@ export const createFile: Selector<ProtocolFile> = createSelector(
[]
)

// TODO(jr, 10/3/23): add staging area, standard slot, and trash bin loadFixtures
// TODO(jr, 10/3/23): add standard slot, and trash bin loadFixtures
const loadFixtureCommands = reduce<
AdditionalEquipmentEntity,
LoadFixtureCreateCommand[]
Expand Down
94 changes: 46 additions & 48 deletions protocol-designer/src/step-forms/reducers/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import assert from 'assert'
import { handleActions } from 'redux-actions'
import { Reducer } from 'redux'
import mapValues from 'lodash/mapValues'
import cloneDeep from 'lodash/cloneDeep'
import merge from 'lodash/merge'
Expand All @@ -20,7 +21,6 @@ import {
PipetteName,
THERMOCYCLER_MODULE_TYPE,
LoadFixtureCreateCommand,
STAGING_AREA_LOAD_NAME,
STANDARD_SLOT_LOAD_NAME,
TRASH_BIN_LOAD_NAME,
} from '@opentrons/shared-data'
Expand All @@ -34,46 +34,49 @@ import {
handleFormChange,
} from '../../steplist/formLevel'
import { PRESAVED_STEP_ID } from '../../steplist/types'
import {
_getPipetteEntitiesRootState,
_getLabwareEntitiesRootState,
_getInitialDeckSetupRootState,
} from '../selectors'
import { getLabwareIsCompatible } from '../../utils/labwareModuleCompatibility'
import {
createPresavedStepForm,
getDeckItemIdInSlot,
getIdsInRange,
} from '../utils'
import {
createInitialProfileCycle,
createInitialProfileStep,
} from '../utils/createInitialProfileItems'
import { getLabwareOnModule } from '../../ui/modules/utils'
import { nestedCombineReducers } from './nestedCombineReducers'
import { PROFILE_CYCLE, PROFILE_STEP } from '../../form-types'
import { Reducer } from 'redux'
import {
NormalizedAdditionalEquipmentById,
NormalizedPipetteById,
} from '@opentrons/step-generation'
import { LoadFileAction } from '../../load-file'
import {
CreateContainerAction,
DeleteContainerAction,
DuplicateLabwareAction,
SwapSlotContentsAction,
} from '../../labware-ingred/actions'
import { SaveStepFormAction } from '../../ui/steps/actions/thunks'
import { ReplaceCustomLabwareDef } from '../../labware-defs/actions'
import type {
FormData,
StepIdType,
StepType,
ProfileItem,
ProfileCycleItem,
ProfileStepItem,
} from '../../form-types'
import {
_getPipetteEntitiesRootState,
_getLabwareEntitiesRootState,
_getInitialDeckSetupRootState,
} from '../selectors'
import {
CreateDeckFixtureAction,
DeleteDeckFixtureAction,
ToggleIsGripperRequiredAction,
} from '../actions/additionalItems'
import {
createPresavedStepForm,
getDeckItemIdInSlot,
getIdsInRange,
} from '../utils'
import {
CreateModuleAction,
CreatePipettesAction,
DeleteModuleAction,
DeletePipettesAction,
EditModuleAction,
SubstituteStepFormPipettesAction,
ChangeBatchEditFieldAction,
ResetBatchEditFieldChangesAction,
SaveStepFormsMultiAction,
} from '../actions'

import type {
CancelStepFormAction,
ChangeFormInputAction,
ChangeSavedStepFormAction,
Expand All @@ -89,7 +92,21 @@ import {
EditProfileStepAction,
FormPatch,
} from '../../steplist/actions'
import {
import type {
FormData,
StepIdType,
StepType,
ProfileItem,
ProfileCycleItem,
ProfileStepItem,
} from '../../form-types'
import type {
CreateContainerAction,
DeleteContainerAction,
DuplicateLabwareAction,
SwapSlotContentsAction,
} from '../../labware-ingred/actions'
import type {
AddStepAction,
DuplicateStepAction,
DuplicateMultipleStepsAction,
Expand All @@ -98,28 +115,12 @@ import {
SelectTerminalItemAction,
SelectMultipleStepsAction,
} from '../../ui/steps/actions/types'
import { SaveStepFormAction } from '../../ui/steps/actions/thunks'
import {
import type {
NormalizedLabware,
NormalizedLabwareById,
ModuleEntities,
} from '../types'
import {
CreateModuleAction,
CreatePipettesAction,
DeleteModuleAction,
DeletePipettesAction,
EditModuleAction,
SubstituteStepFormPipettesAction,
ChangeBatchEditFieldAction,
ResetBatchEditFieldChangesAction,
SaveStepFormsMultiAction,
} from '../actions'
import {
CreateDeckFixtureAction,
DeleteDeckFixtureAction,
ToggleIsGripperRequiredAction,
} from '../actions/additionalItems'

type FormState = FormData | null
const unsavedFormInitialState = null
// the `unsavedForm` state holds temporary form info that is saved or thrown away with "cancel".
Expand Down Expand Up @@ -1329,10 +1330,7 @@ export const additionalEquipmentInvariantProperties = handleActions<NormalizedAd
) => {
const { fixtureId, loadName, location } = command.params
const id = fixtureId ?? ''
// TODO(jr, 10/03/23): filtering out staging area for now
// until it is supported
if (
loadName === STAGING_AREA_LOAD_NAME ||
loadName === STANDARD_SLOT_LOAD_NAME ||
loadName === TRASH_BIN_LOAD_NAME
) {
Expand Down

0 comments on commit d16b7ec

Please sign in to comment.