Skip to content

Commit

Permalink
vehicle-setup: disable calibrate button if vehicle has no position av…
Browse files Browse the repository at this point in the history
…ailable

The reasoning here is that without a position, the WMM cannot be used, resulting in a worse calibration.
This does NOT require a gps or dvl, there's a UI for setting a rough position estimate we can rely on.
  • Loading branch information
Williangalvani committed Feb 19, 2025
1 parent 44e4a3d commit 6a2dddf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn v-if="state !== states.CALIBRATING" color="primary" :disabled="!compass_mask" @click="calibrate()">
<v-btn
v-if="state !== states.CALIBRATING"
color="primary"
:disabled="!compass_mask || (!coordinates || !coordinates.lat || !coordinates.lon)"
@click="calibrate()"
>
Calibrate
</v-btn>
<v-btn v-if="state === states.DONE" color="primary" @click="dismiss">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<StatusTextWatcher :style="`display : ${status_type === 'error' ? 'block' : 'none'};`" />
</v-card-text>
<v-card-actions class="justify-center">
<v-btn color="primary" :disabled="calibrating || !compass_mask" @click="calibrate()">
<v-btn color="primary" :disabled="calibrating || !compass_mask || !coordinates" @click="calibrate()">
Calibrate
</v-btn>
<reboot-button />
Expand Down

0 comments on commit 6a2dddf

Please sign in to comment.