PyFT8 2.7.4__tar.gz → 2.7.6__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.
Files changed (32) hide show
  1. {pyft8-2.7.4 → pyft8-2.7.6}/PKG-INFO +1 -1
  2. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/gui.py +3 -1
  3. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/mqtt.py +9 -7
  4. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/pyft8.py +8 -5
  5. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8.egg-info/PKG-INFO +1 -1
  6. {pyft8-2.7.4 → pyft8-2.7.6}/pyproject.toml +1 -1
  7. {pyft8-2.7.4 → pyft8-2.7.6}/LICENSE +0 -0
  8. {pyft8-2.7.4 → pyft8-2.7.6}/MANIFEST.in +0 -0
  9. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/__init__.py +0 -0
  10. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/callhashes.py +0 -0
  11. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/hamlib.py +0 -0
  12. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/maidenhead.py +0 -0
  13. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/pskr_upload.py +0 -0
  14. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/receiver.py +0 -0
  15. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/rigctrl.py +0 -0
  16. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/time_utils.py +0 -0
  17. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8/transmitter.py +0 -0
  18. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8.egg-info/SOURCES.txt +0 -0
  19. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8.egg-info/dependency_links.txt +0 -0
  20. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8.egg-info/entry_points.txt +0 -0
  21. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8.egg-info/requires.txt +0 -0
  22. {pyft8-2.7.4 → pyft8-2.7.6}/PyFT8.egg-info/top_level.txt +0 -0
  23. {pyft8-2.7.4 → pyft8-2.7.6}/README.md +0 -0
  24. {pyft8-2.7.4 → pyft8-2.7.6}/setup.cfg +0 -0
  25. {pyft8-2.7.4 → pyft8-2.7.6}/tests/dev/CQ AAAA.py +0 -0
  26. {pyft8-2.7.4 → pyft8-2.7.6}/tests/dev/osd.py +0 -0
  27. {pyft8-2.7.4 → pyft8-2.7.6}/tests/dev/test_generate_wav.py +0 -0
  28. {pyft8-2.7.4 → pyft8-2.7.6}/tests/dev/test_loopback_performance.py +0 -0
  29. {pyft8-2.7.4 → pyft8-2.7.6}/tests/dev/view_worked_before.py +0 -0
  30. {pyft8-2.7.4 → pyft8-2.7.6}/tests/plot_baseline.py +0 -0
  31. {pyft8-2.7.4 → pyft8-2.7.6}/tests/spare.py +0 -0
  32. {pyft8-2.7.4 → pyft8-2.7.6}/tests/test_batch_and_live.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyFT8
3
- Version: 2.7.4
3
+ Version: 2.7.6
4
4
  Summary: FT8 Decoding and Encoding in Python with test/loopback code
5
5
  Author-email: G1OJS <g1ojs@yahoo.com>
6
6
  License-Expression: GPL-3.0-or-later
@@ -147,6 +147,9 @@ class Gui:
147
147
  self.make_layout(config)
148
148
  self.ani = FuncAnimation(self.fig, self._animate, interval = 40, frames=(100000), blit=True)
149
149
 
150
+ def set_bandstats_title(self, txt):
151
+ self.band_stats.ax.set_title(txt, fontsize = 10)
152
+
150
153
  def make_layout(self, config):
151
154
  # figure
152
155
  self.plt = plt
@@ -165,7 +168,6 @@ class Gui:
165
168
  self.band_stats = Scrollbox(self.fig, [L['pmargin'], wf_top+L['vsep1'], L['sidebar_width'], L['banner_height']], nlines = 4, monospace = True)
166
169
  self.band_stats.ax.text(-0.2,0.75,'Tx')
167
170
  self.band_stats.ax.text(-0.2,0.25,'Rx')
168
- self.band_stats.ax.set_title(f"Spots to/from {config['station']['grid'][:4]} <15 mins", fontsize = 10)
169
171
 
170
172
  # console
