Added menu to modal to adjust z height

This commit is contained in:
Chish36 2025-08-13 15:42:32 +01:00
parent 3b5df818d3
commit 0de3f6df66

View file

@ -54,6 +54,51 @@
</div> </div>
<div v-show="stepValue == 2"> <div v-show="stepValue == 2">
<h3>Adjust z height</h3>
<p>
Insert a sample and adjust the z position of
the stage using the buttons below, until the
sample is in focus.
</p>
<p>
You may also adjust the z position with <b>page up</b> and <b>page down</b>.
</p>
<miniStreamDisplay
v-if="stepValue == 2"
class="mini-preview"
></miniStreamDisplay>
<div class="action-button-container">
<action-button
ref="moveZ"
thing="stage"
action="move_relative"
:button-primary="false"
:submit-data="{ x: 0, y: 0, z: -100}"
:submit-label="'-'"
:can-terminate="false"
@finished="
updatePosition();
"
class="action-button"
/>
<action-button
ref="moveZ"
thing="stage"
action="move_relative"
:button-primary="false"
:submit-data="{ x: 0, y: 0, z: 100}"
:submit-label="'+'"
:can-terminate="false"
@finished="
updatePosition();
"
class="action-button"
/>
</div>
</div>
<div v-show="stepValue == 3">
<h3>Camera-stage mapping</h3> <h3>Camera-stage mapping</h3>
<div v-if="isCSMCalibrated"> <div v-if="isCSMCalibrated">
<p> <p>
@ -87,7 +132,7 @@
</ul> </ul>
<miniStreamDisplay <miniStreamDisplay
v-if="stepValue == 2" v-if="stepValue == 3"
class="mini-preview" class="mini-preview"
></miniStreamDisplay> ></miniStreamDisplay>
@ -99,7 +144,7 @@
</div> </div>
</div> </div>
<div v-show="stepValue == 3"> <div v-show="stepValue == 4">
<p> <p>
<b>Calibration complete</b> <b>Calibration complete</b>
</p> </p>
@ -118,7 +163,7 @@
Cancel Cancel
</button> </button>
<button <button
v-show="stepValue == 3" v-show="stepValue == 4"
class="uk-button uk-button-default" class="uk-button uk-button-default"
type="button" type="button"
@click="restart()" @click="restart()"
@ -126,7 +171,7 @@
Restart Restart
</button> </button>
<button <button
v-show="stepValue < 3" v-show="stepValue < 4"
class="uk-button uk-button-primary uk-margin-left" class="uk-button uk-button-primary uk-margin-left"
type="button" type="button"
@click="increment()" @click="increment()"
@ -134,7 +179,7 @@
Next Next
</button> </button>
<button <button
v-show="stepValue == 3" v-show="stepValue == 4"
class="uk-button uk-button-primary uk-margin-left" class="uk-button uk-button-primary uk-margin-left"
type="button" type="button"
@click="hide()" @click="hide()"
@ -150,6 +195,7 @@
import cameraCalibrationSettings from "../tabContentComponents/settingsComponents/cameraSettingsComponents/cameraCalibrationSettings.vue"; import cameraCalibrationSettings from "../tabContentComponents/settingsComponents/cameraSettingsComponents/cameraCalibrationSettings.vue";
import CSMCalibrationSettings from "../tabContentComponents/settingsComponents/CSMSettingsComponents/CSMCalibrationSettings.vue"; import CSMCalibrationSettings from "../tabContentComponents/settingsComponents/CSMSettingsComponents/CSMCalibrationSettings.vue";
import miniStreamDisplay from "../genericComponents/miniStreamDisplay.vue"; import miniStreamDisplay from "../genericComponents/miniStreamDisplay.vue";
import ActionButton from "../labThingsComponents/actionButton.vue";
export default { export default {
name: "CalibrationModal", name: "CalibrationModal",
@ -157,7 +203,8 @@ export default {
components: { components: {
cameraCalibrationSettings, cameraCalibrationSettings,
CSMCalibrationSettings, CSMCalibrationSettings,
miniStreamDisplay miniStreamDisplay,
ActionButton
}, },
data: function() { data: function() {
@ -223,6 +270,11 @@ export default {
this.onHide(); this.onHide();
} }
}, },
async updatePosition() {
this.setPosition = await this.readThingProperty("stage", "position");
},
// Forces modal to show on button press // Forces modal to show on button press
force_show: function() { force_show: function() {
this.ready = true; this.ready = true;
@ -260,7 +312,7 @@ export default {
increment: function() { increment: function() {
// Upper bound on section number // Upper bound on section number
if (this.stepValue < 3) { if (this.stepValue < 4) {
this.stepValue = this.stepValue + 1; this.stepValue = this.stepValue + 1;
return true; return true;
} }
@ -275,4 +327,18 @@ export default {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.action-button-container {
display: flex;
flex-direction: row; /* Stack vertically */
justify-content: center; /* Left align */
gap: 8px; /* Small space between buttons */
margin-top: 4px; /* Gap from image */
}
.action-button {
padding: 6px 12px; /* Smaller button */
font-size: 22px !important;
margin: 0; /* Remove default margin */
width: 120px;
min-width: 80px;
}
</style> </style>