Skip to content

Commit

Permalink
Merge pull request #220 from alduhoo/alduhoo/cw/speed
Browse files Browse the repository at this point in the history
Support setting CW speed via rigctl
  • Loading branch information
mbridak authored Nov 21, 2024
2 parents 09fbb71 + e3a5e2c commit 80add56
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,8 @@ def cwspeed_spinbox_changed(self) -> None:
if self.pref.get("cwtype") == 3 and self.rig_control is not None:
if self.rig_control.interface == "flrig":
self.rig_control.cat.set_flrig_cw_speed(self.cw_speed.value())
elif self.rig_control.interface == "rigctld":
self.rig_control.cat.set_rigctl_cw_speed(self.cw_speed.value())

def stop_cw(self):
""""""
Expand Down
17 changes: 16 additions & 1 deletion not1mm/lib/cat_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
command lines to test the CW API via XMLRPC
Setting WPM
curl -d "<?xml version='1.0'?><methodCall><methodName>rig.cwio_set_wpm</methodName><params><param><value><i4>28</i4></value></param></params></methodCall>" http://localhost:12345
curl -d "<?xml version='1.0'?><methodCall><methodName>rig.cwio_set_wpm</methodName><params><param><value><i4>28</i4></value></param></params></methodCall>" http://localhost:12345
Setting the text to send
curl -d "<?xml version='1.0'?><methodCall><methodName>rig.cwio_text</methodName><params><param><value><string>test test test</string></value></param></params></methodCall>" http://localhost:12345
Expand Down Expand Up @@ -178,6 +178,21 @@ def sendcwrigctl(self, texttosend):
self.__initialize_rigctrld()
return False

def set_rigctl_cw_speed(self, speed):
"""Set CW speed via rigctld"""
if self.rigctrlsocket:
try:
self.online = True
self.rigctrlsocket.send(bytes(f"L KEYSPD {speed}\n", "utf-8"))
_ = self.__get_serial_string()
return
except socket.error as exception:
self.online = False
logger.debug("set_level_rigctld: %s", f"{exception}")
self.rigctrlsocket = None
return
self.__initialize_rigctrld()

def sendcwxmlrpc(self, texttosend):
"""Add text to flrig's cw send buffer."""
logger.debug(f"{texttosend=}")
Expand Down

0 comments on commit 80add56

Please sign in to comment.