import ctypes
from Grifo_E_1553lib.data_types.tws_status_and_targets import ValitidyWordAndHptIdentifier, TrackPriority0104, TrackPriority0508,TrackPriority0910, TrackAccurancy0104, TrackAccurancy0508, TrackIdOfTwsTrackedTarget0102, TrackIdOfTwsTrackedTarget0304, TrackIdOfTwsTrackedTarget0506, TrackIdOfTwsTrackedTarget0708
from Grifo_E_1553lib.data_types.x_display_coord_of_the_hpt_target import XDisplayCoordOfTheHptTarget
from Grifo_E_1553lib.data_types.y_display_coord_of_the_hpt_target import YDisplayCoordOfTheHptTarget
from Grifo_E_1553lib.data_types.target_velocity_magnitude  import TargetVelocityMagnitude
from Grifo_E_1553lib.data_types.tws_velocity import TwsVelocity
from Grifo_E_1553lib.data_types.relative_timetag import RelativeTimetag
from Grifo_E_1553lib.data_types.track_validity_and_status_word import TrackValidityAndStatusWord1, TrackValidityAndStatusWord2
from Grifo_E_1553lib.data_types.target_display_coordinate import TargetXDisplayCoordinate,TargetYDisplayCoordinate
from Grifo_E_1553lib.data_types.target_identifier import TargetIdentifier


class TrackedTarget02_10(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("track_validity_and_status_word_1", TrackValidityAndStatusWord1),
        ("track_validity_and_status_word_2", TrackValidityAndStatusWord2),
        ("time_tag", RelativeTimetag),
        ("target_range", ctypes.c_uint16),
        ("normalized_target_position_x", ctypes.c_int16),
        ("normalized_target_position_y", ctypes.c_int16),
        ("normalized_target_position_z", ctypes.c_int16),
        ("target_range_rate", ctypes.c_int16),
        ("target_velocity", ctypes.c_uint16),
        ("target_velocity_x", ctypes.c_int16),
        ("target_velocity_y", ctypes.c_int16),
        ("target_velocity_z", ctypes.c_int16),
        ("target_acceleration", ctypes.c_uint16),
        ("target_acceleration_x", ctypes.c_int16),
        ("target_acceleration_y", ctypes.c_int16),
        ("target_acceleration_z", ctypes.c_int16),
        ("target_aspect_angle", ctypes.c_int16),
        ("target_cas", ctypes.c_uint16),
        ("target_mach_number", ctypes.c_uint16),
        ("target_x_display_coordinate", TargetXDisplayCoordinate),
        ("target_y_display_coordinate", TargetYDisplayCoordinate),
        ("standard_deviation_of_position_x_estimate", ctypes.c_uint16),
        ("standard_deviation_of_position_y_estimate", ctypes.c_uint16),
        ("standard_deviation_of_position_z_estimate", ctypes.c_uint16),
        ("reserved_word_1", ctypes.c_int16),
        ("reserved_word_2", ctypes.c_int16),
        ("target_identifier", TargetIdentifier),
    ]
    
class TrackedTarget01(TrackedTarget02_10):
    _pack_ = 1
    _fields_ =TrackedTarget02_10._fields_ + [
        ("validity_word_and_hpt_identifier",ValitidyWordAndHptIdentifier),
        ("track_priority_(targets_01_to_04)",TrackPriority0104),
        ("track_priority_(targets_05_to_08)",TrackPriority0508),
        ("track_priority_(targets_09_to_10)",TrackPriority0910)
    ] 
