added a button to flatten the lens shading table
This commit is contained in:
parent
0fc1936379
commit
4b7d6eded6
1 changed files with 21 additions and 6 deletions
|
|
@ -53,20 +53,29 @@
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!--Show auto calibrate if default plugin is enabled-->
|
<!--Show auto calibrate if default plugin is enabled-->
|
||||||
<div v-if="recalibrationUri">
|
<div v-if="'recalibrate' in recalibrationLinks" class="uk-margin-small">
|
||||||
<taskSubmitter
|
<taskSubmitter
|
||||||
:can-terminate="false"
|
:can-terminate="false"
|
||||||
:requires-confirmation="true"
|
:requires-confirmation="true"
|
||||||
:confirmation-message="
|
:confirmation-message="
|
||||||
'Start recalibration? This may take a while, and the microscope will be locked during this time.'
|
'Start recalibration? This may take a while, and the microscope will be locked during this time.'
|
||||||
"
|
"
|
||||||
:submit-url="recalibrationUri"
|
:submit-url="recalibrationLinks.recalibrate.href"
|
||||||
:submit-label="'Auto-Calibrate'"
|
:submit-label="'Auto-Calibrate'"
|
||||||
@response="onRecalibrateResponse"
|
@response="onRecalibrateResponse"
|
||||||
@error="onRecalibrateError"
|
@error="onRecalibrateError"
|
||||||
>
|
>
|
||||||
</taskSubmitter>
|
</taskSubmitter>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="'flatten_lens_shading_table' in recalibrationLinks" class="uk-margin-small">
|
||||||
|
<button
|
||||||
|
class="uk-button uk-button-danger uk-form-small uk-float-right uk-margin-small uk-width-1-1"
|
||||||
|
@click="flattenLensShadingTableRequest"
|
||||||
|
>
|
||||||
|
Disable flat-field correction
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -86,7 +95,7 @@ export default {
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
settings: null,
|
settings: null,
|
||||||
recalibrationUri: null,
|
recalibrationLinks: null,
|
||||||
isCalibrating: false
|
isCalibrating: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -102,7 +111,7 @@ export default {
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.updateSettings();
|
this.updateSettings();
|
||||||
this.updateRecalibrationUri();
|
this.updateRecalibrationLinks();
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -117,7 +126,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
updateRecalibrationUri: function() {
|
updateRecalibrationLinks: function() {
|
||||||
axios
|
axios
|
||||||
.get(this.pluginsUri) // Get a list of plugins
|
.get(this.pluginsUri) // Get a list of plugins
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|
@ -128,7 +137,9 @@ export default {
|
||||||
// if AutocalibrationPlugin is enabled
|
// if AutocalibrationPlugin is enabled
|
||||||
if (foundExtension) {
|
if (foundExtension) {
|
||||||
// Get plugin action link
|
// Get plugin action link
|
||||||
this.recalibrationUri = foundExtension.links.recalibrate.href;
|
this.recalibrationLinks = foundExtension.links;
|
||||||
|
} else {
|
||||||
|
this.recalibrationLinks = {}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
@ -172,6 +183,10 @@ export default {
|
||||||
|
|
||||||
onRecalibrateError: function(error) {
|
onRecalibrateError: function(error) {
|
||||||
this.modalError(error); // Let mixin handle error
|
this.modalError(error); // Let mixin handle error
|
||||||
|
},
|
||||||
|
|
||||||
|
flattenLensShadingTableRequest: function() {
|
||||||
|
axios.post(this.recalibrationLinks.flatten_lens_shading_table.href)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue