Skip to content

Commit

Permalink
Merge branch 'edge' into app_dqa-desktop-device-details-deck-config
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed Nov 16, 2023
2 parents 240bb0a + 09d48ce commit 6081918
Show file tree
Hide file tree
Showing 18 changed files with 102 additions and 24 deletions.
8 changes: 6 additions & 2 deletions api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging
from contextlib import nullcontext
from typing import Any, List, Optional, Sequence, Union, cast
from typing import Any, List, Optional, Sequence, Union, cast, Dict
from opentrons_shared_data.errors.exceptions import (
CommandPreconditionViolated,
CommandParameterLimitViolated,
Expand Down Expand Up @@ -435,6 +435,10 @@ def mix(

c_vol = self._core.get_available_volume() if not volume else volume

dispense_kwargs: Dict[str, Any] = {}
if self.api_version >= APIVersion(2, 16):
dispense_kwargs["push_out"] = 0.0

with publisher.publish_context(
broker=self.broker,
command=cmds.mix(
Expand All @@ -446,7 +450,7 @@ def mix(
):
self.aspirate(volume, location, rate)
while repetitions - 1 > 0:
self.dispense(volume, rate=rate)
self.dispense(volume, rate=rate, **dispense_kwargs)
self.aspirate(volume, rate=rate)
repetitions -= 1
self.dispense(volume, rate=rate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ def test_get_deck_gripper_offsets(ot3_standard_deck_def: DeckDefinitionV4) -> No

assert subject.get_deck_default_gripper_offsets() == LabwareMovementOffsetData(
pickUpOffset=LabwareOffsetVector(x=0, y=0, z=0),
dropOffset=LabwareOffsetVector(x=0, y=0, z=-0.25),
dropOffset=LabwareOffsetVector(x=0, y=0, z=-0.75),
)


Expand Down
4 changes: 2 additions & 2 deletions api/tests/opentrons/protocol_engine/state/test_module_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -1756,14 +1756,14 @@ def test_is_edge_move_unsafe(
lazy_fixture("thermocycler_v2_def"),
LabwareMovementOffsetData(
pickUpOffset=LabwareOffsetVector(x=0, y=0, z=4.6),
dropOffset=LabwareOffsetVector(x=0, y=0, z=4.6),
dropOffset=LabwareOffsetVector(x=0, y=0, z=5.6),
),
),
(
lazy_fixture("heater_shaker_v1_def"),
LabwareMovementOffsetData(
pickUpOffset=LabwareOffsetVector(x=0, y=0, z=0),
dropOffset=LabwareOffsetVector(x=0, y=0, z=0.5),
dropOffset=LabwareOffsetVector(x=0, y=0, z=1.0),
),
),
(
Expand Down
4 changes: 3 additions & 1 deletion app/src/organisms/LabwarePositionCheck/PrepareSpace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export const PrepareSpace = (props: PrepareSpaceProps): JSX.Element | null => {
labwareLocation: location,
definition: labwareDef,
},
]}
].filter(
() => !('moduleModel' in location && location.moduleModel != null)
)}
deckConfig={deckConfig}
/>
</Flex>
Expand Down
9 changes: 8 additions & 1 deletion components/src/hardware-sim/BaseDeck/BaseDeck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element {
) : (
<>
{showSlotLabels ? (
<SlotLabels robotType={robotType} color={darkFill} />
<SlotLabels
robotType={robotType}
color={darkFill}
show4thColumn={
stagingAreaFixtures.length > 0 ||
wasteChuteStagingAreaFixtures.length > 0
}
/>
) : null}
{singleSlotFixtures.map(fixture => (
<SingleSlotFixture
Expand Down
36 changes: 30 additions & 6 deletions components/src/hardware-sim/Deck/SlotLabels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { RobotType } from '@opentrons/shared-data'
interface SlotLabelsProps {
robotType: RobotType
color?: string
show4thColumn?: boolean
}

/**
Expand All @@ -19,7 +20,11 @@ interface SlotLabelsProps {
export const SlotLabels = ({
robotType,
color,
show4thColumn = false,
}: SlotLabelsProps): JSX.Element | null => {
const widthSmallRem = 10.5
const widthLargeRem = 15.25

return robotType === FLEX_ROBOT_TYPE ? (
<>
<RobotCoordsForeignObject
Expand Down Expand Up @@ -71,37 +76,56 @@ export const SlotLabels = ({
</RobotCoordsForeignObject>
<RobotCoordsForeignObject
height="2.5rem"
width="30.375rem"
x="-15"
width={`${
show4thColumn
? widthSmallRem * 2 + widthLargeRem * 2
: widthSmallRem + widthLargeRem * 2
}rem`}
x="-100"
y="-55"
>
<Flex
alignItems={ALIGN_CENTER}
flex="1"
width="30.375rem"
width={`${
show4thColumn
? widthSmallRem * 2 + widthLargeRem * 2
: widthSmallRem + widthLargeRem * 2
}rem`}
height="2.5rem"
>
<Flex
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_CENTER}
flex="1"
width={`${widthLargeRem}rem`}
>
<LocationIcon color={color} slotName="1" height="100%" />
</Flex>
<Flex
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_CENTER}
flex="1"
width={`${widthSmallRem}rem`}
>
<LocationIcon color={color} slotName="2" height="100%" />
</Flex>
<Flex
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_CENTER}
flex="1"
width={
show4thColumn ? `${widthSmallRem}rem` : `${widthLargeRem}rem`
}
>
<LocationIcon color={color} slotName="3" height="100%" />
</Flex>
{show4thColumn ? (
<Flex
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_CENTER}
width={`${widthSmallRem}rem`}
>
<LocationIcon color={color} slotName="4" height="100%" />
</Flex>
) : null}
</Flex>
</RobotCoordsForeignObject>
</>
Expand Down
6 changes: 5 additions & 1 deletion components/src/hardware-sim/DeckConfigurator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ export function DeckConfigurator(props: DeckConfiguratorProps): JSX.Element {
fixtureLocation={cutoutId}
/>
))}
<SlotLabels robotType={FLEX_ROBOT_TYPE} color={darkFill} />
<SlotLabels
robotType={FLEX_ROBOT_TYPE}
color={darkFill}
show4thColumn={stagingAreaFixtures.length > 0}
/>
{children}
</RobotCoordinateSpace>
)
Expand Down
13 changes: 11 additions & 2 deletions hardware-testing/hardware_testing/opentrons_api/helpers_ot3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from datetime import datetime
from enum import Enum
from math import pi
from subprocess import run
from subprocess import run, Popen
from time import time
from typing import Callable, Coroutine, Dict, List, Optional, Tuple, Union

import atexit
from opentrons_hardware.drivers.can_bus import DriverSettings, build, CanMessenger
from opentrons_hardware.drivers.can_bus import settings as can_bus_settings
from opentrons_hardware.firmware_bindings.constants import SensorId
Expand Down Expand Up @@ -77,6 +77,15 @@ def stop_server_ot3() -> None:
"""Stop opentrons-robot-server on the OT3."""
print('Stopping "opentrons-robot-server"...')
run(["systemctl", "stop", "opentrons-robot-server"])
atexit.register(restart_server_ot3)


def restart_server_ot3() -> None:
"""Start opentrons-robot-server on the OT3."""
print('Starting "opentrons-robot-server"...')
Popen(
["systemctl", "restart", "opentrons-robot-server", "&"],
)


def start_server_ot3() -> None:
Expand Down
2 changes: 1 addition & 1 deletion shared-data/deck/definitions/3/ot3_standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@
"dropOffset": {
"x": 0,
"y": 0,
"z": -0.25
"z": -0.75
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion shared-data/deck/definitions/4/ot3_standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
"dropOffset": {
"x": 0,
"y": 0,
"z": -0.25
"z": -0.75
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"z": 10.7
}
},
"gripForce": 15,
"gripForce": 9,
"gripHeightFromLabwareBottom": 10,
"ordering": [
["A1", "B1", "C1", "D1", "E1", "F1", "G1", "H1"],
Expand Down
14 changes: 14 additions & 0 deletions shared-data/labware/definitions/2/opentrons_96_pcr_adapter/1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1014,5 +1014,19 @@
"x": 8.5,
"y": 5.5,
"z": 0
},
"gripperOffsets": {
"default": {
"pickUpOffset": {
"x": 0,
"y": 0,
"z": 0
},
"dropOffset": {
"x": 0,
"y": 0,
"z": 1.0
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1014,5 +1014,19 @@
"x": 0,
"y": 0,
"z": 0
},
"gripperOffsets": {
"default": {
"pickUpOffset": {
"x": 0,
"y": 0,
"z": 0
},
"dropOffset": {
"x": 0,
"y": 0,
"z": 1.0
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"z": 10.7
}
},
"gripForce": 15,
"gripForce": 9,
"gripHeightFromLabwareBottom": 10,
"ordering": [
["A1", "B1", "C1", "D1", "E1", "F1", "G1", "H1"],
Expand Down
2 changes: 1 addition & 1 deletion shared-data/module/definitions/3/heaterShakerModuleV1.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"dropOffset": {
"x": 0,
"y": 0,
"z": 0.5
"z": 1.0
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion shared-data/module/definitions/3/magneticBlockV1.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dropOffset": {
"x": 0,
"y": 0,
"z": 0.5
"z": 1.0
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion shared-data/module/definitions/3/temperatureModuleV2.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dropOffset": {
"x": 0,
"y": 0,
"z": 0.5
"z": 1.0
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion shared-data/module/definitions/3/thermocyclerModuleV2.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"dropOffset": {
"x": 0,
"y": 0,
"z": 4.6
"z": 5.6
}
}
},
Expand Down

0 comments on commit 6081918

Please sign in to comment.