Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 30 additions & 9 deletions rules/okom → rules/okom/okom
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,35 @@ CONTEST=okom
LOGFILE=okom.log
CONTEST_MODE
CABRILLO=UNIVERSAL
CABRILLO-CONTEST=OKOM
CABRILLO-CONTEST=OK-OM-DX

#================================
# Select one of following blocks:
#--------------------------------
#
# non-OK/OM stations send serial number
#
CABRILLO-EXCHANGE=#
F3=@ ++5NN-- #
S&P_TU_MSG=TU ++5NN-- #
#--------------------------------
#
# OK/OM stanice: okresní znak (tři písmena, XXX).
#
MULT_LIST=okommults
COUNTRYLIST=OK,OM
COUNTRY_LIST_POINTS=1
USE_COUNTRYLIST_ONLY
SERIAL_OR_SECTION
SECTION_MULT
##CABRILLO-EXCHANGE= XXX
##F3=@ ++5NN-- XXX
##S&P_TU_MSG=TU ++5NN-- XXX
#================================


# Scoring:
# (handled by okom.py)

# Multipliers:
# OK/OM districts and DXCC countries per band
# (handled by okom.py)
GENERIC_MULT=BAND

INITIAL_EXCHANGE=ok_om.txt
RECALL_MULTS

Expand All @@ -36,7 +57,7 @@ RECALL_MULTS
#
F1=+TEST -% %+TEST-
F2=%
F3=+@ 5NN -# #
#F3=+@ 5NN -# #
F4=TU 73
F5=@
F6=%
Expand All @@ -48,5 +69,5 @@ F11=PSE K
F12=+TEST -% %+ TEST-
#
CQ_TU_MSG=+TU -%+ TEST-
S&P_TU_MSG=+TU 5NN -# #
#S&P_TU_MSG=+TU 5NN -# #

106 changes: 106 additions & 0 deletions rules/okom/okom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
"""
OK-OM DX Contest
http://okomdx.crk.cz/index.php?page=CW-rules-english
"""

OKOM_DISTRICTS = {
'OK': [
# Praha
'APA','APB','APC','APD','APE','APF','APG','APH','API','APJ',
# Central Bohemia
'BBN','BBE','BKD','BKO','BKH','BME','BMB','BNY','BPZ','BPV','BPB','BRA',
# Southern Bohemia
'CBU','CCK','CJH','CPE','CPI','CPR','CST','CTA',
# Western Bohemia
'DDO','DCH','DKV','DKL','DPM','DPJ','DPS','DRO','DSO','DTA',
# Northern Bohemia
'ECL','EDE','ECH','EJA','ELI','ELT','ELO','EMO','ETE','EUL',
# Eastern Bohemia
'FHB','FHK','FCR','FJI','FNA','FPA','FRK','FSE','FSV','FTR','FUO',
# Southern Moravia
'GBL','GBM','GBV','GBR','GHO','GJI','GKR','GPR','GTR','GUH','GVY','GZL','GZN', 'GZS',
# Northern Moravia
'HBR','HFM','HJE','HKA','HNJ','HOL','HOP','HOS','HPR','HSU','HVS'
],
'OM': [
# Bratislava, prefix OM1
'BAA','BAB','BAC','BAD','BAE','MAL','PEZ','SEN',
# Trnava, prefix OM2
'TRN','DST','GAL','HLO','PIE','SEA','SKA',
# Trencin, prefix OM4
'TNC','BAN','ILA','MYJ','NMV','PAR','PBY','PRI','PUC',
# Nitra, prefix OM5
'NIT','KOM','LVC','NZA','SAL','TOP','ZMO',
# Zilina, prefix OM6
'ZIL','BYT','CAD','DKU','KNM','LMI','MAR','NAM','RUZ','TTE','TVR',
# Banska Bystrica, prefix OM7
'BBY','BRE','DET','KRU','LUC','POL','REV','RSO','VKR','ZVO','ZAR','ZIH','BST',
# Kosice, prefix OM8
'KEA','KEB','KEC','KED','KEO','GEL','MIC','ROZ','SOB','SNV','TRE',
# Presov, prefix OM0
'PRE','BAR','HUM','KEZ','LEV','MED','POP','SAB','SNI','SLU','STR','SVI','VRT'
]
}

MY_PREFIX = None
MY_CONTINENT = None

def init(cfg):
dxcc = tlf.get_dxcc(tlf.MY_CALL)
global MY_PREFIX
MY_PREFIX = dxcc.main_prefix
global MY_CONTINENT
MY_CONTINENT = dxcc.continent


def score(qso):
# 6.3 /MM stations are not multipliers,
# but worth 5 points for any participant.
if (qso.call.endswith('/MM')):
return 5

dxcc = tlf.get_dxcc(qso.call)

if MY_PREFIX in ['OK','OM']:
# 6.1 Czech and Slovak station:
# - QSO with your own country - 2 points,
# - QSO with a different country on your continent - 3 points,
# - QSO with another continent - 5 points.
if dxcc.main_prefix == MY_PREFIX:
points = 2
elif dxcc.continent == MY_CONTINENT:
points = 3
else:
points = 5
else:
# 6.2 Non-Czech and Slovak stations:
# - QSO with Czech and Slovak station - 10 points,
# - QSO with your own country - 1 points,
# - QSO with a different country on your continent - 3 points,
# - QSO with another continent - 5 points.
if dxcc.main_prefix in ['OK','OM']:
points = 10
elif dxcc.main_prefix == MY_PREFIX:
points = 1
elif dxcc.continent == MY_CONTINENT:
points = 3
else:
points = 5

return points


def check_exchange(qso):
xchg = qso.exchange.strip()
dxcc = tlf.get_dxcc(qso.call)

mult = dxcc.main_prefix

if dxcc.main_prefix in ['OK','OM']:
if xchg in OKOM_DISTRICTS[dxcc.main_prefix]:
mult += ' ' + xchg
else:
xchg = xchg.rjust(3, '0') # normalize serial number

return {'mult1_value': mult, 'normalized_exchange': xchg}

4 changes: 3 additions & 1 deletion rules/spdx_dx
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#########################################
# SPDX contest for stations outside SP #
# PA0R, 3.10.2003 #
# https://spdxcontest.pzk.org.pl #
#########################################
#
CONTEST=spdx_dx
LOGFILE=spdx.log
CONTEST_MODE
CABRILLO=UNIVERSAL
CABRILLO-CONTEST=SPDX
#################################
MULT_LIST=spdxmults
COUNTRYLIST=SP
USE_COUNTRYLIST_ONLY
COUNTRY_LIST_POINTS=3
SECTION_MULT
SERIAL_OR_SECTION
RECALL_MULTS
SERIAL_EXCHANGE
SHORT_SERIAL
Expand Down
11 changes: 10 additions & 1 deletion rules/spdx_sp
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
#########################################
# SPDX contest for stations outside SP #
# PA0R, 3.10.2003 #
# https://spdxcontest.pzk.org.pl #
#########################################
#
CONTEST=spdx_sp
LOGFILE=spdx.log
CONTEST_MODE
CABRILLO=UNIVERSAL
CABRILLO-CONTEST=SPDX
#
# Zmień B na jednoliterowy skrót swojego województwa
# (patrz również poniżej F3 oraz S&P_TU_MSG)
#
CABRILLO-EXCHANGE=B
#
#################################
MY_COUNTRY_POINTS=0
MY_CONTINENT_POINTS=1
DX_POINTS=3
COUNTRY_MULT
SERIAL_EXCHANGE
COUNTRYLIST=SP
EXCLUDE_MULTILIST=COUNTRYLIST
NOB4
#
##################################
Expand Down
164 changes: 0 additions & 164 deletions share/okommults

This file was deleted.

2 changes: 0 additions & 2 deletions src/globalvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ extern char fkey_header[60];

extern SCREEN *mainscreen;

extern bool mult_side;
extern bool countrylist_only;
extern bool mixedmode;
extern bool qso_once;
extern bool leading_zeros_serial;
Expand Down
Loading