More fixes to telemetry filter

testing
Mark Jessop 2025-10-20 17:13:49 +10:30
rodzic 875eb8b955
commit ca2a5b7e12
2 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -12,7 +12,7 @@ from queue import Queue
# MINOR - New sonde type support, other fairly big changes that may result in telemetry or config file incompatability issus. # MINOR - New sonde type support, other fairly big changes that may result in telemetry or config file incompatability issus.
# PATCH - Small changes, or minor feature additions. # PATCH - Small changes, or minor feature additions.
__version__ = "1.8.2-beta8" __version__ = "1.8.2-beta9"
# Global Variables # Global Variables

Wyświetl plik

@ -1940,12 +1940,12 @@ class SondeDecoder(object):
if self.enable_realtime_filter and (_telemetry["type"].startswith("DFM")): if self.enable_realtime_filter and (_telemetry["type"].startswith("DFM")):
# If sonde has already been received, calculate velocity # If sonde has already been received, calculate velocity
velocity = 0 velocity = 0
if _telemetry["callsign"] in self.last_positions.keys(): if _telemetry['id'] in self.last_positions.keys():
_last_position = self.last_positions[_telemetry["callsign"]] _last_position = self.last_positions[_telemetry['id']]
distance = position_info( distance = position_info(
(_last_position[0], _last_position[1], 0), (_last_position[0], _last_position[1], 0),
(_telemetry["latitude"], _telemetry["longitude"], 0) (_telemetry["lat"], _telemetry["lon"], 0)
)["great_circle_distance"] # distance is in metres )["great_circle_distance"] # distance is in metres
time_diff = time.time() - _last_position[2] # seconds time_diff = time.time() - _last_position[2] # seconds
@ -1957,12 +1957,12 @@ class SondeDecoder(object):
self.log_debug(f"Dropped packet - Velocity ({velocity}) exceeds max ({self.max_velocity}).") self.log_debug(f"Dropped packet - Velocity ({velocity}) exceeds max ({self.max_velocity}).")
# Reset last position to prevent an endless chain of rejecting telemetry # Reset last position to prevent an endless chain of rejecting telemetry
del self.last_positions[_telemetry["callsign"]] del self.last_positions[_telemetry['id']]
else: else:
# Check passed, update last position and continue processing # Check passed, update last position and continue processing
self.last_positions[_telemetry["callsign"]] = ( self.last_positions[_telemetry['id']] = (
_telemetry["latitude"], _telemetry["lat"],
_telemetry["longitude"], _telemetry["lon"],
time.time() time.time()
) )