eive-tmtc/config/hook_implementations.py

610 lines
26 KiB
Python
Raw Normal View History

2021-03-19 17:39:52 +01:00
import argparse
from typing import Union, Dict, Tuple
from tmtccmd.config.definitions import ServiceOpCodeDictT, HkReplyUnpacked, DataReplyUnpacked
from tmtccmd.tm.service_3_base import Service3Base
from tmtccmd.tc.definitions import TcQueueT
2021-03-23 13:44:33 +01:00
from tmtccmd.com_if.com_interface_base import CommunicationInterface
from tmtccmd.core.backend import TmTcHandler
2021-05-17 17:42:04 +02:00
from tmtccmd.config.hook import TmTcHookBase
2021-03-19 17:39:52 +01:00
from tmtccmd.utility.tmtc_printer import TmTcPrinter
2022-01-18 14:03:56 +01:00
from tmtccmd.config.globals import (
OpCodeDictKeys,
add_op_code_entry,
add_service_op_code_entry,
)
2021-06-29 16:10:03 +02:00
from config.object_ids import RW1_ID
2021-05-17 17:59:24 +02:00
from config.definitions import CustomServiceList
2021-03-19 17:39:52 +01:00
2021-03-19 17:42:36 +01:00
class EiveHookObject(TmTcHookBase):
2021-05-17 17:42:04 +02:00
def get_service_op_code_dictionary(self) -> ServiceOpCodeDictT:
from tmtccmd.config.globals import get_default_service_op_code_dict
2022-01-18 14:03:56 +01:00
2021-05-17 17:59:24 +02:00
service_op_code_dict = get_default_service_op_code_dict()
2021-09-15 15:09:13 +02:00
2021-09-07 13:28:36 +02:00
get_eive_service_op_code_dict(service_op_code_dict=service_op_code_dict)
2021-09-15 15:09:13 +02:00
2021-05-17 17:59:24 +02:00
return service_op_code_dict
2021-05-17 17:42:04 +02:00
def get_json_config_file_path(self) -> str:
2021-08-16 14:20:22 +02:00
"""The user can specify a path and filename for the JSON configuration file by overriding
this function.
2021-05-17 17:42:04 +02:00
:return:
"""
return "config/tmtc_config.json"
2021-03-19 17:39:52 +01:00
def add_globals_pre_args_parsing(self, gui: bool = False):
2021-03-19 17:50:09 +01:00
from config.globals_config import set_globals_pre_args_parsing
2022-01-18 14:03:56 +01:00
2021-03-19 17:50:09 +01:00
set_globals_pre_args_parsing(gui=gui)
2021-03-19 17:39:52 +01:00
def add_globals_post_args_parsing(self, args: argparse.Namespace):
from config.globals_config import add_globals_post_args_parsing
2022-01-18 14:03:56 +01:00
add_globals_post_args_parsing(
args=args, json_cfg_path=self.get_json_config_file_path()
)
def assign_communication_interface(
self, com_if_key: str, tmtc_printer: TmTcPrinter
) -> Union[CommunicationInterface, None]:
2021-05-17 17:42:04 +02:00
from tmtccmd.config.com_if import create_communication_interface_default
2022-01-18 14:03:56 +01:00
2021-05-17 17:42:04 +02:00
return create_communication_interface_default(
2022-01-18 14:03:56 +01:00
com_if_key=com_if_key,
tmtc_printer=tmtc_printer,
json_cfg_path=self.get_json_config_file_path(),
space_packet_ids=(0x0865,),
2021-05-17 17:42:04 +02:00
)
2021-03-19 17:39:52 +01:00
def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int):
from config.custom_mode_op import custom_mode_operation
2022-01-18 14:03:56 +01:00
2021-03-19 17:39:52 +01:00
custom_mode_operation(mode=mode, tmtc_backend=tmtc_backend)
def pack_service_queue(self, service: int, op_code: str, service_queue: TcQueueT):
from pus_tc.tc_packer_hook import pack_service_queue_user
2022-01-18 14:03:56 +01:00
pack_service_queue_user(
service=service, op_code=op_code, service_queue=service_queue
)
2021-03-19 17:39:52 +01:00
2021-05-17 17:42:04 +02:00
def get_object_ids(self) -> Dict[bytes, list]:
from config.object_ids import get_object_ids
2022-01-18 14:03:56 +01:00
2021-05-17 17:42:04 +02:00
return get_object_ids()
2021-03-19 17:39:52 +01:00
@staticmethod
def handle_service_8_telemetry(
2022-01-18 14:03:56 +01:00
object_id: bytes, action_id: int, custom_data: bytearray
) -> DataReplyUnpacked:
2021-03-19 17:39:52 +01:00
from pus_tm.service_8_hook import user_analyze_service_8_data
return user_analyze_service_8_data(
object_id=object_id, action_id=action_id, custom_data=custom_data
)
@staticmethod
def handle_service_3_housekeeping(
2021-06-12 13:48:31 +02:00
object_id: bytes, set_id: int, hk_data: bytearray, service3_packet: Service3Base
) -> HkReplyUnpacked:
2021-03-19 17:39:52 +01:00
from pus_tm.hk_handling import handle_user_hk_packet
return handle_user_hk_packet(
2022-01-18 14:03:56 +01:00
object_id=object_id,
set_id=set_id,
hk_data=hk_data,
service3_packet=service3_packet,
2021-03-19 17:43:18 +01:00
)
2021-06-29 16:10:03 +02:00
@staticmethod
def handle_service_5_event(
2022-01-18 14:03:56 +01:00
object_id: bytes, event_id: int, param_1: int, param_2: int
2021-06-29 16:10:03 +02:00
) -> str:
if object_id == RW1_ID:
if event_id == 1:
return ""
return ""
2021-09-07 13:28:36 +02:00
def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
from pus_tc.pdu1 import Pdu1OpCodes
2021-09-07 14:51:50 +02:00
from pus_tc.pdu2 import Pdu2OpCodes
2021-09-20 11:47:04 +02:00
from pus_tc.p60dock import P60OpCodes
from gomspace.gomspace_common import GomspaceOpCodes
2021-09-08 14:47:33 +02:00
from pus_tc.gps import GpsOpCodes
2022-01-18 14:03:56 +01:00
2021-09-07 13:28:36 +02:00
op_code_dict = {
2022-01-18 14:03:56 +01:00
"reboot": ("Reboot with Prompt", {OpCodeDictKeys.TIMEOUT: 2.0}),
"reboot_self": ("Reboot Self", {OpCodeDictKeys.TIMEOUT: 4.0}),
"reboot_0_0": ("Reboot 0 0", {OpCodeDictKeys.TIMEOUT: 4.0}),
"reboot_0_1": ("Reboot 0 1", {OpCodeDictKeys.TIMEOUT: 4.0}),
"reboot_1_0": ("Reboot 1 0", {OpCodeDictKeys.TIMEOUT: 4.0}),
"reboot_1_1": ("Reboot 1 1", {OpCodeDictKeys.TIMEOUT: 4.0}),
2021-09-07 13:28:36 +02:00
}
2022-01-18 14:03:56 +01:00
service_tuple = ("Core Controller", op_code_dict)
2021-09-07 13:28:36 +02:00
service_op_code_dict[CustomServiceList.CORE.value] = service_tuple
2021-09-08 14:47:33 +02:00
op_code_dict = {
2022-01-18 14:03:56 +01:00
GpsOpCodes.RESET_GNSS.value: ("Reset GPS", {OpCodeDictKeys.TIMEOUT: 2.0})
2021-09-08 14:47:33 +02:00
}
2022-01-18 14:03:56 +01:00
service_tuple = ("GPS 0", op_code_dict)
2021-09-08 14:47:33 +02:00
service_op_code_dict[CustomServiceList.GPS_0.value] = service_tuple
service_op_code_dict[CustomServiceList.GPS_1.value] = service_tuple
2021-09-07 13:28:36 +02:00
op_code_dict = {
"0": ("ACU: Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"51": ("ACU: Print channel statistics", {OpCodeDictKeys.TIMEOUT: 2.0}),
2021-09-07 13:28:36 +02:00
}
service_tuple = ("ACU Devices", op_code_dict)
service_op_code_dict[CustomServiceList.ACU.value] = service_tuple
op_code_dict = {
"0": ("TMP1075 Tests", {OpCodeDictKeys.TIMEOUT: 2.2}),
}
service_tuple = ("TMP1075 1", op_code_dict)
service_op_code_dict[CustomServiceList.TMP1075_1.value] = service_tuple
service_tuple = ("TMP1075 2", op_code_dict)
service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tuple
2022-01-27 15:59:19 +01:00
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict,
keys="0",
info="P60 Tests",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=P60OpCodes.STACK_3V3_ON.value,
info="P60 Dock: Turn stack 3V3 on",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=P60OpCodes.STACK_3V3_OFF.value,
info="P60 Dock: Turn stack 3V3 off",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=P60OpCodes.STACK_5V_ON.value,
info="P60 Dock: Turn stack 5V on",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=P60OpCodes.STACK_5V_OFF.value,
info="P60 Dock: Turn stack 5V off",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=GomspaceOpCodes.PRINT_SWITCH_V_I.value,
info="P60 Dock: Print Switches, Voltages, Currents",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_service_op_code_entry(
srv_op_code_dict=service_op_code_dict,
name=CustomServiceList.P60DOCK.value,
info="P60 Device",
op_code_entry=op_code_dict,
)
2021-09-07 13:28:36 +02:00
op_code_dict_srv_pdu1 = {
"0": ("PDU1 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-18 14:03:56 +01:00
Pdu1OpCodes.TCS_BOARD_ON.value: (
"PDU1: Turn TCS board on",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
Pdu1OpCodes.TCS_BOARD_OFF.value: (
"PDU1: Turn TCS board off",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
Pdu1OpCodes.STAR_TRACKER_ON.value: (
"PDU1: Turn star tracker on",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
Pdu1OpCodes.STAR_TRACKER_OFF.value: (
"PDU1: Turn star tracker off",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
Pdu1OpCodes.SUS_NOMINAL_ON.value: (
"PDU1: Turn SUS nominal on",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
Pdu1OpCodes.SUS_NOMINAL_OFF.value: (
"PDU1: Turn SUS nominal off",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
Pdu1OpCodes.ACS_A_SIDE_ON.value: (
"PDU1: Turn ACS Side A on",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
Pdu1OpCodes.ACS_A_SIDE_OFF.value: (
"PDU1: Turn ACS Side A off",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
Pdu1OpCodes.SYRLINKS_ON.value: (
"PDU1: Turn Syrlinks on",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
Pdu1OpCodes.SYRLINKS_OFF.value: (
"PDU1: Turn Syrlinks off",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2022-01-27 14:53:10 +01:00
Pdu1OpCodes.MGT_ON.value: (
"PDU1: Turn MGT on",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
Pdu1OpCodes.MGT_OFF.value: (
"PDU1: Turn MGT off",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2022-01-18 14:03:56 +01:00
GomspaceOpCodes.PRINT_SWITCH_V_I.value: (
"PDU1: Print Switches, Voltages, Currents",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-09-07 13:28:36 +02:00
}
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
2022-01-18 14:03:56 +01:00
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict,
keys="0",
info="PDU2 Tests",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.ACS_SIDE_B_ON.value,
info="PDU2: Turn ACS Side B on",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.ACS_SIDE_B_OFF.value,
info="PDU2: Turn ACS Side B off",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.SUS_REDUNDANT_ON.value,
info="PDU2: Turn SUS redundant on",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.SUS_REDUNDANT_OFF.value,
info="PDU2: Turn SUS redundant off",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.RW_ON.value,
info="PDU2: Turn reaction wheels on",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.RW_OFF.value,
info="PDU2: Turn reaction wheels off",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
2022-01-18 14:19:08 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
keys=Pdu2OpCodes.Q7S_OFF.value,
info="Q7S Off",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
2022-01-18 14:03:56 +01:00
add_op_code_entry(
op_code_dict=op_code_dict,
keys=GomspaceOpCodes.PRINT_SWITCH_V_I.value,
info="PDU2: Print Switches, Voltages, Currents",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_service_op_code_entry(
srv_op_code_dict=service_op_code_dict,
name="pdu2",
info="PDU2 Device",
op_code_entry=op_code_dict,
)
# service_pdu2_tuple = ("PDU2 Device", op_code_dict_srv_pdu2)
2021-09-07 13:28:36 +02:00
op_code_dict_srv_heater = {
"0": ("Heater Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_heater_tuple = ("Heater Device", op_code_dict_srv_heater)
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)
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}),
2022-01-18 14:03:56 +01:00
"5": (
"Reaction Wheel: Send get-telemetry-command",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-09-07 13:28:36 +02:00
}
service_rw_tuple = ("Reaction Wheel", op_code_dict_srv_rw)
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}),
}
service_rad_sensor_tuple = ("Radiation Sensor", op_code_dict_srv_rad_sensor)
op_code_dict_ploc_mem_dumper = {
"0": ("PLOC Memory Dumper: MRAM dump", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
2022-01-18 14:03:56 +01:00
service_ploc_memory_dumper_tuple = (
"Radiation Sensor",
op_code_dict_ploc_mem_dumper,
)
2021-09-07 13:28:36 +02:00
op_code_dict_srv_ploc_supv = {
"0": ("PLOC Supervisor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("PLOC Supervisor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("PLOC Supervisor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"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}),
2022-01-18 14:03:56 +01:00
"7": (
"PLOC Supervisor: Select MPSoC boot image",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-09-07 13:28:36 +02:00
"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}),
2022-01-18 14:03:56 +01:00
"13": (
"PLOC Supervisor: Request boot status report",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-09-07 13:28:36 +02:00
"14": ("PLOC Supervisor: Update available", {OpCodeDictKeys.TIMEOUT: 2.0}),
"15": ("PLOC Supervisor: Watchdogs enable", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-18 14:03:56 +01:00
"16": (
"PLOC Supervisor: Watchdog Configure Timeout",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-09-07 13:28:36 +02:00
"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}),
2022-01-18 14:03:56 +01:00
"23": (
"PLOC Supervisor: Set ADC enabled channels",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"24": (
"PLOC Supervisor: Set ADC window and stride",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-09-07 13:28:36 +02:00
"25": ("PLOC Supervisor: Set ADC threshold", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-18 14:03:56 +01:00
"26": (
"PLOC Supervisor: Request latchup status report",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-09-07 13:28:36 +02:00
"27": ("PLOC Supervisor: Copy ADC data to MRAM", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-18 14:03:56 +01:00
"28": (
"PLOC Supervisor: Enable/Disable NVM0/1/3",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-09-07 13:28:36 +02:00
"29": ("PLOC Supervisor: Select NVM", {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}),
2022-01-18 14:03:56 +01:00
"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},
),
2021-09-07 13:28:36 +02:00
"41": ("PLOC Supervisor: CAN loopback test", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
op_code_dict_srv_ploc_updater = {
2022-01-18 14:03:56 +01:00
"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},
),
2021-09-07 13:28:36 +02:00
}
service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
op_code_dict_srv_star_tracker = {
2021-12-14 19:25:23 +01:00
"0": ("Star Tracker: Mode On", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Star Tracker: Mode Normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Star Tracker: Mode Off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("Star Tracker: Mode Raw", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("Star Tracker: Ping", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-18 14:03:56 +01:00
"5": (
"Star Tracker: Switch to bootloader program",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-12-14 19:25:23 +01:00
"6": ("Star Tracker: Request temperature", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": ("Star Tracker: Request version", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": ("Star Tracker: Request interface", {OpCodeDictKeys.TIMEOUT: 2.0}),
"9": ("Star Tracker: Request power", {OpCodeDictKeys.TIMEOUT: 2.0}),
"10": ("Star Tracker: Subscribe to telemetry", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-18 14:03:56 +01:00
"11": (
"Star Tracker: Boot image (requires bootloader mode)",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-12-14 19:25:23 +01:00
"12": ("Star Tracker: Request time", {OpCodeDictKeys.TIMEOUT: 2.0}),
"13": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
"14": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"15": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"16": ("Star Tracker: Limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
"17": ("Star Tracker: Tracking", {OpCodeDictKeys.TIMEOUT: 2.0}),
"18": ("Star Tracker: Mounting", {OpCodeDictKeys.TIMEOUT: 2.0}),
"19": ("Star Tracker: Camera", {OpCodeDictKeys.TIMEOUT: 2.0}),
"20": ("Star Tracker: Blob", {OpCodeDictKeys.TIMEOUT: 2.0}),
"21": ("Star Tracker: Centroiding", {OpCodeDictKeys.TIMEOUT: 2.0}),
"22": ("Star Tracker: LISA", {OpCodeDictKeys.TIMEOUT: 2.0}),
"23": ("Star Tracker: Matching", {OpCodeDictKeys.TIMEOUT: 2.0}),
"24": ("Star Tracker: Validation", {OpCodeDictKeys.TIMEOUT: 2.0}),
"25": ("Star Tracker: Algo", {OpCodeDictKeys.TIMEOUT: 2.0}),
"26": ("Star Tracker: Take image", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-01 11:17:01 +01:00
"27": ("Star Tracker: Stop str helper", {OpCodeDictKeys.TIMEOUT: 2.0}),
2021-12-14 19:25:23 +01:00
"28": ("Star Tracker: Reset error signal", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-18 14:03:56 +01:00
"29": (
"Star Tracker: Set name of download image",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"30": ("Star Tracker: Request histogram", {OpCodeDictKeys.TIMEOUT: 2.0}),
2021-12-19 11:35:16 +01:00
"31": ("Star Tracker: Request contrast", {OpCodeDictKeys.TIMEOUT: 2.0}),
2021-12-19 14:49:22 +01:00
"32": ("Star Tracker: Set json filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
"33": ("Star Tracker: Write", {OpCodeDictKeys.TIMEOUT: 2.0}),
2021-12-24 07:32:35 +01:00
"34": ("Star Tracker: Read", {OpCodeDictKeys.TIMEOUT: 2.0}),
"35": ("Star Tracker: Set Read filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
"36": ("Star Tracker: Get checksum", {OpCodeDictKeys.TIMEOUT: 2.0}),
2021-12-29 20:33:49 +01:00
"37": ("Star Tracker: Set time", {OpCodeDictKeys.TIMEOUT: 2.0}),
"38": ("Star Tracker: Download centroid", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-27 16:38:20 +01:00
"39": (
"Star Tracker: Upload centroid (not implemented?)",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-12-29 20:33:49 +01:00
"40": ("Star Tracker: Download matched star", {OpCodeDictKeys.TIMEOUT: 2.0}),
"41": ("Star Tracker: Download DB Image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"42": ("Star Tracker: Download Blob Pixel", {OpCodeDictKeys.TIMEOUT: 2.0}),
"43": ("Star Tracker: Download FPGA Image", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-18 14:03:56 +01:00
"44": (
"Star Tracker: Change download FPGA image name",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-12-30 12:55:24 +01:00
"45": ("Star Tracker: Upload FPGA image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"46": ("Star Tracker: FPGA action", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-17 08:40:16 +01:00
"47": ("Star Tracker: Unlock", {OpCodeDictKeys.TIMEOUT: 2.0}),
"48": ("Star Tracker: Request camera parameter", {OpCodeDictKeys.TIMEOUT: 2.0}),
"49": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
"50": ("Star Tracker: Request blob parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-31 07:40:57 +01:00
"51": ("Star Tracker: Set image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
2021-09-07 13:28:36 +02:00
}
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)
2021-11-24 15:56:25 +01:00
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}),
2022-01-25 18:23:02 +01:00
"4": ("CCSDS Handler: Set arbitrary bitrate", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-31 07:34:20 +01:00
"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}),
2021-11-24 15:56:25 +01:00
}
service_ccsds_handler_tuple = ("CCSDS Handler", op_code_dict_srv_ccsds_handler)
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}),
2021-11-24 15:56:25 +01:00
}
service_pdec_handler_tuple = ("PDEC Handler", op_code_dict_srv_pdec_handler)
2021-12-02 09:25:31 +01:00
op_code_dict_srv_syrlinks_handler = {
"0": ("Syrlinks Handler: Set TX standby", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Syrlinks Handler: Set TX modulation", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Syrlinks Handler: Set TX carrier wave", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("Syrlinks Handler: Read TX status", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": ("Syrlinks Handler: Read TX waveform", {OpCodeDictKeys.TIMEOUT: 2.0}),
2022-01-18 14:03:56 +01:00
"7": (
"Syrlinks Handler: Read TX AGC value high byte ",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"8": (
"Syrlinks Handler: Read TX AGC value low byte ",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
2021-12-02 09:25:31 +01:00
}
2022-01-18 14:03:56 +01:00
service_syrlinks_handler_tuple = (
"Syrlinks Handler",
op_code_dict_srv_syrlinks_handler,
)
2021-12-02 09:25:31 +01:00
2021-09-07 13:28:36 +02:00
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu1_tuple
2022-01-18 14:03:56 +01:00
# service_op_code_dict[CustomServiceList.PDU2.value] = service_pdu2_tuple
2021-09-07 13:28:36 +02:00
service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple
service_op_code_dict[CustomServiceList.IMTQ.value] = service_imtq_tuple
service_op_code_dict[CustomServiceList.REACTION_WHEEL_1.value] = service_rw_tuple
service_op_code_dict[CustomServiceList.REACTION_WHEEL_2.value] = service_rw_tuple
service_op_code_dict[CustomServiceList.REACTION_WHEEL_3.value] = service_rw_tuple
service_op_code_dict[CustomServiceList.REACTION_WHEEL_4.value] = service_rw_tuple
service_op_code_dict[CustomServiceList.RAD_SENSOR.value] = service_rad_sensor_tuple
service_op_code_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
2022-01-18 14:03:56 +01:00
service_op_code_dict[
CustomServiceList.PLOC_UPDATER.value
] = service_ploc_updater_tuple
service_op_code_dict[
CustomServiceList.STAR_TRACKER.value
] = service_star_tracker_tuple
service_op_code_dict[
CustomServiceList.PLOC_MEMORY_DUMPER.value
] = service_ploc_memory_dumper_tuple
service_op_code_dict[
CustomServiceList.CCSDS_HANDLER.value
] = service_ccsds_handler_tuple
service_op_code_dict[
CustomServiceList.PDEC_HANDLER.value
] = service_pdec_handler_tuple
service_op_code_dict[
CustomServiceList.SYRLINKS.value
] = service_syrlinks_handler_tuple