171
173
  self.console = Scrollbox(self.fig, [wf_left, wf_top+L['vsep1'], 1-wf_left-L['pmargin'], L['banner_height']])
@@ -3,8 +3,6 @@ import threading
3
3
  import time
4
4
  from ast import literal_eval
5
5
 
6
- SPOTLIFE = 15*60
7
-
8
6
  import os
9
7
  import pickle
10
8
 
@@ -37,7 +35,8 @@ class DiskDict:
37
35
  os.replace(tmp_file, self.file)
38
36
 
39
37
  class PSKR_MQTT_listener:
40
- def __init__(self, config_folder, my_call, home_square):
38
+ def __init__(self, config_folder, my_call, home_square, spotlife):
39
+ self.spotlife = spotlife
41
40
  self.my_call = my_call
42
41
  self.hearing_me = DiskDict(f"{config_folder}/hearing_me.pkl")
43
42
  self.heard_by_me = DiskDict(f"{config_folder}/heard_by_me.pkl")
@@ -72,6 +71,9 @@ class PSKR_MQTT_listener:
72
71
  d = literal_eval(msg.payload.decode())
73
72
  except:
74
73
  return
74
+ self.add_spot(d)
75
+
76
+ def add_spot(self, d):
75
77
  sc, rc = (d['sc'], d['sl']), (d['rc'], d['rl'])
76
78
  for iTxRx, c in enumerate([sc, rc]):
77
79
  call, loc = c
@@ -83,12 +85,12 @@ class PSKR_MQTT_listener:
83
85
  self.band_TxRx_homecall_report_times.data[key].append(tnow)
84
86
  if d['sc'] == self.my_call:
85
87
  self.hearing_me.data.setdefault(d['b'], {})
86
- if d['rc'] not in self.hearing_me.data:
88
+ if d['rc'] not in self.hearing_me.data[d['b']]:
87
89
  self.hearing_me_new.append(d['rc'])
88
90
  self.hearing_me.data[d['b']][d['rc']] = {'t': tnow,'rp': d['rp'],'c': d['rc']}
89
91
  if d['rc'] == self.my_call:
90
92
  self.heard_by_me.data.setdefault(d['b'], {})
91
- if d['sc'] not in self.heard_by_me.data:
93
+ if d['sc'] not in self.heard_by_me.data[d['b']]:
92
94
  self.heard_by_me_new.append(d['sc'])
93
95
  self.heard_by_me.data[d['b']][d['sc']] = {'t': tnow,'rp': d['rp'],'c': d['sc']}
94
96
 
@@ -106,10 +108,10 @@ class PSKR_MQTT_listener:
106
108
  for b in self.home_most_remotes:
107
109
  self.home_most_remotes[b] = [('',0), ('',0)]
108
110
 
109
- # keep only the remote spots that happened in the SPOTLIFE window
111
+ # keep only the remote spots that happened in the self.spotlife window
110
112
  for band_TxRx_homecall in self.band_TxRx_homecall_report_times.data:
111
113
  band_TxRx_homecall_report_times = self.band_TxRx_homecall_report_times.data[band_TxRx_homecall]
112
- band_TxRx_homecall_report_times = [t for t in band_TxRx_homecall_report_times if (time.time() - t) < SPOTLIFE]
114
+ band_TxRx_homecall_report_times = [t for t in band_TxRx_homecall_report_times if (time.time() - t) < self.spotlife]
113
115
  self.band_TxRx_homecall_report_times.data[band_TxRx_homecall] = band_TxRx_homecall_report_times
114
116
 
115
117
  # count number of local Tx and Rx, and identify the local Tx and Rx with most remote spots
@@ -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.7.4'
17
+ VER = '2.7.6'
18
18
 
19
19
  MAX_TX_START_SECONDS = 2.5
20
20
  SPOTLIFE = 5*60
@@ -257,9 +257,12 @@ def on_rx_decode(c):
257
257
  if gui:
258
258
  gui.add_message_box(message)
259
259
  if qso.band_info['b'] is not None and pskr_upload is not None:
260
- dx_call = c.msg_tuple[1]
260
+ _, dx_call, dx_grid = c.msg_tuple
261
261
  if dx_call != 'not' and dx_call != config['station']['call']:
262
262
  pskr_upload.add_report(dx_call, int(1000000*float(qso.band_info['fMHz'])) + c.fHz, c.snr, 'FT8', 1, int(time.time()))
263
+ loc = pskr_info.callsign_cache.data.get(dx_call, dx_grid)
264
+ # can't use the next line unless I keep more info than just time in the spots data and deduplicate
265
+ # pskr_info.add_spot({'sc':dx_call, 'sl':loc, 'rc':config['station']['call'], 'rl':config['station']['grid'], 'b':qso.band_info['b'], 'rp': c.snr})
263
266
  print(message.wsjtx_screen_format())
264
267
  write_all_txt_row(message)
265
268
 
@@ -274,7 +277,7 @@ def on_rx_busy_profile(busy_profile_new, cycle):
274
277
  idx = np.argmin(busy_profile[f0_idx:fn_idx])
275
278
  clearest_frequency = (f0_idx + idx) * audio_in.df
276
279
  busy_profile = busy_profile_new
277
- console_print(f"[on_busy] Set Tx freq to {clearest_frequency:6.1f}")
280
+ console_print(f"[on_busy] Clear Tx frequency found at {clearest_frequency:6.1f}")
278
281
 
279
282
  #============= Callbacks for GUI ==========================================================
280
283
  def on_gui_sidebars_refresh(gui):
@@ -301,7 +304,6 @@ def on_gui_sidebars_refresh(gui):
301
304
  tx_lead, rx_lead = pskr_info.home_most_remotes[b]
302
305
  call = config['station']['call']
303
306
  n_spotted, n_spotting = pskr_info.get_spot_counts(b, call)
304
- # add local count here for n_spotted prior to round trip to pskreporter?
305
307
  gui.band_stats.scroll_print(f"{call:<7} {tx_lead[0]:<7}", color = '#ff756b')
306
308
  gui.band_stats.scroll_print(f"{n_spotting:<7} {tx_lead[1]:<7}", color = '#ff756b')
307
309
  gui.band_stats.scroll_print(f"{call:<7} {rx_lead[0]:<7}", color = '#b6f0c6')
@@ -371,7 +373,7 @@ def cli():
371
373
  if mc is not None and 'pskreporter' in config.keys():
372
374
  if config['pskreporter']['upload'] == 'Y':
373
375
  pskr_upload = PSKR_upload(mc, mg, software = f"PyFT8 v{VER}", console_print = console_print) if not mc is None else None
374
- pskr_info = PSKR_MQTT_listener(config_folder, mc, mg[:4])
376
+ pskr_info = PSKR_MQTT_listener(config_folder, mc, mg[:4], SPOTLIFE)
375
377
  qso = FT8_QSO()
376
378
  if config.has_section('hamlib_rig'):
377
379
  console_print("Connecting to rig via Hamlib")
@@ -403,6 +405,7 @@ def cli():
403
405
  rx = Receiver(audio_in, [200, 3100], on_rx_decode, on_rx_busy_profile)
404
406
  audio_in.start_streamed_audio(input_device_idx)
405
407
  if gui is not None:
408
+ gui.set_bandstats_title(f"Spots to/from {config['station']['grid'][:4]} <{SPOTLIFE/60:.0f} mins")
406
409
  gui.plt.show()
407
410
  else:
408
411
  wait_for_keyboard()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyFT8
3
- Version: 2.7.4
3
+ Version: 2.7.6
4
4
  Summary: FT8 Decoding and Encoding in Python with test/loopback code
5
5
  Author-email: G1OJS <g1ojs@yahoo.com>
6
6
  License-Expression: GPL-3.0-or-later
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "PyFT8"
3
- version = "2.7.4"
3
+ version = "2.7.6"
4
4
  license = "GPL-3.0-or-later"
5
5
 
6
6
  authors = [
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