Skip to content

Commit 69fd303

Browse files
Williangalvanipatrickelectric
authored andcommitted
frontend: autopilot manager: only show buttons when it makes sense to do so
1 parent ac130ff commit 69fd303

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

core/frontend/src/views/Autopilot.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
Change board
8989
</v-btn>
9090
<v-btn
91-
v-if="settings.is_pirate_mode"
91+
v-if="settings.is_pirate_mode && board_supports_start_stop"
9292
class="ma-1"
9393
:block="$vuetify.breakpoint.xs"
9494
color="secondary"
@@ -98,7 +98,7 @@
9898
Start autopilot
9999
</v-btn>
100100
<v-btn
101-
v-if="settings.is_pirate_mode"
101+
v-if="settings.is_pirate_mode && board_supports_start_stop"
102102
class="ma-1"
103103
:block="$vuetify.breakpoint.xs"
104104
color="secondary"
@@ -108,6 +108,7 @@
108108
Stop autopilot
109109
</v-btn>
110110
<v-btn
111+
v-if="settings.is_pirate_mode && board_supports_restart"
111112
color="primary"
112113
class="ma-1"
113114
:block="$vuetify.breakpoint.xs"
@@ -173,6 +174,13 @@ export default Vue.extend({
173174
}
174175
},
175176
computed: {
177+
board_supports_start_stop(): boolean {
178+
return this.current_board?.name !== 'Manual'
179+
},
180+
board_supports_restart(): boolean {
181+
// this is a mavlink command, all boards should support it
182+
return true
183+
},
176184
autopilot_info(): Record<string, string> {
177185
let version = 'Unknown'
178186
if (this.firmware_info) {

0 commit comments

Comments
 (0)