From c1bb983d0beab5dc0c75d78a938c0510a502a615 Mon Sep 17 00:00:00 2001 From: jupfi Date: Wed, 20 Dec 2023 09:22:19 +0100 Subject: [PATCH] Removed confirmation of commands for broadband measurements. This causes bugs atm. --- src/nqrduck_autotm/controller.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/nqrduck_autotm/controller.py b/src/nqrduck_autotm/controller.py index bcc9515..e21525d 100644 --- a/src/nqrduck_autotm/controller.py +++ b/src/nqrduck_autotm/controller.py @@ -51,13 +51,12 @@ class AutoTMController(ModuleController): elif self.module.model.LUT.TYPE == "Electrical": tuning_voltage, matching_voltage = self.module.model.LUT.get_voltages(frequency) confirmation = self.set_voltages(str(tuning_voltage), str(matching_voltage)) - if confirmation: - # We need to change the signal pathway to preamp to measure the reflection - self.switch_to_atm() - reflection = self.read_reflection(frequency) - # We need to change the signal pathway back to atm to perform a measurement - self.switch_to_preamp() - self.module.nqrduck_signal.emit("confirm_tune_and_match", reflection) + # We need to change the signal pathway to preamp to measure the reflection + self.switch_to_atm() + reflection = self.read_reflection(frequency) + # We need to change the signal pathway back to atm to perform a measurement + self.switch_to_preamp() + self.module.nqrduck_signal.emit("confirm_tune_and_match", reflection) elif self.module.model.LUT.TYPE == "Mechanical": tuning_position, matching_position = self.module.model.LUT.get_positions(frequency) @@ -595,13 +594,12 @@ class AutoTMController(ModuleController): start_time = time.time() confirmation = self.send_command(command) - if confirmation: - while matching_voltage != self.module.model.matching_voltage and tuning_voltage != self.module.model.tuning_voltage: - QApplication.processEvents() - # Check for timeout - if time.time() - start_time > timeout_duration: - logger.error("Voltage setting timed out") - break + while matching_voltage != self.module.model.matching_voltage and tuning_voltage != self.module.model.tuning_voltage: + QApplication.processEvents() + # Check for timeout + if time.time() - start_time > timeout_duration: + logger.error("Voltage setting timed out") + break logger.debug("Voltages set successfully") return confirmation