experimenting with new decorator

This commit is contained in:
Robin Müller 2022-08-12 10:04:08 +02:00
parent 0af9d52283
commit 26a886b5a2
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
14 changed files with 42 additions and 26 deletions

2
deps/tmtccmd vendored

@ -1 +1 @@
Subproject commit 5d1612bcdb2ad1bcff39f0401740c7449c092134
Subproject commit b2a48845e514f4c8305ae29dd3b98484ae270fa2

View File

@ -14,37 +14,17 @@ from pus_tc.devs.bpx_batt import BpxOpCodes
from config.definitions import CustomServiceList
from pus_tc.system.tcs import add_tcs_cmds
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.config.tmtc import register_tmtc_definitions, execute_tmtc_def_functions
from tmtccmd.config.globals import get_default_tmtc_defs
def get_eive_service_op_code_dict() -> TmTcDefWrapper:
def_wrapper = get_default_tmtc_defs()
add_bpx_cmd_definitions(defs=def_wrapper)
add_core_controller_definitions(defs=def_wrapper)
add_pl_pcdu_cmds(defs=def_wrapper)
add_pcdu_cmds(defs=def_wrapper)
specify_rtd_cmds(defs=def_wrapper)
add_imtq_cmds(defs=def_wrapper)
add_rad_sens_cmds(defs=def_wrapper)
add_rw_cmds(defs=def_wrapper)
add_ploc_mpsoc_cmds(defs=def_wrapper)
add_power_cmd_defs(defs=def_wrapper)
add_ploc_supv_cmds(defs=def_wrapper)
add_system_cmds(defs=def_wrapper)
add_time_cmds(defs=def_wrapper)
add_syrlinks_cmds(defs=def_wrapper)
add_gps_cmds(defs=def_wrapper)
add_str_cmds(defs=def_wrapper)
add_ccsds_cmds(defs=def_wrapper)
add_pdec_cmds(defs=def_wrapper)
add_heater_cmds(defs=def_wrapper)
add_tcs_cmds(defs=def_wrapper)
add_tmp_sens_cmds(def_wrapper)
add_proc_cmds(def_wrapper)
add_scex_cmds(def_wrapper)
execute_tmtc_def_functions(def_wrapper)
return def_wrapper
@register_tmtc_definitions
def add_tmp_sens_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add("0", "TMP1075 Tests")
@ -52,6 +32,7 @@ def add_tmp_sens_cmds(defs: TmTcDefWrapper):
defs.add_service(CustomServiceList.TMP1075_2.value, "TMP1075 2", oce)
@register_tmtc_definitions
def add_pdec_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add("0", "PDEC Handler: Print CLCW")
@ -59,6 +40,7 @@ def add_pdec_cmds(defs: TmTcDefWrapper):
defs.add_service(CustomServiceList.PDEC_HANDLER.value, "PDEC Handler", oce)
@register_tmtc_definitions
def add_ccsds_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add("0", "CCSDS Handler: Set low rate")
@ -73,6 +55,7 @@ def add_ccsds_cmds(defs: TmTcDefWrapper):
defs.add_service(CustomServiceList.CCSDS_HANDLER.value, "CCSDS Handler", oce)
@register_tmtc_definitions
def add_str_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add("0", "Star Tracker: Mode On, Submode Bootloader")
@ -137,6 +120,7 @@ def add_str_cmds(defs: TmTcDefWrapper):
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
@register_tmtc_definitions
def add_syrlinks_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add("0", "Syrlinks Handler: Set mode off")
@ -160,6 +144,7 @@ def add_syrlinks_cmds(defs: TmTcDefWrapper):
defs.add_service(CustomServiceList.SYRLINKS.value, "Syrlinks Handler", oce)
@register_tmtc_definitions
def add_bpx_cmd_definitions(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(keys=BpxOpCodes.HK, info="Request BPX HK")
@ -176,6 +161,7 @@ def add_bpx_cmd_definitions(defs: TmTcDefWrapper):
)
@register_tmtc_definitions
def add_time_cmds(defs: TmTcDefWrapper):
from pus_tc.system.time import OpCodes, Info
@ -191,6 +177,7 @@ def add_time_cmds(defs: TmTcDefWrapper):
)
@register_tmtc_definitions
def add_imtq_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add("0", "Mode Off")
@ -210,6 +197,7 @@ def add_imtq_cmds(defs: TmTcDefWrapper):
defs.add_service(CustomServiceList.IMTQ.value, "IMQT Device", oce)
@register_tmtc_definitions
def add_ploc_mpsoc_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add("0", "Ploc MPSoC: Set mode off")
@ -234,6 +222,7 @@ def add_ploc_mpsoc_cmds(defs: TmTcDefWrapper):
defs.add_service(CustomServiceList.PLOC_MPSOC.value, "Ploc MPSoC", oce)
@register_tmtc_definitions
def add_ploc_supv_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add("0", "PLOC Memory Dumper: MRAM dump")
@ -287,6 +276,7 @@ def add_ploc_supv_cmds(defs: TmTcDefWrapper):
defs.add_service(CustomServiceList.PLOC_SUPV.value, "PLOC Supervisor", oce)
@register_tmtc_definitions
def add_system_cmds(defs: TmTcDefWrapper):
from pus_tc.system.acs import AcsOpCodes, SusOpCodes
import pus_tc.system.tcs as tcs

