not1mm 24.10.14__py3-none-any.whl → 24.10.15__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.
@@ -352,6 +352,11 @@
352
352
  <string>NAQP CW</string>
353
353
  </property>
354
354
  </item>
355
+ <item>
356
+ <property name="text">
357
+ <string>NAQP RTTY</string>
358
+ </property>
359
+ </item>
355
360
  <item>
356
361
  <property name="text">
357
362
  <string>NAQP SSB</string>
not1mm/lib/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.10.14"
3
+ __version__ = "24.10.15"
not1mm/plugins/naqp_cw.py CHANGED
@@ -13,12 +13,12 @@
13
13
  # Single Op Assisted (QRP/Low)
14
14
  # Single Op Overlay: Youth
15
15
  # Multi-Two (Low)
16
- # Max operating hours: Single Op: 10 hours
17
- # Multi-Two: 12 hours
18
- # Max power: LP: 100 watts
19
- # QRP: 5 watts
20
- # Exchange: NA: Name + (state/DC/province/country)
21
- # non-NA: Name
16
+ # Max operating hours: Single Op: 10 hours
17
+ # Multi-Two: 12 hours
18
+ # Max power: LP: 100 watts
19
+ # QRP: 5 watts
20
+ # Exchange: NA: Name + (state/DC/province/country)
21
+ # non-NA: Name
22
22
  # Work stations: Once per band
23
23
  # QSO Points: NA station: 1 point per QSO
24
24
  # non-NA station: 1 point per QSO with an NA station
@@ -391,3 +391,129 @@ def recalculate_mults(self):
391
391
  cmd["cmd"] = "UPDATELOG"
392
392
  cmd["station"] = platform.node()
393
393
  self.multicast_interface.send_as_json(cmd)
