From a1343c12644740c9648343666ea259c95112a85d Mon Sep 17 00:00:00 2001 From: "James C. Ahlstrom" Date: Fri, 10 May 2024 13:16:44 -0400 Subject: [PATCH] Quisk version 4.2.33 --- CHANGELOG.txt | 7 +++++++ __init__.py | 2 +- quisk.py | 17 ++++++++++++++++- setup.py | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6d99c51..a374116 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,10 @@ +Quisk Version 4.2.33 May 2024 +============================== +Added the get_level Hamlib command "l STRENGTH". It returns the S-meter reading. I finally found some Hamlib +documentation, often not an easy task. The return value of STRENGTH is in dB with zero dB equal to S9. +There are 6 dB per S-unit. So a STRENGTH of 4 is 4dB over S9, and -6, -12, -18 is S8, S7, S6. I also added +the corresponding FlexRadio command ZZSM. + Quisk Version 4.2.32 April 2024 ================================ I found and fixed a bug in the microphone filters that can result in a buffer overrun. You should update Quisk. diff --git a/__init__.py b/__init__.py index 5fdc8b4..2620d83 100644 --- a/__init__.py +++ b/__init__.py @@ -1,2 +1,2 @@ -#Quisk version 4.2.32 +#Quisk version 4.2.33 from .quisk import main diff --git a/quisk.py b/quisk.py index cf02b61..5f983fc 100644 --- a/quisk.py +++ b/quisk.py @@ -658,6 +658,16 @@ class HamlibHandlerSerial: self.app.pttButton.SetValue(0, True) else: self.Error(cmd, data) + def ZZSM(self, cmd, data, length): # return the S-meter value in dB * 2; 0 to 260 + if length == 0: # 0 to 260 is -140 to -10 dB; S9 == -73 dB == 134; dB = ZZSM / 2 - 140 + i = round((self.app.hamlib_strength + 67) * 2) + if i < 0: + i = 0 + elif i > 260: + i = 260 + self.Write('%s%03d;' % (cmd, i)) + else: + self.Error(cmd, data) def ZZSP(self, cmd, data, length): # the split status if length == 0: if self.app.split_rxtx: @@ -1151,7 +1161,7 @@ class HamlibHandlerRig2: # Test with telnet localhost 4532 def GetLevel(self): name = self.GetParamName() if name == '?': # send back supported parameters - self.Reply2('AGC AF', 0) + self.Reply2('AGC AF STRENGTH', 0) elif name == 'AGC': if self.app.BtnAGC.GetValue(): self.Reply2(4, 0) @@ -1160,6 +1170,9 @@ class HamlibHandlerRig2: # Test with telnet localhost 4532 elif name == 'AF': x = self.app.audio_volume # audio_volume is 0 to 1.000 self.Reply2("%.5f" % x, 0) + elif name == 'STRENGTH': + i = round(self.app.hamlib_strength) + self.Reply2(i, 0) else: self.ErrParam() def SetLevel(self): @@ -3565,6 +3578,7 @@ class App(wx.App): self.smeter_avg_seconds = 1.0 # seconds for S-meter average self.smeter_sunits = -87.0 self.smeter_usage = "smeter" # specify use of s-meter display + self.hamlib_strength = 0.0; self.timer = time.time() # A seconds clock self.heart_time0 = self.timer # timer to call HeartBeat at intervals self.save_time0 = self.timer @@ -5043,6 +5057,7 @@ class App(wx.App): self.smeter_sunits_time0 = self.timer s = self.smeter_sunits / 6.0 # change to S units; 6db per S unit s += Hardware.correct_smeter # S-meter correction for the gain, band, etc. + self.hamlib_strength = (s - 9.0) * 6.0 # convert to dB; 0 dB is S9 if s < 0: s = 0 if s >= 9.5: diff --git a/setup.py b/setup.py index 47f9d0b..fad007b 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ import os # You must define the version here. A title string including # the version will be written to __init__.py and read by quisk.py. -Version = '4.2.32' +Version = '4.2.33' fp = open("__init__.py", "w") # write title string fp.write("#Quisk version %s\n" % Version)