Skip to content

Commit

Permalink
add in a fix for tip pressence when using the ot3simulator backend
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Dec 21, 2023
1 parent 7e1c7b3 commit 04b5129
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/src/opentrons/hardware_control/backends/ot3controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1369,3 +1369,8 @@ async def get_tip_status(self, mount: OT3Mount) -> TipStateType:

def current_tip_state(self, mount: OT3Mount) -> Optional[bool]:
return self.tip_presence_manager.current_tip_state(mount)

def _update_tip_state(self, mount: OT3Mount, status: bool) -> None:
"""This is something we only use in the simulator.
It is required so that PE simulations using ot3api don't break."""
pass
5 changes: 5 additions & 0 deletions api/src/opentrons/hardware_control/backends/ot3simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,3 +764,8 @@ async def update_tip_detector(self, mount: OT3Mount, sensor_count: int) -> None:

async def teardown_tip_detector(self, mount: OT3Mount) -> None:
pass

def _update_tip_state(self, mount: OT3Mount, status: bool) -> None:
"""This is something we only use in the simulator.
It is required so that PE simulations using ot3api don't break."""
self._sim_tip_state[mount] = status
3 changes: 3 additions & 0 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2094,6 +2094,7 @@ async def pick_up_tip(
def add_tip_to_instr() -> None:
instrument.add_tip(tip_length=tip_length)
instrument.set_current_volume(0)
self._backend._update_tip_state(realmount, True)

await self._move_to_plunger_bottom(realmount, rate=1.0)
if (
Expand Down Expand Up @@ -2194,6 +2195,8 @@ def _remove_tips() -> None:
await self._home([Axis.by_mount(mount)])

_remove_tips()
# call this in case we're simulating
self._backend._update_tip_state(realmount, False)

async def clean_up(self) -> None:
"""Get the API ready to stop cleanly."""
Expand Down

0 comments on commit 04b5129

Please sign in to comment.