cleaned new addition

This commit is contained in:
Markus Kranz 2022-05-24 15:26:08 +02:00
parent 4b762328c5
commit 095cf822ee

View File

@ -77,9 +77,10 @@ def generic_print(tc_queue: TcQueueT, info: dict):
def pack_generic_hk_listening_cmds( def pack_generic_hk_listening_cmds(
tc_queue: TcQueueT, proc_key: str, sid_list: bytes, diag: bool tc_queue: TcQueueT, proc_key: str, sid_list: list[bytearray], diag: bool
): ):
info = PROC_INFO_DICT[proc_key] info = PROC_INFO_DICT[proc_key]
collection_time = info[2]
generic_print(tc_queue=tc_queue, info=info) generic_print(tc_queue=tc_queue, info=info)
for sid in sid_list: for sid in sid_list:
@ -91,6 +92,18 @@ def pack_generic_hk_listening_cmds(
interval_seconds=info[3], interval_seconds=info[3],
) )
tc_queue.appendleft((QueueCommands.WAIT, collection_time))
for sid in sid_list:
disable_listen_to_hk_for_x_seconds(
diag=diag,
tc_queue=tc_queue,
device=proc_key,
sid=sid,
)
sid_list.clear()
""" OLD """ OLD
listen_to_hk_for_x_seconds( listen_to_hk_for_x_seconds(
@ -103,63 +116,42 @@ def pack_generic_hk_listening_cmds(
) )
""" """
def pack_proc_commands(tc_queue: TcQueueT, op_code: str): def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
sid_list = [] sid_list = []
if op_code in OpCodes.BAT_FT: if op_code in OpCodes.BAT_FT:
key = KAI.BAT_FT[0] key = KAI.BAT_FT[0]
sid = make_sid(oids.BPX_HANDLER_ID, BpxSetIds.GET_HK_SET) sid_list.append(make_sid(oids.BPX_HANDLER_ID, BpxSetIds.GET_HK_SET))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False
) )
if op_code in OpCodes.CORE_FT: if op_code in OpCodes.CORE_FT:
key = KAI.CORE_FT[0] key = KAI.CORE_FT[0]
sid_list += make_sid(oids.CORE_CONTROLLER_ID, CoreSetIds.HK) sid_list.append(make_sid(oids.CORE_CONTROLLER_ID, CoreSetIds.HK))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False
) )
if op_code in OpCodes.PCDU_FT: if op_code in OpCodes.PCDU_FT:
key = KAI.PCDU_FT[0] key = KAI.PCDU_FT[0]
sid_list.append(make_sid(oids.P60_DOCK_HANDLER, GsSetIds.P60_CORE))
sid = make_sid(oids.P60_DOCK_HANDLER, GsSetIds.P60_CORE) sid_list.append(make_sid(oids.PDU_1_HANDLER_ID, GsSetIds.PDU_1_CORE))
sid_list.append(make_sid(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_CORE))
sid_list.append(make_sid(oids.ACU_HANDLER_ID, GsSetIds.ACU_CORE))
sid_list.append(make_sid(oids.P60_DOCK_HANDLER, GsSetIds.P60_AUX))
sid_list.append(make_sid(oids.PDU_1_HANDLER_ID, GsSetIds.PDU_1_AUX))
sid_list.append(make_sid(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_AUX))
sid_list.append(make_sid(oids.ACU_HANDLER_ID, GsSetIds.ACU_AUX))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False
)
sid = make_sid(oids.PDU_1_HANDLER_ID, GsSetIds.PDU_1_CORE)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_CORE)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.ACU_HANDLER_ID, GsSetIds.ACU_CORE)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.P60_DOCK_HANDLER, GsSetIds.P60_AUX)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.PDU_1_HANDLER_ID, GsSetIds.PDU_1_AUX)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_AUX)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.ACU_HANDLER_ID, GsSetIds.ACU_AUX)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
) )
if op_code in OpCodes.RAD_SEN_FT: if op_code in OpCodes.RAD_SEN_FT:
key = KAI.RAD_SEN_FT[0] key = KAI.RAD_SEN_FT[0]
sid = make_sid(oids.RAD_SENSOR_ID, RadSetIds.RAD_SEN_CORE) sid_list.append(make_sid(oids.RAD_SENSOR_ID, RadSetIds.RAD_SEN_CORE))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False
) )
if op_code in OpCodes.TCS_FT_ON: if op_code in OpCodes.TCS_FT_ON:
@ -176,31 +168,16 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
pack_acs_command(tc_queue=tc_queue, op_code="acs-a") pack_acs_command(tc_queue=tc_queue, op_code="acs-a")
# MGMs # MGMs
sid = make_sid(oids.MGM_0_LIS3_HANDLER_ID, MgmSetIds_0_2.CORE_HK) sid_list.append(make_sid(oids.MGM_0_LIS3_HANDLER_ID, MgmSetIds_0_2.CORE_HK))
pack_generic_hk_listening_cmds( sid_list.append(make_sid(oids.MGM_1_RM3100_HANDLER_ID, MgmSetIds_1_3.CORE_HK))
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.MGM_1_RM3100_HANDLER_ID, MgmSetIds_1_3.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
# Gyros # Gyros
sid = make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CORE_HK) sid_list.append(make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CORE_HK))
pack_generic_hk_listening_cmds( sid_list.append(make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK))
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False sid_list.append(make_sid(oids.GYRO_1_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK))
)
sid = make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.GYRO_1_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
# GNSS0 # GNSS0
sid = make_sid(oids.GPS_HANDLER_0_ID, GnssSetIds_0.CORE_HK) sid_list.append(make_sid(oids.GPS_HANDLER_0_ID, GnssSetIds_0.CORE_HK))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False
) )
pack_acs_command(tc_queue=tc_queue, op_code="acs-off") pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
@ -208,31 +185,16 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
pack_acs_command(tc_queue=tc_queue, op_code="acs-b") pack_acs_command(tc_queue=tc_queue, op_code="acs-b")
# MGMs # MGMs
sid = make_sid(oids.MGM_2_LIS3_HANDLER_ID, MgmSetIds_0_2.CORE_HK) sid_list.append(make_sid(oids.MGM_2_LIS3_HANDLER_ID, MgmSetIds_0_2.CORE_HK))
pack_generic_hk_listening_cmds( sid_list.append(make_sid(oids.MGM_3_RM3100_HANDLER_ID, MgmSetIds_1_3.CORE_HK))
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.MGM_3_RM3100_HANDLER_ID, MgmSetIds_1_3.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
# Gyros # Gyros
sid = make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CORE_HK) sid_list.append(make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CORE_HK))
pack_generic_hk_listening_cmds( sid_list.append(make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK))
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False sid_list.append(make_sid(oids.GYRO_3_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK))
)
sid = make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.GYRO_3_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
# GNSS1 # GNSS1
sid = make_sid(oids.GPS_HANDLER_1_ID, GnssSetIds_1.CORE_HK) sid_list.append(make_sid(oids.GPS_HANDLER_1_ID, GnssSetIds_1.CORE_HK))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False
) )
pack_acs_command(tc_queue=tc_queue, op_code="acs-off") pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
@ -240,55 +202,22 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
pack_acs_command(tc_queue=tc_queue, op_code="acs-d") pack_acs_command(tc_queue=tc_queue, op_code="acs-d")
# MGMs # MGMs
sid = make_sid(oids.MGM_0_LIS3_HANDLER_ID, MgmSetIds_0_2.CORE_HK) sid_list.append(make_sid(oids.MGM_0_LIS3_HANDLER_ID, MgmSetIds_0_2.CORE_HK))
pack_generic_hk_listening_cmds( sid_list.append(make_sid(oids.MGM_1_RM3100_HANDLER_ID, MgmSetIds_1_3.CORE_HK))
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False sid_list.append(make_sid(oids.MGM_2_LIS3_HANDLER_ID, MgmSetIds_0_2.CORE_HK))
) sid_list.append(make_sid(oids.MGM_3_RM3100_HANDLER_ID, MgmSetIds_1_3.CORE_HK))
sid = make_sid(oids.MGM_1_RM3100_HANDLER_ID, MgmSetIds_1_3.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.MGM_2_LIS3_HANDLER_ID, MgmSetIds_0_2.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.MGM_3_RM3100_HANDLER_ID, MgmSetIds_1_3.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
# Gyros # Gyros
sid = make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CORE_HK) sid_list.append(make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CORE_HK))
pack_generic_hk_listening_cmds( sid_list.append(make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK))
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False sid_list.append(make_sid(oids.GYRO_1_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK))
) sid_list.append(make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CORE_HK))
sid = make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK) sid_list.append(make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK))
pack_generic_hk_listening_cmds( sid_list.append(make_sid(oids.GYRO_3_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK))
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.GYRO_1_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.GYRO_3_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
# GNSS0+1 # GNSS0+1
sid = make_sid(oids.GPS_HANDLER_0_ID, GnssSetIds_0.CORE_HK) sid_list.append(make_sid(oids.GPS_HANDLER_0_ID, GnssSetIds_0.CORE_HK))
sid_list.append(make_sid(oids.GPS_HANDLER_1_ID, GnssSetIds_1.CORE_HK))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False
)
sid = make_sid(oids.GPS_HANDLER_1_ID, GnssSetIds_1.CORE_HK)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
) )
pack_acs_command(tc_queue=tc_queue, op_code="acs-off") pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
@ -296,17 +225,11 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
if op_code in OpCodes.MGT_FT: if op_code in OpCodes.MGT_FT:
key = KAI.MGT_FT[0] key = KAI.MGT_FT[0]
sid = make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET) sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET))
sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET))
sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False
)
sid = make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
) )
# mgt 1: imtq und hk # mgt 1: imtq und hk
@ -316,17 +239,11 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
key = KAI.MGT_FT[0] key = KAI.MGT_FT[0]
pack_acs_command(tc_queue=tc_queue, op_code="acs-a") pack_acs_command(tc_queue=tc_queue, op_code="acs-a")
sid = make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET) sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET))
sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET))
sid_list.append(make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET))
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False
)
sid = make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
)
sid = make_sid(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET)
pack_generic_hk_listening_cmds(
tc_queue=tc_queue, proc_key=key, sid=sid, diag=False
) )
pack_acs_command(tc_queue=tc_queue, op_code="acs-off") pack_acs_command(tc_queue=tc_queue, op_code="acs-off")