kopia lustrzana https://github.com/bristol-seds/pico-tracker
[aprs,tools] bugfix, make it work
rodzic
0bd01e5c6b
commit
00bdda7e2d
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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!")
|
||||
|
|
Ładowanie…
Reference in New Issue