Added a pane for camera/stage calibration
This commit is contained in:
parent
4784257eb1
commit
2ba9c9493b
3 changed files with 119 additions and 1 deletions
|
|
@ -13,6 +13,11 @@
|
||||||
<div class="uk-accordion-content"><cameraSettings /></div>
|
<div class="uk-accordion-content"><cameraSettings /></div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li v-if="$store.getters.ready">
|
||||||
|
<a class="uk-accordion-title" href="#">Camera/stage mapping settings</a>
|
||||||
|
<div class="uk-accordion-content"><cameraStageMappingSettings /></div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li v-if="$store.getters.ready">
|
<li v-if="$store.getters.ready">
|
||||||
<a class="uk-accordion-title" href="#">Microscope settings</a>
|
<a class="uk-accordion-title" href="#">Microscope settings</a>
|
||||||
<div class="uk-accordion-content"><microscopeSettings /></div>
|
<div class="uk-accordion-content"><microscopeSettings /></div>
|
||||||
|
|
@ -25,6 +30,7 @@
|
||||||
import streamSettings from "./settingsComponents/streamSettings.vue";
|
import streamSettings from "./settingsComponents/streamSettings.vue";
|
||||||
import microscopeSettings from "./settingsComponents/microscopeSettings.vue";
|
import microscopeSettings from "./settingsComponents/microscopeSettings.vue";
|
||||||
import cameraSettings from "./settingsComponents/cameraSettings.vue";
|
import cameraSettings from "./settingsComponents/cameraSettings.vue";
|
||||||
|
import cameraStageMappingSettings from "./settingsComponents/cameraStageMappingSettings.vue";
|
||||||
import appSettings from "./settingsComponents/appSettings.vue";
|
import appSettings from "./settingsComponents/appSettings.vue";
|
||||||
|
|
||||||
// Export main app
|
// Export main app
|
||||||
|
|
@ -34,6 +40,7 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
streamSettings,
|
streamSettings,
|
||||||
cameraSettings,
|
cameraSettings,
|
||||||
|
cameraStageMappingSettings,
|
||||||
microscopeSettings,
|
microscopeSettings,
|
||||||
appSettings
|
appSettings
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ export default {
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
settings: null,
|
settings: null,
|
||||||
recalibrationLinks: null,
|
recalibrationLinks: {},
|
||||||
isCalibrating: false
|
isCalibrating: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
<template>
|
||||||
|
<div id="cameraStageMappingSettings">
|
||||||
|
<form @submit.prevent="applyConfigRequest">
|
||||||
|
|
||||||
|
|
||||||
|
<!--Show auto calibrate if default plugin is enabled-->
|
||||||
|
<div v-if="'calibrate_xy' in recalibrationLinks" class="uk-margin-small">
|
||||||
|
<taskSubmitter
|
||||||
|
:can-terminate="false"
|
||||||
|
:requires-confirmation="true"
|
||||||
|
:confirmation-message="
|
||||||
|
'Start recalibration of the stage to the camera? This may take a while, and the microscope will be locked during this time.'
|
||||||
|
"
|
||||||
|
:submit-url="recalibrationLinks.calibrate_xy.href"
|
||||||
|
:submit-label="'Auto-Calibrate using camera'"
|
||||||
|
@response="onRecalibrateResponse"
|
||||||
|
@error="onRecalibrateError"
|
||||||
|
>
|
||||||
|
</taskSubmitter>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from "axios";
|
||||||
|
import taskSubmitter from "../../genericComponents/taskSubmitter";
|
||||||
|
|
||||||
|
// Export main app
|
||||||
|
export default {
|
||||||
|
name: "CameraStageMappingSettings",
|
||||||
|
|
||||||
|
components: {
|
||||||
|
taskSubmitter
|
||||||
|
},
|
||||||
|
|
||||||
|
data: function() {
|
||||||
|
return {
|
||||||
|
settings: null,
|
||||||
|
recalibrationLinks: {},
|
||||||
|
isCalibrating: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
settingsUri: function() {
|
||||||
|
return `${this.$store.getters.baseUri}/api/v2/instrument/settings`;
|
||||||
|
},
|
||||||
|
pluginsUri: function() {
|
||||||
|
return `${this.$store.getters.baseUri}/api/v2/extensions`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.updateSettings();
|
||||||
|
this.updateRecalibrationLinks();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
updateSettings: function() {
|
||||||
|
axios
|
||||||
|
.get(this.settingsUri)
|
||||||
|
.then(response => {
|
||||||
|
this.settings = response.data.extensions['org.openflexure.camera_stage_mapping'];
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.modalError(error); // Let mixin handle error
|
||||||
|
this.settings = {};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
updateRecalibrationLinks: function() {
|
||||||
|
axios
|
||||||
|
.get(this.pluginsUri) // Get a list of plugins
|
||||||
|
.then(response => {
|
||||||
|
var plugins = response.data;
|
||||||
|
var foundExtension = plugins.find(
|
||||||
|
e => e.title === "org.openflexure.camera_stage_mapping"
|
||||||
|
);
|
||||||
|
// if camera-stage mapping extension is enabled
|
||||||
|
if (foundExtension) {
|
||||||
|
// Get plugin action link
|
||||||
|
this.recalibrationLinks = foundExtension.links;
|
||||||
|
} else {
|
||||||
|
this.recalibrationLinks = {}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.modalError(error); // Let mixin handle error
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onRecalibrateResponse: function() {
|
||||||
|
this.modalNotify("Finished stage-to-camera calibration.");
|
||||||
|
// Update local settings
|
||||||
|
this.updateSettings();
|
||||||
|
},
|
||||||
|
|
||||||
|
onRecalibrateError: function(error) {
|
||||||
|
this.modalError(error); // Let mixin handle error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.center-spinner {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue