added first ACS ASS command

This commit is contained in:
Robin Müller 2022-03-07 11:07:54 +01:00
parent 859cbf0eb3
commit 0bdc8f04a8
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
7 changed files with 38 additions and 12 deletions

View File

@ -42,3 +42,4 @@ class CustomServiceList(enum.Enum):
PDEC_HANDLER = "pdec_handler" PDEC_HANDLER = "pdec_handler"
STR_IMG_HELPER = "str_img_helper" STR_IMG_HELPER = "str_img_helper"
SYRLINKS = "syrlinks" SYRLINKS = "syrlinks"
ACS_ASS = "acs-ass"

View File

@ -125,6 +125,7 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
add_rw_cmds, add_rw_cmds,
add_rad_sens_cmds, add_rad_sens_cmds,
add_ploc_cmds, add_ploc_cmds,
add_system_cmds
) )
from pus_tc.devs.gps import GpsOpCodes from pus_tc.devs.gps import GpsOpCodes
@ -136,6 +137,7 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
add_rad_sens_cmds(cmd_dict=service_op_code_dict) add_rad_sens_cmds(cmd_dict=service_op_code_dict)
add_rw_cmds(cmd_dict=service_op_code_dict) add_rw_cmds(cmd_dict=service_op_code_dict)
add_ploc_cmds(cmd_dict=service_op_code_dict) add_ploc_cmds(cmd_dict=service_op_code_dict)
add_system_cmds(cmd_dict=service_op_code_dict)
op_code_dict = { op_code_dict = {
GpsOpCodes.RESET_GNSS.value: ("Reset GPS", {OpCodeDictKeys.TIMEOUT: 2.0}) GpsOpCodes.RESET_GNSS.value: ("Reset GPS", {OpCodeDictKeys.TIMEOUT: 2.0})

View File

@ -511,3 +511,20 @@ def add_ploc_cmds(cmd_dict: ServiceOpCodeDictT):
cmd_dict[ cmd_dict[
CustomServiceList.PLOC_MEMORY_DUMPER.value CustomServiceList.PLOC_MEMORY_DUMPER.value
] = service_ploc_memory_dumper_tuple ] = service_ploc_memory_dumper_tuple
def add_system_cmds(cmd_dict: ServiceOpCodeDictT):
from pus_tc.system.acs import AcsOpCodes
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",
)
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,
)

View File

@ -1,10 +1,11 @@
import enum import enum
from tmtccmd.tc.definitions import TcQueueT from tmtccmd.tc.definitions import TcQueueT, QueueCommands
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices
from config.object_ids import ACS_BOARD_ASS_ID from config.object_ids import ACS_BOARD_ASS_ID
class AcsOpCodes(enum.Enum): class AcsOpCodes:
ACS_ASS_A_SIDE = ["0", "a"] ACS_ASS_A_SIDE = ["0", "a"]
ACS_ASS_B_SIDE = ["1", "b"] ACS_ASS_B_SIDE = ["1", "b"]
ACS_ASS_DUAL_MODE = ["2", "d"] ACS_ASS_DUAL_MODE = ["2", "d"]
@ -17,11 +18,16 @@ class AcsBoardSubmodes(enum.IntEnum):
def pack_acs_command(tc_queue: TcQueueT, op_code: str): def pack_acs_command(tc_queue: TcQueueT, op_code: str):
if op_code == AcsOpCodes.ACS_ASS_A_SIDE: if op_code in AcsOpCodes.ACS_ASS_A_SIDE:
tc_queue.appendleft((QueueCommands.PRINT, "Switching to ACS board assembly A side"))
mode_data = pack_mode_data( mode_data = pack_mode_data(
object_id=ACS_BOARD_ASS_ID, object_id=ACS_BOARD_ASS_ID,
mode=Modes.NORMAL, mode=Modes.NORMAL,
submode=AcsBoardSubmodes.A_SIDE, submode=AcsBoardSubmodes.A_SIDE,
) )
cmd = PusTelecommand(
pass service=200,
subservice=Subservices.COMMAND_MODE_COMMAND,
app_data=mode_data
)
tc_queue.appendleft(cmd.pack_command_tuple())

View File

@ -195,6 +195,8 @@ def pack_service_queue_user(
) )
if service == CustomServiceList.PL_PCDU.value: if service == CustomServiceList.PL_PCDU.value:
return pack_pl_pcdu_commands(tc_queue=service_queue, op_code=op_code) return pack_pl_pcdu_commands(tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.ACS_ASS.value:
return pack_acs_command(tc_queue=service_queue, op_code=op_code)
LOGGER.warning("Invalid Service !") LOGGER.warning("Invalid Service !")

View File

@ -27,6 +27,7 @@ limitations under the License.
@author R. Mueller @author R. Mueller
""" """
import sys import sys
import traceback
try: try:
from tmtccmd.runner import ( from tmtccmd.runner import (
@ -39,12 +40,9 @@ try:
except ImportError as error: except ImportError as error:
run_tmtc_commander = None run_tmtc_commander = None
initialize_tmtc_commander = None initialize_tmtc_commander = None
print(error) tb = traceback.format_exc()
print(tb)
print("Python tmtccmd submodule could not be imported") print("Python tmtccmd submodule could not be imported")
print(
'Install with "cd tmtccmd && python3 -m pip '
'install -e .[gui]" for interactive installation'
)
sys.exit(1) sys.exit(1)
try: try:

@ -1 +1 @@
Subproject commit 67fd6ef97435a6f6098792ab8d04ecba6be5dda4 Subproject commit 0f4d4730ab35163c5a06138f4b54e4eaf89bc24c