fix:Beta 的energy calibration的操作逻辑

This commit is contained in:
xiaoguangbin 2023-10-28 17:36:02 +08:00
parent 6a4bb9822d
commit 18f343d899

View File

@ -128,9 +128,9 @@
<span>C to E : </span>
<span>
E =
<a-input-number size="small" v-model="newCalibrationFuncModel.paramA" /> +
<a-input-number size="small" v-model="newCalibrationFuncModel.paramB" /> *C +
<a-input-number size="small" v-model="newCalibrationFuncModel.paramC" /> *C <sup>2</sup>
<a-input-number size="small" v-model="newCalibrationFuncModel.paramA" @change="newCalibrationFuncModelChange"/> +
<a-input-number size="small" v-model="newCalibrationFuncModel.paramB" @change="newCalibrationFuncModelChange"/> *C +
<a-input-number size="small" v-model="newCalibrationFuncModel.paramC" @change="newCalibrationFuncModelChange" /> *C <sup>2</sup>
</span>
</p>
<div class="func">
@ -785,6 +785,11 @@ export default {
energy,
})
// add chart线 20231028Xiao
if(this.figureChartOption.series[1].data) {
this.figureChartOption.series[1].data = []
}
this.figureChartOption.series[1].markPoint.data.push({ xAxis: channel, yAxis: energy })
const { min, max } = this.getFigureChartMaxAndMin()
@ -808,6 +813,19 @@ export default {
this.isInverse = true
},
//
newCalibrationFuncModelChange() {
// table 20231028Xiao
this.list = []
// chart线 20231028Xiao
if(this.figureChartOption.series[1].data) {
this.figureChartOption.series[1].data = []
}
if(this.figureChartOption.series[1].markPoint.data) {
this.figureChartOption.series[1].markPoint.data = []
}
},
//
handleDel(index) {
const willDelItem = this.list.splice(index, 1)[0]
@ -857,15 +875,19 @@ export default {
// Fitting
async handleFitting() {
const hasEmpty = Object.entries(this.newCalibrationFuncModel).some(([_, v]) => !v)
if (hasEmpty) {
if (hasEmpty && this.list.length < 3) {
return
}
try {
const { success, result, message } = await postAction('/spectrumAnalysis/fitting', {
...this.newCalibrationFuncModel,
tempPoints: this.isFirstFitting
? this.oldScatterSeries
: this.list.map((item) => ({ x: item.channel, y: item.energy })),
// 20231028Xiao
tempPoints: this.list.length > 0
? this.list.map((item) => ({ x: item.channel, y: item.energy }))
: this.oldScatterSeries,
// tempPoints: this.isFirstFitting
// ? this.oldScatterSeries
// : this.list.map((item) => ({ x: item.channel, y: item.energy })),
count: this.isFirstFitting || !this.isInverse ? undefined : this.count,
})
if (success) {