From 2e34722d6e620a91e842a95cb75e4d874252bdd3 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 23 Nov 2020 13:08:44 +0000 Subject: [PATCH] Removed old console logs --- openflexure_microscope/api/static/src/App.vue | 6 +---- .../api/static/src/components/appContent.vue | 5 ---- .../components/fieldComponents/keyvalList.vue | 5 ---- .../genericComponents/taskSubmitter.vue | 23 ++++++------------- .../modalComponents/calibrationModal.vue | 1 - .../components/pluginComponents/JsonForm.vue | 11 ++------- .../aboutComponents/statusPane.vue | 10 ++++---- .../captureComponents/paneCapture.vue | 5 +--- .../galleryComponents/captureCard.vue | 2 -- .../galleryComponents/zipDownloader.vue | 17 +++----------- .../tabContentComponents/galleryContent.vue | 3 --- .../tabContentComponents/loggingContent.vue | 1 - .../navigateComponents/paneNavigate.vue | 2 -- .../settingsComponents/CSMSettings.vue | 2 -- .../CSMCalibrationSettings.vue | 2 -- .../settingsComponents/appSettings.vue | 1 - .../settingsComponents/cameraSettings.vue | 1 - .../settingsComponents/featuresSettings.vue | 1 - .../settingsComponents/microscopeSettings.vue | 2 -- .../settingsComponents/stageSettings.vue | 5 +--- .../slideScanComponents/paneSlideScan.vue | 1 - .../tabContentComponents/streamContent.vue | 11 ++------- openflexure_microscope/api/static/src/main.js | 7 ------ 23 files changed, 21 insertions(+), 103 deletions(-) diff --git a/openflexure_microscope/api/static/src/App.vue b/openflexure_microscope/api/static/src/App.vue index ef216d09..26165824 100644 --- a/openflexure_microscope/api/static/src/App.vue +++ b/openflexure_microscope/api/static/src/App.vue @@ -199,15 +199,13 @@ export default { (state, getters) => { return getters.uriV2; }, - uriV2 => { + () => { this.checkConnection(); - console.log(uriV2); } ); // Keyboard shortcuts Mousetrap.bind("?", () => { - console.log(this.keyboardManual); this.toggleModalElement(this.$refs["keyboardManualModal"]); // Calls the mixin }); @@ -290,7 +288,6 @@ export default { // Remove origin watcher this.unwatchOriginFunction(); // Remove key listeners - console.log("Resetting Mousetrap"); Mousetrap.reset(); }, @@ -313,7 +310,6 @@ export default { }, handleExit: function() { - console.log("Triggered beforeunload"); this.$root.$emit("globalTogglePreview", false); }, diff --git a/openflexure_microscope/api/static/src/components/appContent.vue b/openflexure_microscope/api/static/src/components/appContent.vue index 27e72e0a..cd084c63 100644 --- a/openflexure_microscope/api/static/src/components/appContent.vue +++ b/openflexure_microscope/api/static/src/components/appContent.vue @@ -230,7 +230,6 @@ export default { pluginsGuiList: function() { // List of plugin GUIs, obtained from this.plugins values - console.log("Recalculating plugins"); var pluginGuis = []; for (let plugin of Object.values(this.plugins)) { if (plugin.meta.gui) { @@ -304,11 +303,9 @@ export default { methods: { updatePlugins: function() { - console.log("Updating plugin forms"); return axios .get(this.pluginsUri) .then(response => { - console.log(response); this.plugins = response.data; }) .catch(error => { @@ -333,8 +330,6 @@ export default { }, enterApp: function() { // Stuff to do once connected and all init modals are finished - console.log("Entering main application"); - //this.currentTab = "view"; } } }; diff --git a/openflexure_microscope/api/static/src/components/fieldComponents/keyvalList.vue b/openflexure_microscope/api/static/src/components/fieldComponents/keyvalList.vue index ed884a4a..4d7743a4 100644 --- a/openflexure_microscope/api/static/src/components/fieldComponents/keyvalList.vue +++ b/openflexure_microscope/api/static/src/components/fieldComponents/keyvalList.vue @@ -111,11 +111,6 @@ export default { this.$delete(newSelected, key); this.$emit("input", newSelected); - }, - - modifyValue: function(e, v) { - console.log(e); - console.log(v); } } }; diff --git a/openflexure_microscope/api/static/src/components/genericComponents/taskSubmitter.vue b/openflexure_microscope/api/static/src/components/genericComponents/taskSubmitter.vue index 9f80e3bf..cb11e22a 100644 --- a/openflexure_microscope/api/static/src/components/genericComponents/taskSubmitter.vue +++ b/openflexure_microscope/api/static/src/components/genericComponents/taskSubmitter.vue @@ -138,7 +138,6 @@ export default { checkExistingTasks: function() { axios.get(this.submitUrl).then(response => { - console.log(response.data); for (const task of response.data) { if (task.status == "pending" || task.status == "running") { this.taskStarted = true; @@ -165,10 +164,10 @@ export default { startTask: function() { // Starts a new Action task - console.log("Task start clicked"); + this.$emit("submit", this.submitData); // Send a request to start a task - console.log("Submitting to ", this.submitUrl); + this.taskStarted = true; this.$emit("taskStarted", this.taskId); axios @@ -191,7 +190,7 @@ export default { this.pollTask(this.taskId, this.pollInterval) .then(response => { // Do something with the final response - console.log("Emitting onResponse: ", response); + this.$emit("response", response); this.$emit("finished"); }) @@ -199,12 +198,11 @@ export default { if (!error) { error = Error("Unknown error"); } - console.log("Emitting onError: ", error); + this.$emit("error", error); this.$emit("finished"); }) .finally(() => { - console.log("Cleaning up after task."); // Reset taskRunning and taskId this.taskRunning = false; this.taskStarted = false; @@ -223,7 +221,6 @@ export default { var checkCondition = (resolve, reject) => { // If the condition is met, we're done! axios.get(this.taskUrl).then(response => { - console.log(response.data.status); var result = response.data.status; // If the task ends with success if (result == "completed") { @@ -232,13 +229,13 @@ export default { // If task ends with an error else if (result == "error") { // Pass the error string back with reject - console.log("Rejecting pollTask due to error"); + reject(new Error(response.data.output)); } // If task ends with termination else if (result == "cancelled") { // Pass a generic termination error back with reject - console.log("Rejecting pollTask due to cancellation"); + reject(new Error("Task cancelled")); } else { // Since the task is still running, we can update the progress bar @@ -253,19 +250,13 @@ export default { }, pollProgress: function() { - console.log("Starting progress polling"); - axios.get(this.taskUrl).then(response => { - console.log("PROGRESS RESPONSE: ", response.data.progress); this.progress = response.data.progress; }); }, terminateTask: function() { - console.log("Terminating task..."); - axios.delete(this.taskUrl).then(response => { - console.log("TERMINATION RESPONSE: ", response.data); - }); + axios.delete(this.taskUrl); } } }; diff --git a/openflexure_microscope/api/static/src/components/modalComponents/calibrationModal.vue b/openflexure_microscope/api/static/src/components/modalComponents/calibrationModal.vue index feda2acb..fab205bf 100644 --- a/openflexure_microscope/api/static/src/components/modalComponents/calibrationModal.vue +++ b/openflexure_microscope/api/static/src/components/modalComponents/calibrationModal.vue @@ -265,7 +265,6 @@ export default { }, onHide: function() { - console.log("UIKit modal hidden"); this.$emit("onClose"); }, diff --git a/openflexure_microscope/api/static/src/components/pluginComponents/JsonForm.vue b/openflexure_microscope/api/static/src/components/pluginComponents/JsonForm.vue index d53e9eb1..18a495ee 100644 --- a/openflexure_microscope/api/static/src/components/pluginComponents/JsonForm.vue +++ b/openflexure_microscope/api/static/src/components/pluginComponents/JsonForm.vue @@ -201,8 +201,6 @@ export default { }, updateForm() { - // Trigger a plugin form update - console.log("Emitting reloadForms"); this.$emit("reloadForms"); }, @@ -214,14 +212,10 @@ export default { }, newQuickRequest: function(params) { - console.log(this.submitApiUri); - console.log(params); // Send a quick request axios .post(this.submitApiUri, params) - .then(response => { - // Do something with the response - console.log(response); + .then(() => { // Do all the finished request stuff this.onSubmissionCompleted(); }) @@ -232,8 +226,7 @@ export default { onTaskSubmit: function() {}, - onTaskResponse: function(responseData) { - console.log("Task finished with response data: ", responseData); + onTaskResponse: function() { // Do all the finished request stuff this.onSubmissionCompleted(); }, diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/aboutComponents/statusPane.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/aboutComponents/statusPane.vue index 361b5ac7..6854a4a1 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/aboutComponents/statusPane.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/aboutComponents/statusPane.vue @@ -165,9 +165,8 @@ export default { () => { if ("shutdown" in this.systemActionLinks) { this.$store.commit("resetState"); - axios.post(this.systemActionLinks.shutdown).catch(error => { - console.log(error); // Be quiet when empty response is recieved - }); + // Post and silence errors + axios.post(this.systemActionLinks.shutdown).catch(() => {}); } }, () => {} @@ -178,9 +177,8 @@ export default { () => { if ("reboot" in this.systemActionLinks) { this.$store.commit("resetState"); - axios.post(this.systemActionLinks.reboot).catch(error => { - console.log(error); // Be quiet when empty response is recieved - }); + // Post and silence errors + axios.post(this.systemActionLinks.reboot).catch(() => {}); } }, () => {} diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue index cd83a3cf..a3827938 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue @@ -356,8 +356,6 @@ export default { payload.annotations["Notes"] = this.captureNotes; } - console.log(payload); - return payload; }, @@ -437,8 +435,7 @@ export default { onScanSubmit: function() {}, - onScanResponse: function(responseData) { - console.log("Scan finished with response data: ", responseData); + onScanResponse: function() { this.modalNotify("Finished scan."); }, diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/galleryComponents/captureCard.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/galleryComponents/captureCard.vue index 80c33397..f3f1d2ba 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/galleryComponents/captureCard.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/galleryComponents/captureCard.vue @@ -241,7 +241,6 @@ export default { methods: { getMetadata: function() { // Send metadata request - console.log("Loading capture metadata..."); axios .get(this.captureURL) .then(response => { @@ -322,7 +321,6 @@ export default { }, delTagRequest: function(tagString) { - console.log(tagString); // Send tag DELETE request axios .delete(this.tagsURL, { data: [tagString] }) diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/galleryComponents/zipDownloader.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/galleryComponents/zipDownloader.vue index 9ed46a44..a0074706 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/galleryComponents/zipDownloader.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/galleryComponents/zipDownloader.vue @@ -17,7 +17,6 @@ :submit-url="zipBuilderUri" :submit-label="'Create ZIP'" :submit-data="captureIds" - @submit="onSubmit" @response="onResponse" @error="onError" > @@ -155,14 +154,9 @@ export default { }, deleteLastZip() { - axios - .delete(this.downloadUrl) - .then(response => { - console.log(response); - }) - .catch(error => { - this.modalError(error); // Let mixin handle error - }); + axios.delete(this.downloadUrl).catch(error => { + this.modalError(error); // Let mixin handle error + }); }, onResponse: function(response) { @@ -171,11 +165,6 @@ export default { this.downloadReady = true; }, - onSubmit: function(submitData) { - console.log("SUBMITTED"); - console.log(submitData); - }, - onError: function(error) { this.modalError(error); // Let mixin handle error } diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/galleryContent.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/galleryContent.vue index 612baee9..185398ea 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/galleryContent.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/galleryContent.vue @@ -349,7 +349,6 @@ export default { updateCaptures: function() { if (this.$store.state.available) { - console.log("Updating capture list..."); axios .get(this.capturesUri) .then(response => { @@ -358,8 +357,6 @@ export default { .catch(error => { this.modalError(error); // Let mixin handle error }); - } else { - console.log("Delaying capture update until connection is available"); } }, diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/loggingContent.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/loggingContent.vue index a1968176..93b9447f 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/loggingContent.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/loggingContent.vue @@ -122,7 +122,6 @@ export default { } }, updateLogs: function() { - console.log("Updating logs..."); axios .get(this.loggingUri) .then(response => { diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/navigateComponents/paneNavigate.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/navigateComponents/paneNavigate.vue index d8c53fbc..d22b045e 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/navigateComponents/paneNavigate.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/navigateComponents/paneNavigate.vue @@ -239,7 +239,6 @@ export default { }, moveRequest: function(x, y, z, absolute) { - console.log(`Sending move request of ${x}, ${y}, ${z}`); // If not movement-locked if (!this.moveLock) { // Lock move requests @@ -266,7 +265,6 @@ export default { }, moveInImageCoordinatesRequest: function(x, y) { - console.log(`Sending move request in image coordinates: ${x}, ${y}`); // If not movement-locked if (!this.moveLock) { // Lock move requests diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/CSMSettings.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/CSMSettings.vue index 4e3cd78f..d8c4be79 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/CSMSettings.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/CSMSettings.vue @@ -84,8 +84,6 @@ export default { axios .get(this.recalibrationLinks.get_calibration.href) .then(response => { - console.log("CSM data:"); - console.log(response.data); if (Object.keys(response.data).length === 0) { this.dataAvailable = false; } else { diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/CSMSettingsComponents/CSMCalibrationSettings.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/CSMSettingsComponents/CSMCalibrationSettings.vue index 8589c0ad..1a07bbda 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/CSMSettingsComponents/CSMCalibrationSettings.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/CSMSettingsComponents/CSMCalibrationSettings.vue @@ -93,8 +93,6 @@ export default { axios .get(this.recalibrationLinks.get_calibration.href) .then(response => { - console.log("CSM data:"); - console.log(response.data); if (Object.keys(response.data).length === 0) { this.dataAvailable = false; } else { diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/appSettings.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/appSettings.vue index 6e208f7a..f2d1ed04 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/appSettings.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/appSettings.vue @@ -36,7 +36,6 @@ export default { watch: { appTheme() { - console.log("Saving appTheme setting"); this.setLocalStorageObj("appTheme", this.appTheme); } }, 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 bc6a920f..63c66208 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/cameraSettings.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/cameraSettings.vue @@ -110,7 +110,6 @@ export default { }, applyConfigRequest: function() { - console.log("Applying config to the microscope"); var payload = { camera: { picamera: { diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/featuresSettings.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/featuresSettings.vue index 1b78e27d..da240360 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/featuresSettings.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/featuresSettings.vue @@ -40,7 +40,6 @@ export default { watch: { IHIEnabled() { - console.log("Saving IHIEnabled setting"); this.setLocalStorageObj("IHIEnabled", this.IHIEnabled); } }, diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/microscopeSettings.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/microscopeSettings.vue index fe58d291..a5f0a33e 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/microscopeSettings.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/microscopeSettings.vue @@ -108,8 +108,6 @@ export default { } }; - console.log(payload); - // Send request to update config axios .put(this.settingsUri, payload) 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 f0489b88..fae3462b 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/stageSettings.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/settingsComponents/stageSettings.vue @@ -56,11 +56,9 @@ export default { methods: { getStageType: function() { - console.log("Getting stage type"); axios .get(this.stageTypeUri) .then(response => { - console.log("Stage type is " + response.data); this.stageType = response.data; }) .catch(error => { @@ -68,7 +66,6 @@ export default { }); }, setStageType: function() { - console.log("Setting stage type"); axios .put(this.stageTypeUri, this.stageType, { headers: { @@ -77,7 +74,7 @@ export default { }) .then(response => { this.stageType = response.data; - console.log("Stage type set to " + this.stageType); + this.modalNotify("Stage geometry changed."); }) .catch(error => { diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/slideScanComponents/paneSlideScan.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/slideScanComponents/paneSlideScan.vue index 7ce7a0b3..0d3096bf 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/slideScanComponents/paneSlideScan.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/slideScanComponents/paneSlideScan.vue @@ -174,7 +174,6 @@ export default { return this.currentTime.substr(0, 19); }, set(val) { - console.log(val); // Get timezone var dt = new Date(); var tzo = -dt.getTimezoneOffset(), diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/streamContent.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/streamContent.vue index d1ee99c1..2554d621 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/streamContent.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/streamContent.vue @@ -73,7 +73,6 @@ export default { }, mounted() { - console.log(`${this._uid} mounted`); // A global signal listener to change the GPU preview state this.$root.$on("globalTogglePreview", state => { this.previewRequest(state); @@ -97,13 +96,11 @@ export default { }, created: function() { - console.log(`${this._uid} created`); // Send a request to start/stop GPU preview based on global setting this.safePreviewRequest(this.$store.state.autoGpuPreview); }, beforeDestroy: function() { - console.log(`${this._uid} being destroyed`); // Remove global signal listener to change the GPU preview state this.$root.$off("globalTogglePreview"); // Remove global signal listener to flash the stream element @@ -163,15 +160,12 @@ export default { handleDoneResize: function() { // Recalculate size - console.log(`Recalculating frame size for ${this._uid}`); + this.recalculateSize(); // Handle closed stream if (this.displaySize[0] == 0 && this.displaySize[1] == 0) { - console.log(`${this._uid} is zero`); // If this stream was previously active if (this.$store.state.activeStreams[this._uid] == true) { - console.log(`${this._uid} was active`); - console.log(`STREAM ${this._uid} CLOSED`); this.$store.commit("removeStream", this._uid); // If all streams are closed, request the GPU preview close var a = Object.values(this.$store.state.activeStreams); @@ -182,7 +176,6 @@ export default { } // If resized to anything other than zero } else { - console.log(`STREAM ${this._uid} OPEN`); this.$store.commit("addStream", this._uid); if (this.$store.state.autoGpuPreview == true) { // Start the preview immediately @@ -282,7 +275,7 @@ export default { } // Send preview request - console.log(`${this._uid} toggled preview to ${state}`); + axios .post(requestUri, payload) .then(() => {}) diff --git a/openflexure_microscope/api/static/src/main.js b/openflexure_microscope/api/static/src/main.js index 3e4a9933..a9441a66 100644 --- a/openflexure_microscope/api/static/src/main.js +++ b/openflexure_microscope/api/static/src/main.js @@ -53,9 +53,7 @@ Vue.mixin({ ) .finally(function() { // Reenable the GPU preview, if it was active before the modal - console.log("Re-enabling GPU preview"); if (context.$store.state.autoGpuPreview) { - console.log("Re-enabling preview"); context.$root.$emit("globalTogglePreview", true); } }); @@ -102,21 +100,17 @@ Vue.mixin({ // If the response is a nicely formatted JSON response from the server if (error.response.data.message) { errormsg = `${error.response.status}: ${error.response.data.message}`; - console.log(errormsg); } // If the response is just some generic error response else { errormsg = `${error.response.status}: ${error.response.data}`; - console.log(errormsg); } // If the error occured during the request } else if (error.request) { errormsg = `${error.message}`; - console.log(errormsg); // Everything else } else { errormsg = `${error.message}`; - console.log(errormsg); } return errormsg; }, @@ -138,7 +132,6 @@ Vue.mixin({ try { return JSON.parse(localStorage.getItem(keyName)); } catch (e) { - console.log("Malformed entry. Removing from localStorage"); localStorage.removeItem(keyName); return null; }