Icon lookup for SIGs in preparation for #47. Improved ZLOTA spotter lookup.

This commit is contained in:
Ian Renton
2025-10-20 10:33:18 +01:00
parent ae72649df8
commit a21782cb62
18 changed files with 89 additions and 60 deletions

View File

@@ -1,15 +1,31 @@
from core.config import SERVER_OWNER_CALLSIGN
from data.band import Band
from data.sig import SIG
# General software
SOFTWARE_NAME = "Spothole by M0TRT"
SOFTWARE_VERSION = "0.1"
# HTTP headers used for spot providers that use HTTP
HTTP_HEADERS = {"User-Agent": SOFTWARE_NAME + " " + SOFTWARE_VERSION + " (operated by " + SERVER_OWNER_CALLSIGN + ")"}
HTTP_HEADERS = {"User-Agent": SOFTWARE_NAME + ", v" + SOFTWARE_VERSION + " (operated by " + SERVER_OWNER_CALLSIGN + ")"}
# Special Interest Groups
SIGS = ["POTA", "SOTA", "WWFF", "GMA", "WWBOTA", "HEMA", "MOTA", "ARLHS", "ILLW", "SiOTA", "WCA", "ZLOTA", "IOTA", "KRMNPA"]
SIGS = [
SIG(name="POTA", description="Parks on the Air", icon="tree"),
SIG(name="SOTA", description="Summits on the Air", icon="mountain-sun"),
SIG(name="WWFF", description="World Wide Flora & Fauna", icon="seedling"),
SIG(name="GMA", description="Global Mountain Activity", icon="person-hiking"),
SIG(name="WWBOTA", description="Worldwide Bunkers on the Air", icon="radiation"),
SIG(name="HEMA", description="HuMPs Excluding Marilyns Award", icon="mound"),
SIG(name="IOTA", description="Islands on the Air", icon="umbrella-beach"),
SIG(name="MOTA", description="Mills on the Air", icon="fan"),
SIG(name="ARLHS", description="Amateur Radio Lighthouse Society", icon="tower-observation"),
SIG(name="ILLW", description="International Lighthouse & Lightship Weekend", icon="tower-observation"),
SIG(name="SiOTA", description="Silos on the Air", icon="wheat-awn"),
SIG(name="WCA", description="World Castles Award", icon="chess-rook"),
SIG(name="ZLOTA", description="New Zealand on the Air", icon="kiwi-bird"),
SIG(name="KRMNPA", description="Keith Roget Memorial National Parks Award", icon="earth-oceania")
]
# Modes. Note "DIGI" and "DIGITAL" are also supported but are normalised into "DATA".
CW_MODES = ["CW"]

View File

@@ -0,0 +1,8 @@
from core.constants import SIGS
# Utility function to get the icon for a named SIG. If no match is found, the "circle-question" icon will be returned.
def get_icon_for_sig(sig):
for s in SIGS:
if s.name == sig:
return s.icon
return "circle-question"