Skip to content

Commit

Permalink
frontend: autopilot manager: only show buttons when it makes sense to…
Browse files Browse the repository at this point in the history
… do so
  • Loading branch information
Williangalvani committed Jan 16, 2025
1 parent a41ae5e commit c1c27b0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/frontend/src/views/Autopilot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
Change board
</v-btn>
<v-btn
v-if="settings.is_pirate_mode"
v-if="settings.is_pirate_mode && board_supports_start_stop"
class="ma-1"
:block="$vuetify.breakpoint.xs"
color="secondary"
Expand All @@ -83,7 +83,7 @@
Start autopilot
</v-btn>
<v-btn
v-if="settings.is_pirate_mode"
v-if="settings.is_pirate_mode && board_supports_start_stop"
class="ma-1"
:block="$vuetify.breakpoint.xs"
color="secondary"
Expand All @@ -93,6 +93,7 @@
Stop autopilot
</v-btn>
<v-btn
v-if="settings.is_pirate_mode && board_supports_restart"
color="primary"
class="ma-1"
:block="$vuetify.breakpoint.xs"
Expand Down Expand Up @@ -156,6 +157,13 @@ export default Vue.extend({
}
},
computed: {
board_supports_start_stop(): boolean {
return this.current_board?.name !== 'Unmanaged'
},
board_supports_restart(): boolean {
// this is a mavlink command, all boards should support it
return true
},
autopilot_info(): Record<string, string> {
let version = 'Unknown'
if (this.firmware_info) {
Expand Down

0 comments on commit c1c27b0

Please sign in to comment.