eive-tmtc/pus_tc/cmd_definitions.py

792 lines
28 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,
)
from config.definitions import CustomServiceList
2022-03-04 10:41:05 +01:00
from pus_tc.devs.bpx_batt import BpxOpCodes
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,
)
def add_core_controller_definitions(cmd_dict: ServiceOpCodeDictT):
from pus_tc.system.core import OpCodes
2022-02-24 10:56:36 +01:00
2022-02-03 16:02:55 +01:00
od = dict()
2022-02-24 10:56:36 +01:00
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT, info="Reboot with Prompt")
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_SELF, info="Reboot Self")
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_0_0, info="Reboot 0 0")
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_0_1, info="Reboot 0 1")
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_1_0, info="Reboot 1 0")
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_1_1, info="Reboot 1 1")
add_op_code_entry(
op_code_dict=od,
keys=OpCodes.ENABLE_REBOOT_FILE_HANDLING,
info="Enable reboot file handling",
)
add_op_code_entry(
op_code_dict=od,
keys=OpCodes.DISABLE_REBOOT_FILE_HANDLING,
info="Disable reboot file handling",
)
add_op_code_entry(
op_code_dict=od,
keys=OpCodes.RESET_ALL_REBOOT_COUNTERS,
info="Reset all reboot counters",
)
add_op_code_entry(
op_code_dict=od,
keys=OpCodes.RESET_REBOOT_COUNTER_00,
info="Reset reboot counter 0 0",
)
add_op_code_entry(
op_code_dict=od,
keys=OpCodes.RESET_REBOOT_COUNTER_01,
info="Reset reboot counter 0 1",
)
add_op_code_entry(
op_code_dict=od,
keys=OpCodes.RESET_REBOOT_COUNTER_10,
info="Reset reboot counter 1 0",
)
add_op_code_entry(
op_code_dict=od,
keys=OpCodes.RESET_REBOOT_COUNTER_11,
info="Reset reboot counter 1 1",
)
2022-03-13 21:35:12 +01:00
add_op_code_entry(
op_code_dict=od,
keys=OpCodes.GET_HK,
info="Request housekeeping set",
)
2022-02-03 16:02:55 +01:00
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.CORE.value,
info="Reboot Self",
op_code_entry=od,
)
2022-02-25 19:25:14 +01:00
def add_pl_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
from pus_tc.devs.plpcdu import OpCodes, Info
2022-03-04 10:44:55 +01:00
2022-02-25 19:25:14 +01:00
op_code_dict = dict()
2022-03-01 18:12:31 +01:00
add_op_code_entry(
op_code_dict=op_code_dict, keys=OpCodes.SWITCH_ON, info=Info.SWITCH_ON
2022-03-03 18:24:17 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.NORMAL_SSR,
info=Info.NORMAL_SSR,
2022-03-01 18:12:31 +01:00
)
2022-03-03 18:55:11 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.NORMAL_DRO,
info=Info.NORMAL_DRO,
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.NORMAL_X8,
info=Info.NORMAL_X8,
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.NORMAL_TX,
info=Info.NORMAL_TX,
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.NORMAL_MPA,
info=Info.NORMAL_MPA,
2022-03-03 18:55:11 +01:00
)
2022-03-01 18:12:31 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.NORMAL_HPA,
info=Info.NORMAL_HPA,
)
add_op_code_entry(
2022-04-04 13:53:26 +02:00
op_code_dict=op_code_dict, keys=OpCodes.SWITCH_OFF, info=Info.SWITCH_OFF
2022-03-01 18:12:31 +01:00
)
2022-03-01 19:41:24 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.UPDATE_DRO_TO_X8_WAIT,
info="Update DRO to X8 wait time",
)
2022-03-02 15:06:50 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_SSR_TO_DRO_FAILURE,
2022-03-04 10:44:55 +01:00
info="Inject failure SSR to DRO transition",
2022-03-02 15:06:50 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_DRO_TO_X8_FAILURE,
2022-03-04 10:44:55 +01:00
info="Inject failure in DRO to X8 transition",
2022-03-02 15:06:50 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_X8_TO_TX_FAILURE,
2022-03-04 10:44:55 +01:00
info="Inject failure in X8 to TX transition",
2022-03-02 15:06:50 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_TX_TO_MPA_FAILURE,
2022-03-04 10:44:55 +01:00
info="Inject failure in TX to MPA transition",
2022-03-02 15:06:50 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_MPA_TO_HPA_FAILURE,
2022-03-04 10:44:55 +01:00
info="Inject failure in MPA to HPA transition",
2022-03-02 15:06:50 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.INJECT_ALL_ON_FAILURE,
2022-03-04 10:44:55 +01:00
info="Inject failure in all on mode",
2022-03-02 15:06:50 +01:00
)
2022-02-25 19:25:14 +01:00
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.PL_PCDU.value,
info="PL PCDU",
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-02-03 16:02:55 +01:00
def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
2022-04-04 18:46:52 +02:00
from pus_tc.devs.p60dock import P60OpCodes, GomspaceOpCodes, Info
2022-03-04 10:41:05 +01:00
from pus_tc.devs.pdu1 import Pdu1OpCodes
2022-03-04 10:44:55 +01:00
from pus_tc.devs.pdu2 import Pdu2OpCodes
2022-04-08 14:46:01 +02:00
from gomspace.gomspace_common import Info as GsInfo
2022-02-03 16:02:55 +01:00
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-04 18:46:52 +02:00
keys=P60OpCodes.STACK_3V3_ON,
info=Info.STACK_3V3_ON,
2022-02-03 16:02:55 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-04 18:46:52 +02:00
keys=P60OpCodes.STACK_3V3_OFF,
info=Info.STACK_3V3_OFF,
2022-02-03 16:02:55 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-04 18:46:52 +02:00
keys=P60OpCodes.STACK_5V_ON,
info=Info.STACK_5V_ON,
2022-02-03 16:02:55 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-04 18:46:52 +02:00
keys=P60OpCodes.STACK_5V_OFF,
info=Info.STACK_5V_OFF,
2022-02-03 16:02:55 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-08 14:46:01 +02:00
keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE,
info=GsInfo.REQUEST_CORE_HK_ONCE,
2022-02-03 16:02:55 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-08 14:46:01 +02:00
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
info=GsInfo.REQUEST_AUX_HK_ONCE,
)
2022-02-03 16:02:55 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-04 18:46:52 +02:00
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
2022-02-03 16:02:55 +01:00
info="P60 Dock: Print Switches, Voltages, Currents",
)
2022-03-14 14:46:00 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-04 18:46:52 +02:00
keys=GomspaceOpCodes.PRINT_LATCHUPS,
2022-03-14 14:46:00 +01:00
info="P60 Dock: Print Latchups",
)
2022-04-04 18:46:52 +02:00
add_op_code_entry(op_code_dict=op_code_dict, keys=P60OpCodes.TEST, info="P60 Tests")
2022-02-03 16:02:55 +01:00
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.P60DOCK.value,
info="P60 Device",
op_code_entry=op_code_dict,
)
2022-02-04 17:05:27 +01:00
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.TCS_BOARD_ON.value,
info="PDU1: Turn TCS board on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.TCS_BOARD_OFF.value,
info="PDU1: Turn TCS board off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.STAR_TRACKER_ON.value,
info="PDU1: Turn star tracker on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.STAR_TRACKER_OFF.value,
info="PDU1: Turn star tracker off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.SUS_NOMINAL_ON.value,
info="PDU1: Turn SUS nominal on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.SUS_NOMINAL_OFF.value,
info="PDU1: Turn SUS nominal off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.ACS_A_SIDE_ON.value,
info="PDU1: Turn ACS A side on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.ACS_A_SIDE_OFF.value,
info="PDU1: Turn ACS A side off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.SYRLINKS_ON.value,
info="PDU1: Turn Syrlinks on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.SYRLINKS_OFF.value,
info="PDU1: Turn Syrlinks off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.MGT_ON.value,
info="PDU1: Turn MGT on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.MGT_OFF.value,
2022-03-17 19:50:25 +01:00
info="PDU1: Turn MGT off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.PLOC_ON.value,
info="PDU1: Turn PLOC on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.PLOC_OFF.value,
info="PDU1: Turn PLOC off",
2022-02-04 17:05:27 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.SCEX_ON.value,
info="PDU1: Turn Solar Cell Experiment on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu1OpCodes.SCEX_OFF.value,
info="PDU1: Turn Solar Cell Experiment off",
)
2022-03-14 09:56:34 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-08 14:46:01 +02:00
keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE,
info=GsInfo.REQUEST_CORE_HK_ONCE,
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
info=GsInfo.REQUEST_AUX_HK_ONCE,
2022-03-14 09:56:34 +01:00
)
2022-02-04 17:05:27 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-04 18:46:52 +02:00
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
2022-02-04 17:05:27 +01:00
info="PDU1: Print Switches, Voltages, Currents",
)
2022-03-14 15:13:39 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-04 18:46:52 +02:00
keys=GomspaceOpCodes.PRINT_LATCHUPS,
2022-03-14 15:13:39 +01:00
info="PDU1: Print Latchups",
)
add_op_code_entry(
op_code_dict=op_code_dict, keys=Pdu1OpCodes.TESTS.value, info="PDU1 Tests"
)
2022-02-04 17:05:27 +01:00
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name=CustomServiceList.PDU1.value,
info="PDU1 Device",
op_code_entry=op_code_dict,
)
2022-02-03 16:02:55 +01:00
op_code_dict = dict()
2022-03-16 18:44:28 +01:00
add_op_code_entry(op_code_dict=op_code_dict, keys="0", info="PDU2 Tests")
2022-02-03 16:02:55 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.ACS_SIDE_B_ON.value,
info="PDU2: Turn ACS Side B on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.ACS_SIDE_B_OFF.value,
info="PDU2: Turn ACS Side B off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.SUS_REDUNDANT_ON.value,
info="PDU2: Turn SUS redundant on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.SUS_REDUNDANT_OFF.value,
info="PDU2: Turn SUS redundant off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.RW_ON.value,
info="PDU2: Turn reaction wheels on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.RW_OFF.value,
info="PDU2: Turn reaction wheels off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
2022-03-16 18:44:28 +01:00
keys=Pdu2OpCodes.PL_PCDU_VBAT_NOM_ON.value,
info="PDU2: PL PCDU Switch Channel Nominal (1) on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.PL_PCDU_VBAT_NOM_OFF.value,
info="PDU2: PL PCDU Switch Channel Nominal (1) off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.PL_PCDU_VBAT_RED_ON.value,
info="PDU2: PL PCDU Switch Channel Redundant (1) on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.PL_PCDU_VBAT_RED_OFF.value,
info="PDU2: PL PCDU Switch Channel Redundant (1) off",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.TCS_HEATER_IN_ON.value,
info="PDU2: Switch TCS Heater Input on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.TCS_HEATER_IN_OFF.value,
info="PDU2: Switch TCS Heater Input off",
2022-02-03 16:02:55 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.SOLAR_ARRAY_DEPL_ON.value,
info="PDU2: Switch Solar Array Deployment On",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.SOLAR_ARRAY_DEPL_OFF.value,
info="PDU2: Switch Solar Array Deployment Off",
)
2022-03-28 16:49:07 +02:00
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.PL_CAMERA_ON.value,
info="PDU2: Turn payload camera on",
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.PL_CAMERA_OFF.value,
info="PDU2: Turn payload camera off",
)
2022-02-03 16:02:55 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-08 14:46:01 +02:00
keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE,
info=GsInfo.REQUEST_CORE_HK_ONCE,
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
info=GsInfo.REQUEST_AUX_HK_ONCE,
2022-02-03 16:02:55 +01:00
)
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-04 18:46:52 +02:00
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
2022-02-03 16:02:55 +01:00
info="PDU2: Print Switches, Voltages, Currents",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
2022-03-14 15:13:39 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
2022-04-04 18:46:52 +02:00
keys=GomspaceOpCodes.PRINT_LATCHUPS,
2022-03-14 15:13:39 +01:00
info="PDU2: Print Latchups",
)
2022-02-03 16:02:55 +01:00
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
name="pdu2",
info="PDU2 Device",
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
def add_rw_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_rw = {
"0": ("Reaction Wheel: Run all commands", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Reaction Wheel: Set speed", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Reaction Wheel: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("Reaction Wheel: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("Reaction Wheel: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": (
"Reaction Wheel: Send get-telemetry-command",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_rw_tuple = ("Reaction Wheel", op_code_dict_srv_rw)
cmd_dict[CustomServiceList.REACTION_WHEEL_1.value] = service_rw_tuple
cmd_dict[CustomServiceList.REACTION_WHEEL_2.value] = service_rw_tuple
cmd_dict[CustomServiceList.REACTION_WHEEL_3.value] = service_rw_tuple
cmd_dict[CustomServiceList.REACTION_WHEEL_4.value] = service_rw_tuple
def add_rad_sens_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict_srv_rad_sensor = {
"0": ("Radiation Sensor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Radiation Sensor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Radiation Sensor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-03-31 11:36:50 +02:00
"3": ("Radiation Sensor: Start conversions", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("Radiation Sensor: Read conversions", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("Radiation Sensor: Enable debug output", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("Radiation Sensor: Disable debug putput", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-03-02 11:44:39 +01:00
}
service_rad_sensor_tuple = ("Radiation Sensor", op_code_dict_srv_rad_sensor)
cmd_dict[CustomServiceList.RAD_SENSOR.value] = service_rad_sensor_tuple
2022-03-02 11:44:39 +01:00
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-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}),
"4": ("PLOC Supervisor: Restart MPSoC", {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},
),
"14": ("PLOC Supervisor: Update available", {OpCodeDictKeys.TIMEOUT: 2.0}),
"15": ("PLOC Supervisor: Watchdogs enable", {OpCodeDictKeys.TIMEOUT: 2.0}),
"16": (
"PLOC Supervisor: Watchdog Configure Timeout",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"17": ("PLOC Supervisor: Enable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"18": ("PLOC Supervisor: Disable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"19": ("PLOC Supervisor: Auto calibrate alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
"20": ("PLOC Supervisor: Set alert limit", {OpCodeDictKeys.TIMEOUT: 2.0}),
"21": ("PLOC Supervisor: Set alert irq filter", {OpCodeDictKeys.TIMEOUT: 2.0}),
"22": ("PLOC Supervisor: Set ADC sweep period", {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}),
"33": ("PLOC Supervisor: Print CPU stats", {OpCodeDictKeys.TIMEOUT: 2.0}),
"34": ("PLOC Supervisor: Set debug verbosity", {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}),
"43": ("PLOC Supervisor: Terminate supervisor process", {OpCodeDictKeys.TIMEOUT: 2.0}),
"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}),
"49": ("PLOC Supervisor: Enable ADC monitor task", {OpCodeDictKeys.TIMEOUT: 2.0}),
"50": ("PLOC Supervisor: Disable ADC monitor task", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-04-14 07:53:18 +02:00
"51": ("PLOC Supervisor: Logging request event buffers", {OpCodeDictKeys.TIMEOUT: 2.0}),
"52": ("PLOC Supervisor: Logging clear counters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"53": ("PLOC Supervisor: Logging set topic", {OpCodeDictKeys.TIMEOUT: 2.0}),
"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-03-02 11:44:39 +01:00
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
op_code_dict_srv_ploc_updater = {
"0": (
"Ploc Updater: Update uboot on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"1": (
"Ploc Updater: Update bitstream on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"2": (
"Ploc Updater: Update linux on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"3": (
"Ploc Updater: Update application on partition A",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"4": (
"Ploc Updater: Update uboot on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"5": (
"Ploc Updater: Update bitstream on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"6": (
"Ploc Updater: Update linux on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"7": (
"Ploc Updater: Update application on partition B",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
cmd_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
cmd_dict[CustomServiceList.PLOC_UPDATER.value] = service_ploc_updater_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
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
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,
)