not1mm 24.11.17__py3-none-any.whl → 24.11.19__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.
Files changed (55) hide show
  1. not1mm/__main__.py +1 -1
  2. not1mm/data/new_contest.ui +5 -0
  3. not1mm/lib/plugin_common.py +20 -1
  4. not1mm/lib/version.py +1 -1
  5. not1mm/plugins/10_10_fall_cw.py +12 -24
  6. not1mm/plugins/10_10_spring_cw.py +12 -24
  7. not1mm/plugins/10_10_summer_phone.py +12 -22
  8. not1mm/plugins/10_10_winter_phone.py +12 -24
  9. not1mm/plugins/arrl_10m.py +16 -29
  10. not1mm/plugins/arrl_dx_cw.py +11 -22
  11. not1mm/plugins/arrl_dx_ssb.py +11 -22
  12. not1mm/plugins/arrl_field_day.py +14 -22
  13. not1mm/plugins/arrl_rtty_ru.py +10 -22
  14. not1mm/plugins/arrl_ss_cw.py +14 -29
  15. not1mm/plugins/arrl_ss_phone.py +14 -29
  16. not1mm/plugins/arrl_vhf_jan.py +14 -29
  17. not1mm/plugins/arrl_vhf_jun.py +14 -29
  18. not1mm/plugins/arrl_vhf_sep.py +14 -29
  19. not1mm/plugins/canada_day.py +14 -29
  20. not1mm/plugins/cq_160_cw.py +10 -24
  21. not1mm/plugins/cq_160_ssb.py +10 -24
  22. not1mm/plugins/cq_wpx_cw.py +12 -25
  23. not1mm/plugins/cq_wpx_rtty.py +12 -25
  24. not1mm/plugins/cq_wpx_ssb.py +14 -29
  25. not1mm/plugins/cq_ww_cw.py +11 -22
  26. not1mm/plugins/cq_ww_rtty.py +12 -26
  27. not1mm/plugins/cq_ww_ssb.py +11 -22
  28. not1mm/plugins/cwt.py +12 -26
  29. not1mm/plugins/darc_xmas.py +560 -0
  30. not1mm/plugins/general_logging.py +12 -26
  31. not1mm/plugins/helvetia.py +15 -26
  32. not1mm/plugins/iaru_fieldday_r1_cw.py +12 -25
  33. not1mm/plugins/iaru_fieldday_r1_ssb.py +12 -25
  34. not1mm/plugins/iaru_hf.py +11 -22
  35. not1mm/plugins/icwc_mst.py +136 -40
  36. not1mm/plugins/jidx_cw.py +102 -23
  37. not1mm/plugins/jidx_ph.py +106 -29
  38. not1mm/plugins/k1usn_sst.py +10 -16
  39. not1mm/plugins/lz-dx.py +17 -28
  40. not1mm/plugins/naqp_cw.py +11 -17
  41. not1mm/plugins/naqp_rtty.py +11 -17
  42. not1mm/plugins/naqp_ssb.py +11 -17
  43. not1mm/plugins/phone_weekly_test.py +101 -16
  44. not1mm/plugins/raem.py +26 -25
  45. not1mm/plugins/ref_cw.py +17 -28
  46. not1mm/plugins/ref_ssb.py +32 -28
  47. not1mm/plugins/stew_perry_topband.py +102 -16
  48. not1mm/plugins/weekly_rtty.py +17 -16
  49. not1mm/plugins/winter_field_day.py +28 -24
  50. {not1mm-24.11.17.dist-info → not1mm-24.11.19.dist-info}/METADATA +9 -5
  51. {not1mm-24.11.17.dist-info → not1mm-24.11.19.dist-info}/RECORD +55 -54
  52. {not1mm-24.11.17.dist-info → not1mm-24.11.19.dist-info}/LICENSE +0 -0
  53. {not1mm-24.11.17.dist-info → not1mm-24.11.19.dist-info}/WHEEL +0 -0
  54. {not1mm-24.11.17.dist-info → not1mm-24.11.19.dist-info}/entry_points.txt +0 -0
  55. {not1mm-24.11.17.dist-info → not1mm-24.11.19.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,560 @@
1
+ """DARC XMAS plugin"""
2
+
3
+ # pylint: disable=invalid-name, unused-argument, unused-variable, c-extension-no-member, unused-import
4
+
5
+ # DARC Christmas Contest
6
+ # Status: Active
7
+ # Geographic Focus: Germany
8
+ # Participation: Worldwide
9
+ # Awards: Worldwide
10
+ # Mode: CW, SSB
11
+ # Bands: 80, 40m
12
+ # Classes: Single Op (Low/High)
13
+ # Max power: HP: >100 watts
14
+ # LP: 100 watts
15
+ # Exchange: RST + DOK
16
+ # non-Member (DL): RST + 'NM' or 'no member'
17
+ # outside DL: RST + serial number
18
+ # Work stations: Once per band and mode
19
+ # QSO Points: 1 point per QSO
20
+ # Multipliers: DOK (DARC/VFDB), 'NM' does not count + each WPX-prefix per band
21
+ # Score Calculation: Total score = total QSO points x total mults
22
+ # Mail logs to: (none)
23
+ # Find rules at: https://www.darc.de/der-club/referate/conteste/weihnachtswettbewerb/regeln/
24
+ # Upload logs at: https://dxhf2.darc.de/~xmaslog/upload.cgi?form=referat&lang=de
25
+ # Cabrillo name: XMAS
26
+
27
+
28
+ import datetime
29
+ import logging
30
+
31
+ from pathlib import Path
32
+
33
+ from PyQt6 import QtWidgets
34
+
35
+ from not1mm.lib.plugin_common import gen_adif, get_points
36
+ from not1mm.lib.version import __version__
37
+
38
+ logger = logging.getLogger(__name__)
39
+
40
+ EXCHANGE_HINT = "DOK/NM or #"
41
+
42
+ name = "DARC XMAS"
43
+ mode = "BOTH" # CW SSB BOTH RTTY
44
+ # columns = [0, 1, 2, 3, 4, 5, 6, 11, 15]
45
+ columns = [
46
+ "YYYY-MM-DD HH:MM:SS",
47
+ "Call",
48
+ "Freq",
49
+ "Snt",
50
+ "Rcv",
51
+ "SentNr",
52
+ "RcvNr",
53
+ "M1",
54
+ "M2",
55
+ "PTS",
56
+ ]
57
+ cabrillo_name = "XMAS"
58
+
59
+ advance_on_space = [True, True, True, True, True]
60
+
61
+ # 1 once per contest, 2 work each band, 3 each band/mode, 4 no dupe checking
62
+ dupe_type = 3
63
+
64
+
65
+ def init_contest(self):
66
+ """setup plugin"""
67
+ set_tab_next(self)
68
+ set_tab_prev(self)
69
+ interface(self)
70
+ self.next_field = self.other_2
71
+
72
+
73
+ def interface(self):
74
+ """Setup user interface"""
75
+ self.field1.show()
76
+ self.field2.show()
77
+ self.field3.show()
78
+ self.field4.show()
79
+ self.snt_label.setText("SNT")
80
+ self.other_label.setText("DOK/# Sent")
81
+ self.field3.setAccessibleName("RST Sent")
82
+ self.exch_label.setText("DOK/# RCVD")
83
+ self.field4.setAccessibleName("DOK/NM or Number")
84
+
85
+
86
+ def reset_label(self):
87
+ """reset label after field cleared"""
88
+
89
+
90
+ def set_tab_next(self):
91
+ """Set TAB Advances"""
92
+ self.tab_next = {
93
+ self.callsign: self.sent,
94
+ self.sent: self.receive,
95
+ self.receive: self.other_1,
96
+ self.other_1: self.other_2,
97
+ self.other_2: self.callsign,
98
+ }
99
+
100
+
101
+ def set_tab_prev(self):
102
+ """Set TAB Advances"""
103
+ self.tab_prev = {
104
+ self.callsign: self.other_2,
105
+ self.sent: self.callsign,
106
+ self.receive: self.sent,
107
+ self.other_1: self.receive,
108
+ self.other_2: self.other_1,
109
+ }
110
+
111
+
112
+ def set_contact_vars(self):
113
+ """Contest Specific"""
114
+ self.contact["SNT"] = self.sent.text()
115
+ self.contact["RCV"] = self.receive.text()
116
+ self.contact["NR"] = self.other_2.text().upper()
117
+ self.contact["SentNr"] = self.other_1.text()
118
+ # self.contact["SentNr"] = self.contest_settings.get("SentExchange", "").upper()
119
+ dok = self.contact["NR"]
120
+
121
+ dxcc = self.contact.get("CountryPrefix", "")
122
+ band = self.contact.get("Band", "")
123
+
124
+ if dxcc == "DL" and not isinstance(dok, int) and dok.upper() != "NM":
125
+ query = (
126
+ f"select count(*) as dok_count from dxlog where 1=1 "
127
+ f"and NR = '{dok.upper()}' "
128
+ f"and Band = '{band}' "
129
+ f"and ContestNR = {self.pref.get('contest', '1')};"
130
+ )
131
+ result = self.database.exec_sql(query)
132
+ count = int(result.get("dok_count", 0))
133
+ if count == 0:
134
+ self.contact["IsMultiplier2"] = 1
135
+ else:
136
+ self.contact["IsMultiplier2"] = 0
137
+
138
+ if self.contact.get("WPXPrefix", ""):
139
+ result = self.database.fetch_wpx_exists(self.contact.get("WPXPrefix", ""))
140
+ if result.get("wpx_count", ""):
141
+ self.contact["IsMultiplier1"] = 0
142
+ else:
143
+ self.contact["IsMultiplier1"] = 1
144
+
145
+
146
+ def predupe(self):
147
+ """prefill his exchange with last known values"""
148
+
149
+
150
+ def prefill(self):
151
+ """Fill SentNR"""
152
+ sent_sxchange_setting = self.contest_settings.get("SentExchange", "")
153
+ if sent_sxchange_setting.strip() == "#":
154
+ result = self.database.get_serial()
155
+ serial_nr = str(result.get("serial_nr", "1")).zfill(3)
156
+ if serial_nr == "None":
157
+ serial_nr = "001"
158
+ if len(self.other_1.text()) == 0:
159
+ self.other_1.setText(serial_nr)
160
+ else:
161
+ self.other_1.setText(sent_sxchange_setting)
162
+
163
+ if self.other_2.text() == "":
164
+ call = self.callsign.text().upper()
165
+ query = f"select NR from dxlog where Call = '{call}' and ContestName = 'XMAS' order by ts desc;"
166
+ logger.debug(query)
167
+ result = self.database.exec_sql(query)
168
+ logger.debug("%s", f"{result}")
169
+ if result:
170
+ if isinstance(result.get("NR", ""), str):
171
+ self.other_2.setText(str(result.get("NR", "")))
172
+
173
+
174
+ def points(self):
175
+ """Calc point"""
176
+ return 1
177
+
178
+
179
+ def show_mults(self):
180
+ """Return display string for mults"""
181
+ return int(self.database.fetch_mult_count(1).get("count", 0)) + int(
182
+ self.database.fetch_mult_count(2).get("count", 0)
183
+ )
184
+
185
+
186
+ def show_qso(self):
187
+ """Return qso count"""
188
+ result = self.database.fetch_qso_count()
189
+ if result:
190
+ return int(result.get("qsos", 0))
191
+ return 0
192
+
193
+
194
+ def calc_score(self):
195
+ """Return calculated score"""
196
+ result = self.database.fetch_points()
197
+ if result is not None:
198
+ score = result.get("Points", "0")
199
+ if score is None:
200
+ score = "0"
201
+ contest_points = int(score)
202
+ mults = show_mults(self)
203
+ return contest_points * mults
204
+ return 0
205
+
206
+
207
+ def adif(self):
208
+ """Call the generate ADIF function"""
209
+ gen_adif(self, cabrillo_name, "XMAS")
210
+
211
+
212
+ def output_cabrillo_line(line_to_output, ending, file_descriptor, file_encoding):
213
+ """"""
214
+ print(
215
+ line_to_output.encode(file_encoding, errors="ignore").decode(),
216
+ end=ending,
217
+ file=file_descriptor,
218
+ )
219
+
220
+
221
+ def cabrillo(self, file_encoding):
222
+ """Generates Cabrillo file. Maybe."""
223
+ # https://www.cqwpx.com/cabrillo.htm
224
+ logger.debug("******Cabrillo*****")
225
+ logger.debug("Station: %s", f"{self.station}")
226
+ logger.debug("Contest: %s", f"{self.contest_settings}")
227
+ now = datetime.datetime.now()
228
+ date_time = now.strftime("%Y-%m-%d_%H-%M-%S")
229
+ filename = (
230
+ str(Path.home())
231
+ + "/"
232
+ + f"{self.station.get('Call', '').upper()}_{cabrillo_name}_{date_time}.log"
233
+ )
234
+ logger.debug("%s", filename)
235
+ log = self.database.fetch_all_contacts_asc()
236
+ try:
237
+ with open(filename, "w", encoding=file_encoding) as file_descriptor:
238
+ output_cabrillo_line(
239
+ "START-OF-LOG: 3.0",
240
+ "\r\n",
241
+ file_descriptor,
242
+ file_encoding,
243
+ )
244
+ output_cabrillo_line(
245
+ f"CREATED-BY: Not1MM v{__version__}",
246
+ "\r\n",
247
+ file_descriptor,
248
+ file_encoding,
249
+ )
250
+ output_cabrillo_line(
251
+ f"CONTEST: {cabrillo_name}",
252
+ "\r\n",
253
+ file_descriptor,
254
+ file_encoding,
255
+ )
256
+ if self.station.get("Club", ""):
257
+ output_cabrillo_line(
258
+ f"CLUB: {self.station.get('Club', '').upper()}",
259
+ "\r\n",
260
+ file_descriptor,
261
+ file_encoding,
262
+ )
263
+ output_cabrillo_line(
264
+ f"CALLSIGN: {self.station.get('Call','')}",
265
+ "\r\n",
266
+ file_descriptor,
267
+ file_encoding,
268
+ )
269
+ output_cabrillo_line(
270
+ f"LOCATION: {self.station.get('ARRLSection', '')}",
271
+ "\r\n",
272
+ file_descriptor,
273
+ file_encoding,
274
+ )
275
+ output_cabrillo_line(
276
+ f"CATEGORY-OPERATOR: {self.contest_settings.get('OperatorCategory','')}",
277
+ "\r\n",
278
+ file_descriptor,
279
+ file_encoding,
280
+ )
281
+ output_cabrillo_line(
282
+ f"CATEGORY-ASSISTED: {self.contest_settings.get('AssistedCategory','')}",
283
+ "\r\n",
284
+ file_descriptor,
285
+ file_encoding,
286
+ )
287
+ output_cabrillo_line(
288
+ f"CATEGORY-BAND: {self.contest_settings.get('BandCategory','')}",
289
+ "\r\n",
290
+ file_descriptor,
291
+ file_encoding,
292
+ )
293
+ output_cabrillo_line(
294
+ f"CATEGORY-MODE: {self.contest_settings.get('ModeCategory','')}",
295
+ "\r\n",
296
+ file_descriptor,
297
+ file_encoding,
298
+ )
299
+ output_cabrillo_line(
300
+ f"CATEGORY-TRANSMITTER: {self.contest_settings.get('TransmitterCategory','')}",
301
+ "\r\n",
302
+ file_descriptor,
303
+ file_encoding,
304
+ )
305
+ if self.contest_settings.get("OverlayCategory", "") != "N/A":
306
+ output_cabrillo_line(
307
+ f"CATEGORY-OVERLAY: {self.contest_settings.get('OverlayCategory','')}",
308
+ "\r\n",
309
+ file_descriptor,
310
+ file_encoding,
311
+ )
312
+ output_cabrillo_line(
313
+ f"GRID-LOCATOR: {self.station.get('GridSquare','')}",
314
+ "\r\n",
315
+ file_descriptor,
316
+ file_encoding,
317
+ )
318
+ output_cabrillo_line(
319
+ f"CATEGORY-POWER: {self.contest_settings.get('PowerCategory','')}",
320
+ "\r\n",
321
+ file_descriptor,
322
+ file_encoding,
323
+ )
324
+
325
+ output_cabrillo_line(
326
+ f"CLAIMED-SCORE: {calc_score(self)}",
327
+ "\r\n",
328
+ file_descriptor,
329
+ file_encoding,
330
+ )
331
+ ops = f"@{self.station.get('Call','')}"
332
+ list_of_ops = self.database.get_ops()
333
+ for op in list_of_ops:
334
+ ops += f", {op.get('Operator', '')}"
335
+ output_cabrillo_line(
336
+ f"OPERATORS: {ops}",
337
+ "\r\n",
338
+ file_descriptor,
339
+ file_encoding,
340
+ )
341
+ output_cabrillo_line(
342
+ f"NAME: {self.station.get('Name', '')}",
343
+ "\r\n",
344
+ file_descriptor,
345
+ file_encoding,
346
+ )
347
+ output_cabrillo_line(
348
+ f"ADDRESS: {self.station.get('Street1', '')}",
349
+ "\r\n",
350
+ file_descriptor,
351
+ file_encoding,
352
+ )
353
+ output_cabrillo_line(
354
+ f"ADDRESS-CITY: {self.station.get('City', '')}",
355
+ "\r\n",
356
+ file_descriptor,
357
+ file_encoding,
358
+ )
359
+ output_cabrillo_line(
360
+ f"ADDRESS-STATE-PROVINCE: {self.station.get('State', '')}",
361
+ "\r\n",
362
+ file_descriptor,
363
+ file_encoding,
364
+ )
365
+ output_cabrillo_line(
366
+ f"ADDRESS-POSTALCODE: {self.station.get('Zip', '')}",
367
+ "\r\n",
368
+ file_descriptor,
369
+ file_encoding,
370
+ )
371
+ output_cabrillo_line(
372
+ f"ADDRESS-COUNTRY: {self.station.get('Country', '')}",
373
+ "\r\n",
374
+ file_descriptor,
375
+ file_encoding,
376
+ )
377
+ output_cabrillo_line(
378
+ f"EMAIL: {self.station.get('Email', '')}",
379
+ "\r\n",
380
+ file_descriptor,
381
+ file_encoding,
382
+ )
383
+ for contact in log:
384
+ the_date_and_time = contact.get("TS", "")
385
+ themode = contact.get("Mode", "")
386
+ if themode == "LSB" or themode == "USB":
387
+ themode = "PH"
388
+ frequency = str(int(contact.get("Freq", "0"))).rjust(5)
389
+
390
+ loggeddate = the_date_and_time[:10]
391
+ loggedtime = the_date_and_time[11:13] + the_date_and_time[14:16]
392
+ output_cabrillo_line(
393
+ f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
394
+ f"{contact.get('StationPrefix', '').ljust(13)} "
395
+ f"{str(contact.get('SNT', '')).ljust(3)} "
396
+ f"{str(contact.get('SentNr', '')).ljust(6)} "
397
+ f"{contact.get('Call', '').ljust(13)} "
398
+ f"{str(contact.get('RCV', '')).ljust(3)} "
399
+ f"{str(contact.get('NR', '')).ljust(6)}",
400
+ "\r\n",
401
+ file_descriptor,
402
+ file_encoding,
403
+ )
404
+ output_cabrillo_line("END-OF-LOG:", "\r\n", file_descriptor, file_encoding)
405
+ self.show_message_box(f"Cabrillo saved to: {filename}")
406
+ except IOError as exception:
407
+ logger.critical("cabrillo: IO error: %s, writing to %s", exception, filename)
408
+ self.show_message_box(f"Error saving Cabrillo: {exception} {filename}")
409
+ return
410
+
411
+
412
+ def recalculate_mults(self):
413
+ """Recalculates multipliers after change in logged qso."""
414
+
415
+ all_contacts = self.database.fetch_all_contacts_asc()
416
+ for contact in all_contacts:
417
+
418
+ contact["IsMultiplier1"] = 0
419
+ contact["IsMultiplier2"] = 0
420
+
421
+ time_stamp = contact.get("TS", "")
422
+ dok = contact.get("NR", "")
423
+ dxcc = contact.get("CountryPrefix", "")
424
+ band = contact.get("Band", "")
425
+ wpx = contact.get("WPXPrefix", "")
426
+ result = self.database.fetch_wpx_exists_before_me(wpx, time_stamp)
427
+ wpx_count = result.get("wpx_count", 1)
428
+ if wpx_count == 0:
429
+ contact["IsMultiplier1"] = 1
430
+ else:
431
+ contact["IsMultiplier1"] = 0
432
+
433
+ if dxcc == "DL" and not isinstance(dok, int) and dok.upper() != "NM":
434
+ query = (
435
+ f"select count(*) as dok_count from dxlog where TS < '{time_stamp}' "
436
+ f"and NR = '{dok.upper()}' "
437
+ f"and Band = '{band}' "
438
+ f"and ContestNR = {self.pref.get('contest', '1')};"
439
+ )
440
+ result = self.database.exec_sql(query)
441
+ count = int(result.get("dok_count", 0))
442
+ if count == 0:
443
+ contact["IsMultiplier2"] = 1
444
+ else:
445
+ contact["IsMultiplier2"] = 0
446
+ self.database.change_contact(contact)
447
+
448
+
449
+ def process_esm(self, new_focused_widget=None, with_enter=False):
450
+ """ESM State Machine"""
451
+
452
+ # self.pref["run_state"]
453
+
454
+ # -----===== Assigned F-Keys =====-----
455
+ # self.esm_dict["CQ"]
456
+ # self.esm_dict["EXCH"]
457
+ # self.esm_dict["QRZ"]
458
+ # self.esm_dict["AGN"]
459
+ # self.esm_dict["HISCALL"]
460
+ # self.esm_dict["MYCALL"]
461
+ # self.esm_dict["QSOB4"]
462
+
463
+ # ----==== text fields ====----
464
+ # self.callsign
465
+ # self.sent
466
+ # self.receive
467
+ # self.other_1
468
+ # self.other_2
469
+
470
+ if new_focused_widget is not None:
471
+ self.current_widget = self.inputs_dict.get(new_focused_widget)
472
+
473
+ # print(f"checking esm {self.current_widget=} {with_enter=} {self.pref.get("run_state")=}")
474
+
475
+ for a_button in [
476
+ self.F1,
477
+ self.F2,
478
+ self.F3,
479
+ self.F4,
480
+ self.F5,
481
+ self.F6,
482
+ self.F7,
483
+ self.F8,
484
+ self.F9,
485
+ self.F10,
486
+ self.F11,
487
+ self.F12,
488
+ ]:
489
+ self.restore_button_color(a_button)
490
+
491
+ buttons_to_send = []
492
+
493
+ if self.pref.get("run_state"):
494
+ if self.current_widget == "callsign":
495
+ if len(self.callsign.text()) < 3:
496
+ self.make_button_green(self.esm_dict["CQ"])
497
+ buttons_to_send.append(self.esm_dict["CQ"])
498
+ elif len(self.callsign.text()) > 2:
499
+ self.make_button_green(self.esm_dict["HISCALL"])
500
+ self.make_button_green(self.esm_dict["EXCH"])
501
+ buttons_to_send.append(self.esm_dict["HISCALL"])
502
+ buttons_to_send.append(self.esm_dict["EXCH"])
503
+
504
+ elif self.current_widget in ["other_1", "other_2"]:
505
+ if self.other_2.text() == "" or self.other_1.text() == "":
506
+ self.make_button_green(self.esm_dict["AGN"])
507
+ buttons_to_send.append(self.esm_dict["AGN"])
508
+ else:
509
+ self.make_button_green(self.esm_dict["QRZ"])
510
+ buttons_to_send.append(self.esm_dict["QRZ"])
511
+ buttons_to_send.append("LOGIT")
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)
520
+ else:
521
+ if self.current_widget == "callsign":
522
+ if len(self.callsign.text()) > 2:
523
+ self.make_button_green(self.esm_dict["MYCALL"])
524
+ buttons_to_send.append(self.esm_dict["MYCALL"])
525
+
526
+ elif self.current_widget in ["other_1", "other_2"]:
527
+ if self.other_2.text() == "" or self.other_1.text() == "":
528
+ self.make_button_green(self.esm_dict["AGN"])
529
+ buttons_to_send.append(self.esm_dict["AGN"])
530
+ else:
531
+ self.make_button_green(self.esm_dict["EXCH"])
532
+ buttons_to_send.append(self.esm_dict["EXCH"])
533
+ buttons_to_send.append("LOGIT")
534
+
535
+ if with_enter is True and bool(len(buttons_to_send)):
536
+ for button in buttons_to_send:
537
+ if button:
538
+ if button == "LOGIT":
539
+ self.save_contact()
540
+ continue
541
+ self.process_function_key(button)
542
+
543
+
544
+ def populate_history_info_line(self):
545
+ result = self.database.fetch_call_history(self.callsign.text())
546
+ if result:
547
+ self.history_info.setText(
548
+ f"{result.get('Call', '')}, {result.get('Name', '')}, {result.get('Exch1', '')}, {result.get('UserText','...')}"
549
+ )
550
+ else:
551
+ self.history_info.setText("")
552
+
553
+
554
+ def check_call_history(self):
555
+ """"""
556
+ result = self.database.fetch_call_history(self.callsign.text())
557
+ if result:
558
+ self.history_info.setText(f"{result.get('UserText','')}")
559
+ if self.other_1.text() == "":
560
+ self.other_1.setText(f"{result.get('Exch1', '')}")
@@ -46,11 +46,9 @@ def interface(self):
46
46
  self.field4.show()
