diff --git a/src/components/paneCapture.vue b/src/components/paneCapture.vue index 9acd73a3..08da2cc9 100644 --- a/src/components/paneCapture.vue +++ b/src/components/paneCapture.vue @@ -29,6 +29,15 @@
- - + + @@ -158,8 +187,11 @@ export default { fullResolution: false, storeBayer: false, resizeCapture: false, + captureNotes: "", scanCapture: false, isScanning: false, + scanDeltaZ: 'Medium', + scanStyle: 'Raster', scanStepSize: { x: parseInt(0.8*this.$store.state.apiConfig.fov[0]), y: parseInt(0.8*this.$store.state.apiConfig.fov[1]), @@ -209,62 +241,29 @@ export default { }, handleCapture: function() { - var payload = {} - - // Filename - if (Boolean(this.filename)) { - payload.filename = this.filename - } - - // Basic boolean params - payload.temporary = this.temporary; - payload.use_video_port = !this.fullResolution; - payload.bayer = this.storeBayer; - - // Resizing - if (this.resizeCapture) { - payload.size = { - width: this.resizeDims[0], - height: this.resizeDims[1] - } - } - - // Additional metadata - payload.metadata = this.customMetadata - payload.tags = this.tags + var payload = this.basePayload // Do capture this.newCaptureRequest(payload) }, handleScan: function() { - var payload = {} - - // Filename - if (Boolean(this.filename)) { - payload.filename = this.filename - } - - // Basic boolean params - payload.temporary = this.temporary; - payload.use_video_port = !this.fullResolution; - payload.bayer = this.storeBayer; - - // Resizing - if (this.resizeCapture) { - payload.size = { - width: this.resizeDims[0], - height: this.resizeDims[1] - } - } - - // Additional metadata - payload.metadata = this.customMetadata - payload.tags = this.tags + 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 + } + + payload.autofocus_dz = afDeltas[this.scanDeltaZ] // Do capture this.newScanRequest(payload) @@ -312,6 +311,38 @@ export default { }, scanApiUri: function () { return this.$store.getters.uri + "/plugin/default/scan/tile" + }, + basePayload: function () { + var payload = {} + + // Filename + if (Boolean(this.filename)) { + payload.filename = this.filename + } + + // Basic boolean params + payload.temporary = this.temporary; + payload.use_video_port = !this.fullResolution; + payload.bayer = this.storeBayer; + + // Resizing + if (this.resizeCapture) { + payload.size = { + width: this.resizeDims[0], + height: this.resizeDims[1] + } + } + + // Additional metadata + payload.metadata = this.customMetadata + payload.tags = this.tags + + // Attach notes + if (this.captureNotes) { + payload.metadata['Notes'] = this.captureNotes + } + + return payload } }