Fixed bug w. different number formats.

This commit is contained in:
jupfi 2023-08-16 10:37:09 +02:00
parent 3cca963118
commit 0eef206a6f

View file

@ -3,7 +3,7 @@ import numpy as np
import json import json
from serial.tools.list_ports import comports from serial.tools.list_ports import comports
from PyQt6 import QtSerialPort from PyQt6 import QtSerialPort
from PyQt5.QtCore import QThread, pyqtSignal, pyqtSlot from PyQt6.QtCore import QThread, pyqtSignal, pyqtSlot
from nqrduck.module.module_controller import ModuleController from nqrduck.module.module_controller import ModuleController
from .model import S11Data from .model import S11Data
@ -51,6 +51,8 @@ class AutoTMController(ModuleController):
MAX_FREQUENCY = 300e6 # Hz MAX_FREQUENCY = 300e6 # Hz
try: try:
start_frequence = start_frequency.replace(",", ".")
stop_frequency = stop_frequency.replace(",", ".")
start_frequency = float(start_frequency) * 1e6 start_frequency = float(start_frequency) * 1e6
stop_frequency = float(stop_frequency) * 1e6 stop_frequency = float(stop_frequency) * 1e6
except ValueError: except ValueError:
@ -286,6 +288,8 @@ class AutoTMController(ModuleController):
logger.debug("Setting voltages") logger.debug("Setting voltages")
MAX_VOLTAGE = 5 # V MAX_VOLTAGE = 5 # V
try: try:
tuning_voltage = tuning_voltage.replace(",", ".")
matching_voltage = matching_voltage.replace(",", ".")
tuning_voltage = float(tuning_voltage) tuning_voltage = float(tuning_voltage)
matching_voltage = float(matching_voltage) matching_voltage = float(matching_voltage)
except ValueError: except ValueError: