コード例 #1
0
 def create_scene_boot_enter(self, devices_list, scene_name, exec_times):
     this_checker = ck.Checker()
     if len(devices_list) == 0:
         self.scene_boot_enter = scene_boot_enter.SceneBootEnter(
             name=scene_name,
             exec_time=exec_times,
             by=sc.BY_COUNT,
             checker=this_checker,
             inner=self.onAndoff_dict["内置应用"],
             third=self.onAndoff_dict["第三方应用"],
             tv=self.onAndoff_dict["信源"])
         self.scene_boot_enter.save()
         self.attribute_init()
         self.creat_success_toast = toast(parent=self, text='开机直达场景\n创建成功!')
         self.creat_success_toast.move(
             QPoint(self.geometry().left() + self.width() * 0.3,
                    self.geometry().top() + self.height() * 0.3))
         self.creat_success_toast.ocl_signal.connect(self.open_scene_list)
         self.creat_success_toast.exec()
     else:
         self.scene_boot_enter = scene_boot_enter.SceneBootEnter(
             name="开机直达",
             exec_time=1,
             checker=this_checker,
             inner=self.onAndoff_dict["内置应用"],
             third=self.onAndoff_dict["第三方应用"],
             tv=self.onAndoff_dict["信源"])
         self.attribute_init()
         self.scene_boot_enter.device = dv.Device(devices_list[0][0],
                                                  devices_list[0][1])
         self.checkscene = sceneOneCheck(self.scene_boot_enter)
         self.checkscene.reflash_sig.connect(self.showlog)
         self.checkscene.dependent_check_sig.connect(self.check_message)
         self.checkscene.start()
コード例 #2
0
    def create_dc_scene(self,devices_list, scene_name,exec_times):
        this_checker = ck.Checker(
            power_off=self.dc_dict["待机是否正常"],
            sub_screen=self.dc_dict["副屏是否正常(外置摄像头保存图片)"],
            power_on=self.dc_dict["开机是否正常"],

        )
        if len(devices_list) == 0:
            self.scene_dcwake = scene_wake.SceneDCWake(
                name=scene_name,
                exec_time=exec_times,
                by=sc.BY_COUNT,
                checker=this_checker,
                mode=dk.MODE_QUICK
                )
            self.scene_dcwake.save()
            self.attribute_init()
            self.creat_success_toast = toast(parent=self, text='DC待机场景\n创建成功!')
            self.creat_success_toast.move(QPoint(self.geometry().left() + self.width() * 0.3, self.geometry().top() + self.height() * 0.3))
            self.creat_success_toast.ocl_signal.connect(self.open_scene_list)
            self.creat_success_toast.setModal(True)
            self.creat_success_toast.exec()
        else:
            self.scene_dcwake = scene_wake.SceneDCWake(
                name="DC待机",
                exec_time=1,
                checker=this_checker,
                mode=dk.MODE_QUICK
        )
            self.attribute_init()
            self.scene_dcwake.device = dv.Device(devices_list[0][0], devices_list[0][1])
            self.checkscene = sceneOneCheck(self.scene_dcwake)
            self.checkscene.reflash_sig.connect(self.showlog)
            self.checkscene.dependent_check_sig.connect(self.check_message)
            self.checkscene.start()
コード例 #3
0
    def create_onoff_scene(self, devices_list, scene_name, exec_times):
        this_checker = ck.Checker(
            net=self.onAndoff_dict["网络是否回连成功"],
            usb=self.onAndoff_dict["移动存储设备挂载是否成功,U盘个数:"],
            hdmi=self.onAndoff_dict["HDMI出图是否成功"],
            blue_controller=self.onAndoff_dict["遥控器是否回连成功"],
            blue_speaker=self.onAndoff_dict["蓝牙音箱是否回连成功"],
            near=self.onAndoff_dict["近场唤醒是否成功"],
            far=self.onAndoff_dict["远场唤醒是否成功"],
            usb_count=self.usb_count,
            # a2dp_mac=self.a2dp_mac
        )
        if len(devices_list) == 0:
            self.scene_onoff = scene_on_and_off.SceneOnAndOff(
                name=scene_name,
                exec_time=exec_times,
                by=sc.BY_COUNT,
                checker=this_checker,
                mode=self.mode,
                key_set=dict(volume=self.onAndoff_dict["音量+-"],
                             channel=self.onAndoff_dict["频道+-"],
                             pad=self.onAndoff_dict["五维键"],
                             voice=self.onAndoff_dict['语音键']),
                dc_off_interval=self.waittime,
                on2check_interval=self.boottime,
                ad_root=self.ad_root,
                far=self.far)
            self.scene_onoff.save()
            self.attribute_init()
            self.creat_success_toast = toast(parent=self, text='开关机场景\n创建成功!')
            self.creat_success_toast.move(
                QPoint(self.geometry().left() + self.width() * 0.3,
                       self.geometry().top() + self.height() * 0.3))
            self.creat_success_toast.ocl_signal.connect(self.open_scene_list)
            self.creat_success_toast.exec()
        else:
            self.scene_onoff = scene_on_and_off.SceneOnAndOff(
                name="开机压测",
                exec_time=1,
                checker=this_checker,
                mode=self.mode,
                key_set=dict(volume=self.onAndoff_dict["音量+-"],
                             channel=self.onAndoff_dict["频道+-"],
                             pad=self.onAndoff_dict["五维键"],
                             voice=self.onAndoff_dict['语音键']),
                dc_off_interval=self.waittime,
                on2check_interval=self.boottime,
                ad_root=self.ad_root,
                far=self.far)

            self.attribute_init()
            self.scene_onoff.device = dv.Device(devices_list[0][0],
                                                devices_list[0][1])
            self.checkscene = sceneOneCheck(self.scene_onoff)
            self.checkscene.reflash_sig.connect(self.showlog)
            self.checkscene.dependent_check_sig.connect(self.check_message)
            self.checkscene.start()
