Skip to content

Commit

Permalink
adding an event so we can exit early if requested
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Dec 5, 2024
1 parent a7ce1d6 commit 575c4b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config.dev.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use_rpm=True
duration_between_updates_seconds=23
post_delay_duration=0.25
pre_delay_duration=2.0
enable_dodging_od=True
enable_dodging_od=False


[stirring.pid]
Expand All @@ -54,7 +54,7 @@ Kd=0.0

[od_reading.config]
# how many samples should the ADC publish per second?
samples_per_second=0.03
samples_per_second=0.2

pd_reference_ema=0.4

Expand Down
3 changes: 3 additions & 0 deletions pioreactor/background_jobs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,18 +1181,21 @@ def sneak_in(ads_interval: float, post_delay: float, pre_delay: float) -> None:

def on_sleeping(self) -> None:
try:
self._event_is_dodging_od.set()
self.sneak_in_timer.pause()
except AttributeError:
pass

def on_disconnected(self) -> None:
try:
self._event_is_dodging_od.set()
self.sneak_in_timer.cancel()
except AttributeError:
pass

def on_sleeping_to_ready(self) -> None:
try:
self._event_is_dodging_od.clear()
self.sneak_in_timer.unpause()
except AttributeError:
pass
Expand Down

0 comments on commit 575c4b6

Please sign in to comment.