[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 if datum: # valid backlog
print print
print Fore.CYAN + "Extracted valid backlog from {}-{}:".format(aprs_call, ssid) print Fore.CYAN + "Extracted valid backlog from {}-{}:".format(aprs_call, ssid)
print_datum(datum) print_datum(datum, tf)
print Fore.RESET print Fore.RESET
# Habitat upload # Habitat upload

Wyświetl plik

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

Wyświetl plik

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