32 lines
1.4 KiB
Python
32 lines
1.4 KiB
Python
import ctypes
|
|
from pymsc.lib1553.datatypes.navigation import Semicircle
|
|
from pymsc.lib1553.datatypes.common_extra import LatLong
|
|
|
|
|
|
class MsgA3Payload(ctypes.Structure):
|
|
"""Message A3: Graphic Settings - improved mapping (best-effort).
|
|
|
|
This structure maps common multiword fields to dedicated ctypes where
|
|
evident in the ICD (lat/long pairs, semicircles). Remaining words are
|
|
kept as uint16 placeholders to preserve word count (32 words total).
|
|
"""
|
|
_pack_ = 1
|
|
_fields_ = [
|
|
("graphic_order", ctypes.c_uint16), # A3-01
|
|
("time_to_go", ctypes.c_uint16), # A3-02 (single-word)
|
|
("wp1_lat", LatLong), # A3-03/04
|
|
("wp1_long", LatLong), # A3-05/06
|
|
("wp2_lat", LatLong), # A3-07/08
|
|
("wp2_long", LatLong), # A3-09/10
|
|
("wp3_lat", LatLong), # A3-11/12
|
|
("wp3_long", LatLong), # A3-13/14
|
|
("intercept_fd_x", Semicircle), # A3-15
|
|
("intercept_fd_y", Semicircle), # A3-16
|
|
("intercept_zone_r_min", ctypes.c_uint16), # A3-17
|
|
("intercept_zone_r_max", ctypes.c_uint16), # A3-18
|
|
("no_escape_zone_r_max", ctypes.c_uint16), # A3-19
|
|
] + [(f"word_{i:02d}", ctypes.c_uint16) for i in range(20, 33)]
|
|
|
|
def __init__(self):
|
|
super().__init__()
|