moved from snr to meter

This commit is contained in:
DJ2LS 2023-01-30 12:28:02 +01:00
parent d54416fc8d
commit 87fb4382a4
5 changed files with 16 additions and 17 deletions

View file

@ -970,8 +970,8 @@ class RF:
static.HAMLIB_STATUS = self.hamlib.get_status() static.HAMLIB_STATUS = self.hamlib.get_status()
static.HAMLIB_ALC = self.hamlib.get_alc() static.HAMLIB_ALC = self.hamlib.get_alc()
static.HAMLIB_RF = self.hamlib.get_level() static.HAMLIB_RF = self.hamlib.get_level()
static.HAMLIB_SWR = self.hamlib.get_swr() static.HAMLIB_METER = self.hamlib.get_meter()
print(f"ALC: {static.HAMLIB_ALC}, RF: {static.HAMLIB_RF}, SWR: {static.HAMLIB_SWR}") print(f"ALC: {static.HAMLIB_ALC}, RF: {static.HAMLIB_RF}, SWR: {static.HAMLIB_METER}")
def calculate_fft(self) -> None: def calculate_fft(self) -> None:
""" """
Calculate an average signal strength of the channel to assess Calculate an average signal strength of the channel to assess

View file

@ -35,7 +35,7 @@ class radio:
self.frequency = '' self.frequency = ''
self.mode = '' self.mode = ''
self.alc = '' self.alc = ''
self.swr = '' self.meter = ''
self.rf = '' self.rf = ''
def open_rig( def open_rig(
@ -209,7 +209,7 @@ class radio:
rf = data[0].decode("utf-8") rf = data[0].decode("utf-8")
if 'RPRT' not in rf: if 'RPRT' not in rf:
try: try:
rf = int(rf) self.rf = int(rf)
except ValueError: except ValueError:
self.rf = str(rf) self.rf = str(rf)
@ -217,30 +217,29 @@ class radio:
except Exception: except Exception:
return self.rf return self.rf
def get_swr(self): def get_meter(self):
try: try:
data = self.send_data_command(b"l SWR", True) data = self.send_data_command(b"l METER", True)
data = data.split(b"\n") data = data.split(b"\n")
swr = data[0].decode("utf-8") meter = data[0].decode("utf-8")
if 'RPRT' not in swr: if 'RPRT' not in meter:
try: try:
swr = int(swr) self.meter = str(meter)
except ValueError: except ValueError:
self.swr = str(swr) self.meter = str(meter)
return self.swr return self.meter
except Exception: except Exception:
return self.swr return self.meter
def get_alc(self): def get_alc(self):
try: try:
data = self.send_data_command(b"l ALC", True) data = self.send_data_command(b"l ALC", True)
data = data.split(b"\n") data = data.split(b"\n")
print(data)
alc = data[0].decode("utf-8") alc = data[0].decode("utf-8")
if 'RPRT' not in alc: if 'RPRT' not in alc:
try: try:
alc = int(alc) self.alc = int(alc)
except ValueError: except ValueError:
self.alc = str(alc) self.alc = str(alc)

View file

@ -34,7 +34,7 @@ class radio:
""" """ """ """
return None return None
def get_swr(self): def get_meter(self):
""" """ """ """
return None return None

View file

@ -654,7 +654,7 @@ def send_tnc_state():
"snr": str(static.SNR), "snr": str(static.SNR),
"frequency": str(static.HAMLIB_FREQUENCY), "frequency": str(static.HAMLIB_FREQUENCY),
"rf_level": str(static.HAMLIB_RF), "rf_level": str(static.HAMLIB_RF),
"swr": str(static.HAMLIB_SWR), "meter": str(static.HAMLIB_METER),
"alc": str(static.HAMLIB_ALC), "alc": str(static.HAMLIB_ALC),
"speed_level": str(static.ARQ_SPEED_LEVEL), "speed_level": str(static.ARQ_SPEED_LEVEL),
"mode": str(static.HAMLIB_MODE), "mode": str(static.HAMLIB_MODE),

View file

@ -66,7 +66,7 @@ HAMLIB_MODE: str = ""
HAMLIB_BANDWIDTH: int = 0 HAMLIB_BANDWIDTH: int = 0
HAMLIB_RF: int = 0 HAMLIB_RF: int = 0
HAMLIB_ALC: int = 0 HAMLIB_ALC: int = 0
HAMLIB_SWR: int = 0 HAMLIB_METER: int = 0
# ------------------------- # -------------------------
# FreeDV Defaults # FreeDV Defaults