apply black

This commit is contained in:
Robin Müller 2022-05-24 17:24:09 +02:00
parent 83115d43af
commit 9c5d16fb7c
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 58 additions and 15 deletions

View File

@ -324,6 +324,7 @@ def add_bpx_cmd_definitions(cmd_dict: ServiceOpCodeDictT):
def add_pl_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
from pus_tc.devs.plpcdu import OpCodes, Info
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict, keys=OpCodes.SWITCH_ON, info=Info.SWITCH_ON

View File

@ -133,7 +133,9 @@ def pack_core_commands(tc_queue: TcQueueT, op_code: str):
)
if op_code in OpCodes.REBOOT_FULL:
tc_queue.appendleft((QueueCommands.PRINT, f"Core Command: {Info.REBOOT_FULL}"))
cmd = generate_action_command(object_id=CORE_CONTROLLER_ID, action_id=ActionIds.FULL_REBOOT)
cmd = generate_action_command(
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.FULL_REBOOT
)
tc_queue.appendleft(cmd.pack_command_tuple())
if op_code in OpCodes.XSC_REBOOT_SELF:
perform_reboot_cmd(tc_queue=tc_queue, reboot_self=True)

View File

@ -70,7 +70,7 @@ PROC_INFO_DICT = {
KAI.ACS_FT[0]: [OpCodes.ACS_FT, KAI.ACS_FT[1], 120.0, 10.0],
KAI.MGT_FT[0]: [OpCodes.MGT_FT, KAI.MGT_FT[1], 120.0, 10.0],
KAI.MGT_FT_DP[0]: [OpCodes.MGT_FT_DP, KAI.MGT_FT_DP[1], 120.0, 10.0],
# collection_time for KAI.MGT_FT_DP maybe be reduced as a full 120seconds is not needed after MGTs are tested
# collection_time for KAI.MGT_FT_DP maybe be reduced as a full 120seconds is not needed after MGTs are tested
}
@ -81,7 +81,11 @@ def generic_print(tc_queue: TcQueueT, info: dict):
def pack_generic_hk_listening_cmds(
tc_queue: TcQueueT, proc_key: str, sid_list: list[bytearray], diag: bool, mgt: bool,
tc_queue: TcQueueT,
proc_key: str,
sid_list: list[bytearray],
diag: bool,
mgt: bool,
):
info = PROC_INFO_DICT[proc_key]
collection_time = info[2]
@ -155,12 +159,12 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
)
if op_code in OpCodes.TCS_FT_ON:
# check whether tcs_assembly also has to be commanded to NORMAL Mode
# check whether tcs_assembly also has to be commanded to NORMAL Mode
# pack_tcs_sys_commands(tc_queue=tc_queue, op_code="tcs-normal")
pack_controller_commands(tc_queue=tc_queue, op_code="thermal_controller")
if op_code in OpCodes.TCS_FT_OFF:
# check whether tcs_assembly also has to be commanded to OFF Mode
# check whether tcs_assembly also has to be commanded to OFF Mode
# pack_tcs_sys_commands(tc_queue=tc_queue, op_code="tcs-off")
pack_controller_commands(tc_queue=tc_queue, op_code="thermal_controller")
@ -227,8 +231,8 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
if op_code in OpCodes.MGT_FT:
key = KAI.MGT_FT[0]
# missing imtq to ON
# mgt 1: imtq und hk
# missing imtq to ON
# mgt 1: imtq und hk
# MISSING: imtq board activation to ON (implementation pending by Jakob)
@ -241,8 +245,8 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
# MISSING: imtq board deactivation to OFF (implementation pending by Jakob)
# missing imtq to ON
# mgt 2.: imtq + dual side + dipole
# missing imtq to ON
# mgt 2.: imtq + dual side + dipole
if op_code in OpCodes.MGT_FT_DP:
key = KAI.MGT_FT_DP[0]
@ -320,26 +324,62 @@ def activate_mgts_alternately(
tc_queue: TcQueueT,
):
command = pack_dipole_command(object_id=oids.IMTQ_HANDLER_ID, x_dipole=2000, y_dipole=0, z_dipole=0, duration=30000)
command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID,
x_dipole=2000,
y_dipole=0,
z_dipole=0,
duration=30000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0))
command = pack_dipole_command(object_id=oids.IMTQ_HANDLER_ID, x_dipole=-2000, y_dipole=0, z_dipole=0, duration=30000)
command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID,
x_dipole=-2000,
y_dipole=0,
z_dipole=0,
duration=30000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0))
command = pack_dipole_command(object_id=oids.IMTQ_HANDLER_ID, x_dipole=0, y_dipole=2000, z_dipole=0, duration=30000)
command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID,
x_dipole=0,
y_dipole=2000,
z_dipole=0,
duration=30000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0))
command = pack_dipole_command(object_id=oids.IMTQ_HANDLER_ID, x_dipole=0, y_dipole=-2000, z_dipole=0, duration=30000)
command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID,
x_dipole=0,
y_dipole=-2000,
z_dipole=0,
duration=30000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0))
command = pack_dipole_command(object_id=oids.IMTQ_HANDLER_ID, x_dipole=0, y_dipole=0, z_dipole=2000, duration=30000)
command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID,
x_dipole=0,
y_dipole=0,
z_dipole=2000,
duration=30000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0))
command = pack_dipole_command(object_id=oids.IMTQ_HANDLER_ID, x_dipole=0, y_dipole=0, z_dipole=-2000, duration=30000)
command = pack_dipole_command(
object_id=oids.IMTQ_HANDLER_ID,
x_dipole=0,
y_dipole=0,
z_dipole=-2000,
duration=30000,
)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.WAIT, 10.0))