-
Notifications
You must be signed in to change notification settings - Fork 119
Create configuration page for lights #2368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Williangalvani
commented
Feb 6, 2024
core/frontend/src/components/vehiclesetup/configuration/lights.vue
Outdated
Show resolved
Hide resolved
| lights1_new_param(new_param_name: string | undefined) { | ||
| if (new_param_name) { | ||
| // reset any other parameter using lights1 to undefined | ||
| for (const old_param of this.servo_params) { | ||
| if (old_param.name === new_param_name) { | ||
| continue | ||
| } | ||
| if (old_param.value === Lights.Lights1) { | ||
| // set the old parameter to DISABLED | ||
| mavlink2rest.setParam(old_param.name, Lights.DISABLED, autopilot_data.system_id) | ||
| } | ||
| } | ||
| mavlink2rest.setParam(new_param_name, Lights.Lights1, autopilot_data.system_id) | ||
| } | ||
| }, | ||
| lights2_new_param(new_param_name: string | undefined) { | ||
| if (new_param_name) { | ||
| // reset any other parameter using lights2 to undefined | ||
| for (const old_param of this.servo_params) { | ||
| if (old_param.name === new_param_name) { | ||
| continue | ||
| } | ||
| if (old_param.value === Lights.Lights2) { | ||
| // set the old parameter to DISABLED | ||
| mavlink2rest.setParam(old_param.name, Lights.DISABLED, autopilot_data.system_id) | ||
| } | ||
| } | ||
| mavlink2rest.setParam(new_param_name, Lights.Lights2, autopilot_data.system_id) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we encapsulate this in a single function for both lights ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| <v-card> | ||
| <v-card-title> Joystick steps </v-card-title> | ||
| <v-card-text> | ||
| How many button presses it takes to go from 0% to 100% brightness. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that asking the user a percentage per step over the number of buttons press is more friendly. Maybe rephrasing it helps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
improved the wording and added a live-updated percentage
3c5a8ec to
9a792c4
Compare
|
updated |
| return { | ||
| lights1_new_param: undefined as (string | undefined), // item-value must be a primitive | ||
| lights2_new_param: undefined as (string | undefined), | ||
| steps_new_value: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we use a default value, like 10 ?
Other than that is just weird to start with 0 steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that should never happen, as we set it to the parameter value both when mounting (if the param is available) or when we detect a parameter change in the watcher. but I did update it anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you configure it for the first time, if the lights are not configured, it starts with 0.
9a792c4 to
889ed64
Compare
|
Can we add a slider for the steps? Could also be nice to have a little graph showing the steps visually (with display options for both linear and Lumen-exponential brightness outputs). It might make sense to have the channel controls in the top row, and then the steps slider + graph in a second row (instead of the current approach with everything in a single row). |
|
There is also another thing, the page end up showing for rover as well, should we remove it ? |
Fancy! |
patrickelectric
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move further required changes to issues.

