|
|
|
|
@ -38,6 +38,22 @@ if __name__ == "__main__":
|
|
|
|
|
mode = 'm'
|
|
|
|
|
change_mode = True
|
|
|
|
|
if (debug_mode == False) and (change_mode == True):
|
|
|
|
|
try:
|
|
|
|
|
file = open("/home/pi/CubeSatSim/command_count.txt", "r")
|
|
|
|
|
string = file.read()
|
|
|
|
|
file.close()
|
|
|
|
|
command_count = int(string)
|
|
|
|
|
command_count += 1
|
|
|
|
|
filec = open("/home/pi/CubeSatSim/command_count.txt", "w")
|
|
|
|
|
command_count_string = str(command_count)
|
|
|
|
|
print(command_count_string)
|
|
|
|
|
string = filec.write(command_count_string)
|
|
|
|
|
filec.close()
|
|
|
|
|
except:
|
|
|
|
|
print("Can't write command_count file!")
|
|
|
|
|
print("Command_count: ")
|
|
|
|
|
print(command_count)
|
|
|
|
|
|
|
|
|
|
print("\n/home/pi/CubeSatSim/config -" + mode)
|
|
|
|
|
system("/home/pi/CubeSatSim/config -" + mode)
|
|
|
|
|
change_mode = False
|
|
|
|
|
|