added assembly mode commands

This commit is contained in:
Robin Müller 2022-05-05 16:23:17 +02:00
parent e616614a04
commit 3bc19a387f
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 14 additions and 8 deletions

View File

@ -11,7 +11,7 @@ from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data
from pus_tc.service_200_mode import pack_mode_data, Modes
class CommandIds:
@ -31,19 +31,19 @@ def pack_rad_sensor_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
if op_code == "0":
tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode on"))
mode_data = pack_mode_data(object_id, 1, 0)
mode_data = pack_mode_data(object_id, Modes.ON, 0)
command = PusTelecommand(service=200, subservice=1, ssc=41, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "1":
tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode normal"))
mode_data = pack_mode_data(object_id, 2, 0)
mode_data = pack_mode_data(object_id, Modes.NORMAL, 0)
command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "2":
tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode off"))
mode_data = pack_mode_data(object_id, 0, 0)
mode_data = pack_mode_data(object_id, Modes.OFF, 0)
command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())

View File

@ -10,7 +10,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
from tmtccmd.config.globals import add_op_code_entry, add_service_op_code_entry
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes, Subservices
from config.definitions import CustomServiceList
@ -161,11 +161,17 @@ def pack_single_rw_test_into(
def pack_rw_ass_cmds(tc_queue: TcQueueT, object_id: bytes, op_code: str):
if op_code in OpCodesAss.OFF:
pass
data = pack_mode_data(object_id=object_id, mode=Modes.OFF, submode=0)
cmd = PusTelecommand(service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=data)
tc_queue.appendleft(cmd.pack_command_tuple())
if op_code in OpCodesAss.ON:
pass
data = pack_mode_data(object_id=object_id, mode=Modes.ON, submode=0)
cmd = PusTelecommand(service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=data)
tc_queue.appendleft(cmd.pack_command_tuple())
if op_code in OpCodesAss.NML:
pass
data = pack_mode_data(object_id=object_id, mode=Modes.NORMAL, submode=0)
cmd = PusTelecommand(service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=data)
tc_queue.appendleft(cmd.pack_command_tuple())
def pack_set_speed_command(object_id: bytes, speed: int, ramp_time: int) -> bytearray: