Camera calibration buttons specified by server. Simulation has option to remove sample

This commit is contained in:
Julian Stirling 2025-07-27 15:07:35 +01:00
parent 1e89ef0ff7
commit 0794d4777f
5 changed files with 175 additions and 79 deletions

View file

@ -1,87 +1,38 @@
<template>
<div>
<!--Show auto calibrate if default plugin is enabled-->
<div v-if="'full_auto_calibrate' in actions" class="uk-margin-small">
<action-button
:can-terminate="false"
:requires-confirmation="true"
:confirmation-message="
'Start recalibration? This may take a while, and the microscope will be locked during this time.'
"
thing="camera"
action="full_auto_calibrate"
:submit-label="'Full Auto-Calibrate'"
@response="onRecalibrateResponse"
@error="modalError"
/>
</div>
<div v-if="'auto_expose_from_minimum' in actions" class="uk-margin-small">
<action-button
:can-terminate="false"
:requires-confirmation="false"
thing="camera"
action="auto_expose_from_minimum"
:submit-label="'Auto Gain &amp; Shutter Speed'"
@response="onRecalibrateResponse"
@error="modalError"
/>
</div>
<div v-if="'calibrate_white_balance' in actions" class="uk-margin-small">
<action-button
:can-terminate="false"
:requires-confirmation="false"
thing="camera"
action="calibrate_white_balance"
:submit-label="'Auto White Balance'"
@response="onRecalibrateResponse"
@error="modalError"
/>
</div>
<div v-if="'calibrate_lens_shading' in actions" class="uk-margin-small">
<action-button
:can-terminate="false"
:requires-confirmation="true"
:confirmation-message="
'Is the microscope looking at an evenly illuminated, empty field of view? ' +
'If not, the current image will show through in any images captured afterwards.'
"
thing="camera"
action="calibrate_lens_shading"
:submit-label="'Auto Flat Field Correction'"
@response="onRecalibrateResponse"
@error="modalError"
/>
</div>
<div
v-show="showExtraSettings"
v-if="'flatten_lens_shading_table' in actions"
<div
v-for="(action, index) in secondaryCalibrationActions"
class="uk-child-width-expand"
:key = "'primary_cal' + index"
>
<action-button
:can-terminate="false"
:requires-confirmation="false"
thing="camera"
action="flat_lens_shading"
:submit-label="'Disable Flat Field Correction'"
:can-terminate="action.can_terminate"
:requires-confirmation="action.requires_confirmation"
:thing="action.thing"
:action="action.action"
:submit-label="action.submit_label"
@response="onRecalibrateResponse"
@error="modalError"
/>
</div>
<div
v-show="showExtraSettings"
v-if="'reset_lens_shading' in actions"
class="uk-child-width-expand"
>
<action-button
:can-terminate="false"
:requires-confirmation="false"
thing="camera"
action="reset_lens_shading"
:submit-label="'Reset Flat Field Correction'"
@response="onRecalibrateResponse"
@error="modalError"
/>
<div v-if="showExtraSettings">
<div
v-for="(action, index) in primaryCalibrationActions"
class="uk-child-width-expand"
:key = "'secondary_cal' + index"
>
<action-button
:can-terminate="action.can_terminate"
:requires-confirmation="action.requires_confirmation"
:thing="action.thing"
:action="action.action"
:submit-label="action.submit_label"
@response="onRecalibrateResponse"
@error="modalError"
/>
</div>
</div>
</div>
</template>
@ -97,6 +48,13 @@ export default {
ActionButton
},
data() {
return {
primaryCalibrationActions: [],
secondaryCalibrationActions: []
};
},
props: {
showExtraSettings: {
type: Boolean,
@ -115,6 +73,11 @@ export default {
}
},
async created() {
this.primaryCalibrationActions = await this.readThingProperty("camera", "primary_calibration_actions");
this.secondaryCalibrationActions = await this.readThingProperty("camera", "secondary_calibration_actions");
},
methods: {
onRecalibrateResponse: function() {
this.modalNotify("Finished recalibration.");