Skip to content

Commit

Permalink
Messing around with real time scoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbridak committed Nov 30, 2024
1 parent 14d9533 commit 2f7af15
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions not1mm/lib/plugin_common.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
"""Common function(s) for all contest plugins"""

import datetime
from dicttoxml import dicttoxml
from decimal import Decimal
from pathlib import Path
from not1mm.lib.ham_utility import get_adif_band


def online_score(self):
"""generate online xml"""

# <?xml version="1.0"?>
# <dynamicresults>
# <contest>CQ-WW-SSB</contest>
# <call>VA2WA</call> <ops>NR9Q</ops>
# <class power="HIGH" assisted = "ASSISTED" transmitter="ONE" ops="SINGLE-OP" bands="ALL" mode="SSB" overlay="N/A"></class>
# <club>Contest Group du Quebec</club>
# <soft>My logger</soft>
# <version>4.38</version>
# <qth>
# <dxcccountry>K</dxcccountry>
# <cqzone>4</cqzone>
# <iaruzone>8</iaruzone>
# <arrlsection>IL</arrlsection>
# <stprvoth>IL</stprvoth>
# <grid6>EN40IC</grid6>
# </qth>
# <breakdown>
# <qso band="total" mode="ALL">20</qso>
# <mult band="total" mode="ALL" type="zone">13</mult>
# <mult band="total" mode="ALL" type="country">17</mult>
# <point band="total" mode="ALL">49</point>
# </breakdown> <score>1470</score>
# <timestamp>2018-10-29 13:20:27</timestamp>
# </dynamicresults>

info = {}
info["contest"] = "CQ-WW-SSB"
info["call"] = "VA2WA"
info["ops"] = "NR9Q"
print(f"{dicttoxml(info, custom_root='dynamicresults', attr_type=False).decode()=}")


def get_points(self):
"""Return raw points before mults"""
result = self.database.fetch_points()
Expand Down
2 changes: 1 addition & 1 deletion not1mm/plugins/cq_ww_cw.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

from PyQt6 import QtWidgets

from not1mm.lib.plugin_common import gen_adif, get_points
from not1mm.lib.plugin_common import gen_adif, get_points, online_score
from not1mm.lib.version import __version__
from not1mm.lib.ham_utility import get_logged_band

Expand Down

0 comments on commit 2f7af15

Please sign in to comment.