parent
bd8f311f0c
commit
8d79171bf4
@ -1,20 +1,44 @@
|
|||||||
import sys
|
import sys
|
||||||
from os import system
|
from os import system
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
change_mode = False
|
||||||
|
if (len(sys.argv)) > 1:
|
||||||
|
# print("There are arguments!")
|
||||||
|
if (('d' == sys.argv[1]):
|
||||||
|
debug_mode = 1
|
||||||
|
try:
|
||||||
for line in sys.stdin:
|
for line in sys.stdin:
|
||||||
if '^c' == line.rstrip():
|
if (debug_mode):
|
||||||
break
|
print(line)
|
||||||
# print(line)
|
|
||||||
|
# if '^c' == line.rstrip():
|
||||||
|
# break
|
||||||
|
|
||||||
if (line.find("MODE=a")) > 0:
|
if (line.find("MODE=a")) > 0:
|
||||||
system("echo 'APRS Mode!!'")
|
system("echo 'APRS Mode!!'")
|
||||||
mode = 'a'
|
mode = 'a'
|
||||||
change_mode = True
|
change_mode = True
|
||||||
if (line.find("MODE=f")) > 0:
|
if (line.find("MODE=f")) > 0:
|
||||||
system("echo 'FSK Mode!!'")
|
system("echo 'FSK Mode!!'")
|
||||||
|
mode = 'f'
|
||||||
|
change_mode = True
|
||||||
if (line.find("MODE=b")) > 0:
|
if (line.find("MODE=b")) > 0:
|
||||||
system("echo 'BPSK Mode!!'")
|
system("echo 'BPSK Mode!!'")
|
||||||
|
mode = 'b'
|
||||||
|
change_mode = True
|
||||||
if (line.find("MODE=s")) > 0:
|
if (line.find("MODE=s")) > 0:
|
||||||
system("echo 'SSTV Mode!!'")
|
system("echo 'SSTV Mode!!'")
|
||||||
|
mode = 's'
|
||||||
|
change_mode = True
|
||||||
if (line.find("MODE=m")) > 0:
|
if (line.find("MODE=m")) > 0:
|
||||||
system("echo 'CW Mode!!'")
|
system("echo 'CW Mode!!'")
|
||||||
|
mode = 'm'
|
||||||
|
change_mode = True
|
||||||
|
if (debug_mode == True) and (change_mode == True):
|
||||||
|
print("/home/pi/CubeSatSim/config -" + mode)
|
||||||
|
system("/home/pi/CubeSatSim/config -" + mode)
|
||||||
|
change_mode = False
|
||||||
|
except:
|
||||||
print("Done")
|
print("Done")
|
||||||
|
|||||||
Loading…
Reference in new issue