Added option to ignore indirect APRS reports.

This commit is contained in:
Marat Fayzullin 2023-04-22 16:30:19 -04:00
parent 04334149b8
commit 8b9e3138ad
6 changed files with 15 additions and 4 deletions

View File

@ -1,6 +1,7 @@
**1.2.12**
- Added FAX decoder, tested on weather fax transmissions.
- Added FAX background decoding service (not tested).
- Added option to ignore indirect APRS reports.
- Fixed a minor JavaScript error on startup.
- Optimized SSTV decoder code.

1
debian/changelog vendored
View File

@ -2,6 +2,7 @@ openwebrx (1.2.12) bullseye jammy; urgency=low
* Added FAX decoder, tested on weather fax transmissions.
* Added FAX background decoding service (not tested).
* Added option to ignore indirect APRS reports.
* Fixed a minor JavaScript error on startup.
* Optimized SSTV decoder code.

View File

@ -162,6 +162,7 @@ defaultConfig = PropertyLayer(
google_maps_api_key="",
map_position_retention_time=2 * 60 * 60,
map_prefer_recent_reports=True,
map_ignore_indirect_reports=False,
callsign_url="https://www.qrzcq.com/call/{}",
vessel_url="https://www.vesselfinder.com/vessels/details/{}",
usage_policy_url="policy",

View File

@ -459,6 +459,7 @@ class MapConnection(OpenWebRxClient):
"google_maps_api_key",
"receiver_gps",
"map_position_retention_time",
"map_ignore_indirect_reports",
"map_prefer_recent_reports",
"callsign_url",
"vessel_url",

View File

@ -200,6 +200,10 @@ class GeneralSettingsController(SettingsFormController):
infotext="Specifies how log markers / grids will remain visible on the map",
append="s",
),
CheckboxInput(
"map_ignore_indirect_reports",
"Ignore position reports arriving via indirect path",
),
CheckboxInput(
"map_prefer_recent_reports",
"Prefer more recent position reports to shorter path reports",

View File

@ -80,15 +80,18 @@ class Map(object):
def updateLocation(self, callsign, loc: Location, mode: str, band: Band = None, hops: list[str] = []):
pm = Config.get()
ignoreIndirect = pm["map_ignore_indirect_reports"]
preferRecent = pm["map_prefer_recent_reports"]
needBroadcast = False
ts = datetime.now()
with self.positionsLock:
# prefer messages with shorter hop count unless preferRecent set
if preferRecent or callsign not in self.positions or len(hops) <= len(self.positions[callsign]["hops"]):
self.positions[callsign] = {"location": loc, "updated": ts, "mode": mode, "band": band, "hops": hops }
needBroadcast = True
# ignore indirect reports if ignoreIndirect set
if not ignoreIndirect or len(hops)==0:
# prefer messages with shorter hop count unless preferRecent set
if preferRecent or callsign not in self.positions or len(hops) <= len(self.positions[callsign]["hops"]):
self.positions[callsign] = {"location": loc, "updated": ts, "mode": mode, "band": band, "hops": hops }
needBroadcast = True
if needBroadcast:
self.broadcast(