Support RSGB contests

This commit is contained in:
Ian Renton
2026-09-05 09:00:32 +01:00
parent d3d1d20821
commit d6e53c14e9
32 changed files with 256 additions and 98 deletions
+5 -3
View File
@@ -7,7 +7,7 @@ from datetime import datetime, timedelta
import pytz
from core.call_lookup_helper import get_call_info
from core.enums import Continent
from core.enums import AlertType, Continent
from core.sig_lookup_helper import populate_missing_sig_ref_info
from core.utils import get_flag_for_dxcc
@@ -58,8 +58,10 @@ class Alert:
sig: str | None = None
# SIG references. We allow multiple here for e.g. n-fer activations, unlike ADIF SIG_INFO
sig_refs: list | None = None
# Whether this alert is for a DXpedition, as opposed to e.g. an xOTA programme.
is_dxpedition: bool = False
# The type of alert this is: xOTA, DXpedition, or Contest.
alert_type: AlertType | None = None
# A URL link to more information, if any
url: str | None = None
# Where we got the alert from, e.g. "POTA", "SOTA"...
source: str | None = None
# The ID the source gave it, if any.
+1 -1
View File
@@ -15,7 +15,7 @@ class SIGRef:
# Name of the reference, e.g. "Null Country Park", if known.
name: str | None = None
# Type of the reference, e.g. "Park", if known.
ref_type: SIGRefType = SIGRefType.UNKNOWN
ref_type: SIGRefType | None = None
# URL to look up more information about the reference, if known.
url: str | None = None
# Latitude of the reference, in degrees, if known.
+6 -10
View File
@@ -103,9 +103,9 @@ class Spot:
# General QSO info
# Reported mode, such as SSB, PHONE, CW, FT8...
mode: Mode = Mode.UNKNOWN
mode: Mode | None = None
# Inferred mode "family".
mode_type: ModeType = ModeType.UNKNOWN
mode_type: ModeType | None = None
# Source of the mode information.
mode_source: ModeSource = ModeSource.NONE
# Frequency, in Hz
@@ -239,21 +239,17 @@ class Spot:
self.band = band.name
# Mode from comments or bandplan
if not self.mode:
self.mode = Mode.UNKNOWN
if self.mode != Mode.UNKNOWN:
if self.mode:
self.mode_source = ModeSource.SPOT
if self.comment and self.mode == Mode.UNKNOWN:
if self.comment and not self.mode:
self.mode = infer_mode_from_comment(self.comment)
self.mode_source = ModeSource.COMMENT
if self.freq and self.mode == Mode.UNKNOWN:
if self.freq and not self.mode:
self.mode = infer_mode_from_frequency(self.freq)
self.mode_source = ModeSource.BANDPLAN
# Mode type from mode
if not self.mode_type:
self.mode_type = ModeType.UNKNOWN
if self.mode != Mode.UNKNOWN and self.mode_type == ModeType.UNKNOWN:
if self.mode and not self.mode_type:
self.mode_type = infer_mode_type_from_mode(self.mode)
# If we have a latitude or grid at this point, it can only have been provided by the spot itself