29
29
<p v-else-if =" (Object.keys(filtered_param_sets).length === 0)" >
30
30
No parameters available for this setup.
31
31
</p >
32
- <v-virtual-scroll
33
- v-if =" value_items.length > 0"
34
- class =" flex-grow"
35
- :items =" value_items"
36
- height =" 200"
37
- item-height =" 20"
38
- style =" min-width : 50% ;"
32
+ <v-card
33
+ v-if =" Object.keys(value).length !== 0"
39
34
>
40
- <template #default =" { item } " >
41
- <v-list-item >
42
- <v-list-item-content >
43
- <v-list-item-title >{{ item.key }} {{ item.value }}</v-list-item-title >
44
- </v-list-item-content >
45
- </v-list-item >
46
- </template >
47
- </v-virtual-scroll >
35
+ <v-card-text >
36
+ <v-row class =" virtual-table-row" >
37
+ <v-col class =" virtual-table-cell name-cell" >
38
+ <strong >Name</strong >
39
+ </v-col >
40
+ <v-col class =" virtual-table-cell" >
41
+ <strong >Value</strong >
42
+ </v-col >
43
+ </v-row >
44
+ </v-card-text >
45
+ <v-virtual-scroll
46
+ :items =" parametersFromSet(value)"
47
+ height =" 250"
48
+ item-height =" 30"
49
+ class =" virtual-table"
50
+ >
51
+ <template #default =" { item } " >
52
+ <v-row class =" virtual-table-row" >
53
+ <v-col class =" virtual-table-cell name-cell" >
54
+ <v-tooltip bottom >
55
+ <template #activator =" { on } " >
56
+ <div v-on =" on" >
57
+ {{ item.name }}
58
+ </div >
59
+ </template >
60
+ <span >
61
+ {{ item.current?.description ?? 'No description provided' }}
62
+ </span >
63
+ </v-tooltip >
64
+ </v-col >
65
+ <v-col class =" virtual-table-cell" >
66
+ <v-tooltip bottom >
67
+ <template #activator =" { on } " >
68
+ <div
69
+ class =" large-text-cell"
70
+ v-on =" on"
71
+ >
72
+ {{ printParamWithUnit(item.current) }}
73
+ </div >
74
+ </template >
75
+ <span >
76
+ {{ printParamWithUnit(item.current) }}
77
+ </span >
78
+ </v-tooltip >
79
+ </v-col >
80
+ </v-row >
81
+ </template >
82
+ </v-virtual-scroll >
83
+ </v-card >
48
84
</div >
49
85
</template >
50
86
@@ -53,8 +89,10 @@ import { SemVer } from 'semver'
53
89
import Vue , { PropType } from ' vue'
54
90
import { Dictionary } from ' vue-router'
55
91
92
+ import autopilot_data from ' @/store/autopilot'
56
93
import autopilot from ' @/store/autopilot_manager'
57
94
import { Firmware , Vehicle } from ' @/types/autopilot'
95
+ import { printParamWithUnit } from ' @/types/autopilot/parameter'
58
96
import { VForm } from ' @/types/vuetify'
59
97
import { callPeriodically , stopCallingPeriodically } from ' @/utils/helper_functions'
60
98
@@ -121,9 +159,6 @@ export default Vue.extend({
121
159
board(): string | undefined {
122
160
return autopilot .current_board ?.name
123
161
},
124
- value_items(): { key: string , value: number }[] {
125
- return Object .entries (this .value ?? {}).map (([key , value ]) => ({ key , value }))
126
- },
127
162
invalid_board(): boolean {
128
163
return ! this .board
129
164
},
@@ -208,6 +243,49 @@ export default Vue.extend({
208
243
this .selected_param_set = paramSet
209
244
this .$emit (' input' , paramSet )
210
245
},
246
+ parametersFromSet(paramset : Dictionary <number >) {
247
+ return Object .entries (paramset ).map (([name ]) => {
248
+ const currentParameter = autopilot_data .parameter (name )
249
+
250
+ return {
251
+ name ,
252
+ current: currentParameter ,
253
+ }
254
+ })
255
+ },
256
+ printParamWithUnit ,
211
257
},
212
258
})
213
259
</script >
260
+ <style scoped>
261
+ .virtual-table-row {
262
+ display : flex ;
263
+ margin : 0 ;
264
+ margin-bottom : 15px ;
265
+ border-bottom : 1px solid #eee ;
266
+ flex-wrap : nowrap ;
267
+ }
268
+
269
+ .virtual-table-cell {
270
+ flex : 1 ;
271
+ padding : 5px ;
272
+ height : 30px ;
273
+ min-width : 150px ;
274
+ }
275
+ .virtual-table-cell .v-input {
276
+ margin-top : -6px ;
277
+ }
278
+ .virtual-table-cell .large-text-cell {
279
+ white-space : nowrap ;
280
+ overflow : hidden ;
281
+ text-overflow : ellipsis ;
282
+ }
283
+
284
+ .name-cell {
285
+ min-width : 200px ;
286
+ }
287
+
288
+ .virtual-table {
289
+ overflow-x : hidden ;
290
+ }
291
+ </style >
0 commit comments