from enum import IntEnum
from typing import Tuple
from UniTAP.dev.modules.dut_tests.test_utils import CMTFormat, CMTVSCFormat, CMTBitDepth, CMTVSCBitDepth,\
    make_cf, make_vsc_cf
from UniTAP.dev.modules.dut_tests.test_group_params_types import Param


class Timing:
    """
    Class `Timing` describes available supported timings standard.
    - CTA `cta` (enable/disable).
    - RB1 `rb1` (enable/disable).
    - RB2 `rb2` (enable/disable).
    - Set all standards `set_all`.
    """
    def __init__(self, timing_value):
        self.__value = Param(timing_value)

    @property
    def cta(self) -> bool:
        """
        Set and get CTA flag support.

        Returns:
            object of bool type
        """
        return bool(self.__value._get_by_bitmask(0))

    @property
    def rb1(self) -> bool:
        """
        Set and get RB1 flag support.

        Returns:
            object of bool type
        """
        return bool(self.__value._get_by_bitmask(1))

    @property
    def rb2(self) -> bool:
        """
        Set and get RB2 flag support.

        Returns:
            object of bool type
        """
        return bool(self.__value._get_by_bitmask(2))

    @cta.setter
    def cta(self, value: bool):
        self.__value._set_by_bitmask(value, 0)

    @rb1.setter
    def rb1(self, value: bool):
        self.__value._set_by_bitmask(value, 1)

    @rb2.setter
    def rb2(self, value: bool):
        self.__value._set_by_bitmask(value, 2)

    def set_all(self):
        self.cta = True
        self.rb1 = True
        self.rb2 = True

    def clear_all(self):
        self.cta = False
        self.rb1 = False
        self.rb2 = False


