moved from meter to strength

This commit is contained in:
DJ2LS 2023-01-30 12:31:34 +01:00
parent 87fb4382a4
commit 62792e75bb
4 changed files with 13 additions and 13 deletions

View file

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

View file

@ -35,7 +35,7 @@ class radio:
self.frequency = ''
self.mode = ''
self.alc = ''
self.meter = ''
self.strength = ''
self.rf = ''
def open_rig(
@ -217,20 +217,20 @@ class radio:
except Exception:
return self.rf
def get_meter(self):
def get_strength(self):
try:
data = self.send_data_command(b"l METER", True)
data = self.send_data_command(b"l STRENGTH", True)
data = data.split(b"\n")
meter = data[0].decode("utf-8")
if 'RPRT' not in meter:
strength = data[0].decode("utf-8")
if 'RPRT' not in strength:
try:
self.meter = str(meter)
self.strength = str(strength)
except ValueError:
self.meter = str(meter)
self.strength = str(strength)
return self.meter
return self.strength
except Exception:
return self.meter
return self.strength
def get_alc(self):
try:

View file

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

View file

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