mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
updated rigctld integration
This commit is contained in:
parent
6d555b9362
commit
770a6ccdaa
3 changed files with 28 additions and 21 deletions
21
tnc/main.py
21
tnc/main.py
|
@ -12,7 +12,7 @@ import argparse
|
|||
import threading
|
||||
import static
|
||||
import subprocess
|
||||
|
||||
import sys
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
|
@ -63,13 +63,26 @@ if __name__ == '__main__':
|
|||
else:
|
||||
dtr_state = "NONE"
|
||||
|
||||
command = "exec ./hamlib/linux/rigctld -r " + str(static.HAMLIB_DEVICE_PORT) + \
|
||||
if sys.platform == "linux":
|
||||
command = "exec ./hamlib/linux/rigctld -r " + str(static.HAMLIB_DEVICE_PORT) + \
|
||||
" -s "+ str(static.HAMLIB_SERIAL_SPEED) + \
|
||||
" -P "+ str(static.HAMLIB_PTT_TYPE) + \
|
||||
" -m "+ str(static.HAMLIB_DEVICE_ID) + \
|
||||
" --set-conf=dtr_state=" + dtr_state
|
||||
p = subprocess.Popen(command, shell=True)
|
||||
|
||||
try:
|
||||
p = subprocess.Popen(command, shell=True)
|
||||
except:
|
||||
print("hamlib not started")
|
||||
sys.exit()
|
||||
|
||||
elif sys.platform == "darwin":
|
||||
print("platform not yet supported")
|
||||
sys.exit()
|
||||
|
||||
elif sys.platform == "win32":
|
||||
print("platform not yet supported")
|
||||
sys.exit()
|
||||
|
||||
else:
|
||||
print("platform not supported!")
|
||||
sys.exit()
|
||||
|
|
|
@ -646,17 +646,10 @@ class RF():
|
|||
static.SNR = 0
|
||||
|
||||
def get_radio_stats(self):
|
||||
#static.HAMLIB_FREQUENCY = float(self.my_rig.get_freq()/1000)
|
||||
#(hamlib_mode, static.HAMLIB_BANDWITH) = self.my_rig.get_mode()
|
||||
#static.HAMLIB_MODE = Hamlib.rig_strrmode(hamlib_mode)
|
||||
|
||||
static.HAMLIB_FREQUENCY = rigctld.get_frequency()
|
||||
static.HAMLIB_MODE = rigctld.get_mode()[0]
|
||||
static.HAMLIB_BANDWITH = rigctld.get_mode()[1]
|
||||
print(static.HAMLIB_MODE)
|
||||
print(static.HAMLIB_FREQUENCY)
|
||||
print(static.HAMLIB_BANDWITH)
|
||||
|
||||
|
||||
|
||||
def calculate_fft(self, data_in):
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
import socket
|
||||
import logging
|
||||
import static
|
||||
|
||||
# rigctl - https://github.com/darksidelemm/rotctld-web-gui/blob/master/rotatorgui.py#L35
|
||||
# https://github.com/xssfox/freedv-tnc/blob/master/freedvtnc/rigctl.py
|
||||
|
@ -64,9 +65,9 @@ class Rigctld():
|
|||
if data is not None:
|
||||
data = data.split(b'\n')
|
||||
try:
|
||||
freq = int(data[0])
|
||||
freq = int(data[0])/1000
|
||||
except:
|
||||
freq = 0
|
||||
freq = static.HAMLIB_FREQUENCY
|
||||
print(data)
|
||||
return freq
|
||||
|
||||
|
@ -79,7 +80,7 @@ class Rigctld():
|
|||
bandwith = int(data[1])
|
||||
except:
|
||||
print(data)
|
||||
mode = '0'
|
||||
bandwith = 0
|
||||
mode = static.HAMLIB_MODE
|
||||
bandwith = static.HAMLIB_BANDWITH
|
||||
return [mode, bandwith]
|
||||
|
||||
|
|
Loading…
Reference in a new issue