Log transmitter modes in cache for easy identification

merge-requests/26/head
Cees Bassa 2019-06-25 12:55:16 +02:00
parent a7f477db9b
commit 9b6135f8b0
2 changed files with 5 additions and 3 deletions

View File

@ -211,9 +211,9 @@ def main():
continue
fp.write(
"%05d %s %d %d %d\n" %
"%05d %s %d %d %d %s\n" %
(transmitters[uuid]["norad_cat_id"], uuid, transmitter["stats"]["success_rate"],
transmitter["stats"]["good_count"], transmitter["stats"]["total_count"]))
transmitter["stats"]["good_count"], transmitter["stats"]["total_count"], transmitters[uuid]["mode"]))
logging.info("Transmitter success rates received!")
fp.close()

View File

@ -38,6 +38,8 @@ def read_priorities_transmitters(filename):
sattrans = {}
lines = fp.readlines()
for line in lines:
if line[0]=="#":
continue
parts = line.strip().split(" ")
sat = parts[0]
prio = parts[1]
@ -75,7 +77,7 @@ def get_active_transmitter_info(fmin, fmax):
for o in r.json():
if o["downlink_low"]:
if o["status"] == "active" and o["downlink_low"] > fmin and o["downlink_low"] <= fmax:
transmitter = {"norad_cat_id": o["norad_cat_id"], "uuid": o["uuid"]}
transmitter = {"norad_cat_id": o["norad_cat_id"], "uuid": o["uuid"], "mode": o["mode"]}
transmitters.append(transmitter)
logging.info("Transmitters filtered based on ground station capability.")
return transmitters