Camera stage mapping step in wizard says skip until complete.

This commit is contained in:
Julian Stirling 2025-11-04 20:13:46 +00:00
parent e71a25733b
commit e1172248b0
4 changed files with 47 additions and 4 deletions

View file

@ -27,6 +27,7 @@ gets very confusing.
v-if="currentStep"
:key="stepIndex"
v-bind="currentStep.props"
@awaiting-user="handleAwaitingUser"
/>
<p class="uk-text-right">
<button
@ -68,6 +69,7 @@ export default {
data() {
return {
stepIndex: this.startOnLast ? this.steps.length - 1 : 0,
stepAwaitingUser: false,
};
},
@ -79,7 +81,11 @@ export default {
return !this.first || this.stepIndex > 0;
},
nextButtonText() {
return this.final && this.stepIndex === this.steps.length - 1 ? "Finish" : "Next";
const isLastStep = this.final && this.stepIndex === this.steps.length - 1;
if (this.stepAwaitingUser) {
return isLastStep ? "Skip and Finish" : "Skip";
}
return isLastStep ? "Finish" : "Next";
},
},
@ -88,6 +94,7 @@ export default {
* Move to the previous step in this task, or the previous task if first step.
*/
previousStep: function () {
this.stepAwaitingUser = false;
if (this.stepIndex > 0) {
this.stepIndex = this.stepIndex - 1;
} else {
@ -99,6 +106,7 @@ export default {
* Move to the next step in this task, or the next task if final step.
*/
nextStep: function () {
this.stepAwaitingUser = false;
if (this.stepIndex < this.steps.length - 1) {
this.stepIndex = this.stepIndex + 1;
return true;
@ -106,6 +114,9 @@ export default {
this.$emit("next");
}
},
handleAwaitingUser(isAwaiting) {
this.stepAwaitingUser = isAwaiting;
},
},
};
</script>

View file

@ -6,7 +6,10 @@
<p>If it is not in focus, click back and re-focus.</p>
<template #below-stream>
<div class="action-button-container">
<CSMCalibrationSettings :show-extra-settings="false" />
<CSMCalibrationSettings
:show-extra-settings="false"
@recalibrateResponse="checkCalibrationState"
/>
</div>
</template>
</stepTemplateWithStream>
@ -23,6 +26,17 @@ export default {
stepTemplateWithStream,
CSMCalibrationSettings,
},
mounted() {
this.checkCalibrationState();
},
methods: {
async checkCalibrationState() {
const needsCal = await this.readThingProperty("camera_stage_mapping", "calibration_required");
this.$emit("awaiting-user", needsCal);
},
},
};
</script>