diff --git a/tangostationcontrol/tangostationcontrol/devices/beam.py b/tangostationcontrol/tangostationcontrol/devices/beam.py index d62a49e368598ccf5868f5c74402233d5eb403cf..afcdf78871e321a2489339f747f61351643790b2 100644 --- a/tangostationcontrol/tangostationcontrol/devices/beam.py +++ b/tangostationcontrol/tangostationcontrol/devices/beam.py @@ -87,6 +87,13 @@ class Beam(lofar_device): # -------- # overloaded functions # -------- + + def init_device(self): + super().init_device() + + # thread to perform beam tracking + self.HBAT_beam_tracker = None + @log_exceptions() def configure_for_initialise(self): super().configure_for_initialise() @@ -126,8 +133,9 @@ class Beam(lofar_device): @log_exceptions() def configure_for_off(self): - # Stop thread object - self.HBAT_beam_tracker.stop() + if self.HBAT_beam_tracker: + # Stop thread object + self.HBAT_beam_tracker.stop() super().configure_for_off()