Remove ProtoLog from timeline
Test: N/A
Change-Id: I537765b3715bbe343117082d9100bc2d579e16fc
diff --git a/tools/winscope/src/BottomNavigation.vue b/tools/winscope/src/BottomNavigation.vue
index f7bde04..05dae3e 100644
--- a/tools/winscope/src/BottomNavigation.vue
+++ b/tools/winscope/src/BottomNavigation.vue
@@ -102,16 +102,19 @@
</div>
<md-list>
- <md-list-item v-for="(file, idx) in files" :key="file.filename">
+ <md-list-item
+ v-for="indexedFile in indexedTimelineFiles"
+ :key="indexedFile.file.filename"
+ >
<md-icon>
- {{file.type.icon}}
- <md-tooltip md-direction="right">{{file.type.name}}</md-tooltip>
+ {{indexedFile.file.type.icon}}
+ <md-tooltip md-direction="right">{{indexedFile.file.type.name}}</md-tooltip>
</md-icon>
<timeline
- :items="file.timeline"
- :selected-index="file.selectedIndex"
+ :items="indexedFile.file.timeline"
+ :selected-index="indexedFile.file.selectedIndex"
:scale="scale"
- @item-selected="onTimelineItemSelected($event, idx)"
+ @item-selected="onTimelineItemSelected($event, indexedFile.index)"
class="timeline"
/>
</md-list-item>
@@ -135,7 +138,9 @@
import DataFilter from './DataFilter.vue'
import DraggableDiv from './DraggableDiv.vue'
import VideoView from './VideoView.vue'
+
import { nanos_to_string } from './transform.js'
+import { DATA_TYPES } from './decode.js'
// Find the index of the last element matching the predicate in a sorted array
function findLastMatchingSorted(array, predicate) {
@@ -156,6 +161,24 @@
name: 'bottom-navigation',
props: [ 'files', 'video', 'store', 'activeFile' ],
data() {
+ // Files that should be excluded from being shown in timeline
+ const timelineFileFilter = new Set([DATA_TYPES.PROTO_LOG]);
+
+ const timelineFiles = this.files
+ .filter(file => !timelineFileFilter.has(file.type));
+
+ const indexedTimelineFiles = [];
+ for (let i = 0; i < this.files.length; i++) {
+ const file = this.files[i];
+
+ if (!timelineFileFilter.has(file.type)) {
+ indexedTimelineFiles.push({
+ index: i,
+ file: file,
+ })
+ }
+ }
+
return {
minimized: true,
currentTimestamp: 0,
@@ -169,6 +192,8 @@
resizeOffset: 0,
showVideoOverlay: true,
videoOverlayTop: 0,
+ timelineFiles,
+ indexedTimelineFiles,
}
},
computed: {