diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/stageSettings.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/stageSettings.vue index 48bb8a72..5a7ed4a1 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/stageSettings.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/stageSettings.vue @@ -4,7 +4,7 @@

Stage settings

@@ -18,7 +18,7 @@ type="submit" class="uk-button uk-button-primary uk-width-1-1" > - Change stage type + Change stage geometry
@@ -70,11 +70,15 @@ export default { setStageType: function() { console.log("Setting stage type"); axios - .put(this.stageTypeUri, this.stageType) + .put(this.stageTypeUri, this.stageType,{ + headers: { + 'Content-Type': 'application/json', + } + }) .then(response => { this.stageType = response.data; console.log("Stage type set to " + this.stageType); - this.modalNotify("Stage type changed."); + this.modalNotify("Stage geometry changed."); }) .catch(error => { this.modalError(error); diff --git a/openflexure_microscope/microscope.py b/openflexure_microscope/microscope.py index 22824815..1cbcf270 100644 --- a/openflexure_microscope/microscope.py +++ b/openflexure_microscope/microscope.py @@ -144,6 +144,9 @@ class Microscope: try: logging.info("Trying SangaStage") self.stage = SangaStage(port=stage_port) + logging.info("Saving new SangaStage type configuration") + configuration["stage"]["type"] = stage_type + self.configuration_file.save(configuration) except Exception as e: # pylint: disable=W0703 logging.error(e) logging.warning("No compatible Sangaboard hardware found.") @@ -151,17 +154,15 @@ class Microscope: try: logging.info("Trying SangaDeltaStage") self.stage = SangaDeltaStage(port=stage_port) - + logging.info("Saving new SangaDeltaStage type configuration") + configuration["stage"]["type"] = stage_type + self.configuration_file.save(configuration) except Exception as e: # pylint: disable=W0703 logging.error(e) logging.warning("No compatible Sangaboard hardware found.") else: logging.warning("The stage type is incorrectly defined.") - logging.info("Saving new stage type configuration") - configuration["stage"]["type"] = stage_type - self.configuration_file.save(configuration) - def has_real_stage(self) -> bool: """ Check if a real (non-mock) stage is currently attached.