View File

@ -7,6 +7,7 @@ import struct
from config.definitions import CustomServiceList
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.config.tmtc import register_tmtc_definitions
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import (
@ -48,6 +49,7 @@ class Info:
TEST = "ACU Test"
@register_tmtc_definitions
def add_acu_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(

View File

@ -2,6 +2,7 @@ import enum
from config.definitions import CustomServiceList
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.config.tmtc import register_tmtc_definitions
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
from tmtccmd.logging import get_console_logger
@ -24,6 +25,7 @@ class SetIds:
HK = 0
@register_tmtc_definitions
def add_gps_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.RESET_GNSS, info=Info.RESET_GNSS)

View File

@ -8,6 +8,7 @@ import enum
from config.definitions import CustomServiceList
from config.object_ids import get_object_ids
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.config.tmtc import register_tmtc_definitions
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.util.obj_id import ObjectIdU32
from tmtccmd.tc.pus_201_fsfw_health import (
@ -53,6 +54,7 @@ class ActionIds(enum.IntEnum):
SWITCH_HEATER = 0
@register_tmtc_definitions
def add_heater_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.HEATER_CMD, info=Info.HEATER_CMD)

View File

@ -6,7 +6,7 @@ from typing import Optional
from config.definitions import CustomServiceList
from tmtccmd.config import TmTcDefWrapper
from tmtccmd.config.tmtc import OpCodeEntry
from tmtccmd.config.tmtc import OpCodeEntry, register_tmtc_definitions
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import (
make_sid,
@ -115,6 +115,7 @@ class ParamIds(enum.IntEnum):
INJECT_ALL_ON_FAILURE = 35
@register_tmtc_definitions
def add_pl_pcdu_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.SWITCH_HPA_ON_PROC, info=Info.SWITCH_HPA_ON_PROC)

View File

@ -12,8 +12,10 @@ from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from pus_tc.devs.p60dock import P60OpCodes, GomspaceOpCodes, P60Info
from pus_tc.devs.acu import add_acu_cmds
from tmtccmd.config.tmtc import register_tmtc_definitions
@register_tmtc_definitions
def add_p60_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(keys=P60OpCodes.STACK_3V3_ON, info=P60Info.STACK_3V3_ON)
@ -33,6 +35,7 @@ def add_p60_cmds(defs: TmTcDefWrapper):
)
@register_tmtc_definitions
def add_power_cmd_defs(defs: TmTcDefWrapper):
oce = OpCodeEntry()
add_pdu1_common_defs(oce)
@ -47,6 +50,7 @@ def add_power_cmd_defs(defs: TmTcDefWrapper):
)
@register_tmtc_definitions
def add_pdu1_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
add_pdu1_common_defs(oce)
@ -65,6 +69,7 @@ def add_pdu1_cmds(defs: TmTcDefWrapper):
)
@register_tmtc_definitions
def add_pdu2_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
add_pdu2_common_defs(oce)
@ -91,6 +96,7 @@ def add_pdu2_cmds(defs: TmTcDefWrapper):
)
@register_tmtc_definitions
def add_pcdu_cmds(defs: TmTcDefWrapper):
add_p60_cmds(defs)
add_pdu1_cmds(defs)

View File

@ -12,6 +12,7 @@ from config.definitions import CustomServiceList
from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data, Modes
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.config.tmtc import register_tmtc_definitions
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
from tmtccmd.util import ObjectIdU32
@ -46,6 +47,7 @@ class CommandIds:
DISABLE_DEBUG_OUTPUT = 5
@register_tmtc_definitions
def add_rad_sens_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(info=Info.ON, keys=OpCodes.ON)

View File

@ -7,6 +7,7 @@
import struct
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.config.tmtc import register_tmtc_definitions
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import (
generate_one_hk_command,
@ -75,6 +76,7 @@ class RampTime:
MS_1000 = 1000
@register_tmtc_definitions
def add_rw_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(info=InfoDevs.SPEED, keys=OpCodesDevs.SPEED)

View File

@ -4,6 +4,7 @@ from config.definitions import CustomServiceList
from pus_tc.devs.pdec_handler import CommandIds
from spacepackets.ecss import PusTelecommand
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.config.tmtc import register_tmtc_definitions
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.util import ObjectIdU32
@ -45,6 +46,7 @@ class Info:
WIRTE_CONFIG = "Write config"
@register_tmtc_definitions
def specify_rtd_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.ON, info=Info.ON)

View File

@ -2,6 +2,7 @@ import enum
import json
from config.definitions import CustomServiceList
from tmtccmd.config.tmtc import register_tmtc_definitions
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from tmtccmd.config import OpCodeEntry, TmTcDefWrapper
@ -44,6 +45,7 @@ class Info:
FRAM = "Read FRAM"
@register_tmtc_definitions
def add_scex_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.PING, info=Info.PING)

View File

@ -7,7 +7,7 @@ from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from tmtccmd.logging import get_console_logger
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
from tmtccmd.config.tmtc import OpCodeEntry
from tmtccmd.config.tmtc import OpCodeEntry, register_tmtc_definitions
from config.object_ids import CORE_CONTROLLER_ID
@ -67,6 +67,7 @@ class Copy(enum.IntEnum):
NONE = 2
@register_tmtc_definitions
def add_core_controller_definitions(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.REBOOT_XSC, info=Info.REBOOT_XSC)

View File

@ -8,6 +8,7 @@ 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 TmTcDefWrapper, OpCodeEntry
from tmtccmd.config.tmtc import register_tmtc_definitions
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_11_tc_sched import (
@ -126,6 +127,7 @@ def generic_print(q: DefaultPusQueueHelper, info: dict):
q.add_log_cmd(f"Executing {info[1]} Procedure (OpCodes: {info[0]})")
@register_tmtc_definitions
def add_proc_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
for proc_entry in PROC_INFO_DICT.values():

View File

@ -2,6 +2,7 @@ import enum
from config.definitions import CustomServiceList
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
from tmtccmd.config.tmtc import register_tmtc_definitions
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_200_fsfw_modes import Modes
from tmtccmd.tc.pus_3_fsfw_hk import (
@ -32,6 +33,7 @@ class SetIds(enum.IntEnum):
SUS_TEMP_SENSORS = 2
@register_tmtc_definitions
def add_tcs_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
oce.add(