update tmtccmd and add first acs ass cmds

This commit is contained in:
Robin Müller 2022-03-07 10:24:45 +01:00
parent 35ca0d9d6e
commit 859cbf0eb3
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
9 changed files with 36 additions and 39 deletions

View File

@ -66,6 +66,9 @@ STR_IMG_HELPER_ID = bytes([0x44, 0x33, 0x00, 0x02])
PLOC_MPSOC_ID = bytes([0x44, 0x33, 0x00, 0x15]) PLOC_MPSOC_ID = bytes([0x44, 0x33, 0x00, 0x15])
PL_PCDU_ID = bytes([0x44, 0x30, 0x00, 0x00]) PL_PCDU_ID = bytes([0x44, 0x30, 0x00, 0x00])
# System and Assembly Objects
ACS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x01])
class ObjectInfo: class ObjectInfo:
id: int = 0 id: int = 0

View File

@ -1,33 +0,0 @@
import enum
from tmtccmd.tc.definitions import TcQueueT
from spacepackets.ecss.definitions import PusServices
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
from tmtccmd.tc.packer import PusTelecommand
from config.object_ids import (
MGM_0_HANDLER_ID,
)
class AcsOpCodes(enum.Enum):
ALL_ON = "0"
ALL_OFF = "1"
POWER_CYCLE = "2"
# Switch on A side
ON_MGM_0 = "12"
ON_MGM_1 = "13"
ON_GYRO_0 = "14"
ON_GYRO_1 = "15"
# Switch on B side
ON_MGM_2 = "16"
ON_MGM_3 = "17"
ON_GYRO_2 = "18"
ON_GYRO_3 = "19"
def pack_acs_command(tc_queue: TcQueueT, op_code: str):
if op_code == AcsOpCodes.ALL_ON:
pass
if op_code == AcsOpCodes.ON_MGM_0.value:
app_data = pack_mode_data(object_id=MGM_0_HANDLER_ID, mode=Modes.ON, submode=0)
# return PusTelecommand(service=PusServices.SERVICE_200_MODE, subservice=)

View File

@ -39,7 +39,7 @@ def add_bpx_cmd_definitions(cmd_dict: ServiceOpCodeDictT):
def add_core_controller_definitions(cmd_dict: ServiceOpCodeDictT): def add_core_controller_definitions(cmd_dict: ServiceOpCodeDictT):
from pus_tc.core import OpCodes from pus_tc.system.core import OpCodes
od = dict() od = dict()
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, info="Reboot with Prompt")

View File

27
pus_tc/system/acs.py Normal file
View File

@ -0,0 +1,27 @@
import enum
from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
from config.object_ids import ACS_BOARD_ASS_ID
class AcsOpCodes(enum.Enum):
ACS_ASS_A_SIDE = ["0", "a"]
ACS_ASS_B_SIDE = ["1", "b"]
ACS_ASS_DUAL_MODE = ["2", "d"]
class AcsBoardSubmodes(enum.IntEnum):
A_SIDE = 0
B_SIDE = 1
DUAL_SIDE = 2
def pack_acs_command(tc_queue: TcQueueT, op_code: str):
if op_code == AcsOpCodes.ACS_ASS_A_SIDE:
mode_data = pack_mode_data(
object_id=ACS_BOARD_ASS_ID,
mode=Modes.NORMAL,
submode=AcsBoardSubmodes.A_SIDE,
)
pass

View File

@ -26,11 +26,11 @@ from pus_tc.devs.rad_sensor import pack_rad_sensor_test_into
from pus_tc.devs.ploc_upater import pack_ploc_updater_test_into from pus_tc.devs.ploc_upater import pack_ploc_updater_test_into
from pus_tc.devs.ploc_memory_dumper import pack_ploc_memory_dumper_cmd from pus_tc.devs.ploc_memory_dumper import pack_ploc_memory_dumper_cmd
from pus_tc.devs.ccsds_handler import pack_ccsds_handler_test from pus_tc.devs.ccsds_handler import pack_ccsds_handler_test
from pus_tc.core import pack_core_commands from pus_tc.system.core import pack_core_commands
from pus_tc.devs.star_tracker import pack_star_tracker_commands from pus_tc.devs.star_tracker import pack_star_tracker_commands
from pus_tc.devs.syrlinks_hk_handler import pack_syrlinks_command from pus_tc.devs.syrlinks_hk_handler import pack_syrlinks_command
from pus_tc.devs.gps import pack_gps_command from pus_tc.devs.gps import pack_gps_command
from pus_tc.acs import pack_acs_command from pus_tc.system.acs import pack_acs_command
from pus_tc.devs.plpcdu import pack_pl_pcdu_commands from pus_tc.devs.plpcdu import pack_pl_pcdu_commands
from pus_tc.devs.str_img_helper import pack_str_img_helper_command from pus_tc.devs.str_img_helper import pack_str_img_helper_command
from config.definitions import CustomServiceList from config.definitions import CustomServiceList

View File

@ -12,7 +12,7 @@ from tmtccmd.pus.service_17_test import Service17TMExtended
from tmtccmd.tm.service_3_fsfw_housekeeping import Service3FsfwTm from tmtccmd.tm.service_3_fsfw_housekeeping import Service3FsfwTm
from tmtccmd.tm.service_20_fsfw_parameters import Service20FsfwTm from tmtccmd.tm.service_20_fsfw_parameters import Service20FsfwTm
from tmtccmd.tm.service_5_event import Service5Tm from tmtccmd.tm.service_5_event import Service5Tm
from tmtccmd.tm.service_200_mode import Service200Tm from tmtccmd.tm.service_200_fsfw_mode import Service200FsfwTm
from tmtccmd.utility.tmtc_printer import TmTcPrinter, PrintFormats from tmtccmd.utility.tmtc_printer import TmTcPrinter, PrintFormats
from config.definitions import PUS_APID from config.definitions import PUS_APID
@ -49,7 +49,7 @@ def pus_factory_hook(raw_tm_packet: bytearray, tmtc_printer: TmTcPrinter):
if service_type == 20: if service_type == 20:
tm_packet = Service20FsfwTm.unpack(raw_telemetry=raw_tm_packet) tm_packet = Service20FsfwTm.unpack(raw_telemetry=raw_tm_packet)
if service_type == 200: if service_type == 200:
tm_packet = Service200Tm.unpack(raw_telemetry=raw_tm_packet) tm_packet = Service200FsfwTm.unpack(raw_telemetry=raw_tm_packet)
if tm_packet is None: if tm_packet is None:
LOGGER.info( LOGGER.info(
f"The service {service_type} is not implemented in Telemetry Factory" f"The service {service_type} is not implemented in Telemetry Factory"

@ -1 +1 @@
Subproject commit 2660c438a318db1389df561b76512bc994f00497 Subproject commit 67fd6ef97435a6f6098792ab8d04ecba6be5dda4