not1mm 24.9.3__py3-none-any.whl → 24.9.6__py3-none-any.whl

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.
not1mm/__main__.py CHANGED
@@ -67,6 +67,7 @@ from not1mm.lib.settings import Settings
67
67
  from not1mm.lib.version import __version__
68
68
  from not1mm.lib.versiontest import VersionTest
69
69
  from not1mm.lib.ft8_watcher import FT8Watcher
70
+ from not1mm.lib.fldigi_watcher import FlDigiWatcher
70
71
 
71
72
  import not1mm.fsutils as fsutils
72
73
  from not1mm.logwindow import LogWindow
@@ -163,7 +164,9 @@ class MainWindow(QtWidgets.QMainWindow):
163
164
 
164
165
  radio_thread = QThread()
165
166
  voice_thread = QThread()
167
+ fldigi_thread = QThread()
166
168
 
169
+ fldigi_watcher = None
167
170
  rig_control = None
168
171
  log_window = None
169
172
  check_window = None
@@ -193,7 +196,7 @@ class MainWindow(QtWidgets.QMainWindow):
193
196
  self.rightdot.hide()
194
197
  self.n1mm = N1MM()
195
198
  self.ft8 = FT8Watcher()
196
- self.ft8.set_callback(self.ft8_result)
199
+ self.ft8.set_callback(None)
197
200
  self.mscp = SCP(fsutils.APP_DATA_PATH)
198
201
  self.next_field = self.other_2
199
202
  self.dupe_indicator.hide()
@@ -507,6 +510,13 @@ class MainWindow(QtWidgets.QMainWindow):
507
510
  | QtWidgets.QDockWidget.DockWidgetFeature.DockWidgetMovable
508
511
  )
509
512
 
513
+ self.fldigi_watcher = FlDigiWatcher()
514
+ self.fldigi_watcher.moveToThread(self.fldigi_thread)
515
+ self.fldigi_thread.started.connect(self.fldigi_watcher.run)
516
+ self.fldigi_thread.finished.connect(self.fldigi_watcher.deleteLater)
517
+ self.fldigi_watcher.poll_callback.connect(self.fldigi_qso)
518
+ self.fldigi_thread.start()
519
+
510
520
  self.log_window = LogWindow()
511
521
  self.log_window.setObjectName("log-window")
512
522
  if os.environ.get("WAYLAND_DISPLAY"):
@@ -566,32 +576,50 @@ class MainWindow(QtWidgets.QMainWindow):
566
576
  "You can udate to the current version by using:\npip install -U not1mm"
567
577
  )
568
578
 
569
- def ft8_result(self, result: dict):
579
+ def fldigi_qso(self, result: str):
570
580
  """
571
- Callback for ft8 watcher
581
+ gets called when there is a new fldigi qso logged.
572
582
 
573
583
  {
574
- 'CALL': 'KE0OG',
575
- 'GRIDSQUARE': 'DM10AT',
576
- 'MODE': 'FT8',
577
- 'RST_SENT': '',
578
- 'RST_RCVD': '',
579
- 'QSO_DATE': '20210329',
580
- 'TIME_ON': '183213',
581
- 'QSO_DATE_OFF': '20210329',
582
- 'TIME_OFF': '183213',
583
- 'BAND': '20M',
584
- 'FREQ': '14.074754',
584
+ 'FREQ': '7.029500',
585
+ 'CALL': 'DL2DSL',
586
+ 'MODE': 'RTTY',
587
+ 'NAME': 'BOB',
588
+ 'QSO_DATE': '20240904',
589
+ 'QSO_DATE_OFF': '20240904',
590
+ 'TIME_OFF': '212825',
591
+ 'TIME_ON': '212800',
592
+ 'RST_RCVD': '599',
593
+ 'RST_SENT': '599',
594
+ 'BAND': '40M',
595
+ 'COUNTRY': 'FED. REP. OF GERMANY',
596
+ 'CQZ': '14',
597
+ 'STX': '000',
598
+ 'STX_STRING': '1D ORG',
599
+ 'CLASS': '1D',
600
+ 'ARRL_SECT': 'DX',
601
+ 'TX_PWR': '0',
602
+ 'OPERATOR': 'K6GTE',
585
603
  'STATION_CALLSIGN': 'K6GTE',
586
604
  'MY_GRIDSQUARE': 'DM13AT',
587
- 'CONTEST_ID': 'ARRL-FIELD-DAY',
588
- 'SRX_STRING': '1D UT',
589
- 'CLASS': '1D',
590
- 'ARRL_SECT': 'UT'
605
+ 'MY_CITY': 'ANAHEIM, CA',
606
+ 'MY_STATE': 'CA'
591
607
  }
592
608
 
593
609
  """
594
- print(f"{result=}")
610
+
611
+ datadict = {}
612
+ splitdata = result.upper().strip().split("<")
613
+ for data in splitdata:
614
+ if data:
615
+ tag = data.split(":")
616
+ if tag == ["EOR>"]:
617
+ break
618
+ datadict[tag[0]] = tag[1].split(">")[1].strip()
619
+ logger.debug(f"{datadict=}")
620
+ if hasattr(self.contest, "ft8_handler"):
621
+ self.contest.set_self(self)
622
+ self.contest.ft8_handler(datadict)
595
623
 
596
624
  def setDarkMode(self, setdarkmode=False) -> None:
597
625
  """Forces a darkmode palette."""
@@ -1908,7 +1936,7 @@ class MainWindow(QtWidgets.QMainWindow):
1908
1936
  " "
1909
1937
  )[:19]
1910
1938
  self.contact["Call"] = self.callsign.text()
1911
- if self.contact.get("Mode") not in ("FT8", "FT4"):
1939
+ if self.contact.get("Mode") not in ("FT8", "FT4", "RTTY"):
1912
1940
  self.contact["Freq"] = round(
1913
1941
  float(self.radio_state.get("vfoa", 0.0)) / 1000, 2
1914
1942
  )
@@ -347,6 +347,11 @@
347
347
  <string>STEW PERRY TOPBAND</string>