394
+
395
+
396
+ def process_esm(self, new_focused_widget=None, with_enter=False):
397
+ """ESM State Machine"""
398
+
399
+ # self.pref["run_state"]
400
+
401
+ # -----===== Assigned F-Keys =====-----
402
+ # self.esm_dict["CQ"]
403
+ # self.esm_dict["EXCH"]
404
+ # self.esm_dict["QRZ"]
405
+ # self.esm_dict["AGN"]
406
+ # self.esm_dict["HISCALL"]
407
+ # self.esm_dict["MYCALL"]
408
+ # self.esm_dict["QSOB4"]
409
+
410
+ # ----==== text fields ====----
411
+ # self.callsign
412
+ # self.sent
413
+ # self.receive
414
+ # self.other_1
415
+ # self.other_2
416
+
417
+ if new_focused_widget is not None:
418
+ self.current_widget = self.inputs_dict.get(new_focused_widget)
419
+
420
+ # print(f"checking esm {self.current_widget=} {with_enter=} {self.pref.get("run_state")=}")
421
+
422
+ for a_button in [
423
+ self.F1,
424
+ self.F2,
425
+ self.F3,
426
+ self.F4,
427
+ self.F5,
428
+ self.F6,
429
+ self.F7,
430
+ self.F8,
431
+ self.F9,
432
+ self.F10,
433
+ self.F11,
434
+ self.F12,
435
+ ]:
436
+ self.restore_button_color(a_button)
437
+
438
+ buttons_to_send = []
439
+
440
+ if self.pref.get("run_state"):
441
+ if self.current_widget == "callsign":
442
+ if len(self.callsign.text()) < 3:
443
+ self.make_button_green(self.esm_dict["CQ"])
444
+ buttons_to_send.append(self.esm_dict["CQ"])
445
+ elif len(self.callsign.text()) > 2 and self.callsign.text().isalnum():
446
+ self.make_button_green(self.esm_dict["HISCALL"])
447
+ self.make_button_green(self.esm_dict["EXCH"])
448
+ buttons_to_send.append(self.esm_dict["HISCALL"])
449
+ buttons_to_send.append(self.esm_dict["EXCH"])
450
+
451
+ elif self.current_widget == "other_1" or self.current_widget == "other_2":
452
+ continent = self.contact.get("Continent")
453
+ print(
454
+ f"{self.current_widget=} {self.other_1.text().isalpha()=} {self.other_2.text().isalpha()=} {continent=}"
455
+ )
456
+ if self.other_1.text() == "" or (
457
+ self.other_2.text() == "" and continent == "NA"
458
+ ):
459
+ self.make_button_green(self.esm_dict["AGN"])
460
+ buttons_to_send.append(self.esm_dict["AGN"])
461
+ elif (
462
+ self.other_1.text().isalpha()
463
+ and self.other_2.text().isalpha()
464
+ and continent == "NA"
465
+ ):
466
+ self.make_button_green(self.esm_dict["QRZ"])
467
+ buttons_to_send.append(self.esm_dict["QRZ"])
468
+ buttons_to_send.append("LOGIT")
469
+ elif self.other_1.text().isalpha() and continent != "NA":
470
+ self.make_button_green(self.esm_dict["QRZ"])
471
+ buttons_to_send.append(self.esm_dict["QRZ"])
472
+ buttons_to_send.append("LOGIT")
473
+ else:
474
+ self.make_button_green(self.esm_dict["AGN"])
475
+ buttons_to_send.append(self.esm_dict["AGN"])
476
+
477
+ if with_enter is True and bool(len(buttons_to_send)):
478
+ for button in buttons_to_send:
479
+ if button:
480
+ if button == "LOGIT":
481
+ self.save_contact()
482
+ continue
483
+ self.process_function_key(button)
484
+ else:
485
+ if self.current_widget == "callsign":
486
+ if len(self.callsign.text()) > 2 and self.callsign.text().isalnum():
487
+ self.make_button_green(self.esm_dict["MYCALL"])
488
+ buttons_to_send.append(self.esm_dict["MYCALL"])
489
+
490
+ elif self.current_widget == "other_1" or self.current_widget == "other_2":
491
+ continent = self.contact.get("Continent")
492
+ if self.other_1.text() == "" or (
493
+ self.other_2.text() == "" and continent == "NA"
494
+ ):
495
+ self.make_button_green(self.esm_dict["AGN"])
496
+ buttons_to_send.append(self.esm_dict["AGN"])
497
+ elif (
498
+ self.other_1.text().isalpha()
499
+ and self.other_2.text().isalpha()
500
+ and continent == "NA"
501
+ ):
502
+ self.make_button_green(self.esm_dict["EXCH"])
503
+ buttons_to_send.append(self.esm_dict["EXCH"])
504
+ buttons_to_send.append("LOGIT")
505
+ elif self.other_1.text().isalpha() and continent != "NA":
506
+ self.make_button_green(self.esm_dict["EXCH"])
507
+ buttons_to_send.append(self.esm_dict["EXCH"])
508
+ buttons_to_send.append("LOGIT")
509
+ else:
510
+ self.make_button_green(self.esm_dict["AGN"])
511
+ buttons_to_send.append(self.esm_dict["AGN"])
512
+
513
+ if with_enter is True and bool(len(buttons_to_send)):
514
+ for button in buttons_to_send:
515
+ if button:
516
+ if button == "LOGIT":
517
+ self.save_contact()
518
+ continue
519
+ self.process_function_key(button)
@@ -0,0 +1,628 @@
1
+ """NAQP RTTY plugin"""
2
+
3
+ # pylint: disable=invalid-name, unused-argument, unused-variable, c-extension-no-member, unused-import
4
+
5
+ # North American QSO Party, RTTY
6
+ # Status: Active
7
+ # Geographic Focus: North America
8
+ # Participation: Worldwide
9
+ # Awards: North America
10
+ # Mode: RTTY
11
+ # Bands: 160, 80, 40, 20, 15, 10m
12
+ # Classes: Single Op (QRP/Low)
13
+ # Single Op Assisted (QRP/Low)
14
+ # Single Op Overlay: Youth
15
+ # Multi-Two (Low)
16
+ # Max operating hours: Single Op: 10 hours
17
+ # Multi-Two: 12 hours
18
+ # Max power: LP: 100 watts
19
+ # QRP: 5 watts
20
+ # Exchange: NA: Name + (state/DC/province/country)
21
+ # non-NA: Name
22
+ # Work stations: Once per band
23
+ # QSO Points: NA station: 1 point per QSO
24
+ # non-NA station: 1 point per QSO with an NA station
25
+ # Multipliers: Each US state and DC (including KH6/KL7) once per band
26
+ # Each VE province/territory once per band
27
+ # Each North American country (except W/VE) once per band
28
+ # Score Calculation: Total score = total QSO points x total mults
29
+ # E-mail logs to: (none)
30
+ # Upload log at: http://www.ncjweb.com/naqplogsubmit/
31
+ # Mail logs to: (none)
32
+ # Find rules at: https://www.ncjweb.com/NAQP-Rules.pdf
33
+ # Cabrillo name: NAQP-RTTY
34
+
35
+ import datetime
36
+ import logging
37
+ import platform
38
+
39
+ from pathlib import Path
40
+
41
+ from PyQt6 import QtWidgets
42
+
43
+ from not1mm.lib.ham_utility import get_logged_band
44
+ from not1mm.lib.plugin_common import gen_adif, get_points
45
+ from not1mm.lib.version import __version__
46
+
47
+ logger = logging.getLogger(__name__)
48
+
49
+ EXCHANGE_HINT = "Name or Name + SPC"
50
+
51
+ ALTEREGO = None
52
+
53
+ name = "NAQP RTTY"
54
+ cabrillo_name = "NAQP-RTTY"
55
+ mode = "RTTY" # CW SSB BOTH RTTY
56
+ # columns = [0, 1, 2, 3, 4, 10, 11, 14, 15]
57
+ columns = [
58
+ "YYYY-MM-DD HH:MM:SS",
59
+ "Call",
60
+ "Freq",
61
+ "Name",
62
+ "Sect",
63
+ "M1",
64
+ "PTS",
65
+ ]
66
+
67
+ advance_on_space = [True, True, True, True, True]
68
+
69
+ # 1 once per contest, 2 work each band, 3 each band/mode, 4 no dupe checking
70
+ dupe_type = 2
71
+
72
+
73
+ def init_contest(self):
74
+ """setup plugin"""
75
+ set_tab_next(self)
76
+ set_tab_prev(self)
77
+ interface(self)
78
+ self.next_field = self.other_1
79
+
80
+
81
+ def interface(self):
82
+ """Setup user interface"""
83
+ self.field1.hide()
84
+ self.field2.hide()
85
+ self.field3.show()
86
+ self.field4.show()
87
+ self.snt_label.setText("SNT")
88
+ self.field1.setAccessibleName("RST Sent")
89
+ namefield = self.field3.findChild(QtWidgets.QLabel)
90
+ namefield.setText("Name")
91
+ self.field3.setAccessibleName("Name")
92
+ spc = self.field4.findChild(QtWidgets.QLabel)
93
+ spc.setText("State")
94
+ self.field4.setAccessibleName("State")
95
+
96
+
97
+ def reset_label(self):
98
+ """reset label after field cleared"""
99
+
100
+
101
+ def set_tab_next(self):
102
+ """Set TAB Advances"""
103
+ self.tab_next = {
104
+ self.callsign: self.field3.findChild(QtWidgets.QLineEdit),
105
+ self.field3.findChild(QtWidgets.QLineEdit): self.field4.findChild(
106
+ QtWidgets.QLineEdit
107
+ ),
108
+ self.field4.findChild(QtWidgets.QLineEdit): self.callsign,
109
+ }
110
+
111
+
112
+ def set_tab_prev(self):
113
+ """Set TAB Advances"""
114
+ self.tab_prev = {
115
+ self.callsign: self.field4.findChild(QtWidgets.QLineEdit),
116
+ self.field3.findChild(QtWidgets.QLineEdit): self.callsign,
117
+ self.field4.findChild(QtWidgets.QLineEdit): self.field3.findChild(
118
+ QtWidgets.QLineEdit
119
+ ),
120
+ }
121
+
122
+
123
+ def set_contact_vars(self):
124
+ """Contest Specific"""
125
+ self.contact["SNT"] = self.sent.text()
126
+ self.contact["RCV"] = self.receive.text()
127
+ self.contact["Name"] = self.other_1.text().upper()
128
+ self.contact["Sect"] = self.other_2.text().upper()
129
+ self.contact["SentNr"] = self.contest_settings.get("SentExchange", 0)
130
+
131
+ if self.contact.get("Sect", ""):
132
+ result = self.database.fetch_sect_band_exists(
133
+ self.contact.get("Sect", ""), self.contact.get("Band", "")
134
+ )
135
+ if result.get("sect_count", ""):
136
+ self.contact["IsMultiplier1"] = 0
137
+ else:
138
+ self.contact["IsMultiplier1"] = 1
139
+
140
+
141
+ def predupe(self):
142
+ """called after callsign entered"""
143
+
144
+
145
+ def prefill(self):
146
+ """Fill sentnr"""
147
+
148
+
149
+ def points(self):
150
+ """Calc point"""
151
+ mycontinent = ""
152
+ hiscontinent = ""
153
+ result = self.cty_lookup(self.station.get("Call", ""))
154
+ if result:
155
+ for item in result.items():
156
+ mycontinent = item[1].get("continent", "")
157
+ result = self.cty_lookup(self.contact.get("Call", ""))
158
+ if result:
159
+ for item in result.items():
160
+ hiscontinent = item[1].get("continent", "")
161
+ if mycontinent == "NA" or hiscontinent == "NA":
162
+ return 1
163
+ return 0
164
+
165
+
166
+ def show_mults(self):
167
+ """Return display string for mults"""
168
+ result = self.database.fetch_section_band_count_nodx()
169
+ if result:
170
+ return int(result.get("sb_count", 0))
171
+ return 0
172
+
173
+
174
+ def show_qso(self):
175
+ """Return qso count"""
176
+ result = self.database.fetch_qso_count()
177
+ if result:
178
+ return int(result.get("qsos", 0))
179
+ return 0
180
+
181
+
182
+ def calc_score(self):
183
+ """Return calculated score"""
184
+ result = self.database.fetch_points()
185
+ if result is not None:
186
+ score = result.get("Points", "0")
187
+ if score is None:
188
+ score = "0"
189
+ contest_points = int(score)
190
+ mults = show_mults(self)
191
+ return contest_points * mults
192
+ return 0
193
+
194
+
195
+ def adif(self):
196
+ """Call the generate ADIF function"""
197
+ gen_adif(self, cabrillo_name, "NAQP-RTTY")
198
+
199
+
200
+ def cabrillo(self):
201
+ """Generates Cabrillo file. Maybe."""
202
+ # https://www.cqwpx.com/cabrillo.htm
203
+ logger.debug("******Cabrillo*****")
204
+ logger.debug("Station: %s", f"{self.station}")
205
+ logger.debug("Contest: %s", f"{self.contest_settings}")
206
+ now = datetime.datetime.now()
207
+ date_time = now.strftime("%Y-%m-%d_%H-%M-%S")
208
+ filename = (
209
+ str(Path.home())
210
+ + "/"
211
+ + f"{self.station.get('Call', '').upper()}_{cabrillo_name}_{date_time}.log"
212
+ )
213
+ logger.debug("%s", filename)
214
+ log = self.database.fetch_all_contacts_asc()
215
+ try:
216
+ with open(filename, "w", encoding="ascii") as file_descriptor:
217
+ print("START-OF-LOG: 3.0", end="\r\n", file=file_descriptor)
218
+ print(
219
+ f"CREATED-BY: Not1MM v{__version__}",
220
+ end="\r\n",
221
+ file=file_descriptor,
222
+ )
223
+ print(
224
+ f"CONTEST: {cabrillo_name}",
225
+ end="\r\n",
226
+ file=file_descriptor,
227
+ )
228
+ if self.station.get("Club", ""):
229
+ print(
230
+ f"CLUB: {self.station.get('Club', '').upper()}",
231
+ end="\r\n",
232
+ file=file_descriptor,
233
+ )
234
+ print(
235
+ f"CALLSIGN: {self.station.get('Call','')}",
236
+ end="\r\n",
237
+ file=file_descriptor,
238
+ )
239
+ print(
240
+ f"LOCATION: {self.station.get('ARRLSection', '')}",
241
+ end="\r\n",
242
+ file=file_descriptor,
243
+ )
244
+ # print(
245
+ # f"ARRL-SECTION: {self.pref.get('section', '')}",
246
+ # end="\r\n",
247
+ # file=file_descriptor,
248
+ # )
249
+ print(
250
+ f"CATEGORY-OPERATOR: {self.contest_settings.get('OperatorCategory','')}",
251
+ end="\r\n",
252
+ file=file_descriptor,
253
+ )
254
+ print(
255
+ f"CATEGORY-ASSISTED: {self.contest_settings.get('AssistedCategory','')}",
256
+ end="\r\n",
257
+ file=file_descriptor,
258
+ )
259
+ print(
260
+ f"CATEGORY-BAND: {self.contest_settings.get('BandCategory','')}",
261
+ end="\r\n",
262
+ file=file_descriptor,
263
+ )
264
+ print(
265
+ f"CATEGORY-MODE: {self.contest_settings.get('ModeCategory','')}",
266
+ end="\r\n",
267
+ file=file_descriptor,
268
+ )
269
+ print(
270
+ f"CATEGORY-TRANSMITTER: {self.contest_settings.get('TransmitterCategory','')}",
271
+ end="\r\n",
272
+ file=file_descriptor,
273
+ )
274
+ if self.contest_settings.get("OverlayCategory", "") != "N/A":
275
+ print(
276
+ f"CATEGORY-OVERLAY: {self.contest_settings.get('OverlayCategory','')}",
277
+ end="\r\n",
278
+ file=file_descriptor,
279
+ )
280
+ print(
281
+ f"GRID-LOCATOR: {self.station.get('GridSquare','')}",
282
+ end="\r\n",
283
+ file=file_descriptor,
284
+ )
285
+ # print(
286
+ # f"CATEGORY: {None}",
287
+ # end="\r\n",
288
+ # file=file_descriptor,
289
+ # )
290
+ print(
291
+ f"CATEGORY-POWER: {self.contest_settings.get('PowerCategory','')}",
292
+ end="\r\n",
293
+ file=file_descriptor,
294
+ )
295
+
296
+ print(
297
+ f"CLAIMED-SCORE: {calc_score(self)}",
298
+ end="\r\n",
299
+ file=file_descriptor,
300
+ )
301
+ ops = f"@{self.station.get('Call','')}"
302
+ list_of_ops = self.database.get_ops()
303
+ for op in list_of_ops:
304
+ ops += f", {op.get('Operator', '')}"
305
+ print(
306
+ f"OPERATORS: {ops}",
307
+ end="\r\n",
308
+ file=file_descriptor,
309
+ )
310
+ print(
311
+ f"NAME: {self.station.get('Name', '')}",
312
+ end="\r\n",
313
+ file=file_descriptor,
314
+ )
315
+ print(
316
+ f"ADDRESS: {self.station.get('Street1', '')}",
317
+ end="\r\n",
318
+ file=file_descriptor,
319
+ )
320
+ print(
321
+ f"ADDRESS-CITY: {self.station.get('City', '')}",
322
+ end="\r\n",
323
+ file=file_descriptor,
324
+ )
325
+ print(
326
+ f"ADDRESS-STATE-PROVINCE: {self.station.get('State', '')}",
327
+ end="\r\n",
328
+ file=file_descriptor,
329
+ )
330
+ print(
331
+ f"ADDRESS-POSTALCODE: {self.station.get('Zip', '')}",
332
+ end="\r\n",
333
+ file=file_descriptor,
334
+ )
335
+ print(
336
+ f"ADDRESS-COUNTRY: {self.station.get('Country', '')}",
337
+ end="\r\n",
338
+ file=file_descriptor,
339
+ )
340
+ print(
341
+ f"EMAIL: {self.station.get('Email', '')}",
342
+ end="\r\n",
343
+ file=file_descriptor,
344
+ )
345
+ for contact in log:
346
+ the_date_and_time = contact.get("TS", "")
347
+ themode = contact.get("Mode", "")
348
+ if themode == "LSB" or themode == "USB":
349
+ themode = "PH"
350
+ if themode == "LSB" or themode == "USB":
351
+ themode = "PH"
352
+ if themode.strip() in (
353
+ "RTTY",
354
+ "RTTY-R",
355
+ "LSB-D",
356
+ "USB-D",
357
+ "AM-D",
358
+ "FM-D",
359
+ "DIGI-U",
360
+ "DIGI-L",
361
+ "RTTYR",
362
+ "PKTLSB",
363
+ "PKTUSB",
364
+ ):
365
+ themode = "RY"
366
+ frequency = str(int(contact.get("Freq", "0"))).rjust(5)
367
+
368
+ loggeddate = the_date_and_time[:10]
369
+ loggedtime = the_date_and_time[11:13] + the_date_and_time[14:16]
370
+ print(
371
+ f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
372
+ f"{contact.get('StationPrefix', '').ljust(13)} "
373
+ f"{str(contact.get('SentNr', '')).upper()} "
374
+ f"{contact.get('Call', '').ljust(13)} "
375
+ f"{str(contact.get('Name', '')).ljust(11)} "
376
+ f"{str(contact.get('Sect', '')).ljust(5)}",
377
+ end="\r\n",
378
+ file=file_descriptor,
379
+ )
380
+ print("END-OF-LOG:", end="\r\n", file=file_descriptor)
381
+ self.show_message_box(f"Cabrillo saved to: {filename}")
382
+ except IOError as exception:
383
+ logger.critical("cabrillo: IO error: %s, writing to %s", exception, filename)
384
+ self.show_message_box(f"Error saving Cabrillo: {exception} {filename}")
385
+ return
386
+
387
+
388
+ def recalculate_mults(self):
389
+ """Recalculates multipliers after change in logged qso."""
390
+
391
+ all_contacts = self.database.fetch_all_contacts_asc()
392
+ for contact in all_contacts:
393
+ time_stamp = contact.get("TS", "")
394
+ sect = contact.get("Sect", "")
395
+ band = contact.get("Band", "")
396
+ query = (
397
+ f"select count(*) as sect_count from dxlog where TS < '{time_stamp}' "
398
+ f"and Sect = '{sect}' "
399
+ f"and Band = '{band}' "
400
+ f"and ContestNR = {self.pref.get('contest', '1')};"
401
+ )
402
+ result = self.database.exec_sql(query)
403
+ count = result.get("sect_count", 1)
404
+ if count == 0 and contact.get("Points", 0) == 1 and sect != "DX":
405
+ contact["IsMultiplier1"] = 1
406
+ else:
407
+ contact["IsMultiplier1"] = 0
408
+ self.database.change_contact(contact)
409
+ cmd = {}
410
+ cmd["cmd"] = "UPDATELOG"
411
+ cmd["station"] = platform.node()
412
+ self.multicast_interface.send_as_json(cmd)
413
+
414
+
415
+ def set_self(the_outie):
416
+ """..."""
417
+ globals()["ALTEREGO"] = the_outie
418
+
419
+
420
+ def ft8_handler(the_packet: dict):
421
+ """Process FT8 QSO packets
422
+ FT8
423
+ {
424
+ 'CALL': 'KE0OG',
425
+ 'GRIDSQUARE': 'DM10AT',
426
+ 'MODE': 'FT8',
427
+ 'RST_SENT': '',
428
+ 'RST_RCVD': '',
429
+ 'QSO_DATE': '20210329',
430
+ 'TIME_ON': '183213',
431
+ 'QSO_DATE_OFF': '20210329',
432
+ 'TIME_OFF': '183213',
433
+ 'BAND': '20M',
434
+ 'FREQ': '14.074754',
435
+ 'STATION_CALLSIGN': 'K6GTE',
436
+ 'MY_GRIDSQUARE': 'DM13AT',
437
+ 'CONTEST_ID': 'ARRL-FIELD-DAY',
438
+ 'SRX_STRING': '1D UT',
439
+ 'CLASS': '1D',
440
+ 'ARRL_SECT': 'UT'
441
+ }
442
+ FlDigi
443
+ {
444
+ 'FREQ': '7.029500',
445
+ 'CALL': 'DL2DSL',
446
+ 'MODE': 'RTTY',
447
+ 'NAME': 'BOB',
448
+ 'QSO_DATE': '20240904',
449
+ 'QSO_DATE_OFF': '20240904',
450
+ 'TIME_OFF': '212825',
451
+ 'TIME_ON': '212800',
452
+ 'RST_RCVD': '599',
453
+ 'RST_SENT': '599',
454
+ 'BAND': '40M',
455
+ 'COUNTRY': 'FED. REP. OF GERMANY',
456
+ 'CQZ': '14',
457
+ 'STX': '000',
458
+ 'STX_STRING': '1D ORG',
459
+ 'CLASS': '1D',
460
+ 'ARRL_SECT': 'DX',
461
+ 'TX_PWR': '0',
462
+ 'OPERATOR': 'K6GTE',
463
+ 'STATION_CALLSIGN': 'K6GTE',
464
+ 'MY_GRIDSQUARE': 'DM13AT',
465
+ 'MY_CITY': 'ANAHEIM, CA',
466
+ 'MY_STATE': 'CA'
467
+ }
468
+
469
+ """
470
+ logger.debug(f"{the_packet=}")
471
+ print(f"{the_packet=}")
472
+ # the_packet=
473
+ # {
474
+ # 'FREQ': '14.028415', 'CALL': 'K5TUY', 'MODE': 'RTTY', 'NAME': 'RUSS', 'QSO_DATE': '20241015',
475
+ # 'QSO_DATE_OFF': '20241015', 'TIME_OFF': '131334', 'TIME_ON': '130300', 'RST_RCVD': '599', 'RST_SENT': '599',
476
+ # 'BAND': '20M', 'COUNTRY': 'USA', 'CQZ': '5', 'STX': '000', 'SRX_STRING': 'MO', 'STX_STRING': 'DM13',
477
+ # 'TX_PWR': '0', 'OPERATOR': 'K6GTE', 'STATION_CALLSIGN': 'K6GTE', 'MY_GRIDSQUARE': 'DM13AT',
478
+ # 'MY_CITY': 'ANAHEIM, CA', 'MY_STATE': 'CA'
479
+ # }
480
+ if ALTEREGO is not None:
481
+ ALTEREGO.callsign.setText(the_packet.get("CALL"))
482
+ ALTEREGO.contact["Call"] = the_packet.get("CALL", "")
483
+ ALTEREGO.contact["SNT"] = ALTEREGO.sent.text()
484
+ ALTEREGO.contact["RCV"] = ALTEREGO.receive.text()
485
+ ALTEREGO.other_1.setText(str(the_packet.get("NAME", "")))
486
+ ALTEREGO.other_2.setText(f'{the_packet.get("SRX_STRING", "")}'.strip())
487
+ ALTEREGO.contact["ZN"] = the_packet.get("CQZ", "")
488
+ ALTEREGO.contact["Mode"] = the_packet.get("MODE", "ERR")
489
+ ALTEREGO.contact["Freq"] = round(float(the_packet.get("FREQ", "0.0")) * 1000, 2)
490
+ ALTEREGO.contact["QSXFreq"] = round(
491
+ float(the_packet.get("FREQ", "0.0")) * 1000, 2
492
+ )
493
+ ALTEREGO.contact["Band"] = get_logged_band(
494
+ str(int(float(the_packet.get("FREQ", "0.0")) * 1000000))
495
+ )
496
+ logger.debug(f"{ALTEREGO.contact=}")
497
+
498
+ ALTEREGO.save_contact()
499
+
500
+
501
+ def process_esm(self, new_focused_widget=None, with_enter=False):
502
+ """ESM State Machine"""
503
+
504
+ # self.pref["run_state"]
505
+
506
+ # -----===== Assigned F-Keys =====-----
507
+ # self.esm_dict["CQ"]
508
+ # self.esm_dict["EXCH"]
509
+ # self.esm_dict["QRZ"]
510
+ # self.esm_dict["AGN"]
511
+ # self.esm_dict["HISCALL"]
512
+ # self.esm_dict["MYCALL"]
513
+ # self.esm_dict["QSOB4"]
514
+
515
+ # ----==== text fields ====----
516
+ # self.callsign
517
+ # self.sent
518
+ # self.receive
519
+ # self.other_1
520
+ # self.other_2
521
+
522
+ if new_focused_widget is not None:
523
+ self.current_widget = self.inputs_dict.get(new_focused_widget)
524
+
525
+ # print(f"checking esm {self.current_widget=} {with_enter=} {self.pref.get("run_state")=}")
526
+
527
+ for a_button in [
528
+ self.F1,
529
+ self.F2,
530
+ self.F3,
531
+ self.F4,
532
+ self.F5,
533
+ self.F6,
534
+ self.F7,
535
+ self.F8,
536
+ self.F9,
537
+ self.F10,
538
+ self.F11,
539
+ self.F12,
540
+ ]:
541
+ self.restore_button_color(a_button)
542
+
543
+ buttons_to_send = []
544
+
545
+ if self.pref.get("run_state"):
546
+ if self.current_widget == "callsign":
547
+ if len(self.callsign.text()) < 3:
548
+ self.make_button_green(self.esm_dict["CQ"])
549
+ buttons_to_send.append(self.esm_dict["CQ"])
550
+ elif len(self.callsign.text()) > 2 and self.callsign.text().isalnum():
551
+ self.make_button_green(self.esm_dict["HISCALL"])
552
+ self.make_button_green(self.esm_dict["EXCH"])
553
+ buttons_to_send.append(self.esm_dict["HISCALL"])
554
+ buttons_to_send.append(self.esm_dict["EXCH"])
555
+
556
+ elif self.current_widget == "other_1" or self.current_widget == "other_2":
557
+ continent = self.contact.get("Continent")
558
+ print(
559
+ f"{self.current_widget=} {self.other_1.text().isalpha()=} {self.other_2.text().isalpha()=} {continent=}"
560
+ )
561
+ if self.other_1.text() == "" or (
562
+ self.other_2.text() == "" and continent == "NA"
563
+ ):
564
+ self.make_button_green(self.esm_dict["AGN"])
565
+ buttons_to_send.append(self.esm_dict["AGN"])
566
+ elif (
567
+ self.other_1.text().isalpha()
568
+ and self.other_2.text().isalpha()
569
+ and continent == "NA"
570
+ ):
571
+ self.make_button_green(self.esm_dict["QRZ"])
572
+ buttons_to_send.append(self.esm_dict["QRZ"])
573
+ buttons_to_send.append("LOGIT")
574
+ elif self.other_1.text().isalpha() and continent != "NA":
575
+ self.make_button_green(self.esm_dict["QRZ"])
576
+ buttons_to_send.append(self.esm_dict["QRZ"])
577
+ buttons_to_send.append("LOGIT")
578
+ else:
579
+ self.make_button_green(self.esm_dict["AGN"])
580
+ buttons_to_send.append(self.esm_dict["AGN"])
581
+
582
+ if with_enter is True and bool(len(buttons_to_send)):
583
+ sendstring = ""
584
+ for button in buttons_to_send:
585
+ if button:
586
+ if button == "LOGIT":
587
+ self.save_contact()
588
+ continue
589
+ sendstring = f"{sendstring}{self.process_macro(button.toolTip())} "
590
+ self.fldigi_util.send_string(sendstring)
591
+ else:
592
+ if self.current_widget == "callsign":
593
+ if len(self.callsign.text()) > 2 and self.callsign.text().isalnum():
594
+ self.make_button_green(self.esm_dict["MYCALL"])
595
+ buttons_to_send.append(self.esm_dict["MYCALL"])
596
+
597
+ elif self.current_widget == "other_1" or self.current_widget == "other_2":
598
+ continent = self.contact.get("Continent")
599
+ if self.other_1.text() == "" or (
600
+ self.other_2.text() == "" and continent == "NA"
601
+ ):
602
+ self.make_button_green(self.esm_dict["AGN"])
603
+ buttons_to_send.append(self.esm_dict["AGN"])
604
+ elif (
605
+ self.other_1.text().isalpha()
606
+ and self.other_2.text().isalpha()
607
+ and continent == "NA"
608
+ ):
609
+ self.make_button_green(self.esm_dict["EXCH"])
610
+ buttons_to_send.append(self.esm_dict["EXCH"])
611
+ buttons_to_send.append("LOGIT")
612
+ elif self.other_1.text().isalpha() and continent != "NA":
613
+ self.make_button_green(self.esm_dict["EXCH"])
614
+ buttons_to_send.append(self.esm_dict["EXCH"])
615
+ buttons_to_send.append("LOGIT")
616
+ else:
617
+ self.make_button_green(self.esm_dict["AGN"])
618
+ buttons_to_send.append(self.esm_dict["AGN"])
619
+
620
+ if with_enter is True and bool(len(buttons_to_send)):
621
+ sendstring = ""
622
+ for button in buttons_to_send:
623
+ if button:
624
+ if button == "LOGIT":
625
+ self.save_contact()
626
+ continue
627
+ sendstring = f"{sendstring}{self.process_macro(button.toolTip())} "
628
+ self.fldigi_util.send_string(sendstring)
@@ -361,3 +361,129 @@ def recalculate_mults(self):
361
361
  cmd["cmd"] = "UPDATELOG"
