Skip to content

Commit

Permalink
add HSKC rules (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
zcsahok authored Apr 15, 2024
1 parent dde2253 commit 00ef9a9
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 0 deletions.
32 changes: 32 additions & 0 deletions rules/hskc/hskc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Hungarian Straight Key Contest
# https://hskc.ha8kux.com/en/contest-rules
#
# Provided by: Zoltan Csahok HA5CQZ

CONTEST=hskc
LOGFILE=hskc.log

CONTEST_MODE

GENERIC_MULT = BAND

# scoring and mults handled by hskc.py


CABRILLO-CONTEST=HSKC
CABRILLO-CATEGORY-MODE=CW
CABRILLO-CATEGORY-BAND=80M
CABRILLO-CATEGORY-POWER=(LOW,QRP)
CABRILLO-CATEGORY-OPERATOR=(SINGLE-OP,MULTI-OP)

# fixed Cabrillo fields
CABRILLO-CATEGORY-TRANSMITTER=ONE
CABRILLO-OPERATORS=-
CABRILLO-CATEGORY-STATION=-
CABRILLO-CATEGORY-TIME=-
CABRILLO-CATEGORY-OVERLAY=-
CABRILLO-OFFTIME=-
CABRILLO-LOCATION=-
CABRILLO-CLUB=-

36 changes: 36 additions & 0 deletions rules/hskc/hskc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
Hungarian Straight Key Contest
https://hskc.ha8kux.com/en/contest-rules
"""
import re

MULT_PATTERN = re.compile(r"""
( # either
([0-9][A-Z])[A-Z]* # the last digit of the prefix and the next letter (first letter of the suffix)
| # or
([0-9A-Z]{2}) # the last two characters of the callsign
)
(/([0-9]|[A-Z]+))? # optional trailing call modifier - ignored
$ # end of string
""", re.VERBOSE)


# QSO with a Category A station 3 points, with a Category B station 1 point
def score(qso):
if qso.exchange.strip().endswith('A'):
return 3
else:
return 1


def check_exchange(qso):
m = MULT_PATTERN.search(qso.call)
mult = ''
if m:
if m.group(2):
mult = m.group(2)
elif m.group(3):
mult = m.group(3)

return {'mult1_value': mult}

13 changes: 13 additions & 0 deletions test/rules/hskc/hskc.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
80CW 09-Apr-24 19:35 0001 HA2MN 599 599 123A 2M 3
80CW 09-Apr-24 19:39 0002 HA5ABC 599 599 123A 5A 3
80CW 09-Apr-24 19:39 0003 YU9VK 599 599 123B 9V 1
80CW 09-Apr-24 19:39 0004 SP5A 599 599 8A 3
80CW 09-Apr-24 19:39 0005 HA8KZ 599 599 12A 8K 3
80CW 09-Apr-24 19:39 0006 HA8KW 599 599 42A 3
80CW 09-Apr-24 19:39 0007 HG2007PAX 599 599 311A 7P 3
80CW 09-Apr-24 19:40 0008 HA/DJ7EJ/M 599 599 23B 7E 1
80CW 09-Apr-24 19:40 0009 YO6QBC 599 599 19A 6Q 3
80CW 09-Apr-24 19:40 0010 HL22 599 599 7B 22 1
80CW 09-Apr-24 19:40 0011 TX9 599 599 726A X9 3
80CW 09-Apr-24 19:41 0012 TM380 599 599 5A 80 3
80CW 09-Apr-24 20:03 0013 IM0/S52JKL 599 599 213A 2J 3
2 changes: 2 additions & 0 deletions test/rules/hskc/logcfg.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RULES=hskc
CALL=HA5AAA
1 change: 1 addition & 0 deletions test/rules/hskc/rules/hskc
1 change: 1 addition & 0 deletions test/rules/hskc/rules/hskc.py

0 comments on commit 00ef9a9

Please sign in to comment.