Skip to content

Commit

Permalink
PwmSetup:: add servoToHighlight function and map for handling newer a…
Browse files Browse the repository at this point in the history
…rdusub version functions in highlighting
  • Loading branch information
Williangalvani committed Feb 19, 2025
1 parent 44e4a3d commit 55fbe3b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/frontend/src/components/vehiclesetup/PwmSetup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
v-for="(item, index) in servo_function_parameters"
:key="item.name"
style="cursor: pointer;"
@mouseover="highlight = [stringToUserFriendlyText(printParam(item))]"
@mouseover="highlight = [servoToHighlight(item)]"
@mouseleave="highlight = default_highlight"
@click="showParamEdit(item)"
>
Expand Down Expand Up @@ -426,6 +426,14 @@ export default Vue.extend({
const left = percent < 0 ? 50 + percent : 50
return `width: ${Math.abs(percent)}%; left: ${left}%; background-color: red`
},
servoToHighlight(param: Parameter): string {
const pretty_name = this.stringToUserFriendlyText(printParam(param))
// map for backwards compatibility
const map: Record<string, string> = {
Mount1Pitch: 'MountTilt',
}
return map[pretty_name] ?? pretty_name
},
showParamEdit(param: Parameter) {
this.selected_param = param
this.edit_param_dialog = true
Expand Down

0 comments on commit 55fbe3b

Please sign in to comment.