30 lines
1.2 KiB
Python
30 lines
1.2 KiB
Python
import ctypes
|
|
from pymsc.lib1553.datatypes.common_extra import StatusWord, TimeTag
|
|
from pymsc.lib1553.datatypes.navigation import Semicircle, Velocity
|
|
|
|
|
|
class MsgB4Payload(ctypes.Structure):
|
|
"""Message B4: SPT Target - partial typed mapping.
|
|
|
|
Maps status words, time tag, range and normalized position (X,Y,Z) and
|
|
velocity fields where appropriate.
|
|
"""
|
|
_pack_ = 1
|
|
_fields_ = [
|
|
("track_validity_status_1", StatusWord), # B4-01
|
|
("track_validity_status_2", StatusWord), # B4-02
|
|
("time_tag", TimeTag), # B4-03 (two words)
|
|
("target_range", ctypes.c_uint16), # B4-04
|
|
("norm_pos_x", Semicircle), # B4-05
|
|
("norm_pos_y", Semicircle), # B4-06
|
|
("norm_pos_z", Semicircle), # B4-07
|
|
("target_range_rate", ctypes.c_uint16), # B4-08
|
|
("target_velocity_mag", Velocity), # B4-09
|
|
("target_velocity_x", Velocity), # B4-10
|
|
("target_velocity_y", Velocity), # B4-11
|
|
("target_velocity_z", Velocity), # B4-12
|
|
] + [(f"word_{i:02d}", ctypes.c_uint16) for i in range(13, 33)]
|
|
|
|
def __init__(self):
|
|
super().__init__()
|