PyFT8 2.7.7__tar.gz → 2.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyft8-2.7.7 → pyft8-2.8.0}/PKG-INFO +1 -1
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/mqtt.py +19 -18
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/pyft8.py +10 -7
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8.egg-info/PKG-INFO +1 -1
- {pyft8-2.7.7 → pyft8-2.8.0}/pyproject.toml +1 -1
- {pyft8-2.7.7 → pyft8-2.8.0}/LICENSE +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/MANIFEST.in +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/__init__.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/callhashes.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/gui.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/hamlib.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/maidenhead.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/pskr_upload.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/receiver.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/rigctrl.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/time_utils.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8/transmitter.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8.egg-info/SOURCES.txt +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8.egg-info/dependency_links.txt +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8.egg-info/entry_points.txt +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8.egg-info/requires.txt +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/PyFT8.egg-info/top_level.txt +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/README.md +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/setup.cfg +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/tests/dev/CQ AAAA.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/tests/dev/osd.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/tests/dev/test_generate_wav.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/tests/dev/test_loopback_performance.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/tests/dev/view_worked_before.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/tests/plot_baseline.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/tests/spare.py +0 -0
- {pyft8-2.7.7 → pyft8-2.8.0}/tests/test_batch_and_live.py +0 -0
|
@@ -38,13 +38,13 @@ class PSKR_MQTT_listener:
|
|
|
38
38
|
def __init__(self, config_folder, my_call, home_square, pskr_refresh_mins):
|
|
39
39
|
self.pskr_refresh_mins = pskr_refresh_mins
|
|
40
40
|
self.my_call = my_call
|
|
41
|
-
self.hearing_me = DiskDict(f"{config_folder}/hearing_me.pkl")
|
|
42
|
-
self.heard_by_me = DiskDict(f"{config_folder}/heard_by_me.pkl")
|
|
41
|
+
self.hearing_me = DiskDict(f"{config_folder}/hearing_me.pkl") # all-time record of hearing me
|
|
42
|
+
self.heard_by_me = DiskDict(f"{config_folder}/heard_by_me.pkl") # all-time record of heard by me
|
|
43
43
|
self.hearing_me_new = []
|
|
44
44
|
self.heard_by_me_new = []
|
|
45
45
|
self.home_square = home_square
|
|
46
|
-
self.callsign_cache = DiskDict(f"{config_folder}/callsign_cache.pkl")
|
|
47
|
-
self.band_TxRx_homecall_report_times = DiskDict(f"{config_folder}/report_times.pkl")
|
|
46
|
+
self.callsign_cache = DiskDict(f"{config_folder}/callsign_cache.pkl") # all time cache call -> fine locator
|
|
47
|
+
self.band_TxRx_homecall_report_times = DiskDict(f"{config_folder}/report_times.pkl") # last 20 mins data -> per band tx/rx & current band detail
|
|
48
48
|
self.home_activity = {}
|
|
49
49
|
self.home_most_remotes = {}
|
|
50
50
|
self.lock = threading.Lock()
|
|
@@ -72,33 +72,32 @@ class PSKR_MQTT_listener:
|
|
|
72
72
|
|
|
73
73
|
def add_homespots_record(self, key, t):
|
|
74
74
|
self.band_TxRx_homecall_report_times.data.setdefault(key, [])
|
|
75
|
-
self.band_TxRx_homecall_report_times.data[key].append(t)
|
|
75
|
+
self.band_TxRx_homecall_report_times.data[key].append(int(t))
|
|
76
76
|
|
|
77
77
|
def add_myspots_record(self, data, band, call, t, rp):
|
|
78
78
|
data.setdefault(band, {})
|
|
79
|
-
data[band][call] = {'t': t,'rp':rp
|
|
79
|
+
data[band][call] = {'t': int(t),'rp':int(rp)}
|
|
80
80
|
|
|
81
81
|
def on_message(self, client, userdata, msg):
|
|
82
82
|
try:
|
|
83
83
|
d = literal_eval(msg.payload.decode())
|
|
84
84
|
except:
|
|
85
85
|
return
|
|
86
|
-
tnow = time.time()
|
|
86
|
+
tnow = int(time.time())
|
|
87
87
|
sc, rc = (d['sc'], d['sl']), (d['rc'], d['rl'])
|
|
88
88
|
for iTxRx, call_loc in enumerate([sc, rc]):
|
|
89
89
|
call, loc = call_loc
|
|
90
90
|
self.store_best_location(call, loc)
|
|
91
91
|
if self.home_square in loc:
|
|
92
92
|
self.add_homespots_record((d['b'], iTxRx, call), tnow)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
self.heard_by_me.data[d['b']][d['sc']] = {'t': tnow,'rp': d['rp'],'c': d['sc']}
|
|
93
|
+
if d['sc'] == self.my_call:
|
|
94
|
+
if d['rc'] not in self.hearing_me.data[d['b']]:
|
|
95
|
+
self.hearing_me_new.append(d['rc'])
|
|
96
|
+
self.add_myspots_record(self.hearing_me.data, d['b'], d['rc'], tnow, d['rp'])
|
|
97
|
+
if d['rc'] == self.my_call:
|
|
98
|
+
if d['sc'] not in self.heard_by_me.data[d['b']]:
|
|
99
|
+
self.heard_by_me_new.append(d['sc'])
|
|
100
|
+
self.add_myspots_record(self.heard_by_me.data, d['b'], d['sc'], tnow, d['rp'])
|
|
102
101
|
|
|
103
102
|
def count_activity(self):
|
|
104
103
|
import numpy as np
|
|
@@ -128,8 +127,10 @@ class PSKR_MQTT_listener:
|
|
|
128
127
|
self.home_activity[b][iTxRx] +=1
|
|
129
128
|
self.home_most_remotes.setdefault(b, [('',0), ('',0)])
|
|
130
129
|
nremotes = len(band_TxRx_homecall_report_times)
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
current_winner = self.home_most_remotes[b][iTxRx]
|
|
131
|
+
if nremotes > current_winner[1]:
|
|
132
|
+
if c != self.my_call:
|
|
133
|
+
self.home_most_remotes[b][iTxRx] = (c, nremotes)
|
|
133
134
|
|
|
134
135
|
def get_spot_counts(self, band, call):
|
|
135
136
|
tx_reports = self.band_TxRx_homecall_report_times.data.get((band, 0, call), [])
|
|
@@ -14,7 +14,7 @@ from PyFT8.hamlib import Rig_hamlib
|
|
|
14
14
|
from PyFT8.mqtt import PSKR_MQTT_listener
|
|
15
15
|
import PyFT8.maidenhead as maidenhead
|
|
16
16
|
|
|
17
|
-
VER = '2.
|
|
17
|
+
VER = '2.8.0'
|
|
18
18
|
|
|
19
19
|
MAX_TX_START_SECONDS = 2.5
|
|
20
20
|
HEARING_PANEL_LIFE_MINS = 5
|
|
@@ -75,7 +75,7 @@ class ADIF:
|
|
|
75
75
|
console_print(f"Logged QSO with {oStation['c']}")
|
|
76
76
|
|
|
77
77
|
def _build_cache(self):
|
|
78
|
-
import
|
|
78
|
+
import calendar
|
|
79
79
|
def parse(rec, field):
|
|
80
80
|
p = rec.find(field)
|
|
81
81
|
if p > 0:
|
|
@@ -87,7 +87,10 @@ class ADIF:
|
|
|
87
87
|
for l in f.readlines():
|
|
88
88
|
if parse(l, 'mode') == "FT8":
|
|
89
89
|
c, b, d, t = parse(l, 'call'), parse(l, 'band'), parse(l, 'qso_date'), parse(l, 'time_on')
|
|
90
|
-
|
|
90
|
+
time_tuple = time.strptime(d+t, "%Y%m%d%H%M%S")
|
|
91
|
+
tm = calendar.timegm(time_tuple)
|
|
92
|
+
# if time.time()-tm < 36000:
|
|
93
|
+
# print(c, b, d, t, int(time.time()-tm))
|
|
91
94
|
cache[c] = tm
|
|
92
95
|
cache[c + "_"+b+"_FT8"] = tm
|
|
93
96
|
return cache
|
|
@@ -130,7 +133,7 @@ class FT8_QSO:
|
|
|
130
133
|
def __init__(self):
|
|
131
134
|
if config is not None:
|
|
132
135
|
self.mStation = {'c':config['station']['call'], 'g':config['station']['grid']}
|
|
133
|
-
self.band_info = {'b':None, 'fMHz':0}
|
|
136
|
+
self.band_info = {'b':None, 'fMHz':0, 'time_set':0}
|
|
134
137
|
self.tx_freq = 750
|
|
135
138
|
threading.Thread(target = self._transmitter, daemon = True).start()
|
|
136
139
|
self.clear()
|
|
@@ -254,7 +257,7 @@ def write_all_txt_row(message):
|
|
|
254
257
|
|
|
255
258
|
#============= Callbacks for Receiver ==========================================================
|
|
256
259
|
def on_rx_decode(c):
|
|
257
|
-
if (c.decode_completed - qso.band_info['time_set']) <
|
|
260
|
+
if (c.decode_completed - qso.band_info['time_set']) < 9: # prevent bad QRG -> heard_by_me and pskreporter upload data
|
|
258
261
|
return
|
|
259
262
|
message = Message(c)
|
|
260
263
|
if gui:
|
|
@@ -285,7 +288,7 @@ def on_rx_busy_profile(busy_profile_new, cycle):
|
|
|
285
288
|
idx = np.argmin(busy_profile[f0_idx:fn_idx])
|
|
286
289
|
clearest_frequency = (f0_idx + idx) * audio_in.df
|
|
287
290
|
busy_profile = busy_profile_new
|
|
288
|
-
console_print(f"[on_busy] Clear Tx frequency found at {clearest_frequency:6.1f}")
|
|
291
|
+
#console_print(f"[on_busy] Clear Tx frequency found at {clearest_frequency:6.1f}")
|
|
289
292
|
|
|
290
293
|
#============= Callbacks for GUI ==========================================================
|
|
291
294
|
def on_gui_sidebars_refresh(gui, display_cycle):
|
|
@@ -331,7 +334,7 @@ def on_gui_sidebars_refresh(gui, display_cycle):
|
|
|
331
334
|
new_calls = pskr_info.hearing_me_new if display_cycle == 1 else pskr_info.heard_by_me_new
|
|
332
335
|
for remote_call in calls_now:
|
|
333
336
|
rpt = band_rpts[remote_call]
|
|
334
|
-
|
|
337
|
+
snr, geo_text, timestamp = int(rpt['rp']), get_geo_text(remote_call), rpt['t']
|
|
335
338
|
color = 'white' if remote_call in new_calls else 'lime'
|
|
336
339
|
display_rows.append((f"{remote_call:<7} {snr:+03d} {geo_text:<12}", timestamp, color))
|
|
337
340
|
display_rows.sort(key = lambda row: row[1], reverse = True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|