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

@ -11,6 +11,7 @@
:modal-progress="actionData.modal_progress"
@response="actionResponse"
@error="modalError"
@finished="actionFinished"
/>
</template>
@ -33,11 +34,27 @@ export default {
},
methods: {
actionResponse: function () {
/**
* Runs when the ActionButton's action completes successfully.
*
* It is used to send success notifications. It also forwards the response to the
* parent.
*/
actionResponse: function (response) {
if (this.actionData.notify_on_success) {
this.modalNotify(this.actionData.success_message);
this.$emit("response", response);
}
},
/**
* Runs when the ActionButton's action finishes in any way (error, cancel,
* completion).
*
* This forwards the event to the parent
*/
actionFinished: function () {
this.$emit("finished");
},
},
};
</script>

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>

View file

@ -124,9 +124,10 @@ export default {
];
}
},
onRecalibrateResponse: function () {
onRecalibrateResponse: function (response) {
this.modalNotify("Finished stage-to-camera calibration.");
this.updateDisplayedCSM();
this.$emit("recalibrateResponse", response);
},
},
};