fix: 修复底部significance不变的问题
This commit is contained in:
parent
fc7c62b504
commit
df457a3e4f
|
@ -198,6 +198,7 @@ export default {
|
||||||
all: null,
|
all: null,
|
||||||
baseLineCP: [],
|
baseLineCP: [],
|
||||||
},
|
},
|
||||||
|
peakList: [], // Peak 列表(非点位)
|
||||||
|
|
||||||
nuclideLibraryList: [], // 当前鼠标点击选中的channel
|
nuclideLibraryList: [], // 当前鼠标点击选中的channel
|
||||||
peakInfomationTooltip: {
|
peakInfomationTooltip: {
|
||||||
|
@ -356,7 +357,11 @@ export default {
|
||||||
}
|
}
|
||||||
const nextAxis = markLineXAxis == -1 ? 1 : markLineXAxis + 1
|
const nextAxis = markLineXAxis == -1 ? 1 : markLineXAxis + 1
|
||||||
markLineData.xAxis = nextAxis
|
markLineData.xAxis = nextAxis
|
||||||
const { channel: nextChannel, energy: nextEnergy, counts: nextCounts } = this.getEnergyAndCountsByXAxis(nextAxis)
|
const {
|
||||||
|
channel: nextChannel,
|
||||||
|
energy: nextEnergy,
|
||||||
|
counts: nextCounts,
|
||||||
|
} = this.getEnergyAndCountsByXAxis(nextAxis)
|
||||||
this.setChartBottomTitle(nextChannel, nextEnergy, nextCounts)
|
this.setChartBottomTitle(nextChannel, nextEnergy, nextCounts)
|
||||||
|
|
||||||
this.getSelPosNuclide(nextChannel)
|
this.getSelPosNuclide(nextChannel)
|
||||||
|
@ -545,6 +550,7 @@ export default {
|
||||||
|
|
||||||
shapeChannelData,
|
shapeChannelData,
|
||||||
shapeEnergyData,
|
shapeEnergyData,
|
||||||
|
peak,
|
||||||
} = result
|
} = result
|
||||||
if (flag && (flag == 'dab' || flag == 'file')) {
|
if (flag && (flag == 'dab' || flag == 'file')) {
|
||||||
this.bAnalyed = result.bAnalyed
|
this.bAnalyed = result.bAnalyed
|
||||||
|
@ -556,6 +562,10 @@ export default {
|
||||||
this.detailedInfomation = DetailedInformation
|
this.detailedInfomation = DetailedInformation
|
||||||
this.qcFlags = QCFlag
|
this.qcFlags = QCFlag
|
||||||
|
|
||||||
|
if(peak) {
|
||||||
|
this.peakList = peak
|
||||||
|
}
|
||||||
|
|
||||||
const channelPeakGroup = this.getLineData(allData, 'Peak', 'channel', true)
|
const channelPeakGroup = this.getLineData(allData, 'Peak', 'channel', true)
|
||||||
const energyPeakGroup = this.getLineData(allData, 'Peak', 'energy', true)
|
const energyPeakGroup = this.getLineData(allData, 'Peak', 'energy', true)
|
||||||
|
|
||||||
|
@ -867,9 +877,48 @@ export default {
|
||||||
|
|
||||||
// 设置图表底部的标题
|
// 设置图表底部的标题
|
||||||
setChartBottomTitle(channel, energy, counts) {
|
setChartBottomTitle(channel, energy, counts) {
|
||||||
this.option.title.text = `{a|Channel:${channel}} {a|Energy:${
|
const { index, find } = this.findNearPeak(channel)
|
||||||
energy || 0
|
|
||||||
}} {a|Counts:${counts || 0}} {a|Detectability:0}`
|
this.option.title.text = `{a|Channel:${channel}} {a|Energy:${energy || '0.00'}} {a|Counts:${
|
||||||
|
counts || '0.0'
|
||||||
|
}} {a|Significance:${find ? this.peakList[index].significance.toFixed(2) : '0.00'}}`
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查找最近的峰(C++相关)
|
||||||
|
findNearPeak(channel) {
|
||||||
|
let t_bFind = false,
|
||||||
|
i = 0,
|
||||||
|
peakNum = this.peakList.length
|
||||||
|
for (; i < peakNum; ++i) {
|
||||||
|
const peak = this.peakList[i]
|
||||||
|
if (channel >= peak.left && channel <= peak.right) {
|
||||||
|
// 如果 channel 在峰的左右边界内
|
||||||
|
if (peak.multiIndex > 0 && channel > peak.peakCentroid) {
|
||||||
|
// 如果是重峰,且 channel 在重峰的第一个峰的中心道右侧
|
||||||
|
let j = i
|
||||||
|
let temp = channel - peak.peakCentroid
|
||||||
|
while (++j < peakNum && this.peakList[j].multiIndex == peak.multiIndex) {
|
||||||
|
if (Math.abs(this.peakList[j].peakCentroid - channel) < temp) {
|
||||||
|
// 找出重峰中峰中心道离 channel 最近的峰
|
||||||
|
temp = Math.abs(this.peakList[j].peakCentroid - channel)
|
||||||
|
i = j
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// channel 在索引(i)对应的峰内
|
||||||
|
t_bFind = true
|
||||||
|
break
|
||||||
|
} else if (peak.left > channel) {
|
||||||
|
// channel 不在任何峰内,找离它最近的峰
|
||||||
|
if (i > 0 && channel - this.peakList[i - 1].peakCentroid < peak.peakCentroid - channel) i -= 1
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i >= peakNum) i -= 1
|
||||||
|
return {
|
||||||
|
index: i,
|
||||||
|
find: t_bFind,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 根据xAixs值找channel、energy和counts
|
// 根据xAixs值找channel、energy和counts
|
||||||
|
|
Loading…
Reference in New Issue
Block a user