class ColorimetryDp14:
    """
        Class `ColorimetryDp14` describes optional and additional color modes to be used with DP CTS tests.
        - RGB 8 bpc VESA `rgb_8bpc_vesa`.
        - RGB 10 bpc VESA `rgb_10bpc_vesa`.
        - RGB 12 bpc VESA `rgb_12bpc_vesa`.
        - YCbCr-444 8 bpc CTA ITU-709 `ycbcr444_8bpc_cta_itu709`.
        - YCbCr-444 10 bpc CTA ITU-709 `ycbcr444_10bpc_cta_itu709`.
        - YCbCr-444 12 bpc CTA ITU-709 `ycbcr444_12bpc_cta_itu709`.
        - YCbCr-422 8 bpc CTA ITU-709 `ycbcr422_8bpc_cta_itu709`.
        - YCbCr-422 10 bpc CTA ITU-709 `ycbcr422_10bpc_cta_itu709`.
        - YCbCr-422 12 bpc CTA ITU-709 `ycbcr422_10bpc_cta_itu709`.
        - YCbCr-422 simple 8 bpc CTA ITU-709 `ycbcr422_simple_8bpc_cta_itu709`.
        - YCbCr-422 simple 10 bpc CTA ITU-709 `ycbcr422_simple_10bpc_cta_itu709`.
        - YCbCr-422 simple 12 bpc CTA ITU-709 `ycbcr422_simple_12bpc_cta_itu709`.
        - YCbCr-420 8 bpc CTA ITU-709 `ycbcr420_8bpc_cta_itu709`.
        - YCbCr-420 10 bpc CTA ITU-709 `ycbcr420_10bpc_cta_itu709`.
        - YCbCr-420 12 bpc CTA ITU-709 `ycbcr420_12bpc_cta_itu709`.
        - Clear all settings `clear_all`.
        - Select all settings `select_all`.
        """
    def __init__(self, json_obj):
        self.__rgb_8bpc_vesa = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_0"])
        self.__rgb_10bpc_vesa = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_1"])
        self.__rgb_12bpc_vesa = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_2"])

        self.__ycbcr444_8bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_3"])
        self.__ycbcr444_10bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_4"])
        self.__ycbcr444_12bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_5"])

        self.__ycbcr422_8bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_6"])
        self.__ycbcr422_10bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_7"])
        self.__ycbcr422_12bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_8"])

        self.__ycbcr422_simple_8bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_9"])
        self.__ycbcr422_simple_10bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_10"])
        self.__ycbcr422_simple_12bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_11"])

        self.__ycbcr420_8bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_12"])
        self.__ycbcr420_10bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_13"])
        self.__ycbcr420_12bpc_cta_itu709 = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_MODE_14"])

        # Pass 126-142

        self.__color_formats = Param(json_obj["TSI_DP14_SRCCTS_DSC_COLOR_FORMATS"])
        self.__color_formats.default_value = 32

    def clear_all(self):
        """
        Clear all modes (disable).
        """
        self.rgb_8bpc_vesa = False
        self.rgb_10bpc_vesa = False
        self.rgb_12bpc_vesa = False

        self.ycbcr444_8bpc_cta_itu709 = False
        self.ycbcr444_10bpc_cta_itu709 = False
        self.ycbcr444_12bpc_cta_itu709 = False

        self.ycbcr422_8bpc_cta_itu709 = False
        self.ycbcr422_10bpc_cta_itu709 = False
        self.ycbcr422_12bpc_cta_itu709 = False

        self.ycbcr422_simple_8bpc_cta_itu709 = False
        self.ycbcr422_simple_10bpc_cta_itu709 = False
        self.ycbcr422_simple_12bpc_cta_itu709 = False

        self.ycbcr420_8bpc_cta_itu709 = False
        self.ycbcr420_10bpc_cta_itu709 = False
        self.ycbcr420_12bpc_cta_itu709 = False

    def select_all(self):
        """
        Select all modes (enable).
        """
        self.rgb_8bpc_vesa = True
        self.rgb_10bpc_vesa = True
        self.rgb_12bpc_vesa = True

        self.ycbcr444_8bpc_cta_itu709 = True
        self.ycbcr444_10bpc_cta_itu709 = True
        self.ycbcr444_12bpc_cta_itu709 = True

        self.ycbcr422_8bpc_cta_itu709 = True
        self.ycbcr422_10bpc_cta_itu709 = True
        self.ycbcr422_12bpc_cta_itu709 = True

        self.ycbcr422_simple_8bpc_cta_itu709 = True
        self.ycbcr422_simple_10bpc_cta_itu709 = True
        self.ycbcr422_simple_12bpc_cta_itu709 = True

        self.ycbcr420_8bpc_cta_itu709 = True
        self.ycbcr420_10bpc_cta_itu709 = True
        self.ycbcr420_12bpc_cta_itu709 = True

    @property
    def rgb_8bpc_vesa(self):
        """
        Set and get RGB 8 bpc VESA flag support.

        Returns:
            object
        """
        return self.__rgb_8bpc_vesa

    @rgb_8bpc_vesa.setter
    def rgb_8bpc_vesa(self, value: bool):
        cf_value = make_cf(CMTFormat.RGB_LEGACY, CMTBitDepth.BPC_8) if value else 0
        if self.__rgb_8bpc_vesa.default_value != cf_value:
            self.__rgb_8bpc_vesa.default_value = cf_value

    @property
    def rgb_10bpc_vesa(self):
        """
        Set and get RGB 10 bpc VESA flag support.

        Returns:
            object
        """
        return self.__rgb_10bpc_vesa

    @rgb_10bpc_vesa.setter
    def rgb_10bpc_vesa(self, value: bool):
        cf_value = make_cf(CMTFormat.RGB_LEGACY, CMTBitDepth.BPC_10) if value else 0
        if self.__rgb_10bpc_vesa.default_value != cf_value:
            self.__rgb_10bpc_vesa.default_value = cf_value

    @property
    def rgb_12bpc_vesa(self):
        """
        Set and get RGB 12 bpc VESA flag support.

        Returns:
            object
        """
        return self.__rgb_12bpc_vesa

    @rgb_12bpc_vesa.setter
    def rgb_12bpc_vesa(self, value: bool):
        cf_value = make_cf(CMTFormat.RGB_LEGACY, CMTBitDepth.BPC_12) if value else 0
        if self.__rgb_12bpc_vesa.default_value != cf_value:
            self.__rgb_12bpc_vesa.default_value = cf_value

    @property
    def ycbcr444_8bpc_cta_itu709(self):
        """
        Set and get YCbCr-444 8 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr444_8bpc_cta_itu709

    @ycbcr444_8bpc_cta_itu709.setter
    def ycbcr444_8bpc_cta_itu709(self, value: bool):
        cf_value = make_cf(CMTFormat.YCBCR_444_BT709, CMTBitDepth.BPC_8) if value else 0
        if self.__ycbcr444_8bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr444_8bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr444_10bpc_cta_itu709(self):
        """
        Set and get YCbCr-444 10 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr444_10bpc_cta_itu709

    @ycbcr444_10bpc_cta_itu709.setter
    def ycbcr444_10bpc_cta_itu709(self, value: bool):
        cf_value = make_cf(CMTFormat.YCBCR_444_BT709, CMTBitDepth.BPC_10) if value else 0
        if self.__ycbcr444_10bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr444_10bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr444_12bpc_cta_itu709(self):
        """
        Set and get YCbCr-444 12 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr444_12bpc_cta_itu709

    @ycbcr444_12bpc_cta_itu709.setter
    def ycbcr444_12bpc_cta_itu709(self, value: bool):
        cf_value = make_cf(CMTFormat.YCBCR_444_BT709, CMTBitDepth.BPC_12) if value else 0
        if self.__ycbcr444_12bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr444_12bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr422_8bpc_cta_itu709(self):
        """
        Set and get YCbCr-422 8 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr422_8bpc_cta_itu709

    @ycbcr422_8bpc_cta_itu709.setter
    def ycbcr422_8bpc_cta_itu709(self, value: bool):
        cf_value = make_cf(CMTFormat.YCBCR_422_BT709, CMTBitDepth.BPC_8) if value else 0
        if self.__ycbcr444_12bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr444_12bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr422_10bpc_cta_itu709(self):
        """
        Set and get YCbCr-422 10 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr422_10bpc_cta_itu709

    @ycbcr422_10bpc_cta_itu709.setter
    def ycbcr422_10bpc_cta_itu709(self, value: bool):
        cf_value = make_cf(CMTFormat.YCBCR_422_BT709, CMTBitDepth.BPC_10) if value else 0
        if self.__ycbcr422_10bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr422_10bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr422_12bpc_cta_itu709(self):
        """
        Set and get YCbCr-422 12 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr422_12bpc_cta_itu709

    @ycbcr422_12bpc_cta_itu709.setter
    def ycbcr422_12bpc_cta_itu709(self, value: bool):
        cf_value = make_cf(CMTFormat.YCBCR_422_BT709, CMTBitDepth.BPC_12) if value else 0
        if self.__ycbcr422_12bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr422_12bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr422_simple_8bpc_cta_itu709(self):
        """
        Set and get YCbCr-422 Simple 8 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr422_simple_8bpc_cta_itu709

    @ycbcr422_simple_8bpc_cta_itu709.setter
    def ycbcr422_simple_8bpc_cta_itu709(self, value: bool):
        cf_value = make_vsc_cf(CMTVSCFormat.YCBCR_SIMPLE_422_BT709, CMTVSCBitDepth.BPC_YCBCR_8) if value else 0
        if self.__ycbcr422_simple_8bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr422_simple_8bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr422_simple_10bpc_cta_itu709(self):
        """
        Set and get YCbCr-422 Simple 10 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr422_simple_10bpc_cta_itu709

    @ycbcr422_simple_10bpc_cta_itu709.setter
    def ycbcr422_simple_10bpc_cta_itu709(self, value: bool):
        cf_value = make_vsc_cf(CMTVSCFormat.YCBCR_SIMPLE_422_BT709, CMTVSCBitDepth.BPC_YCBCR_10) if value else 0
        if self.__ycbcr422_simple_10bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr422_simple_10bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr422_simple_12bpc_cta_itu709(self):
        """
        Set and get YCbCr-422 Simple 12 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr422_simple_12bpc_cta_itu709

    @ycbcr422_simple_12bpc_cta_itu709.setter
    def ycbcr422_simple_12bpc_cta_itu709(self, value: bool):
        cf_value = make_vsc_cf(CMTVSCFormat.YCBCR_SIMPLE_422_BT709, CMTVSCBitDepth.BPC_YCBCR_12) if value else 0
        if self.__ycbcr422_simple_12bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr422_simple_12bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr420_8bpc_cta_itu709(self):
        """
        Set and get YCbCr-420 8 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr420_8bpc_cta_itu709

    @ycbcr420_8bpc_cta_itu709.setter
    def ycbcr420_8bpc_cta_itu709(self, value: bool):
        cf_value = make_vsc_cf(CMTVSCFormat.YCBCR_420_BT709, CMTVSCBitDepth.BPC_YCBCR_8) if value else 0
        if self.__ycbcr420_8bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr420_8bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr420_10bpc_cta_itu709(self):
        """
        Set and get YCbCr-420 10 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr420_10bpc_cta_itu709

    @ycbcr420_10bpc_cta_itu709.setter
    def ycbcr420_10bpc_cta_itu709(self, value: bool):
        cf_value = make_vsc_cf(CMTVSCFormat.YCBCR_420_BT709, CMTVSCBitDepth.BPC_YCBCR_10) if value else 0
        if self.__ycbcr420_10bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr420_10bpc_cta_itu709.default_value = cf_value

    @property
    def ycbcr420_12bpc_cta_itu709(self):
        """
        Set and get YCbCr-420 12 bpc CTA ITU-709 flag support.

        Returns:
            object
        """
        return self.__ycbcr420_12bpc_cta_itu709

    @ycbcr420_12bpc_cta_itu709.setter
    def ycbcr420_12bpc_cta_itu709(self, value: bool):
        cf_value = make_vsc_cf(CMTVSCFormat.YCBCR_420_BT709, CMTVSCBitDepth.BPC_YCBCR_12) if value else 0
        if self.__ycbcr420_12bpc_cta_itu709.default_value != cf_value:
            self.__ycbcr420_12bpc_cta_itu709.default_value = cf_value


class DscVideoModesDp14:
    """
    Class `DscVideoModesDp14` describes available timings for DSC tests.
    - 1920x1080 30Hz `vm_1920x1080_30hz`.
    - 1920x1080 60Hz `vm_1920x1080_60hz`.
    - 1920x1080 120Hz `vm_1920x1080_120hz`.
    - 3840x2160 30Hz `vm_3840x2160_30hz`.
    - 3840x2160 60Hz `vm_3840x2160_60hz`.
    - 3840x2160 120Hz `vm_3840x2160_120hz`.
    - 5120x2160 30Hz `vm_5120x2160_30hz`.
    - 5120x2160 60Hz `vm_5120x2160_60hz`.
    - 5120x2160 120Hz `vm_5120x2160_120hz`.
    - 7680x4320 30Hz `vm_7680x4320_30hz`.
    - 7680x4320 60Hz `vm_7680x4320_60hz`.
    - 7680x4320 100Hz `vm_7680x4320_120hz`.
    - Disable all timings `clear_all`.
    - Select all timings `select_all`.
    """
    def __init__(self, json_obj):
        self.__id_1920x1080_30Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_0_ID"])
        self.__lc_lr_1920x1080_30Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_0_LC_LR"])
        self.__1920x1080_30Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_0_TIMINGS"])

        self.__id_1920x1080_60Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_1_ID"])
        self.__lc_lr_1920x1080_60Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_1_LC_LR"])
        self.__1920x1080_60Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_1_TIMINGS"])

        self.__id_1920x1080_120Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_2_ID"])
        self.__lc_lr_1920x1080_120Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_2_LC_LR"])
        self.__1920x1080_120Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_2_TIMINGS"])

        self.__id_3840x2160_30Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_3_ID"])
        self.__lc_lr_3840x2160_30Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_3_LC_LR"])
        self.__3840x2160_30Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_3_TIMINGS"])

        self.__id_3840x2160_60Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_4_ID"])
        self.__lc_lr_3840x2160_60Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_4_LC_LR"])
        self.__3840x2160_60Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_4_TIMINGS"])

        self.__id_3840x2160_120Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_5_ID"])
        self.__lc_lr_3840x2160_120Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_5_LC_LR"])
        self.__3840x2160_120Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_5_TIMINGS"])

        self.__id_5120x2160_30Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_6_ID"])
        self.__lc_lr_5120x2160_30Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_6_LC_LR"])
        self.__5120x2160_30Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_6_TIMINGS"])

        self.__id_5120x2160_60Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_7_ID"])
        self.__lc_lr_5120x2160_60Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_7_LC_LR"])
        self.__5120x2160_60Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_7_TIMINGS"])

        self.__id_5120x2160_120Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_8_ID"])
        self.__lc_lr_5120x2160_120Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_8_LC_LR"])
        self.__5120x2160_120Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_8_TIMINGS"])

        self.__id_7680x4320_30Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_9_ID"])
        self.__lc_lr_7680x4320_30Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_9_LC_LR"])
        self.__7680x4320_30Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_9_TIMINGS"])

        self.__id_7680x4320_60Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_10_ID"])
        self.__lc_lr_7680x4320_60Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_10_LC_LR"])
        self.__7680x4320_60Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_10_TIMINGS"])

        self.__id_7680x4320_100Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_11_ID"])
        self.__lc_lr_7680x4320_100Hz = Param(json_obj["TSI_DP14_SRCCTS_DSC_VMT_11_LC_LR"])
        self.__7680x4320_100Hz = Timing(json_obj["TSI_DP14_SRCCTS_DSC_VMT_11_TIMINGS"])

    @property
    def vm_1920x1080_30hz(self) -> Timing:
        """
        Set and get 1920x1080 30Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__1920x1080_30Hz

    @property
    def vm_1920x1080_60hz(self) -> Timing:
        """
        Set and get 1920x1080 60Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__1920x1080_60Hz

    @property
    def vm_1920x1080_120hz(self) -> Timing:
        """
        Set and get 1920x1080 120Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__1920x1080_120Hz

    @property
    def vm_3840x2160_30hz(self) -> Timing:
        """
        Set and get 3840x2160 30Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__3840x2160_30Hz

    @property
    def vm_3840x2160_60hz(self) -> Timing:
        """
        Set and get 3840x2160 60Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__3840x2160_60Hz

    @property
    def vm_3840x2160_120hz(self) -> Timing:
        """
        Set and get 3840x2160 120Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__3840x2160_120Hz

    @property
    def vm_5120x2160_30hz(self) -> Timing:
        """
        Set and get 5120x2160 30Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__5120x2160_30Hz

    @property
    def vm_5120x2160_60hz(self) -> Timing:
        """
        Set and get 5120x2160 60Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__5120x2160_60Hz

    @property
    def vm_5120x2160_120hz(self) -> Timing:
        """
        Set and get 5120x2160 120Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__5120x2160_120Hz

    @property
    def vm_7680x4320_30hz(self) -> Timing:
        """
        Set and get 7680x4320 30Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__7680x4320_30Hz

    @property
    def vm_7680x4320_60hz(self) -> Timing:
        """
        Set and get 7680x4320 60Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__7680x4320_60Hz

    @property
    def vm_7680x4320_100hz(self) -> Timing:
        """
        Set and get 7680x4320 100Hz timing flag support.

        Returns:
            object of bool type
        """
        return self.__7680x4320_100Hz

    def clear_all(self):
        """
        Clear (disable) all timings.
        """
        self.vm_1920x1080_30hz.clear_all()
        self.vm_1920x1080_60hz.clear_all()
        self.vm_1920x1080_120hz.clear_all()
        self.vm_3840x2160_30hz.clear_all()
        self.vm_3840x2160_60hz.clear_all()
        self.vm_3840x2160_120hz.clear_all()
        self.vm_5120x2160_30hz.clear_all()
        self.vm_5120x2160_60hz.clear_all()
        self.vm_5120x2160_120hz.clear_all()
        self.vm_7680x4320_30hz.clear_all()
        self.vm_7680x4320_60hz.clear_all()
        self.vm_7680x4320_100hz.clear_all()

    def select_all(self):
        """
        Select (enable) all timings.
        """
        self.vm_1920x1080_30hz.set_all()
        self.vm_1920x1080_60hz.set_all()
        self.vm_1920x1080_120hz.set_all()
        self.vm_3840x2160_30hz.set_all()
        self.vm_3840x2160_60hz.set_all()
        self.vm_3840x2160_120hz.set_all()
        self.vm_5120x2160_30hz.set_all()
        self.vm_5120x2160_60hz.set_all()
        self.vm_5120x2160_120hz.set_all()
        self.vm_7680x4320_30hz.set_all()
        self.vm_7680x4320_60hz.set_all()
        self.vm_7680x4320_100hz.set_all()


class DscConfigDp14Tab:
    """
    Class `DscConfigDp14Tab` allows working with settings for DP DSC LLCTS tests.
    - Set and get DSC maximum slice number `dsc_max_slice`.
    - Set and get DSC version `dsc_version`.
    - Set and get DSC video modes `dsc_video_modes` type `DscVideoModesDp14`.
    - Set and get colorimetry `ColorimetryDp14`.
    """
    def __init__(self, json_obj):
        self.__dsc_max_slice = Param(json_obj["TSI_DP14_SRCCTS_DSC_DUT_MAX_SLICE"])  # DscMaxSliceNumber
        self.__dsc_version = Param(json_obj["TSI_DP14_SRCCTS_DSC_VERSION"])  # DscVersion
        self.__dsc_video_modes = DscVideoModesDp14(json_obj)
        self.__colorimetry = ColorimetryDp14(json_obj)

    @property
    def dsc_max_slice(self) -> int:
        """
        Set and get DSC maximum slice number.

        Returns:
            object of int type
        """
        return self.__dsc_max_slice.default_value

    @dsc_max_slice.setter
    def dsc_max_slice(self, dsc_max_slice: int):
        if dsc_max_slice not in [1, 2, 4, 8, 10, 12, 16, 20, 24]:
            raise ValueError(f"DSC Max slice count available values {[1, 2, 4, 8, 10, 12, 16, 20, 24]}")
        self.__dsc_max_slice.default_value = dsc_max_slice

    @property
    def dsc_version(self) -> list:
        """
        Set and get DSC version.

        Returns:
            object of list type
        """
        return [self.__dsc_version.default_value >> 16 & 0xF, self.__dsc_version.default_value & 0xF]

    @dsc_version.setter
    def dsc_version(self, dsc_version: Tuple[int, int]):
        version = (dsc_version[0] << 16) | dsc_version[1]
        if version not in [65537, 65538]:
            raise ValueError("DSC Version must be 1.1 or 1.2")
        self.__dsc_version.default_value = version

    @property
    def dsc_video_modes(self) -> DscVideoModesDp14:
        """
        Set and get DSC video modes.

        Returns:
            object of `DscVideoModesDp14` type
        """
        return self.__dsc_video_modes

    @dsc_video_modes.setter
    def dsc_video_modes(self, dsc_video_modes: DscVideoModesDp14):
        self.__dsc_video_modes = dsc_video_modes

    @property
    def colorimetry(self) -> ColorimetryDp14:
        """
        Set and get colorimetry.

        Returns:
            object of `ColorimetryDp14` type
        """
        return self.__colorimetry

    @colorimetry.setter
    def colorimetry(self, colorimetry: ColorimetryDp14):
        self.__colorimetry = colorimetry
