Skip to content

Commit

Permalink
Marconi Club QSO Party Day rules (#420)
Browse files Browse the repository at this point in the history
* add Marconi Club QSO Party Day

* set bandindex in qso created for a spot

* use initial exchanges for bandmap
  • Loading branch information
zcsahok committed Feb 23, 2024
1 parent 5125397 commit 7b714df
Show file tree
Hide file tree
Showing 9 changed files with 1,063 additions and 0 deletions.
62 changes: 62 additions & 0 deletions rules/mcd/mcd
@@ -0,0 +1,62 @@
##############################
# Marconi Club QSO Party Day #
##############################
# http://www.ariloano.it/marconiclub/
#
# Provided by: Zoltan Csahok HA5CQZ
#

LOGFILE=mcd.log
CONTEST_MODE

CABRILLO=UNIVERSAL
CABRILLO-CONTEST= MCD-QSO-PARTY
CABRILLO-CATEGORY-BAND= ALL
CABRILLO-CATEGORY-MODE= CW
CABRILLO-CATEGORY-TRANSMITTER= ONE
CABRILLO-CATEGORY-OPERATOR= ONE

CABRILLO-CATEGORY-ASSISTED= -
CABRILLO-CATEGORY-POWER= -
CABRILLO-CATEGORY-TIME= -
CABRILLO-CATEGORY-STATION=-
CABRILLO-CATEGORY-OVERLAY=-
CABRILLO-LOCATION=-
CABRILLO-OFFTIME=-
CABRILLO-CLUB=-
CABRILLO-OPERATORS=-

#================================
# Select one of following blocks:
#--------------------------------
#
# non-members send serial number
#
CABRILLO-EXCHANGE=#
F3=@ ++5NN-- #
S&P_TU_MSG=TU ++5NN-- #
#--------------------------------
#
# Marconi Club members send membership number
#
##CABRILLO-EXCHANGE= MC123
##F3=@ ++5NN-- MC123
##S&P_TU_MSG=TU ++5NN-- MC123
#================================

# Scoring:
# (handled by mcd.py)


# Multipliers:
# The multiplier total is the sum of worked MC members on each band
# (handled by mcd.py)

GENERIC_MULT=BAND


RECALL_MULTS
INITIAL_EXCHANGE=rules/mcd.txt

PLUGIN_CONFIG=rules/mcd.txt

48 changes: 48 additions & 0 deletions rules/mcd/mcd.py
@@ -0,0 +1,48 @@
"""
Marconi Club QSO Party Day
http://www.ariloano.it/marconiclub/
"""

import re

MEMBERS = {}

def init(cfg):
# read initial exchange file
global MEMBERS
comment = re.compile("(^#|^$)") # starts with a hash or empty
with open(cfg) as file:
for line in file:
line = line.strip()
if comment.match(line):
continue
[call, exchange] = line.split(',')
MEMBERS[call] = exchange


def get_member_id(exchange):
if exchange.startswith('MC'):
return exchange

return ''


# - 5 points for a QSO with a member of Marconi Club A.R.I. Loano
# - 1 point for a QSO with a non-member
def score(qso):

if get_member_id(qso.exchange):
points = 5
else:
points = 1

return points


def check_exchange(qso):
mult = get_member_id(qso.exchange)
if not mult and qso.call in MEMBERS:
mult = MEMBERS[qso.call]

return {'mult1_value': mult}

0 comments on commit 7b714df

Please sign in to comment.