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" :modal-progress="actionData.modal_progress"
@response="actionResponse" @response="actionResponse"
@error="modalError" @error="modalError"
@finished="actionFinished"
/> />
</template> </template>
@ -33,11 +34,27 @@ export default {
}, },
methods: { 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) { if (this.actionData.notify_on_success) {
this.modalNotify(this.actionData.success_message); 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> </script>

View file

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

View file

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

View file

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