not1mm 24.10.21__py3-none-any.whl → 24.10.22__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
not1mm/data/main.ui CHANGED
@@ -9,8 +9,8 @@
9
9
  <rect>
10
10
  <x>0</x>
11
11
  <y>0</y>
12
- <width>855</width>
13
- <height>465</height>
12
+ <width>785</width>
13
+ <height>268</height>
14
14
  </rect>
15
15
  </property>
16
16
  <property name="sizePolicy">
@@ -367,6 +367,16 @@
367
367
  <string>PHONE WEEKLY TEST</string>
368
368
  </property>
369
369
  </item>
370
+ <item>
371
+ <property name="text">
372
+ <string>REF CW</string>
373
+ </property>
374
+ </item>
375
+ <item>
376
+ <property name="text">
377
+ <string>REF SSB</string>
378
+ </property>
379
+ </item>
370
380
  <item>
371
381
  <property name="text">
372
382
  <string>STEW PERRY TOPBAND</string>
not1mm/lib/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.10.21"
3
+ __version__ = "24.10.22"
@@ -51,6 +51,7 @@ RAC_OFFICIAL_STATIONS = [
51
51
  "VY0RAC",
52
52
  "VY1RAC",
53
53
  "VY2RAC",
54
+ "VE3RHQ",
54
55
  ]
55
56
 
56
57
  PROV_SEC = [
@@ -151,9 +152,6 @@ def predupe(self):
151
152
 
152
153
  def prefill(self):
153
154
  """Fill sentnr"""
154
- # if len(self.other_2.text()) == 0:
155
- # self.other_2.setText(str(self.contact.get("ZN", "")))
156
-
157
155
  result = self.database.get_serial()
158
156
  serial_nr = str(result.get("serial_nr", "1")).zfill(3)
159
157
  if serial_nr == "None":
@@ -164,8 +162,6 @@ def prefill(self):
164
162
  if len(field.text()) == 0:
165
163
  field.setText(exchange)
166
164
 
167
- # self.other_1.setText(str(self.contest_settings.get("SentExchange", 0)))
168
-
169
165
 
170
166
  def points(self):
171
167
  """Calc point"""
@@ -177,7 +173,7 @@ def points(self):
177
173
  if result:
178
174
  for item in result.items():
179
175
  entity = item[1].get("entity", "")
180
- continent = item[1].get("continent", "")
176
+ # continent = item[1].get("continent", "")
181
177
  if entity == "Canada":
182
178
  return 10
183
179
 
@@ -401,3 +397,92 @@ def cabrillo(self):
401
397
 
402
398
  def recalculate_mults(self):
403
399
  """Recalculates multipliers after change in logged qso."""
400
+
401
+
402
+ def process_esm(self, new_focused_widget=None, with_enter=False):
403
+ """ESM State Machine"""
404
+
405
+ # self.pref["run_state"]
406
+
407
+ # -----===== Assigned F-Keys =====-----
408
+ # self.esm_dict["CQ"]
409
+ # self.esm_dict["EXCH"]
410
+ # self.esm_dict["QRZ"]
411
+ # self.esm_dict["AGN"]
412
+ # self.esm_dict["HISCALL"]
413
+ # self.esm_dict["MYCALL"]
414
+ # self.esm_dict["QSOB4"]
415
+
416
+ # ----==== text fields ====----
417
+ # self.callsign
418
+ # self.sent
419
+ # self.receive
420
+ # self.other_1
421
+ # self.other_2
422
+
423
+ if new_focused_widget is not None:
424
+ self.current_widget = self.inputs_dict.get(new_focused_widget)
425
+
426
+ for a_button in [
427
+ self.esm_dict["CQ"],
428
+ self.esm_dict["EXCH"],
429
+ self.esm_dict["QRZ"],
430
+ self.esm_dict["AGN"],
431
+ self.esm_dict["HISCALL"],
432
+ self.esm_dict["MYCALL"],
433
+ self.esm_dict["QSOB4"],
434
+ ]:
435
+ if a_button is not None:
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:
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 in ["other_1", "other_2"]:
452
+ if self.other_1.text() == "" or self.other_2.text() == "":
453
+ self.make_button_green(self.esm_dict["AGN"])
454
+ buttons_to_send.append(self.esm_dict["AGN"])
455
+ else:
456
+ self.make_button_green(self.esm_dict["QRZ"])
457
+ buttons_to_send.append(self.esm_dict["QRZ"])
458
+ buttons_to_send.append("LOGIT")
459
+
460
+ if with_enter is True and bool(len(buttons_to_send)):
461
+ for button in buttons_to_send:
462
+ if button:
463
+ if button == "LOGIT":
464
+ self.save_contact()
465
+ continue
466
+ self.process_function_key(button)
467
+ else:
468
+ if self.current_widget == "callsign":
469
+ if len(self.callsign.text()) > 2:
470
+ self.make_button_green(self.esm_dict["MYCALL"])
471
+ buttons_to_send.append(self.esm_dict["MYCALL"])
472
+
473
+ elif self.current_widget in ["other_1", "other_2"]:
474
+ if self.other_1.text() == "" or self.other_2.text() == "":
475
+ self.make_button_green(self.esm_dict["AGN"])
476
+ buttons_to_send.append(self.esm_dict["AGN"])
477
+ else:
478
+ self.make_button_green(self.esm_dict["EXCH"])
479
+ buttons_to_send.append(self.esm_dict["EXCH"])
480
+ buttons_to_send.append("LOGIT")
481
+
482
+ if with_enter is True and bool(len(buttons_to_send)):
483
+ for button in buttons_to_send:
484
+ if button:
485
+ if button == "LOGIT":
486
+ self.save_contact()
487
+ continue
488
+ self.process_function_key(button)
not1mm/plugins/ref_cw.py CHANGED
@@ -7,13 +7,13 @@ Awards: Worldwide
7
7
  Mode: CW
8
8
  Bands: 80, 40, 20, 15, 10m
9
9
  Classes: Single Op All Band
10
- Single Op Single Band
11
- Multi-Single
12
- Club
13
- SWL
10
+ Single Op Single Band
11
+ Multi-Single
12
+ Club
13
+ SWL
14
14
  Max power: HP: >100 Watts
15
- LP: 100 Watts
16
- QRP: 5 Watts
15
+ LP: 100 Watts
16
+ QRP: 5 Watts
17
17
 
18
18
  Exchange: French: RST + Department/Prefix
19
19
  non-French: RST + Serial No.
@@ -326,7 +326,7 @@ def recalculate_mults(self):
326
326
 
327
327
  def adif(self):
328
328
  """Call the generate ADIF function"""
329
- gen_adif(self, cabrillo_name, "HELVETIA")
329
+ gen_adif(self, cabrillo_name, "REF-CW")
330
330
 
331
331
 
332
332
  def cabrillo(self):
@@ -500,3 +500,100 @@ def cabrillo(self):
500
500
  logger.critical("cabrillo: IO error: %s, writing to %s", exception, filename)
501
501
  self.show_message_box(f"Error saving Cabrillo: {exception} {filename}")
502
502
  return
503
+
504
+
505
+ def process_esm(self, new_focused_widget=None, with_enter=False):
506
+ """ESM State Machine"""
507
+
508
+ # self.pref["run_state"]
509
+
510
+ # -----===== Assigned F-Keys =====-----
511
+ # self.esm_dict["CQ"]
512
+ # self.esm_dict["EXCH"]
513
+ # self.esm_dict["QRZ"]
514
+ # self.esm_dict["AGN"]
515
+ # self.esm_dict["HISCALL"]
516
+ # self.esm_dict["MYCALL"]
517
+ # self.esm_dict["QSOB4"]
518
+
519
+ # ----==== text fields ====----
520
+ # self.callsign
521
+ # self.sent
522
+ # self.receive
523
+ # self.other_1
524
+ # self.other_2
525
+
526
+ if new_focused_widget is not None:
527
+ self.current_widget = self.inputs_dict.get(new_focused_widget)
528
+
529
+ # print(f"checking esm {self.current_widget=} {with_enter=} {self.pref.get("run_state")=}")
530
+
531
+ for a_button in [
532
+ self.esm_dict["CQ"],
533
+ self.esm_dict["EXCH"],
534
+ self.esm_dict["QRZ"],
535
+ self.esm_dict["AGN"],
536
+ self.esm_dict["HISCALL"],
537
+ self.esm_dict["MYCALL"],
538
+ self.esm_dict["QSOB4"],
539
+ ]:
540
+ if a_button is not None:
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:
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_2":
557
+ if self.other_2.text() == "":
558
+ self.make_button_green(self.esm_dict["AGN"])
559
+ buttons_to_send.append(self.esm_dict["AGN"])
560
+ elif self.other_2.text().isnumeric():
561
+ self.make_button_green(self.esm_dict["QRZ"])
562
+ buttons_to_send.append(self.esm_dict["QRZ"])
563
+ buttons_to_send.append("LOGIT")
564
+ else:
565
+ self.make_button_green(self.esm_dict["AGN"])
566
+ buttons_to_send.append(self.esm_dict["AGN"])
567
+
568
+ if with_enter is True and bool(len(buttons_to_send)):
569
+ for button in buttons_to_send:
570
+ if button:
571
+ if button == "LOGIT":
572
+ self.save_contact()
573
+ continue
574
+ self.process_function_key(button)
575
+ else:
576
+ if self.current_widget == "callsign":
577
+ if len(self.callsign.text()) > 2:
578
+ self.make_button_green(self.esm_dict["MYCALL"])
579
+ buttons_to_send.append(self.esm_dict["MYCALL"])
580
+
581
+ elif self.current_widget == "other_2":
582
+ if self.other_2.text() == "":
583
+ self.make_button_green(self.esm_dict["AGN"])
584
+ buttons_to_send.append(self.esm_dict["AGN"])
585
+ elif self.other_2.text().isnumeric():
586
+ self.make_button_green(self.esm_dict["EXCH"])
587
+ buttons_to_send.append(self.esm_dict["EXCH"])
588
+ buttons_to_send.append("LOGIT")
589
+ else:
590
+ self.make_button_green(self.esm_dict["AGN"])
591
+ buttons_to_send.append(self.esm_dict["AGN"])
592
+
593
+ if with_enter is True and bool(len(buttons_to_send)):
594
+ for button in buttons_to_send:
595
+ if button:
596
+ if button == "LOGIT":
597
+ self.save_contact()
598
+ continue
599
+ self.process_function_key(button)
@@ -0,0 +1,599 @@
1
+ """
2
+ REF Contest, SSB
3
+ Status: Active
4
+ Geographic Focus: France + overseas territories
5
+ Participation: Worldwide
6
+ Awards: Worldwide
7
+ Mode: CW
8
+ Bands: 80, 40, 20, 15, 10m
9
+ Classes: Single Op All Band
10
+ Single Op Single Band
11
+ Multi-Single
12
+ Club
13
+ SWL
14
+ Max power: HP: >100 Watts
15
+ LP: 100 Watts
16
+ QRP: 5 Watts
17
+
18
+ Exchange: French: RST + Department/Prefix
19
+ non-French: RST + Serial No.
20
+
21
+ Work stations: Once per band
22
+
23
+ QSO Points: French: 6 points per QSO with French station same continent
24
+ French: 15 points per QSO with French station on different continent
25
+ French: 1 point per QSO with non-French station same continent
26
+ French: 2 points per QSO with non-French station on different continent
27
+ non-French: 1 point per QSO with French station same continent
28
+ non-French: 3 points per QSO with French station on different continent
29
+
30
+ Multipliers: French/Corsica departments once per band
31
+ French overseas prefixes once per band
32
+ non-French DXCC countries once per band (available only to French stations)
33
+
34
+ Score Calculation: Total score = total QSO points x total mults
35
+
36
+ Upload log at: https://concours.r-e-f.org/contest/logs/upload-form/
37
+ Find rules at: https://concours.r-e-f.org/reglements/actuels/reg_cdfhfdx.pdf
38
+ Cabrillo name: REF-SSB
39
+ Cabrillo name aliases: REF
40
+ """
41
+
42
+ import datetime
43
+ import logging
44
+ import platform
45
+
46
+ from pathlib import Path
47
+
48
+ from PyQt6 import QtWidgets
49
+
50
+ from not1mm.lib.plugin_common import gen_adif, get_points
51
+
52
+ from not1mm.lib.version import __version__
53
+
54
+ logger = logging.getLogger(__name__)
55
+
56
+ EXCHANGE_HINT = "Canton or #"
57
+
58
+ name = "French REF DX contest - SSB"
59
+ cabrillo_name = "REF-SSB"
60
+ mode = "SSB" # CW SSB BOTH RTTY
61
+
62
+ columns = [
63
+ "YYYY-MM-DD HH:MM:SS",
64
+ "Call",
65
+ "Freq",
66
+ "Mode",
67
+ "Snt",
68
+ "Rcv",
69
+ "SentNr",
70
+ "RcvNr",
71
+ "M1",
72
+ "M2",
73
+ "PTS",
74
+ ]
75
+
76
+ advance_on_space = [True, True, True, True, True]
77
+
78
+ # 1 once per contest, 2 work each band, 3 each band/mode, 4 no dupe checking
79
+ dupe_type = 2
80
+
81
+
82
+ def init_contest(self):
83
+ """setup plugin"""
84
+ set_tab_next(self)
85
+ set_tab_prev(self)
86
+ interface(self)
87
+ self.next_field = self.other_2
88
+
89
+
90
+ def interface(self):
91
+ """Setup user interface"""
92
+ self.field1.show()
93
+ self.field2.show()
94
+ self.field3.show()
95
+ self.field4.show()
96
+ label = self.field3.findChild(QtWidgets.QLabel)
97
+ label.setText("Sent")
98
+ self.field3.setAccessibleName("Sent")
99
+ label = self.field4.findChild(QtWidgets.QLabel)
100
+ label.setText("Dep/Pfx/SN")
101
+ self.field4.setAccessibleName("Department, Prefix or SN")
102
+
103
+
104
+ def reset_label(self):
105
+ """reset label after field cleared"""
106
+
107
+
108
+ def set_tab_next(self):
109
+ """Set TAB Advances"""
110
+ self.tab_next = {
111
+ self.callsign: self.field3.findChild(QtWidgets.QLineEdit),
112
+ self.field1.findChild(QtWidgets.QLineEdit): self.field3.findChild(
113
+ QtWidgets.QLineEdit
114
+ ),
115
+ self.field2.findChild(QtWidgets.QLineEdit): self.field3.findChild(
116
+ QtWidgets.QLineEdit
117
+ ),
118
+ self.field3.findChild(QtWidgets.QLineEdit): self.field4.findChild(
119
+ QtWidgets.QLineEdit
120
+ ),
121
+ self.field4.findChild(QtWidgets.QLineEdit): self.callsign,
122
+ }
123
+
124
+
125
+ def set_tab_prev(self):
126
+ """Set TAB Advances"""
127
+ self.tab_prev = {
128
+ self.callsign: self.field4.findChild(QtWidgets.QLineEdit),
129
+ self.field1.findChild(QtWidgets.QLineEdit): self.callsign,
130
+ self.field2.findChild(QtWidgets.QLineEdit): self.callsign,
131
+ self.field3.findChild(QtWidgets.QLineEdit): self.callsign,
132
+ self.field4.findChild(QtWidgets.QLineEdit): self.field3.findChild(
133
+ QtWidgets.QLineEdit
134
+ ),
135
+ }
136
+
137
+
138
+ def set_contact_vars(self):
139
+ """
140
+ Contest Specific
141
+ Multipliers:
142
+ French/Corsica departments once per band
143
+ French overseas prefixes once per band
144
+ non-French DXCC countries once per band (available only to French stations)
145
+ """
146
+ self.contact["SNT"] = self.sent.text()
147
+ self.contact["RCV"] = self.receive.text()
148
+ self.contact["SentNr"] = self.other_1.text().upper()
149
+ self.contact["NR"] = self.other_2.text().upper()
150
+
151
+ self.contact["IsMultiplier1"] = 0
152
+ self.contact["IsMultiplier2"] = 0
153
+
154
+ if (
155
+ self.contact.get("CountryPrefix", "") == "F"
156
+ and self.contact.get("NR", "").isalpha()
157
+ ):
158
+ canton = self.contact.get("NR", "").upper()
159
+ band = self.contact.get("Band", "")
160
+ query = (
161
+ f"select count(*) as canton_count from dxlog where "
162
+ f"NR = '{canton}' "
163
+ f"and Band = '{band}' "
164
+ f"and ContestNR = {self.pref.get('contest', '1')};"
165
+ )
166
+ result = self.database.exec_sql(query)
167
+ count = int(result.get("canton_count", 0))
168
+ if count == 0:
169
+ self.contact["IsMultiplier1"] = 1
170
+
171
+ if self.contact.get("CountryPrefix", ""):
172
+ dxcc = self.contact.get("CountryPrefix", "")
173
+ band = self.contact.get("Band", "")
174
+ query = (
175
+ f"select count(*) as dxcc_count from dxlog where "
176
+ f"CountryPrefix = '{dxcc}' "
177
+ f"and Band = '{band}' "
178
+ f"and ContestNR = {self.pref.get('contest', '1')};"
179
+ )
180
+ result = self.database.exec_sql(query)
181
+ if not result.get("dxcc_count", ""):
182
+ self.contact["IsMultiplier2"] = 1
183
+
184
+
185
+ def predupe(self):
186
+ """called after callsign entered"""
187
+
188
+
189
+ def prefill(self):
190
+ """Fill SentNR"""
191
+ field = self.field3.findChild(QtWidgets.QLineEdit)
192
+ sent_sxchange_setting = self.contest_settings.get("SentExchange", "")
193
+ if sent_sxchange_setting.strip() == "#":
194
+ result = self.database.get_serial()
195
+ serial_nr = str(result.get("serial_nr", "1")).zfill(3)
196
+ if serial_nr == "None":
197
+ serial_nr = "001"
198
+ if len(field.text()) == 0:
199
+ field.setText(serial_nr)
200
+ else:
201
+ field.setText(sent_sxchange_setting)
202
+
203
+
204
+ def points(self):
205
+ """
206
+ Scoring:
207
+ French: 6 points per QSO with French station same continent
208
+ French: 15 points per QSO with French station on different continent
209
+ French: 1 point per QSO with non-French station same continent
210
+ French: 2 points per QSO with non-French station on different continent
211
+ non-French: 1 point per QSO with French station same continent
212
+ non-French: 3 points per QSO with French station on different continent
213
+
214
+ self.contact["CountryPrefix"]
215
+ self.contact["Continent"]
216
+ """
217
+
218
+ # Just incase the cty lookup fails
219
+ my_country = None
220
+ my_continent = None
221
+ their_continent = None
222
+ their_country = None
223
+
224
+ result = self.cty_lookup(self.station.get("Call", ""))
225
+ if result:
226
+ for item in result.items():
227
+ my_country = item[1].get("entity", "")
228
+ my_continent = item[1].get("continent", "")
229
+ result = self.cty_lookup(self.contact.get("Call", ""))
230
+ if result:
231
+ for item in result.items():
232
+ their_country = item[1].get("entity", "")
233
+ their_continent = item[1].get("continent", "")
234
+
235
+ if my_country == "France":
236
+ if their_country == "France":
237
+ if my_continent == their_continent:
238
+ return 6
239
+ else:
240
+ return 15
241
+ else:
242
+ if my_continent == their_continent:
243
+ return 1
244
+ else:
245
+ return 2
246
+ else:
247
+ if their_country == "France":
248
+ if their_continent == my_continent:
249
+ return 1
250
+ else:
251
+ return 3
252
+
253
+ return 0
254
+
255
+
256
+ def show_mults(self):
257
+ """Return display string for mults"""
258
+ return int(self.database.fetch_mult_count(1).get("count", 0)) + int(
259
+ self.database.fetch_mult_count(2).get("count", 0)
260
+ )
261
+
262
+
263
+ def show_qso(self):
264
+ """Return qso count"""
265
+ result = self.database.fetch_qso_count()
266
+ if result:
267
+ return int(result.get("qsos", 0))
268
+ return 0
269
+
270
+
271
+ def calc_score(self):
272
+ """Return calculated score"""
273
+ result = self.database.fetch_points()
274
+ if result is not None:
275
+ score = result.get("Points", "0")
276
+ if score is None:
277
+ score = "0"
278
+ contest_points = int(score)
279
+ mults = show_mults(self)
280
+ return contest_points * mults
281
+ return 0
282
+
283
+
284
+ def recalculate_mults(self):
285
+ """Recalculates multipliers after change in logged qso."""
286
+
287
+ all_contacts = self.database.fetch_all_contacts_asc()
288
+ for contact in all_contacts:
289
+
290
+ contact["IsMultiplier1"] = 0
291
+ contact["IsMultiplier2"] = 0
292
+
293
+ time_stamp = contact.get("TS", "")
294
+ canton = contact.get("NR", "")
295
+ dxcc = contact.get("CountryPrefix", "")
296
+ band = contact.get("Band", "")
297
+ if dxcc == "HB" and canton.isalpha():
298
+ query = (
299
+ f"select count(*) as canton_count from dxlog where TS < '{time_stamp}' "
300
+ f"and NR = '{canton.upper()}' "
301
+ f"and Band = '{band}' "
302
+ f"and ContestNR = {self.pref.get('contest', '1')};"
303
+ )
304
+ result = self.database.exec_sql(query)
305
+ count = int(result.get("canton_count", 0))
306
+ if count == 0:
307
+ contact["IsMultiplier1"] = 1
308
+
309
+ if dxcc:
310
+ query = (
311
+ f"select count(*) as dxcc_count from dxlog where TS < '{time_stamp}' "
312
+ f"and CountryPrefix = '{dxcc}' "
313
+ f"and Band = '{band}' "
314
+ f"and ContestNR = {self.pref.get('contest', '1')};"
315
+ )
316
+ result = self.database.exec_sql(query)
317
+ if not result.get("dxcc_count", ""):
318
+ contact["IsMultiplier2"] = 1
319
+
320
+ self.database.change_contact(contact)
321
+ cmd = {}
322
+ cmd["cmd"] = "UPDATELOG"
323
+ cmd["station"] = platform.node()
324
+ self.multicast_interface.send_as_json(cmd)
325
+
326
+
327
+ def adif(self):
328
+ """Call the generate ADIF function"""
329
+ gen_adif(self, cabrillo_name, "REF-SSB")
330
+
331
+
332
+ def cabrillo(self):
333
+ """Generates Cabrillo file. Maybe."""
334
+ # https://www.cqwpx.com/cabrillo.htm
335
+ logger.debug("******Cabrillo*****")
336
+ logger.debug("Station: %s", f"{self.station}")
337
+ logger.debug("Contest: %s", f"{self.contest_settings}")
338
+ now = datetime.datetime.now()
339
+ date_time = now.strftime("%Y-%m-%d_%H-%M-%S")
340
+ filename = (
341
+ str(Path.home())
342
+ + "/"
343
+ + f"{self.station.get('Call', '').upper()}_{cabrillo_name}_{date_time}.log"
344
+ )
345
+ logger.debug("%s", filename)
346
+ log = self.database.fetch_all_contacts_asc()
347
+ try:
348
+ with open(filename, "w", encoding="ascii") as file_descriptor:
349
+ print("START-OF-LOG: 3.0", end="\r\n", file=file_descriptor)
350
+ print(
351
+ f"CREATED-BY: Not1MM v{__version__}",
352
+ end="\r\n",
353
+ file=file_descriptor,
354
+ )
355
+ print(
356
+ f"CONTEST: {cabrillo_name}",
357
+ end="\r\n",
358
+ file=file_descriptor,
359
+ )
360
+ if self.station.get("Club", ""):
361
+ print(
362
+ f"CLUB: {self.station.get('Club', '').upper()}",
363
+ end="\r\n",
364
+ file=file_descriptor,
365
+ )
366
+ print(
367
+ f"CALLSIGN: {self.station.get('Call','')}",
368
+ end="\r\n",
369
+ file=file_descriptor,
370
+ )
371
+ print(
372
+ f"LOCATION: {self.station.get('ARRLSection', '')}",
373
+ end="\r\n",
374
+ file=file_descriptor,
375
+ )
376
+ # print(
377
+ # f"ARRL-SECTION: {self.pref.get('section', '')}",
378
+ # end="\r\n",
379
+ # file=file_descriptor,
380
+ # )
381
+ print(
382
+ f"CATEGORY-OPERATOR: {self.contest_settings.get('OperatorCategory','')}",
383
+ end="\r\n",
384
+ file=file_descriptor,
385
+ )
386
+ print(
387
+ f"CATEGORY-ASSISTED: {self.contest_settings.get('AssistedCategory','')}",
388
+ end="\r\n",
389
+ file=file_descriptor,
390
+ )
391
+ print(
392
+ f"CATEGORY-BAND: {self.contest_settings.get('BandCategory','')}",
393
+ end="\r\n",
394
+ file=file_descriptor,
395
+ )
396
+ print(
397
+ f"CATEGORY-MODE: {self.contest_settings.get('ModeCategory','')}",
398
+ end="\r\n",
399
+ file=file_descriptor,
400
+ )
401
+ print(
402
+ f"CATEGORY-TRANSMITTER: {self.contest_settings.get('TransmitterCategory','')}",
403
+ end="\r\n",
404
+ file=file_descriptor,
405
+ )
406
+ if self.contest_settings.get("OverlayCategory", "") != "N/A":
407
+ print(
408
+ f"CATEGORY-OVERLAY: {self.contest_settings.get('OverlayCategory','')}",
409
+ end="\r\n",
410
+ file=file_descriptor,
411
+ )
412
+ print(
413
+ f"GRID-LOCATOR: {self.station.get('GridSquare','')}",
414
+ end="\r\n",
415
+ file=file_descriptor,
416
+ )
417
+ # print(
418
+ # f"CATEGORY: {None}",
419
+ # end="\r\n",
420
+ # file=file_descriptor,
421
+ # )
422
+ print(
423
+ f"CATEGORY-POWER: {self.contest_settings.get('PowerCategory','')}",
424
+ end="\r\n",
425
+ file=file_descriptor,
426
+ )
427
+
428
+ print(
429
+ f"CLAIMED-SCORE: {calc_score(self)}",
430
+ end="\r\n",
431
+ file=file_descriptor,
432
+ )
433
+ ops = f"@{self.station.get('Call','')}"
434
+ list_of_ops = self.database.get_ops()
435
+ for op in list_of_ops:
436
+ ops += f", {op.get('Operator', '')}"
437
+ print(
438
+ f"OPERATORS: {ops}",
439
+ end="\r\n",
440
+ file=file_descriptor,
441
+ )
442
+ print(
443
+ f"NAME: {self.station.get('Name', '')}",
444
+ end="\r\n",
445
+ file=file_descriptor,
446
+ )
447
+ print(
448
+ f"ADDRESS: {self.station.get('Street1', '')}",
449
+ end="\r\n",
450
+ file=file_descriptor,
451
+ )
452
+ print(
453
+ f"ADDRESS-CITY: {self.station.get('City', '')}",
454
+ end="\r\n",
455
+ file=file_descriptor,
456
+ )
457
+ print(
458
+ f"ADDRESS-STATE-PROVINCE: {self.station.get('State', '')}",
459
+ end="\r\n",
460
+ file=file_descriptor,
461
+ )
462
+ print(
463
+ f"ADDRESS-POSTALCODE: {self.station.get('Zip', '')}",
464
+ end="\r\n",
465
+ file=file_descriptor,
466
+ )
467
+ print(
468
+ f"ADDRESS-COUNTRY: {self.station.get('Country', '')}",
469
+ end="\r\n",
470
+ file=file_descriptor,
471
+ )
472
+ print(
473
+ f"EMAIL: {self.station.get('Email', '')}",
474
+ end="\r\n",
475
+ file=file_descriptor,
476
+ )
477
+ for contact in log:
478
+ the_date_and_time = contact.get("TS", "")
479
+ themode = contact.get("Mode", "")
480
+ if themode == "LSB" or themode == "USB":
481
+ themode = "PH"
482
+ frequency = str(int(contact.get("Freq", "0"))).rjust(5)
483
+
484
+ loggeddate = the_date_and_time[:10]
485
+ loggedtime = the_date_and_time[11:13] + the_date_and_time[14:16]
486
+ print(
487
+ f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
488
+ f"{contact.get('StationPrefix', '').ljust(13)} "
489
+ f"{str(contact.get('SNT', '')).ljust(3)} "
490
+ f"{str(contact.get('SentNr', '')).ljust(6)} "
491
+ f"{contact.get('Call', '').ljust(13)} "
492
+ f"{str(contact.get('RCV', '')).ljust(3)} "
493
+ f"{str(contact.get('NR', '')).ljust(6)}",
494
+ end="\r\n",
495
+ file=file_descriptor,
496
+ )
497
+ print("END-OF-LOG:", end="\r\n", file=file_descriptor)
498
+ self.show_message_box(f"Cabrillo saved to: {filename}")
499
+ except IOError as exception:
500
+ logger.critical("cabrillo: IO error: %s, writing to %s", exception, filename)
501
+ self.show_message_box(f"Error saving Cabrillo: {exception} {filename}")
502
+ return
503
+
504
+
505
+ def process_esm(self, new_focused_widget=None, with_enter=False):
506
+ """ESM State Machine"""
507
+
508
+ # self.pref["run_state"]
509
+
510
+ # -----===== Assigned F-Keys =====-----
511
+ # self.esm_dict["CQ"]
512
+ # self.esm_dict["EXCH"]
513
+ # self.esm_dict["QRZ"]
514
+ # self.esm_dict["AGN"]
515
+ # self.esm_dict["HISCALL"]
516
+ # self.esm_dict["MYCALL"]
517
+ # self.esm_dict["QSOB4"]
518
+
519
+ # ----==== text fields ====----
520
+ # self.callsign
521
+ # self.sent
522
+ # self.receive
523
+ # self.other_1
524
+ # self.other_2
525
+
526
+ if new_focused_widget is not None:
527
+ self.current_widget = self.inputs_dict.get(new_focused_widget)
528
+
529
+ # print(f"checking esm {self.current_widget=} {with_enter=} {self.pref.get("run_state")=}")
530
+
531
+ for a_button in [
532
+ self.esm_dict["CQ"],
533
+ self.esm_dict["EXCH"],
534
+ self.esm_dict["QRZ"],
535
+ self.esm_dict["AGN"],
536
+ self.esm_dict["HISCALL"],
537
+ self.esm_dict["MYCALL"],
538
+ self.esm_dict["QSOB4"],
539
+ ]:
540
+ if a_button is not None:
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:
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_2":
557
+ if self.other_2.text() == "":
558
+ self.make_button_green(self.esm_dict["AGN"])
559
+ buttons_to_send.append(self.esm_dict["AGN"])
560
+ elif self.other_2.text().isnumeric():
561
+ self.make_button_green(self.esm_dict["QRZ"])
562
+ buttons_to_send.append(self.esm_dict["QRZ"])
563
+ buttons_to_send.append("LOGIT")
564
+ else:
565
+ self.make_button_green(self.esm_dict["AGN"])
566
+ buttons_to_send.append(self.esm_dict["AGN"])
567
+
568
+ if with_enter is True and bool(len(buttons_to_send)):
569
+ for button in buttons_to_send:
570
+ if button:
571
+ if button == "LOGIT":
572
+ self.save_contact()
573
+ continue
574
+ self.process_function_key(button)
575
+ else:
576
+ if self.current_widget == "callsign":
577
+ if len(self.callsign.text()) > 2:
578
+ self.make_button_green(self.esm_dict["MYCALL"])
579
+ buttons_to_send.append(self.esm_dict["MYCALL"])
580
+
581
+ elif self.current_widget == "other_2":
582
+ if self.other_2.text() == "":
583
+ self.make_button_green(self.esm_dict["AGN"])
584
+ buttons_to_send.append(self.esm_dict["AGN"])
585
+ elif self.other_2.text().isnumeric():
586
+ self.make_button_green(self.esm_dict["EXCH"])
587
+ buttons_to_send.append(self.esm_dict["EXCH"])
588
+ buttons_to_send.append("LOGIT")
589
+ else:
590
+ self.make_button_green(self.esm_dict["AGN"])
591
+ buttons_to_send.append(self.esm_dict["AGN"])
592
+
593
+ if with_enter is True and bool(len(buttons_to_send)):
594
+ for button in buttons_to_send:
595
+ if button:
596
+ if button == "LOGIT":
597
+ self.save_contact()
598
+ continue
599
+ self.process_function_key(button)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: not1mm
3
- Version: 24.10.21
3
+ Version: 24.10.22
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
@@ -58,7 +58,7 @@ Requires-Dist: Levenshtein
58
58
  - [Other not so supported contests](#other-not-so-supported-contests)
59
59
  - [Our Code Contributors ✨](#our-code-contributors-)
60
60
  - [List of should be working contests, those in bold have ESM](#list-of-should-be-working-contests-those-in-bold-have-esm)
61
- - [Recent Changes](#recent-changes)
61
+ - [Recent Changes (Polishing the Turd)](#recent-changes-polishing-the-turd)
62
62
  - [Flatpak](#flatpak)
63
63
  - [Installation](#installation)
64
64
  - [Prerequisites](#prerequisites)
@@ -224,13 +224,15 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
224
224
  - **K1USN Slow Speed Test**
225
225
  - **NAQP CW, RTTY, SSB**
226
226
  - Phone Weekly Test
227
- - RAC Canada Day
227
+ - **RAC Canada Day**
228
+ - **REF CW, SSB**
228
229
  - Stew Perry Topband
229
230
  - **Weekly RTTY**
230
231
  - **Winter Field Day**
231
232
 
232
- ## Recent Changes
233
+ ## Recent Changes (Polishing the Turd)
233
234
 
235
+ - [24-10-22] Added ESM to RAC Canada Day. Added French REF.
234
236
  - [24-10-21] Scaled back the hits returned from the check window from 25 to 20. Seems less resource hungry now.
235
237
  - [24-10-20-1] ReWrote how the widgets interact. I porbably broke a thing or two. Let me know.
236
238
  - [24-10-20] Add ESM to ARRL DX.
@@ -30,8 +30,8 @@ not1mm/data/k6gte.not1mm-32.png,sha256=XdTsCa3xqwTfn26Ga7RwO_Vlbg_77RKkSc8bMxVcC
30
30
  not1mm/data/k6gte.not1mm-64.png,sha256=6ku45Gq1g5ezh04F07osoKRtanb3e4kbx5XdIEh3N90,2925
31
31
  not1mm/data/logwindow.ui,sha256=f7vULj96tHIQuR1nJMyvPHHcmVgzkhv9D1isyojsnFU,1458
32
32
  not1mm/data/logwindowx.ui,sha256=CwpI-h7cI1yqyldH9quKftsdHL5lTyL9ABOcf80nfqc,1632
33
- not1mm/data/main.ui,sha256=gQu3tpph-eN-TawrfkmqQ0MMWqRKB1Qrwpo5Eo19ljo,61886
34
- not1mm/data/new_contest.ui,sha256=zqNza6syjqZdVFKS57gzMCL4vD7Fg9n_wO3mS7DDXpg,23222
33
+ not1mm/data/main.ui,sha256=5dp8HYwhfD8H8WncRMChclY9E_JOCAPvsxzl9g9IMRc,61886
34
+ not1mm/data/new_contest.ui,sha256=CBvg-L_81Aftk9_cp88aHrFMLhpRsM80BmA6gOpaGa0,23429
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=hwT2NRwobu0PLDyw6ltmbmcAtGBD02CKGFbgGWjXMqA,2334
117
- not1mm/lib/version.py,sha256=D6mIm6OgYWzRneWveEQ3LiGbwAb1EyqiRI--vg2Qr64,49
117
+ not1mm/lib/version.py,sha256=dmYxdln0AJPTX0xSww6F0-Z7M59diqYW6FIIqRRgV44,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
@@ -131,7 +131,7 @@ not1mm/plugins/arrl_ss_phone.py,sha256=zSD3WBFFWpiOo7RWgMfPduzFxshTczXtwK-OXqGV9
131
131
  not1mm/plugins/arrl_vhf_jan.py,sha256=St_QvYS5AKFUNxtvpU-KlJ3C-xGQi1idFHggmIjnwVc,15717
132
132
  not1mm/plugins/arrl_vhf_jun.py,sha256=9KPILzUD9NYVuXwazhQLCYnGKnoiJDf16omKR5UVflE,14809
133
133
  not1mm/plugins/arrl_vhf_sep.py,sha256=3f5mmXuoe7jt6A8FXFBwentO3lyGMCHSgtkiDcX4Uu4,14809
134
- not1mm/plugins/canada_day.py,sha256=OVpcCl1Chse_zLHf6PayTrgawWM4W-pmrTw40Al-o9s,11998
134
+ not1mm/plugins/canada_day.py,sha256=kyiyUCOz-R6vFNJj1kJ-hwlRXPGE8g5chXzDYv3ATFs,15074
135
135
  not1mm/plugins/cq_160_cw.py,sha256=5s6rIZdJEnmWe1SI06BEyz7p5vP0N2n9mI4l_mZ0icw,14139
136
136
  not1mm/plugins/cq_160_ssb.py,sha256=zIwSMAjHSt6W2edrDzVbyTf860JowHoFkU9BKO8Enag,14182
137
137
  not1mm/plugins/cq_wpx_cw.py,sha256=ZFbcXI8vykXsgMI51YtjM0eQaDOiL0fLG7oAUR1Hfuc,17589
@@ -154,13 +154,14 @@ not1mm/plugins/naqp_cw.py,sha256=_J2Ee1LI1SHE3Mo1Vo6CQ3UiL0tk5yY4U8z9hxnDcBY,174
154
154
  not1mm/plugins/naqp_rtty.py,sha256=MsxQelJmmlwM8HMBO6tvfDLxCMyARrBELY65ZN_DD3A,21229
155
155
  not1mm/plugins/naqp_ssb.py,sha256=sYcAB9dGihDgrRphTrCIoMbW003MNrjBQqOX6IrX6Bw,16365
156
156
  not1mm/plugins/phone_weekly_test.py,sha256=fLpMe03WB9_KgRl6vMgQQt_aktFdqfNt2Sw81CTRAUs,12325
157
- not1mm/plugins/ref_cw.py,sha256=aWjHHkqIKutjRUtzh09y5haFfnZK9poRQDWRQMDRxxU,16326
157
+ not1mm/plugins/ref_cw.py,sha256=9TpIPph1KNyLfsvH3bC6jsJAhJQGT8fGFw12SqiWILg,19997
158
+ not1mm/plugins/ref_ssb.py,sha256=qzhojE-rL7NaMkb6V2XYwZTlx_GDPw3FXlDivGM4oBk,20003
158
159
  not1mm/plugins/stew_perry_topband.py,sha256=CKBQbYl4ETxhXJd2dma4fg_C5pag_s7Nf61SCztZtqE,10668
159
160
  not1mm/plugins/weekly_rtty.py,sha256=ipgY-KlKlEHafnBg-_AFk9KhiXkGTvb4ENoezIeD7jU,18185
160
161
  not1mm/plugins/winter_field_day.py,sha256=nPuPxdK1FimPsHk-uz_3MA4cBqBp6WcwApk7PZwWeWg,13579
161
- not1mm-24.10.21.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
162
- not1mm-24.10.21.dist-info/METADATA,sha256=wsTxrklnGtgMPyF9gTHhc823BjFPgkdYPRgc74xr0Bo,34835
163
- not1mm-24.10.21.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
164
- not1mm-24.10.21.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
165
- not1mm-24.10.21.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
166
- not1mm-24.10.21.dist-info/RECORD,,
162
+ not1mm-24.10.22.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
163
+ not1mm-24.10.22.dist-info/METADATA,sha256=i4rRIdY6tLeST9QP2wjfGtY8tDg9ORPAtn3j6pbI-Uo,34978
164
+ not1mm-24.10.22.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
165
+ not1mm-24.10.22.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
166
+ not1mm-24.10.22.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
167
+ not1mm-24.10.22.dist-info/RECORD,,