Added gain/exposure controls

Also refactored settings pane slightly.
This commit is contained in:
Richard Bowman 2019-04-08 22:44:51 +01:00
parent 5e40af1b2f
commit e6649e41d8
3 changed files with 148 additions and 43 deletions

View file

@ -1,14 +1,6 @@
<template>
<div id="microscopeSettings">
<form @submit.prevent="applyConfigRequest">
<h4>Camera</h4>
<div class="uk-text-center uk-container" v-if="isCalibrating">
<div class="center-spinner" uk-spinner></div>
</div>
<div v-else>
<button type="button" v-on:click="recalibrateConfirm()" class="uk-button uk-button-default uk-form-small uk-float-right uk-margin-small uk-width-1-1">Auto-Calibrate</button>
</div>
<h4>Stage</h4>
<label class="uk-form-label" for="form-stacked-text">Backlash compensation</label>
@ -61,8 +53,7 @@ export default {
data: function () {
return {
microscopeName: this.$store.state.apiConfig.name,
stageBacklash: this.$store.state.apiConfig.backlash,
isCalibrating: false
stageBacklash: this.$store.state.apiConfig.backlash
}
},
@ -72,35 +63,6 @@ export default {
this.stageBacklash = this.$store.state.apiConfig.backlash
},
recalibrateConfirm: function() {
var context = this
this.modalConfirm('Start recalibration? This may take a while, and the microscope will be locked during this time.')
.then(function() {
context.recalibrateRequest()
}, function () {
console.log('Rejected recalibration.')
})
},
recalibrateRequest: function() {
// Send move request
axios.post(this.recalibrateApiUri)
.then(response => {
console.log("Task ID: " + response.data[0].id)
this.isCalibrating = true
return this.$store.dispatch('pollTask', [response.data[0].id, null, null])
})
.then(() => {
UIkit.notification({message: "Finished recalibration.", status: 'success'})
})
.catch(error => {
this.$store.dispatch('handleHTTPError', error); // Let store handle error
})
.finally(() => {
this.isCalibrating = false
})
},
applyConfigRequest: function() {
var payload = {}
@ -112,7 +74,7 @@ export default {
payload.backlash = this.stageBacklash
}
// Send move request
// Send request to update config
axios.post(this.configApiUri, payload)
.then(response => {
this.$store.dispatch('updateConfig');
@ -127,9 +89,6 @@ export default {
},
computed: {
recalibrateApiUri: function () {
return this.$store.getters.uri + "/plugin/default/camera_calibration/recalibrate"
},
configApiUri: function () {
return this.$store.getters.uri + "/config"
}