348
348
  </property>
349
349
  </item>
350
+ <item>
351
+ <property name="text">
352
+ <string>WEEKLY RTTY</string>
353
+ </property>
354
+ </item>
350
355
  <item>
351
356
  <property name="text">
352
357
  <string>WINTER FIELD DAY</string>
@@ -841,7 +846,7 @@
841
846
  <enum>Qt::Horizontal</enum>
842
847
  </property>
843
848
  <property name="standardButtons">
844
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
849
+ <set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
845
850
  </property>
846
851
  <property name="centerButtons">
847
852
  <bool>true</bool>
not1mm/lib/database.py CHANGED
@@ -663,8 +663,8 @@ class DataBase:
663
663
  logger.debug("%s", exception)
664
664
  return {}
665
665
 
666
- def fetch_call_exists(self, call) -> dict:
667
- """returns a dict key of nr_count"""
666
+ def fetch_call_exists(self, call: str) -> dict:
667
+ """returns a dict key of call_count"""
668
668
  try:
669
669
  with sqlite3.connect(self.database) as conn:
670
670
  conn.row_factory = self.row_factory
@@ -0,0 +1,32 @@
1
+ import xmlrpc.client
2
+ from PyQt6.QtCore import QObject, pyqtSignal, QThread, QEventLoop
3
+
4
+
5
+ class FlDigiWatcher(QObject):
6
+ """fldigi watcher"""
7
+
8
+ poll_callback = pyqtSignal(str)
9
+ time_to_quit = False
10
+
11
+ def __init__(self):
12
+ super().__init__()
13
+ ...
14
+
15
+ self.target = "http://127.0.0.1:7362"
16
+ self.payload = ""
17
+ self.response = ""
18
+
19
+ def run(self):
20
+ while not self.time_to_quit:
21
+ try:
22
+ server = xmlrpc.client.ServerProxy(self.target)
23
+ self.response = server.logbook.last_record()
24
+ except OSError:
25
+ continue
26
+ if self.payload != self.response:
27
+ self.payload = self.response
28
+ try:
29
+ self.poll_callback.emit(self.payload)
30
+ except QEventLoop:
31
+ ...
32
+ QThread.msleep(100)
not1mm/lib/ft8_watcher.py CHANGED
@@ -6,10 +6,14 @@ https://github.com/mbridak/not1mm
6
6
  GPL V3
7
7
  """
8
8
 
9
+ import logging
10
+
9
11
  from PyQt6 import QtNetwork
10
12
 
11
13
  import struct
12
14
 
15
+ logger = logging.getLogger(__name__)
16
+
13
17
 
14
18
  class FT8Watcher:
15
19
  """Main Window"""
@@ -64,7 +68,7 @@ class FT8Watcher:
64
68
  datagram, sender_host, sender_port_number = self.udp_socket.readDatagram(
65
69
  self.udp_socket.pendingDatagramSize()
66
70
  )
67
- # print("%s %s %s", sender_host, sender_port_number, datagram)
71
+ logger.debug(f"{datagram=}")
68
72
 
69
73
  if datagram[0:4] != b"\xad\xbc\xcb\xda":
70
74
  return # bail if no wsjt-x magic number
@@ -172,7 +172,7 @@ def gen_adif(self, cabrillo_name: str, contest_id=""):
172
172
  file=file_descriptor,
173
173
  )
174
174
  # ------------CQ 160---------------
175
- elif cabrillo_name in ("CQ-160-CW", "CQ-160-SSB"):
175
+ elif cabrillo_name in ("CQ-160-CW", "CQ-160-SSB", "WEEKLY-RTTY"):
176
176
  rcv = f"{contact.get('Exchange1', '')}"
177
177
  if len(rcv) > 1:
178
178
  print(
not1mm/lib/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.9.3"
3
+ __version__ = "24.9.6"
@@ -296,9 +296,9 @@ def cabrillo(self):
296
296
  for contact in log:
297
297
  the_date_and_time = contact.get("TS", "")
298
298
  themode = contact.get("Mode", "")
299
- if themode in ("LSB", "USB"):
299
+ if themode in ("LSB", "USB", "FM"):
300
300
  themode = "PH"
301
- if themode in ("FT8", "FT4"):
301
+ if themode in ("FT8", "FT4", "RTTY"):
302
302
  themode = "DG"
303
303
  frequency = str(int(contact.get("Freq", "0"))).rjust(5)
304
304
 
@@ -333,7 +333,7 @@ def set_self(the_outie):
333
333
 
334
334
  def ft8_handler(the_packet: dict):
335
335
  """Process FT8 QSO packets
336
-
336
+ FT8
337
337
  {
338
338
  'CALL': 'KE0OG',
339
339
  'GRIDSQUARE': 'DM10AT',
@@ -353,12 +353,36 @@ def ft8_handler(the_packet: dict):
353
353
  'CLASS': '1D',
354
354
  'ARRL_SECT': 'UT'
355
355
  }
356
+ FlDigi
357
+ {
358
+ 'FREQ': '7.029500',
359
+ 'CALL': 'DL2DSL',
360
+ 'MODE': 'RTTY',
361
+ 'NAME': 'BOB',
362
+ 'QSO_DATE': '20240904',
363
+ 'QSO_DATE_OFF': '20240904',
364
+ 'TIME_OFF': '212825',
365
+ 'TIME_ON': '212800',
366
+ 'RST_RCVD': '599',
367
+ 'RST_SENT': '599',
368
+ 'BAND': '40M',
369
+ 'COUNTRY': 'FED. REP. OF GERMANY',
370
+ 'CQZ': '14',
371
+ 'STX': '000',
372
+ 'STX_STRING': '1D ORG',
373
+ 'CLASS': '1D',
374
+ 'ARRL_SECT': 'DX',
375
+ 'TX_PWR': '0',
376
+ 'OPERATOR': 'K6GTE',
377
+ 'STATION_CALLSIGN': 'K6GTE',
378
+ 'MY_GRIDSQUARE': 'DM13AT',
379
+ 'MY_CITY': 'ANAHEIM, CA',
380
+ 'MY_STATE': 'CA'
381
+ }
356
382
 