362
362
  cmd["station"] = platform.node()
363
363
  self.multicast_interface.send_as_json(cmd)
364
+
365
+
366
+ def process_esm(self, new_focused_widget=None, with_enter=False):
367
+ """ESM State Machine"""
368
+
369
+ # self.pref["run_state"]
370
+
371
+ # -----===== Assigned F-Keys =====-----
372
+ # self.esm_dict["CQ"]
373
+ # self.esm_dict["EXCH"]
374
+ # self.esm_dict["QRZ"]
375
+ # self.esm_dict["AGN"]
376
+ # self.esm_dict["HISCALL"]
377
+ # self.esm_dict["MYCALL"]
378
+ # self.esm_dict["QSOB4"]
379
+
380
+ # ----==== text fields ====----
381
+ # self.callsign
382
+ # self.sent
383
+ # self.receive
384
+ # self.other_1
385
+ # self.other_2
386
+
387
+ if new_focused_widget is not None:
388
+ self.current_widget = self.inputs_dict.get(new_focused_widget)
389
+
390
+ # print(f"checking esm {self.current_widget=} {with_enter=} {self.pref.get("run_state")=}")
391
+
392
+ for a_button in [
393
+ self.F1,
394
+ self.F2,
395
+ self.F3,
396
+ self.F4,
397
+ self.F5,
398
+ self.F6,
399
+ self.F7,
400
+ self.F8,
401
+ self.F9,
402
+ self.F10,
403
+ self.F11,
404
+ self.F12,
405
+ ]:
406
+ self.restore_button_color(a_button)
407
+
408
+ buttons_to_send = []
409
+
410
+ if self.pref.get("run_state"):
411
+ if self.current_widget == "callsign":
412
+ if len(self.callsign.text()) < 3:
413
+ self.make_button_green(self.esm_dict["CQ"])
414
+ buttons_to_send.append(self.esm_dict["CQ"])
415
+ elif len(self.callsign.text()) > 2 and self.callsign.text().isalnum():
416
+ self.make_button_green(self.esm_dict["HISCALL"])
417
+ self.make_button_green(self.esm_dict["EXCH"])
418
+ buttons_to_send.append(self.esm_dict["HISCALL"])
419
+ buttons_to_send.append(self.esm_dict["EXCH"])
420
+
421
+ elif self.current_widget == "other_1" or self.current_widget == "other_2":
422
+ continent = self.contact.get("Continent")
423
+ print(
424
+ f"{self.current_widget=} {self.other_1.text().isalpha()=} {self.other_2.text().isalpha()=} {continent=}"
425
+ )
426
+ if self.other_1.text() == "" or (
427
+ self.other_2.text() == "" and continent == "NA"
428
+ ):
429
+ self.make_button_green(self.esm_dict["AGN"])
430
+ buttons_to_send.append(self.esm_dict["AGN"])
431
+ elif (
432
+ self.other_1.text().isalpha()
433
+ and self.other_2.text().isalpha()
434
+ and continent == "NA"
435
+ ):
436
+ self.make_button_green(self.esm_dict["QRZ"])
437
+ buttons_to_send.append(self.esm_dict["QRZ"])
438
+ buttons_to_send.append("LOGIT")
439
+ elif self.other_1.text().isalpha() and continent != "NA":
440
+ self.make_button_green(self.esm_dict["QRZ"])
441
+ buttons_to_send.append(self.esm_dict["QRZ"])
442
+ buttons_to_send.append("LOGIT")
443
+ else:
444
+ self.make_button_green(self.esm_dict["AGN"])
445
+ buttons_to_send.append(self.esm_dict["AGN"])
446
+
447
+ if with_enter is True and bool(len(buttons_to_send)):
448
+ for button in buttons_to_send:
449
+ if button:
450
+ if button == "LOGIT":
451
+ self.save_contact()
452
+ continue
453
+ self.process_function_key(button)
454
+ else:
455
+ if self.current_widget == "callsign":
456
+ if len(self.callsign.text()) > 2 and self.callsign.text().isalnum():
457
+ self.make_button_green(self.esm_dict["MYCALL"])
458
+ buttons_to_send.append(self.esm_dict["MYCALL"])
459
+
460
+ elif self.current_widget == "other_1" or self.current_widget == "other_2":
461
+ continent = self.contact.get("Continent")
462
+ if self.other_1.text() == "" or (
463
+ self.other_2.text() == "" and continent == "NA"
464
+ ):
465
+ self.make_button_green(self.esm_dict["AGN"])
466
+ buttons_to_send.append(self.esm_dict["AGN"])
467
+ elif (
468
+ self.other_1.text().isalpha()
469
+ and self.other_2.text().isalpha()
470
+ and continent == "NA"
471
+ ):
472
+ self.make_button_green(self.esm_dict["EXCH"])
473
+ buttons_to_send.append(self.esm_dict["EXCH"])
474
+ buttons_to_send.append("LOGIT")
475
+ elif self.other_1.text().isalpha() and continent != "NA":
476
+ self.make_button_green(self.esm_dict["EXCH"])
477
+ buttons_to_send.append(self.esm_dict["EXCH"])
478
+ buttons_to_send.append("LOGIT")
479
+ else:
480
+ self.make_button_green(self.esm_dict["AGN"])
481
+ buttons_to_send.append(self.esm_dict["AGN"])
482
+
483
+ if with_enter is True and bool(len(buttons_to_send)):
484
+ for button in buttons_to_send:
485
+ if button:
486
+ if button == "LOGIT":
487
+ self.save_contact()
488
+ continue
489
+ self.process_function_key(button)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: not1mm
3
- Version: 24.10.14
3
+ Version: 24.10.15
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
@@ -213,7 +213,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
213
213
  - ARRL Sweepstakes CW, SSB
