mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
DX Cluster support
This commit is contained in:
14
data/spot.py
14
data/spot.py
@@ -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?
|
||||
Reference in New Issue
Block a user