fixes in procedures and hk handling

This commit is contained in:
Jakob Meier 2022-06-03 18:04:59 +02:00
parent ae0217066b
commit 58ed46e110
4 changed files with 35 additions and 28 deletions

View File

@ -5,6 +5,8 @@
@author J. Meier @author J. Meier
@date 25.03.2021 @date 25.03.2021
""" """
import struct
from tmtccmd.config.definitions import QueueCommands from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
@ -276,11 +278,10 @@ def pack_dipole_command(
command is sent. command is sent.
""" """
action_id = ImtqActionIds.start_actuation_dipole action_id = ImtqActionIds.start_actuation_dipole
command = bytearray()
command = object_id + action_id command = object_id + action_id
command.extend(x_dipole.to_bytes(length=2, byteorder="big")) command += struct.pack('!h', x_dipole)
command.extend(y_dipole.to_bytes(length=2, byteorder="big")) command += struct.pack('!h', y_dipole)
command.extend(z_dipole.to_bytes(length=2, byteorder="big")) command += struct.pack('!h', z_dipole)
command.extend(duration.to_bytes(length=2, byteorder="big")) command += struct.pack('!h', duration)
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command) command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
return command return command

View File

@ -210,7 +210,7 @@ def pack_generic_hk_listening_cmds(
) )
if not cfg.use_tc_sched: if not cfg.use_tc_sched:
tc_queue.appendleft((QueueCommands.WAIT, 120)) tc_queue.appendleft((QueueCommands.WAIT, 60))
sid_list.clear() sid_list.clear()
diag_list.clear() diag_list.clear()
@ -332,7 +332,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
False, False,
True, True,
False, False,
False True
] ]
pack_acs_command(tc_queue=tc_queue, op_code="acs-a") pack_acs_command(tc_queue=tc_queue, op_code="acs-a")
@ -358,7 +358,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
False, False,
True, True,
False, False,
False True
] ]
for b_side_dev in b_side_pairs: for b_side_dev in b_side_pairs:
@ -393,7 +393,7 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
False, False,
True, True,
False, False,
False, True,
] ]
pack_generic_hk_listening_cmds( pack_generic_hk_listening_cmds(
tc_queue=tc_queue, tc_queue=tc_queue,
@ -413,12 +413,15 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET), (oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET),
] ]
diag_list = [ diag_list = [
False, True,
False, True,
False, True,
] ]
# mgt 1: imtq und hk # Command MGT to mode on
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="1")
tc_queue.appendleft((QueueCommands.WAIT, 5))
# Command MGT to normal mode
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="2") pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="2")
for imtq_dev in imtq_pairs: for imtq_dev in imtq_pairs:
@ -456,23 +459,24 @@ def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
diag_list = [ diag_list = [
False, False,
False, False,
True,
False,
True,
False, False,
False, False,
Truehk,
False, False,
False, True,
False, True,
False, True,
False, True,
False,
False,
False,
False,
] ]
pack_acs_command(tc_queue=tc_queue, op_code="acs-d") pack_acs_command(tc_queue=tc_queue, op_code="acs-d")
# mgt 2.: imtq + dual side + dipole # Command MGT to mode on
pack_imtq_test_into( pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="1")
object_id=oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="2" tc_queue.appendleft((QueueCommands.WAIT, 20))
) # Command MGT to normal mode
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="2")
for d_side_and_imtq_dev in d_side_and_imtq_pairs: for d_side_and_imtq_dev in d_side_and_imtq_pairs:
oid = d_side_and_imtq_dev[0] oid = d_side_and_imtq_dev[0]

View File

@ -60,7 +60,7 @@ def handle_adis_gyro_hk(
def handle_l3g_gyro_hk( def handle_l3g_gyro_hk(
object_id: ObjectId, printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes object_id: ObjectId, printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes
): ):
if set_id == L3gGyroSetIds: if set_id == L3gGyroSetIds.CORE_HK:
pw = PrintWrapper(printer) pw = PrintWrapper(printer)
fmt_str = "!ffff" fmt_str = "!ffff"
inc_len = struct.calcsize(fmt_str) inc_len = struct.calcsize(fmt_str)

View File

@ -10,8 +10,10 @@ import config.object_ids as obj_ids
def handle_mgm_hk_data( def handle_mgm_hk_data(
object_id: ObjectId, printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes object_id: ObjectId, printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes
): ):
if object_id in [obj_ids.MGM_0_LIS3_HANDLER_ID, obj_ids.MGM_2_LIS3_HANDLER_ID]: if object_id.as_bytes in [obj_ids.MGM_0_LIS3_HANDLER_ID, obj_ids.MGM_2_LIS3_HANDLER_ID]:
handle_mgm_lis3_hk_data(object_id, printer, set_id, hk_data) handle_mgm_lis3_hk_data(object_id, printer, set_id, hk_data)
elif object_id.as_bytes in [obj_ids.MGM_1_RM3100_HANDLER_ID, obj_ids.MGM_3_RM3100_HANDLER_ID]:
handle_mgm_rm3100_hk_data(object_id, printer, set_id, hk_data)
pass pass
@ -23,7 +25,7 @@ def handle_mgm_lis3_hk_data(
fmt_str = "!ffff" fmt_str = "!ffff"
inc_len = struct.calcsize(fmt_str) inc_len = struct.calcsize(fmt_str)
(field_x, field_y, field_z, temp) = struct.unpack( (field_x, field_y, field_z, temp) = struct.unpack(
fmt_str, hk_data[0 : 0 + inc_len] fmt_str, hk_data[0: 0 + inc_len]
) )
pw.dlog(f"Received MGM LIS3 from object {object_id}") pw.dlog(f"Received MGM LIS3 from object {object_id}")
pw.dlog( pw.dlog(