not1mm 23.12.5__py3-none-any.whl → 24.1.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.
Files changed (42) hide show
  1. not1mm/__main__.py +249 -399
  2. not1mm/data/MASTER.SCP +1056 -48577
  3. not1mm/data/configuration.ui +93 -2
  4. not1mm/data/cty.json +1 -1
  5. not1mm/data/main.ui +186 -3
  6. not1mm/data/new_contest.ui +26 -1
  7. not1mm/lib/ham_utility.py +16 -4
  8. not1mm/lib/settings.py +40 -0
  9. not1mm/lib/version.py +1 -1
  10. not1mm/plugins/10_10_fall_cw.py +1 -1
  11. not1mm/plugins/10_10_spring_cw.py +1 -1
  12. not1mm/plugins/10_10_summer_phone.py +1 -1
  13. not1mm/plugins/10_10_winter_phone.py +1 -1
  14. not1mm/plugins/arrl_10m.py +413 -0
  15. not1mm/plugins/arrl_dx_cw.py +1 -1
  16. not1mm/plugins/arrl_dx_ssb.py +1 -1
  17. not1mm/plugins/arrl_ss_cw.py +4 -1
  18. not1mm/plugins/arrl_ss_phone.py +4 -1
  19. not1mm/plugins/arrl_vhf_jan.py +390 -0
  20. not1mm/plugins/arrl_vhf_jun.py +358 -0
  21. not1mm/plugins/arrl_vhf_sep.py +357 -0
  22. not1mm/plugins/canada_day.py +5 -2
  23. not1mm/plugins/cq_wpx_cw.py +1 -1
  24. not1mm/plugins/cq_wpx_ssb.py +1 -1
  25. not1mm/plugins/cq_ww_cw.py +1 -1
  26. not1mm/plugins/cq_ww_ssb.py +1 -1
  27. not1mm/plugins/cwt.py +5 -2
  28. not1mm/plugins/general_logging.py +1 -1
  29. not1mm/plugins/iaru_hf.py +1 -1
  30. not1mm/plugins/jidx_cw.py +2 -1
  31. not1mm/plugins/jidx_ph.py +2 -1
  32. not1mm/plugins/naqp_cw.py +1 -2
  33. not1mm/plugins/naqp_ssb.py +1 -2
  34. not1mm/plugins/phone_weekly_test.py +372 -0
  35. not1mm/plugins/stew_perry_topband.py +336 -0
  36. not1mm/weee.py +10 -0
  37. {not1mm-23.12.5.dist-info → not1mm-24.1.15.dist-info}/METADATA +19 -7
  38. {not1mm-23.12.5.dist-info → not1mm-24.1.15.dist-info}/RECORD +42 -35
  39. {not1mm-23.12.5.dist-info → not1mm-24.1.15.dist-info}/LICENSE +0 -0
  40. {not1mm-23.12.5.dist-info → not1mm-24.1.15.dist-info}/WHEEL +0 -0
  41. {not1mm-23.12.5.dist-info → not1mm-24.1.15.dist-info}/entry_points.txt +0 -0
  42. {not1mm-23.12.5.dist-info → not1mm-24.1.15.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,372 @@
1
+ """Phone Weekly Test plugin"""
2
+
3
+ # Geographic Focus: North America
4
+ # Participation: Worldwide
5
+ # Mode: SSB
6
+ # Bands: 160, 80, 40, 20, 15m
7
+ # Classes: Single Op
8
+ # Max power: 100 watts
9
+ # Exchange: NA: Name + (state/province/country)
10
+ # non-NA: Name
11
+ # Work stations: Once per band
12
+ # QSO Points: NA station: 1 point per QSO
13
+ # non-NA station: 1 point per QSO with an NA station
14
+ # Multipliers: Each US state (including KH6/KL7) once per band
15
+ # Each VE province/territory once per band
16
+ # Each North American country (except W/VE) once per band
17
+ # Score Calculation: Total score = total QSO points x total mults
18
+ # Submit logs by: 0300Z January 19, 2024
19
+ # E-mail logs to: (none)
20
+ # Post log summary at: http://www.3830scores.com
21
+ # Mail logs to: (none)
22
+ # Find rules at: http://www.perluma.com/Phone_Fray_Contest_Rules.pdf
23
+
24
+
25
+ # pylint: disable=invalid-name, unused-argument, unused-variable, c-extension-no-member, unused-import
26
+
27
+ import datetime
28
+ import logging
29
+ import platform
30
+
31
+ from pathlib import Path
32
+
33
+ from PyQt5 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("__main__")
39
+
40
+ name = "PHONE WEEKLY TEST"
41
+ cabrillo_name = "PHONE-WEEKLY-TEST"
42
+ mode = "SSB" # CW SSB BOTH RTTY
43
+ # columns = [0, 1, 2, 3, 4, 10, 11, 14, 15]
44
+ columns = [
45
+ "YYYY-MM-DD HH:MM:SS",
46
+ "Call",
47
+ "Freq",
48
+ "Name",
49
+ "Sect",
50
+ "M1",
51
+ "PTS",
52
+ ]
53
+
54
+ advance_on_space = [True, True, True, True, True]
55
+
56
+ # 1 once per contest, 2 work each band, 3 each band/mode, 4 no dupe checking
57
+ dupe_type = 2
58
+
59
+
60
+ def init_contest(self):
61
+ """setup plugin"""
62
+ set_tab_next(self)
63
+ set_tab_prev(self)
64
+ interface(self)
65
+ self.next_field = self.other_1
66
+
67
+
68
+ def interface(self):
69
+ """Setup user interface"""
70
+ self.field1.hide()
71
+ self.field2.hide()
72
+ self.field3.show()
73
+ self.field4.show()
74
+ namefield = self.field3.findChild(QtWidgets.QLabel)
75
+ namefield.setText("Name")
76
+ self.field3.setAccessibleName("Name")
77
+ spc = self.field4.findChild(QtWidgets.QLabel)
78
+ spc.setText("State")
79
+ self.field4.setAccessibleName("State")
80
+
81
+
82
+ def reset_label(self):
83
+ """reset label after field cleared"""
84
+
85
+
86
+ def set_tab_next(self):
87
+ """Set TAB Advances"""
88
+ self.tab_next = {
89
+ self.callsign: self.field3.findChild(QtWidgets.QLineEdit),
90
+ self.field3.findChild(QtWidgets.QLineEdit): self.field4.findChild(
91
+ QtWidgets.QLineEdit
92
+ ),
93
+ self.field4.findChild(QtWidgets.QLineEdit): self.callsign,
94
+ }
95
+
96
+
97
+ def set_tab_prev(self):
98
+ """Set TAB Advances"""
99
+ self.tab_prev = {
100
+ self.callsign: self.field4.findChild(QtWidgets.QLineEdit),
101
+ self.field3.findChild(QtWidgets.QLineEdit): self.callsign,
102
+ self.field4.findChild(QtWidgets.QLineEdit): self.field3.findChild(
103
+ QtWidgets.QLineEdit
104
+ ),
105
+ }
106
+
107
+
108
+ def set_contact_vars(self):
109
+ """Contest Specific"""
110
+ self.contact["SNT"] = self.sent.text()
111
+ self.contact["RCV"] = self.receive.text()
112
+ self.contact["Name"] = self.other_1.text().upper()
113
+ self.contact["Sect"] = self.other_2.text().upper()
114
+ self.contact["SentNr"] = self.contest_settings.get("SentExchange", 0)
115
+
116
+ if self.contact.get("Sect"):
117
+ result = self.database.fetch_sect_band_exists(
118
+ self.contact.get("Sect", ""), self.contact.get("Band", "")
119
+ )
120
+ if result.get("sect_count"):
121
+ self.contact["IsMultiplier1"] = 0
122
+ else:
123
+ self.contact["IsMultiplier1"] = 1
124
+
125
+
126
+ def predupe(self):
127
+ """called after callsign entered"""
128
+
129
+
130
+ def prefill(self):
131
+ """Fill sentnr"""
132
+ # if len(self.other_2.text()) == 0:
133
+ # self.other_2.setText(str(self.contact.get("ZN", "")))
134
+ # self.other_1.setText(str(self.contest_settings.get("SentExchange", 0)))
135
+
136
+
137
+ def points(self):
138
+ """Calc point"""
139
+ mycontinent = ""
140
+ hiscontinent = ""
141
+ result = self.cty_lookup(self.station.get("Call", ""))
142
+ if result:
143
+ for item in result.items():
144
+ mycontinent = item[1].get("continent", "")
145
+ result = self.cty_lookup(self.contact.get("Call", ""))
146
+ if result:
147
+ for item in result.items():
148
+ hiscontinent = item[1].get("continent", "")
149
+ if mycontinent == "NA" or hiscontinent == "NA":
150
+ return 1
151
+ return 0
152
+
153
+
154
+ def show_mults(self):
155
+ """Return display string for mults"""
156
+ result = self.database.fetch_section_band_count_nodx()
157
+ if result:
158
+ return int(result.get("sb_count", 0))
159
+ return 0
160
+
161
+
162
+ def show_qso(self):
163
+ """Return qso count"""
164
+ result = self.database.fetch_qso_count()
165
+ if result:
166
+ return int(result.get("qsos", 0))
167
+ return 0
168
+
169
+
170
+ def calc_score(self):
171
+ """Return calculated score"""
172
+ result = self.database.fetch_points()
173
+ if result is not None:
174
+ score = result.get("Points", "0")
175
+ if score is None:
176
+ score = "0"
177
+ contest_points = int(score)
178
+ mults = show_mults(self)
179
+ return contest_points * mults
180
+ return 0
181
+
182
+
183
+ def adif(self):
184
+ """Call the generate ADIF function"""
185
+ gen_adif(self, cabrillo_name, "NAQP-SSB")
186
+
187
+
188
+ def cabrillo(self):
189
+ """Generates Cabrillo file. Maybe."""
190
+ # https://www.cqwpx.com/cabrillo.htm
191
+ logger.debug("******Cabrillo*****")
192
+ logger.debug("Station: %s", f"{self.station}")
193
+ logger.debug("Contest: %s", f"{self.contest_settings}")
194
+ now = datetime.datetime.now()
195
+ date_time = now.strftime("%Y-%m-%d_%H-%M-%S")
196
+ filename = (
197
+ str(Path.home())
198
+ + "/"
199
+ + f"{self.station.get('Call').upper()}_{cabrillo_name}_{date_time}.log"
200
+ )
201
+ logger.debug("%s", filename)
202
+ log = self.database.fetch_all_contacts_asc()
203
+ try:
204
+ with open(filename, "w", encoding="ascii") as file_descriptor:
205
+ print("START-OF-LOG: 3.0", end="\r\n", file=file_descriptor)
206
+ print(
207
+ f"CREATED-BY: Not1MM v{__version__}",
208
+ end="\r\n",
209
+ file=file_descriptor,
210
+ )
211
+ print(
212
+ f"CONTEST: {cabrillo_name}",
213
+ end="\r\n",
214
+ file=file_descriptor,
215
+ )
216
+ print(
217
+ f"CALLSIGN: {self.station.get('Call','')}",
218
+ end="\r\n",
219
+ file=file_descriptor,
220
+ )
221
+ print(
222
+ f"LOCATION: {self.station.get('ARRLSection', '')}",
223
+ end="\r\n",
224
+ file=file_descriptor,
225
+ )
226
+ # print(
227
+ # f"ARRL-SECTION: {self.pref.get('section', '')}",
228
+ # end="\r\n",
229
+ # file=file_descriptor,
230
+ # )
231
+ print(
232
+ f"CATEGORY-OPERATOR: {self.contest_settings.get('OperatorCategory','')}",
233
+ end="\r\n",
234
+ file=file_descriptor,
235
+ )
236
+ print(
237
+ f"CATEGORY-ASSISTED: {self.contest_settings.get('AssistedCategory','')}",
238
+ end="\r\n",
239
+ file=file_descriptor,
240
+ )
241
+ print(
242
+ f"CATEGORY-BAND: {self.contest_settings.get('BandCategory','')}",
243
+ end="\r\n",
244
+ file=file_descriptor,
245
+ )
246
+ print(
247
+ f"CATEGORY-MODE: {self.contest_settings.get('ModeCategory','')}",
248
+ end="\r\n",
249
+ file=file_descriptor,
250
+ )
251
+ print(
252
+ f"CATEGORY-TRANSMITTER: {self.contest_settings.get('TransmitterCategory','')}",
253
+ end="\r\n",
254
+ file=file_descriptor,
255
+ )
256
+ if self.contest_settings.get("OverlayCategory", "") != "N/A":
257
+ print(
258
+ f"CATEGORY-OVERLAY: {self.contest_settings.get('OverlayCategory','')}",
259
+ end="\r\n",
260
+ file=file_descriptor,
261
+ )
262
+ print(
263
+ f"GRID-LOCATOR: {self.station.get('GridSquare','')}",
264
+ end="\r\n",
265
+ file=file_descriptor,
266
+ )
267
+ # print(
268
+ # f"CATEGORY: {None}",
269
+ # end="\r\n",
270
+ # file=file_descriptor,
271
+ # )
272
+ print(
273
+ f"CATEGORY-POWER: {self.contest_settings.get('PowerCategory','')}",
274
+ end="\r\n",
275
+ file=file_descriptor,
276
+ )
277
+
278
+ print(
279
+ f"CLAIMED-SCORE: {calc_score(self)}",
280
+ end="\r\n",
281
+ file=file_descriptor,
282
+ )
283
+ print(
284
+ f"OPERATORS: {self.contest_settings.get('Operators','')}",
285
+ end="\r\n",
286
+ file=file_descriptor,
287
+ )
288
+ print(
289
+ f"NAME: {self.station.get('Name', '')}",
290
+ end="\r\n",
291
+ file=file_descriptor,
292
+ )
293
+ print(
294
+ f"ADDRESS: {self.station.get('Street1', '')}",
295
+ end="\r\n",
296
+ file=file_descriptor,
297
+ )
298
+ print(
299
+ f"ADDRESS-CITY: {self.station.get('City', '')}",
300
+ end="\r\n",
301
+ file=file_descriptor,
302
+ )
303
+ print(
304
+ f"ADDRESS-STATE-PROVINCE: {self.station.get('State', '')}",
305
+ end="\r\n",
306
+ file=file_descriptor,
307
+ )
308
+ print(
309
+ f"ADDRESS-POSTALCODE: {self.station.get('Zip', '')}",
310
+ end="\r\n",
311
+ file=file_descriptor,
312
+ )
313
+ print(
314
+ f"ADDRESS-COUNTRY: {self.station.get('Country', '')}",
315
+ end="\r\n",
316
+ file=file_descriptor,
317
+ )
318
+ print(
319
+ f"EMAIL: {self.station.get('Email', '')}",
320
+ end="\r\n",
321
+ file=file_descriptor,
322
+ )
323
+ for contact in log:
324
+ the_date_and_time = contact.get("TS", "")
325
+ themode = contact.get("Mode", "")
326
+ if themode == "LSB" or themode == "USB":
327
+ themode = "PH"
328
+ frequency = str(int(contact.get("Freq", "0"))).rjust(5)
329
+
330
+ loggeddate = the_date_and_time[:10]
331
+ loggedtime = the_date_and_time[11:13] + the_date_and_time[14:16]
332
+ print(
333
+ f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
334
+ f"{contact.get('StationPrefix', '').ljust(13)} "
335
+ f"{str(contact.get('SentNr', '')).upper()} "
336
+ f"{contact.get('Call', '').ljust(13)} "
337
+ f"{str(contact.get('Name', '')).ljust(11)} "
338
+ f"{str(contact.get('Sect', '')).ljust(5)}",
339
+ end="\r\n",
340
+ file=file_descriptor,
341
+ )
342
+ print("END-OF-LOG:", end="\r\n", file=file_descriptor)
343
+ except IOError as exception:
344
+ logger.critical("cabrillo: IO error: %s, writing to %s", exception, filename)
345
+ return
346
+
347
+
348
+ def recalculate_mults(self):
349
+ """Recalculates multipliers after change in logged qso."""
350
+
351
+ all_contacts = self.database.fetch_all_contacts_asc()
352
+ for contact in all_contacts:
353
+ time_stamp = contact.get("TS")
354
+ sect = contact.get("Sect", "")
355
+ band = contact.get("Band", "")
356
+ query = (
357
+ f"select count(*) as sect_count from dxlog where TS < '{time_stamp}' "
358
+ f"and Sect = '{sect}' "
359
+ f"and Band = '{band}' "
360
+ f"and ContestNR = {self.pref.get('contest', '1')};"
361
+ )
362
+ result = self.database.exec_sql(query)
363
+ count = result.get("sect_count", 1)
364
+ if count == 0 and contact.get("Points", 0) == 1 and sect != "DX":
365
+ contact["IsMultiplier1"] = 1
366
+ else:
367
+ contact["IsMultiplier1"] = 0
368
+ self.database.change_contact(contact)
369
+ cmd = {}
370
+ cmd["cmd"] = "UPDATELOG"
371
+ cmd["station"] = platform.node()
372
+ self.multicast_interface.send_as_json(cmd)
@@ -0,0 +1,336 @@
1
+ """Stew Perry Topband plugin"""
2
+
3
+ # Geographic Focus: Worldwide
4
+ # Participation: Worldwide
5
+ # Awards: Worldwide
6
+ # Mode: CW
7
+ # Bands: 160m Only
8
+ # Classes: Single Op (QRP/Low/High)
9
+ # Multi-Op (QRP/Low/High)
10
+ # Max operating hours: 14 hours
11
+ # Max power: HP: >100 watts
12
+ # LP: 5-100 watts
13
+ # QRP: <5 watts
14
+ # Exchange: 4-Character grid square
15
+ # QSO Points: 1 point per QSO plus 1 point per 500 km
16
+ # multiply QSO points by 2 if low power station
17
+ # multiply QSO points by 4 if QRP station
18
+ # Multipliers: (none)
19
+ # Score Calculation: Total score = total QSO points x power multiplier
20
+ # Submit logs by: January 15, 2024
21
+ # E-mail logs to: (none)
22
+ # Upload log at: http://www.b4h.net/stew/tbdcsubmitlog.php
23
+ # Mail logs to: BARC
24
+ # 50335 NW Hayward Rd
25
+ # Manning, OR 97125
26
+ # USA
27
+ # Find rules at: http://www.kkn.net/stew/
28
+
29
+ # pylint: disable=invalid-name, unused-argument, unused-variable, c-extension-no-member
30
+
31
+ import datetime
32
+ import logging
33
+
34
+ from pathlib import Path
35
+ from PyQt5 import QtWidgets
36
+ from not1mm.lib.plugin_common import gen_adif, get_points
37
+ from not1mm.lib.version import __version__
38
+
39
+ logger = logging.getLogger("__main__")
40
+
41
+ cabrillo_name = "STEW-PERRY"
42
+ name = "Stew Perry Topband"
43
+
44
+ mode = "CW" # CW SSB BOTH RTTY
45
+
46
+ columns = [
47
+ "YYYY-MM-DD HH:MM:SS",
48
+ "Call",
49
+ "Freq",
50
+ "Mode",
51
+ "Exchange1",
52
+ "Sect",
53
+ "PTS",
54
+ ]
55
+
56
+ advance_on_space = [True, True, True, True, True]
57
+
58
+ # 1 once per contest, 2 work each band, 3 each band/mode, 4 no dupe checking
59
+ dupe_type = 1
60
+
61
+
62
+ def init_contest(self):
63
+ """setup plugin"""
64
+ set_tab_next(self)
65
+ set_tab_prev(self)
66
+ interface(self)
67
+ self.next_field = self.other_1
68
+
69
+
70
+ def interface(self):
71
+ """Setup user interface"""
72
+ self.field1.hide()
73
+ self.field2.hide()
74
+ self.field3.show()
75
+ self.field4.show()
76
+ label = self.field3.findChild(QtWidgets.QLabel)
77
+ label.setText("Class")
78
+ self.field3.setAccessibleName("Class")
79
+ label = self.field4.findChild(QtWidgets.QLabel)
80
+ label.setText("Section")
81
+ self.field4.setAccessibleName("Section")
82
+
83
+
84
+ def reset_label(self):
85
+ """reset label after field cleared"""
86
+
87
+
88
+ def set_tab_next(self):
89
+ """Set TAB Advances"""
90
+ self.tab_next = {
91
+ self.callsign: self.field3.findChild(QtWidgets.QLineEdit),
92
+ self.field1.findChild(QtWidgets.QLineEdit): self.field3.findChild(
93
+ QtWidgets.QLineEdit
94
+ ),
95
+ self.field2.findChild(QtWidgets.QLineEdit): self.field3.findChild(
96
+ QtWidgets.QLineEdit
97
+ ),
98
+ self.field3.findChild(QtWidgets.QLineEdit): self.field4.findChild(
99
+ QtWidgets.QLineEdit
100
+ ),
101
+ self.field4.findChild(QtWidgets.QLineEdit): self.callsign,
102
+ }
103
+
104
+
105
+ def set_tab_prev(self):
106
+ """Set TAB Advances"""
107
+ self.tab_prev = {
108
+ self.callsign: self.field4.findChild(QtWidgets.QLineEdit),
109
+ self.field1.findChild(QtWidgets.QLineEdit): self.callsign,
110
+ self.field2.findChild(QtWidgets.QLineEdit): self.callsign,
111
+ self.field3.findChild(QtWidgets.QLineEdit): self.callsign,
112
+ self.field4.findChild(QtWidgets.QLineEdit): self.field3.findChild(
113
+ QtWidgets.QLineEdit
114
+ ),
115
+ }
116
+
117
+
118
+ def set_contact_vars(self):
119
+ """Contest Specific"""
120
+ self.contact["SNT"] = self.sent.text()
121
+ self.contact["RCV"] = self.receive.text()
122
+ self.contact["Exchange1"] = self.other_1.text().upper()
123
+ self.contact["Sect"] = self.other_2.text().upper()
124
+
125
+
126
+ def predupe(self):
127
+ """called after callsign entered"""
128
+
129
+
130
+ def prefill(self):
131
+ """Fill SentNR"""
132
+
133
+
134
+ def points(self):
135
+ """Calc point"""
136
+ _mode = self.contact.get("Mode", "")
137
+ if _mode in "SSB, USB, LSB, FM, AM":
138
+ return 1
139
+ if _mode in "CW, RTTY":
140
+ return 2
141
+ return 0
142
+
143
+
144
+ def show_mults(self):
145
+ """Return display string for mults"""
146
+ result = self.database.get_unique_band_and_mode()
147
+ if result:
148
+ return int(result.get("mult", 0))
149
+ return 0
150
+
151
+
152
+ def show_qso(self):
153
+ """Return qso count"""
154
+ result = self.database.fetch_qso_count()
155
+ if result:
156
+ return int(result.get("qsos", 0))
157
+ return 0
158
+
159
+
160
+ def calc_score(self):
161
+ """Return calculated score"""
162
+ _points = get_points(self)
163
+ _mults = show_mults(self)
164
+ _power_mult = 1
165
+ if self.contest_settings.get("PowerCategory", "") == "QRP":
166
+ _power_mult = 2
167
+ return _points * _power_mult * _mults
168
+
169
+
170
+ def adif(self):
171
+ """Call the generate ADIF function"""
172
+ gen_adif(self, cabrillo_name, "STEW-PERRY")
173
+
174
+
175
+ def cabrillo(self):
176
+ """Generates Cabrillo file. Maybe."""
177
+ # https://www.cqwpx.com/cabrillo.htm
178
+ logger.debug("******Cabrillo*****")
179
+ logger.debug("Station: %s", f"{self.station}")
180
+ logger.debug("Contest: %s", f"{self.contest_settings}")
181
+ now = datetime.datetime.now()
182
+ date_time = now.strftime("%Y-%m-%d_%H-%M-%S")
183
+ filename = (
184
+ str(Path.home())
185
+ + "/"
186
+ + f"{self.station.get('Call').upper()}_{cabrillo_name}_{date_time}.log"
187
+ )
188
+ logger.debug("%s", filename)
189
+ log = self.database.fetch_all_contacts_asc()
190
+ try:
191
+ with open(filename, "w", encoding="ascii") as file_descriptor:
192
+ print("START-OF-LOG: 3.0", end="\r\n", file=file_descriptor)
193
+ print(
194
+ f"CREATED-BY: Not1MM v{__version__}",
195
+ end="\r\n",
196
+ file=file_descriptor,
197
+ )
198
+ print(
199
+ f"CONTEST: {cabrillo_name}",
200
+ end="\r\n",
201
+ file=file_descriptor,
202
+ )
203
+ print(
204
+ f"CALLSIGN: {self.station.get('Call','')}",
205
+ end="\r\n",
206
+ file=file_descriptor,
207
+ )
208
+ print(
209
+ f"LOCATION: {self.station.get('ARRLSection', '')}",
210
+ end="\r\n",
211
+ file=file_descriptor,
212
+ )
213
+ # print(
214
+ # f"ARRL-SECTION: {self.pref.get('section', '')}",
215
+ # end="\r\n",
216
+ # file=file_descriptor,
217
+ # )
218
+ print(
219
+ f"CATEGORY-OPERATOR: {self.contest_settings.get('OperatorCategory','')}",
220
+ end="\r\n",
221
+ file=file_descriptor,
222
+ )
223
+ print(
224
+ f"CATEGORY-ASSISTED: {self.contest_settings.get('AssistedCategory','')}",
225
+ end="\r\n",
226
+ file=file_descriptor,
227
+ )
228
+ print(
229
+ f"CATEGORY-BAND: {self.contest_settings.get('BandCategory','')}",
230
+ end="\r\n",
231
+ file=file_descriptor,
232
+ )
233
+ print(
234
+ f"CATEGORY-MODE: {self.contest_settings.get('ModeCategory','')}",
235
+ end="\r\n",
236
+ file=file_descriptor,
237
+ )
238
+ print(
239
+ f"CATEGORY-TRANSMITTER: {self.contest_settings.get('TransmitterCategory','')}",
240
+ end="\r\n",
241
+ file=file_descriptor,
242
+ )
243
+ if self.contest_settings.get("OverlayCategory", "") != "N/A":
244
+ print(
245
+ f"CATEGORY-OVERLAY: {self.contest_settings.get('OverlayCategory','')}",
246
+ end="\r\n",
247
+ file=file_descriptor,
248
+ )
249
+ print(
250
+ f"GRID-LOCATOR: {self.station.get('GridSquare','')}",
251
+ end="\r\n",
252
+ file=file_descriptor,
253
+ )
254
+ # print(
255
+ # f"CATEGORY: {None}",
256
+ # end="\r\n",
257
+ # file=file_descriptor,
258
+ # )
259
+ print(
260
+ f"CATEGORY-POWER: {self.contest_settings.get('PowerCategory','')}",
261
+ end="\r\n",
262
+ file=file_descriptor,
263
+ )
264
+
265
+ print(
266
+ f"CLAIMED-SCORE: {calc_score(self)}",
267
+ end="\r\n",
268
+ file=file_descriptor,
269
+ )
270
+ print(
271
+ "OPERATORS: ",
272
+ end="\r\n",
273
+ file=file_descriptor,
274
+ )
275
+ print(
276
+ f"NAME: {self.station.get('Name', '')}",
277
+ end="\r\n",
278
+ file=file_descriptor,
279
+ )
280
+ print(
281
+ f"ADDRESS: {self.station.get('Street1', '')}",
282
+ end="\r\n",
283
+ file=file_descriptor,
284
+ )
285
+ print(
286
+ f"ADDRESS-CITY: {self.station.get('City', '')}",
287
+ end="\r\n",
288
+ file=file_descriptor,
289
+ )
290
+ print(
291
+ f"ADDRESS-STATE-PROVINCE: {self.station.get('State', '')}",
292
+ end="\r\n",
293
+ file=file_descriptor,
294
+ )
295
+ print(
296
+ f"ADDRESS-POSTALCODE: {self.station.get('Zip', '')}",
297
+ end="\r\n",
298
+ file=file_descriptor,
299
+ )
300
+ print(
301
+ f"ADDRESS-COUNTRY: {self.station.get('Country', '')}",
302
+ end="\r\n",
303
+ file=file_descriptor,
304
+ )
305
+ print(
306
+ f"EMAIL: {self.station.get('Email', '')}",
307
+ end="\r\n",
308
+ file=file_descriptor,
309
+ )
310
+ for contact in log:
311
+ the_date_and_time = contact.get("TS", "")
312
+ themode = contact.get("Mode", "")
313
+ if themode == "LSB" or themode == "USB":
314
+ themode = "PH"
315
+ frequency = str(int(contact.get("Freq", "0"))).rjust(5)
316
+
317
+ loggeddate = the_date_and_time[:10]
318
+ loggedtime = the_date_and_time[11:13] + the_date_and_time[14:16]
319
+ print(
320
+ f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
321
+ f"{contact.get('StationPrefix', '').ljust(13)} "
322
+ f"{self.contest_settings.get('SentExchange', '').ljust(9).upper()}"
323
+ f"{contact.get('Call', '').ljust(13)} "
324
+ f"{str(contact.get('Exchange1', '')).ljust(3)} "
325
+ f"{str(contact.get('Sect', '')).ljust(6)}",
326
+ end="\r\n",
327
+ file=file_descriptor,
328
+ )
329
+ print("END-OF-LOG:", end="\r\n", file=file_descriptor)
330
+ except IOError as exception:
331
+ logger.critical("cabrillo: IO error: %s, writing to %s", exception, filename)
332
+ return
333
+
334
+
335
+ def recalculate_mults(self):
336
+ """Recalculates multipliers after change in logged qso."""