Skip to content

Commit 4bec308

Browse files
joaomariolagopatrickelectric
authored andcommitted
frontend: ParameterLoader: Fix invalid parameter
* Change to not use printParamWithUnit when parameter is not found in autopilot_data, instead uses N/A for current and just raw value for new parameter
1 parent 8bc6b21 commit 4bec308

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

core/frontend/src/components/parameter-editor/ParameterLoader.vue

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,31 @@
5151
<v-col class="virtual-table-cell name-cell">
5252
<v-tooltip bottom>
5353
<template #activator="{ on }">
54-
<div v-on="on">
54+
<div :style="!item.current ? { color: 'var(--v-warning-base)' } : {}" v-on="on">
5555
{{ item.name }}
5656
</div>
5757
</template>
5858
<span>
59-
{{ item.current?.description ?? 'No description provided' }}
59+
{{
60+
item.current
61+
? item.current?.description ?? 'No description provided'
62+
: 'Parameter not found in Autopilot data, most likely will not be written to the vehicle.'
63+
}}
6064
</span>
6165
</v-tooltip>
6266
</v-col>
6367
<v-col class="virtual-table-cell">
64-
<v-tooltip bottom>
68+
<v-tooltip :disabled="!item.current" bottom>
6569
<template #activator="{ on }">
6670
<div
6771
class="large-text-cell"
6872
v-on="on"
6973
>
70-
{{ printParamWithUnit(item.current) }}
74+
{{ item.current ? printParamWithUnit(item.current) : 'N/A' }}
7175
</div>
7276
</template>
7377
<span>
74-
{{ printParamWithUnit(item.current) }}
78+
{{ item.current ? printParamWithUnit(item.current) : 'N/A' }}
7579
</span>
7680
</v-tooltip>
7781
</v-col>
@@ -82,11 +86,11 @@
8286
class="large-text-cell"
8387
v-on="on"
8488
>
85-
{{ printParamWithUnit(item.new) }}
89+
{{ item.current ? printParamWithUnit(item.new) : item.new.value }}
8690
</div>
8791
</template>
8892
<span>
89-
{{ printParamWithUnit(item.new) }}
93+
{{ item.current ? printParamWithUnit(item.new) : item.new.value }}
9094
</span>
9195
</v-tooltip>
9296
</v-col>
@@ -294,7 +298,7 @@ export default Vue.extend({
294298
295299
return {
296300
name,
297-
current: currentParameter,
301+
current: currentParameter ?? undefined,
298302
new: { ...currentParameter, value },
299303
}
300304
})

0 commit comments

Comments
 (0)