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 */ 15 16import {BaseElement, element} from "../../../../base-ui/BaseElement.js"; 17import {LitTabs} from "../../../../base-ui/tabs/lit-tabs.js"; 18import "../../../../base-ui/tabs/lit-tabpane.js"; 19import {CpuStruct} from "../../../bean/CpuStruct.js"; 20import "../../../../base-ui/table/lit-table.js"; 21import {LitTabpane} from "../../../../base-ui/tabs/lit-tabpane.js"; 22import "../sheet/TabPaneCpu.js"; 23import "../sheet/TabPaneThreadStates.js" 24import "../sheet/TabPaneSlices.js" 25import "../sheet/TabPaneCounter.js" 26import "../sheet/TabPaneCpuByProcess.js" 27import "../sheet/TabPaneCpuByThread.js" 28import "../sheet/TabPaneFps.js" 29import "../sheet/TabPaneSPT.js" 30import "../sheet/TabPanePTS.js" 31import "../sheet/TabPaneContextSwitch.js" 32import "../sheet/TabPaneThreadSwitch.js" 33import "../sheet/TabPaneCpuUsage.js"; 34import "../sheet/TabPaneBoxChild.js"; 35import "../sheet/TabPaneHeap.js"; 36import {BoxJumpParam, SelectionParam} from "../../../bean/BoxSelection.js"; 37import {TabPaneThreadStates} from "../sheet/TabPaneThreadStates.js"; 38import {TabPaneCpuByProcess} from "../sheet/TabPaneCpuByProcess.js"; 39import {TabPaneCpuByThread} from "../sheet/TabPaneCpuByThread.js"; 40import {TabPaneSlices} from "../sheet/TabPaneSlices.js"; 41import {TabPaneSPT} from "../sheet/TabPaneSPT.js"; 42import {TabPanePTS} from "../sheet/TabPanePTS.js"; 43import {TabPaneContextSwitch} from "../sheet/TabPaneContextSwitch.js"; 44import {TabPaneThreadSwitch} from "../sheet/TabPaneThreadSwitch.js"; 45import {TabPaneBoxChild} from "../sheet/TabPaneBoxChild.js"; 46import {TabPaneCounter} from "../sheet/TabPaneCounter.js"; 47import "../sheet/TabPaneCurrentSelection.js"; 48import {TabPaneCurrentSelection} from "../sheet/TabPaneCurrentSelection.js"; 49import {FuncStruct} from "../../../bean/FuncStruct.js"; 50import {ProcessMemStruct} from "../../../bean/ProcessMemStruct.js"; 51import {ThreadStruct} from "../../../bean/ThreadStruct.js"; 52import {TabPaneFps} from "../sheet/TabPaneFps.js"; 53import {TabPaneCpuUsage} from "../sheet/TabPaneCpuUsage.js"; 54import "../timer-shaft/TabPaneFlag.js"; 55import {TabPaneFlag} from "../timer-shaft/TabPaneFlag.js"; 56import {Flag} from "../timer-shaft/Flag.js"; 57import {TabPaneHeap} from "../sheet/TabPaneHeap.js"; 58import {WakeupBean} from "../../../bean/WakeupBean.js"; 59 60@element("trace-sheet") 61export class TraceSheet extends BaseElement { 62 private litTabs: LitTabs | undefined | null 63 private nav: HTMLDivElement | undefined | null 64 private tabCurrentSelection: LitTabpane | undefined | null 65 private tabBoxCpuThread: LitTabpane | undefined | null 66 private tabBoxCpuProcess: LitTabpane | undefined | null 67 private tabBoxThreadStates: LitTabpane | undefined | null 68 private tabBoxSlices: LitTabpane | undefined | null 69 private tabBoxCounters: LitTabpane | undefined | null 70 private tabBoxFps: LitTabpane | undefined | null 71 private tabBoxSPT: LitTabpane | undefined | null 72 private tabBoxPTS: LitTabpane | undefined | null 73 private tabBoxContextSwitch: LitTabpane | undefined | null 74 private tabBoxThreadSwitch: LitTabpane | undefined | null 75 private tabBoxCpuUsage: LitTabpane | undefined | null 76 private tabBoxChild: LitTabpane | undefined | null 77 private boxFlag: LitTabpane | undefined | null 78 private tabBoxHeap: LitTabpane | undefined | null 79 private tabSPT: TabPaneSPT | undefined | null 80 private tabPTS: TabPanePTS | undefined | null 81 private tabCs: TabPaneContextSwitch | undefined | null 82 private tabTs: TabPaneThreadSwitch | undefined | null 83 private tabChild: TabPaneBoxChild | undefined | null 84 private currentKey: string = "1"; 85 private selection: SelectionParam | undefined | null; 86 87 static get observedAttributes() { 88 return ['mode']; 89 } 90 91 initElements(): void { 92 this.litTabs = this.shadowRoot?.querySelector("#tabs"); 93 this.tabCurrentSelection = this.shadowRoot?.querySelector("#current-selection"); 94 this.tabBoxCpuThread = this.shadowRoot?.querySelector("#box-cpu-thread"); 95 this.tabBoxCpuProcess = this.shadowRoot?.querySelector("#box-cpu-process"); 96 this.tabBoxThreadStates = this.shadowRoot?.querySelector("#box-thread-states"); 97 this.tabBoxSlices = this.shadowRoot?.querySelector("#box-slices"); 98 this.tabBoxCounters = this.shadowRoot?.querySelector("#box-counters"); 99 this.tabBoxFps = this.shadowRoot?.querySelector("#box-fps"); 100 this.tabBoxSPT = this.shadowRoot?.querySelector("#box-spt"); 101 this.tabBoxPTS = this.shadowRoot?.querySelector("#box-pts"); 102 this.tabBoxContextSwitch = this.shadowRoot?.querySelector("#box-cs"); 103 this.tabBoxThreadSwitch = this.shadowRoot?.querySelector("#box-ts"); 104 this.tabBoxCpuUsage = this.shadowRoot?.querySelector("#box-cpu-usage"); 105 this.tabBoxChild = this.shadowRoot?.querySelector("#box-cpu-child"); 106 this.boxFlag = this.shadowRoot?.querySelector("#box-flag"); 107 this.tabBoxHeap = this.shadowRoot?.querySelector("#box-heap"); 108 109 this.tabSPT = this.shadowRoot!.querySelector<TabPaneSPT>('#tab-spt'); 110 this.tabPTS = this.shadowRoot!.querySelector<TabPanePTS>('#tab-pts'); 111 this.tabCs = this.shadowRoot!.querySelector<TabPaneContextSwitch>('#tab-cs'); 112 this.tabTs = this.shadowRoot!.querySelector<TabPaneThreadSwitch>('#tab-ts'); 113 this.tabChild = this.shadowRoot!.querySelector<TabPaneBoxChild>('#tab-box-child'); 114 115 let minBtn = this.shadowRoot?.querySelector("#min-btn"); 116 minBtn?.addEventListener('click', (e) => { 117 console.log(this.parentElement); 118 }) 119 this.onclick = (e) => { 120 e.preventDefault(); 121 e.stopPropagation(); 122 } 123 this.litTabs!.onTabClick = (e: any) => { 124 this.loadTabPaneData(e.detail.key) 125 } 126 this.litTabs!.addEventListener("close-handler", (e) => { 127 this.recoveryBoxSelection(); 128 this.tabBoxChild!.hidden = true; 129 this.litTabs?.activeByKey(this.currentKey); 130 }) 131 this.tabSPT!.addEventListener("row-click", (e) => { 132 this.jumpBoxChild("11", e) 133 }) 134 this.tabPTS!.addEventListener("row-click", (e) => { 135 this.jumpBoxChild("12", e) 136 }) 137 this.tabCs!.addEventListener("row-click", (e) => { 138 this.jumpBoxChild("13", e) 139 }) 140 this.tabTs!.addEventListener("row-click", (e) => { 141 this.jumpBoxChild("14", e) 142 }) 143 } 144 145 connectedCallback() { 146 this.nav = this.shadowRoot?.querySelector("#tabs")?.shadowRoot?.querySelector('#nav') 147 let tabs: HTMLDivElement | undefined | null = this.shadowRoot?.querySelector('#tabs') 148 let navRoot: HTMLDivElement | null | undefined = this.shadowRoot?.querySelector("#tabs")?.shadowRoot?.querySelector('.nav-root') 149 150 let search: HTMLDivElement | undefined | null = document.querySelector("body > sp-application")?.shadowRoot?.querySelector("div > div.search-container") 151 let timerShaft: HTMLDivElement | undefined | null = this.parentElement?.querySelector(".timer-shaft") 152 153 let borderTop: number = 1; 154 let initialHeight = { 155 tabs: `calc(30vh + 39px)`, 156 node: "30vh" 157 } 158 this.nav!.onmousedown = (event) => { 159 let litTabpane: NodeListOf<HTMLDivElement> | undefined | null = this.shadowRoot?.querySelectorAll("#tabs > lit-tabpane") 160 let preY = event.pageY; 161 162 let preHeight = tabs!.offsetHeight; 163 164 document.onmousemove = function (event) { 165 let moveY: number; 166 167 moveY = preHeight - (event.pageY - preY) 168 litTabpane!.forEach((node: HTMLDivElement, b) => { 169 if (navRoot!.offsetHeight <= moveY && (search!.offsetHeight + timerShaft!.offsetHeight + borderTop) <= (window.innerHeight - moveY)) { 170 tabs!.style.height = moveY + "px" 171 node!.style.height = (moveY - navRoot!.offsetHeight) + "px" 172 // @ts-ignore 173 tabsPackUp.name = "down" 174 } else if (navRoot!.offsetHeight >= moveY) { 175 tabs!.style.height = navRoot!.offsetHeight + "px" 176 node!.style.height = "0px" 177 // @ts-ignore 178 tabsPackUp.name = "up" 179 } else if ((search!.offsetHeight + timerShaft!.offsetHeight + borderTop) >= (window.innerHeight - moveY)) { 180 tabs!.style.height = (window.innerHeight - search!.offsetHeight - timerShaft!.offsetHeight - borderTop) + "px" 181 node!.style.height = (window.innerHeight - search!.offsetHeight - timerShaft!.offsetHeight - navRoot!.offsetHeight - borderTop) + "px" 182 // @ts-ignore 183 tabsPackUp.name = "down" 184 } 185 }) 186 187 } 188 document.onmouseup = function (event) { 189 litTabpane!.forEach((node: HTMLDivElement, b) => { 190 if (node!.style.height !== "0px" && tabs!.style.height != "") { 191 initialHeight.node = node!.style.height; 192 initialHeight.tabs = tabs!.style.height; 193 } 194 }) 195 this.onmousemove = null; 196 this.onmouseup = null; 197 } 198 } 199 let tabsOpenUp: HTMLDivElement | undefined | null = this.shadowRoot?.querySelector("#tabs > div > lit-icon:nth-child(1)") 200 let tabsPackUp: HTMLDivElement | undefined | null = this.shadowRoot?.querySelector("#tabs > div > lit-icon:nth-child(2)") 201 tabsOpenUp!.onclick = (e) => { 202 tabs!.style.height = (window.innerHeight - search!.offsetHeight - timerShaft!.offsetHeight - borderTop) + "px" 203 let litTabpane: NodeListOf<HTMLDivElement> | undefined | null = this.shadowRoot?.querySelectorAll("#tabs > lit-tabpane") 204 litTabpane!.forEach((node: HTMLDivElement, b) => { 205 node!.style.height = (window.innerHeight - search!.offsetHeight - timerShaft!.offsetHeight - navRoot!.offsetHeight - borderTop) + "px" 206 initialHeight.node = node!.style.height; 207 }) 208 initialHeight.tabs = tabs!.style.height; 209 // @ts-ignore 210 tabsPackUp.name = "down" 211 } 212 tabsPackUp!.onclick = (e) => { 213 let litTabpane: NodeListOf<HTMLDivElement> | undefined | null = this.shadowRoot?.querySelectorAll("#tabs > lit-tabpane") 214 // @ts-ignore 215 if (tabsPackUp.name == "down") { 216 tabs!.style.height = navRoot!.offsetHeight + "px" 217 litTabpane!.forEach((node: HTMLDivElement, b) => { 218 node!.style.height = "0px" 219 }) 220 // @ts-ignore 221 tabsPackUp.name = "up" 222 } else { 223 // @ts-ignore 224 tabsPackUp.name = "down" 225 tabs!.style.height = initialHeight.tabs; 226 litTabpane!.forEach((node: HTMLDivElement, b) => { 227 node!.style.height = initialHeight.node; 228 }) 229 } 230 } 231 } 232 233 initHtml(): string { 234 return ` 235 <style> 236 :host([mode='hidden']){ 237 display: none; 238 } 239 :host{ 240 display: block; 241 background-color: rebeccapurple; 242 } 243 244 .tabHeight{ 245 height: 30vh; 246 background-color: var(--dark-background,#FFFFFF); 247 } 248 249 </style> 250 <div style="border-top: 0.5px solid var(--dark-border1,#D5D5D5);"> 251 <lit-tabs id="tabs" position="top-left" activekey="1" mode="card" > 252 <div slot="right" style="margin: 0 10px; color: var(--dark-icon,#606060)"> 253 <lit-icon id="max-btn" name="vertical-align-top" style="font-weight: bold;cursor: pointer;" size="20"></lit-icon> 254 <lit-icon id="min-btn" name="down" style="font-weight: bold;cursor: pointer;" size="20"></lit-icon> 255 </div> 256 <lit-tabpane id="current-selection" key="1" hidden tab="Current Selection" class="tabHeight"> 257 <tabpane-current-selection id="tabpane-cpu"></tabpane-current-selection> 258 </lit-tabpane> 259 <lit-tabpane id="box-cpu-thread" key="2" hidden tab="CPU by thread" class="tabHeight"> 260 <tabpane-cpu-thread id="tab-cpu-thread"></tabpane-cpu-thread> 261 </lit-tabpane> 262 <lit-tabpane id="box-cpu-process" key="3" hidden tab="CPU by process" class="tabHeight"> 263 <tabpane-cpu-process id="tab-cpu-process"></tabpane-cpu-process> 264 </lit-tabpane> 265 <lit-tabpane id="box-thread-states" key="4" hidden tab="Thread States" class="tabHeight"> 266 <tabpane-thread-states id="tab-thread-states" ></tabpane-thread-states> 267 </lit-tabpane> 268 <lit-tabpane id="box-slices" key="5" hidden tab="Slices" class="tabHeight"> 269 <tabpane-slices id="tab-slices"></tabpane-slices> 270 </lit-tabpane> 271 <lit-tabpane id="box-counters" key="6" hidden tab="Counters" class="tabHeight"> 272 <tabpane-counter id="tab-counters"></tabpane-counter> 273 </lit-tabpane> 274 <lit-tabpane id="box-fps" key="7" hidden tab="FPS" class="tabHeight"> 275 <tabpane-fps id="tab-fps"></tabpane-fps> 276 </lit-tabpane> 277 <lit-tabpane id="box-cpu-usage" key="8" hidden tab="CPU Usage" class="tabHeight"> 278 <tabpane-cpu-usage id="tab-cpu-usage"></tabpane-cpu-usage> 279 </lit-tabpane> 280 <lit-tabpane id="box-heap" key="9" hidden tab="Native Hook" class="tabHeight"> 281 <tabpane-heap id="tab-heap"></tabpane-heap> 282 </lit-tabpane> 283 <lit-tabpane id="box-flag" key="10" hidden tab="Current Selection" class="tabHeight"> 284 <tabpane-flag id="tab-flag"></tabpane-flag> 285 </lit-tabpane> 286 287 <lit-tabpane id="box-spt" key="11" hidden tab="States List" class="tabHeight"> 288 <tabpane-spt id="tab-spt"></tabpane-spt> 289 </lit-tabpane> 290 <lit-tabpane id="box-cs" key="13" hidden tab="Switches List" class="tabHeight"> 291 <tabpane-context-switch id="tab-cs"></tabpane-context-switch> 292 </lit-tabpane> 293 <lit-tabpane id="box-pts" key="12" hidden tab="Thread States" class="tabHeight"> 294 <tabpane-pts id="tab-pts"></tabpane-pts> 295 </lit-tabpane> 296 <lit-tabpane id="box-ts" key="14" hidden tab="Thread Switches" class="tabHeight"> 297 <tabpane-thread-switch id="tab-ts"></tabpane-thread-switch> 298 </lit-tabpane> 299 <lit-tabpane id="box-cpu-child" key="15" hidden tab="" closeable class="tabHeight"> 300 <tabpane-box-child id="tab-box-child"></tabpane-box-child> 301 </lit-tabpane> 302 </lit-tabs> 303 </div>`; 304 } 305 306 clear() { 307 this.shadowRoot?.querySelectorAll("lit-tabpane").forEach(it => this.litTabs?.removeChild(it)) 308 } 309 310 displayThreadData(data: ThreadStruct) { 311 this.setAttribute("mode", "max") 312 this.tabCurrentSelection!.hidden = false; 313 this.hideBoxTab(); 314 this.litTabs?.activeByKey("1") 315 let tabCpu = this.shadowRoot!.querySelector<TabPaneCurrentSelection>('#tabpane-cpu'); 316 tabCpu!.setThreadData(data) 317 } 318 319 displayMemData(data: ProcessMemStruct) { 320 this.setAttribute("mode", "max") 321 this.tabCurrentSelection!.hidden = false; 322 this.hideBoxTab(); 323 this.litTabs?.activeByKey("1") 324 let tabCpu = this.shadowRoot!.querySelector<TabPaneCurrentSelection>('#tabpane-cpu'); 325 tabCpu!.setMemData(data) 326 } 327 328 displayFuncData(data: FuncStruct) { 329 this.setAttribute("mode", "max") 330 this.tabCurrentSelection!.hidden = false; 331 this.hideBoxTab(); 332 this.litTabs?.activeByKey("1") 333 let tabCpu = this.shadowRoot!.querySelector<TabPaneCurrentSelection>('#tabpane-cpu'); 334 tabCpu!.setFunctionData(data) 335 } 336 337 displayCpuData(data: CpuStruct, callback: ((data: WakeupBean | null) => void) | undefined = undefined) { 338 this.setAttribute("mode", "max") 339 this.tabCurrentSelection!.hidden = false; 340 this.hideBoxTab(); 341 this.litTabs?.activeByKey("1") 342 let tabCpu = this.shadowRoot!.querySelector<TabPaneCurrentSelection>('#tabpane-cpu'); 343 tabCpu!.setCpuData(data, callback) 344 } 345 346 displayFlagData(flagObj: Flag, idx: number) { 347 this.setAttribute("mode", "max") 348 this.tabCurrentSelection!.hidden = true; 349 this.hideBoxTab(); 350 this.boxFlag!.hidden = false; 351 this.litTabs?.activeByKey("10") 352 let tabFlag = this.shadowRoot!.querySelector<TabPaneFlag>('#tab-flag'); 353 tabFlag?.setFlagObj(flagObj, idx) 354 } 355 356 boxSelection(selection: SelectionParam) { 357 this.tabBoxChild!.hidden = true; 358 this.selection = selection; 359 if (selection.hasFps || selection.cpus.length > 0 || selection.threadIds.length > 0 || selection.funTids.length > 0 || selection.trackIds.length > 0 || selection.heapIds.length > 0) { 360 this.setAttribute("mode", "max") 361 this.tabCurrentSelection!.hidden = true; 362 this.tabBoxCpuThread!.hidden = selection.cpus.length == 0; 363 this.tabBoxCpuProcess!.hidden = selection.cpus.length == 0; 364 this.tabBoxCpuUsage!.hidden = selection.cpus.length == 0; 365 this.tabBoxSPT!.hidden = selection.cpus.length == 0; 366 this.tabBoxPTS!.hidden = selection.cpus.length == 0; 367 this.tabBoxContextSwitch!.hidden = selection.cpus.length == 0; 368 this.tabBoxThreadSwitch!.hidden = selection.cpus.length == 0; 369 this.tabBoxThreadStates!.hidden = selection.threadIds.length == 0; 370 this.tabBoxSlices!.hidden = selection.funTids.length == 0; 371 this.tabBoxCounters!.hidden = selection.trackIds.length == 0; 372 this.tabBoxFps!.hidden = !selection.hasFps; 373 this.tabBoxHeap!.hidden = selection.heapIds.length == 0; 374 this.setBoxActiveKey(selection); 375 } else { 376 this.setAttribute("mode", "hidden") 377 } 378 } 379 380 recoveryBoxSelection() { 381 this.tabCurrentSelection!.hidden = true; 382 this.tabBoxCpuThread!.hidden = !(this.selection!.cpus.length > 0); 383 this.tabBoxCpuProcess!.hidden = !(this.selection!.cpus.length > 0); 384 this.tabBoxCpuUsage!.hidden = !(this.selection!.cpus.length > 0); 385 this.tabBoxSPT!.hidden = !(this.selection!.cpus.length > 0); 386 this.tabBoxPTS!.hidden = !(this.selection!.cpus.length > 0); 387 this.tabBoxContextSwitch!.hidden = !(this.selection!.cpus.length > 0); 388 this.tabBoxThreadSwitch!.hidden = !(this.selection!.cpus.length > 0); 389 this.tabBoxThreadStates!.hidden = !(this.selection!.threadIds.length > 0); 390 this.tabBoxSlices!.hidden = !(this.selection!.funTids.length > 0); 391 this.tabBoxCounters!.hidden = !(this.selection!.trackIds.length > 0) 392 this.tabBoxFps!.hidden = !this.selection?.hasFps; 393 } 394 395 setBoxActiveKey(val: SelectionParam) { 396 if (val.cpus.length > 0) { 397 this.litTabs?.activeByKey("2") 398 this.loadTabPaneData("2") 399 } else if (val.threadIds.length > 0) { 400 this.litTabs?.activeByKey("4") 401 this.loadTabPaneData("4") 402 } else if (val.funTids.length > 0) { 403 this.litTabs?.activeByKey("5") 404 this.loadTabPaneData("5") 405 } else if (val.trackIds.length > 0) { 406 this.litTabs?.activeByKey("6") 407 this.loadTabPaneData("6") 408 } else if (val.hasFps) { 409 this.litTabs?.activeByKey("7") 410 this.loadTabPaneData("7") 411 } else if (val.heapIds.length > 0) { 412 this.litTabs?.activeByKey("9") 413 this.loadTabPaneData("9") 414 } else { 415 this.litTabs?.activeByKey("1") 416 this.loadTabPaneData("1") 417 } 418 } 419 420 loadTabPaneData(key: string) { 421 if (key == "2") { 422 let tabCpuThread = this.shadowRoot!.querySelector<TabPaneCpuByThread>('#tab-cpu-thread'); 423 tabCpuThread!.data = this.selection; 424 } else if (key == "3") { 425 let tabCpuProcess = this.shadowRoot!.querySelector<TabPaneCpuByProcess>('#tab-cpu-process'); 426 tabCpuProcess!.data = this.selection; 427 } else if (key == "4") { 428 let tabThreadStates = this.shadowRoot!.querySelector<TabPaneThreadStates>('#tab-thread-states'); 429 tabThreadStates!.data = this.selection; 430 } else if (key == "5") { 431 let tabSlices = this.shadowRoot!.querySelector<TabPaneSlices>('#tab-slices'); 432 tabSlices!.data = this.selection; 433 } else if (key == "6") { 434 let tabCounters = this.shadowRoot!.querySelector<TabPaneCounter>('#tab-counters'); 435 tabCounters!.data = this.selection; 436 } else if (key == "7") { 437 let tabFps = this.shadowRoot!.querySelector<TabPaneFps>('#tab-fps'); 438 tabFps!.data = this.selection; 439 } else if (key == "8") { 440 let tabCpuUsage = this.shadowRoot!.querySelector<TabPaneCpuUsage>('#tab-cpu-usage'); 441 tabCpuUsage!.data = this.selection; 442 } else if (key == "9") { 443 let tabHeap = this.shadowRoot!.querySelector<TabPaneHeap>('#tab-heap'); 444 tabHeap!.data = this.selection; 445 } else if (key == "10") { 446 447 } else if (key == "11") { 448 this.tabSPT!.data = this.selection; 449 } else if (key == "12") { 450 this.tabPTS!.data = this.selection; 451 } else if (key == "13") { 452 this.tabCs!.data = this.selection; 453 } else if (key == "14") { 454 this.tabTs!.data = this.selection; 455 } 456 } 457 458 hideBoxTab() { 459 this.tabBoxCpuThread!.hidden = true; 460 this.tabBoxCpuProcess!.hidden = true; 461 this.tabBoxThreadStates!.hidden = true; 462 this.tabBoxSlices!.hidden = true; 463 this.tabBoxCounters!.hidden = true; 464 this.tabBoxFps!.hidden = true; 465 this.tabBoxSPT!.hidden = true; 466 this.tabBoxPTS!.hidden = true; 467 this.tabBoxContextSwitch!.hidden = true; 468 this.tabBoxThreadSwitch!.hidden = true; 469 this.tabBoxCpuUsage!.hidden = true; 470 this.boxFlag!.hidden = true; 471 this.tabBoxHeap!.hidden = true; 472 this.tabBoxChild!.hidden = true; 473 } 474 475 hideOtherBoxTab(key: string) { 476 this.tabBoxCpuThread!.hidden = true; 477 this.tabBoxCpuProcess!.hidden = true; 478 this.tabBoxThreadStates!.hidden = true; 479 this.tabBoxSlices!.hidden = true; 480 this.tabBoxCounters!.hidden = true; 481 this.tabBoxFps!.hidden = true; 482 this.tabBoxCpuUsage!.hidden = true; 483 this.tabBoxHeap!.hidden = true; 484 if (key == "11") { 485 this.tabBoxPTS!.hidden = true; 486 this.tabBoxContextSwitch!.hidden = true; 487 this.tabBoxThreadSwitch!.hidden = true; 488 } else if (key == "12") { 489 this.tabBoxSPT!.hidden = true; 490 this.tabBoxContextSwitch!.hidden = true; 491 this.tabBoxThreadSwitch!.hidden = true; 492 } else if (key == "13") { 493 this.tabBoxSPT!.hidden = true; 494 this.tabBoxPTS!.hidden = true; 495 this.tabBoxThreadSwitch!.hidden = true; 496 } else if (key == "14") { 497 this.tabBoxSPT!.hidden = true; 498 this.tabBoxPTS!.hidden = true; 499 this.tabBoxContextSwitch!.hidden = true; 500 } 501 this.tabBoxChild!.hidden = false 502 this.currentKey = key 503 this.litTabs?.activeByKey("15") 504 } 505 506 jumpBoxChild(key: string, e: any) { 507 this.hideOtherBoxTab(key) 508 this.tabBoxChild!.tab = e.detail.title 509 let param = new BoxJumpParam(); 510 param.leftNs = this.selection!.leftNs; 511 param.rightNs = this.selection!.rightNs; 512 param.state = e.detail.state; 513 param.threadId = e.detail.threadId; 514 param.processId = e.detail.processId; 515 this.tabChild!.data = param; 516 } 517} 518