reduced code duplication
This commit is contained in:
parent
79e0838473
commit
27b41c0a48
@ -235,14 +235,21 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
||||
|
||||
if op_code in OpCodes.PCDU_FT:
|
||||
key = KAI.PCDU_FT[0]
|
||||
sid_list.append(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))
|
||||
pcdu_pairs = [
|
||||
(oids.P60_DOCK_HANDLER, GsSetIds.P60_CORE),
|
||||
(oids.PDU_1_HANDLER_ID, GsSetIds.PDU_1_CORE),
|
||||
(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_CORE),
|
||||
(oids.ACU_HANDLER_ID, GsSetIds.ACU_CORE),
|
||||
(oids.P60_DOCK_HANDLER, GsSetIds.P60_AUX),
|
||||
(oids.PDU_1_HANDLER_ID, GsSetIds.PDU_1_AUX),
|
||||
(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_AUX),
|
||||
(oids.ACU_HANDLER_ID, GsSetIds.ACU_AUX),
|
||||
]
|
||||
|
||||
for pcdu_dev in pcdu_pairs:
|
||||
oid = pcdu_dev[0]
|
||||
set_id = pcdu_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
@ -295,8 +302,9 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
||||
(oids.GYRO_3_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK),
|
||||
(oids.GPS_CONTROLLER, GpsSetIds.HK),
|
||||
]
|
||||
d_side_pairs = a_side_pairs + b_side_pairs
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-a")
|
||||
# MGMs
|
||||
|
||||
for a_side_dev in a_side_pairs:
|
||||
oid = a_side_dev[0]
|
||||
set_id = a_side_dev[1]
|
||||
@ -331,33 +339,11 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-d")
|
||||
|
||||
# MGMs
|
||||
sid_list.append(make_sid(oids.MGM_0_LIS3_HANDLER_ID, MgmLis3SetIds_0_2.CORE_HK))
|
||||
sid_list.append(
|
||||
make_sid(oids.MGM_1_RM3100_HANDLER_ID, MgmRm3100SetIds_1_3.CORE_HK)
|
||||
)
|
||||
sid_list.append(make_sid(oids.MGM_2_LIS3_HANDLER_ID, MgmLis3SetIds_0_2.CORE_HK))
|
||||
sid_list.append(
|
||||
make_sid(oids.MGM_3_RM3100_HANDLER_ID, MgmRm3100SetIds_1_3.CORE_HK)
|
||||
)
|
||||
# Gyros
|
||||
sid_list.append(
|
||||
make_sid(oids.GYRO_0_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CORE_HK)
|
||||
)
|
||||
sid_list.append(
|
||||
make_sid(oids.GYRO_0_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CFG_HK)
|
||||
)
|
||||
sid_list.append(make_sid(oids.GYRO_1_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK))
|
||||
sid_list.append(
|
||||
make_sid(oids.GYRO_2_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CORE_HK)
|
||||
)
|
||||
sid_list.append(
|
||||
make_sid(oids.GYRO_2_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CFG_HK)
|
||||
)
|
||||
sid_list.append(make_sid(oids.GYRO_3_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK))
|
||||
# GNSS0+1
|
||||
sid_list.append(make_sid(oids.GPS_CONTROLLER, GpsSetIds.HK))
|
||||
sid_list.append(make_sid(oids.GPS_HANDLER_1_ID, GpsSetIds.HK))
|
||||
for d_side_dev in d_side_pairs:
|
||||
oid = d_side_dev[0]
|
||||
set_id = d_side_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
@ -370,13 +356,19 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
||||
|
||||
if op_code in OpCodes.MGT_FT:
|
||||
key = KAI.MGT_FT[0]
|
||||
imtq_pairs = [
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET),
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET),
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET),
|
||||
]
|
||||
|
||||
# mgt 1: imtq und hk
|
||||
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="2")
|
||||
|
||||
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))
|
||||
for imtq_dev in imtq_pairs:
|
||||
oid = imtq_dev[0]
|
||||
set_id = imtq_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, cfg=GenericHkListeningCfg.default()
|
||||
)
|
||||
@ -385,6 +377,26 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
||||
|
||||
if op_code in OpCodes.MGT_FT_DP:
|
||||
key = KAI.MGT_FT_DP[0]
|
||||
a_side_pairs = [
|
||||
(oids.MGM_0_LIS3_HANDLER_ID, MgmLis3SetIds_0_2.CORE_HK),
|
||||
(oids.MGM_1_RM3100_HANDLER_ID, MgmRm3100SetIds_1_3.CORE_HK),
|
||||
(oids.GYRO_0_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CORE_HK),
|
||||
(oids.GYRO_1_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK),
|
||||
(oids.GPS_CONTROLLER, GpsSetIds.HK),
|
||||
]
|
||||
b_side_pairs = [
|
||||
(oids.MGM_2_LIS3_HANDLER_ID, MgmLis3SetIds_0_2.CORE_HK),
|
||||
(oids.MGM_3_RM3100_HANDLER_ID, MgmRm3100SetIds_1_3.CORE_HK),
|
||||
(oids.GYRO_2_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CORE_HK),
|
||||
(oids.GYRO_3_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK),
|
||||
(oids.GPS_CONTROLLER, GpsSetIds.HK),
|
||||
]
|
||||
imtq_pairs = [
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET),
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET),
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET),
|
||||
]
|
||||
d_side_and_imtq_pairs = a_side_pairs + b_side_pairs + imtq_pairs
|
||||
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-d")
|
||||
# mgt 2.: imtq + dual side + dipole
|
||||
@ -392,42 +404,13 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
||||
object_id=oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="2"
|
||||
)
|
||||
|
||||
# MGMs
|
||||
sid_list.append(make_sid(oids.MGM_0_LIS3_HANDLER_ID, MgmLis3SetIds_0_2.CORE_HK))
|
||||
sid_list.append(
|
||||
make_sid(oids.MGM_1_RM3100_HANDLER_ID, MgmRm3100SetIds_1_3.CORE_HK)
|
||||
)
|
||||
sid_list.append(make_sid(oids.MGM_2_LIS3_HANDLER_ID, MgmLis3SetIds_0_2.CORE_HK))
|
||||
sid_list.append(
|
||||
make_sid(oids.MGM_3_RM3100_HANDLER_ID, MgmRm3100SetIds_1_3.CORE_HK)
|
||||
)
|
||||
# Gyros
|
||||
sid_list.append(
|
||||
make_sid(oids.GYRO_0_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CORE_HK)
|
||||
)
|
||||
sid_list.append(
|
||||
make_sid(oids.GYRO_0_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CFG_HK)
|
||||
)
|
||||
sid_list.append(make_sid(oids.GYRO_1_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK))
|
||||
sid_list.append(
|
||||
make_sid(oids.GYRO_2_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CORE_HK)
|
||||
)
|
||||
sid_list.append(
|
||||
make_sid(oids.GYRO_2_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CFG_HK)
|
||||
)
|
||||
sid_list.append(make_sid(oids.GYRO_3_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK))
|
||||
# GNSS0+1
|
||||
sid_list.append(make_sid(oids.GPS_CONTROLLER, GpsSetIds.HK))
|
||||
sid_list.append(make_sid(oids.GPS_HANDLER_1_ID, GpsSetIds.HK))
|
||||
|
||||
# IMTQ
|
||||
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))
|
||||
for d_side_and_imtq_dev in d_side_and_imtq_pairs:
|
||||
oid = d_side_and_imtq_dev[0]
|
||||
set_id = d_side_and_imtq_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
|
||||
cfg = GenericHkListeningCfg.default()
|
||||
cfg.mgt = True
|
||||
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
@ -528,27 +511,33 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
||||
|
||||
if op_code in OpCodes.RW_FT_ONE_RW:
|
||||
key = KAI.RW_FT_ONE_RW[0]
|
||||
rw_pairs = [
|
||||
(oids.RW1_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW1_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW1_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW1_ID, RwSetIds.TM_SET),
|
||||
(oids.RW2_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW2_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW2_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW2_ID, RwSetIds.TM_SET),
|
||||
(oids.RW3_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW3_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW3_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW3_ID, RwSetIds.TM_SET),
|
||||
(oids.RW4_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW4_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW4_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW4_ID, RwSetIds.TM_SET),
|
||||
]
|
||||
|
||||
# RW NORMAL
|
||||
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="nml")
|
||||
|
||||
# RW HK für alle RWs nur einzeln
|
||||
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.STATUS_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.TEMPERATURE_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.LAST_RESET))
|
||||
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.TM_SET))
|
||||
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.STATUS_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.TEMPERATURE_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.LAST_RESET))
|
||||
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.TM_SET))
|
||||
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.STATUS_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.TEMPERATURE_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.LAST_RESET))
|
||||
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.TM_SET))
|
||||
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.STATUS_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.TEMPERATURE_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.LAST_RESET))
|
||||
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.TM_SET))
|
||||
|
||||
for rw_dev in rw_pairs:
|
||||
oid = rw_dev[0]
|
||||
set_id = rw_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
@ -562,26 +551,32 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
||||
# ass command with 2 rws to speed
|
||||
if op_code in OpCodes.RW_FT_TWO_RWS:
|
||||
key = KAI.RW_FT_TWO_RWS[0]
|
||||
rw_pairs = [
|
||||
(oids.RW1_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW1_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW1_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW1_ID, RwSetIds.TM_SET),
|
||||
(oids.RW2_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW2_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW2_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW2_ID, RwSetIds.TM_SET),
|
||||
(oids.RW3_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW3_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW3_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW3_ID, RwSetIds.TM_SET),
|
||||
(oids.RW4_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW4_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW4_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW4_ID, RwSetIds.TM_SET),
|
||||
]
|
||||
# RW NORMAL
|
||||
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="nml")
|
||||
|
||||
# RW
|
||||
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.STATUS_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.TEMPERATURE_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.LAST_RESET))
|
||||
sid_list.append(make_sid(oids.RW1_ID, RwSetIds.TM_SET))
|
||||
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.STATUS_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.TEMPERATURE_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.LAST_RESET))
|
||||
sid_list.append(make_sid(oids.RW2_ID, RwSetIds.TM_SET))
|
||||
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.STATUS_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.TEMPERATURE_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.LAST_RESET))
|
||||
sid_list.append(make_sid(oids.RW3_ID, RwSetIds.TM_SET))
|
||||
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.STATUS_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.TEMPERATURE_SET_ID))
|
||||
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.LAST_RESET))
|
||||
sid_list.append(make_sid(oids.RW4_ID, RwSetIds.TM_SET))
|
||||
for rw_dev in rw_pairs:
|
||||
oid = rw_dev[0]
|
||||
set_id = rw_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
|
Loading…
Reference in New Issue
Block a user