File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed
components/vehiclesetup/overview Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 50
50
Armed
51
51
</v-card-title >
52
52
</v-card >
53
+ <v-card
54
+ v-if =" uncalibrated_sensors"
55
+ v-tooltip =" 'One or more sensors are not calibrated'"
56
+ class =" d-flex align-center warning justify-center mr-5"
57
+ height =" 40"
58
+ >
59
+ <v-icon class =" ml-3" >
60
+ mdi-alert-outline
61
+ </v-icon >
62
+ <v-card-title >
63
+ Uncalibrated sensors
64
+ </v-card-title >
65
+ </v-card >
53
66
<draggable v-model =" selected_widgets" class =" d-flex align-center justify-center" >
54
67
<component
55
68
:is =" getWidget(widget_name).component"
@@ -531,6 +544,9 @@ export default Vue.extend({
531
544
safe_mode(): boolean {
532
545
return autopilot_data .is_safe
533
546
},
547
+ uncalibrated_sensors(): boolean {
548
+ return autopilot_data .uncalibrated_sensors
549
+ },
534
550
wifi_connected(): boolean {
535
551
return wifi .current_network != null
536
552
},
Original file line number Diff line number Diff line change @@ -293,13 +293,40 @@ export default Vue.extend({
293
293
return results
294
294
},
295
295
},
296
+ watch: {
297
+ imu_is_calibrated: {
298
+ handler() {
299
+ this .updateUncalibratedSensorsStatus ()
300
+ },
301
+ deep: true ,
302
+ immediate: true ,
303
+ },
304
+ compass_is_calibrated: {
305
+ handler() {
306
+ this .updateUncalibratedSensorsStatus ()
307
+ },
308
+ deep: true ,
309
+ immediate: true ,
310
+ },
311
+ },
296
312
mounted() {
297
313
mavlink .setMessageRefreshRate ({ messageName: ' SCALED_PRESSURE$' , refreshRate: 1 })
298
314
mavlink .setMessageRefreshRate ({ messageName: ' SCALED_PRESSURE2$' , refreshRate: 1 })
299
315
mavlink .setMessageRefreshRate ({ messageName: ' SCALED_PRESSURE3$' , refreshRate: 1 })
300
316
mavlink .setMessageRefreshRate ({ messageName: ' VFR_HUD' , refreshRate: 1 })
317
+
318
+ this .updateUncalibratedSensorsStatus ()
301
319
},
302
320
methods: {
321
+ updateUncalibratedSensorsStatus() {
322
+ const imuUncalibrated = this .imu_is_calibrated &&
323
+ Object .values (this .imu_is_calibrated ).some ((calibrated ) => ! calibrated )
324
+
325
+ const compassUncalibrated = this .compass_is_calibrated &&
326
+ Object .values (this .compass_is_calibrated ).some ((calibrated ) => ! calibrated )
327
+
328
+ autopilot_data .setUncalibratedSensors (imuUncalibrated || compassUncalibrated )
329
+ },
303
330
print_bus(bus : BUS_TYPE ): string {
304
331
return BUS_TYPE [bus ]
305
332
},
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ class AutopilotStore extends VuexModule {
38
38
39
39
verhicle_armed = false
40
40
41
+ uncalibrated_sensors = false
42
+
41
43
get parameter ( ) {
42
44
return ( name : string ) : Parameter | undefined => this . parameters . find ( ( parameter ) => parameter . name === name )
43
45
}
@@ -112,6 +114,11 @@ class AutopilotStore extends VuexModule {
112
114
setVehicleArmed ( armed : boolean ) : void {
113
115
this . verhicle_armed = armed
114
116
}
117
+
118
+ @Mutation
119
+ setUncalibratedSensors ( uncalibrated : boolean ) : void {
120
+ this . uncalibrated_sensors = uncalibrated
121
+ }
115
122
}
116
123
117
124
export { AutopilotStore }
You can’t perform that action at this time.
0 commit comments