Merge pull request #647 from DJ2LS/rigctld-win

Internal rigctld tweaks for windows users
This commit is contained in:
DJ2LS 2024-02-11 21:38:24 +01:00 committed by GitHub
commit f437b2a01b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 3 deletions

View file

@ -21,7 +21,7 @@ ip = 127.0.0.1
port = 4532
path =
command =
arguments = --cenas
arguments =
[RADIO]
control = disabled

View file

@ -18,6 +18,7 @@ from pathlib import Path
import platform
import subprocess
import psutil
import glob
log = structlog.get_logger("helpers")
@ -738,8 +739,9 @@ def find_binary_path(binary_name="rigctld", search_system_wide=False):
if platform.system() != 'Windows':
system_paths.extend(['/usr/bin', '/usr/local/bin', '/bin'])
else:
system_paths.extend(['C:\\Windows\\System32', 'C:\\Windows'])
system_paths.extend(glob.glob("C:\\Program Files\\Hamlib*\\bin"))
system_paths.extend(glob.glob("C:\\Program Files (x86)\\Hamlib*\\bin"))
for path in system_paths:
potential_path = os.path.join(path, binary_name)
if os.path.isfile(potential_path):

View file

@ -221,6 +221,7 @@ class radio:
def format_rigctld_args(self):
config = self.config['RADIO'] # Accessing the 'RADIO' section of the INI file
config_rigctld = self.config['RIGCTLD'] # Accessing the 'RIGCTLD' section of the INI file for custom args
args = []
# Helper function to check if the value should be ignored
@ -251,5 +252,10 @@ class radio:
if not should_ignore(config.get('stop_bits', "0")):
args += ['--set-conf', f'stop_bits={config["stop_bits"]}']
# Handle custom arguments for rigctld
# Custom args are split via ' ' so python doesn't add extranaeous quotes on windows
args += config_rigctld["arguments"].split(" ")
#print("Hamlib args ==>" + str(args))
return args