Merge remote-tracking branch 'origin/develop' into kranz/master

This commit is contained in:
2022-05-23 16:44:11 +02:00
5 changed files with 160 additions and 27 deletions

View File

@ -1,10 +1,11 @@
from ast import Pass
from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.config import QueueCommands
from .common import command_mode
import config.object_ids as obj_ids
from pus_tc.prompt_parameters import prompt_parameters
class OpCodes:
THERMAL_CONTROLLER = [obj_ids.THERMAL_CONTROLLER_ID.hex(), "thermal_controller"]
@ -17,12 +18,13 @@ class Info:
def pack_controller_commands(tc_queue: TcQueueT, op_code: str):
mode = int(input("Specify mode: (OFF = 0; ON = 1; NORMAL = 2) [2] ") or "2")
print(mode)
parameters = prompt_parameters([{"name": "Mode", "defaultValue": "2"}, {
"name": "Submode", "defaultValue": "0"}])
mode = int(parameters["Mode"])
if mode < 0 or mode > 2:
print("Invalid Mode, defaulting to OFF")
mode = 0
submode = int(input("Specify submode [0]: ") or "0")
submode = int(parameters["Submode"])
command_mode(
object_id=get_object_from_op_code(op_code),
mode=mode,
@ -31,6 +33,16 @@ def pack_controller_commands(tc_queue: TcQueueT, op_code: str):
info=op_code + " to " + str(mode) + "," + str(submode),
)
tc_queue.appendleft((QueueCommands.WAIT, 20))
command_mode(
object_id=get_object_from_op_code(op_code),
mode=0,
submode=0,
tc_queue=tc_queue,
info=op_code + " to 0,0",
)
def get_object_from_op_code(op_code: str):
try: