import ctypes
from Grifo_E_1553lib.data_types.relative_timetag import RelativeTimetag
from Grifo_E_1553lib.data_types.semicircle import Semicircle
from Grifo_E_1553lib.data_types.acceleration import Acceleration
from Grifo_E_1553lib.data_types.velocity import Velocity
from Grifo_E_1553lib.data_types.attitude_rate import AttitudeRate
from Grifo_E_1553lib.data_types.ang_acc import AngAcc

class MsgInuHighSpeed(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("mode_word", ctypes.c_uint16),
        ("timetag", RelativeTimetag),
        ("x_vel", Velocity),
        ("y_vel", Velocity),
        ("z_vel", Velocity),
        ("platform_azimuth", Semicircle),
        ("roll", Semicircle),
        ("pitch", Semicircle),
        ("roll_rate", AttitudeRate),
        ("pitch_rate", AttitudeRate),
        ("yaw_rate", AttitudeRate),
        ("longitudinal_acc", Acceleration),
        ("lateral_acc", Acceleration),
        ("normal_acc", Acceleration),
        ("ptaz_tt", RelativeTimetag),
        ("roll_tt", RelativeTimetag),
        ("pitch_tt", RelativeTimetag),
        ("roll_ang_acc", AngAcc),
        ("pitch_ang_acc", AngAcc),
        ("yaw_ang_acc", AngAcc)
    ]

    def __init__(self):
        super().__init__()
        self.mode_word = ctypes.c_uint16(0)
        self.timetag = RelativeTimetag()
        self.x_vel = Velocity()
        self.y_vel = Velocity()
        self.z_vel = Velocity()
        # self.platform_azimuth = Semicircle()
        # self.roll = Semicircle()
        # self.pitch = Semicircle()
        self.roll_rate = AttitudeRate()
        self.pitch_rate = AttitudeRate()
        self.yaw_rate = AttitudeRate()
        self.longitudinal_acc = Acceleration()
        self.lateral_acc = Acceleration()
        self.normal_acc = Acceleration()
        # self.ptaz_tt = RelativeTimetag()
        # self.roll_tt = RelativeTimetag()
        # self.pitch_tt = RelativeTimetag()
        self.roll_ang_acc = AngAcc()
        self.pitch_ang_acc = AngAcc()
        self.yaw_ang_acc = AngAcc()