Use calibration_required property to conditionally render z cal step
This commit is contained in:
parent
5875abbceb
commit
f68515b17d
5 changed files with 50 additions and 12 deletions
|
|
@ -28,7 +28,7 @@
|
|||
<script>
|
||||
import singleStepTask from "./calibrationWizardComponents/singleStepTask.vue";
|
||||
import welcomeStep from "./calibrationWizardComponents/welcomeStep.vue";
|
||||
import zMotorDirectionStep from "./calibrationWizardComponents/zMotorDirectionStep.vue";
|
||||
import zMotorCalibrationTask from "./calibrationWizardComponents/zMotorCalibrationTask.vue";
|
||||
import cameraCalibrationTask from "./calibrationWizardComponents/cameraCalibrationTask.vue";
|
||||
import cameraStageMappingTask from "./calibrationWizardComponents/cameraStageMappingTask.vue";
|
||||
import finalStep from "./calibrationWizardComponents/finalStep.vue";
|
||||
|
|
@ -69,6 +69,7 @@ export default {
|
|||
this.$refs["calibrationModalEl"].addEventListener("hidden", this.onHide);
|
||||
// Check which Things are available on mount.
|
||||
const allCalibrationTasks = {
|
||||
stage: markRaw(zMotorCalibrationTask),
|
||||
camera: markRaw(cameraCalibrationTask),
|
||||
camera_stage_mapping: markRaw(cameraStageMappingTask),
|
||||
};
|
||||
|
|
@ -121,15 +122,6 @@ export default {
|
|||
});
|
||||
}
|
||||
|
||||
// Ask which way the z motor turns, right after the welcome screen but before any
|
||||
// other tasks, so the stage is correctly oriented before anything else runs.
|
||||
if (this.thingAvailable("stage") && this.thingDescription("stage").title != "DummyStage") {
|
||||
tasks.push({
|
||||
component: markRaw(singleStepTask),
|
||||
props: { title: "Stage Calibration", stepComponent: zMotorDirectionStep },
|
||||
});
|
||||
}
|
||||
|
||||
// Add calibration task for each thing
|
||||
for (const thing of thingsToCal) {
|
||||
const taskComponent = this.availableCalibrationTasks[thing];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
<template>
|
||||
<singleStepTask
|
||||
title="Stage Calibration"
|
||||
:step-component="zMotorDirectionStep"
|
||||
@next="$emit('next')"
|
||||
@back="$emit('back')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import singleStepTask from "./singleStepTask.vue";
|
||||
import zMotorDirectionStep from "./zMotorDirectionStep.vue";
|
||||
|
||||
export default {
|
||||
name: "ZMotorCalibrationTask",
|
||||
|
||||
components: {
|
||||
singleStepTask,
|
||||
},
|
||||
|
||||
emits: ["next", "back"],
|
||||
|
||||
data() {
|
||||
return {
|
||||
zMotorDirectionStep,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -69,7 +69,7 @@ export default {
|
|||
},
|
||||
|
||||
mounted() {
|
||||
this.$emit("awaiting-user", true);
|
||||
this.checkCalibrationState();
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
@ -94,7 +94,9 @@ export default {
|
|||
},
|
||||
// Once a direction is selected, advance
|
||||
selectDir() {
|
||||
this.$emit("advance");
|
||||
this.invokeAction("stage", "mark_calibration_complete").then(() => {
|
||||
this.$emit("advance");
|
||||
});
|
||||
},
|
||||
// If motor moves clockwise, invert z direction, then progress to next step
|
||||
triggerClockwise() {
|
||||
|
|
@ -102,6 +104,10 @@ export default {
|
|||
this.selectDir();
|
||||
});
|
||||
},
|
||||
async checkCalibrationState() {
|
||||
const needsCal = await this.readThingProperty("stage", "calibration_required");
|
||||
this.$emit("awaiting-user", needsCal);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue