If message truncated prioritize adjacent zones for retention
This commit is contained in:
parent
c9ffa24a5e
commit
d812e9e73f
|
|
@ -1,5 +1,5 @@
|
|||
Package: noaacap
|
||||
Version: 0.9.2
|
||||
Version: 1.0.0
|
||||
Section: hamradio
|
||||
Priority: extra
|
||||
Maintainer: Dan Srebnick <k2ie at k2ie.net>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
Copyright: 2017-2019 Daniel L. Srebnick <k2ie@k2ie.net>
|
||||
Copyright: 2017-2020 Daniel L. Srebnick <k2ie@k2ie.net>
|
||||
License: BSD-2-clause
|
||||
Files: *
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
[noaacap]
|
||||
myTZ = America/New_York
|
||||
myZone = NJC025
|
||||
myResend = 0
|
||||
myAdj1 = NJC026
|
||||
myAdj2 = NJC027
|
||||
myResend = 30
|
||||
Logging = 0
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
##
|
||||
## See /usr/local/share/noaacap/CHANGELOG for change history
|
||||
##
|
||||
version = "0.9.2"
|
||||
version = "1.0"
|
||||
|
||||
import sys
|
||||
import pytz
|
||||
|
|
@ -27,9 +27,9 @@ log.addHandler(JournalHandler(SYSLOG_IDENTIFIER='noaacap'))
|
|||
|
||||
if len(sys.argv) == 2 and sys.argv[1] == '-v':
|
||||
print("noaacap.py by K2IE, version " + version + "\n")
|
||||
print("A weather alert beacon exec for aprx >= 2.9")
|
||||
print("A weather alert beacon exec for aprx >= 2.9 and Direwolf >= 1.3")
|
||||
print("Licensed under the BSD 2 Clause license")
|
||||
print("Copyright 2017-2019 by Daniel L. Srebnick\n")
|
||||
print("Copyright 2017-2020 by Daniel L. Srebnick\n")
|
||||
sys.exit(0)
|
||||
|
||||
# We need this function early in execution
|
||||
|
|
@ -77,6 +77,16 @@ except:
|
|||
log.error("Check " + conffile + " for proper myZone value in [noaacap] section")
|
||||
ErrExit()
|
||||
|
||||
try:
|
||||
adjZone1 = config.get('noaacap', 'adjZone1')
|
||||
except:
|
||||
adjZone1 = ''
|
||||
|
||||
try:
|
||||
adjZone2 = config.get('noaacap', 'adjZone2')
|
||||
except:
|
||||
adjZone2 = ''
|
||||
|
||||
try:
|
||||
myResend = int(config.get('noaacap', 'myResend'))
|
||||
except:
|
||||
|
|
@ -305,6 +315,10 @@ for i in range(0, count):
|
|||
if not myZone in parsezcs(zcs):
|
||||
zcs = myZone + "-" + zcs
|
||||
message = exputc + "z," + type + "," + zcs
|
||||
if adjZone1 not equal '':
|
||||
zcs = adjZone1 + "-" + zcs
|
||||
if adjZone2 not equal '':
|
||||
zcs = adjZone2 + "-" + zcs
|
||||
|
||||
if n > 0:
|
||||
log.info("Truncated Msg: " + message)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
noaacap changelog
|
||||
##
|
||||
Version: 1.0
|
||||
Release: February 6, 2020
|
||||
Added ability to specify up to 2 adjacent zones
|
||||
##
|
||||
Version: 0.9
|
||||
Release: February 20, 2018
|
||||
Added timeout for non/slow response of NWS servers
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
BSD 2-Clause License
|
||||
|
||||
Copyright (c) 2017-2019, Daniel L. Srebnick
|
||||
Copyright (c) 2017-2020, Daniel L. Srebnick
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
|
|
@ -66,6 +66,10 @@ myResend should be set to 0 for no message resends or to an interval of your
|
|||
choosing. If noaacap beacons every 2 minutes, a value of 30 would provide
|
||||
hourly resends.
|
||||
|
||||
adjZone1 and adjZone2 may be optionally specified. If specified, those zones
|
||||
are guaranteed to be retained in any messages found for myZone that have been
|
||||
truncated because of length.
|
||||
|
||||
Logging values are 0 (quiet), 1 (informational), and 2 (debug). Logs are
|
||||
written to the systemd journal. You may view the logs in realtime using the
|
||||
following command: sudo journalctl -f | grep noaacap.
|
||||
|
|
@ -77,4 +81,4 @@ k2ie@k2ie.net with the callsign-SSID of your APRS station that is sending
|
|||
weather alerts via this program.
|
||||
|
||||
Dan Srebnick, K2IE
|
||||
09/23/19
|
||||
02/06/2020
|
||||
|
|
|
|||
Loading…
Reference in New Issue