Skip to content

Commit

Permalink
Quisk version 4.2.39
Browse files Browse the repository at this point in the history
  • Loading branch information
jimahlstrom committed Oct 1, 2024
1 parent 78a1ca3 commit fb888a2
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Quisk Version 4.2.39 October 2024
==================================
I added an optional Hardware method PollGuiControl(self). If you define this in your Hardware file,
the GUI thread will call it frequently. It can be used to set PTT from your hardware.

I am trying to work around a wxPython quirk that causes mouse wheel tuning to fail. Please test.

Quisk Version 4.2.38 September 2024
====================================
This is a bugfix release. I fixed a bug in the Hamlib serial port when using a physical TTY instead
Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Quisk version 4.2.38
#Quisk version 4.2.39
from .quisk import main
23 changes: 22 additions & 1 deletion multuspkg/quisk_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def __init__(self, app, conf):
conf.si570_direct_control = False
conf.si570_xtal_freq = 114285000
conf.repeater_delay = 0.25
self.ptt_count = 200
self.ptt_on = 0
BaseHardware.__init__(self, app, conf)
QS.set_sparams(multus_cw_samples=1)
self.use_softrock = True
Expand All @@ -104,6 +106,13 @@ def TransferOut(self, address, message): # message is a bytes array or an intege
self.usb_dev.ctrl_transfer(OUT, address, self.si570_i2c_address + 0x700, 0, message)
if DEBUG:
print ("USB send to 0x%X" % address, message)
def TransferIn(self, address, length):
if self.usb_dev:
recv = self.usb_dev.ctrl_transfer(IN, address, self.si570_i2c_address + 0x700, 0, length)
if DEBUG:
print ("USB receive from 0x%X" % address, recv)
return recv
return None
def open(self):
text = BaseHardware.open(self)
self.InitKeyer()
Expand All @@ -120,8 +129,20 @@ def ChangeMode(self, mode):
print ("Mode is not CW")
self.TransferOut(0x70, cw_mode)
return ret
def PollCwKey(self): # Called frequently by Quisk to check the CW key status
def PollCwKey(self): # Called frequently from the sound thread to check the CW key status
return # Quisk is always in Rx
def PollGuiControl(self): # Called frequently from the GUI thread
self.ptt_count -= 1
if self.ptt_count <= 0:
self.ptt_count = 200
reply = self.TransferIn(0xA5, 1)
if DEBUG:
print ("PollGuiControl got", reply)
if reply:
ptt = reply[0] # This is 255 for error
if ptt in (0, 1) and ptt != self.ptt_on:
self.ptt_on = ptt
self.application.pttButton.SetValue(ptt, True)
def InitKeyer(self):
# Initialize the keyer parameters
conf = self.conf
Expand Down
6 changes: 5 additions & 1 deletion quisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2123,7 +2123,7 @@ def GetMousePosition(self, event):
"""For mouse clicks in our display, translate to our screen coordinates."""
mouse_x, mouse_y = event.GetPosition()
win = event.GetEventObject()
if win is not self:
if win and win is not self:
x, y = win.GetPosition().Get()
mouse_x += x
mouse_y += y
Expand Down Expand Up @@ -3524,6 +3524,7 @@ def OnInit(self):
if not os.path.isdir(self.QuiskFilesDir):
self.QuiskFilesDir = DefaultConfigDir
self.std_out_err = StdOutput(self)
self.std_out_err.Logfile("WxPython " + wx.version())
QS.set_params(quisk_is_vna=0) # We are not the VNA program
# Read in configuration from the selected radio
self.BandPlan = []
Expand Down Expand Up @@ -3614,6 +3615,7 @@ def OnInit(self):
setattr(conf, 'widgets_file_name', '')
Hardware = self.Hardware
self.use_fast_heart_beat = hasattr(Hardware, "FastHeartBeat")
self.poll_gui_control = hasattr(Hardware, "PollGuiControl")
# Initialization - may be over-written by persistent state
self.local_conf.Initialize()
self.clip_time0 = 0 # timer to display a CLIP message on ADC overflow
Expand Down Expand Up @@ -6455,6 +6457,8 @@ def OnReadSound(self): # called at frequent intervals
self.hamlib_com2_handler.Process()
if self.use_fast_heart_beat:
Hardware.FastHeartBeat()
if self.poll_gui_control:
Hardware.PollGuiControl()
if conf.do_repeater_offset:
hold = QS.tx_hold_state(-1)
if hold == 2: # Tx is being held for an FM repeater TX frequency shift
Expand Down
2 changes: 2 additions & 0 deletions quisk_hardware_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def InitBscope(self, int_size, endian, clock, length): # Bandscope initializatio
self.application.bandscope_clock = clock
#def PollCwKey(self): # Optional. Called frequently by the sound thread to check the CW key status.
# pass # Do not define if not needed.
#def PollGuiControl(self): # Optional. Called frequently by the GUI thread to change GUI settings (PTT etc.)
# pass # Do not define if not needed.
def StartSamples(self): # Quisk calls this from the sound thread to start sending samples.
# If you return a string, it replaces the string returned from hardware open()
pass
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 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.38'
Version = '4.2.39'

fp = open("__init__.py", "w") # write title string
fp.write("#Quisk version %s\n" % Version)
Expand Down

0 comments on commit fb888a2

Please sign in to comment.