not1mm 25.3.19__py3-none-any.whl → 25.3.23__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.
@@ -0,0 +1,727 @@
1
+ """
2
+ His Maj. King of Spain Contest, SSB
3
+ Status: Active
4
+ Geographic Focus: Worldwide
5
+ Participation: Worldwide
6
+ Awards: Worldwide
7
+ Mode: SSB
8
+ Bands: 160, 80, 40, 20, 15, 10m
9
+ Classes: Single Op All Band (QRP/Low/High)
10
+ Single Op All Band Youth
11
+ Single Op Single Band
12
+ Multi-Op (Low/High)
13
+ Max power: HP: >100 watts
14
+ LP: 100 watts
15
+ QRP: 5 watts
16
+ Exchange: EA: RST + province
17
+ non-EA: RST + Serial No.
18
+ Work stations: Once per band
19
+ QSO Points: (see rules)
20
+ Multipliers: Each EA province once per band
21
+ Each EADX100 entity once per band
22
+ Each special (EA0) station once per band
23
+ Score Calculation: Total score = total QSO points x total mults
24
+ E-mail logs to: (none)
25
+ Upload log at: https://concursos.ure.es/en/logs/
26
+ Mail logs to: (none)
27
+ Find rules at: https://concursos.ure.es/en/s-m-el-rey-de-espana-ssb/bases/
28
+ Cabrillo name: EA-MAJESTAD-SSB
29
+ """
30
+
31
+ # pylint: disable=invalid-name, unused-argument, unused-variable, c-extension-no-member
32
+
33
+ # EA1: AV, BU, C, LE, LO, LU, O, OU, P, PO, S, SA, SG, SO, VA, ZA
34
+ # EA2: BI, HU, NA, SS, TE, VI, Z
35
+ # EA3: B, GI, L, T
36
+ # EA4: BA, CC, CR, CU, GU, M, TO
37
+ # EA5: A, AB, CS, MU, V
38
+ # EA6: IB
39
+ # EA7: AL, CA, CO, GR, H, J, MA, SE
40
+ # EA8: GC, TF
41
+ # EA9: CE, ML
42
+
43
+
44
+ import datetime
45
+ import logging
46
+
47
+ from pathlib import Path
48
+ from PyQt6 import QtWidgets
49
+
50
+ from not1mm.lib.ham_utility import get_logged_band
51
+ from not1mm.lib.plugin_common import gen_adif, get_points, online_score_xml
52
+ from not1mm.lib.version import __version__
53
+
54
+ logger = logging.getLogger(__name__)
55
+
56
+ EXCHANGE_HINT = "Province or #"
57
+
58
+ name = "His Maj. King of Spain Contest, SSB"
59
+ mode = "SSB" # CW SSB BOTH RTTY
60
+ cabrillo_name = "EA-MAJESTAD-SSB"
61
+
62
+ columns = [
63
+ "YYYY-MM-DD HH:MM:SS",
64
+ "Call",
65
+ "Freq",
66
+ "Snt",
67
+ "Rcv",
68
+ "SentNr",
69
+ "RcvNr",
70
+ "PTS",
71
+ ]
72
+
73
+ advance_on_space = [True, True, True, True, True]
74
+
75
+ # 1 once per contest, 2 work each band, 3 each band/mode, 4 no dupe checking
76
+ dupe_type = 2
77
+
78
+
79
+ def init_contest(self) -> None:
80
+ """setup plugin"""
81
+ set_tab_next(self)
82
+ set_tab_prev(self)
83
+ interface(self)
84
+ self.next_field = self.other_2
85
+
86
+
87
+ def interface(self) -> None:
88
+ """
89
+ Setup the user interface.
90
+ Unhides the input fields and sets the lebels.
91
+ """
92
+ self.field1.show()
93
+ self.field2.show()
94
+ self.field3.show()
95
+ self.field4.show()
96
+ self.snt_label.setText("SNT")
97
+ self.field1.setAccessibleName("RST Sent")
98
+ self.other_label.setText("SentNR")
99
+ self.field3.setAccessibleName("Sent Number")
100
+ self.exch_label.setText("Prov or SN")
101
+ self.field4.setAccessibleName("Province or Serial Number")
102
+
103
+
104
+ def reset_label(self) -> None:
105
+ """
106
+ Reset label after field cleared.
107
+ Not needed for this contest.
108
+ """
109
+
110
+
111
+ def set_tab_next(self) -> None:
112
+ """
113
+ Set TAB Advances.
114
+ Defines which which of the fields are next to get focus when the TAB key is pressed.
115
+ """
116
+ self.tab_next = {
117
+ self.callsign: self.sent,
118
+ self.sent: self.receive,
119
+ self.receive: self.other_1,
120
+ self.other_1: self.other_2,
121
+ self.other_2: self.callsign,
122
+ }
123
+
124
+
125
+ def set_tab_prev(self) -> None:
126
+ """
127
+ Set TAB Advances.
128
+ Defines which which of the fields are next to get focus when the Shift-TAB key is pressed.
129
+ """
130
+ self.tab_prev = {
131
+ self.callsign: self.other_2,
132
+ self.sent: self.callsign,
133
+ self.receive: self.sent,
134
+ self.other_1: self.receive,
135
+ self.other_2: self.other_1,
136
+ }
137
+
138
+
139
+ def validate(self) -> bool:
140
+ """Not Used"""
141
+ return True
142
+
143
+
144
+ def set_contact_vars(self) -> None:
145
+ """Contest Specific"""
146
+ self.contact["SNT"] = self.sent.text()
147
+ self.contact["RCV"] = self.receive.text()
148
+ self.contact["NR"] = self.other_2.text().upper()
149
+ self.contact["SentNr"] = self.other_1.text()
150
+
151
+
152
+ def predupe(self) -> None:
153
+ """called after callsign entered. Not needed here."""
154
+
155
+
156
+ def prefill(self) -> None:
157
+ """
158
+ Fill the SentNR field with either the next serial number or the province.
159
+ """
160
+ result = self.database.get_serial()
161
+ serial_nr = str(result.get("serial_nr", "1")).zfill(3)
162
+ if serial_nr == "None":
163
+ serial_nr = "001"
164
+
165
+ exchange = self.contest_settings.get("SentExchange", "").replace("#", serial_nr)
166
+ if len(self.other_1.text()) == 0:
167
+ self.other_1.setText(exchange)
168
+
169
+
170
+ def points(self) -> int:
171
+ """
172
+ Calculate the points for this contact.
173
+ """
174
+ # EA: 2 points per QSO with EA
175
+ # EA: 1 point per QSO with non-EA
176
+ # non-EA: 3 points per QSO with EA
177
+ # non-EA: 1 point per QSO with non-EA
178
+
179
+ ea_prefixes = ["EA", "EA1", "EA2", "EA3", "EA4", "EA5", "EA6", "EA7", "EA8", "EA9"]
180
+
181
+ me = None
182
+ him = None
183
+
184
+ result = self.cty_lookup(self.station.get("Call", ""))
185
+ if result:
186
+ for item in result.items():
187
+ me = item[1].get("primary_pfx", "")
188
+
189
+ result = self.cty_lookup(self.contact.get("Call", ""))
190
+ if result:
191
+ for item in result.items():
192
+ him = item[1].get("primary_pfx", "")
193
+
194
+ if me is not None and him is not None:
195
+ if me in ea_prefixes and him in ea_prefixes:
196
+ return 2
197
+ elif me in ea_prefixes and him not in ea_prefixes:
198
+ return 1
199
+ elif me not in ea_prefixes and him in ea_prefixes:
200
+ return 3
201
+ else:
202
+ return 1
203
+
204
+ return 1
205
+
206
+
207
+ def show_mults(self, rtc=None) -> int:
208
+ """Return display string for mults"""
209
+
210
+ ea_provinces = 0
211
+ # dx = 0
212
+ ef0f = 0
213
+ eadx100 = 0
214
+
215
+ # Each EADX100 entity once per band
216
+ sql = (
217
+ "select count(DISTINCT(CountryPrefix || ':' || Band)) as mult_count "
218
+ f"from dxlog where ContestNR = {self.database.current_contest};"
219
+ )
220
+ result = self.database.exec_sql(sql)
221
+ if result:
222
+ eadx100 = result.get("mult_count", 0)
223
+
224
+ # Each EA province once per band
225
+ sql = (
226
+ "select count(DISTINCT(NR || ':' || Band)) as mult_count "
227
+ f"from dxlog where ContestNR = {self.database.current_contest} and typeof(NR) = 'text';"
228
+ )
229
+ result = self.database.exec_sql(sql)
230
+ if result:
231
+ ea_provinces = result.get("mult_count", 0)
232
+
233
+ # Each QSO with EF0F/8 once per band
234
+ sql = (
235
+ "select count(DISTINCT(Band)) as mult_count "
236
+ f"from dxlog where Call = 'EF0F/8' and ContestNR = {self.database.current_contest};"
237
+ )
238
+ result = self.database.exec_sql(sql)
239
+ if result:
240
+ ef0f = result.get("mult_count", 0)
241
+
242
+ if rtc is not None:
243
+ return 0, 0
244
+
245
+ return ea_provinces + ef0f + eadx100
246
+
247
+
248
+ def show_qso(self) -> int:
249
+ """Return qso count"""
250
+ result = self.database.fetch_qso_count()
251
+ if result:
252
+ return int(result.get("qsos", 0))
253
+ return 0
254
+
255
+
256
+ def calc_score(self) -> int:
257
+ """Return calculated score"""
258
+ _points = get_points(self)
259
+ _mults = show_mults(self)
260
+
261
+ return _points * _mults
262
+
263
+
264
+ def adif(self) -> None:
265
+ """Call the generate ADIF function"""
266
+ gen_adif(self, cabrillo_name, contest_id=cabrillo_name)
267
+
268
+
269
+ def output_cabrillo_line(line_to_output, ending, file_descriptor, file_encoding):
270
+ """"""
271
+ print(
272
+ line_to_output.encode(file_encoding, errors="ignore").decode(),
273
+ end=ending,
274
+ file=file_descriptor,
275
+ )
276
+
277
+
278
+ def cabrillo(self, file_encoding):
279
+ """Generates Cabrillo file. Maybe."""
280
+ # https://www.cqwpx.com/cabrillo.htm
281
+ logger.debug("******Cabrillo*****")
282
+ logger.debug("Station: %s", f"{self.station}")
283
+ logger.debug("Contest: %s", f"{self.contest_settings}")
284
+ now = datetime.datetime.now()
285
+ date_time = now.strftime("%Y-%m-%d_%H-%M-%S")
286
+ filename = (
287
+ str(Path.home())
288
+ + "/"
289
+ + f"{self.station.get('Call', '').upper()}_{cabrillo_name}_{date_time}.log"
290
+ )
291
+ logger.debug("%s", filename)
292
+ log = self.database.fetch_all_contacts_asc()
293
+ try:
294
+ with open(filename, "w", encoding=file_encoding, newline="") as file_descriptor:
295
+ output_cabrillo_line(
296
+ "START-OF-LOG: 3.0",
297
+ "\r\n",
298
+ file_descriptor,
299
+ file_encoding,
300
+ )
301
+ output_cabrillo_line(
302
+ f"CREATED-BY: Not1MM v{__version__}",
303
+ "\r\n",
304
+ file_descriptor,
305
+ file_encoding,
306
+ )
307
+ output_cabrillo_line(
308
+ f"CONTEST: {cabrillo_name}",
309
+ "\r\n",
310
+ file_descriptor,
311
+ file_encoding,
312
+ )
313
+ if self.station.get("Club", ""):
314
+ output_cabrillo_line(
315
+ f"CLUB: {self.station.get('Club', '')}",
316
+ "\r\n",
317
+ file_descriptor,
318
+ file_encoding,
319
+ )
320
+ output_cabrillo_line(
321
+ f"CALLSIGN: {self.station.get('Call','')}",
322
+ "\r\n",
323
+ file_descriptor,
324
+ file_encoding,
325
+ )
326
+ output_cabrillo_line(
327
+ f"LOCATION: {self.station.get('ARRLSection', '')}",
328
+ "\r\n",
329
+ file_descriptor,
330
+ file_encoding,
331
+ )
332
+ output_cabrillo_line(
333
+ f"CATEGORY-OPERATOR: {self.contest_settings.get('OperatorCategory','')}",
334
+ "\r\n",
335
+ file_descriptor,
336
+ file_encoding,
337
+ )
338
+ output_cabrillo_line(
339
+ f"CATEGORY-ASSISTED: {self.contest_settings.get('AssistedCategory','')}",
340
+ "\r\n",
341
+ file_descriptor,
342
+ file_encoding,
343
+ )
344
+ output_cabrillo_line(
345
+ f"CATEGORY-BAND: {self.contest_settings.get('BandCategory','')}",
346
+ "\r\n",
347
+ file_descriptor,
348
+ file_encoding,
349
+ )
350
+ mode = self.contest_settings.get("ModeCategory", "")
351
+ if mode in ["SSB+CW", "SSB+CW+DIGITAL"]:
352
+ mode = "MIXED"
353
+ output_cabrillo_line(
354
+ f"CATEGORY-MODE: {mode}",
355
+ "\r\n",
356
+ file_descriptor,
357
+ file_encoding,
358
+ )
359
+ output_cabrillo_line(
360
+ f"CATEGORY-TRANSMITTER: {self.contest_settings.get('TransmitterCategory','')}",
361
+ "\r\n",
362
+ file_descriptor,
363
+ file_encoding,
364
+ )
365
+ if self.contest_settings.get("OverlayCategory", "") != "N/A":
366
+ output_cabrillo_line(
367
+ f"CATEGORY-OVERLAY: {self.contest_settings.get('OverlayCategory','')}",
368
+ "\r\n",
369
+ file_descriptor,
370
+ file_encoding,
371
+ )
372
+ output_cabrillo_line(
373
+ f"GRID-LOCATOR: {self.station.get('GridSquare','')}",
374
+ "\r\n",
375
+ file_descriptor,
376
+ file_encoding,
377
+ )
378
+ output_cabrillo_line(
379
+ f"CATEGORY-POWER: {self.contest_settings.get('PowerCategory','')}",
380
+ "\r\n",
381
+ file_descriptor,
382
+ file_encoding,
383
+ )
384
+
385
+ output_cabrillo_line(
386
+ f"CLAIMED-SCORE: {calc_score(self)}",
387
+ "\r\n",
388
+ file_descriptor,
389
+ file_encoding,
390
+ )
391
+ ops = f"@{self.station.get('Call','')}"
392
+ list_of_ops = self.database.get_ops()
393
+ for op in list_of_ops:
394
+ ops += f", {op.get('Operator', '')}"
395
+ output_cabrillo_line(
396
+ f"OPERATORS: {ops}",
397
+ "\r\n",
398
+ file_descriptor,
399
+ file_encoding,
400
+ )
401
+ output_cabrillo_line(
402
+ f"NAME: {self.station.get('Name', '')}",
403
+ "\r\n",
404
+ file_descriptor,
405
+ file_encoding,
406
+ )
407
+ output_cabrillo_line(
408
+ f"ADDRESS: {self.station.get('Street1', '')}",
409
+ "\r\n",
410
+ file_descriptor,
411
+ file_encoding,
412
+ )
413
+ output_cabrillo_line(
414
+ f"ADDRESS-CITY: {self.station.get('City', '')}",
415
+ "\r\n",
416
+ file_descriptor,
417
+ file_encoding,
418
+ )
419
+ output_cabrillo_line(
420
+ f"ADDRESS-STATE-PROVINCE: {self.station.get('State', '')}",
421
+ "\r\n",
422
+ file_descriptor,
423
+ file_encoding,
424
+ )
425
+ output_cabrillo_line(
426
+ f"ADDRESS-POSTALCODE: {self.station.get('Zip', '')}",
427
+ "\r\n",
428
+ file_descriptor,
429
+ file_encoding,
430
+ )
431
+ output_cabrillo_line(
432
+ f"ADDRESS-COUNTRY: {self.station.get('Country', '')}",
433
+ "\r\n",
434
+ file_descriptor,
435
+ file_encoding,
436
+ )
437
+ output_cabrillo_line(
438
+ f"EMAIL: {self.station.get('Email', '')}",
439
+ "\r\n",
440
+ file_descriptor,
441
+ file_encoding,
442
+ )
443
+ for contact in log:
444
+ the_date_and_time = contact.get("TS", "")
445
+ themode = contact.get("Mode", "")
446
+ if themode == "LSB" or themode == "USB":
447
+ themode = "PH"
448
+ if themode == "RTTY":
449
+ themode = "RY"
450
+ frequency = str(int(contact.get("Freq", "0"))).rjust(5)
451
+
452
+ loggeddate = the_date_and_time[:10]
453
+ loggedtime = the_date_and_time[11:13] + the_date_and_time[14:16]
454
+ output_cabrillo_line(
455
+ f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
456
+ f"{contact.get('StationPrefix', '').ljust(13)} "
457
+ f"{str(contact.get('SNT', '')).ljust(3)} "
458
+ f"{str(contact.get('SentNr', '')).ljust(6)} "
459
+ f"{contact.get('Call', '').ljust(13)} "
460
+ f"{str(contact.get('RCV', '')).ljust(3)} "
461
+ f"{str(contact.get('NR', '')).ljust(6)}",
462
+ "\r\n",
463
+ file_descriptor,
464
+ file_encoding,
465
+ )
466
+ output_cabrillo_line("END-OF-LOG:", "\r\n", file_descriptor, file_encoding)
467
+ self.show_message_box(f"Cabrillo saved to: {filename}")
468
+ except IOError as exception:
469
+ logger.critical("cabrillo: IO error: %s, writing to %s", exception, filename)
470
+ self.show_message_box(f"Error saving Cabrillo: {exception} {filename}")
471
+ return
472
+
473
+
474
+ def recalculate_mults(self) -> None:
475
+ """Recalculates multipliers after change in logged qso."""
476
+
477
+
478
+ def process_esm(self, new_focused_widget=None, with_enter=False):
479
+ """ESM State Machine"""
480
+
481
+ # self.pref["run_state"]
482
+
483
+ # -----===== Assigned F-Keys =====-----
484
+ # self.esm_dict["CQ"]
485
+ # self.esm_dict["EXCH"]
486
+ # self.esm_dict["QRZ"]
487
+ # self.esm_dict["AGN"]
488
+ # self.esm_dict["HISCALL"]
489
+ # self.esm_dict["MYCALL"]
490
+ # self.esm_dict["QSOB4"]
491
+
492
+ # ----==== text fields ====----
493
+ # self.callsign
494
+ # self.sent
495
+ # self.receive
496
+ # self.other_1
497
+ # self.other_2
498
+
499
+ if new_focused_widget is not None:
500
+ self.current_widget = self.inputs_dict.get(new_focused_widget)
501
+
502
+ # print(f"checking esm {self.current_widget=} {with_enter=} {self.pref.get("run_state")=}")
503
+
504
+ for a_button in [
505
+ self.esm_dict["CQ"],
506
+ self.esm_dict["EXCH"],
507
+ self.esm_dict["QRZ"],
508
+ self.esm_dict["AGN"],
509
+ self.esm_dict["HISCALL"],
510
+ self.esm_dict["MYCALL"],
511
+ self.esm_dict["QSOB4"],
512
+ ]:
513
+ if a_button is not None:
514
+ self.restore_button_color(a_button)
515
+
516
+ buttons_to_send = []
517
+
518
+ if self.pref.get("run_state"):
519
+ if self.current_widget == "callsign":
520
+ if len(self.callsign.text()) < 3:
521
+ self.make_button_green(self.esm_dict["CQ"])
522
+ buttons_to_send.append(self.esm_dict["CQ"])
523
+ elif len(self.callsign.text()) > 2:
524
+ self.make_button_green(self.esm_dict["HISCALL"])
525
+ self.make_button_green(self.esm_dict["EXCH"])
526
+ buttons_to_send.append(self.esm_dict["HISCALL"])
527
+ buttons_to_send.append(self.esm_dict["EXCH"])
528
+
529
+ elif self.current_widget in ["other_2"]:
530
+ if self.other_2.text() == "":
531
+ self.make_button_green(self.esm_dict["AGN"])
532
+ buttons_to_send.append(self.esm_dict["AGN"])
533
+ else:
534
+ self.make_button_green(self.esm_dict["QRZ"])
535
+ buttons_to_send.append(self.esm_dict["QRZ"])
536
+ buttons_to_send.append("LOGIT")
537
+
538
+ if with_enter is True and bool(len(buttons_to_send)):
539
+ for button in buttons_to_send:
540
+ if button:
541
+ if button == "LOGIT":
542
+ self.save_contact()
543
+ continue
544
+ if button == self.esm_dict["HISCALL"]:
545
+ self.process_function_key(button, rttysendrx=False)
546
+ continue
547
+ self.process_function_key(button)
548
+ else:
549
+ if self.current_widget == "callsign":
550
+ if len(self.callsign.text()) > 2:
551
+ self.make_button_green(self.esm_dict["MYCALL"])
552
+ buttons_to_send.append(self.esm_dict["MYCALL"])
553
+
554
+ elif self.current_widget in ["other_2"]:
555
+ if self.other_2.text() == "":
556
+ self.make_button_green(self.esm_dict["AGN"])
557
+ buttons_to_send.append(self.esm_dict["AGN"])
558
+ else:
559
+ self.make_button_green(self.esm_dict["EXCH"])
560
+ buttons_to_send.append(self.esm_dict["EXCH"])
561
+ buttons_to_send.append("LOGIT")
562
+
563
+ if with_enter is True and bool(len(buttons_to_send)):
564
+ for button in buttons_to_send:
565
+ if button:
566
+ if button == "LOGIT":
567
+ self.save_contact()
568
+ continue
569
+ self.process_function_key(button)
570
+
571
+
572
+ def populate_history_info_line(self):
573
+ result = self.database.fetch_call_history(self.callsign.text())
574
+ if result:
575
+ self.history_info.setText(
576
+ f"{result.get('Call', '')}, {result.get('Name', '')}, {result.get('Exch1', '')}, {result.get('UserText','...')}"
577
+ )
578
+ else:
579
+ self.history_info.setText("")
580
+
581
+
582
+ def check_call_history(self):
583
+ """"""
584
+ result = self.database.fetch_call_history(self.callsign.text())
585
+ if result:
586
+ self.history_info.setText(f"{result.get('UserText','')}")
587
+ if self.other_2.text() == "":
588
+ self.other_2.setText(f"{result.get('Exch1', '')}")
589
+
590
+
591
+ def get_mults(self):
592
+ """"""
593
+ mults = {}
594
+ mults["country"], mults["state"] = show_mults(self, rtc=True)
595
+ return mults
596
+
597
+
598
+ def just_points(self):
599
+ """"""
600
+ return get_points(self)
601
+
602
+
603
+ def set_self(the_outie):
604
+ """..."""
605
+ globals()["ALTEREGO"] = the_outie
606
+
607
+
608
+ def ft8_handler(the_packet: dict):
609
+ print(f"{the_packet=}")
610
+ """Process FT8 QSO packets
611
+ # FT8
612
+ # {
613
+ # 'CALL': 'KE0OG',
614
+ # 'GRIDSQUARE': 'DM10AT',
615
+ # 'MODE': 'FT8',
616
+ # 'RST_SENT': '',
617
+ # 'RST_RCVD': '',
618
+ # 'QSO_DATE': '20210329',
619
+ # 'TIME_ON': '183213',
620
+ # 'QSO_DATE_OFF': '20210329',
621
+ # 'TIME_OFF': '183213',
622
+ # 'BAND': '20M',
623
+ # 'FREQ': '14.074754',
624
+ # 'STATION_CALLSIGN': 'K6GTE',
625
+ # 'MY_GRIDSQUARE': 'DM13AT',
626
+ # 'CONTEST_ID': 'ARRL-FIELD-DAY',
627
+ # 'SRX_STRING': '1D UT',
628
+ # 'CLASS': '1D',
629
+ # 'ARRL_SECT': 'UT'
630
+ # }
631
+ # FlDigi
632
+ # {
633
+ # 'CALL': 'K5TUS',
634
+ # 'MODE': 'RTTY',
635
+ # 'FREQ': '14.068415',
636
+ # 'BAND': '20M',
637
+ # 'QSO_DATE': '20250103',
638
+ # 'TIME_ON': '2359',
639
+ # 'QSO_DATE_OFF': '20250103',
640
+ # 'TIME_OFF': '2359',
641
+ # 'NAME': '',
642
+ # 'QTH': '',
643
+ # 'STATE': 'ORG',
644
+ # 'VE_PROV': '',
645
+ # 'COUNTRY': 'USA',
646
+ # 'RST_SENT': '599',
647
+ # 'RST_RCVD': '599',
648
+ # 'TX_PWR': '0',
649
+ # 'CNTY': '',
650
+ # 'DXCC': '',
651
+ # 'CQZ': '5',
652
+ # 'IOTA': '',
653
+ # 'CONT': '',
654
+ # 'ITUZ': '',
655
+ # 'GRIDSQUARE': '',
656
+ # 'QSLRDATE': '',
657
+ # 'QSLSDATE': '',
658
+ # 'EQSLRDATE': '',
659
+ # 'EQSLSDATE': '',
660
+ # 'LOTWRDATE': '',
661
+ # 'LOTWSDATE': '',
662
+ # 'QSL_VIA': '',
663
+ # 'NOTES': '',
664
+ # 'SRX': '',
665
+ # 'STX': '000',
666
+ # 'SRX_STRING': '',
667
+ # 'STX_STRING': 'CA',
668
+
669
+
670
+ # 'SRX': '666',
671
+ # 'STX': '000',
672
+ # 'SRX_STRING': '',
673
+ # 'STX_STRING': 'CA',
674
+
675
+ # 'SRX': '004', 'STX': '000', 'SRX_STRING': '', 'STX_STRING': '#',
676
+
677
+ # 'CLASS': '',
678
+ # 'ARRL_SECT': '',
679
+ # 'OPERATOR': 'K6GTE',
680
+ # 'STATION_CALLSIGN': 'K6GTE',
681
+ # 'MY_GRIDSQUARE': 'DM13AT',
682
+ # 'MY_CITY': 'ANAHEIM, CA',
683
+ # 'CHECK': '',
684
+ # 'AGE': '',
685
+ # 'TEN_TEN': '',
686
+ # 'CWSS_PREC': '',
687
+ # 'CWSS_SECTION': '',
688
+ # 'CWSS_SERNO': '',
689
+ # 'CWSS_CHK': ''
690
+ # }
691
+
692
+ # """
693
+
694
+ # logger.debug(f"{the_packet=}")
695
+ # if ALTEREGO is not None:
696
+ # ALTEREGO.callsign.setText(the_packet.get("CALL"))
697
+ # ALTEREGO.contact["Call"] = the_packet.get("CALL", "")
698
+ # ALTEREGO.contact["SNT"] = the_packet.get("RST_SENT", "599")
699
+ # ALTEREGO.contact["RCV"] = the_packet.get("RST_RCVD", "599")
700
+
701
+ # sent_string = the_packet.get("STX_STRING", "")
702
+ # if sent_string != "":
703
+ # ALTEREGO.contact["SentNr"] = sent_string
704
+ # ALTEREGO.other_1.setText(str(sent_string))
705
+ # else:
706
+ # ALTEREGO.contact["SentNr"] = the_packet.get("STX", "000")
707
+ # ALTEREGO.other_1.setText(str(the_packet.get("STX", "000")))
708
+
709
+ # rx_string = the_packet.get("SRX_STRING", "")
710
+ # if rx_string != "":
711
+ # ALTEREGO.contact["NR"] = rx_string
712
+ # ALTEREGO.other_2.setText(str(rx_string))
713
+ # else:
714
+ # ALTEREGO.contact["NR"] = the_packet.get("SRX", "000")
715
+ # ALTEREGO.other_2.setText(str(the_packet.get("SRX", "000")))
716
+
717
+ # ALTEREGO.contact["Mode"] = the_packet.get("MODE", "ERR")
718
+ # ALTEREGO.contact["Freq"] = round(float(the_packet.get("FREQ", "0.0")) * 1000, 2)
719
+ # ALTEREGO.contact["QSXFreq"] = round(
720
+ # float(the_packet.get("FREQ", "0.0")) * 1000, 2
721
+ # )
722
+ # ALTEREGO.contact["Band"] = get_logged_band(
723
+ # str(int(float(the_packet.get("FREQ", "0.0")) * 1000000))
724
+ # )
725
+ # logger.debug(f"{ALTEREGO.contact=}")
726
+
727
+ # ALTEREGO.save_contact()