[aprs,tools] bugfix, make it work

main-solar-only
Richard Meadows 2016-05-07 11:47:54 +01:00
rodzic 0bd01e5c6b
commit 00bdda7e2d
3 zmienionych plików z 12 dodań i 10 usunięć

Wyświetl plik

@ -72,7 +72,7 @@ def extract_and_upload(packet, aprs_call, ssid):
if datum: # valid backlog
print
print Fore.CYAN + "Extracted valid backlog from {}-{}:".format(aprs_call, ssid)
print_datum(datum)
print_datum(datum, tf)
print Fore.RESET
# Habitat upload

Wyświetl plik

@ -6,7 +6,9 @@ else will be ignored.
"""
import re
import arrow
from datetime import datetime
from datetime import timedelta
from telemetry_format import *
from math import log, exp
@ -30,17 +32,17 @@ def extract_time(line):
if match == None:
return None
else:
# Get a datetime object
dt = datetime.strptime(match.group(1), '%d%H%M')
now = datetime.now()
# Get a arrow
arw = arrow.get(match.group(1), 'DDHHmm')
utcnow = arrow.utcnow()
if dt.day > now.day: # from last month
now = now - timedelta(months = 1)
# Set dt year/month from current utc
arw = arw.replace(year=utcnow.year, month=utcnow.month)
# fill in month and year
dt = dt.replace(year=now.year, month=now.month)
if arw.day > utcnow.day: # from last month
arw = arw.replace(months=-1)
return dt
return arw
"""
Takes a parsed telemetry line and returns latitude, longitude and

Wyświetl plik

@ -5,7 +5,7 @@
class telemetry_format_ssid:
def __init__(self, ssid):
if ssid is '11':
if ssid == '11':
self.flight_nr = 15
else:
raise ValueError("Telemetry format does not know about this ssid!")