Add images to calibration step

This commit is contained in:
Joe Knapper 2026-07-02 12:35:46 +01:00 committed by Julian Stirling
parent 2b03879bcf
commit 11f2482ab1
4 changed files with 67 additions and 23 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -126,7 +126,7 @@ export default {
if (this.thingAvailable("stage") && this.thingDescription("stage").title != "DummyStage") { if (this.thingAvailable("stage") && this.thingDescription("stage").title != "DummyStage") {
tasks.push({ tasks.push({
component: markRaw(singleStepTask), component: markRaw(singleStepTask),
props: { stepComponent: zMotorDirectionStep }, props: { title: "Stage Calibration", stepComponent: zMotorDirectionStep },
}); });
} }

View file

@ -1,9 +1,8 @@
<template> <template>
<div> <div>
<p>First, let's check your stage's z motor direction.</p>
<p> <p>
Looking at the exposed z gear from above, which way does it turn when you press and hold the Looking at the exposed z gear from above, which way does it turn when you press and hold the
button below? <b>Turn z motor</b> button below?
</p> </p>
<div class="uk-margin uk-flex uk-flex-center"> <div class="uk-margin uk-flex uk-flex-center">
<button <button
@ -13,25 +12,47 @@
@pointerup="jogZStop" @pointerup="jogZStop"
@pointercancel="jogZStop" @pointercancel="jogZStop"
> >
<span class="material-symbols-outlined sync-icon"> add </span> <span>Turn z motor</span>
</button> </button>
</div> </div>
<!-- Direction selection -->
<div class="uk-margin uk-flex"> <div class="uk-margin uk-flex">
<button <!-- Anti-clockwise column -->
class="uk-button uk-button-default uk-width-1-2 uk-button-primary" <div class="uk-width-1-2 dir-option">
type="button" <img
@click="selectDir" src="/direction_AC.png"
> alt="Anti-clockwise"
Anti-clockwise class="dir-image clickable"
</button> @click="selectDir"
<action-button />
class="uk-width-1-2"
thing="stage" <button
action="invert_axis_direction" class="uk-button uk-button-default uk-width-1-1 uk-button-primary"
:submit-data="{ axis: 'z' }" type="button"
submit-label="Clockwise" @click="selectDir"
@response="selectDir" >
/> Anti-clockwise
</button>
</div>
<!-- Clockwise column -->
<div class="uk-width-1-2 dir-option">
<img
src="/direction_CW.png"
alt="Clockwise"
class="dir-image clickable"
@click="triggerClockwise"
/>
<button
class="uk-button uk-button-default uk-width-1-1 uk-button-primary"
type="button"
@click="triggerClockwise"
>
Clockwise
</button>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -42,10 +63,6 @@ import ActionButton from "../../labThingsComponents/actionButton.vue";
export default { export default {
name: "ZMotorDirectionStep", name: "ZMotorDirectionStep",
components: {
ActionButton,
},
emits: ["advance", "awaiting-user"], emits: ["advance", "awaiting-user"],
data: function () { data: function () {
@ -84,6 +101,12 @@ export default {
selectDir() { selectDir() {
this.$emit("advance"); this.$emit("advance");
}, },
// If motor moves clockwise, invert z direction, then progress to next step
triggerClockwise() {
this.invokeAction("stage", "invert_axis_direction", { axis: "z" }).then(() => {
this.selectDir();
});
},
}, },
}; };
</script> </script>
@ -95,4 +118,25 @@ export default {
padding: 0 30px; padding: 0 30px;
gap: 4px; gap: 4px;
} }
.dir-option {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
margin: 5px;
}
.dir-image {
width: 70%;
height: auto;
}
.clickable {
cursor: pointer;
}
.dir-option button {
text-align: center;
}
</style> </style>