|
83 | 83 | </v-row> |
84 | 84 | </v-stepper-content> |
85 | 85 | <v-stepper-content step="2"> |
| 86 | + <v-alert |
| 87 | + v-if="board_not_detected" |
| 88 | + type="warning" |
| 89 | + class="ma-2" |
| 90 | + dense |
| 91 | + > |
| 92 | + No flight controller detected. |
| 93 | + </v-alert> |
86 | 94 | <div class="d-flex justify-space-between"> |
87 | 95 | <model-viewer |
88 | 96 | v-if="model_viewer_supported && model_viewer_ready" |
@@ -300,6 +308,7 @@ import Vue from 'vue' |
300 | 308 |
|
301 | 309 | import { |
302 | 310 | availableFirmwares, |
| 311 | + fetchCurrentBoard, |
303 | 312 | fetchFirmwareInfo, |
304 | 313 | installFirmwareFromUrl, |
305 | 314 | } from '@/components/autopilot/AutopilotManagerUpdater' |
@@ -386,6 +395,7 @@ export default Vue.extend({ |
386 | 395 | configuration_page_index: 0, |
387 | 396 | model_viewer_supported: MODEL_VIEWER_SUPPORTED, |
388 | 397 | model_viewer_ready: false, |
| 398 | + board_not_detected: false, |
389 | 399 | } |
390 | 400 | }, |
391 | 401 | computed: { |
@@ -526,7 +536,13 @@ export default Vue.extend({ |
526 | 536 | ? ApplyStatus.Done : ApplyStatus.Failed |
527 | 537 | this.retry_count += 1 |
528 | 538 | }, |
529 | | - setupBoat() { |
| 539 | + async setupBoat() { |
| 540 | + await fetchCurrentBoard() |
| 541 | + if (!autopilot.current_board) { |
| 542 | + this.board_not_detected = true |
| 543 | + return |
| 544 | + } |
| 545 | + this.board_not_detected = false |
530 | 546 | this.vehicle_type = Vehicle.Rover |
531 | 547 | this.vehicle_name = 'BlueBoat' |
532 | 548 | this.vehicle_image = '/assets/vehicles/images/bb120.png' |
@@ -586,7 +602,13 @@ export default Vue.extend({ |
586 | 602 | this.finalConfigurations() |
587 | 603 | } |
588 | 604 | }, |
589 | | - setupROV() { |
| 605 | + async setupROV() { |
| 606 | + await fetchCurrentBoard() |
| 607 | + if (!autopilot.current_board) { |
| 608 | + this.board_not_detected = true |
| 609 | + return |
| 610 | + } |
| 611 | + this.board_not_detected = false |
590 | 612 | this.vehicle_type = Vehicle.Sub |
591 | 613 | this.vehicle_name = 'BlueROV' |
592 | 614 | this.vehicle_image = '/assets/vehicles/images/bluerov2.png' |
@@ -661,6 +683,11 @@ export default Vue.extend({ |
661 | 683 | .catch((error) => `Failed to disable smart wifi hotspot: ${error.message ?? error.response?.data}.`) |
662 | 684 | }, |
663 | 685 | async installLatestStableFirmware(vehicle: Vehicle): Promise<ConfigurationStatus> { |
| 686 | + await fetchCurrentBoard() |
| 687 | + if (!autopilot.current_board) { |
| 688 | + return 'No flight controller board detected.' |
| 689 | + } |
| 690 | +
|
664 | 691 | if (this.retry_count) { |
665 | 692 | console.debug('Going to reboot flight controller on retry.') |
666 | 693 | mavlink2rest.sendMessage( |
|
0 commit comments