1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15export enum TestMode { 16 ONLINE, 17 BRIGHTNESS, 18 STARTUP 19} 20 21export class OtherSupport { 22 public testName: string 23 public testSrc: string 24 public testMode: TestMode 25 public resource: Resource 26 27 constructor(testName: string, testSrc: string, testMode: TestMode, resource: Resource) { 28 this.testName = testName 29 this.testSrc = testSrc 30 this.testMode = testMode 31 this.resource = resource 32 } 33} 34 35export class SwitchItem { 36 public id: string 37 public switchName: string 38 public switchSrc: Resource 39 public isOpen: boolean 40 public enable: boolean 41 42 constructor(id: string, switchName: string, switchSrc: Resource, isOpen: boolean, enable: boolean) { 43 this.id = id 44 this.switchName = switchName 45 this.switchSrc = switchSrc 46 this.isOpen = isOpen 47 this.enable = enable 48 } 49} 50 51export class CollectItem { 52 public name: string 53 public isSupport: boolean 54 public isSelect: boolean 55 56 constructor(name: string, isSupport: boolean, isSelect: boolean) { 57 this.name = name 58 this.isSupport = isSupport 59 this.isSelect = isSelect 60 } 61} 62 63export class TaskInfoConfig { 64 public testName: string 65 public collectItem: Array<CollectItem> 66 public switchItem: Array<SwitchItem> 67 68 constructor(testName?: string, collectItem?: Array<CollectItem>, switchItem?: Array<SwitchItem>) { 69 this.testName = testName 70 this.collectItem = collectItem 71 this.switchItem = switchItem 72 } 73} 74 75export class AppInfoItem { 76 public id: number 77 public packageName: string 78 public appName: string 79 public appVersion: String 80 public appIcon: string 81 public abilityName: string 82 83 constructor(packageName: string, appName: string, appVersion: String, appIcon: string, abilityName: string) { 84 this.packageName = packageName 85 this.appName = appName 86 this.appVersion = appVersion 87 this.appIcon = appIcon 88 this.abilityName = abilityName 89 } 90} 91 92export class ReportItem { 93 public sessionId: String; 94 public dbPath: String; 95 public packageName: String; 96 public iconId: String; 97 public name: String; 98 public appName: String; 99 public startTime: String; 100 public testDuration: String; 101 public upStatus: boolean; 102 103 constructor(sessionId: String, dbPath: String, packageName: String, iconId: String, name: String, appName: String, startTime: String, testDuration: String, upStatus: boolean) { 104 this.sessionId = sessionId 105 this.dbPath = dbPath 106 this.packageName = packageName 107 this.iconId = iconId 108 this.name = name 109 this.appName = appName 110 this.startTime = startTime 111 this.testDuration = testDuration 112 this.upStatus = upStatus 113 } 114 115 public getStartTime(): string{ 116 return this.startTime.valueOf() 117 } 118 119 public getTestDuration(): string{ 120 return this.testDuration.valueOf() 121 } 122 123 public getDbPath(): string{ 124 return this.dbPath.valueOf() 125 } 126} 127 128 129 130export class QuestionItem { 131 public question: string 132 public answer: string 133 134 constructor(question: string, answer: string) { 135 this.answer = answer 136 this.question = question 137 } 138} 139 140export const questionList = new Array( 141 new QuestionItem('1.SP工具怎么使用', '如何使用可以查看以下地址:https://gitee.com/openharmony/developtools_profiler/blob/master/host/smartperf/client/client_ui/README_zh.md'), 142 new QuestionItem('2.SP工具支持FPS采集吗?', '可以,fps依赖Hidumper能力..'), 143 new QuestionItem('3.SP工具支持RAM采集吗?', 'ram采集目前是 读取进程节点内存信息中的PSS值...'), 144 new QuestionItem('4.FPS采集不到?', '可能是视频应用,需要联系开发添加对应的图层,做采集适配'), 145 new QuestionItem('5.SP采集原理?', '目前除fps外,其他采集均是通过cat 系统节点获取'), 146 new QuestionItem('6.报告页的值是怎么算的?', '最终以一场测试结果的平均值为准'), 147 new QuestionItem('7.SP后续规划?', '集成更多采集能力,如trace采集,counter采集,网络采集等等;优化数据展示方式,报告上传网站端,在线分析性能功耗问题') 148) 149 150export class SummaryItem { 151 public icon: Resource 152 public content: string 153 public value: string 154 public backColor: string 155 156 constructor(icon: Resource, content: string, value: string, backColor: string) { 157 this.icon = icon 158 this.content = content 159 this.value = value 160 this.backColor = backColor 161 } 162} 163 164