• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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(
104    sessionId: String,
105    dbPath: String,
106    packageName: String,
107    iconId: String,
108    name: String,
109    appName: String,
110    startTime: String,
111    testDuration: String,
112    upStatus: boolean
113  ) {
114    this.sessionId = sessionId;
115    this.dbPath = dbPath;
116    this.packageName = packageName;
117    this.iconId = iconId;
118    this.name = name;
119    this.appName = appName;
120    this.startTime = startTime;
121    this.testDuration = testDuration;
122    this.upStatus = upStatus;
123  }
124
125  public getStartTime(): string {
126    return this.startTime.valueOf();
127  }
128
129  public getTestDuration(): string {
130    return this.testDuration.valueOf();
131  }
132
133  public getDbPath(): string {
134    return this.dbPath.valueOf();
135  }
136}
137
138export class QuestionItem {
139  public question: string;
140  public answer: string;
141
142  constructor(question: string, answer: string) {
143    this.answer = answer;
144    this.question = question;
145  }
146}
147
148export const questionList = new Array(
149  new QuestionItem(
150    '1.SP工具怎么使用', '通过查看README_zh.md文档'),
151  new QuestionItem('2.SP工具支持FPS采集吗?', '可以:fps依赖Hidumper能力..'),
152  new QuestionItem('3.SP工具支持RAM采集吗?', 'ram采集目前是 读取进程节点内存信息中的PSS值...'),
153  new QuestionItem('4.FPS采集不到?', '可能是视频应用,需要联系开发添加对应的图层,做采集适配'),
154  new QuestionItem('5.SP采集原理?', '目前除fps外,其他采集均是通过cat 系统节点获取'),
155  new QuestionItem('6.报告页的值是怎么算的?', '最终以一场测试结果的平均值为准'),
156  new QuestionItem(
157    '7.SP后续规划?',
158    '集成更多采集能力,如trace采集,counter采集,网络采集等等;优化数据展示方式,报告上传网站端,在线分析性能功耗问题'
159  )
160);
161
162export class SummaryItem {
163  public icon: Resource;
164  public content: string;
165  public value: string;
166  public backColor: string;
167
168  constructor(icon: Resource, content: string, value: string, backColor: string) {
169    this.icon = icon;
170    this.content = content;
171    this.value = value;
172    this.backColor = backColor;
173  }
174}
175