diff --git a/ide/src/trace/bean/BoxSelection.ts b/ide/src/trace/bean/BoxSelection.ts index 3a95a14cdd7bb8892171083b96486083e8e1f526..ef7af45fc9599d14f315a9f9144e9ea30c4502f1 100644 --- a/ide/src/trace/bean/BoxSelection.ts +++ b/ide/src/trace/bean/BoxSelection.ts @@ -40,6 +40,9 @@ export class SelectionParam { isCurrentPane: boolean = false; startup: boolean = false; staticInit: boolean = false; + eventTypeId: string = ''; + + cpus: Array = []; cpuStateRowsId: Array = []; diff --git a/ide/src/trace/component/trace/sheet/TabPaneFilter.ts b/ide/src/trace/component/trace/sheet/TabPaneFilter.ts index b98b500d2fe8d85f61dfa169e16b508cefb18d23..55ff78b5ec5704fa33e757a04c976c9437ab44da 100644 --- a/ide/src/trace/component/trace/sheet/TabPaneFilter.ts +++ b/ide/src/trace/component/trace/sheet/TabPaneFilter.ts @@ -58,7 +58,6 @@ export class TabPaneFilter extends BaseElement { private cutList: Array | undefined; private libraryList: Array | undefined; - private transferChecked: string | undefined; filterData(type: string, data: object = {}) { return { @@ -103,7 +102,6 @@ export class TabPaneFilter extends BaseElement { this.markButtonEL = this.shadowRoot?.querySelector('#mark'); this.iconEL = this.shadowRoot?.querySelector('#icon'); this.statisticsName = this.shadowRoot?.querySelector('.statistics-name'); - let transferEL = this.shadowRoot?.querySelector('.transfer-text'); this.iconEL!.onclick = (e) => { if (this.iconEL!.name == 'statistics') { this.iconEL!.name = 'menu'; @@ -126,10 +124,6 @@ export class TabPaneFilter extends BaseElement { } }; - transferEL!.onclick = () => { - this.getTransferList(); - }; - this.markButtonEL!.onclick = (e) => { if (this.getFilter) { this.getFilter(this.filterData('mark', { mark: true })); @@ -437,36 +431,20 @@ export class TabPaneFilter extends BaseElement { initializeTreeTransfer() { let radioList = this.shadowRoot!.querySelectorAll('.radio'); let divElement = this.shadowRoot!.querySelectorAll('.tree-radio'); - - if (this.transferChecked && this.transferChecked !== 'count') { - radioList![Number(this.transferChecked)].checked = true; - } else if (this.transferChecked && this.transferChecked == 'count') { - radioList![radioList.length - 1].checked = true; - } + radioList![radioList.length -1].checked = true; divElement!.forEach((divEl, idx) => { divEl.addEventListener('click', () => { - this.transferChecked = radioList![idx].value; radioList![idx].checked = true; if (this.getCallTransfer) { this.getCallTransfer({ - value: radioList![idx].value, - }); + eventTypeId: radioList![idx].value + }) } }); }); } - refreshTreeTransfer() { - let radioList = this.shadowRoot!.querySelectorAll('.radio'); - if (this.transferChecked && this.transferChecked !== 'count') { - radioList![Number(this.transferChecked)].checked = false; - } else if (this.transferChecked && this.transferChecked == 'count') { - radioList![radioList.length - 1].checked = false; - } - this.transferChecked = ''; - } - initializeTreeConstraints() { let inputs = this.shadowRoot!.querySelectorAll('.constraints-input'); let check = this.shadowRoot!.querySelector('#constraints-check'); diff --git a/ide/src/trace/component/trace/sheet/hiperf/TabPerfProfile.ts b/ide/src/trace/component/trace/sheet/hiperf/TabPerfProfile.ts index 0ce3fbcfb08fd853000fcd149385b3c2257abec7..db6f04e7ed3f46a6cfc7695f0c87d1229c350b72 100644 --- a/ide/src/trace/component/trace/sheet/hiperf/TabPerfProfile.ts +++ b/ide/src/trace/component/trace/sheet/hiperf/TabPerfProfile.ts @@ -67,21 +67,25 @@ export class TabpanePerfProfile extends BaseElement { this.perfProfilerFilter!.style.display = 'none'; } this.perfProfilerFilter!.disabledTransfer(false, 'perf'); + this.perfProfilerFilter!.getTransferList(); this.perfProfilerFilter!.initializeFilterTree(true, true, true); this.perfProfilerFilter!.filterValue = ''; - this.perfProfilerFilter!.refreshTreeTransfer(); this.perfProfileProgressEL!.loading = true; this.perfProfileLoadingPage.style.visibility = 'visible'; + this.getDataByWorkAndUpDateCanvas(perfProfilerSelection); + } + + getDataByWorkAndUpDateCanvas(perfProfilerSelection: SelectionParam) { const initWidth = this.clientWidth; this.initGetData(perfProfilerSelection, initWidth); this.perfProfilerFilter!.getCallTransferData((data: any) => { - perfProfilerSelection.eventTypeId = data.value !== 'count' ? data.value : undefined; - this.initGetData(perfProfilerSelection, initWidth, data); + perfProfilerSelection.eventTypeId = data.eventTypeId !== 'count' ? data.eventTypeId : undefined; + this.initGetData(perfProfilerSelection, initWidth); }); } - initGetData(perfProfilerSelection: SelectionParam | any, initWidth: number, data?: any): void { + initGetData(perfProfilerSelection: SelectionParam | any, initWidth: number): void { this.getDataByWorker( [ { @@ -96,18 +100,17 @@ export class TabpanePerfProfile extends BaseElement { (results: any[]) => { this.setPerfProfilerLeftTableData(results); this.perfProfilerList!.recycleDataSource = []; - if (data && data.value !== 'count') { + if(perfProfilerSelection.eventTypeId && perfProfilerSelection.eventTypeId !== 'count') { this.perfProfileFrameChart!.mode = ChartMode.EventCount; - } else { + }else{ this.perfProfileFrameChart!.mode = ChartMode.Count; } - + this.perfProfileFrameChart?.updateCanvas(true, initWidth); this.perfProfileFrameChart!.data = this.perfProfilerDataSource; this.switchFlameChart(); this.perfProfilerFilter!.icon = 'block'; - } - ); + }) } getParentTree(