from UniTAP.dev.modules.dut_tests.test_group_params_types import Param


class Hdr10TestParam:

    def __init__(self, json_obj):
        self.__same_frame = Param(json_obj["TSI_HDR10_CTS_DISTR_SAME_FRAME"])
        self.__timeout = Param(json_obj["TSI_HDR10_CTS_DISTR_TIMEOUT"])

    @property
    def timeout(self):
        return self.__timeout.default_value

    @timeout.setter
    def timeout(self, timeout: int):
        if not(self.__timeout.min_value < timeout < self.__timeout.max_value):
            raise ValueError(f"Timeout cannot be less than {self.__timeout.min_value} and more than "
                             f"{self.__timeout.max_value}.")
        self.__timeout.default_value = timeout

    @property
    def same_frame(self):
        return self.__same_frame.default_value

    @same_frame.setter
    def same_frame(self, same_frame: bool):
        self.__same_frame.default_value = same_frame
