eive-tmtc/eive_tmtc/pus_tc/cmd_definitions.py

156 lines
6.4 KiB
Python
Raw Normal View History

2022-11-29 16:53:29 +01:00
from eive_tmtc.config.definitions import CustomServiceList
2022-08-18 11:09:35 +02:00
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry, CoreServiceList
2022-08-12 10:22:33 +02:00
from tmtccmd.config.tmtc import (
tmtc_definitions_provider,
call_all_definitions_providers,
)
2022-07-04 18:14:51 +02:00
from tmtccmd.config.globals import get_default_tmtc_defs
def get_eive_service_op_code_dict() -> TmtcDefinitionWrapper:
2022-08-12 10:20:01 +02:00
"""Call all registered TMTC definition providers. They were registered using
the :py:func:`tmtc_definitions_provider` decorator.
"""
2022-07-04 18:14:51 +02:00
def_wrapper = get_default_tmtc_defs()
2022-08-18 11:09:35 +02:00
srv_5 = OpCodeEntry()
srv_5.add("0", "Event Test")
def_wrapper.add_service(
name=CoreServiceList.SERVICE_5.value,
info="PUS Service 5 Event",
op_code_entry=srv_5,
)
call_all_definitions_providers(def_wrapper)
2022-07-04 18:14:51 +02:00
return def_wrapper
@tmtc_definitions_provider
def add_tmp_sens_cmds(defs: TmtcDefinitionWrapper):
2022-07-05 02:12:54 +02:00
oce = OpCodeEntry()
oce.add("0", "TMP1075 Tests")
defs.add_service(CustomServiceList.TMP1075_1.value, "TMP1075 1", oce)
defs.add_service(CustomServiceList.TMP1075_2.value, "TMP1075 2", oce)
@tmtc_definitions_provider
def add_pdec_cmds(defs: TmtcDefinitionWrapper):
2022-07-05 02:12:54 +02:00
oce = OpCodeEntry()
oce.add("0", "PDEC Handler: Print CLCW")
oce.add("1", "PDEC Handler: Print PDEC monitor")
defs.add_service(CustomServiceList.PDEC_HANDLER.value, "PDEC Handler", oce)
@tmtc_definitions_provider
def add_ccsds_cmds(defs: TmtcDefinitionWrapper):
2022-07-05 02:12:54 +02:00
oce = OpCodeEntry()
oce.add("0", "CCSDS Handler: Set low rate")
oce.add("1", "CCSDS Handler: Set high rate")
oce.add("2", "CCSDS Handler: Enable transmitter")
oce.add("3", "CCSDS Handler: Disable transmitter")
oce.add("4", "CCSDS Handler: Set arbitrary bitrate")
oce.add("5", "CCSDS Handler: Enable tx clock manipulator")
oce.add("6", "CCSDS Handler: Disable tx clock manipulator")
oce.add("7", "CCSDS Handler: Update tx data on rising edge")
oce.add("8", "CCSDS Handler: Update tx data on falling edge")
defs.add_service(CustomServiceList.CCSDS_HANDLER.value, "CCSDS Handler", oce)
@tmtc_definitions_provider
def add_str_cmds(defs: TmtcDefinitionWrapper):
2022-07-05 02:12:54 +02:00
oce = OpCodeEntry()
oce.add("0", "Star Tracker: Mode On, Submode Bootloader")
oce.add("1", "Star Tracker: Mode On, Submode Firmware")
oce.add("2", "Star Tracker: Mode Normal")
oce.add("3", "Star Tracker: Mode Off")
oce.add("4", "Star Tracker: Mode Raw")
oce.add("5", "Star Tracker: Ping")
oce.add("6", "Star Tracker: Switch to bootloader program")
oce.add("7", "Star Tracker: Request temperature")
oce.add("8", "Star Tracker: Request version")
oce.add("9", "Star Tracker: Request interface")
oce.add("10", "Star Tracker: Request power")
oce.add("11", "Star Tracker: Set subscription parameters")
oce.add("12", "Star Tracker: Boot image (requires bootloader mode)")
oce.add("13", "Star Tracker: Request time")
oce.add("14", "Star Tracker: Request solution")
oce.add("15", "Star Tracker: Upload image")
oce.add("16", "Star Tracker: Download image")
oce.add("17", "Star Tracker: Set limit parameters")
oce.add("17", "Star Tracker: Set limit parameters")
oce.add("18", "Star Tracker: Set tracking parameters")
oce.add("19", "Star Tracker: Set mounting parameters")
oce.add("20", "Star Tracker: Set camera parameters")
oce.add("22", "Star Tracker: Set centroiding parameters")
oce.add("23", "Star Tracker: Set LISA parameters")
oce.add("24", "Star Tracker: Set matching parameters")
oce.add("25", "Star Tracker: Set validation parameters")
oce.add("26", "Star Tracker: Set algo parameters")
oce.add("27", "Star Tracker: Take image")
oce.add("28", "Star Tracker: Stop str helper")
oce.add("30", "Star Tracker: Set name of download image")
oce.add("31", "Star Tracker: Request histogram")
oce.add("32", "Star Tracker: Request contrast")
oce.add("33", "Star Tracker: Set json filename")
oce.add("35", "Star Tracker: Flash read")
oce.add("36", "Star Tracker: Set flash read filename")
oce.add("37", "Star Tracker: Get checksum")
oce.add("49", "Star Tracker: Request camera parameter")
oce.add("50", "Star Tracker: Request limits")
oce.add("51", "Star Tracker: Set image processor parameters")
oce.add("52", "Star Tracker: (EGSE only) Load camera ground config")
oce.add("53", "Star Tracker: (EGSE only) Load camera flight config")
oce.add("54", "Star Tracker: Request log level parameters")
oce.add("55", "Star Tracker: Request mounting parameters")
oce.add("56", "Star Tracker: Request image processor parameters")
oce.add("57", "Star Tracker: Request centroiding parameters")
oce.add("58", "Star Tracker: Request lisa parameters")
oce.add("59", "Star Tracker: Request matching parameters")
oce.add("60", "Star Tracker: Request tracking parameters")
oce.add("61", "Star Tracker: Request validation parameters")
oce.add("62", "Star Tracker: Request algo parameters")
oce.add("63", "Star Tracker: Request subscription parameters")
oce.add("64", "Star Tracker: Request log subscription parameters")
oce.add("65", "Star Tracker: Request debug camera parameters")
oce.add("66", "Star Tracker: Set log level parameters")
oce.add("67", "Star Tracker: Set log subscription parameters")
oce.add("68", "Star Tracker: Set debug camera parameters")
oce.add("69", "Star Tracker: Firmware update")
oce.add("70", "Star Tracker: Disable timestamp generation")
oce.add("71", "Star Tracker: Enable timestamp generation")
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
@tmtc_definitions_provider
def add_time_cmds(defs: TmtcDefinitionWrapper):
2023-01-16 14:13:06 +01:00
from eive_tmtc.pus_tc.system.time import OpCode, Info
2022-04-09 18:44:04 +02:00
2022-07-05 02:12:54 +02:00
oce = OpCodeEntry()
oce.add(
2023-01-16 14:13:06 +01:00
keys=OpCode.SET_CURRENT_TIME,
2022-04-09 18:44:04 +02:00
info=Info.SET_CURRENT_TIME,
)
2022-07-05 02:12:54 +02:00
defs.add_service(
2022-04-09 18:44:04 +02:00
name=CustomServiceList.TIME.value,
info="Time Service",
2022-07-05 02:12:54 +02:00
op_code_entry=oce,
2022-04-09 18:44:04 +02:00
)
@tmtc_definitions_provider
def add_system_cmds(defs: TmtcDefinitionWrapper):
2022-11-29 16:53:29 +01:00
import eive_tmtc.pus_tc.system.controllers as controllers
2022-07-05 02:12:54 +02:00
oce = OpCodeEntry()
oce.add(
2023-01-16 14:13:06 +01:00
keys=controllers.OpCode.THERMAL_CONTROLLER,
info=controllers.Info.THERMAL_CONTROLLER,
)
2022-07-05 02:12:54 +02:00
oce.add(
2023-01-16 14:13:06 +01:00
keys=controllers.OpCode.CORE_CONTROLLER,
info=controllers.Info.CORE_CONTROLLER,
)
2022-07-05 02:12:54 +02:00
defs.add_service(
name=CustomServiceList.CONTROLLERS.value,
info="Controllers",
2022-07-05 02:12:54 +02:00
op_code_entry=oce,
)