import ctypes
from .enums import TargetAccurancy

class TrackAccurancy0508(ctypes.Structure):
    _fields_ = [("raw", ctypes.c_uint16)]

    def get_track_05_position_accurancy(self):
        return TargetAccurancy((self.raw >> 14) & 0x03)
    def set_track_05_position_accurancy(self, value):
        self.raw &= ~(0x03 << 14)
        self.raw |= (value << 14)

    def get_track_05_velocity_accurancy(self):
        return TargetAccurancy((self.raw >> 12) & 0x03)
    def set_track_05_velocity_accurancy(self, value):
        self.raw &= ~(0x03 << 12)
        self.raw |= (value << 12)

    def get_track_06_position_accurancy(self):
        return TargetAccurancy((self.raw >> 10) & 0x03)
    def set_track_06_position_accurancy(self, value):
        self.raw &= ~(0x03 << 10)
        self.raw |= (value << 10)

    def get_track_06_velocity_accurancy(self):
        return TargetAccurancy((self.raw >> 8) & 0x03)
    def set_track_06_velocity_accurancy(self, value):
        self.raw &= ~(0x03 << 8)
        self.raw |= (value << 8)

    def get_track_07_position_accurancy(self):
        return TargetAccurancy((self.raw >> 6) & 0x03)
    def set_track_07_position_accurancy(self, value):
        self.raw &= ~(0x03 << 6)
        self.raw |= (value << 6)

    def get_track_07_velocity_accurancy(self):
        return TargetAccurancy((self.raw >> 4) & 0x03)
    def set_track_07_velocity_accurancy(self, value):
        self.raw &= ~(0x03 << 4)
        self.raw |= (value << 4)

    def get_track_08_position_accurancy(self):
        return TargetAccurancy((self.raw >> 2) & 0x03)
    def set_track_08_position_accurancy(self, value):
        self.raw &= ~(0x03 << 2)
        self.raw |= (value << 2)

    def get_track_08_velocity_accurancy(self):
        return TargetAccurancy((self.raw >> 0) & 0x03)
    def set_track_08_velocity_accurancy(self, value):
        self.raw &= ~(0x03 << 0)
        self.raw |= (value << 0)