214
214
  - ARRL VHF January, June, September
215
215
  - CQ 160 CW, SSB
216
- - CQ WPX CW, RTTY, SSB
216
+ - .CQ WPX CW, RTTY, SSB
217
217
  - .CQ World Wide CW, RTTY, SSB
218
218
  - .CWOps CWT
219
219
  - Helvetia
@@ -222,7 +222,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
222
222
  - ICWC MST
223
223
  - Japan International DX CW, SSB
224
224
  - .K1USN Slow Speed Test
225
- - NAQP CW, SSB
225
+ - .NAQP CW, RTTY, SSB
226
226
  - Phone Weekly Test
227
227
  - RAC Canada Day
228
228
  - Stew Perry Topband
@@ -231,6 +231,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
231
231
 
232
232
  ## Recent Changes
233
233
 
234
+ - [24-10-15] Add NAQP RTTY, Added ESM to NAQP.
234
235
  - [24-10-14] Add ESM to CQ WPX.
235
236
  - [24-10-13] Added ESM to Weekly RTTY, K1USN and CWT.
236
237
  - [24-10-11] added ESM to CQWW SSB and RTTY.
@@ -31,7 +31,7 @@ not1mm/data/k6gte.not1mm-64.png,sha256=6ku45Gq1g5ezh04F07osoKRtanb3e4kbx5XdIEh3N
31
31
  not1mm/data/logwindow.ui,sha256=f7vULj96tHIQuR1nJMyvPHHcmVgzkhv9D1isyojsnFU,1458
32
32
  not1mm/data/logwindowx.ui,sha256=CwpI-h7cI1yqyldH9quKftsdHL5lTyL9ABOcf80nfqc,1632
33
33
  not1mm/data/main.ui,sha256=IOrAJfJDhG30bWi08pLBGzDKjBvjKfPNI9-GNpvu0vI,61886
34
- not1mm/data/new_contest.ui,sha256=oIe15jiIN50wc5THeJLIO3KYZWXUyqRt9n_ShD0qO7Y,23116
34
+ not1mm/data/new_contest.ui,sha256=zqNza6syjqZdVFKS57gzMCL4vD7Fg9n_wO3mS7DDXpg,23222
35
35
  not1mm/data/not1mm.html,sha256=c9-mfjMwDt4f5pySUruz2gREW33CQ2_rCddM2z5CZQo,23273
36
36
  not1mm/data/opon.ui,sha256=QDicqAk2lORG2UWsHa6jHlsGn6uzrrI2R4HSAocpPes,2258
37
37
  not1mm/data/pickcontest.ui,sha256=4hPBszCglObThx_eIWtmK9CEcbr7WBjbB1rKZdI-o3I,1707
@@ -114,7 +114,7 @@ not1mm/lib/plugin_common.py,sha256=TbFUbftjELFt4QRdsjSHbqnXSngZOlSwlCTClqosDXA,9
114
114
  not1mm/lib/select_contest.py,sha256=WsptLuwkouIHeocJL3oZ6-eUfEnhpwdc-x7eMZ_TIVM,359
115
115
  not1mm/lib/settings.py,sha256=7_JFDSKPOd35Gwzqhrbed4EfrlYUm7AEnz2xBRioc-g,13280
116
116
  not1mm/lib/super_check_partial.py,sha256=p5l3u2ZOCBtlWgbvskC50FpuoaIpR07tfC6zTdRWbh4,2334
117
- not1mm/lib/version.py,sha256=5FcRZ4LJYlhATkLgCJmVozjtLkJZxonDosjR6rRNS7o,49
117
+ not1mm/lib/version.py,sha256=TQilIDGjxM6306HAmXC1jsWKAGZlk0Wp784hGVD4EKI,49
118
118
  not1mm/lib/versiontest.py,sha256=8vDNptuBBunn-1IGkjNaquehqBYUJyjrPSF8Igmd4_Y,1286
119
119
  not1mm/plugins/10_10_fall_cw.py,sha256=IttjX1yy4nDdACGsiYlPteFG8eVseX_WtoFio6bqHE8,10953
120
120
  not1mm/plugins/10_10_spring_cw.py,sha256=ThCptdM3dX4ywhoy2JRcOEyHSqcJolFaT7O_PYzM1Mg,10958
@@ -150,16 +150,17 @@ not1mm/plugins/icwc_mst.py,sha256=v8L5NX2QmTM7x8Po1mb4yfN-dGVIuqky5MIT-OjfaVY,11
150
150
  not1mm/plugins/jidx_cw.py,sha256=9oV4hDxMiGXa9wuYUNYOCsr-mz8LYB-4WMHBN8u2dFk,12153
