Esempio n. 1
0
def Adjacentchannelrejection(testitem):
    global_element.emitsingle.stateupdataSingle.emit('Testing in progress of Adjacentchannelrejection channel ' +
                                                     global_element.Test_channel)

    # 设置WLAN 信令LOSS
    channel_fre = report_handle.fre_wlan_calc(global_element.Test_channel)
    global_element.CU_intance.set_wlan_loss(channel_fre)

    if global_element.Test_Datarate == '1' or global_element.Test_Datarate == '2':
        offset_freq = 30
        gprf_level = -39
        bs_power = -74
    elif global_element.Test_Datarate == '5.5' or global_element.Test_Datarate == '11':
        offset_freq = 25
        gprf_level = -35
        bs_power = -70

    if eval(channel_fre) + offset_freq > 2472:
        gprf_freq = eval(channel_fre) - offset_freq
    else:
        gprf_freq = eval(channel_fre) + offset_freq

    if global_element.Test_Datarate != '5.5':
        wavefilename = global_element.Test_Datarate + 'M'
    else:
        wavefilename = '5M'

    global_element.CU_intance.init_generator(str(gprf_freq), str(gprf_level), wavefilename)

    global_element.CU_intance.set_wlan_bslevel(str(bs_power))

    # 取值
    packets_num = testitem['parms']['Parm'][0]['Value']
    per_result = global_element.CU_intance.get_wlan_per(packets_num)

    global_element.emitsingle.stateupdataSingle.emit(global_element.Test_channel + ' per_result:' + per_result)

    global_element.CU_intance.off_gprf()
Esempio n. 2
0
def Adjacentchannelrejection(testitem):
    global_element.emitsingle.stateupdataSingle.emit(
        'Testing in progress of Adjacentchannelrejection channel ' +
        global_element.Test_channel)

    global_element.Test_item = '21.3.18.2_Adjacent channel rejection'

    # 设置WLAN 信令LOSS
    channel_fre = report_handle.fre_wlan_calc(global_element.Test_channel)
    global_element.CU_intance.set_wlan_loss(channel_fre)

    level_list = [-82, -79, -77, -74, -70, -66, -65, -64, -59, -57]
    limit_list = []
    for limit in testitem['limits']['limit']:
        limit_list.append(limit['low'])

    if global_element.Test_wlan_bw == 'VHT20':
        bs_level = str(level_list[eval(global_element.Test_Datarate[-1:])] + 3)
        offset_freq = 20
        gprf_level = str(
            int(bs_level) +
            int(limit_list[int(global_element.Test_Datarate[-1:])]))
    elif global_element.Test_wlan_bw == 'VHT40':
        bs_level = str(level_list[eval(global_element.Test_Datarate[-1:])] + 6)
        offset_freq = 40
        gprf_level = str(
            int(bs_level) +
            int(limit_list[int(global_element.Test_Datarate[-1:])]))
    elif global_element.Test_wlan_bw == 'VHT80':
        bs_level = str(level_list[eval(global_element.Test_Datarate[-1:])] + 9)
        offset_freq = 80
        gprf_level = str(
            int(bs_level) +
            int(limit_list[int(global_element.Test_Datarate[-1:])]))

    half_obw = eval(global_element.Test_wlan_bw[-2:]) / 2
    if (5170 + half_obw) < eval(channel_fre) + offset_freq < (5330 - half_obw)\
            or (5490 + half_obw) < eval(channel_fre) + offset_freq < (5710 - half_obw) \
            or (5735 + half_obw) < eval(channel_fre) + offset_freq < (5835 - half_obw):
        gprf_freq = eval(channel_fre) + offset_freq
    else:
        gprf_freq = eval(channel_fre) - offset_freq

    wavefilename = 'AC_' + global_element.Test_Datarate + '_' + global_element.Test_wlan_bw

    global_element.CU_intance.init_generator(str(gprf_freq), str(gprf_level),
                                             wavefilename)

    global_element.CU_intance.set_wlan_bslevel(str(bs_level))

    # 取值
    packets_num = testitem['parms']['Parm'][0]['Value']
    per_result, packets_done = global_element.CU_intance.get_wlan_per(
        packets_num)

    global_element.Test_remark = 'Uint: %, ' + str(
        packets_done) + ' packests transmited!'
    high_limit = '10'
    low_limit = 'None'
    report_handle.Reporttool(per_result, low_limit, high_limit)

    global_element.CU_intance.off_gprf()
Esempio n. 3
0
def wlanac_testplan_handle(current_testplan):
    # 检测是否CU
    if global_element.devices_config_dict['xml']['CU']['CHECK'] == 'False':
        global_element.emitsingle.thread_exitSingle.emit(
            'Test WLAN AC must have CU!')
        time.sleep(0.1)

    # 检查DUT 控制方式
    if global_element.active_dut_dict['xml']['DUTCONFIG']['AUTOMODE'] not in [
            '4', '5'
    ]:
        global_element.testseq_judgement_list.append('Inconclusive')
        global_element.emitsingle.stateupdataSingle.emit(
            'To test wlan, please select the automatic control mode of DUT '
            'in Un-cellular mode.')
        return

    # 检测综测仪是否有WLAN信令选件
    result = global_element.CU_intance.check_wlansin_option()
    if result == False:
        global_element.emitsingle.stateupdataSingle.emit(
            'The CU does not support WLAN signaling mode')
        global_element.testseq_judgement_list.append('Inconclusive')
        return

    # 处理init seting,获取datarate, channel, Antenna信息
    init_parms_list = current_testplan[0]['parms']['Parm']
    channel_str_list = WLAN_AC.initseting(init_parms_list)

    # 综测仪WLAN信令的初始化设置
    result = global_element.CU_intance.wlan_init_setting()
    if result == False:
        global_element.emitsingle.stateupdataSingle.emit(
            'WLAN signaling parameter initialization error in the CU!')
        global_element.testseq_judgement_list.append('Inconclusive')
        return
    time.sleep(0.1)
    global_element.emitsingle.stateupdataSingle.emit(
        'Initialization of WLAN signaling parameters of the CU is '
        'completed!')

    for channel in channel_str_list:
        if channel != '':
            global_element.Test_channel = channel  # 更新全局变量channel
            freq = report_handle.fre_wlan_calc(channel)
            global_element.CU_intance.set_wlan_channel(
                freq)  # 设置综测仪wlan channel
            time.sleep(3)

            result = global_element.CU_intance.check_wlan_connect_state()
            if result == False:
                global_element.emitsingle.stateupdataSingle.emit(
                    'DUT failed to establish connection!')
                global_element.testseq_judgement_list.append('Inconclusive')
                return

            for testitem in current_testplan[1:]:
                if testitem['@enable'] == 'yes':
                    if testitem[
                            '@Name'] == '21.3.18.2_Adjacent channel rejection':
                        WLAN_AC.Adjacentchannelrejection(testitem)
                    elif testitem[
                            '@Name'] == '21.3.18.3_NO Adjacent channel rejection':
                        WLAN_AC.NoAdjacentchannelrejection(testitem)
                    # elif testitem['@Name'] == '99% Occupied Bandwidth':
                    #     LTEFCC.pct99OccupiedBandwidth(testitem)
                    # elif testitem['@Name'] == '26dB Occupied Bandwidth':
                    #     LTEFCC.dB26OccupiedBandwidth(testitem)
                    # elif testitem['@Name'] == 'Band edge':
                    #     LTEFCC.Bandedge(testitem)
                    # elif testitem['@Name'] == 'Conducted Spurious emissions':
                    #     LTEFCC.ConductedSpuriousemissions(testitem)
                    # elif testitem['@Name'] == 'Frequency stability':
                    #     LTEFCC.Frequencystability(testitem)
                    else:
                        pass

                    # 更新进度
                    global_element.finished_step += 1
                    process_rate = format(
                        global_element.finished_step * 100 /
                        global_element.total_step, '.2f')
                    global_element.emitsingle.process_rateupdataSingle.emit(
                        process_rate)
                    # 停止功能函数接口

                    # 更新summary
                    global_element.emitsingle.summaryupdataSingle.emit(
                        global_element.finished_result_list)