@@ -273,8 +273,41 @@ import axios from "axios";
import tagList from "../../fieldComponents/tagList";
import keyvalList from "../../fieldComponents/keyvalList";
-
import taskSubmitter from "../../genericComponents/taskSubmitter";
+import { syncDataWithLocalStorage } from "../../../syncDataWithLocalStorage";
+
+/**
+ * The capture settings that should persist in local storage are these ones
+ */
+function defaultCaptureSettings() {
+ return {
+ filename: "",
+ temporary: false,
+ fullResolution: false,
+ storeBayer: false,
+ resizeCapture: false,
+ captureNotes: "",
+ scanDeltaZ: "Fast",
+ scanStyle: "Raster",
+ namingStyle: "Coordinates",
+ scanStepSize: {
+ x: 800,
+ y: 640,
+ z: 50
+ },
+ scanSteps: {
+ x: 3,
+ y: 3,
+ z: 5
+ },
+ resizeDims: [640, 480],
+ tags: [],
+ annotations: {
+ Client: "openflexure-microscope-jsclient:builtin"
+ },
+ scanUri: null
+ };
+}
// Export main app
export default {
@@ -288,32 +321,8 @@ export default {
data: function() {
return {
- filename: "",
- temporary: false,
- fullResolution: false,
- storeBayer: false,
- resizeCapture: false,
- captureNotes: "",
- scanCapture: false,
- scanDeltaZ: "Fast",
- scanStyle: "Raster",
- namingStyle: "Coordinates",
- scanStepSize: {
- x: 800,
- y: 640,
- z: 50
- },
- scanSteps: {
- x: 3,
- y: 3,
- z: 5
- },
- resizeDims: [640, 480],
- tags: [],
- annotations: {
- Client: "openflexure-microscope-jsclient:builtin"
- },
- scanUri: null
+ ...defaultCaptureSettings(),
+ scanCapture: false // Don't remember the "scan" tickbox in local storage.
};
},
@@ -393,6 +402,9 @@ export default {
mounted() {
this.updateScanUri();
+ // Load settings if they have been saved, and set up watchers to sync with local storage
+ syncDataWithLocalStorage("captureSettings", this, defaultCaptureSettings());
+
// A global signal listener to perform a capture action
this.$root.$on("globalCaptureEvent", () => {
this.handleCapture();
diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/captureContent.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/captureContent.vue
index a1758f9b..cd057af8 100644
--- a/openflexure_microscope/api/static/src/components/tabContentComponents/captureContent.vue
+++ b/openflexure_microscope/api/static/src/components/tabContentComponents/captureContent.vue
@@ -15,7 +15,7 @@ import paneCapture from "./captureComponents/paneCapture";
import streamDisplay from "./streamContent.vue";
export default {
- name: "NavigateContent",
+ name: "CaptureContent",
components: {
paneCapture,
diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/cameraSettings.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/cameraSettings.vue
index 67c1fdda..d161049a 100644
--- a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/cameraSettings.vue
+++ b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/cameraSettings.vue
@@ -3,7 +3,7 @@