From b7821fc6285eb2a0cf6612024813818b11897693 Mon Sep 17 00:00:00 2001 From: sunmingze Date: Thu, 31 Aug 2023 17:24:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B8=A7=E7=8E=87=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: youngshady --- .../src/main/ets/pages/Experience/DeskFps.ets | 43 +++++++------------ .../main/ets/pages/Experience/PhotoFps.ets | 26 ++++++----- .../common/ExperienceCustomContainer.ets | 2 +- 3 files changed, 33 insertions(+), 38 deletions(-) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets b/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets index 181e5e7b2..8ba1a6550 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/DeskFps.ets @@ -28,7 +28,7 @@ struct CustomContainerUser { @State StepTips: string = '操作步骤:根据操作提示滑动系统桌面测试帧率'+'\n'+'预期结果:帧率大于55帧测试通过'; @State Vue: boolean = false; @State StartEnable: boolean = true; - @State Fps: string = '0'; + @State Fps: number = 0; scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); @@ -43,13 +43,14 @@ struct CustomContainerUser { Scroll(this.scroller) { Column(){ Row(){ - Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) .fontColor(Color.White).fontSize('24fp') } Row(){ - Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入系统桌面`+ '\n' + '\n' + `2.左右滑动系统桌面连续10s以上` - + '\n' + '\n' + '3.回到DeskFps测试项点击结束键' + '\n' + '\n' + `4.若测试最高帧率大于55帧则通过测试` - + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' ) + Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入系统桌面` + '\n' + '\n' + '2.点击悬浮球开始测试'+ '\n' + '\n' + + `3.左右滑动系统桌面连续10s以上` + '\n' + '\n' + '4.待悬浮球倒计时结束显示为done后返回validator应用' + '\n' + '\n' + `5.点击结束观察测试结果` + '\n' + '\n' + + `6.若测试最高帧率大于55帧则通过测试` + '\n' + '\n' + `注意事项:` + '\n' + '\n' + + `※1.若悬浮球显示连接失败,需重启设备并在run.bat中输入run validator拉起测试` + '\n' + '\n' + `※2.双击悬浮球中断测试,长按悬浮球提前结束测试` + '\n' + '\n') .fontColor(Color.White).fontSize('20fp') } Row(){ @@ -84,30 +85,18 @@ struct CustomContainerUser { .onClick(() => { this.StartEnable = !this.StartEnable let report = globalThis.resultNum; -// let headList = new Array(); -// let endList = new Array(); -// let head = report.indexOf(":"); -// let end = report.indexOf('|'); -// let Fps = new Array(); -// -// while(head > -1){ -// headList.push(head); -// head = report.indexOf(":",head + 1); -// } -// while(end > -1){ -// endList.push(end); -// end = report.indexOf("|",end + 1); -// } -// for(let i = 0; i < headList.length; i++) { -// Fps[i] = Number(report.substring(headList[i]+1,endList[i])); -// } let reg = /fps:(\d+)/g; let matches = report.match(reg); - let fpsValues = matches.map(match => parseInt(match.substring(4))); - let maxFps = Math.max(...fpsValues); - this.Fps = maxFps.toString(); - if(maxFps >= 55) { - this.Vue = true; + if (matches == null) { + this.Fps = 0; + } + else { + let fpsValues = matches.map(match => parseInt(match.substring(4))); + let maxFps = Math.max(...fpsValues); + this.Fps = maxFps; + if(maxFps >= 55) { + this.Vue = true; + } } globalThis.HideFloatingWindow(); }) diff --git a/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets b/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets index 036e1c4a9..ac0c37f9f 100644 --- a/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets +++ b/validator/acts_validator/src/main/ets/pages/Experience/PhotoFps.ets @@ -24,7 +24,7 @@ struct CustomContainerUser { @State StepTips: string = '操作步骤:根据操作提示滑动图库测试帧率'+'\n'+'预期结果:帧率大于或等于55帧测试通过'; @State Vue: boolean = false; @State StartEnable: boolean = true; - @State Fps: string = '0'; + @State Fps: number = 0; scroller: Scroller = new Scroller(); async aboutToAppear(){ await FirstDialog.ChooseDialog(this.StepTips,this.name); @@ -39,13 +39,14 @@ struct CustomContainerUser { Scroll(this.scroller) { Column(){ Row(){ - Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') + Text(`根据以下操作步骤完成测试`+ '\n' + '\n' ) .fontColor(Color.White).fontSize('24fp') } Row(){ - Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.在图库中预置500张图片`+ '\n' + '\n' + `2.点击开始键进入图库` - + '\n' + '\n' + `3.滑动图库缩略图界面连续10s以上` + '\n' + '\n' + '4.回到PhotoFps测试项点击结束键' + '\n' + '\n' + - `5.若测试最高帧率大于或等于55帧则通过测试` + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' ) + Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.在图库中预置500张图片` + '\n' + '\n' + '2.点击开始键进入图库'+ '\n' + '\n' + + `3.点击悬浮球开始测试` + '\n' + '\n' + '4.滑动图库缩略图界面连续10s以上' + '\n' + '\n' + `5.待悬浮球倒计时结束显示为done后返回validator应用` + '\n' + '\n' + + `6.点击结束观察测试结果` + '\n' + '\n' + `7.若测试最高帧率大于或等于55帧则通过测试` + '\n' + '\n' + `注意事项:` + '\n' + '\n' + + `※1.若悬浮球显示连接失败,需重启设备并在run.bat中输入run validator拉起测试` + '\n' + '\n' + `※2.双击悬浮球中断测试,长按悬浮球提前结束测试` + '\n' + '\n') .fontColor(Color.White).fontSize('20fp') } Row(){ @@ -85,11 +86,16 @@ struct CustomContainerUser { let report = globalThis.resultNum; let reg = /fps:(\d+)/g; let matches = report.match(reg); - let fpsValues = matches.map(match => parseInt(match.substring(4))); - let maxFps = Math.max(...fpsValues); - this.Fps = maxFps.toString(); - if(maxFps >= 55) { - this.Vue = true; + if (matches == null) { + this.Fps = 0; + } + else { + let fpsValues = matches.map(match => parseInt(match.substring(4))); + let maxFps = Math.max(...fpsValues); + this.Fps = maxFps; + if(maxFps >= 55) { + this.Vue = true; + } } globalThis.HideFloatingWindow(); }) diff --git a/validator/acts_validator/src/main/ets/pages/common/ExperienceCustomContainer.ets b/validator/acts_validator/src/main/ets/pages/common/ExperienceCustomContainer.ets index 7cdd56f4c..1306b869a 100644 --- a/validator/acts_validator/src/main/ets/pages/common/ExperienceCustomContainer.ets +++ b/validator/acts_validator/src/main/ets/pages/common/ExperienceCustomContainer.ets @@ -31,7 +31,7 @@ export struct CustomContainer { Url : string = ''; @Link StartEnable : boolean @Link Vue : boolean; - @Link Fps : string; + @Link Fps : number; @BuilderParam content: () => void; @Builder PassBtn(text: Resource, isFullScreen: boolean) { -- GitLab