Skip to content

Commit

Permalink
Added Verbose mode
Browse files Browse the repository at this point in the history
  • Loading branch information
platini2 authored Feb 3, 2021
1 parent 01670a5 commit 1c3109b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions celestron.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__copyright__ = "Copyright 2020, Patricio Latini"
__credits__ = "Patricio Latini"
__license__ = "GPL"
__version__ = "0.6.8"
__version__ = "0.6.9"
__maintainer__ = "Patricio Latini"
__email__ = "[email protected]"
__status__ = "Production"
Expand All @@ -28,6 +28,8 @@
emulategps = False
global mount
mount = ''
global verbose
verbose = False

scannerid = 0x22
preamble = 0x3b
Expand Down Expand Up @@ -213,7 +215,11 @@ def decodemsg (msg):
receivertext = devices[receiver]
else:
receivertext = 'UNKNOWN'
output = str(round(time.time()-starttime,6)) + " - " + sendertext + " (" + str(hex(sender)) + ") " + "-> " + receivertext + " (" + str(hex(receiver)) + ") " + "--- " + commandtext + " (" + str(hex(command)) + ") " + "--- " + str(commandvalue)
if verbose:
dumptext = ' --- ' + str(msg)
else:
dumptext = ''
output = str(round(time.time()-starttime,6)) + " - " + sendertext + " (" + str(hex(sender)) + ") " + "-> " + receivertext + " (" + str(hex(receiver)) + ") " + "--- " + commandtext + " (" + str(hex(command)) + ") " + "--- " + str(commandvalue) + dumptext
print (output)
if emulategps:
global gpslat,gpslon
Expand Down Expand Up @@ -335,7 +341,8 @@ def printhelpmenu():
print ("c) send Command to device")
print ("k) toggle Keepalive send")
print ("s) reScan AUXBUS ")
print ("a) rescan AUXBUS for All")
print ("a) rescan AUXBUS for All")
print ("v) toggle Verbose output")
print ("g) toggle GPS simulator")
print ("r) Reset Packet Timer ")
print ("h) print this Help menu")
Expand Down Expand Up @@ -467,6 +474,7 @@ def execute_code(connmodearg, port):
global mount
global starttime
global endthread
global verbose

connmode = connmodearg

Expand Down Expand Up @@ -542,6 +550,8 @@ def execute_code(connmodearg, port):
scanauxbus('all')
if inputkey == "i":
identifymount()
if inputkey == "v":
verbose = not verbose
if inputkey == "r":
starttime=time.time()
if inputkey == "h":
Expand Down

0 comments on commit 1c3109b

Please sign in to comment.