47
47
  self.snt_label.setText("SNT")
48
48
  self.field1.setAccessibleName("RST Sent")
49
- label = self.field3.findChild(QtWidgets.QLabel)
50
- label.setText("Name")
49
+ self.other_label.setText("Name")
51
50
  self.field3.setAccessibleName("Name")
52
- label = self.field4.findChild(QtWidgets.QLabel)
53
- label.setText("Comment")
51
+ self.exch_label.setText("Comment")
54
52
  self.field4.setAccessibleName("Comment")
55
53
 
56
54
 
@@ -61,34 +59,22 @@ def reset_label(self):
61
59
  def set_tab_next(self):
62
60
  """Set TAB Advances"""
63
61
  self.tab_next = {
64
- self.callsign: self.field1.findChild(QtWidgets.QLineEdit),
65
- self.field1.findChild(QtWidgets.QLineEdit): self.field2.findChild(
66
- QtWidgets.QLineEdit
67
- ),
68
- self.field2.findChild(QtWidgets.QLineEdit): self.field3.findChild(
69
- QtWidgets.QLineEdit
70
- ),
71
- self.field3.findChild(QtWidgets.QLineEdit): self.field4.findChild(
72
- QtWidgets.QLineEdit
73
- ),
74
- self.field4.findChild(QtWidgets.QLineEdit): self.callsign,
62
+ self.callsign: self.sent,
63
+ self.sent: self.receive,
64
+ self.receive: self.other_1,
65
+ self.other_1: self.other_2,
66
+ self.other_2: self.callsign,
75
67
  }
76
68
 
77
69
 
78
70
  def set_tab_prev(self):
79
71
  """Set TAB Advances"""
80
72
  self.tab_prev = {
81
- self.callsign: self.field4.findChild(QtWidgets.QLineEdit),
82
- self.field1.findChild(QtWidgets.QLineEdit): self.callsign,
83
- self.field2.findChild(QtWidgets.QLineEdit): self.field1.findChild(
84
- QtWidgets.QLineEdit
85
- ),
86
- self.field3.findChild(QtWidgets.QLineEdit): self.field2.findChild(
87
- QtWidgets.QLineEdit
88
- ),
89
- self.field4.findChild(QtWidgets.QLineEdit): self.field3.findChild(
90
- QtWidgets.QLineEdit
91
- ),
73
+ self.callsign: self.other_2,
74
+ self.sent: self.callsign,
75
+ self.receive: self.sent,
76
+ self.other_1: self.receive,
77
+ self.other_2: self.other_1,
92
78
  }
93
79
 
94
80
 
@@ -116,11 +116,9 @@ def interface(self):
116
116
  self.field2.show()
117
117
  self.field3.show()
118
118
  self.field4.show()
119
- label = self.field3.findChild(QtWidgets.QLabel)
120
- label.setText("Sent")
119
+ self.other_label.setText("Sent")
121
120
  self.field3.setAccessibleName("Sent")
122
- label = self.field4.findChild(QtWidgets.QLabel)
123
- label.setText("Canton/SN")
121
+ self.exch_label.setText("Canton/SN")
124
122
  self.field4.setAccessibleName("Canton or SN")
125
123
 
126
124
 
@@ -131,30 +129,22 @@ def reset_label(self):
131
129
  def set_tab_next(self):
132
130
  """Set TAB Advances"""
133
131
  self.tab_next = {
134
- self.callsign: self.field3.findChild(QtWidgets.QLineEdit),
135
- self.field1.findChild(QtWidgets.QLineEdit): self.field3.findChild(
136
- QtWidgets.QLineEdit
137
- ),
138
- self.field2.findChild(QtWidgets.QLineEdit): self.field3.findChild(
139
- QtWidgets.QLineEdit
140
- ),
141
- self.field3.findChild(QtWidgets.QLineEdit): self.field4.findChild(
142
- QtWidgets.QLineEdit
143
- ),
144
- self.field4.findChild(QtWidgets.QLineEdit): self.callsign,
132
+ self.callsign: self.other_1,
133
+ self.sent: self.other_1,
134
+ self.receive: self.other_1,
135
+ self.other_1: self.other_2,
136
+ self.other_2: self.callsign,
145
137
  }
146
138
 
147
139
 
148
140
  def set_tab_prev(self):
149
141
  """Set TAB Advances"""
150
142
  self.tab_prev = {
151
- self.callsign: self.field4.findChild(QtWidgets.QLineEdit),
152
- self.field1.findChild(QtWidgets.QLineEdit): self.callsign,
153
- self.field2.findChild(QtWidgets.QLineEdit): self.callsign,
154
- self.field3.findChild(QtWidgets.QLineEdit): self.callsign,
155
- self.field4.findChild(QtWidgets.QLineEdit): self.field3.findChild(
156
- QtWidgets.QLineEdit
157
- ),
143
+ self.callsign: self.other_2,
144
+ self.sent: self.callsign,
145
+ self.receive: self.callsign,
146
+ self.other_1: self.callsign,
147
+ self.other_2: self.other_1,
158
148
  }
159
149
 
160
150
 
@@ -205,17 +195,16 @@ def predupe(self):
205
195
 
206
196
  def prefill(self):
207
197
  """Fill SentNR"""
208
- field = self.field3.findChild(QtWidgets.QLineEdit)
209
198
  sent_sxchange_setting = self.contest_settings.get("SentExchange", "")
210
199
  if sent_sxchange_setting.strip() == "#":
211
200
  result = self.database.get_serial()
212
201
  serial_nr = str(result.get("serial_nr", "1")).zfill(3)
213
202
  if serial_nr == "None":
214
203
  serial_nr = "001"
215
- if len(field.text()) == 0:
216
- field.setText(serial_nr)
204
+ if len(self.other_1.text()) == 0:
205
+ self.other_1.setText(serial_nr)
217
206
  else:
218
- field.setText(sent_sxchange_setting)
207
+ self.other_1.setText(sent_sxchange_setting)
219
208
 
220
209
 
221
210
  def points(self):