diff --git a/protocol-designer/src/components/LiquidPlacementModal.js b/protocol-designer/src/components/LiquidPlacementModal.js index 1ce2f3bf81a..190d17bb742 100644 --- a/protocol-designer/src/components/LiquidPlacementModal.js +++ b/protocol-designer/src/components/LiquidPlacementModal.js @@ -113,7 +113,6 @@ const mapStateToProps = (state: BaseState): SP => { wellContents = wellContentsSelectors.getWellContentsAllLabware(state)[ labwareId ] - console.log('liquidplacementmodal', { wellContents }) return { selectedWells, diff --git a/protocol-designer/src/components/steplist/SubstepRow.js b/protocol-designer/src/components/steplist/SubstepRow.js index 6441677ab4f..b2d4af0f392 100644 --- a/protocol-designer/src/components/steplist/SubstepRow.js +++ b/protocol-designer/src/components/steplist/SubstepRow.js @@ -43,12 +43,13 @@ export const PillTooltipContents = ( const hasMultipleIngreds = props.ingreds ? Object.keys(props.ingreds).length > 1 : false + return (
{props.ingreds && - map(props.ingreds, (ingred, groupId) => ( + map(props.ingreds, (ingred: number, groupId): React.Node => ( )} ))} diff --git a/protocol-designer/src/file-data/selectors/commands.js b/protocol-designer/src/file-data/selectors/commands.js index dd5c20695c3..c57f6e06acd 100644 --- a/protocol-designer/src/file-data/selectors/commands.js +++ b/protocol-designer/src/file-data/selectors/commands.js @@ -91,7 +91,19 @@ export const getInitialRobotState: BaseState => StepGeneration.RobotState = crea moduleLocations: modules, pipetteLocations: pipettes, }) - robotState.liquidState.labware = labwareLiquidState + // console.log('initial robot liq state, raw', { + // ...robotState.liquidState.labware, + // }) + + // TODO IMMEDIATELY: this SHOULD be adding only empty labware keys (eg `trashId: {}` is not in labwareLiquidState) + // Trace better and see if you can do it more elegantly. + // Before, it was `robotState.liquidState.labware = labwareLiquidState` + robotState.liquidState.labware = { + ...robotState.liquidState.labware, + ...labwareLiquidState, + } + + // console.log('initial robot state', robotState) return robotState } ) diff --git a/protocol-designer/src/step-generation/getNextRobotStateAndWarnings/dispenseUpdateLiquidState.js b/protocol-designer/src/step-generation/getNextRobotStateAndWarnings/dispenseUpdateLiquidState.js index 04cab80e646..3c2a815afea 100644 --- a/protocol-designer/src/step-generation/getNextRobotStateAndWarnings/dispenseUpdateLiquidState.js +++ b/protocol-designer/src/step-generation/getNextRobotStateAndWarnings/dispenseUpdateLiquidState.js @@ -58,8 +58,6 @@ export function dispenseUpdateLiquidState( well ) const liquidLabware = prevLiquidState.labware[labware] - // TODO IMMEDIATELY left off here - console.log('dispenseUpdateLiquidState', { liquidLabware }) // remove liquid from pipette tips, // create intermediate object where sources are updated tip liquid states diff --git a/protocol-designer/src/top-selectors/well-contents/index.js b/protocol-designer/src/top-selectors/well-contents/index.js index 59a960c0fea..6b38a564090 100644 --- a/protocol-designer/src/top-selectors/well-contents/index.js +++ b/protocol-designer/src/top-selectors/well-contents/index.js @@ -1,7 +1,6 @@ // @flow import { createSelector } from 'reselect' import isEmpty from 'lodash/isEmpty' -import mapValues from 'lodash/mapValues' import min from 'lodash/min' import pick from 'lodash/pick' import reduce from 'lodash/reduce' @@ -72,20 +71,21 @@ export const getAllWellContentsForActiveItem: Selector = timelineFrameBeforeActiveItem, (labwareEntities, timelineFrame) => { const liquidState = timelineFrame.robotState.liquidState.labware - const wellContentsByLabwareId = mapValues( - liquidState, + const wellContentsByLabwareId = Object.keys(labwareEntities).reduce( ( - labwareLiquids: StepGeneration.SingleLabwareLiquidState, + acc: WellContentsByLabware, labwareId: string - ) => { - const contentz = _wellContentsForLabware( - labwareLiquids, + ): WellContentsByLabware => { + const liquids = liquidState[labwareId] + const contents = _wellContentsForLabware( + liquids, labwareEntities[labwareId].def ) - console.log('getAllWellContentsForActiveItem', { contentz, labwareId }) - return contentz - } + return { ...acc, [labwareId]: contents } + }, + {} ) + return wellContentsByLabwareId } )
{hasMultipleIngreds && (
- {formatPercentage(ingred.volume, totalLiquidVolume)} + {formatPercentage(ingred, totalLiquidVolume)} - {formatVolume(ingred.volume, 2)}µl + {formatVolume(ingred, 2)}µl