Use neater spread operator to copy objects
Rather than Object.assign, I now use the ... operator to ensure that dictionaries don't pollute each other in computed properties.
This commit is contained in:
parent
332ecad19b
commit
b7c15886e9
1 changed files with 24 additions and 26 deletions
|
|
@ -441,18 +441,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
scanPayload: function() {
|
scanPayload: function() {
|
||||||
var payload = Object.assign({}, this.basePayload);
|
|
||||||
|
|
||||||
// Scan params
|
|
||||||
payload.grid = [this.scanSteps.x, this.scanSteps.y, this.scanSteps.z];
|
|
||||||
payload.stride_size = [
|
|
||||||
this.scanStepSize.x,
|
|
||||||
this.scanStepSize.y,
|
|
||||||
this.scanStepSize.z
|
|
||||||
];
|
|
||||||
payload.style = this.scanStyle.toLowerCase();
|
|
||||||
payload.namemode = this.namingStyle.toLowerCase();
|
|
||||||
|
|
||||||
// Convert AF selector to dz
|
// Convert AF selector to dz
|
||||||
var afDeltas = {
|
var afDeltas = {
|
||||||
Off: 0,
|
Off: 0,
|
||||||
|
|
@ -461,22 +449,32 @@ export default {
|
||||||
Fine: 10,
|
Fine: 10,
|
||||||
Fast: 2000
|
Fast: 2000
|
||||||
};
|
};
|
||||||
|
return {
|
||||||
payload.autofocus_dz = afDeltas[this.scanDeltaZ];
|
...this.basePayload,
|
||||||
payload.fast_autofocus = this.scanDeltaZ == "Fast";
|
// Scan params
|
||||||
|
grid: [this.scanSteps.x, this.scanSteps.y, this.scanSteps.z],
|
||||||
return payload;
|
stride_size: [
|
||||||
|
this.scanStepSize.x,
|
||||||
|
this.scanStepSize.y,
|
||||||
|
this.scanStepSize.z
|
||||||
|
],
|
||||||
|
style: this.scanStyle.toLowerCase(),
|
||||||
|
namemode: this.namingStyle.toLowerCase(),
|
||||||
|
autofocus_dz: afDeltas[this.scanDeltaZ],
|
||||||
|
fast_autofocus: this.scanDeltaZ == "Fast"
|
||||||
|
};
|
||||||
},
|
},
|
||||||
smartScanPayload: function() {
|
smartScanPayload: function() {
|
||||||
var payload = Object.assign({}, this.scanPayload);
|
return {
|
||||||
payload.threshold = this.smartStackThreshold;
|
...this.scanPayload,
|
||||||
payload.width = this.smartStackPeakWidth;
|
threshold: this.smartStackThreshold,
|
||||||
payload.align_dist = this.smartStackAlignDist;
|
width: this.smartStackPeakWidth,
|
||||||
payload.backlash = this.smartStackBacklash;
|
align_dist: this.smartStackAlignDist,
|
||||||
payload.fit_style = this.smartStackFitStyle;
|
backlash: this.smartStackBacklash,
|
||||||
payload.m_and_m_index = this.smartStackMAndMIndex;
|
fit_style: this.smartStackFitStyle,
|
||||||
payload.autofocus_dz = this.smartStackAutofocusDz;
|
m_and_m_index: this.smartStackMAndMIndex,
|
||||||
return payload;
|
autofocus_dz: this.smartStackAutofocusDz
|
||||||
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue