DX Cluster support

This commit is contained in:
Ian Renton
2025-09-26 23:26:39 +01:00
parent c34821dc9b
commit fd2ffb47a0
6 changed files with 86 additions and 6 deletions

View File

@@ -1,6 +1,8 @@
from dataclasses import dataclass
from datetime import datetime
from pyhamtools.locator import locator_to_latlong, latlong_to_locator
from core.constants import DXCC_FLAGS
from core.utils import infer_mode_family_from_mode, infer_band_from_freq, infer_continent_from_callsign, \
infer_country_from_callsign, infer_cq_zone_from_callsign, infer_itu_zone_from_callsign, infer_dxcc_id_from_callsign
@@ -97,4 +99,14 @@ class Spot:
self.band_contrast_color = band.contrast_color
if self.mode and not self.mode_family:
self.mode_family=infer_mode_family_from_mode(self.mode)
self.mode_family=infer_mode_family_from_mode(self.mode)
if self.grid and not self.latitude:
ll = locator_to_latlong(self.grid)
self.latitude = ll[0]
self.longitude = ll[1]
if self.latitude and self.longitude and not self.grid:
self.grid = latlong_to_locator(self.latitude, self.longitude, 8)
# TODO lat/lon from DXCC centre?