diff --git a/TimeBaseAOMDriver/blacs_workers.py b/TimeBaseAOMDriver/blacs_workers.py index f6f0265ef268d6f2cbd03a40dca2a0658eedd11b..1d85e1344248836f778099d9a980883e6c5d1c5a 100644 --- a/TimeBaseAOMDriver/blacs_workers.py +++ b/TimeBaseAOMDriver/blacs_workers.py @@ -37,10 +37,10 @@ class TimeBaseWorker(Worker): if self.smart_cache[channel][attr] != group[channel].attrs[attr] or fresh: # Disable sweep mode, if it was in use. # This is necessary is update the sweep mode parameters. - if self.smart_cache["Sswpm"] != 0: + if self.smart_cache[channel]["Sswpm"] != 0: print(f"Programming {channel}, Sswpm=0") self.client.send(f"{channel}|Sswpm:0\r\n".encode()) - self.smart_cache["Sswpm"] = 0 + self.smart_cache[channel]["Sswpm"] = 0 time.sleep(0.01) if attr == "Sswpm": # Skip sweep mode, becasue I want to enable it only after @@ -51,10 +51,10 @@ class TimeBaseWorker(Worker): self.smart_cache[channel][attr] = group[channel].attrs[attr] time.sleep(0.01) # TODO: What's the best time here? Do we need to wait at all? According to the DIM-3000 manual the rate is 10 commands per second, it seems router can also handle faster times? # Program actual value of sweep mode - if group[channel]["Sswpm"] != 0: + if group[channel].attrs["Sswpm"] != 0: print(f"Programming {channel}, Sswpm") - self.client.send(f"{channel}|Sswpm:{group[channel]['Sswpm']}\r\n".encode()) - self.smart_cache["Sswpm"] = {group[channel]['Sswpm']} + self.client.send(f"{channel}|Sswpm:{group[channel].attrs['Sswpm']}\r\n".encode()) + self.smart_cache[channel]["Sswpm"] = {group[channel].attrs['Sswpm']} time.sleep(0.01) if not initial_values[channel]["gate"]: