not1mm 24.10.13__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.
@@ -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)