Skip to content

Commit

Permalink
Some work toward #7. Instead of example settings, having a script to …
Browse files Browse the repository at this point in the history
…configure things.
  • Loading branch information
nmrossomando committed Mar 21, 2018
1 parent 8e8da12 commit 37ab82a
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DataStructures/GroundTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ void BPP::GroundTrack::printPacket() {
if(timeToImpact != -5) {
jsonOut.addValue("time_to_sea_level", timeToImpact);
}
jsonOut.addValue("comment", packetData.comment);
jsonOut.addValue("comment", packetData.comment);
}

// Finally, update KML file with newest packet.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Link Telemetry

Copyright (c) 2015-2017 University of Maryland Space Systems Lab
Copyright (c) 2015-2018 University of Maryland Space Systems Lab
NearSpace Balloon Payload Program

Link Telemetry is licensed under the terms of the MIT License:
Expand Down
53 changes: 53 additions & 0 deletions Link-TLM-Configurator
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python3
#
# Copyright (c) 2015-2018 University of Maryland Space Systems Lab
# NearSpace Balloon Payload Program
#
# Licensed under the MIT license. See LICENSE file for details.
#
# Here's a little app to do settings configuration for Link-TLM.
# I highly recommend using this instead of manually editing the JSON file.
# This should prevent any malformed JSON issues, and ensure everything is copacetic.
#
# Usage: It's a GUI app. Just do ./Link-TLM-Configurator.
#
# 2018-03-20 Nick Rossomando
#

import json

class Settings:
def __init__(self):
# Init settings to on board, use on board, keep on board defaults.
self.balloonCallsigns = ["W3EAX-9"]
self.vanCallsigns = 0
self.unparsedLogFilename = "Logs/unparsedPackets.txt"
self.parsedLogFilename = "Logs/parsedPackets.txt"
self.jsonLogFilename = "Logs/jsonOutput.json"
self.kmlLogFilename = "Logs/kmlOutput.kml"

def write_settings(self):
setDict = {}
setDict["balloonCallsigns"] = self.balloonCallsigns
setDict["vanCallsigns"] = self.vanCallsigns
setDict["unparsedLogFilename"] = self.unparsedLogFilename
setDict["parsedLogFilename"] = self.parsedLogFilename
setDict["jsonLogFilename"] = self.jsonLogFilename
setDict["kmlLogFilename"] = self.kmlLogFilename

with open("Prefs/settings.json","w") as f:
f.write(json.dumps(setDict, indent=4))
f.write('\n\n')

def load_settings(self):
with open("Prefs/settings.json","r") as f:
setDict = json.load(f)


def main():
print("Do stuff here.")
test = Settings()
test.load_settings()

if __name__ == "__main__":
main()

0 comments on commit 37ab82a

Please sign in to comment.