diff --git a/scriptsapi/qo100_datv.py b/scriptsapi/qo100_datv.py index 58321dcf2..83711c7e8 100755 --- a/scriptsapi/qo100_datv.py +++ b/scriptsapi/qo100_datv.py @@ -42,10 +42,10 @@ def get_input_options(): class Controller: """ Controller main class """ - def __init__(self): + def __init__(self, options): + self.options = options self.device_hwtype = None - # ====================================================================== def change_device_center_frequency(self, content, new_frequency): """ Change device center frequency searching recursively """ @@ -125,48 +125,48 @@ class Controller: return 0 if i < 1 else i - 1 # ====================================================================== - def set_device(self, options): + def set_device(self): """ Set the device """ # ---------------------------------------------------------------------- - device_settings_url = f"{BASE_URL}/deviceset/{options.device_index}/device/settings" + device_settings_url = f"{BASE_URL}/deviceset/{self.options.device_index}/device/settings" r = requests.get(url=device_settings_url, timeout=10) if r.status_code // 100 == 2: # OK rj = r.json() self.device_hwtype = rj.get("deviceHwType", None) device_settings = rj.get(sdrangel.DEVICE_TYPES[self.device_hwtype]["settings"], None) device_sr, device_decim = self.get_device_sr_and_decim(self.device_hwtype, device_settings) - new_decim = self.calc_decim(device_sr, options.symbol_rate) + new_decim = self.calc_decim(device_sr, self.options.symbol_rate) print(f"sr: {device_sr} S/s decim: {device_decim} new decim: {1<