[mod] added parsing of period in phg

This commit is contained in:
stf 2021-04-04 19:20:50 +00:00
parent 2f97b2447a
commit 7d556cd162
1 changed files with 11 additions and 5 deletions

View File

@ -178,11 +178,17 @@ def parse_phg(body):
else:
direction = int(body[3]) * 45
trange = sqrt(2*haat*sqrt((power/10)*(10**(gain/10))/2))
return {"power": "%sW" % power,
"haat": "%.3fm" % (haat * 0.3048),
"gain": "%sdb" % gain,
"dir": direction,
"range": "%.3fkm" % (trange * 1.609)}
res = {"power": "%sW" % power,
"haat": "%.3fm" % (haat * 0.3048),
"gain": "%sdb" % gain,
"dir": direction,
"range": "%.3fkm" % (trange * 1.609)}
if len(body)>4:
if (body[4].isalpha() and body[4].isupper()):
res['period']=ord(body[4]) - 55
elif body[4].isdigit():
res['period']=ord(body[4]) - 48
return res
def parse_comment_altitude(body):
parsed = {}