コード例 #4
0
    def create_online_scene(self, devices_list, scene_name, exec_times):
        this_checker = ck.Checker(
            blue_controller=self.online_dict["遥控器是否回连成功"],
            blue_speaker=self.online_dict["蓝牙音箱是否回连成功"],
            near=self.online_dict["近场唤醒是否成功"],
            far=self.online_dict["远场唤醒是否成功"],
        )
        brand_list = []
        for channel in [
                "腾讯视频", "爱奇艺", "酷喵", "QQ音乐MV", "QQ音乐", "HDP", "电视家",
                "本地视频_大码率", "本地视频_混合编解码", "信源"
        ]:
            if self.online_dict[channel] == True:
                brand_list.append(channel)
        if len(devices_list) == 0:
            self.online_scene = scene_media.SceneMedia(
                name=scene_name,
                exec_time=exec_times,
                by=sc.BY_TIME,
                checker=this_checker,
                brand_list=brand_list,
                profile=self.lineEdit.text(),
                performance_str=self.performance_str,
                performance_interval=self.performance_interval,
                local_video=self.local_video

                # check_interval=self.lineEdit_2.text()
            )
            self.attribute_init()
            self.online_scene.save()
            self.creat_success_toast = toast(parent=self, text='视频煲机场景\n创建成功!')
            self.creat_success_toast.move(
                QPoint(self.geometry().left() + self.width() * 0.3,
                       self.geometry().top() + self.height() * 0.3))
            self.creat_success_toast.ocl_signal.connect(self.open_scene_list)
            self.creat_success_toast.exec()
        else:
            self.online_scene = scene_media.SceneMedia(
                name="视频煲机",
                exec_time=1,
                checker=this_checker,
                brand_list=brand_list,
                profile=self.lineEdit.text(),
                performance_str=self.performance_str,
                performance_interval=self.performance_interval,
                local_video=self.local_video)
            self.attribute_init()
            self.online_scene.device = dv.Device(devices_list[0][0],
                                                 devices_list[0][1])
            self.checkscene = sceneOneCheck(self.online_scene)
            self.checkscene.reflash_sig.connect(self.showlog)
            self.checkscene.dependent_check_sig.connect(self.check_message)
            self.checkscene.start()
コード例 #5
0
    def create_recorder_scene(self, device_list, curname, times):
        check = ck.Checker()
        self.recorder_scene = SceneRecord(name=curname,
                                          exec_time=times,
                                          checker=check,
                                          scripts=self.script_list)
        self.recorder_scene.save()
        self.creat_success_toast = toast(parent=self, text='录制脚本压测场景\n创建成功!')

        self.creat_success_toast.move(
            self.geometry().left() + self.width() * 0.2,
            self.geometry().top() + self.height() * 0.1)
        self.creat_success_toast.ocl_signal.connect(self.open_scene_list)
        self.creat_success_toast.exec()
コード例 #6
0
    def create_scene_TV(self,devices_list, scene_name,exec_times):
        this_checker = ck.Checker(
            blue_controller=self.choice_dict["遥控器是否回连成功"],
            blue_speaker=self.choice_dict["蓝牙音箱是否回连成功"],
            near=self.choice_dict["近场唤醒是否成功"],
            far=self.choice_dict["远场唤醒是否成功"],
            # a2dp_mac=self.a2dp_mac
        )
        chanel_list = []
        for channel in ['HDMI1','HDMI2','HDMI3','ATV','DTMB']:
            if self.choice_dict[channel] == True:
                chanel_list.append(channel)

        if len(devices_list) == 0:
            self.SceneTV = scene_tv.SceneTV(
                name=scene_name,
                exec_time=exec_times,
                by=sc.BY_TIME,
                checker=this_checker,
                channel_list=chanel_list,
                channel_switch_interval=self.channel_switch_interval,
                performance_interval=self.performance_interval,
                check_interval=self.check_interval,
                performance_str=self.performance_str
            )
            self.SceneTV.save()
            self.attribute_init()
            self.creat_success_toast = toast(parent=self, text='信源压测场景\n创建成功!')
            self.creat_success_toast.move(QPoint(self.geometry().left() + self.width() * 0.3, self.geometry().top() + self.height() * 0.3))
            self.creat_success_toast.ocl_signal.connect(self.open_scene_list)
            self.creat_success_toast.exec()
        else:
            self.SceneTV = scene_tv.SceneTV(
                name="信源煲机",
                exec_time=1,
                checker=this_checker,
                channel_list=chanel_list,
                channel_switch_interval=self.channel_switch_interval,
                performance_interval=self.performance_interval,
                check_interval=self.check_interval,
                performance_str=self.performance_str
            )
            self.attribute_init()
            self.SceneTV.device = dv.Device(devices_list[0][0], devices_list[0][1])
            self.checkscene = sceneOneCheck(self.SceneTV)
            self.checkscene.reflash_sig.connect(self.showlog)
            self.checkscene.dependent_check_sig.connect(self.check_message)
            self.checkscene.start()
コード例 #7
0
 def create_monkeylogic_scene(self, devices_list, scene_name, exec_times):
     this_checker = ck.Checker(
         camera=self.monkeyLogic_dict["摄像头是否正常"],
         usb=self.monkeyLogic_dict["USB挂载正常,U盘个数:"],
         far=self.monkeyLogic_dict["远场语音是否唤醒正常"],
         net=self.monkeyLogic_dict['网络连接是否正常'],
         near=self.monkeyLogic_dict["近场语音是否唤醒正常"],
         blue_speaker=self.monkeyLogic_dict['蓝牙音箱是否回连成功'],
         blue_controller=self.monkeyLogic_dict['蓝牙遥控器是否回连成功'],
         usb_count=self.usb_count,
         # a2dp_mac=self.a2dp_mac
     )
     if len(devices_list) == 0:
         self.monkeylogic_scene = scene_monkey.SceneMonkeyLogic(
             name=scene_name,
             exec_time=exec_times,
             by=sc.BY_TIME,
             mode=self.mode,
             checker=this_checker,
             switch_interval=self.switch_interval,
             check_interval=self.check_interval,
             packages=self.packages)
         self.monkeylogic_scene.save()
         self.attribute_init()
         self.creat_success_toast = toast(parent=self,
                                          text='逻辑Monkey场景\n创建成功!')
         self.creat_success_toast.move(
             QPoint(self.geometry().left() + self.width() * 0.3,
                    self.geometry().top() + self.height() * 0.3))
         self.creat_success_toast.ocl_signal.connect(self.open_scene_list)
         self.creat_success_toast.exec()
     else:
         self.monkeylogic_scene = scene_monkey.SceneMonkeyLogic(
             name="逻辑monkey",
             exec_time=1,
             mode=self.mode,
             checker=this_checker,
             switch_interval=self.switch_interval,
             check_interval=self.check_interval,
             packages=self.packages)
         self.attribute_init()
         self.monkeylogic_scene.device = dv.Device(devices_list[0][0],
                                                   devices_list[0][1])
         self.checkscene = sceneOneCheck(self.monkeylogic_scene)
         self.checkscene.reflash_sig.connect(self.showlog)
         self.checkscene.dependent_check_sig.connect(self.check_message)
         self.checkscene.start()
コード例 #8
0
 def create_recovery_scene(self, devices_list, scene_name, exec_times):
     this_checker = ck.Checker(
         launcher=self.recover_dict["launcher进入正常"],
         camera=self.recover_dict["摄像头驱动是否正常,是否能升降"],
         usb=self.recover_dict["移动存储设备是否能够成功挂载,U盘个数:"],
         wifi_driver=self.recover_dict["WiFi驱动是否正常"],
         far=self.recover_dict["远场语音是否能唤醒"],
         check_apk=self.recover_dict["检测第三方应用是否存在"],
         install_apk=self.recover_dict["批量安装APK(APK路径:xxx)"],
         usb_count=self.usb_count,
         apk_root=self.apk_root)
     if len(devices_list) == 0:
         self.recovery_scene = scene_recovery.SceneRecovery(
             name=scene_name,
             exec_time=exec_times,
             by=sc.BY_COUNT,
             checker=this_checker,
             retain_app=self.is_save_app,
             serial_open=self.is_open_Serial)
         self.recovery_scene.save()
         self.attribute_init()
         self.creat_success_toast = toast(parent=self, text='系统重置场景\n创建成功!')
         self.creat_success_toast.move(
             QPoint(self.geometry().left() + self.width() * 0.3,
                    self.geometry().top() + self.height() * 0.3))
         self.creat_success_toast.ocl_signal.connect(self.open_scene_list)
         self.creat_success_toast.exec()
     else:
         self.recovery_scene = scene_recovery.SceneRecovery(
             name="恢复出厂设置",
             exec_time=1,
             checker=this_checker,
             retain_app=self.is_save_app,
             serial_open=self.is_open_Serial)
         self.attribute_init()
         self.recovery_scene.device = dv.Device(devices_list[0][0],
                                                devices_list[0][1])
         self.checkscene = sceneOneCheck(self.recovery_scene)
         self.checkscene.reflash_sig.connect(self.showlog)
         self.checkscene.dependent_check_sig.connect(self.check_message)
         self.checkscene.start()