@@ -147,7 +142,15 @@
-
+
+
+
@@ -159,13 +162,16 @@ import axios from 'axios'
import tagList from "../fieldComponents/tagList"
import keyvalList from "../fieldComponents/keyvalList"
+import taskSubmitter from "../genericComponents/taskSubmitter"
+
// Export main app
export default {
name: 'paneCapture',
components: {
tagList,
- keyvalList
+ keyvalList,
+ taskSubmitter
},
@@ -178,7 +184,6 @@ export default {
resizeCapture: false,
captureNotes: "",
scanCapture: false,
- isScanning: false,
scanDeltaZ: 'Medium',
scanStyle: 'Raster',
scanStepSize: {
@@ -209,24 +214,7 @@ export default {
},
handleScan: function() {
- var payload = this.basePayload
-
- // Scan params
- payload.grid = [this.scanSteps.x, this.scanSteps.y, this.scanSteps.z]
- payload.step_size = [this.scanStepSize.x, this.scanStepSize.y, this.scanStepSize.z]
- payload.style = this.scanStyle.toLowerCase()
-
- // Convert AF selector to dz
- var afDeltas = {
- Off: 0,
- Coarse: 100,
- Medium: 30,
- Fine: 10,
- Fast: 1500
- }
-
- payload.autofocus_dz = afDeltas[this.scanDeltaZ]
- payload.fast_autofocus = this.scanDeltaZ == "Fast"
+ var payload = this.scanPayload
// Do capture
this.newScanRequest(payload)
@@ -243,22 +231,18 @@ export default {
})
},
- newScanRequest: function(params) {
- axios.post(this.scanApiUri, params)
- .then(response => {
- console.log("Task ID: " + response.data.id)
- this.isScanning = true
- return this.$store.dispatch('pollTask', [response.data.id, 3600, 5])
- })
- .then(() => {
- this.modalNotify("Finished scan.")
- })
- .catch(error => {
- this.modalError(error)
- })
- .finally(() => {
- this.isScanning = false
- })
+ onScanSubmit: function(submitData) {
+ // We don't need to do anything on this event yet
+ console.log("onScanSubmit event triggered")
+ },
+
+ onScanResponse: function(responseData) {
+ console.log("Scan finished with response data: ", responseData)
+ this.modalNotify("Finished scan.")
+ },
+
+ onScanError: function(error) {
+ this.modalError(error)
}
},
@@ -306,7 +290,31 @@ export default {
}
return payload
- }
+ },
+
+ scanPayload: function() {
+ var payload = this.basePayload
+
+ // Scan params
+ payload.grid = [this.scanSteps.x, this.scanSteps.y, this.scanSteps.z]
+ payload.step_size = [this.scanStepSize.x, this.scanStepSize.y, this.scanStepSize.z]
+ payload.style = this.scanStyle.toLowerCase()
+
+ // Convert AF selector to dz
+ var afDeltas = {
+ Off: 0,
+ Coarse: 100,
+ Medium: 30,
+ Fine: 10,
+ Fast: 1500
+ }
+
+ payload.autofocus_dz = afDeltas[this.scanDeltaZ]
+ payload.fast_autofocus = this.scanDeltaZ == "Fast"
+
+ return payload
+ },
+
}
}