357
383
  """
358
- print(f"{the_packet=}")
359
-
384
+ logger.debug(f"{the_packet=}")
360
385
  if ALTEREGO is not None:
361
-
362
386
  ALTEREGO.callsign.setText(the_packet.get("CALL"))
363
387
  ALTEREGO.contact["Call"] = the_packet.get("CALL", "")
364
388
  ALTEREGO.contact["SNT"] = ALTEREGO.sent.text()
@@ -373,7 +397,7 @@ def ft8_handler(the_packet: dict):
373
397
  ALTEREGO.contact["Band"] = get_logged_band(
374
398
  str(int(float(the_packet.get("FREQ", "0.0")) * 1000000))
375
399
  )
400
+ logger.debug(f"{ALTEREGO.contact=}")
376
401
  ALTEREGO.other_1.setText(the_packet.get("CLASS", "ERR"))
377
402
  ALTEREGO.other_2.setText(the_packet.get("ARRL_SECT", "ERR"))
378
- print(f"\n{ALTEREGO.contact=}\n")
379
403
  ALTEREGO.save_contact()
@@ -0,0 +1,442 @@
1
+ """Weekly RTTY Test"""
2
+
3
+ # Geographic Focus: North America
4
+ # Participation: Worldwide
5
+ # Mode: RTTY
6
+ # Bands: 80, 40, 20, 15, 10m
7
+ # Classes: Single-Op (QRP/Low)
8
+ # Max power: LP: 100 watts
9
+ # QRP: 5 watts
10
+ # Exchange: Name + (state/province/country)
11
+ # Work stations: Once per band
12
+ # QSO Points: 1 point per QSO
13
+ # Multipliers: Each callsign once
14
+ # Score Calculation: Total score = total QSO points x total mults
15
+ # Submit logs by: September 8, 2024
16
+ # E-mail logs to: (none)
17
+ # Post log summary at: http://www.3830scores.com/
18
+ # Mail logs to: (none)
19
+ # Find rules at: https://radiosport.world/wrt.html
20
+
21
+ import datetime
22
+ import logging
23
+ import platform
24
+
25
+ from pathlib import Path
26
+
27
+ from PyQt6 import QtWidgets
28
+
29
+ from not1mm.lib.ham_utility import get_logged_band
30
+ from not1mm.lib.plugin_common import gen_adif, get_points
31
+ from not1mm.lib.version import __version__
32
+
33
+ logger = logging.getLogger(__name__)
34
+
35
+ ALTEREGO = None
36
+
37
+ EXCHANGE_HINT = "Name + SPC"
38
+
39
+ name = "WEEKLY RTTY TEST"
40
+ cabrillo_name = "WEEKLY-RTTY"
41
+ mode = "RTTY" # CW SSB BOTH RTTY
42
+ # columns = [0, 1, 2, 3, 4, 10, 11, 14, 15]
43
+ columns = [
44
+ "YYYY-MM-DD HH:MM:SS",
45
+ "Call",
46
+ "Freq",
47
+ "Exchange1",
48
+ "M1",
49
+ "PTS",
50
+ ]
51
+
52
+ advance_on_space = [True, True, True, True, True]
53
+
54
+ # 1 once per contest, 2 work each band, 3 each band/mode, 4 no dupe checking
55
+ dupe_type = 2
56
+
57
+
58
+ def init_contest(self):
59
+ """setup plugin"""
60
+ set_tab_next(self)
61
+ set_tab_prev(self)
62
+ interface(self)
63
+ self.next_field = self.other_1
64
+
65
+
66
+ def interface(self):
67
+ """Setup user interface"""
68
+ self.field1.hide()
69
+ self.field2.hide()
70
+ self.field3.show()
71
+ self.field4.show()
72
+ namefield = self.field3.findChild(QtWidgets.QLabel)
73
+ namefield.setText("Name")
74
+ self.field3.setAccessibleName("Name")
75
+ spc = self.field4.findChild(QtWidgets.QLabel)
76
+ spc.setText("SPC")
77
+ self.field4.setAccessibleName("SPC")
78
+
79
+
80
+ def reset_label(self):
81
+ """reset label after field cleared"""
82
+
83
+
84
+ def set_tab_next(self):
85
+ """Set TAB Advances"""
86
+ self.tab_next = {
87
+ self.callsign: self.field3.findChild(QtWidgets.QLineEdit),
88
+ self.field3.findChild(QtWidgets.QLineEdit): self.field4.findChild(
89
+ QtWidgets.QLineEdit
90
+ ),
91
+ self.field4.findChild(QtWidgets.QLineEdit): self.callsign,
92
+ }
93
+
94
+
95
+ def set_tab_prev(self):
96
+ """Set TAB Advances"""
97
+ self.tab_prev = {
98
+ self.callsign: self.field4.findChild(QtWidgets.QLineEdit),
99
+ self.field3.findChild(QtWidgets.QLineEdit): self.callsign,
100
+ self.field4.findChild(QtWidgets.QLineEdit): self.field3.findChild(
101
+ QtWidgets.QLineEdit
102
+ ),
103
+ }
104
+
105
+
106
+ def set_contact_vars(self):
107
+ """Contest Specific"""
108
+ self.contact["SNT"] = self.sent.text()
109
+ self.contact["RCV"] = self.receive.text()
110
+ self.contact["Name"] = self.other_1.text().upper()
111
+ self.contact["Sect"] = self.other_2.text().upper()
112
+ self.contact["SentNr"] = self.contest_settings.get("SentExchange", 0)
113
+ self.contact["Exchange1"] = (
114
+ f"{self.other_1.text().upper()} {self.other_2.text().upper()}"
115
+ )
116
+
117
+ result = self.database.fetch_call_exists(self.callsign.text())
118
+ # result = ALTEREGO.database.fetch_call_exists(self.callsign.text())
119
+ if result.get("call_count", ""):
120
+ self.contact["IsMultiplier1"] = 0
121
+ else:
122
+ self.contact["IsMultiplier1"] = 1
123
+
124
+
125
+ def predupe(self):
126
+ """called after callsign entered"""
127
+
128
+
129
+ def prefill(self):
130
+ """Fill sentnr"""
131
+
132
+
133
+ def points(self):
134
+ """Calc point"""
135
+ return 1
136
+
137
+
138
+ def show_mults(self):
139
+ """Return display string for mults"""
140
+ result = self.database.fetch_section_band_count_nodx()
141
+ if result:
142
+ return int(result.get("sb_count", 0))
143
+ return 0
144
+
145
+
146
+ def show_qso(self):
147
+ """Return qso count"""
148
+ result = self.database.fetch_qso_count()
149
+ if result:
150
+ return int(result.get("qsos", 0))
151
+ return 0
152
+
153
+
154
+ def calc_score(self):
155
+ """Return calculated score"""
156
+ result = self.database.fetch_points()
157
+ if result is not None:
158
+ score = result.get("Points", "0")
159
+ if score is None:
160
+ score = "0"
161
+ contest_points = int(score)
162
+ mults = show_mults(self)
163
+ return contest_points * mults
164
+ return 0
165
+
166
+
167
+ def adif(self):
168
+ """Call the generate ADIF function"""
169
+ gen_adif(self, cabrillo_name, cabrillo_name)
170
+
171
+
172
+ def cabrillo(self):
173
+ """Generates Cabrillo file. Maybe."""
174
+ # https://www.cqwpx.com/cabrillo.htm
175
+ logger.debug("******Cabrillo*****")
176
+ logger.debug("Station: %s", f"{self.station}")
177
+ logger.debug("Contest: %s", f"{self.contest_settings}")
178
+ now = datetime.datetime.now()
179
+ date_time = now.strftime("%Y-%m-%d_%H-%M-%S")
180
+ filename = (
181
+ str(Path.home())
182
+ + "/"
183
+ + f"{self.station.get('Call','').upper()}_{cabrillo_name}_{date_time}.log"
184
+ )
185
+ logger.debug("%s", filename)
186
+ log = self.database.fetch_all_contacts_asc()
187
+ try:
188
+ with open(filename, "w", encoding="ascii") as file_descriptor:
189
+ print("START-OF-LOG: 3.0", end="\r\n", file=file_descriptor)
190
+ print(
191
+ f"CREATED-BY: Not1MM v{__version__}",
192
+ end="\r\n",
193
+ file=file_descriptor,
194
+ )
195
+ print(
196
+ f"CONTEST: {cabrillo_name}",
197
+ end="\r\n",
198
+ file=file_descriptor,
199
+ )
200
+ if self.station.get("Club", ""):
201
+ print(
202
+ f"CLUB: {self.station.get('Club', '').upper()}",
203
+ end="\r\n",
204
+ file=file_descriptor,
205
+ )
206
+ print(
207
+ f"CALLSIGN: {self.station.get('Call','')}",
208
+ end="\r\n",
209
+ file=file_descriptor,
210
+ )
211
+ print(
212
+ f"LOCATION: {self.station.get('ARRLSection', '')}",
213
+ end="\r\n",
214
+ file=file_descriptor,
215
+ )
216
+ # print(
217
+ # f"ARRL-SECTION: {self.pref.get('section', '')}",
218
+ # end="\r\n",
219
+ # file=file_descriptor,
220
+ # )
221
+ print(
222
+ f"CATEGORY-OPERATOR: {self.contest_settings.get('OperatorCategory','')}",
223
+ end="\r\n",
224
+ file=file_descriptor,
225
+ )
226
+ print(
227
+ f"CATEGORY-ASSISTED: {self.contest_settings.get('AssistedCategory','')}",
228
+ end="\r\n",
229
+ file=file_descriptor,
230
+ )
231
+ print(
232
+ f"CATEGORY-BAND: {self.contest_settings.get('BandCategory','')}",
233
+ end="\r\n",
234
+ file=file_descriptor,
235
+ )
236
+ print(
237
+ f"CATEGORY-MODE: {self.contest_settings.get('ModeCategory','')}",
238
+ end="\r\n",
239
+ file=file_descriptor,
240
+ )
241
+ print(
242
+ f"CATEGORY-TRANSMITTER: {self.contest_settings.get('TransmitterCategory','')}",
243
+ end="\r\n",
244
+ file=file_descriptor,
245
+ )
246
+ if self.contest_settings.get("OverlayCategory", "") != "N/A":
247
+ print(
248
+ f"CATEGORY-OVERLAY: {self.contest_settings.get('OverlayCategory','')}",
249
+ end="\r\n",
250
+ file=file_descriptor,
251
+ )
252
+ print(
253
+ f"GRID-LOCATOR: {self.station.get('GridSquare','')}",
254
+ end="\r\n",
255
+ file=file_descriptor,
256
+ )
257
+ # print(
258
+ # f"CATEGORY: {None}",
259
+ # end="\r\n",
260
+ # file=file_descriptor,
261
+ # )
262
+ print(
263
+ f"CATEGORY-POWER: {self.contest_settings.get('PowerCategory','')}",
264
+ end="\r\n",
265
+ file=file_descriptor,
266
+ )
267
+
268
+ print(
269
+ f"CLAIMED-SCORE: {calc_score(self)}",
270
+ end="\r\n",
271
+ file=file_descriptor,
272
+ )
273
+ ops = f"@{self.station.get('Call','')}"
274
+ list_of_ops = self.database.get_ops()
275
+ for op in list_of_ops:
276
+ ops += f", {op.get('Operator', '')}"
277
+ print(
278
+ f"OPERATORS: {ops}",
279
+ end="\r\n",
280
+ file=file_descriptor,
281
+ )
282
+ print(
283
+ f"NAME: {self.station.get('Name', '')}",
284
+ end="\r\n",
285
+ file=file_descriptor,
286
+ )
287
+ print(
288
+ f"ADDRESS: {self.station.get('Street1', '')}",
289
+ end="\r\n",
290
+ file=file_descriptor,
291
+ )
292
+ print(
293
+ f"ADDRESS-CITY: {self.station.get('City', '')}",
294
+ end="\r\n",
295
+ file=file_descriptor,
296
+ )
297
+ print(
298
+ f"ADDRESS-STATE-PROVINCE: {self.station.get('State', '')}",
299
+ end="\r\n",
300
+ file=file_descriptor,
301
+ )
302
+ print(
303
+ f"ADDRESS-POSTALCODE: {self.station.get('Zip', '')}",
304
+ end="\r\n",
305
+ file=file_descriptor,
306
+ )
307
+ print(
308
+ f"ADDRESS-COUNTRY: {self.station.get('Country', '')}",
309
+ end="\r\n",
310
+ file=file_descriptor,
311
+ )
312
+ print(
313
+ f"EMAIL: {self.station.get('Email', '')}",
314
+ end="\r\n",
315
+ file=file_descriptor,
316
+ )
317
+ for contact in log:
318
+ the_date_and_time = contact.get("TS", "")
319
+ themode = contact.get("Mode", "")
320
+ if themode == "RTTY":
321
+ themode = "RY"
322
+ frequency = str(int(contact.get("Freq", "0"))).rjust(5)
323
+
324
+ loggeddate = the_date_and_time[:10]
325
+ loggedtime = the_date_and_time[11:13] + the_date_and_time[14:16]
326
+ exch1 = ""
327
+ exch2 = ""
328
+ if " " in str(contact.get("Exchange1", "")):
329
+ exch1, exch2 = str(contact.get("Exchange1", "")).strip().split(" ")
330
+ print(
331
+ f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
332
+ f"{contact.get('StationPrefix', '').ljust(13)} "
333
+ f"{str(contact.get('SentNr', '')).upper()} "
334
+ f"{contact.get('Call', '').ljust(13)} "
335
+ f"{exch1.ljust(10)} "
336
+ f"{exch2.ljust(5)} ",
337
+ end="\r\n",
338
+ file=file_descriptor,
339
+ )
340
+ print("END-OF-LOG:", end="\r\n", file=file_descriptor)
341
+ self.show_message_box(f"Cabrillo saved to: {filename}")
342
+ except IOError as exception:
343
+ logger.critical("cabrillo: IO error: %s, writing to %s", exception, filename)
344
+ self.show_message_box(f"Error saving Cabrillo: {exception} {filename}")
345
+ return
346
+
347
+
348
+ def recalculate_mults(self):
349
+ """Recalculates multipliers after change in logged qso."""
350
+
351
+ all_contacts = self.database.fetch_all_contacts_asc()
352
+ for contact in all_contacts:
353
+ time_stamp = contact.get("TS", "")
354
+ call = contact.get("Call", "")
355
+ query = (
356
+ f"select count(*) as call_count from dxlog where TS < '{time_stamp}' "
357
+ f"and Call = '{call}' "
358
+ f"and ContestNR = {self.pref.get('contest', '1')};"
359
+ )
360
+ result = self.database.exec_sql(query)
361
+ count = result.get("call_count", 1)
362
+ if count == 0:
363
+ contact["IsMultiplier1"] = 1
364
+ else:
365
+ contact["IsMultiplier1"] = 0
366
+ self.database.change_contact(contact)
367
+ cmd = {}
368
+ cmd["cmd"] = "UPDATELOG"
369
+ cmd["station"] = platform.node()
370
+ self.multicast_interface.send_as_json(cmd)
371
+
372
+
373
+ def set_self(the_outie):
374
+ """..."""
375
+ globals()["ALTEREGO"] = the_outie
376
+
377
+
378
+ def ft8_handler(the_packet: dict):
379
+ """Process FT8 QSO packets
380
+
381
+ FlDigi
382
+ {
383
+ 'FREQ': '7.029500',
384
+ 'CALL': 'DL2DSL',
385
+ 'MODE': 'RTTY',
386
+ 'NAME': 'BOB',result = ALTEREGO.database.fetch_call_exists(the_packet.get("CALL", ""))
387
+ if result.get("call_count", ""):
388
+ ALTEREGO.contact["IsMultiplier1"] = 0
389
+ else:
390
+ ALTEREGO.contact["IsMultiplier1"] = 1
391
+ 'QSO_DATE': '20240904',
392
+ 'QSO_DATE_OFF': '20240904',
393
+ 'TIME_OFF': '212825',
394
+ 'TIME_ON': '212800',
395
+ 'RST_RCVD': '599',
396
+ 'RST_SENT': '599',
397
+ 'BAND': '40M',
398
+ 'COUNTRY': 'FED. REP. OF GERMANY',
399
+ 'CQZ': '14',
400
+ 'STX': '000',
401
+ 'STX_STRING': '1D ORG',
402
+ 'CLASS': '1D',
403
+ 'ARRL_SECT': 'DX',
404
+ 'TX_PWR': '0',
405
+ 'OPERATOR': 'K6GTE',
406
+ 'STATION_CALLSIGN': 'K6GTE',
407
+ 'MY_GRIDSQUARE': 'DM13AT',
408
+ 'MY_CITY': 'ANAHEIM, CA',
409
+ 'MY_STATE': 'CA'
410
+ }
411
+
412
+ """
413
+ logger.debug(f"{the_packet=}")
414
+ if ALTEREGO is not None:
415
+ ALTEREGO.callsign.setText(the_packet.get("CALL"))
416
+ ALTEREGO.contact["Call"] = the_packet.get("CALL", "")
417
+ ALTEREGO.contact["SNT"] = ALTEREGO.sent.text()
418
+ ALTEREGO.contact["RCV"] = ALTEREGO.receive.text()
419
+ ALTEREGO.contact["Exchange1"] = the_packet.get("SRX_STRING", "")
420
+ exch1 = ""
421
+ exch2 = ""
422
+ if " " in str(the_packet.get("SRX_STRING", "")):
423
+ exch1, exch2 = str(the_packet.get("SRX_STRING", "")).strip().split(" ")
424
+ ALTEREGO.other_1.setText(exch1)
425
+ ALTEREGO.other_2.setText(exch2)
426
+ # ALTEREGO.contact["Sect"] = the_packet.get("ARRL_SECT", "ERR")
427
+ ALTEREGO.contact["Mode"] = the_packet.get("MODE", "ERR")
428
+ ALTEREGO.contact["Freq"] = round(float(the_packet.get("FREQ", "0.0")) * 1000, 2)
429
+ ALTEREGO.contact["QSXFreq"] = round(
430
+ float(the_packet.get("FREQ", "0.0")) * 1000, 2
431
+ )
432
+ ALTEREGO.contact["Band"] = get_logged_band(
433
+ str(int(float(the_packet.get("FREQ", "0.0")) * 1000000))
434
+ )
435
+
436
+ result = ALTEREGO.database.fetch_call_exists(the_packet.get("CALL", ""))
437
+ if result.get("call_count", ""):
438
+ ALTEREGO.contact["IsMultiplier1"] = 0
439
+ else:
440
+ ALTEREGO.contact["IsMultiplier1"] = 1
441
+ logger.debug(f"{ALTEREGO.contact=}")
442
+ ALTEREGO.save_contact()
not1mm/test.py CHANGED
@@ -1,10 +1,6 @@
1
- class Somefunc:
2
- def __init__(self):
3
- """weee"""
1
+ import xmlrpc.client
4
2
 
5
- def testfunc():
6
- """wooo"""
7
-
8
-
9
- thetest = Somefunc()
10
- print(f"{hasattr(thetest, "ft8_catcher")}")
3
+ target = "http://127.0.0.1:8421"
4
+ server = xmlrpc.client.ServerProxy(target)
5
+ adif = "<QSO_DATE:8>20150721<QSO_DATE_OFF:8>20150721<TIME_ON:4>1333<TIME_OFF:6>133436<CALL:5>N3FJP<FREQ:8>3.081500<MODE:0><RST_SENT:0><RST_RCVD:0><TX_PWR:0><NAME:5>Glenn<QTH:7>Bel Air<STATE:2>MD<VE_PROV:0><COUNTRY:13>United States<GRIDSQUARE:6>FM19tm<STX:0><SRX:0><SRX_STRING:0><STX_STRING:0><NOTES:0><IOTA:0><DXCC:0><QSL_VIA:0><QSLRDATE:0><QSLSDATE:0><eor>"
6
+ response = server.log.add_record(adif)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: not1mm
3
- Version: 24.9.3
3
+ Version: 24.9.6
4
4
  Summary: NOT1MM Logger
5
5
  Author-email: Michael Bridak <michael.bridak@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/mbridak/not1mm
@@ -100,7 +100,7 @@ Requires-Dist: Levenshtein
100
100
  - [Cluster](#cluster)
101
101
  - [N1MM Packets](#n1mm-packets)
102
102
  - [Bands](#bands)
103
- - [Logging WSJT-X FT8/FT4 contacts](#logging-wsjt-x-ft8ft4-contacts)
103
+ - [Logging WSJT-X FT8/FT4 and FLDIGI RTTY contacts](#logging-wsjt-x-ft8ft4-and-fldigi-rtty-contacts)
104
104
  - [Sending CW](#sending-cw)
105
105
  - [Editing macro keys](#editing-macro-keys)
106
106
  - [Macro substitutions](#macro-substitutions)
@@ -169,9 +169,9 @@ when the program craps the bed. I'm only one guy, so if you see a bug let me kno
169
169
 
170
170
  ### Data and RTTY
171
171
 
172
- I don't do much of any digital or RTTY operating. This is why you don't see RTTY in
173
- the list of working contests. The Lord helps those who burn people at the... I
174
- mean, who help themselves. Feel free to fill in that hole with a pull request.
172
+ I've recently added portions of code to watch for WSTJ-X and fldigi QSOs. I've added
173
+ the Weekly RTTY Test, So RTTY could be tested. Also added FT8/4 and RTTY to ARRL Field
174
+ Day. Praying that it works. I'll add more details later.
175
175
 
176
176
  ### Other not so supported contests
177
177
 
@@ -222,10 +222,13 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
222
222
  - Phone Weekly Test
223
223
  - RAC Canada Day
224
224
  - Stew Perry Topband
225
+ - Weekly RTTY
225
226
  - Winter Field Day
226
227
 
227
228
  ## Recent Changes
228
229
 
230
+ - [24-9-6] Added the Weekly RTTY
231
+ - [24-9-5] Added FlDigi support for Field Day.
229
232
  - [24-9-3] Added WSJT-X FT8 mode contacts to ARRL Field Day.
230
233
 
231
234
  See [CHANGELOG.md](CHANGELOG.md) for prior changes.
@@ -603,12 +606,20 @@ appear. Those without will not.
603
606
 
604
607
  ![Bands Configuration Screen](https://github.com/mbridak/not1mm/raw/master/pic/configure_bands.png)
605
608
 
606
- ## Logging WSJT-X FT8/FT4 contacts
609
+ ## Logging WSJT-X FT8/FT4 and FLDIGI RTTY contacts
607
610
 
608
- **Currently only working for ARRL Field Day.**
611
+ **FT8/FT4 Currently only working for ARRL Field Day.**
609
612
 
610
613
  not1mm listens for WSJT-X UDP traffic on the default localhost:2237. No setup is
611
- needed to be done on not1mm's side.
614
+ needed to be done on not1mm's side. That's good because I'm lazy.
615
+
616
+ not1mm polls for fldigi QSOs via it's XMLRPC interface. It does this in a rather stupid
617
+ way. It just keeps asking what was the last QSO and compares it to the previous response.
618
+ If it's different, it's new. I've added the Weekly RTTY Test so this can be tested.
619
+
620
+ Unlike WSJT, fldigi needs to be setup for this to work. The XMLRPC interface needs to be
621
+ active. And in fldigi's config dialog go to CONTESTS -> General -> CONTEST and select
622
+ Generic Contest. Make sure the Text Capture Order field says CALL EXCHANGE.
612
623
 
613
624
  ## Sending CW
614
625
 
@@ -1,11 +1,11 @@
1
1
  not1mm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- not1mm/__main__.py,sha256=xmqEIER571T8ONHjL-65TCuQ-PnUpDqH-nQFIutvUOk,122905
2
+ not1mm/__main__.py,sha256=LfjFkTKxq706D3NttjQcMEV6RNNHDc8Pt4xA8qcaM-w,124009
3
3
  not1mm/bandmap.py,sha256=1b5tXCfGTnpqqn6hPNt7zRA8SmuwSXzSwNHZXhCRt70,31434
4
4
  not1mm/checkwindow.py,sha256=aI-nr8OF90IWV7R_XRdmitvBJ9M85evCs72HoU3Jnvc,10374
5
5
  not1mm/fsutils.py,sha256=ukHKxKTeNKxKwqRaJjtzRShL4X5Xl0jRBbADyy3Ifp8,1701
6
6
  not1mm/logwindow.py,sha256=pwhiwolmGnW01LF4sjlu3ywLsgfxL6KuGuKuYKYmgeY,44403
7
7
  not1mm/radio.py,sha256=eiB04LPMPBeMrBRI021Z7VXth66EOYb0Ujh11T9877c,3362
8
- not1mm/test.py,sha256=H_5hAobuNebV0-PZk_CeX0_MO2FgGhMiauVBfNhfNTg,166
8
+ not1mm/test.py,sha256=QE9lemU13glwB2yuBAuXXQHzADTW1vSX90HHu0F-Akg,496
9
9
  not1mm/vfo.py,sha256=IvmUQYMIPzLJw_BHQGis4J_IEW-vlBtdfxZLXPh7OzI,12335
10
10
  not1mm/voice_keying.py,sha256=sA3gw5_k7kShTg2qhG7HkKDM5M6KheJVRkAc_C7mxDk,3006
11
11
  not1mm/data/JetBrainsMono-Regular.ttf,sha256=UOHctAKY_PzCGh7zy-6f6egnCcSK0wzmF0csBqO9lDY,203952
@@ -30,7 +30,7 @@ not1mm/data/k6gte.not1mm-64.png,sha256=6ku45Gq1g5ezh04F07osoKRtanb3e4kbx5XdIEh3N
30
30
  not1mm/data/logwindow.ui,sha256=vfkNdzJgFs3tTOBKLDavF2zVMvNHWOZ82fAErRi6pQY,1436
31
31
  not1mm/data/logwindowx.ui,sha256=9FzDJtLRpagvAWcDjFdB9NnvNZ4bVxdTNHy1Jit2ido,1610
32
32
  not1mm/data/main.ui,sha256=Y8F0gOqMTcsxBmc3QvWkJMxhYFpxUJQl-btGiM1-31w,56506
33
- not1mm/data/new_contest.ui,sha256=6j4OYcTjSx-5ywvBf4GQfuAEaavCJVPVwzj_es5ajsc,22138
33
+ not1mm/data/new_contest.ui,sha256=x4KkVqbaqrv-808yC7BR5ZBpMal81GF6uzKCrod8ick,22278
34
34
  not1mm/data/not1mm.html,sha256=c9-mfjMwDt4f5pySUruz2gREW33CQ2_rCddM2z5CZQo,23273
35
35
  not1mm/data/opon.ui,sha256=mC4OhoVIfR1H9IqHAKXliPMm8VOVmxSEadpsFQ7XnS4,2247
36
36
  not1mm/data/pickcontest.ui,sha256=_9JFiJw4l-bRRgNDtVg1DpxreylYd_UqEq0wfcr9gJc,1600
@@ -94,23 +94,24 @@ not1mm/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
94
  not1mm/lib/about.py,sha256=sWycfGcruN3SaEe4JmaJ61K6D8Itq0WxpUYT-lEcmYM,416
95
95
  not1mm/lib/cat_interface.py,sha256=aazvNTSeZAROq3KL8gPx-I95iVez2IiIOSk22qeqVCQ,19502
96
96
  not1mm/lib/cwinterface.py,sha256=Q8p3pScOHczZ8ptICfH1Yu6rCEwQJLgrNwYMN76B2i8,3389
97
- not1mm/lib/database.py,sha256=0dx6SX40OiPFent2ePAGsFj_XmOVMNBHaqd0QtAiewY,43129
97
+ not1mm/lib/database.py,sha256=TZjMixyPACZginoJkemXOdA4kAYMdSirdodkmN0Fv10,43136
98
98
  not1mm/lib/edit_contact.py,sha256=Ki9bGPpqyQQBB1cU8VIBDCal3lbXeQ6qxhzklmhE2_w,353
99
99
  not1mm/lib/edit_macro.py,sha256=raKWBwsHInj5EUKmvyLQ6gqc3ZFDlstsD3xqoM4PC8E,517
100
100
  not1mm/lib/edit_opon.py,sha256=j3qJ1aBsQoIOnQ9yiBl3lyeISvKTP0I_rtBYBPAfgeI,359
101
101
  not1mm/lib/edit_station.py,sha256=doL21Hs6jzIE43ohAopdFt_iqnRJZHFcqzcnCS0-iio,1965
102
- not1mm/lib/ft8_watcher.py,sha256=ISfXjs-Mgbz_lE5SThEnFoCe8apNLElgSuECAMCH18I,4080
102
+ not1mm/lib/fldigi_watcher.py,sha256=k_fAaJLdt4mwyKKnpiZrV-rSFtRbi2C8y1Dg3eyILIU,883
103
+ not1mm/lib/ft8_watcher.py,sha256=M9R5OUs3i99u3IfKnv1KYIMfljPViSbk-VeyjsVQLp4,4100
103
104
  not1mm/lib/ham_utility.py,sha256=uRErxCxZr8dfxzekPyett0e_BABDVOCvSUUTzXq6ctE,11790
104
105
  not1mm/lib/lookup.py,sha256=F2fl5QkMxaGSxl1XMWnLUub3T9Mt7LhCX4acOlAsks4,13952
105
106
  not1mm/lib/multicast.py,sha256=bnFUNHyy82GmIb3_88EPBVVssj7-HzkJPaH671cK8Qw,3249
106
107
  not1mm/lib/n1mm.py,sha256=H54mpgJF0GAmKavM-nb5OAq2SJFWYkux4eMWWiSRxJc,6288
107
108
  not1mm/lib/new_contest.py,sha256=IznTDMq7yXHB6zBoGUEC_WDYPCPpsSZW4wwMJi16zK0,816
108
109
  not1mm/lib/playsound.py,sha256=kxkcitBFbZCXJ2wxQ1lxg4rBwfxiSpuNpJSXHOPCoXA,9241
109
- not1mm/lib/plugin_common.py,sha256=wuG7B0OJx9zYc5Gew3fdt_lNyan8Ul9KNlPQ7PDKGsU,9114
110
+ not1mm/lib/plugin_common.py,sha256=yefvcX61fXSjs__OPssJqVlZyg1AlcV1VDkl2MQP6kk,9129
110
111
  not1mm/lib/select_contest.py,sha256=WsptLuwkouIHeocJL3oZ6-eUfEnhpwdc-x7eMZ_TIVM,359
111
112
  not1mm/lib/settings.py,sha256=MWiKXbasaFbzeHTjfzTaTqbCBrIijudP_-0a5jNmUAA,9265
112
113
  not1mm/lib/super_check_partial.py,sha256=p5l3u2ZOCBtlWgbvskC50FpuoaIpR07tfC6zTdRWbh4,2334
113
- not1mm/lib/version.py,sha256=3nHzm4TY2JdIkrbl-vZhxO25Akrnx3rGDTzqroFbYJg,47
114
+ not1mm/lib/version.py,sha256=ndmch8qmXlDWUwxn8xUdDROK7Mo_VuYlHn16L02Pg6g,47
114
115
  not1mm/lib/versiontest.py,sha256=8vDNptuBBunn-1IGkjNaquehqBYUJyjrPSF8Igmd4_Y,1286
115
116
  not1mm/plugins/10_10_fall_cw.py,sha256=IttjX1yy4nDdACGsiYlPteFG8eVseX_WtoFio6bqHE8,10953
116
117
  not1mm/plugins/10_10_spring_cw.py,sha256=ThCptdM3dX4ywhoy2JRcOEyHSqcJolFaT7O_PYzM1Mg,10958
@@ -120,7 +121,7 @@ not1mm/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
120
121
  not1mm/plugins/arrl_10m.py,sha256=EyNRb3Sm0Qb-GVm0p05EnadlHisVh7y-sKTBP2ddMLo,13768
121
122
  not1mm/plugins/arrl_dx_cw.py,sha256=LVnYDNFEUiIpQ1TlhOCcRK7JNwH5XPO5WzUoApSUMTY,13802
122
123
  not1mm/plugins/arrl_dx_ssb.py,sha256=fUFzuNbCAfA5sQSYm8ISV3P9Z_2xnuKeOdO6E66zn1k,13805
123
- not1mm/plugins/arrl_field_day.py,sha256=-HaAp14eHJsiwo1vNnHjVQ7cbDyZ7NYl0Z3SEUx0fek,11903
124
+ not1mm/plugins/arrl_field_day.py,sha256=pivtEK5j9sLpta12_wuUQYvs7MuiP3JfhlO-AOIDJug,12707
124
125
  not1mm/plugins/arrl_rtty_ru.py,sha256=hKUS4isjdXo3EYxQrsqsDupPp2chW8fpoWj0T1pTgJ4,7994
125
126
  not1mm/plugins/arrl_ss_cw.py,sha256=4yN68xZMuJRaSUfdiY4hafC07A3lifl5q6DEUZ-oYPQ,13080
126
127
  not1mm/plugins/arrl_ss_phone.py,sha256=Yzc5sNjrY8TlnozbYF6k8hbEamyDuUAD_3-BNqHgXqY,13068
@@ -147,10 +148,11 @@ not1mm/plugins/naqp_ssb.py,sha256=VLWVrSzI0UP1AhSXYn61eZ7or1rz6a_pS_xCKfgS4Jw,11
147
148
  not1mm/plugins/phone_weekly_test.py,sha256=fLpMe03WB9_KgRl6vMgQQt_aktFdqfNt2Sw81CTRAUs,12325
148
149
  not1mm/plugins/ref_cw.py,sha256=aWjHHkqIKutjRUtzh09y5haFfnZK9poRQDWRQMDRxxU,16326
149
150
  not1mm/plugins/stew_perry_topband.py,sha256=CKBQbYl4ETxhXJd2dma4fg_C5pag_s7Nf61SCztZtqE,10668
151
+ not1mm/plugins/weekly_rtty.py,sha256=DQcy3SY0Zn56EdlYGf3NxrRhTnkNa5IqRQPRQdKDSPs,14255
150
152
  not1mm/plugins/winter_field_day.py,sha256=4rcfRtobwjHO6BNL3WOTHzBmyyeuX79BNGBG8PfjrI8,10238
151
- not1mm-24.9.3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
152
- not1mm-24.9.3.dist-info/METADATA,sha256=11Kg9639B3UOSQ5rFKE5RgPZLY8Ww7rGP0hs4jW3QU8,29734
153
- not1mm-24.9.3.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
154
- not1mm-24.9.3.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
155
- not1mm-24.9.3.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
156
- not1mm-24.9.3.dist-info/RECORD,,
153
+ not1mm-24.9.6.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
154
+ not1mm-24.9.6.dist-info/METADATA,sha256=m1LWl5Xksz3NJMj6n3i-2IjhrZ452y3kbcljFPFGvoI,30416
155
+ not1mm-24.9.6.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
156
+ not1mm-24.9.6.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
157
+ not1mm-24.9.6.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
158
+ not1mm-24.9.6.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.1)
2
+ Generator: setuptools (74.1.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5