eive-tmtc/pus_tc/cmd_definitions.py

645 lines
26 KiB
Python
Raw Normal View History

2022-02-03 16:02:55 +01:00
from tmtccmd.config import (
add_op_code_entry,
add_service_op_code_entry,
2022-03-03 18:32:08 +01:00
generate_op_code_options,
2022-02-03 16:02:55 +01:00
ServiceOpCodeDictT,
OpCodeDictKeys,
)
2022-05-24 17:01:35 +02:00
from tmtccmd.config.globals import get_default_service_op_code_dict
from pus_tc.devs.gps import GpsOpCodes
from pus_tc.devs.pcdu import add_pcdu_cmds
from pus_tc.devs.plpcdu import add_pl_pcdu_cmds
from pus_tc.devs.rad_sensor import add_rad_sens_cmds
from pus_tc.system.core import add_core_controller_definitions
2022-05-03 19:01:38 +02:00
from pus_tc.devs.heater import add_heater_cmds
2022-05-23 17:50:08 +02:00
from pus_tc.devs.rtd import specify_rtd_cmds
2022-05-10 18:00:56 +02:00
from pus_tc.devs.reaction_wheels import add_rw_cmds
2022-03-04 10:41:05 +01:00
from pus_tc.devs.bpx_batt import BpxOpCodes
2022-05-24 17:01:35 +02:00
from config.definitions import CustomServiceList
2022-02-03 16:02:55 +01:00
2022-05-17 11:13:32 +02:00
def get_eive_service_op_code_dict() -> ServiceOpCodeDictT:
service_op_code_dict = get_default_service_op_code_dict()
2022-05-03 18:36:28 +02:00
add_bpx_cmd_definitions(cmd_dict=service_op_code_dict)
add_core_controller_definitions(cmd_dict=service_op_code_dict)
add_pl_pcdu_cmds(cmd_dict=service_op_code_dict)
add_pcdu_cmds(cmd_dict=service_op_code_dict)
2022-05-23 17:50:08 +02:00
specify_rtd_cmds(cmd_dict=service_op_code_dict)
2022-05-03 18:36:28 +02:00
add_imtq_cmds(cmd_dict=service_op_code_dict)
add_rad_sens_cmds(cmd_dict=service_op_code_dict)
add_rw_cmds(cmd_dict=service_op_code_dict)
add_ploc_mpsoc_cmds(cmd_dict=service_op_code_dict)
add_ploc_supv_cmds(cmd_dict=service_op_code_dict)
add_system_cmds(cmd_dict=service_op_code_dict)
add_time_cmds(cmd_dict=service_op_code_dict)
add_syrlinks_cmds(cmd_dict=service_op_code_dict)
add_gps_cmds(cmd_dict=service_op_code_dict)
add_str_cmds(cmd_dict=service_op_code_dict)
add_ccsds_cmds(cmd_dict=service_op_code_dict)
2022-05-03 19:01:38 +02:00
add_pdec_cmds(cmd_dict=service_op_code_dict)
add_heater_cmds(cmd_dict=service_op_code_dict)
2022-05-03 18:36:28 +02:00
add_tmp_sens_cmds(cmd_dict=service_op_code_dict)
add_proc_cmds(cmd_dict=service_op_code_dict)
2022-05-17 11:13:32 +02:00
return service_op_code_dict
2022-05-03 18:36:28 +02:00
def add_tmp_sens_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict = {
"0": ("TMP1075 Tests", {OpCodeDictKeys.TIMEOUT: 2.2}),
}
service_tuple = ("TMP1075 1", op_code_dict)
cmd_dict[CustomServiceList.TMP1075_1.value] = service_tuple
service_tuple = ("TMP1075 2", op_code_dict)
cmd_dict[CustomServiceList.TMP1075_2.value] = service_tuple
def add_pdec_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_pdec_handler = {
"0": ("PDEC Handler: Print CLCW", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("PDEC Handler: Print PDEC monitor", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_pdec_handler_tuple = ("PDEC Handler", op_code_dict_srv_pdec_handler)
cmd_dict[CustomServiceList.PDEC_HANDLER.value] = service_pdec_handler_tuple
def add_ccsds_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_ccsds_handler = {
"0": ("CCSDS Handler: Set low rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("CCSDS Handler: Set high rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("CCSDS Handler: Enable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("CCSDS Handler: Disable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("CCSDS Handler: Set arbitrary bitrate", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": (
"CCSDS Handler: Enable tx clock manipulator",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"6": (
"CCSDS Handler: Disable tx clock manipulator",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"7": (
"CCSDS Handler: Update tx data on rising edge",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"8": (
"CCSDS Handler: Update tx data on falling edge",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_ccsds_handler_tuple = ("CCSDS Handler", op_code_dict_srv_ccsds_handler)
cmd_dict[CustomServiceList.CCSDS_HANDLER.value] = service_ccsds_handler_tuple
def add_gps_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict = {
GpsOpCodes.RESET_GNSS.value: ("Reset GPS", {OpCodeDictKeys.TIMEOUT: 2.0})
}
service_tuple = ("GPS 0", op_code_dict)
cmd_dict[CustomServiceList.GPS_0.value] = service_tuple
cmd_dict[CustomServiceList.GPS_1.value] = service_tuple
def add_str_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_star_tracker = {
"0": (
"Star Tracker: Mode On, Submode Bootloader",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"1": ("Star Tracker: Mode On, Submode Firmware", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Star Tracker: Mode Normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("Star Tracker: Mode Off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("Star Tracker: Mode Raw", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("Star Tracker: Ping", {OpCodeDictKeys.TIMEOUT: 5.0}),
"6": (
"Star Tracker: Switch to bootloader program",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"7": ("Star Tracker: Request temperature", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": ("Star Tracker: Request version", {OpCodeDictKeys.TIMEOUT: 2.0}),
"9": ("Star Tracker: Request interface", {OpCodeDictKeys.TIMEOUT: 2.0}),
"10": ("Star Tracker: Request power", {OpCodeDictKeys.TIMEOUT: 2.0}),
"11": (
"Star Tracker: Set subscription parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"12": (
"Star Tracker: Boot image (requires bootloader mode)",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"13": ("Star Tracker: Request time", {OpCodeDictKeys.TIMEOUT: 2.0}),
"14": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
"15": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"16": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"17": ("Star Tracker: Set limit parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"18": ("Star Tracker: Set tracking parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"19": ("Star Tracker: Set mounting parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"20": ("Star Tracker: Set camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"22": (
"Star Tracker: Set centroiding parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"23": ("Star Tracker: Set LISA parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"24": ("Star Tracker: Set matching parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"25": (
"Star Tracker: Set validation parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"26": ("Star Tracker: Set algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"27": ("Star Tracker: Take image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"28": ("Star Tracker: Stop str helper", {OpCodeDictKeys.TIMEOUT: 2.0}),
"30": (
"Star Tracker: Set name of download image",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"31": ("Star Tracker: Request histogram", {OpCodeDictKeys.TIMEOUT: 2.0}),
"32": ("Star Tracker: Request contrast", {OpCodeDictKeys.TIMEOUT: 2.0}),
"33": ("Star Tracker: Set json filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
"35": ("Star Tracker: Flash read", {OpCodeDictKeys.TIMEOUT: 2.0}),
"36": ("Star Tracker: Set flash read filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
"37": ("Star Tracker: Get checksum", {OpCodeDictKeys.TIMEOUT: 2.0}),
"49": ("Star Tracker: Request camera parameter", {OpCodeDictKeys.TIMEOUT: 2.0}),
"50": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
"51": (
"Star Tracker: Set image processor parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"52": (
"Star Tracker: (EGSE only) Load camera ground config ",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"53": (
"Star Tracker: (EGSE only) Load camera flight config",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"54": (
"Star Tracker: Request log level parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"55": (
"Star Tracker: Request mounting parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"56": (
"Star Tracker: Request image processor parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"57": (
"Star Tracker: Request centroiding parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"58": ("Star Tracker: Request lisa parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"59": (
"Star Tracker: Request matching parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"60": (
"Star Tracker: Request tracking parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"61": (
"Star Tracker: Request validation parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"62": ("Star Tracker: Request algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"63": (
"Star Tracker: Request subscription parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"64": (
"Star Tracker: Request log subscription parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"65": (
"Star Tracker: Request debug camera parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"66": ("Star Tracker: Set log level parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"67": (
"Star Tracker: Set log subscription parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"68": (
"Star Tracker: Set debug camera parameters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"69": ("Star Tracker: Firmware update", {OpCodeDictKeys.TIMEOUT: 2.0}),
"70": (
"Star Tracker: Disable timestamp generation",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"71": (
"Star Tracker: Enable timestamp generation",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)
cmd_dict[CustomServiceList.STAR_TRACKER.value] = service_star_tracker_tuple
def add_syrlinks_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_syrlinks_handler = {
"0": ("Syrlinks Handler: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Syrlinks Handler: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Syrlinks Handler: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("Syrlinks Handler: Set TX standby", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("Syrlinks Handler: Set TX modulation", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("Syrlinks Handler: Set TX carrier wave", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("Syrlinks Handler: Read TX status", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": ("Syrlinks Handler: Read TX waveform", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": (
"Syrlinks Handler: Read TX AGC value high byte ",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"9": (
"Syrlinks Handler: Read TX AGC value low byte ",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"12": (
"Syrlinks Handler: Write LCL config",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"13": (
"Syrlinks Handler: Read RX status registers",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"14": (
"Syrlinks Handler: Read LCL config register",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"15": (
"Syrlinks Handler: Set waveform OQPSK",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"16": (
"Syrlinks Handler: Set waveform BPSK",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"17": (
"Syrlinks Handler: Set second config",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"18": (
"Syrlinks Handler: Enable debug output",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"19": (
"Syrlinks Handler: Disable debug output",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_syrlinks_handler_tuple = (
"Syrlinks Handler",
op_code_dict_srv_syrlinks_handler,
)
cmd_dict[CustomServiceList.SYRLINKS.value] = service_syrlinks_handler_tuple
2022-02-03 16:02:55 +01:00
def add_bpx_cmd_definitions(cmd_dict: ServiceOpCodeDictT):
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict, keys=BpxOpCodes.HK, info="Request BPX HK"
)
add_op_code_entry(
op_code_dict=op_code_dict, keys=BpxOpCodes.RST_BOOT_CNT, info="Reset Boot Count"
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=BpxOpCodes.REQUEST_CFG,
info="Request Configuration Struct (Step 1)",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=BpxOpCodes.REQUEST_CFG_HK,
info="Request Configuration Struct HK (Step 2)",
)
add_op_code_entry(
op_code_dict=op_code_dict, keys=BpxOpCodes.REBOOT, info="Reboot Command"
)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.BPX_BATTERY.value,
info="BPX Battery Handler",
op_code_entry=op_code_dict,
)
2022-04-09 18:44:04 +02:00
def add_time_cmds(cmd_dict: ServiceOpCodeDictT):
from pus_tc.system.time import OpCodes, Info
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.SET_CURRENT_TIME,
info=Info.SET_CURRENT_TIME,
)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.TIME.value,
info="Time Service",
op_code_entry=op_code_dict,
)
2022-03-02 11:44:39 +01:00
def add_imtq_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_imtq = {
"0": ("IMTQ Tests All", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("IMTQ perform pos X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("IMTQ perform neg X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("IMTQ perform pos Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("IMTQ perform neg Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("IMTQ perform pos Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("IMTQ perform neg Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": ("IMTQ command dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": ("IMTQ get commanded dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_imtq_tuple = ("IMTQ Device", op_code_dict_srv_imtq)
cmd_dict[CustomServiceList.IMTQ.value] = service_imtq_tuple
2022-03-17 19:42:27 +01:00
def add_ploc_mpsoc_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_ploc_mpsoc = {
2022-03-31 11:36:50 +02:00
"0": ("Ploc MPSoC: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Ploc MPSoC: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Ploc MPSoC: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("Ploc MPSoC: Memory write", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("Ploc MPSoC: Memory read", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("Ploc MPSoC: Flash write", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("Ploc MPSoC: Flash delete", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": ("Ploc MPSoC: Replay start", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": ("Ploc MPSoC: Replay stop", {OpCodeDictKeys.TIMEOUT: 2.0}),
"9": ("Ploc MPSoC: Downlink pwr on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"10": ("Ploc MPSoC: Downlink pwr off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"11": ("Ploc MPSoC: Replay write sequence", {OpCodeDictKeys.TIMEOUT: 2.0}),
"12": ("Ploc MPSoC: OBSW reset sequence count", {OpCodeDictKeys.TIMEOUT: 2.0}),
"13": ("Ploc MPSoC: Read DEADBEEF address", {OpCodeDictKeys.TIMEOUT: 2.0}),
"14": ("Ploc MPSoC: Mode replay", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-04-20 21:34:14 +02:00
"15": ("Ploc MPSoC: Mode idle", {OpCodeDictKeys.TIMEOUT: 2.0}),
"16": ("Ploc MPSoC: Tc cam command send", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-05-17 17:21:03 +02:00
"17": ("Ploc MPSoC: Set UART TX tristate", {OpCodeDictKeys.TIMEOUT: 2.0}),
"18": ("Ploc MPSoC: Relesase UART TX", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-03-17 19:42:27 +01:00
}
service_ploc_mpsoc_tuple = ("Ploc MPSoC", op_code_dict_srv_ploc_mpsoc)
cmd_dict[CustomServiceList.PLOC_MPSOC.value] = service_ploc_mpsoc_tuple
def add_ploc_supv_cmds(cmd_dict: ServiceOpCodeDictT):
2022-03-02 11:44:39 +01:00
op_code_dict_ploc_mem_dumper = {
"0": ("PLOC Memory Dumper: MRAM dump", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_memory_dumper_tuple = (
"PLOC Memory Dumper",
op_code_dict_ploc_mem_dumper,
)
op_code_dict_srv_ploc_supv = {
2022-03-28 11:40:13 +02:00
"0": ("PLOC Supervisor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("PLOC Supervisor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("PLOC Supervisor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-03-02 11:44:39 +01:00
"3": ("PLOC Supervisor: Get HK Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("PLOC Supervisor: Start MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("PLOC Supervisor: Shutdown MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": (
"PLOC Supervisor: Select MPSoC boot image",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"8": ("PLOC Supervisor: Set max restart tries", {OpCodeDictKeys.TIMEOUT: 2.0}),
"9": ("PLOC Supervisor: Reset MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
"10": ("PLOC Supervisor: Set time reference", {OpCodeDictKeys.TIMEOUT: 2.0}),
"11": ("PLOC Supervisor: Set boot timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
"12": ("PLOC Supervisor: Disable Hk", {OpCodeDictKeys.TIMEOUT: 2.0}),
"13": (
"PLOC Supervisor: Request boot status report",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"17": ("PLOC Supervisor: Enable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"18": ("PLOC Supervisor: Disable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"20": ("PLOC Supervisor: Set alert limit", {OpCodeDictKeys.TIMEOUT: 2.0}),
"23": (
"PLOC Supervisor: Set ADC enabled channels",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"24": (
"PLOC Supervisor: Set ADC window and stride",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"25": ("PLOC Supervisor: Set ADC threshold", {OpCodeDictKeys.TIMEOUT: 2.0}),
"26": (
"PLOC Supervisor: Request latchup status report",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"27": ("PLOC Supervisor: Copy ADC data to MRAM", {OpCodeDictKeys.TIMEOUT: 2.0}),
"30": ("PLOC Supervisor: Run auto EM tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"31": ("PLOC Supervisor: MRAM Wipe", {OpCodeDictKeys.TIMEOUT: 2.0}),
"35": ("PLOC Supervisor: Set GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
"36": ("PLOC Supervisor: Read GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
"37": ("PLOC Supervisor: Restart supervisor", {OpCodeDictKeys.TIMEOUT: 2.0}),
"38": (
"PLOC Supervisor: Factory reset clear all",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"39": (
"PLOC Supervisor: Factory reset clear mirror entries",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"40": (
"PLOC Supervisor: Factory reset clear circular entries",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2022-04-11 16:53:20 +02:00
"42": ("PLOC Supervisor: Perform update", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-04-28 19:04:17 +02:00
"43": (
"PLOC Supervisor: Terminate supervisor process",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2022-04-11 16:53:20 +02:00
"44": ("PLOC Supervisor: Start MPSoC quiet", {OpCodeDictKeys.TIMEOUT: 2.0}),
"45": ("PLOC Supervisor: Set shutdown timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
"46": ("PLOC Supervisor: Factory flash", {OpCodeDictKeys.TIMEOUT: 2.0}),
"47": ("PLOC Supervisor: Enable auto TM", {OpCodeDictKeys.TIMEOUT: 2.0}),
"48": ("PLOC Supervisor: Disable auto TM", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-05-05 01:21:57 +02:00
"51": (
"PLOC Supervisor: Logging request event buffers",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"52": (
"PLOC Supervisor: Logging clear counters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2022-04-14 07:53:18 +02:00
"53": ("PLOC Supervisor: Logging set topic", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-04-28 19:04:17 +02:00
"54": (
"PLOC Supervisor: Logging request counters",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2022-04-21 16:30:42 +02:00
"55": ("PLOC Supervisor: Request ADC Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-04-28 11:29:26 +02:00
"56": ("PLOC Supervisor: Reset PL", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-05-05 19:20:59 +02:00
"57": ("PLOC Supervisor: Enable NVMs", {OpCodeDictKeys.TIMEOUT: 2.0}),
"58": ("PLOC Supervisor: Continue update", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-03-02 11:44:39 +01:00
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
cmd_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
2022-03-04 10:44:55 +01:00
cmd_dict[
CustomServiceList.PLOC_MEMORY_DUMPER.value
] = service_ploc_memory_dumper_tuple
2022-03-07 11:07:54 +01:00
2022-05-18 18:39:18 +02:00
def add_proc_cmds(cmd_dict: ServiceOpCodeDictT):
2022-05-19 18:47:23 +02:00
from pus_tc.system.proc import OpCodes, KAI
2022-05-18 20:00:59 +02:00
2022-05-18 18:39:18 +02:00
op_code_dict = dict()
2022-05-19 18:47:23 +02:00
add_op_code_entry(
op_code_dict=op_code_dict, keys=OpCodes.HEATER, info=KAI.HEATER[1]
)
2022-05-18 18:39:18 +02:00
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.PROCEDURE.value,
info="Procedures",
op_code_entry=op_code_dict,
)
2022-05-18 20:00:59 +02:00
op_code_dict = dict()
2022-05-19 18:47:23 +02:00
add_op_code_entry(
op_code_dict=op_code_dict, keys=OpCodes.BAT_FT, info=KAI.BAT_FT[1]
)
add_op_code_entry(
op_code_dict=op_code_dict, keys=OpCodes.PCDU_FT, info=KAI.PCDU_FT[1]
)
add_op_code_entry(
2022-05-19 19:24:57 +02:00
op_code_dict=op_code_dict, keys=OpCodes.CORE_FT, info=KAI.CORE_FT[1], options={}
2022-05-19 18:47:23 +02:00
)
2022-05-18 20:00:59 +02:00
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.PROCEDURE.value,
info="TV Test Procedures",
op_code_entry=op_code_dict,
)
2022-05-18 18:39:18 +02:00
2022-03-07 11:07:54 +01:00
def add_system_cmds(cmd_dict: ServiceOpCodeDictT):
2022-03-22 10:14:22 +01:00
from pus_tc.system.acs import AcsOpCodes, SusOpCodes
2022-03-22 19:29:55 +01:00
import pus_tc.system.tcs as tcs
import pus_tc.system.controllers as controllers
default_opts = generate_op_code_options(
enter_listener_mode=False, custom_timeout=8.0
)
2022-03-07 11:07:54 +01:00
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict,
keys=AcsOpCodes.ACS_ASS_A_SIDE,
info="Switch to ACS board A side",
options=default_opts,
2022-03-07 17:02:44 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=AcsOpCodes.ACS_ASS_B_SIDE,
info="Switch to ACS board B side",
options=default_opts,
2022-03-07 17:02:44 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=AcsOpCodes.ACS_ASS_DUAL_MODE,
info="Switch to ACS board dual mode",
options=default_opts,
2022-03-07 17:02:44 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=AcsOpCodes.ACS_ASS_A_ON,
info="Switch ACS board A side on",
options=default_opts,
2022-03-07 17:02:44 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=AcsOpCodes.ACS_ASS_B_ON,
info="Switch ACS board B side on",
options=default_opts,
2022-03-07 17:02:44 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=AcsOpCodes.ACS_ASS_DUAL_ON,
info="Switch ACS board dual mode on",
options=default_opts,
2022-03-07 17:02:44 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=AcsOpCodes.ACS_ASS_OFF,
info="Switch off ACS board",
options=default_opts,
2022-03-07 11:07:54 +01:00
)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.ACS_ASS.value,
info="ACS Assemblies",
op_code_entry=op_code_dict,
)
2022-03-22 10:14:22 +01:00
op_code_dict = dict()
2022-03-22 09:54:57 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
2022-03-22 10:14:22 +01:00
keys=SusOpCodes.SUS_ASS_NOM_SIDE,
2022-03-22 09:54:57 +01:00
info="Switch SUS board to nominal side",
options=default_opts,
)
add_op_code_entry(
op_code_dict=op_code_dict,
2022-03-22 10:14:22 +01:00
keys=SusOpCodes.SUS_ASS_RED_SIDE,
2022-03-22 09:54:57 +01:00
info="Switch SUS board to redundant side",
options=default_opts,
)
add_op_code_entry(
op_code_dict=op_code_dict,
2022-03-22 10:14:22 +01:00
keys=SusOpCodes.SUS_ASS_OFF,
2022-03-22 09:54:57 +01:00
info="Switch off SUS board",
options=default_opts,
)
2022-03-22 11:05:48 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
keys=SusOpCodes.SUS_ASS_DUAL_MODE,
info="Switch SUS board to dual mode",
options=default_opts,
)
2022-03-07 11:07:54 +01:00
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
2022-03-22 10:14:22 +01:00
name=CustomServiceList.SUS_ASS.value,
info="SUS Assembly",
2022-03-07 11:07:54 +01:00
op_code_entry=op_code_dict,
)
2022-03-22 19:29:55 +01:00
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict,
keys=tcs.OpCodes.TCS_BOARD_ASS_NORMAL,
info=tcs.Info.TCS_BOARD_ASS_NORMAL,
options=default_opts,
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=tcs.OpCodes.TCS_BOARD_ASS_OFF,
info=tcs.Info.TCS_BOARD_ASS_OFF,
options=default_opts,
)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.TCS_ASS.value,
info="TCS Board Assembly",
op_code_entry=op_code_dict,
)
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict,
keys=controllers.OpCodes.THERMAL_CONTROLLER,
info=controllers.Info.THERMAL_CONTROLLER,
options=default_opts,
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=controllers.OpCodes.CORE_CONTROLLER,
info=controllers.Info.CORE_CONTROLLER,
options=default_opts,
)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.CONTROLLERS.value,
info="Controllers",
op_code_entry=op_code_dict,
)