151
151
  not1mm/plugins/jidx_ph.py,sha256=T-V7-77SIwu-Jl55VIrbVFZlsBoc97mXtgbdde0GaiQ,11183
152
152
  not1mm/plugins/k1usn_sst.py,sha256=l-_r-Ve1txpJF1UyqoaOKUXjTaKxQtzxCbXd7fZCZIg,15439
153
- not1mm/plugins/naqp_cw.py,sha256=c0MuKqfkIxiYFvv2z7vqrBz3m9FSnSYkPK3f-DdkTIA,12632
154
- not1mm/plugins/naqp_ssb.py,sha256=VLWVrSzI0UP1AhSXYn61eZ7or1rz6a_pS_xCKfgS4Jw,11595
153
+ not1mm/plugins/naqp_cw.py,sha256=3FIBd6_hWNdeVMlAFYnoT-Y_SYY0ZROQIZLh2HHuVy4,17518
154
+ not1mm/plugins/naqp_rtty.py,sha256=vk5vBbpB2HEaRmmpKwzk1GQabAFZmNrrBn3hYUmpf6Y,21299
155
+ not1mm/plugins/naqp_ssb.py,sha256=Bd1mgaycYCSXOb9k3yIbJB9dktO4jC0ty2pg4yONnGM,16435
155
156
  not1mm/plugins/phone_weekly_test.py,sha256=fLpMe03WB9_KgRl6vMgQQt_aktFdqfNt2Sw81CTRAUs,12325
156
157
  not1mm/plugins/ref_cw.py,sha256=aWjHHkqIKutjRUtzh09y5haFfnZK9poRQDWRQMDRxxU,16326
157
158
  not1mm/plugins/stew_perry_topband.py,sha256=CKBQbYl4ETxhXJd2dma4fg_C5pag_s7Nf61SCztZtqE,10668
158
159
  not1mm/plugins/weekly_rtty.py,sha256=S_oBAnsIq2ng7FunIB2qukdZyhMzQKGDAlQFc9UUr-U,18255
159
160
  not1mm/plugins/winter_field_day.py,sha256=4rcfRtobwjHO6BNL3WOTHzBmyyeuX79BNGBG8PfjrI8,10238
160
- not1mm-24.10.14.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
161
- not1mm-24.10.14.dist-info/METADATA,sha256=B_xYjcgKKAYPEdlNEi-KOrti6GC670xE54LjuUNsc4I,33810
162
- not1mm-24.10.14.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
163
- not1mm-24.10.14.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
164
- not1mm-24.10.14.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
165
- not1mm-24.10.14.dist-info/RECORD,,
161
+ not1mm-24.10.15.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
162
+ not1mm-24.10.15.dist-info/METADATA,sha256=LEdL14UB3j7Yea8SYMfSyx8rtoqLvDXbFd_GQ72RGQw,33865
163
+ not1mm-24.10.15.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
164
+ not1mm-24.10.15.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
165
+ not1mm-24.10.15.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
166
+ not1mm-24.10.15.dist-info/RECORD,,