Skip to content

Commit

Permalink
v6.10
Browse files Browse the repository at this point in the history
  • Loading branch information
llinkz committed Apr 25, 2020
1 parent 6ca1cfe commit 1a0f24e
Show file tree
Hide file tree
Showing 3 changed files with 367 additions and 359 deletions.
18 changes: 10 additions & 8 deletions compute_ultimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,16 @@ def run(self):
octave_errors = [b'index-out-of-bounds', b'< 2 good stations found', b'Octave:nonconformant - args',
b'n_stn=2 is not supported', b'resample.m: p and q must be positive integers',
b'Octave:invalid-index', b'incomplete \'data\' chunk']
if sys.version_info[0] == 2:
tdoa_filename = self.m_file_to_process
proc = subprocess.Popen(['octave-cli', tdoa_filename], cwd=self.tdoa_rootdir, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE, shell=False)
else:
tdoa_filename = self.m_file_to_process.replace(".m", "")
proc = subprocess.Popen(['octave-cli', '--eval', tdoa_filename], cwd=self.tdoa_rootdir,
stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=False)
proc = subprocess.Popen(['octave-cli', self.m_file_to_process], cwd=self.tdoa_rootdir, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE, shell=False)
# if sys.version_info[0] == 2:
# tdoa_filename = self.m_file_to_process
# proc = subprocess.Popen(['octave-cli', tdoa_filename], cwd=self.tdoa_rootdir, stderr=subprocess.STDOUT,
# stdout=subprocess.PIPE, shell=False)
# else:
# tdoa_filename = self.m_file_to_process.replace(".m", "")
# proc = subprocess.Popen(['octave-cli', '--eval', tdoa_filename], cwd=self.tdoa_rootdir,
# stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=False)
PROC_PID = proc.pid
if PROC_PID:
APP.gui.writelog("ultimateTDoA process started.")
Expand Down
10 changes: 8 additions & 2 deletions directTDoA.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def __init__(self, parent=None):

def run(self):
try:
tdoa_id_index = 1
# Get the node list from linkfanel website
nodelist = requests.get("http://rx.linkfanel.net/kiwisdr_com.js")
# Convert that listing to fit a JSON format (also removing bad/incomplete node entries)
Expand Down Expand Up @@ -229,9 +230,9 @@ def run(self):
except:
pass
try:
# Search for a Hamcall in the name, becomes the node ID name if OK
# Search for a Hamcall in the name, becomes the node ID name if OK - first call found.
hamcallfield = re.search(
r"(.*)(\s|,|/|^)([A-Za-z]{1,2}[0-9][A-Za-z]{1,3})(\s|,|/|@|-)(.*)",
r"(.*?)(\s|,|/|^)([A-Za-z]{1,2}[0-9][A-Za-z]{1,3})(\s|,|/|@|-)(.*)",
json_data[i]['name'])
node_id = hamcallfield.group(3).upper()
except:
Expand Down Expand Up @@ -259,6 +260,11 @@ def run(self):
snr_search = "15"
if node_id[0].isdigit():
node_id = "h" + node_id
# Check if TDoA id already exists in the db, then change it with an incremental index
with codecs.open('directTDoA_server_list.db', 'rb', encoding='utf8') as db_file2:
if "\"" + node_id + "\"" in db_file2.read():
node_id = node_id + "/" + str(tdoa_id_index)
tdoa_id_index += 1
nodeinfo = dict(
mac=json_data[i]['id'],
url=json_data[i]['url'].split('//', 1)[1],
Expand Down
Loading

0 comments on commit 1a0f24e

Please sign in to comment.