提交 b7821fc6 编写于 作者: S sunmingze

修改帧率信息

Signed-off-by: Nyoungshady <sunmingze3@huawei.com>
上级 c838b90a
...@@ -28,7 +28,7 @@ struct CustomContainerUser { ...@@ -28,7 +28,7 @@ struct CustomContainerUser {
@State StepTips: string = '操作步骤:根据操作提示滑动系统桌面测试帧率'+'\n'+'预期结果:帧率大于55帧测试通过'; @State StepTips: string = '操作步骤:根据操作提示滑动系统桌面测试帧率'+'\n'+'预期结果:帧率大于55帧测试通过';
@State Vue: boolean = false; @State Vue: boolean = false;
@State StartEnable: boolean = true; @State StartEnable: boolean = true;
@State Fps: string = '0'; @State Fps: number = 0;
scroller: Scroller = new Scroller(); scroller: Scroller = new Scroller();
async aboutToAppear(){ async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name); await FirstDialog.ChooseDialog(this.StepTips,this.name);
...@@ -43,13 +43,14 @@ struct CustomContainerUser { ...@@ -43,13 +43,14 @@ struct CustomContainerUser {
Scroll(this.scroller) { Scroll(this.scroller) {
Column(){ Column(){
Row(){ Row(){
Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') Text(`根据以下操作步骤完成测试`+ '\n' + '\n' )
.fontColor(Color.White).fontSize('24fp') .fontColor(Color.White).fontSize('24fp')
} }
Row(){ Row(){
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入系统桌面`+ '\n' + '\n' + `2.左右滑动系统桌面连续10s以上` Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.点击开始键进入系统桌面` + '\n' + '\n' + '2.点击悬浮球开始测试'+ '\n' + '\n' +
+ '\n' + '\n' + '3.回到DeskFps测试项点击结束键' + '\n' + '\n' + `4.若测试最高帧率大于55帧则通过测试` `3.左右滑动系统桌面连续10s以上` + '\n' + '\n' + '4.待悬浮球倒计时结束显示为done后返回validator应用' + '\n' + '\n' + `5.点击结束观察测试结果` + '\n' + '\n' +
+ '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' ) `6.若测试最高帧率大于55帧则通过测试` + '\n' + '\n' + `注意事项:` + '\n' + '\n' +
`※1.若悬浮球显示连接失败,需重启设备并在run.bat中输入run validator拉起测试` + '\n' + '\n' + `※2.双击悬浮球中断测试,长按悬浮球提前结束测试` + '\n' + '\n')
.fontColor(Color.White).fontSize('20fp') .fontColor(Color.White).fontSize('20fp')
} }
Row(){ Row(){
...@@ -84,31 +85,19 @@ struct CustomContainerUser { ...@@ -84,31 +85,19 @@ struct CustomContainerUser {
.onClick(() => { .onClick(() => {
this.StartEnable = !this.StartEnable this.StartEnable = !this.StartEnable
let report = globalThis.resultNum; 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 reg = /fps:(\d+)/g;
let matches = report.match(reg); let matches = report.match(reg);
if (matches == null) {
this.Fps = 0;
}
else {
let fpsValues = matches.map(match => parseInt(match.substring(4))); let fpsValues = matches.map(match => parseInt(match.substring(4)));
let maxFps = Math.max(...fpsValues); let maxFps = Math.max(...fpsValues);
this.Fps = maxFps.toString(); this.Fps = maxFps;
if(maxFps >= 55) { if(maxFps >= 55) {
this.Vue = true; this.Vue = true;
} }
}
globalThis.HideFloatingWindow(); globalThis.HideFloatingWindow();
}) })
} }
......
...@@ -24,7 +24,7 @@ struct CustomContainerUser { ...@@ -24,7 +24,7 @@ struct CustomContainerUser {
@State StepTips: string = '操作步骤:根据操作提示滑动图库测试帧率'+'\n'+'预期结果:帧率大于或等于55帧测试通过'; @State StepTips: string = '操作步骤:根据操作提示滑动图库测试帧率'+'\n'+'预期结果:帧率大于或等于55帧测试通过';
@State Vue: boolean = false; @State Vue: boolean = false;
@State StartEnable: boolean = true; @State StartEnable: boolean = true;
@State Fps: string = '0'; @State Fps: number = 0;
scroller: Scroller = new Scroller(); scroller: Scroller = new Scroller();
async aboutToAppear(){ async aboutToAppear(){
await FirstDialog.ChooseDialog(this.StepTips,this.name); await FirstDialog.ChooseDialog(this.StepTips,this.name);
...@@ -39,13 +39,14 @@ struct CustomContainerUser { ...@@ -39,13 +39,14 @@ struct CustomContainerUser {
Scroll(this.scroller) { Scroll(this.scroller) {
Column(){ Column(){
Row(){ Row(){
Text(`根据以下操作步骤完成测试`+ '\n' + '\n' + '\n' + '\n'+ '\n' + '\n' + '\n' + '\n') Text(`根据以下操作步骤完成测试`+ '\n' + '\n' )
.fontColor(Color.White).fontSize('24fp') .fontColor(Color.White).fontSize('24fp')
} }
Row(){ Row(){
Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.在图库中预置500张图片`+ '\n' + '\n' + `2.点击开始键进入图库` Text(`测试步骤:`+ '\n' + '\n' + '\n' + '\n' + `1.在图库中预置500张图片` + '\n' + '\n' + '2.点击开始键进入图库'+ '\n' + '\n' +
+ '\n' + '\n' + `3.滑动图库缩略图界面连续10s以上` + '\n' + '\n' + '4.回到PhotoFps测试项点击结束键' + '\n' + '\n' + `3.点击悬浮球开始测试` + '\n' + '\n' + '4.滑动图库缩略图界面连续10s以上' + '\n' + '\n' + `5.待悬浮球倒计时结束显示为done后返回validator应用` + '\n' + '\n' +
`5.若测试最高帧率大于或等于55帧则通过测试` + '\n' + '\n' + '\n' + '\n' + '\n' + '\n' + '\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') .fontColor(Color.White).fontSize('20fp')
} }
Row(){ Row(){
...@@ -85,12 +86,17 @@ struct CustomContainerUser { ...@@ -85,12 +86,17 @@ struct CustomContainerUser {
let report = globalThis.resultNum; let report = globalThis.resultNum;
let reg = /fps:(\d+)/g; let reg = /fps:(\d+)/g;
let matches = report.match(reg); let matches = report.match(reg);
if (matches == null) {
this.Fps = 0;
}
else {
let fpsValues = matches.map(match => parseInt(match.substring(4))); let fpsValues = matches.map(match => parseInt(match.substring(4)));
let maxFps = Math.max(...fpsValues); let maxFps = Math.max(...fpsValues);
this.Fps = maxFps.toString(); this.Fps = maxFps;
if(maxFps >= 55) { if(maxFps >= 55) {
this.Vue = true; this.Vue = true;
} }
}
globalThis.HideFloatingWindow(); globalThis.HideFloatingWindow();
}) })
} }
......
...@@ -31,7 +31,7 @@ export struct CustomContainer { ...@@ -31,7 +31,7 @@ export struct CustomContainer {
Url : string = ''; Url : string = '';
@Link StartEnable : boolean @Link StartEnable : boolean
@Link Vue : boolean; @Link Vue : boolean;
@Link Fps : string; @Link Fps : number;
@BuilderParam content: () => void; @BuilderParam content: () => void;
@Builder @Builder
PassBtn(text: Resource, isFullScreen: boolean) { PassBtn(text: Resource, isFullScreen: boolean) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册