diff --git a/rules/iaruhf/iaruhf b/rules/iaruhf/iaruhf index cb89111f..21cbb315 100644 --- a/rules/iaruhf/iaruhf +++ b/rules/iaruhf/iaruhf @@ -11,7 +11,7 @@ ############################## # # The custom multiplier list should be stored in the tlf working directory -CONTEST=iaru-hf +CONTEST=iaruhf LOGFILE=iaruhf.log CONTEST_MODE @@ -36,12 +36,11 @@ RECALL_MULTS # HQ stations and IARU officials INITIAL_EXCHANGE=iaruhf.txt -# It can get the points incorrect if your neighbour country is in the same ITU zone. # Switched from ITUMULT to WYSIWYG_MULTIBAND to get the HQ multipliers correctly. -# TODO convert scoring to a python plugin -MY_COUNTRY_POINTS=1 -MY_CONTINENT_POINTS=3 -DX_POINTS=5 + +# Scoring: +# (handled by iaruhf.py) + WYSIWYG_MULTIBAND #ITUMULT diff --git a/rules/iaruhf/iaruhf.py b/rules/iaruhf/iaruhf.py new file mode 100644 index 00000000..5c209afc --- /dev/null +++ b/rules/iaruhf/iaruhf.py @@ -0,0 +1,44 @@ +""" +IARU HF World Championship +https://www.arrl.org/iaru-hf-world-championship +""" + +MY_ITU_ZONE = None +MY_CONTINENT = None + +IARU_EXCHANGES = ['IARU', 'AC', 'R1', 'R2', 'R3'] + +def init(cfg): + dxcc = tlf.get_dxcc(tlf.MY_CALL) + global MY_ITU_ZONE + MY_ITU_ZONE = dxcc.itu_zone + global MY_CONTINENT + MY_CONTINENT = dxcc.continent + +""" +5. Scoring + 5.1 QSO points: + 5.1.1 Contacts within your own ITU zone count one (1) point. + 5.1.2 Contacts with an IARU HQ or IARU official station count one (1) point. + 5.1.3 Contacts with a station in the same ITU zone + but on a different continent count one (1) point. + 5.1.4 Contacts within your continent but in a different ITU zone + count three (3) points. + 5.1.5 Contacts with a different continent and ITU zone count five (5) points. +""" +def score(qso): + dxcc = tlf.get_dxcc(qso.call) + xchg = qso.exchange.strip() + + if dxcc.itu_zone == MY_ITU_ZONE: # 5.1.1 and 5.1.3 + points = 1 + elif xchg in IARU_EXCHANGES: # 5.1.2 + points = 1 + else: + if dxcc.continent == MY_CONTINENT: # 5.1.4 and 5.1.5 + points = 3 + else: + points = 5 + + return points + diff --git a/test/rules/iaruhf/iaruhf.log b/test/rules/iaruhf/iaruhf.log index 53ab56cc..e43ca1c6 100644 --- a/test/rules/iaruhf/iaruhf.log +++ b/test/rules/iaruhf/iaruhf.log @@ -5,3 +5,4 @@ 20SSB 17-Jul-26 17:47 0005 DA0HQ 59 59 DARC DARC 3 20SSB 17-Jul-26 17:49 0006 DL9XXX 59 59 28 3 20SSB 17-Jul-26 17:52 0007 N0X 59 59 8 8 5 + 40CW 17-Jul-26 17:54 0008 9M2IR 599 599 R3 R3 1 diff --git a/test/rules/iaruhf/rules/iaruhf.py b/test/rules/iaruhf/rules/iaruhf.py new file mode 120000 index 00000000..eab234a3 --- /dev/null +++ b/test/rules/iaruhf/rules/iaruhf.py @@ -0,0 +1 @@ +../../../../rules/iaruhf/iaruhf.py \ No newline at end of file