Cleaned up store and removed unused FoV setting

This commit is contained in:
Joel Collins 2020-11-22 16:52:30 +00:00
parent f187a3a00d
commit a1ae94792e
13 changed files with 42 additions and 119 deletions

View file

@ -242,7 +242,7 @@
</li>
</ul>
<div v-if="scanCapture" class="uk-margin uk-margin-remove-top ">
<div v-if="scanCapture" class="uk-margin uk-margin-remove-top">
<taskSubmitter
:submit-url="scanUri"
:submit-data="scanPayload"
@ -296,9 +296,9 @@ export default {
scanStyle: "Raster",
namingStyle: "Coordinates",
scanStepSize: {
x: 0,
y: 0,
z: 0
x: 800,
y: 640,
z: 50
},
scanSteps: {
x: 3,
@ -326,9 +326,6 @@ export default {
pluginsUri: function() {
return `${this.$store.getters.baseUri}/api/v2/extensions`;
},
settingsFovUri: function() {
return `${this.$store.getters.baseUri}/api/v2/instrument/settings/fov`;
},
basePayload: function() {
var payload = {};
@ -395,7 +392,6 @@ export default {
mounted() {
this.updateScanUri();
this.updateScanStepSize();
// A global signal listener to perform a capture action
this.$root.$on("globalCaptureEvent", () => {
this.handleCapture();
@ -439,21 +435,6 @@ export default {
});
},
updateScanStepSize: function() {
axios
.get(this.settingsFovUri) // Get the microscope FOV
.then(response => {
this.scanStepSize = {
x: parseInt(0.5 * response.data[0]),
y: parseInt(0.5 * response.data[1]),
z: 50
};
})
.catch(error => {
this.modalError(error); // Let mixin handle error
});
},
onScanSubmit: function() {},
onScanResponse: function(responseData) {

View file

@ -29,7 +29,7 @@ export default {
return this.$store.state.globalSettings.appTheme;
},
set(value) {
this.$store.commit("changeSetting", ["appTheme", value]);
this.$store.commit("changeAppTheme", value);
}
}
},

View file

@ -32,7 +32,7 @@ export default {
return this.$store.state.globalSettings.IHIEnabled;
},
set(value) {
this.$store.commit("changeSetting", ["IHIEnabled", value]);
this.$store.commit("changeIHIEnabled", value);
this.$root.$emit("globalSafeTogglePreview", value);
}
}

View file

@ -64,7 +64,7 @@ export default {
return this.$store.state.globalSettings.disableStream;
},
set(value) {
this.$store.commit("changeSetting", ["disableStream", value]);
this.$store.commit("changeDisableStream", value);
}
},
@ -73,7 +73,7 @@ export default {
return this.$store.state.globalSettings.autoGpuPreview;
},
set(value) {
this.$store.commit("changeSetting", ["autoGpuPreview", value]);
this.$store.commit("changeAutoGpuPreview", value);
this.$root.$emit("globalSafeTogglePreview", value);
}
},
@ -83,7 +83,7 @@ export default {
return this.$store.state.globalSettings.trackWindow;
},
set(value) {
this.$store.commit("changeSetting", ["trackWindow", value]);
this.$store.commit("changeTrackWindow", value);
}
}
}

View file

@ -46,7 +46,6 @@ export default {
isVisible: false,
displaySize: [0, 0],
displayPosition: [0, 0],
fov: [0, 0],
resizeTimeoutId: setTimeout(this.doneResizing, 500)
};
},
@ -104,8 +103,6 @@ export default {
console.log(`${this._uid} created`);
// Send a request to start/stop GPU preview based on global setting
this.safePreviewRequest(this.$store.state.globalSettings.autoGpuPreview);
// Get FOV from settings
this.updateFov();
},
beforeDestroy: function() {
@ -136,7 +133,7 @@ export default {
},
clickMonitor: function(event) {
// Calculate steps from event coordinates and store config FOV
// Calculate steps from event coordinates
let xCoordinate = event.offsetX;
let yCoordinate = event.offsetY;
@ -299,21 +296,6 @@ export default {
this.modalError(error); // Let mixin handle error
});
}
},
updateFov: function() {
console.log("Updating FOV");
// Get the current field-of-view setting from the server
axios
.get(`${this.settingsUri}/fov`)
.then(response => {
if (response.data) {
this.fov = response.data;
}
})
.catch(error => {
this.modalError(error); // Let mixin handle error
});
}
}
};