Skip to content

Commit

Permalink
vehicle-setup: allow going back to IDLE state after a failed compass …
Browse files Browse the repository at this point in the history
…calibration
  • Loading branch information
Williangalvani committed Feb 19, 2025
1 parent 44e4a3d commit 9aa100b
Showing 1 changed file with 15 additions and 1 deletion.
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 && state !== states.FAILED"
color="primary"
:disabled="!compass_mask"
@click="calibrate()"
>
Calibrate
</v-btn>
<v-btn v-if="state === states.DONE" color="primary" @click="dismiss">
Expand All @@ -88,6 +93,10 @@
<v-btn v-if="state == states.CALIBRATING" color="red" @click="cancelCalibration()">
Cancel
</v-btn>
<v-btn v-if="state == states.FAILED" color="primary" @click="reset()">
Ok
</v-btn>
<v-spacer />
</v-card-actions>
</v-card>
</v-dialog>
Expand Down Expand Up @@ -171,6 +180,11 @@ export default {
this.progress_listener?.discard()
},
methods: {
reset() {
this.state = states.IDLE
this.cleanup()
this.fitness = {}
},
dismiss() {
this.state = states.IDLE
this.dialog = false
Expand Down

0 comments on commit 9aa100b

Please sign in to comment.