|
|
|
@ -1,6 +1,11 @@
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
import time
|
|
|
|
|
from typing import List
|
|
|
|
|
|
|
|
|
|
from config.definitions import CustomServiceList
|
|
|
|
|
from config.object_ids import get_object_ids
|
|
|
|
|
from pus_tc.system.tcs import pack_tcs_sys_commands
|
|
|
|
|
from tmtccmd.config import (
|
|
|
|
|
QueueCommands,
|
|
|
|
|
ServiceOpCodeDictT,
|
|
|
|
@ -8,25 +13,29 @@ from tmtccmd.config import (
|
|
|
|
|
add_service_op_code_entry,
|
|
|
|
|
)
|
|
|
|
|
from tmtccmd.tc.definitions import TcQueueT
|
|
|
|
|
from tmtccmd.tc.pus_11_tc_sched import (
|
|
|
|
|
generate_time_tagged_cmd,
|
|
|
|
|
generate_enable_tc_sched_cmd,
|
|
|
|
|
generate_reset_tc_sched_cmd,
|
|
|
|
|
)
|
|
|
|
|
from tmtccmd.tc.pus_3_fsfw_hk import *
|
|
|
|
|
|
|
|
|
|
import config.object_ids as oids
|
|
|
|
|
from pus_tc.system.tcs import OpCodes as TcsOpCodes
|
|
|
|
|
from pus_tc.devs.bpx_batt import BpxSetIds
|
|
|
|
|
from pus_tc.system.core import SetIds as CoreSetIds
|
|
|
|
|
from gomspace.gomspace_common import SetIds as GsSetIds
|
|
|
|
|
from pus_tc.devs.rad_sensor import SetIds as RadSetIds
|
|
|
|
|
from pus_tc.devs.mgms import MgmLis3SetIds as MgmSetIds_0_2
|
|
|
|
|
from pus_tc.devs.mgms import MgmRm3100SetIds as MgmSetIds_1_3
|
|
|
|
|
from pus_tc.devs.gyros import AdisGyroSetIds as GyroSetIds_0_2
|
|
|
|
|
from pus_tc.devs.gyros import L3gGyroSetIds as GyroSetIds_1_3
|
|
|
|
|
from pus_tc.devs.mgms import MgmLis3SetIds as MgmLis3SetIds_0_2
|
|
|
|
|
from pus_tc.devs.mgms import MgmRm3100SetIds as MgmRm3100SetIds_1_3
|
|
|
|
|
from pus_tc.devs.gyros import AdisGyroSetIds as AdisGyroSetIds_0_2
|
|
|
|
|
from pus_tc.devs.gyros import L3gGyroSetIds as L3gGyroSetIds_1_3
|
|
|
|
|
from pus_tc.devs.gps import SetIds as GpsSetIds
|
|
|
|
|
from pus_tc.devs.imtq import ImtqSetIds
|
|
|
|
|
from pus_tc.devs.sus import SetIds
|
|
|
|
|
from pus_tc.devs.star_tracker import SetIds as StrSetIds
|
|
|
|
|
from pus_tc.devs.reaction_wheels import RwSetIds
|
|
|
|
|
|
|
|
|
|
from pus_tc.system.tcs import pack_tcs_sys_commands
|
|
|
|
|
from pus_tc.system.controllers import pack_controller_commands
|
|
|
|
|
from pus_tc.system.controllers import pack_cmd_ctrl_to_off, pack_cmd_ctrl_to_nml
|
|
|
|
|
from pus_tc.system.acs import pack_acs_command, pack_sus_cmds
|
|
|
|
|
from pus_tc.devs.imtq import pack_imtq_test_into, pack_dipole_command
|
|
|
|
|
from pus_tc.devs.star_tracker import pack_star_tracker_commands
|
|
|
|
@ -34,13 +43,13 @@ from pus_tc.devs.reaction_wheels import pack_rw_ass_cmds, pack_set_speed_command
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OpCodes:
|
|
|
|
|
HEATER = ["0", "heater"]
|
|
|
|
|
TV_SETUP_TCS_FT_ON = ["setup", "tcs-ft-on"]
|
|
|
|
|
RESET_SCHED = ["reset-sched", "rs"]
|
|
|
|
|
HEATER = ["heater"]
|
|
|
|
|
BAT_FT = ["bat-ft"]
|
|
|
|
|
CORE_FT = ["core-ft"]
|
|
|
|
|
PCDU_FT = ["pcdu-ft"]
|
|
|
|
|
RAD_SEN_FT = ["rad-sen-ft"]
|
|
|
|
|
TCS_FT_ON = ["tcs-ft-on"]
|
|
|
|
|
TCS_FT_OFF = ["tcs-ft-off"]
|
|
|
|
|
ACS_FT = ["acs-ft"]
|
|
|
|
|
MGT_FT = ["mgt-ft"]
|
|
|
|
|
MGT_FT_DP = ["mgt-ft-dp"]
|
|
|
|
@ -48,16 +57,17 @@ class OpCodes:
|
|
|
|
|
STR_FT = ["str-ft"]
|
|
|
|
|
RW_FT_ONE_RW = ["rw-ft-one-rw"]
|
|
|
|
|
RW_FT_TWO_RWS = ["rw-ft-two-rws"]
|
|
|
|
|
TV_TEARDOWN_TCS_FT_OFF = ["teardown", "tcs-ft-off"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class KeyAndInfo:
|
|
|
|
|
TV_SETUP_TCS_FT_ON = ["TCS Act.", "TCS functional test activation"]
|
|
|
|
|
RESET_SCHED = ["Reset Sched", "Reset/Clear TC schedule"]
|
|
|
|
|
HEATER = ["Heater", "heater procedure"]
|
|
|
|
|
BAT_FT = ["BPX Battery", "battery functional test"]
|
|
|
|
|
CORE_FT = ["OBC", "OBC functional test"]
|
|
|
|
|
PCDU_FT = ["PCDU", "PCDU functional test"]
|
|
|
|
|
RAD_SEN_FT = ["Radiation Sensor", "Radiation Sensor functional test"]
|
|
|
|
|
TCS_FT_ON = ["TCS Act.", "TCS functional test activation"]
|
|
|
|
|
TCS_FT_OFF = ["TCS Deact.", "TCS functional test deactivation"]
|
|
|
|
|
ACS_FT = ["ACS", "ACS functional test"]
|
|
|
|
|
MGT_FT = ["MGT", "MGT functional test"]
|
|
|
|
|
MGT_FT_DP = ["MGT dipole", "MGT functional test with dipole"]
|
|
|
|
@ -65,6 +75,7 @@ class KeyAndInfo:
|
|
|
|
|
STR_FT = ["STR", "STR functional test"]
|
|
|
|
|
RW_FT_ONE_RW = ["RW ONE RW", "RW functional test with one RW"]
|
|
|
|
|
RW_FT_TWO_RWS = ["RW TWO RWS", "RW functional test with two RWs"]
|
|
|
|
|
TV_TEARDOWN_TCS_FT_OFF = ["TCS Deact.", "TCS functional test deactivation"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KAI = KeyAndInfo
|
|
|
|
@ -74,21 +85,41 @@ PROC_INFO_DICT = {
|
|
|
|
|
KAI.CORE_FT[0]: [OpCodes.CORE_FT, KAI.CORE_FT[1], 120.0, 10.0],
|
|
|
|
|
KAI.PCDU_FT[0]: [OpCodes.PCDU_FT, KAI.PCDU_FT[1], 120.0, 10.0],
|
|
|
|
|
KAI.RAD_SEN_FT[0]: [OpCodes.RAD_SEN_FT, KAI.RAD_SEN_FT[1], 120.0, 10.0],
|
|
|
|
|
KAI.TCS_FT_ON[0]: [OpCodes.TCS_FT_ON, KAI.TCS_FT_ON[1], 120.0, 10.0],
|
|
|
|
|
KAI.TCS_FT_OFF[0]: [OpCodes.TCS_FT_OFF, KAI.TCS_FT_OFF[1], 120.0, 10.0],
|
|
|
|
|
KAI.TV_SETUP_TCS_FT_ON[0]: [OpCodes.TV_SETUP_TCS_FT_ON, KAI.TV_SETUP_TCS_FT_ON[1], 120.0, 10.0],
|
|
|
|
|
KAI.TV_TEARDOWN_TCS_FT_OFF[0]: [
|
|
|
|
|
OpCodes.TV_TEARDOWN_TCS_FT_OFF,
|
|
|
|
|
KAI.TV_TEARDOWN_TCS_FT_OFF[1],
|
|
|
|
|
120.0,
|
|
|
|
|
10.0,
|
|
|
|
|
],
|
|
|
|
|
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],
|
|
|
|
|
# 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 120
|
|
|
|
|
# seconds is not needed after MGTs are tested
|
|
|
|
|
KAI.MGT_FT_DP[0]: [OpCodes.MGT_FT_DP, KAI.MGT_FT_DP[1], 10.0, 10.0],
|
|
|
|
|
KAI.SUS_FT[0]: [OpCodes.SUS_FT, KAI.SUS_FT[1], 120.0, 10.0],
|
|
|
|
|
KAI.STR_FT[0]: [OpCodes.STR_FT, KAI.STR_FT[1], 120.0, 10.0],
|
|
|
|
|
# collection_time for KAI.RW_FT_ONE_RW maybe be reduced as a full 120seconds is not needed after RWs are tested
|
|
|
|
|
# collection_time for KAI.RW_FT_ONE_RW maybe be reduced as a full 120
|
|
|
|
|
# seconds is not needed after RWs are tested
|
|
|
|
|
KAI.RW_FT_ONE_RW[0]: [OpCodes.RW_FT_ONE_RW, KAI.RW_FT_ONE_RW[1], 10.0, 1.0],
|
|
|
|
|
# collection_time for KAI.RW_FT_ONE_RW maybe be reduced as a full 120seconds is not needed after RWs are tested
|
|
|
|
|
# collection_time for KAI.RW_FT_ONE_RW maybe be reduced as a full 120
|
|
|
|
|
# seconds is not needed after RWs are tested
|
|
|
|
|
KAI.RW_FT_TWO_RWS[0]: [OpCodes.RW_FT_TWO_RWS, KAI.RW_FT_TWO_RWS[1], 10.0, 1.0],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GenericHkListeningCfg:
|
|
|
|
|
def __init__(self, mgt: bool = False, one_rw: bool = False, two_rws: bool = False):
|
|
|
|
|
self.use_tc_sched = False
|
|
|
|
|
self.mgt = mgt
|
|
|
|
|
self.one_rw = one_rw
|
|
|
|
|
self.two_rws = two_rws
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def default(cls) -> GenericHkListeningCfg:
|
|
|
|
|
return GenericHkListeningCfg(False, False, False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def generic_print(tc_queue: TcQueueT, info: dict):
|
|
|
|
|
tc_queue.appendleft(
|
|
|
|
|
(QueueCommands.PRINT, f"Executing {info[1]} Procedure (OpCodes: {info[0]})")
|
|
|
|
@ -96,7 +127,6 @@ def generic_print(tc_queue: TcQueueT, info: dict):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def add_proc_cmds(cmd_dict: ServiceOpCodeDictT):
|
|
|
|
|
|
|
|
|
|
op_code_dict = dict()
|
|
|
|
|
for proc_entry in PROC_INFO_DICT.values():
|
|
|
|
|
add_op_code_entry(
|
|
|
|
@ -115,9 +145,7 @@ def pack_generic_hk_listening_cmds(
|
|
|
|
|
proc_key: str,
|
|
|
|
|
sid_list: list[bytearray],
|
|
|
|
|
diag: bool,
|
|
|
|
|
mgt: bool,
|
|
|
|
|
one_rw: bool,
|
|
|
|
|
two_rws: bool,
|
|
|
|
|
cfg: GenericHkListeningCfg,
|
|
|
|
|
):
|
|
|
|
|
info = PROC_INFO_DICT[proc_key]
|
|
|
|
|
collection_time = info[2]
|
|
|
|
@ -131,37 +159,58 @@ def pack_generic_hk_listening_cmds(
|
|
|
|
|
sid=sid,
|
|
|
|
|
interval_seconds=info[3],
|
|
|
|
|
)
|
|
|
|
|
if not cfg.use_tc_sched:
|
|
|
|
|
tc_queue.appendleft((QueueCommands.WAIT, 2.0))
|
|
|
|
|
|
|
|
|
|
if mgt is True:
|
|
|
|
|
if cfg.mgt:
|
|
|
|
|
activate_mgts_alternately(
|
|
|
|
|
tc_queue=tc_queue,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
elif one_rw is True:
|
|
|
|
|
elif cfg.one_rw:
|
|
|
|
|
activate_all_rws_in_sequence(
|
|
|
|
|
tc_queue=tc_queue, test_speed=20000, test_ramp_time=10000, init_ssc=0
|
|
|
|
|
)
|
|
|
|
|
elif two_rws is True:
|
|
|
|
|
elif cfg.two_rws:
|
|
|
|
|
activate_all_rws_two_consecutively(tc_queue=tc_queue, init_ssc=0)
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
if not cfg.use_tc_sched:
|
|
|
|
|
tc_queue.appendleft((QueueCommands.WAIT, collection_time))
|
|
|
|
|
|
|
|
|
|
disable_cmd_list = []
|
|
|
|
|
for sid in sid_list:
|
|
|
|
|
disable_listen_to_hk_for_x_seconds(
|
|
|
|
|
disable_cmd_list.append(
|
|
|
|
|
gen_disable_listen_to_hk_for_x_seconds(
|
|
|
|
|
diag=diag,
|
|
|
|
|
tc_queue=tc_queue,
|
|
|
|
|
device=proc_key,
|
|
|
|
|
sid=sid,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
current_time = time.time()
|
|
|
|
|
current_time += collection_time
|
|
|
|
|
if not cfg.use_tc_sched:
|
|
|
|
|
for cmd in disable_cmd_list:
|
|
|
|
|
tc_queue.appendleft(cmd.pack_command_tuple())
|
|
|
|
|
else:
|
|
|
|
|
for cmd in disable_cmd_list:
|
|
|
|
|
tc_queue.appendleft(
|
|
|
|
|
generate_time_tagged_cmd(
|
|
|
|
|
release_time=struct.pack("!I", current_time),
|
|
|
|
|
tc_to_insert=cmd,
|
|
|
|
|
ssc=0,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
sid_list.clear()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
sid_list = []
|
|
|
|
|
obj_id_dict = get_object_ids()
|
|
|
|
|
if op_code in OpCodes.RESET_SCHED:
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "Resetting/Clearing TC schedule"))
|
|
|
|
|
tc_queue.appendleft(generate_reset_tc_sched_cmd().pack_command_tuple())
|
|
|
|
|
if op_code in OpCodes.BAT_FT:
|
|
|
|
|
key = KAI.BAT_FT[0]
|
|
|
|
|
sid_list.append(make_sid(oids.BPX_HANDLER_ID, BpxSetIds.GET_HK_SET))
|
|
|
|
@ -170,9 +219,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if op_code in OpCodes.CORE_FT:
|
|
|
|
@ -183,9 +230,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if op_code in OpCodes.PCDU_FT:
|
|
|
|
@ -203,9 +248,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if op_code in OpCodes.RAD_SEN_FT:
|
|
|
|
@ -216,56 +259,64 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if op_code in OpCodes.TCS_FT_ON:
|
|
|
|
|
if op_code in OpCodes.TV_SETUP_TCS_FT_ON:
|
|
|
|
|
# Enable scheduling
|
|
|
|
|
tc_queue.appendleft(generate_enable_tc_sched_cmd().pack_command_tuple())
|
|
|
|
|
# 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")
|
|
|
|
|
pack_tcs_sys_commands(
|
|
|
|
|
tc_queue=tc_queue, op_code=TcsOpCodes.TCS_BOARD_ASS_NORMAL[0]
|
|
|
|
|
)
|
|
|
|
|
pack_cmd_ctrl_to_nml(
|
|
|
|
|
tc_queue=tc_queue, object_id=obj_id_dict.get(oids.THERMAL_CONTROLLER_ID)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if op_code in OpCodes.TCS_FT_OFF:
|
|
|
|
|
# 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")
|
|
|
|
|
if op_code in OpCodes.TV_TEARDOWN_TCS_FT_OFF:
|
|
|
|
|
# TCS board shold always be on anyway, do not command it off here
|
|
|
|
|
pack_cmd_ctrl_to_off(
|
|
|
|
|
tc_queue=tc_queue, object_id=obj_id_dict.get(oids.THERMAL_CONTROLLER_ID)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if op_code in OpCodes.ACS_FT:
|
|
|
|
|
key = KAI.ACS_FT[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),
|
|
|
|
|
]
|
|
|
|
|
pack_acs_command(tc_queue=tc_queue, op_code="acs-a")
|
|
|
|
|
|
|
|
|
|
# MGMs
|
|
|
|
|
sid_list.append(make_sid(oids.MGM_0_LIS3_HANDLER_ID, MgmSetIds_0_2.CORE_HK))
|
|
|
|
|
sid_list.append(make_sid(oids.MGM_1_RM3100_HANDLER_ID, MgmSetIds_1_3.CORE_HK))
|
|
|
|
|
# Gyros
|
|
|
|
|
sid_list.append(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.CFG_HK))
|
|
|
|
|
sid_list.append(make_sid(oids.GYRO_1_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK))
|
|
|
|
|
# GNSS0
|
|
|
|
|
sid_list.append(make_sid(oids.GPS_HANDLER_0_ID, GpsSetIds.HK))
|
|
|
|
|
for a_side_dev in a_side_pairs:
|
|
|
|
|
oid = a_side_dev[0]
|
|
|
|
|
set_id = a_side_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,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
|
|
|
|
|
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
|
|
|
|
|
pack_acs_command(tc_queue=tc_queue, op_code="acs-b")
|
|
|
|
|
|
|
|
|
|
# MGMs
|
|
|
|
|
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))
|
|
|
|
|
# Gyros
|
|
|
|
|
sid_list.append(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.CFG_HK))
|
|
|
|
|
sid_list.append(make_sid(oids.GYRO_3_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK))
|
|
|
|
|
for b_side_dev in b_side_pairs:
|
|
|
|
|
oid = b_side_dev[0]
|
|
|
|
|
set_id = b_side_dev[1]
|
|
|
|
|
sid_list.append(make_sid(oid, set_id))
|
|
|
|
|
# GNSS1
|
|
|
|
|
sid_list.append(make_sid(oids.GPS_HANDLER_1_ID, GpsSetIds.HK))
|
|
|
|
|
pack_generic_hk_listening_cmds(
|
|
|
|
@ -273,9 +324,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
|
|
|
|
@ -283,28 +332,38 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
pack_acs_command(tc_queue=tc_queue, op_code="acs-d")
|
|
|
|
|
|
|
|
|
|
# MGMs
|
|
|
|
|
sid_list.append(make_sid(oids.MGM_0_LIS3_HANDLER_ID, MgmSetIds_0_2.CORE_HK))
|
|
|
|
|
sid_list.append(make_sid(oids.MGM_1_RM3100_HANDLER_ID, MgmSetIds_1_3.CORE_HK))
|
|
|
|
|
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_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, GyroSetIds_0_2.CORE_HK))
|
|
|
|
|
sid_list.append(make_sid(oids.GYRO_0_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK))
|
|
|
|
|
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_list.append(make_sid(oids.GYRO_2_ADIS_HANDLER_ID, GyroSetIds_0_2.CFG_HK))
|
|
|
|
|
sid_list.append(make_sid(oids.GYRO_3_L3G_HANDLER_ID, GyroSetIds_1_3.CORE_HK))
|
|
|
|
|
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_HANDLER_0_ID, GpsSetIds.HK))
|
|
|
|
|
sid_list.append(make_sid(oids.GPS_CONTROLLER, GpsSetIds.HK))
|
|
|
|
|
sid_list.append(make_sid(oids.GPS_HANDLER_1_ID, GpsSetIds.HK))
|
|
|
|
|
pack_generic_hk_listening_cmds(
|
|
|
|
|
tc_queue=tc_queue,
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
|
|
|
|
@ -318,14 +377,10 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
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))
|
|
|
|
|
cfg = GenericHkListeningCfg.default()
|
|
|
|
|
cfg.mgt = True
|
|
|
|
|
pack_generic_hk_listening_cmds(
|
|
|
|
|
tc_queue=tc_queue,
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag=False, cfg=cfg
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="0")
|
|
|
|
@ -347,9 +402,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=True,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="0")
|
|
|
|
@ -384,9 +437,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pack_acs_command(tc_queue=tc_queue, op_code="sus-off")
|
|
|
|
@ -401,9 +452,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pack_acs_command(tc_queue=tc_queue, op_code="sus-off")
|
|
|
|
@ -420,9 +469,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pack_acs_command(tc_queue=tc_queue, op_code="sus-off")
|
|
|
|
@ -441,9 +488,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg.default(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pack_star_tracker_commands(
|
|
|
|
@ -478,9 +523,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=True,
|
|
|
|
|
two_rws=False,
|
|
|
|
|
cfg=GenericHkListeningCfg(mgt=False, one_rw=True, two_rws=False),
|
|
|
|
|
)
|
|
|
|
|
# RW OFF
|
|
|
|
|
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="off")
|
|
|
|
@ -513,40 +556,12 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
|
|
|
|
proc_key=key,
|
|
|
|
|
sid_list=sid_list,
|
|
|
|
|
diag=False,
|
|
|
|
|
mgt=False,
|
|
|
|
|
one_rw=False,
|
|
|
|
|
two_rws=True,
|
|
|
|
|
cfg=GenericHkListeningCfg(mgt=False, one_rw=False, two_rws=True),
|
|
|
|
|
)
|
|
|
|
|
# RW OFF
|
|
|
|
|
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="off")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
def listen_to_hk_for_x_seconds(
|
|
|
|
|
tc_queue: TcQueueT,
|
|
|
|
|
diag: bool,
|
|
|
|
|
device: str,
|
|
|
|
|
sid: bytes,
|
|
|
|
|
interval_seconds: float,
|
|
|
|
|
collection_time: float,
|
|
|
|
|
):
|
|
|
|
|
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, f"Enabling periodic HK for {device}"))
|
|
|
|
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
|
|
|
diag=diag, sid=sid, interval_seconds=interval_seconds, ssc=0
|
|
|
|
|
)
|
|
|
|
|
for cmd in cmd_tuple:
|
|
|
|
|
tc_queue.appendleft(cmd.pack_command_tuple())
|
|
|
|
|
|
|
|
|
|
tc_queue.appendleft((QueueCommands.WAIT, collection_time))
|
|
|
|
|
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, f"Disabling periodic HK for {device}"))
|
|
|
|
|
tc_queue.appendleft(
|
|
|
|
|
disable_periodic_hk_command(diag=diag, sid=sid, ssc=0).pack_command_tuple()
|
|
|
|
|
)
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def enable_listen_to_hk_for_x_seconds(
|
|
|
|
|
tc_queue: TcQueueT,
|
|
|
|
|
diag: bool,
|
|
|
|
@ -561,19 +576,15 @@ def enable_listen_to_hk_for_x_seconds(
|
|
|
|
|
for cmd in cmd_tuple:
|
|
|
|
|
tc_queue.appendleft(cmd.pack_command_tuple())
|
|
|
|
|
|
|
|
|
|
tc_queue.appendleft((QueueCommands.WAIT, 2.0))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def disable_listen_to_hk_for_x_seconds(
|
|
|
|
|
def gen_disable_listen_to_hk_for_x_seconds(
|
|
|
|
|
tc_queue: TcQueueT,
|
|
|
|
|
diag: bool,
|
|
|
|
|
device: str,
|
|
|
|
|
sid: bytes,
|
|
|
|
|
):
|
|
|
|
|
) -> PusTelecommand:
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, f"Disabling periodic HK for {device}"))
|
|
|
|
|
tc_queue.appendleft(
|
|
|
|
|
disable_periodic_hk_command(diag=diag, sid=sid, ssc=0).pack_command_tuple()
|
|
|
|
|
)
|
|
|
|
|
return disable_periodic_hk_command(diag=diag, sid=sid, ssc=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def activate_mgts_alternately(
|
|
|
|
|