Пример #1
0
 def configure_amplitude_offset_table(self, frequency_list=None, offset_list=None, second_antenna_offset_list=None):
     """
     Configures the amplitude offset table to compensate cable loss.
     :type frequency_list: str
     :param frequency_list: the frequency list.
     :type offset_list: str
     :param offset_list: the offset list corresponding to the frequency
     :type second_antenna_offset_list: str
     :param second_antenna_offset_list: the offset list corresponding to the frequency
     listed above for the diverse antenna.
     """
     # Retrieve from bench configuration the frequency and offset table if not given
     if frequency_list is None or offset_list is None:
         available_params = self.__bench_params.get_dict().keys()
         # AmplitudeOffsetTable
         if "AmplitudeOffsetTable" in available_params:
             amplitude_file = ConfigsParser(self.__bench_params.get_param_value("AmplitudeOffsetTable"))
             amplitude_table = amplitude_file.parse_amplitude_offset_table()
             frequency_list = amplitude_table.get("FrequencyList")
             offset_list = amplitude_table.get("OffsetList")
         elif "AmplFrequencyList" in available_params and \
              "AmplOffsetList" in available_params:
             frequency_list = self.__bench_params.get_dict()["AmplFrequencyList"]["value"]
             offset_list = self.__bench_params.get_dict()["AmplOffsetList"]["value"]
     # Set Frequency points using FrequencyList (from Amplitude offset table)
     (err, msg) = W.SetCorrectionFrequency(self, frequency_list)
     self.__error_check(err, msg)
     # Set Amplitude Offset correction using offset list
     (err, msg) = W.SetCorrectionGain(self, offset_list)
     self.__error_check(err, msg)
     # Turning amplitude offset state to ON
     (err, msg) = W.SetCorrectionState(self, "ON")
     self.__error_check(err, msg)
Пример #2
0
    def configure_amplitude_offset_table(self, frequency_list=None, offset_list=None, second_antenna_offset_list=None):
        """
        Configures the amplitude offset table to compensate cable loss.
        :type frequency_list: str
        :param frequency_list: the frequency list.
        :type offset_list: str
        :param offset_list: the offset list corresponding to the frequency
        :type second_antenna_offset_list: str
        :param second_antenna_offset_list: the offset list corresponding to the frequency
        listed above for the diverse antenna.
        """
        # Retrieve from bench configuration the frequency and offset table if not given
        if frequency_list is None or offset_list is None:
            if "AmplitudeOffsetTable" in self._bench_params.get_dict():
                amplitude_file = ConfigsParser(self._bench_params.get_param_value("AmplitudeOffsetTable"))
                amplitude_table = amplitude_file.parse_amplitude_offset_table()
                frequency_list = amplitude_table.get("FrequencyList")
                offset_list = amplitude_table.get("OffsetList")
                if "SecondAntennaOffsetList" in amplitude_table:
                    second_antenna_offset_list = amplitude_table.get("SecondAntennaOffsetList")
        if offset_list is not None:
            # The argument format for the CMW GPIB is freq1, attenuation1, freq2, attenuation2 ...
            main_antenna_list = zip(str(frequency_list).split(","), str(offset_list).split(","))
            main_antenna_str = ", ".join([item for sublist in main_antenna_list for item in sublist])
            # Load in CMW the compensation table
            self._visa.send_command("CONFigure:BASE:FDCorrection:CTABle:CREate 'ACS_main_antenna', %s" % main_antenna_str)
            # Activate the compensation table
            self._visa.send_command("CONFigure:FDCorrection:ACTivate RF1C, 'ACS_main_antenna'")

        try:
            if second_antenna_offset_list is not None:
                # The argument format for the CMW GPIB is freq1, attenuation1, freq2, attenuation2 ...
                div_antenna_list = zip(str(frequency_list).split(","), str(second_antenna_offset_list).split(","))
                div_antenna_str = ", ".join([item for sublist in div_antenna_list for item in sublist])
                # Load in CMW the compensation table
                self._visa.send_command("CONFigure:BASE:FDCorrection:CTABle:CREate 'ACS_div_antenna', %s" % div_antenna_str)
                # Activate the compensation table
                self._visa.send_command("CONFigure:FDCorrection:ACTivate RF3C, 'ACS_div_antenna'")

        except TestEquipmentException as e:
            self._logger.warning("Cannot activate compensation table for RF3C: %s" % e)
Пример #3
0
 def configure_amplitude_offset_table(self,
                                      frequency_list=None,
                                      offset_list=None,
                                      second_antenna_offset_list=None):
     """
     Configures the amplitude offset table to compensate cable loss.
     :type frequency_list: str
     :param frequency_list: the frequency list.
     :type offset_list: str
     :param offset_list: the offset list corresponding to the frequency
     :type second_antenna_offset_list: str
     :param second_antenna_offset_list: the offset list corresponding to the frequency
     listed above for the diverse antenna.
     """
     # Retrieve from bench configuration the frequency and offset table if not given
     if frequency_list is None or offset_list is None:
         available_params = self._bench_params.get_dict().keys()
         # AmplitudeOffsetTable
         if "AmplitudeOffsetTable" in available_params:
             amplitude_file = ConfigsParser(
                 self._bench_params.get_param_value("AmplitudeOffsetTable"))
             amplitude_table = amplitude_file.parse_amplitude_offset_table()
             frequency_list = amplitude_table.get("FrequencyList")
             offset_list = amplitude_table.get("OffsetList")
         elif "AmplFrequencyList" in available_params and \
              "AmplOffsetList" in available_params:
             frequency_list = self._bench_params.get_dict(
             )["AmplFrequencyList"]["value"]
             offset_list = self._bench_params.get_dict(
             )["AmplOffsetList"]["value"]
     # Set Frequency points using FrequencyList (from Amplitude offset table)
     self._visa.send_command("SYST:CORR:FREQ %s" % frequency_list)
     # Set Amplitude Offset correction using offset list
     self._visa.send_command("SYST:CORR:GAIN %s" % offset_list)
     # Turning amplitude offset state to ON
     self._visa.send_command("SYST:CORR:STAT ON")
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        UseCaseBase.__init__(self, tc_name, global_config)

        # Get TC parameters
        self._registration_timeout = \
            int(self._dut_config.get("registrationTimeout"))

        # Read maxDlWcdmaRab from DeviceCatalog.xml
        max_dl_wcdma_rab = \
            str(self._dut_config.get("maxDlWcdmaRab"))

        # Read maxUlWcdmaRab from DeviceCatalog.xml
        max_ul_wcdma_rab = \
            str(self._dut_config.get("maxUlWcdmaRab"))

        # Get FTP server parameters
        self._server = \
            global_config.benchConfig.get_parameters("LAB_SERVER")
        self._server_ip_address = self._server.get_param_value("IP")
        self._username = self._server.get_param_value("username")
        self._password = self._server.get_param_value("password")
        if self._server.has_parameter("ftp_path"):
            self._ftp_path = self._server.get_param_value("ftp_path")
        else:
            self._ftp_path = ""

        # Initialize the server ipv6 address to None.
        self._server_ip_v6_address = None

        # Get the server ipv6 address from the BenchConfig, if the key
        # is present in the file.
        if self._server.has_parameter("IPV6"):
            self._server_ip_v6_address = self._server.get_param_value("IPV6")

        # Get Network configuration
        self._network = \
            global_config.benchConfig.get_parameters("CELLULAR_NETWORK")
        self._apn = self._network.get_param_value("APN")
        self._ssid = self._network.get_param_value("SSID")

        # Read NETWORK_SIMULATOR1 from BenchConfig.xml
        self._ns_node = \
            global_config.benchConfig.get_parameters("NETWORK_SIMULATOR1")
        self._ns_IP_Lan1 = self._ns_node.get_param_value("IP_Lan1")
        self._ns_IP_Lan2 = self._ns_node.get_param_value("IP_Lan2")
        self._ns_DUT_IP_Address = \
            self._ns_node.get_param_value("DUT_IP_Address")
        self._ns_DUT_IP_Address2 = \
            self._ns_node.get_param_value("DUT_IP_Address2", "")
        self._ns_DNS1 = self._ns_node.get_param_value("DNS1")
        self._ns_DNS2 = self._ns_node.get_param_value("DNS2")
        self._ns_Subnet_Mask = \
            self._ns_node.get_param_value("Subnet_Mask")
        self._ns_Default_Gateway = \
            self._ns_node.get_param_value("Default_Gateway")
        self._ns_fast_dormancy = \
            self._ns_node.get_param_value("Fast_Dormancy", "disable")

        # Read the xml Template
        self._band_name = self._tc_parameters.get_param_value("CELL_BAND")
        self._dl_uarfcn = int(self._tc_parameters.get_param_value("DL_UARFCN"))
        self._cell_power = \
            int(self._tc_parameters.get_param_value("CELL_POWER"))
        self._cell_service = self._tc_parameters.get_param_value(
            "CELL_SERVICE")

        # Read the DIRECTION value from UseCase xml Parameter
        self._direction = self._tc_parameters.get_param_value("DIRECTION")
        self._protocol = self._tc_parameters.get_param_value("PROTOCOL")

        # Read the UL_RAB value from UseCase xml Parameter
        # Check if this value is set to MAX or not
        ul_rab_config = str(self._tc_parameters.get_param_value("UL_RAB"))

        if ul_rab_config != "" or ul_rab_config != "None":
            if ul_rab_config == "MAX":
                self._ul_rab = max_ul_wcdma_rab
            else:
                self._ul_rab = ul_rab_config
        else:
            self._logger.info(
                "Unkown UL RAB Configuration %s has been chosen" %
                ul_rab_config)

        # Read the DL_RAB value from UseCase xml Parameter
        # Check if this value is set to MAX or not
        dl_rab_config = str(self._tc_parameters.get_param_value("DL_RAB"))

        if dl_rab_config != "" or dl_rab_config != "None":
            if dl_rab_config == "MAX":
                self._dl_rab = max_dl_wcdma_rab
            else:
                self._dl_rab = dl_rab_config
        else:
            self._logger.info(
                "Unkown UL RAB Configuration %s has been chosen" %
                dl_rab_config)

        # Read Home Public Land Mobile Network (HPLMN) Coverage
        # from test case xml file and accept all the different
        # written for True and False values
        self._hplmn_coverage = \
            self._tc_parameters.get_param_value("HPLMN_COVERAGE", "True")

        # Read Mobile Country Code (MCC) from test case xml file
        self._mcc = \
            int(self._tc_parameters.get_param_value("MCC", "1"))

        # Read Mobile Network Code (MNC) from test case xml file
        self._mnc = \
            int(self._tc_parameters.get_param_value("MNC", "1"))

        # Read Amplitude_Offset_Table file name from Amplitude_Offset_Table.xml
        self._amploffset_filename = \
            self._ns_node.get_param_value("AmplitudeOffsetTable")
        amplitude_file = ConfigsParser(self._amploffset_filename)
        amplitude_table = amplitude_file.parse_amplitude_offset_table()

        # Read frequency_list and offset_list from Amplitude_Offset_Table.xml
        self._frequency_list = amplitude_table.get("FrequencyList")
        self._offset_list = amplitude_table.get("OffsetList")

        # Get UECmdLayer for Data Use Cases
        self._networking_api = self._device.get_uecmd("Networking")
        self._modem_api = self._device.get_uecmd("Modem")

        # Create cellular network simulator and retrieve 3G data API
        self._ns = self._em.get_cellular_network_simulator(
            "NETWORK_SIMULATOR1")
        self._ns_cell_3g = self._ns.get_cell_3g()
        self._data_3g = self._ns_cell_3g.get_data()

        # init wanted registration parameters
        self._wanted_reg_state = "None"