From 575c4b6414232b8efa350221a80fcb869aae4f7f Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Thu, 5 Dec 2024 10:47:15 -0500 Subject: [PATCH] adding an event so we can exit early if requested --- config.dev.ini | 4 ++-- pioreactor/background_jobs/base.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.dev.ini b/config.dev.ini index 9c29cea4..8a8a9880 100644 --- a/config.dev.ini +++ b/config.dev.ini @@ -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] @@ -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 diff --git a/pioreactor/background_jobs/base.py b/pioreactor/background_jobs/base.py index 78f4c91e..7213be1e 100644 --- a/pioreactor/background_jobs/base.py +++ b/pioreactor/background_jobs/base.py @@ -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