kopia lustrzana https://github.com/projecthorus/radiosonde_auto_rx
Merge pull request #776 from darksidelemm/testing
Landing notification tweaks, allow localhost APRSpull/785/head^2
commit
0b6e74f22a
|
@ -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.
|
||||
# PATCH - Small changes, or minor feature additions.
|
||||
|
||||
__version__ = "1.6.2-beta2"
|
||||
__version__ = "1.6.2-beta3"
|
||||
|
||||
|
||||
# Global Variables
|
||||
|
|
|
@ -683,7 +683,7 @@ def read_auto_rx_config(filename, no_sdr_test=False):
|
|||
# that this goes against the wishes of the radiosonde_auto_rx developers to not be part
|
||||
# of the bigger problem of APRS-IS congestion.
|
||||
|
||||
ALLOWED_APRS_SERVERS = ["radiosondy.info"]
|
||||
ALLOWED_APRS_SERVERS = ["radiosondy.info", "localhost"]
|
||||
ALLOWED_APRS_PORTS = [14590]
|
||||
|
||||
if auto_rx_config["aprs_server"] not in ALLOWED_APRS_SERVERS:
|
||||
|
|
|
@ -121,6 +121,7 @@ class EmailNotification(object):
|
|||
self.sondes[_id] = {
|
||||
"last_time": time.time(),
|
||||
"descending_trip": 0,
|
||||
"ascent_trip": False,
|
||||
"descent_notified": False,
|
||||
"track": GenericTrack(max_elements=20),
|
||||
}
|
||||
|
@ -224,14 +225,21 @@ class EmailNotification(object):
|
|||
# We have seen this sonde recently. Let's check it's descending...
|
||||
|
||||
if self.sondes[_id]["descent_notified"] == False and _sonde_state:
|
||||
|
||||
# Set a flag if the sonde has passed above the landing altitude threshold.
|
||||
# This is used along with the descending trip to trigger a landing email notification.
|
||||
if (telemetry["alt"] > self.landing_altitude_threshold):
|
||||
self.sondes[_id]["ascent_trip"] = True
|
||||
|
||||
# If the sonde is below our threshold altitude, *and* is descending at a reasonable rate, increment.
|
||||
if (telemetry["alt"] < self.landing_altitude_threshold) and (
|
||||
_sonde_state["ascent_rate"] < -2.0
|
||||
):
|
||||
self.sondes[_id]["descending_trip"] += 1
|
||||
|
||||
if self.sondes[_id]["descending_trip"] > self.landing_descent_trip:
|
||||
# We've seen this sonde descending for enough time now.
|
||||
if (self.sondes[_id]["descending_trip"] > self.landing_descent_trip) and self.sondes[_id]["ascent_trip"]:
|
||||
# We've seen this sonde descending for enough time now AND we have also seen it go above the landing threshold,
|
||||
# so it's likely been on a flight and isnt just bouncing around on the ground.
|
||||
# Note that we've passed the descent threshold, so we shouldn't analyze anything from this sonde anymore.
|
||||
self.sondes[_id]["descent_notified"] = True
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue