人工交互新增自建台站相关实体类对象
人工交互新增自建台站管理代码 人工交互新增自建台站数据缓存对象 人工交互新增自建台站工具类
This commit is contained in:
parent
2b15cb4e67
commit
cadbdb3ba9
48
jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/cache/SelfCache.java
vendored
Normal file
48
jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/cache/SelfCache.java
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
package org.jeecg.common.cache;
|
||||
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import org.jeecg.common.properties.DurationProperties;
|
||||
import org.jeecg.modules.entity.vo.SelfStationData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Component
|
||||
public class SelfCache {
|
||||
|
||||
@Autowired
|
||||
private DurationProperties durationProperties;
|
||||
|
||||
private Cache<String, SelfStationData> selfCache;
|
||||
|
||||
public void initCache() {
|
||||
selfCache = CacheBuilder.newBuilder()
|
||||
//设置缓存初始大小,应该合理设置,后续会扩容
|
||||
.initialCapacity(10)
|
||||
//最大值
|
||||
.maximumSize(100)
|
||||
//并发数设置
|
||||
.concurrencyLevel(5)
|
||||
//缓存过期时间,写入后XX小时后过期
|
||||
.expireAfterWrite(durationProperties.getCache(), TimeUnit.HOURS)
|
||||
//统计缓存命中率
|
||||
.recordStats()
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
public Cache<String, SelfStationData> getSelfCache() {
|
||||
return selfCache;
|
||||
}
|
||||
|
||||
public void setSelfCache(Cache<String, SelfStationData> selfCache) {
|
||||
this.selfCache = selfCache;
|
||||
}
|
||||
|
||||
public void deleteSelfCache(String key){
|
||||
this.selfCache.invalidate(key);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,589 @@
|
|||
package org.jeecg.common.util;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.base.abstracts.AbstractLogOrReport;
|
||||
import org.jeecg.modules.base.enums.CalName;
|
||||
import org.jeecg.modules.entity.vo.*;
|
||||
import org.jeecg.modules.native_jni.CalValuesHandler;
|
||||
import org.jeecg.modules.native_jni.EnergySpectrumHandler;
|
||||
import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class SelfStationUtil extends AbstractLogOrReport {
|
||||
|
||||
@Autowired
|
||||
private FTPUtil ftpUtil;
|
||||
|
||||
public void loadFile(SelfStationData selfStationData, Integer sampleId, String status, Map<String, Object> map) {
|
||||
try {
|
||||
//读取sample的分析文件内容
|
||||
EnergySpectrumStruct struct = selfStationData.getSampleStruct();
|
||||
SpectrumData spectrumData = new SpectrumData();
|
||||
//封装散点图下的基础数据信息
|
||||
//Station Code
|
||||
String stationCode = struct.site_code;
|
||||
//Detector Code
|
||||
String detectorCode = struct.detector_code;
|
||||
//Data Type
|
||||
String dataType = struct.data_type;
|
||||
//Collection Start
|
||||
Date CollectionStart = null;
|
||||
if ( StringUtils.isNotBlank(struct.collection_start_date) && StringUtils.isNotBlank(struct.collection_start_time) ){
|
||||
CollectionStart = DateUtils.parseDate(struct.collection_start_date + StringPool.SPACE + struct.collection_start_time);
|
||||
}
|
||||
//Collection Stop
|
||||
Date CollectionStop = null;
|
||||
if ( StringUtils.isNotBlank(struct.collection_stop_date) && StringUtils.isNotBlank(struct.collection_stop_time) ){
|
||||
CollectionStop = DateUtils.parseDate(struct.collection_stop_date + StringPool.SPACE + struct.collection_stop_time);
|
||||
}
|
||||
//Collection Time
|
||||
String CollectionTime = "";
|
||||
if ( Objects.nonNull(CollectionStart) && Objects.nonNull(CollectionStop) ){
|
||||
CollectionTime = String.format ("%.2f",Double.valueOf((CollectionStop.getTime() - CollectionStart.getTime())/ 1000));
|
||||
}
|
||||
//Acquisition Start
|
||||
Date AcquisitionStart = null;
|
||||
if ( StringUtils.isNotBlank(struct.acquisition_start_date) && StringUtils.isNotBlank(struct.acquisition_start_time) ){
|
||||
AcquisitionStart = DateUtils.parseDate(struct.acquisition_start_date + StringPool.SPACE + struct.acquisition_start_time);
|
||||
}
|
||||
//Acq Real Time
|
||||
double AcquisitionRealTime = struct.acquisition_real_time;
|
||||
//Acq live Time
|
||||
double AcquisitionLiveTime = struct.acquisition_live_time;
|
||||
//Air Volume[m3]
|
||||
double airVolume = struct.air_volume;
|
||||
//Xe Volume[m3]
|
||||
double xeVolume = struct.sample_volume_of_Xe;
|
||||
//xeCollectionYield
|
||||
double xeCollectionYield = struct.Xe_collection_yield;
|
||||
//gasBkMeasurementId
|
||||
String gasBkMeasurementId = struct.gas_bk_measurement_id;
|
||||
//detectorBkMeasurementId
|
||||
String detectorBkMeasurementId = struct.detector_bk_measurement_id;
|
||||
//measurementId
|
||||
String measurementId = struct.measurement_id;
|
||||
spectrumData.setSampleId(sampleId);
|
||||
spectrumData.setStatus(status);
|
||||
spectrumData.setStationCode(stationCode);
|
||||
spectrumData.setDetectorCode(detectorCode);
|
||||
spectrumData.setDataType(dataType);
|
||||
spectrumData.setCollectionStart(CollectionStart);
|
||||
spectrumData.setCollectionStop(CollectionStop);
|
||||
spectrumData.setCollectionTime(CollectionTime);
|
||||
spectrumData.setAcquisitionStart(AcquisitionStart);
|
||||
spectrumData.setAcquisitionRealTime(String.format("%.2f", AcquisitionRealTime));
|
||||
spectrumData.setAcquisitionLiveTime(String.format("%.2f", AcquisitionLiveTime));
|
||||
spectrumData.setAirVolume(String.format("%.5f", airVolume));
|
||||
spectrumData.setXeVolume(String.format("%.5f", xeVolume));
|
||||
spectrumData.setYield(xeCollectionYield);
|
||||
spectrumData.setGasBkMeasurementId(gasBkMeasurementId);
|
||||
spectrumData.setDetectorBkMeasurementId(detectorBkMeasurementId);
|
||||
spectrumData.setMeasurementId(measurementId);
|
||||
map.put("spectrumData", spectrumData);
|
||||
//根据范围1划分 范围1对应的折线图
|
||||
statisticsROIList(struct.POI_B_x1.get(0).intValue(), struct.POI_B_x2.get(0).intValue(), 1, selfStationData);
|
||||
if ( CollectionUtils.isNotEmpty(selfStationData.getROIOneList()) && Objects.nonNull(selfStationData.getROIOneBetaStart())
|
||||
&& Objects.nonNull(selfStationData.getROIOneBetaStop()) ) {
|
||||
map.put("ROIOneList", selfStationData.getROIOneList());
|
||||
map.put("ROIOneStart", selfStationData.getROIOneBetaStart());
|
||||
map.put("ROIOneStop", selfStationData.getROIOneBetaStop());
|
||||
}
|
||||
//根据范围2划分 范围2对应的折线图
|
||||
statisticsROIList(struct.POI_B_x1.get(1).intValue(), struct.POI_B_x2.get(1).intValue(), 2, selfStationData);
|
||||
if ( CollectionUtils.isNotEmpty(selfStationData.getROITwoList()) && Objects.nonNull(selfStationData.getROITwoBetaStart())
|
||||
&& Objects.nonNull(selfStationData.getROITwoBetaStop()) ) {
|
||||
map.put("ROITwoList", selfStationData.getROITwoList());
|
||||
map.put("ROITwoStart", selfStationData.getROITwoBetaStart());
|
||||
map.put("ROITwoStop", selfStationData.getROITwoBetaStop());
|
||||
}
|
||||
//根据范围3划分 范围3对应的折线图
|
||||
statisticsROIList(struct.POI_B_x1.get(2).intValue(), struct.POI_B_x2.get(2).intValue(), 3, selfStationData);
|
||||
if ( CollectionUtils.isNotEmpty(selfStationData.getROIThreeList()) && Objects.nonNull(selfStationData.getROIThreeBetaStart())
|
||||
&& Objects.nonNull(selfStationData.getROIThreeBetaStop()) ) {
|
||||
map.put("ROIThreeList", selfStationData.getROIThreeList());
|
||||
map.put("ROIThreeStart", selfStationData.getROIThreeBetaStart());
|
||||
map.put("ROIThreeStop", selfStationData.getROIThreeBetaStop());
|
||||
}
|
||||
//根据范围4划分 范围4对应的折线图
|
||||
statisticsROIList(struct.POI_B_x1.get(3).intValue(), struct.POI_B_x2.get(3).intValue(), 4, selfStationData);
|
||||
if ( CollectionUtils.isNotEmpty(selfStationData.getROIFourList()) && Objects.nonNull(selfStationData.getROIFourBetaStart())
|
||||
&& Objects.nonNull(selfStationData.getROIFourBetaStop()) ) {
|
||||
map.put("ROIFourList", selfStationData.getROIFourList());
|
||||
map.put("ROIFourStart", selfStationData.getROIFourBetaStart());
|
||||
map.put("ROIFourStop", selfStationData.getROIFourBetaStop());
|
||||
}
|
||||
//散点图
|
||||
//统计散点图
|
||||
//横坐标 beta-gamma
|
||||
long bChannels = struct.b_channels;
|
||||
//纵坐标 gamma
|
||||
long gChannels = struct.g_channels;
|
||||
//值
|
||||
List<Long> hCounts = struct.h_counts;
|
||||
List<HistogramData> histogramDataList = new LinkedList<>();
|
||||
List<HistogramData> histogramDataDList = new LinkedList<>();
|
||||
for (int i=0; i<bChannels; i++){
|
||||
for (int j=0; j< gChannels; j++){
|
||||
Long index = i * bChannels + j;
|
||||
Long count = hCounts.get(index.intValue());
|
||||
if (count > 0){
|
||||
HistogramData his = new HistogramData();
|
||||
his.setG(i);
|
||||
his.setB(j);
|
||||
his.setC(count);
|
||||
histogramDataList.add(his);
|
||||
histogramDataDList.add(his);
|
||||
}else {
|
||||
HistogramData his = new HistogramData();
|
||||
his.setG(i);
|
||||
his.setB(j);
|
||||
his.setC(count);
|
||||
histogramDataDList.add(his);
|
||||
}
|
||||
}
|
||||
}
|
||||
map.put("histogramDataList", histogramDataList);
|
||||
// map.put("histogramDataDList", histogramDataDList);
|
||||
//gamma能量部分的计算参数 道值
|
||||
List<Double> gCentroidChannel = struct.g_centroid_channel;
|
||||
//gamma能量部分的计算参数 道值对应能量
|
||||
List<Double> gEnergy = struct.g_energy;
|
||||
//调用算法 传入道值和道值对应的能量 得到计算gamma能量公式的参数
|
||||
List<Double> gammaParam = EnergySpectrumHandler.GetFileFittingPara(gCentroidChannel, gEnergy);
|
||||
//存储需要计算gamma能量的道值
|
||||
List<Double> gchannels = new ArrayList<>();
|
||||
for (int i=0; i<gChannels; i++){
|
||||
gchannels.add(Double.valueOf(i));
|
||||
}
|
||||
//调用算法 传递gamma参与计算的道值以及计算公式参数 得到各道值对应的能量
|
||||
List<Double> gammaEnergyList = EnergySpectrumHandler.GetFileFittingData(gchannels, gammaParam);
|
||||
//将gamma能量折线图进行赋值返回
|
||||
map.put("gammaEnergyData", gammaEnergyList);
|
||||
//beta能量部分的计算参数 道值
|
||||
List<Double> bChannel = struct.b_channel;
|
||||
//beta能量部分的计算参数 道值对应的能量
|
||||
List<Double> bElectronEnergy = struct.b_electron_energy;
|
||||
//调用算法 传入道值和道值对应的能量 得到计算beta能量公式的参数
|
||||
List<Double> betaParam = EnergySpectrumHandler.GetFileFittingPara(bChannel, bElectronEnergy);
|
||||
List<Double> bchannels = new ArrayList<>();
|
||||
for (int i=0; i<bChannels; i++){
|
||||
bchannels.add(Double.valueOf(i));
|
||||
}
|
||||
//传入道值和计算公式的参数计算出各道值对应的beta能量
|
||||
List<Double> betaEnergyList = EnergySpectrumHandler.GetFileFittingData(bchannels, betaParam);
|
||||
//将beta能量折线图进行赋值返回
|
||||
map.put("betaEnergyData", betaEnergyList);
|
||||
|
||||
//g_Energy
|
||||
if (CollectionUtils.isNotEmpty(struct.g_energy) && CollectionUtils.isNotEmpty(struct.g_centroid_channel) && CollectionUtils.isNotEmpty(struct.g_uncertainty) && Objects.nonNull(struct.g_record_count)) {
|
||||
GEnergyBlock gEnergyBlock = new GEnergyBlock();
|
||||
gEnergyBlock.setG_energy(struct.g_energy);
|
||||
gEnergyBlock.setCentroid_channel(struct.g_centroid_channel);
|
||||
gEnergyBlock.setUncertainty(struct.g_uncertainty);
|
||||
gEnergyBlock.setRecord_count(struct.g_record_count);
|
||||
selfStationData.getMapEnerKD().put(CalName.CalPHD.getType(), gEnergyBlock);
|
||||
//计算得到公式的参数
|
||||
List<Double> calEnergyParam = CalValuesHandler.calFitPara("Cal_Energy", 2, struct.g_centroid_channel, struct.g_energy, struct.g_uncertainty);
|
||||
ParameterInfo parameterInfo = new ParameterInfo();
|
||||
parameterInfo.setP(calEnergyParam);
|
||||
selfStationData.getMapEnerPara().put(CalName.CalPHD.getType(), parameterInfo);
|
||||
}
|
||||
//g_Resolution
|
||||
if (CollectionUtils.isNotEmpty(struct.g_r_energy) && CollectionUtils.isNotEmpty(struct.g_r_FWHM) && CollectionUtils.isNotEmpty(struct.g_r_uncertainty) && Objects.nonNull(struct.g_r_record_count)) {
|
||||
GResolutionBlock gResolutionBlock = new GResolutionBlock();
|
||||
gResolutionBlock.setG_energy(struct.g_r_energy);
|
||||
gResolutionBlock.setFWHM(struct.g_r_FWHM);
|
||||
gResolutionBlock.setUncertainty(struct.g_r_uncertainty);
|
||||
gResolutionBlock.setRecord_count(struct.g_r_record_count);
|
||||
selfStationData.getMapResoKD().put(CalName.CalPHD.getType(), gResolutionBlock);
|
||||
//计算得到公式的参数
|
||||
List<Double> calEnergyParam = CalValuesHandler.calFitPara("Cal_Resolution", 4, struct.g_r_energy, struct.g_r_FWHM, struct.g_r_uncertainty);
|
||||
ParameterInfo parameterInfo = new ParameterInfo();
|
||||
parameterInfo.setP(calEnergyParam);
|
||||
selfStationData.getMapResoPara().put(CalName.CalPHD.getType(), parameterInfo);
|
||||
}
|
||||
//g_Efficiency
|
||||
if (CollectionUtils.isNotEmpty(struct.g_e_energy) && CollectionUtils.isNotEmpty(struct.g_e_efficiency) && CollectionUtils.isNotEmpty(struct.g_e_uncertainty) && Objects.nonNull(struct.g_e_record_count)) {
|
||||
GEfficiencyBlock gEfficiencyBlock = new GEfficiencyBlock();
|
||||
gEfficiencyBlock.setG_energy(struct.g_e_energy);
|
||||
gEfficiencyBlock.setEfficiency(struct.g_e_efficiency);
|
||||
gEfficiencyBlock.setUncertainty(struct.g_e_uncertainty);
|
||||
gEfficiencyBlock.setRecord_count(struct.g_e_record_count);
|
||||
selfStationData.getMapEffiKD().put(CalName.CalPHD.getType(), gEfficiencyBlock);
|
||||
//计算得到公式的参数
|
||||
List<Double> calEnergyParam = CalValuesHandler.calFitPara("Cal_Efficiency", 1, struct.g_e_energy, struct.g_e_efficiency, struct.g_e_uncertainty);
|
||||
ParameterInfo parameterInfo = new ParameterInfo();
|
||||
parameterInfo.setP(calEnergyParam);
|
||||
selfStationData.getMapEffiPara().put(CalName.CalPHD.getType(), parameterInfo);
|
||||
}
|
||||
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件路径,类型获取对应的解析文件内容并返回进行存储
|
||||
* @param filePathName
|
||||
* @param type
|
||||
* @param selfStationData
|
||||
* @return
|
||||
*/
|
||||
public EnergySpectrumStruct getSourceData(String filePathName, String type, SelfStationData selfStationData) {
|
||||
EnergySpectrumStruct struct = null;
|
||||
File file = null;
|
||||
try {
|
||||
//根据完整的文件路径 获取临时文件
|
||||
file = ftpUtil.downloadFile(filePathName, "betaGamma");
|
||||
if (Objects.nonNull(file)) {
|
||||
if (type.equalsIgnoreCase("sample")) {
|
||||
selfStationData.setSampleTmpPath(file.getAbsolutePath());
|
||||
} else if (type.equalsIgnoreCase("det")) {
|
||||
selfStationData.setDetTmpPath(file.getAbsolutePath());
|
||||
}
|
||||
//解析文件内容
|
||||
struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return struct;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计道值范围内数量
|
||||
* @param startChannel 起始道值
|
||||
* @param endChannel 结束道值
|
||||
* @param num 第几个范围
|
||||
* @param selfStationData 自建台站对象
|
||||
*/
|
||||
public void statisticsROIList(Integer startChannel, Integer endChannel, Integer num, SelfStationData selfStationData) {
|
||||
EnergySpectrumStruct struct = selfStationData.getSampleStruct();
|
||||
//获取总行数信息
|
||||
long betaChannels = struct.b_channels;
|
||||
//获取总列数信息
|
||||
long gammaChannels = struct.g_channels;
|
||||
//获取散点图数量信息
|
||||
List<Long> h_counts = struct.h_counts;
|
||||
//存储同一列不同行加和后的数量
|
||||
List<Integer> sumList = new LinkedList<>();
|
||||
List<SeriseData> seriseDataList = new LinkedList<>();
|
||||
//遍历所有列
|
||||
for (int i=0; i<gammaChannels; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(i);
|
||||
int sum = 0;
|
||||
//根据起始道值和结束道值 获取这一列的所有对应道值的数据
|
||||
for (int j=startChannel; j <= endChannel; j++) {
|
||||
//道值 * 总行数 + 当前列数 获取对应的数据数组下标
|
||||
int index = (int) (j * betaChannels + i);
|
||||
long count = 0;
|
||||
//判断下标是否在h_counts范围内
|
||||
if (index < h_counts.size()) {
|
||||
count = h_counts.get(index);
|
||||
}
|
||||
sum+=count;
|
||||
}
|
||||
seriseData.setY(sum);
|
||||
sumList.add(sum);
|
||||
seriseDataList.add(seriseData);
|
||||
}
|
||||
if (1 == num) {
|
||||
selfStationData.setROIOneList(seriseDataList);
|
||||
selfStationData.setROIOneBetaStart(startChannel);
|
||||
selfStationData.setROIOneBetaStop(endChannel);
|
||||
} else if (2 == num) {
|
||||
selfStationData.setROITwoList(seriseDataList);
|
||||
selfStationData.setROITwoBetaStart(startChannel);
|
||||
selfStationData.setROITwoBetaStop(endChannel);
|
||||
} else if (3 == num) {
|
||||
selfStationData.setROIThreeList(seriseDataList);
|
||||
selfStationData.setROIThreeBetaStart(startChannel);
|
||||
selfStationData.setROIThreeBetaStop(endChannel);
|
||||
} else if (4 == num) {
|
||||
selfStationData.setROIFourList(seriseDataList);
|
||||
selfStationData.setROIFourBetaStart(startChannel);
|
||||
selfStationData.setROIFourBetaStop(endChannel);
|
||||
}
|
||||
}
|
||||
|
||||
public String UpdateEquationEnergy(ParameterInfo m_curParam) {
|
||||
String equation ="";
|
||||
int p_size = m_curParam.getP().size()-1;
|
||||
if(p_size >= 2 && m_curParam.getP().get(2) > 0) {
|
||||
// Polynomial: y=a0+a1*x+a2*x^2+a3*x^3
|
||||
equation +="Energy = "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(1)))+" + C * "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(2)));
|
||||
for(int i=3; i<=p_size; i++) {
|
||||
equation += " + C<sup style=\"vertical-align:super;\">" + (i-1) +"</sup> * "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i)))+"";
|
||||
}
|
||||
} else if(p_size == 1) {
|
||||
equation = "Energy = "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(1)))+" * C";
|
||||
}
|
||||
return equation;
|
||||
}
|
||||
|
||||
public void UpdateChartEnergy(List<Double> m_vCurEnergy, ParameterInfo m_curParam, List<Double> m_vCurCentroid, SelfStationData selfStationData, Double width, Map<String, Object> map) {
|
||||
int num = m_vCurEnergy.size();
|
||||
if(num < 1){
|
||||
return;
|
||||
}
|
||||
List<ChartData> datalist = new LinkedList<>();
|
||||
if(CollectionUtils.isNotEmpty(m_curParam.getP())) {
|
||||
// 拟合曲线
|
||||
ChartData lData = new ChartData();
|
||||
lData.setColor("rgb(255, 255, 0)");
|
||||
lData.setType("Line");
|
||||
|
||||
List<Double> vChan = new LinkedList<>();
|
||||
double MaxChan = Double.valueOf(selfStationData.getSampleStruct().g_channels);
|
||||
double d = 1;
|
||||
double dStep = MaxChan / width * 2;
|
||||
while(d < MaxChan) {
|
||||
vChan.add(d);
|
||||
d+= dStep;
|
||||
}
|
||||
vChan.add(MaxChan);
|
||||
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(vChan, m_curParam.getP()).counts;
|
||||
for(int i=0; i<vChan.size(); i++) {
|
||||
if(vFit.get(i) > 0){
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(vChan.get(i));
|
||||
seriseData.setY(vFit.get(i));
|
||||
lData.getPointlist().add(seriseData);
|
||||
}
|
||||
}
|
||||
if(lData.getPointlist().size() > 1){
|
||||
datalist.add(lData);
|
||||
}
|
||||
}
|
||||
|
||||
// Channel——Energy 点集
|
||||
ChartData pData = new ChartData();
|
||||
pData.setColor("red");
|
||||
pData.setType("Scatter");
|
||||
for(int i=0; i<num; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(m_vCurCentroid.get(i));
|
||||
seriseData.setY(m_vCurEnergy.get(i));
|
||||
pData.getPointlist().add(seriseData);
|
||||
}
|
||||
datalist.add(pData);
|
||||
map.put("AllData", datalist);
|
||||
}
|
||||
|
||||
public String UpdateEquationResolution(ParameterInfo m_curParam) {
|
||||
String equation = "";
|
||||
int p_size = m_curParam.getP().size()-1;
|
||||
if(p_size >= 2 && m_curParam.getP().get(1) > 0 && m_curParam.getP().get(2) > 0) {
|
||||
// Square root of polynomial: y = sqrt(a0+a1*x+a2*x^2+a3*x^3 )
|
||||
equation += "FWHM = ("+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(1)))+" + E * "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(2)));
|
||||
for(int i=3; i<=p_size; i++) {
|
||||
equation += " + E<sup style=\"vertical-align:super;\">"+(i-1)+"</sup> * "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i)));
|
||||
}
|
||||
equation += ")<sup style=\"vertical-align:super;\">"+1+"/"+2+"</sup>";
|
||||
}
|
||||
return equation;
|
||||
}
|
||||
|
||||
public void UpdateChartResolution(List<Double> m_vCurEnergy, ParameterInfo m_curParam, List<Double> m_vCurReso, SelfStationData selfStationData, Double width, Map<String, Object> map) {
|
||||
int num = m_vCurEnergy.size();
|
||||
if(num < 1) return;
|
||||
|
||||
List<ChartData> datalist = new LinkedList<>();
|
||||
if(CollectionUtils.isNotEmpty(m_curParam.getP())) {
|
||||
// 拟合曲线
|
||||
ChartData lData = new ChartData();
|
||||
lData.setColor("rgb(255, 255, 0)");
|
||||
lData.setType("Line");
|
||||
|
||||
List<Double> vChan = new LinkedList<>();
|
||||
vChan.add(1.0);
|
||||
vChan.add(Double.valueOf(selfStationData.getSampleStruct().g_channels));
|
||||
|
||||
List<Double> vEner = CalValuesHandler.calFcnEval(vChan, selfStationData.getUsedEnerPara().getP()).counts;
|
||||
double d = vEner.get(0), maxE = vEner.get(1);
|
||||
double dStep = maxE / width * 2;
|
||||
|
||||
vEner.remove(vEner.size()-1);
|
||||
while(d < maxE) {
|
||||
vEner.add(d);
|
||||
d += dStep;
|
||||
}
|
||||
vEner.add(maxE);
|
||||
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(vEner, m_curParam.getP()).counts;
|
||||
for(int i=0; i<vEner.size(); i++) {
|
||||
if(vFit.get(i) > 0){
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(vEner.get(i));
|
||||
seriseData.setY(vFit.get(i));
|
||||
lData.getPointlist().add(seriseData);
|
||||
}
|
||||
}
|
||||
if(lData.getPointlist().size() > 1){
|
||||
datalist.add(lData);
|
||||
}
|
||||
}
|
||||
|
||||
// Channel——Energy 点集
|
||||
ChartData pData = new ChartData();
|
||||
pData.setColor("red");
|
||||
pData.setType("Scatter");
|
||||
for(int i=0; i<num; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(m_vCurEnergy.get(i));
|
||||
seriseData.setY(m_vCurReso.get(i));
|
||||
pData.getPointlist().add(seriseData);
|
||||
}
|
||||
datalist.add(pData);
|
||||
map.put("AllData", datalist);
|
||||
}
|
||||
|
||||
public String UpdateEquationEfficiency(List<Double> m_vCurEnergy, ParameterInfo m_curParam, Integer curRow, Integer funId) {
|
||||
String equation = "";
|
||||
if(m_curParam.getP().size() > 2) {
|
||||
int p_size = m_curParam.getP().size()-1;
|
||||
int e_size = m_vCurEnergy.size();
|
||||
if (Objects.isNull(funId)) {
|
||||
funId = m_curParam.getP().get(0).intValue();
|
||||
}
|
||||
switch(funId) {
|
||||
case 1: // Interpolation: y=yi+(y(i+1)-yi)*(x-xi)/(x(i+1)-xi) for xi<=x<x(i+1)
|
||||
if(p_size == 2 * e_size && p_size >= 4) {
|
||||
int i = curRow;
|
||||
if(i < 0 || i >= e_size) break;
|
||||
|
||||
double y1, y0, x1, x0;
|
||||
if(i < e_size - 1)
|
||||
{
|
||||
y1 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i*2+3))));
|
||||
y0 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i*2+1))));
|
||||
x1 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i*2+2))));
|
||||
x0 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i*2))));
|
||||
} else {
|
||||
y1 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i*2+1))));
|
||||
y0 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i*2-1))));
|
||||
x1 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i*2))));
|
||||
x0 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i*2-2))));
|
||||
}
|
||||
equation += "Efficiency = "+y0+" + ("+y1+"-"+y0+") * (E - "+x0+") / ("+x1+" - "+x0+")";
|
||||
}
|
||||
break;
|
||||
case 5: // HT Efficiency: y = A*exp(-(E1/x)^k)*(1-exp(-(E2/x)^n))
|
||||
if(p_size == 5) {
|
||||
for(int i=1; i<=p_size; i++) {
|
||||
if(m_curParam.getP().get(i) <= 0) break;
|
||||
}
|
||||
equation += "Efficiency = "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(1)))+" * exp(-("+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(2)))+" / E)<sup style=\"vertical-align:super;\">"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(3)))+"</sup>) * "+
|
||||
"(1-exp(-("+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(4)))+" / E)<sup style=\"vertical-align:super;\">"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(5)))+"</sup>))";
|
||||
}
|
||||
break;
|
||||
case 6: // Polynomial in log(y) against log(x): log(y) = a0 + a1*log(x) +a2*log(x)^2+ a3*log(x)^3
|
||||
if(p_size >= 2) {
|
||||
equation += "log(Efficiency) = "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(1)))+" + "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(2)))+" * log(E)";
|
||||
for(int i=3; i<=p_size; i++) {
|
||||
equation += " + "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i)))+" * log(E)<sup style=\"vertical-align:super;\">"+(i-1)+"</sup>";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8: // Polynomial in log(y) against log(1/x): log(y) = a0 + a1*log(c/x) + a2*log(c/x)^2 + a3*log(c/x)^3 + a4*log(c/x)^4
|
||||
if(p_size >= 3) {
|
||||
equation += "log(Efficiency) = "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(1)))+" + "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(2)))+" * log(C/E)";
|
||||
for(int i=3; i<=p_size; i++) {
|
||||
equation += " + "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i)))+" * log(C/E)<sup style=\"vertical-align:super;\">"+(i-1)+"</sup>";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 93: // HAE Efficiency (1-3): y=S*exp(-(E1/x)^k)*(1- exp(-(2*E3/(x-E3))^n))
|
||||
if(p_size == 5) {
|
||||
equation += "Efficiency = "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(1)))+" * exp(-("+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(2)))+" / E)<sup style=\"vertical-align:super;\">"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(3)))+"</sup>) * "+
|
||||
"(1 - exp(-(2 * "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(4)))+" / (E - "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(4)))+"))<sup style=\"vertical-align:super;\">"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(5)))+"</sup>))";
|
||||
}
|
||||
break;
|
||||
case 94: // HAE Efficiency (1-2): y=S*exp(-(E1/x)^k)*(1- exp(-b*(1/(x-E2))^m))
|
||||
if(p_size == 6) {
|
||||
equation += "Efficiency = "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(1)))+" * exp(-("+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(2)))+" / E)<sup style=\"vertical-align:super;\">"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(3)))+"</sup>) * "+
|
||||
"(1 - exp(-"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(4)))+" * (1 / (E - "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(5)))+"))<sup style=\"vertical-align:super;\">"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(6)))+"</sup>))";
|
||||
}
|
||||
break;
|
||||
case 95: // HAE Efficiency (1-2-3): y = S * exp(-(E1/x)^k) * (1- exp(-b*(1/(x-E2))^m)) *(1 - exp(-(2*E3/(E-E3))^n))
|
||||
if(p_size == 8) {
|
||||
equation += "Efficiency = "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(1)))+" * exp(-("+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(2)))+" / E)<sup style=\"vertical-align:super;\">"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(3)))+"</sup>) * "+
|
||||
"(1 - exp(-"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(4)))+" * (1 / (E - "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(5)))+"))<sup style=\"vertical-align:super;\">"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(6)))+"</sup>)) * "+
|
||||
"(1 - exp(-(2 * "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(7)))+" / (E - "+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(7)))+"))<sup style=\"vertical-align:super;\">"+NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(8)))+"</sup>))";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return equation;
|
||||
}
|
||||
|
||||
public void UpdateChartEfficiency(List<Double> m_vCurEnergy, ParameterInfo m_curParam, List<Double> m_vCurEffi, SelfStationData selfStationData, Double width, Map<String, Object> map) {
|
||||
int num = m_vCurEnergy.size();
|
||||
if(num < 1) return;
|
||||
|
||||
List<ChartData> datalist = new LinkedList<>();
|
||||
if(CollectionUtils.isNotEmpty(m_curParam.getP())) {
|
||||
// 拟合曲线
|
||||
ChartData lData = new ChartData();
|
||||
lData.setColor("rgb(255, 255, 0)");
|
||||
lData.setType("Line");
|
||||
|
||||
List<Double> vChan = new LinkedList<>();
|
||||
vChan.add(1.0);
|
||||
vChan.add(Double.valueOf(selfStationData.getSampleStruct().g_channels));
|
||||
|
||||
List<Double> vEner = CalValuesHandler.calFcnEval(vChan, selfStationData.getUsedEnerPara().getP()).counts;
|
||||
double d = vEner.get(0);
|
||||
double maxE = vEner.get(1);
|
||||
double dStep = maxE / width * 2;
|
||||
|
||||
vEner.remove(vEner.size()-1);
|
||||
while(d < maxE) {
|
||||
vEner.add(d);
|
||||
d += dStep;
|
||||
}
|
||||
vEner.add(maxE);
|
||||
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(vEner, m_curParam.getP()).counts;
|
||||
for(int i=0; i<vEner.size(); i++) {
|
||||
if(vFit.get(i) > 0){
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(vEner.get(i));
|
||||
seriseData.setY(vFit.get(i));
|
||||
lData.getPointlist().add(seriseData);
|
||||
}
|
||||
}
|
||||
if(lData.getPointlist().size() > 1){
|
||||
datalist.add(lData);
|
||||
}
|
||||
}
|
||||
|
||||
// Channel——Energy 点集
|
||||
ChartData pData = new ChartData();
|
||||
pData.setColor("red");
|
||||
pData.setType("Scatter");
|
||||
for(int i=0; i<num; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(m_vCurEnergy.get(i));
|
||||
seriseData.setY(m_vCurEffi.get(i));
|
||||
pData.getPointlist().add(seriseData);
|
||||
}
|
||||
datalist.add(pData);
|
||||
map.put("AllData", datalist);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,144 @@
|
|||
package org.jeecg.modules.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.entity.vo.ChangeData;
|
||||
import org.jeecg.modules.service.ISelfStationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("selfStation")
|
||||
@Api(value = "自建台站管理", tags = "自建台站管理")
|
||||
public class SelfStationController {
|
||||
|
||||
@Autowired
|
||||
private ISelfStationService selfStationService;
|
||||
|
||||
@GetMapping("loadFromFile")
|
||||
@ApiOperation(value = "从文件加载自建台站谱数据", notes = "从文件加载自建台站谱数据")
|
||||
public Result loadFromFile(String sampleFileName, String detFileName, HttpServletRequest request) {
|
||||
return selfStationService.loadSelfStationByFile(sampleFileName, detFileName, request);
|
||||
}
|
||||
|
||||
@PostMapping("updateROI")
|
||||
@ApiOperation(value = "更新ROI范围", notes = "更新ROI范围")
|
||||
public Result updateROI(Integer startChannel, Integer endChannel, Integer ROINum, String sampleFileName, HttpServletRequest request) {
|
||||
return selfStationService.updateROI(startChannel, endChannel, ROINum, sampleFileName, request);
|
||||
}
|
||||
|
||||
@GetMapping("energyCalibration")
|
||||
@ApiOperation(value = "查看Energy Calibration数据", notes = "查看Energy Calibration数据")
|
||||
public Result energyCalibration(String fileName, String currentText, Double width, HttpServletRequest request) {
|
||||
return selfStationService.energyCalibration(fileName, currentText, width, request);
|
||||
}
|
||||
|
||||
@PostMapping("changeDataEnergy")
|
||||
@ApiOperation(value = "修改Energy Calibration数据", notes = "修改Energy Calibration数据")
|
||||
public Result changeDataEnergy(@RequestBody ChangeData changeData, HttpServletRequest request) {
|
||||
return selfStationService.changeDataEnergy(changeData.getM_vCurCentroid(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getSampleId(), changeData.getFileName(), changeData.getWidth(), request);
|
||||
}
|
||||
|
||||
@PostMapping("applyDataEnergy")
|
||||
@ApiOperation(value = "Apply Energy Calibration数据", notes = "Apply Energy Calibration数据")
|
||||
public Result applyDataEnergy(@RequestBody ChangeData changeData, HttpServletRequest request) {
|
||||
return selfStationService.applyDataEnergy(changeData.getM_vCurCentroid(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getCurCalName(), changeData.getSampleId(), changeData.getFileName(), request);
|
||||
}
|
||||
|
||||
@PostMapping("saveDataEnergy")
|
||||
@ApiOperation(value = "保存Energy Calibration数据", notes = "保存Energy Calibration数据")
|
||||
public void saveDataEnergy(@RequestBody ChangeData changeData, HttpServletResponse response) {
|
||||
selfStationService.saveDataEnergy(changeData.getM_vCurCentroid(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), response);
|
||||
}
|
||||
|
||||
@PostMapping("callDataEnergy")
|
||||
@ApiOperation(value = "导入Energy Calibration数据", notes = "导入Energy Calibration数据")
|
||||
public Result callDataEnergy(MultipartFile file, String sampleFileName, Double width, String currentText, HttpServletRequest request) {
|
||||
return selfStationService.callDataEnergy(file, sampleFileName, width, currentText, request);
|
||||
}
|
||||
|
||||
@PutMapping("setCurrentEnergy")
|
||||
@ApiOperation(value = "Energy Calibration页面set to current按钮", notes = "Energy Calibration页面set to current按钮")
|
||||
public Result setCurrentEnergy(String fileName, String currentName, HttpServletRequest request) {
|
||||
return selfStationService.setCurrentEnergy(fileName, currentName, request);
|
||||
}
|
||||
|
||||
@GetMapping("resolutionCalibration")
|
||||
@ApiOperation(value = "查看Resolution Calibration数据", notes = "查看Resolution Calibration数据")
|
||||
public Result resolutionCalibration(String fileName, String currentText, Double width, HttpServletRequest request) {
|
||||
return selfStationService.resolutionCalibration(fileName, currentText, width, request);
|
||||
}
|
||||
|
||||
@PostMapping("changeDataResolution")
|
||||
@ApiOperation(value = "修改Resolution Calibration数据", notes = "修改Resolution Calibration数据")
|
||||
public Result changeDataResolution(@RequestBody ChangeData changeData, HttpServletRequest request) {
|
||||
return selfStationService.changeDataResolution(changeData.getM_vCurReso(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getSampleId(), changeData.getFileName(), changeData.getWidth(), request);
|
||||
}
|
||||
|
||||
@PostMapping("applyDataResolution")
|
||||
@ApiOperation(value = "Apply Resolution Calibration数据", notes = "Apply Resolution Calibration数据")
|
||||
public Result applyDataResolution(@RequestBody ChangeData changeData, HttpServletRequest request) {
|
||||
return selfStationService.applyDataResolution(changeData.getM_vCurReso(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getCurCalName(), changeData.getSampleId(), changeData.getFileName(), request);
|
||||
}
|
||||
|
||||
@PostMapping("saveDataResolution")
|
||||
@ApiOperation(value = "保存Resolution Calibration数据", notes = "保存Resolution Calibration数据")
|
||||
public void saveDataResolution(@RequestBody ChangeData changeData, HttpServletResponse response) {
|
||||
selfStationService.saveDataResolution(changeData.getM_vCurReso(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), response);
|
||||
}
|
||||
|
||||
@PostMapping("callDataResolution")
|
||||
@ApiOperation(value = "导入Resolution Calibration数据", notes = "导入Resolution Calibration数据")
|
||||
public Result callDataResolution(MultipartFile file, String sampleFileName, Double width, String currentText, HttpServletRequest request) {
|
||||
return selfStationService.callDataResolution(file, sampleFileName, width, currentText, request);
|
||||
}
|
||||
|
||||
@PutMapping("setCurrentResolution")
|
||||
@ApiOperation(value = "Resolution Calibration页面set to current按钮", notes = "Resolution Calibration页面set to current按钮")
|
||||
public Result setCurrentResolution(String fileName, String currentName, HttpServletRequest request) {
|
||||
return selfStationService.setCurrentResolution(fileName, currentName, request);
|
||||
}
|
||||
|
||||
@GetMapping("EfficiencyCalibration")
|
||||
@ApiOperation(value = "查看Efficiency Calibration数据", notes = "查看Efficiency Calibration数据")
|
||||
public Result EfficiencyCalibration(String fileName, String currentText, Double width, HttpServletRequest request) {
|
||||
return selfStationService.EfficiencyCalibration(fileName, currentText, width, request);
|
||||
}
|
||||
|
||||
@PostMapping("changeDataEfficiency")
|
||||
@ApiOperation(value = "修改Efficiency Calibration数据", notes = "修改Efficiency Calibration数据")
|
||||
public Result changeDataEfficiency(@RequestBody ChangeData changeData, HttpServletRequest request) {
|
||||
return selfStationService.changeDataEfficiency(changeData.getM_vCurEffi(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getFuncId(), changeData.getSampleId(), changeData.getFileName(), changeData.getWidth(), changeData.getCurRow(), request);
|
||||
}
|
||||
|
||||
@PostMapping("applyDataEfficiency")
|
||||
@ApiOperation(value = "Apply Efficiency Calibration数据", notes = "Apply Efficiency Calibration数据")
|
||||
public Result applyDataEfficiency(@RequestBody ChangeData changeData, HttpServletRequest request) {
|
||||
return selfStationService.applyDataEfficiency(changeData.getM_vCurEffi(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getCurCalName(), changeData.getSampleId(), changeData.getFileName(), request);
|
||||
}
|
||||
|
||||
@PostMapping("saveDataEfficiency")
|
||||
@ApiOperation(value = "保存Efficiency Calibration数据", notes = "保存Efficiency Calibration数据")
|
||||
public void saveDataEfficiency(@RequestBody ChangeData changeData, HttpServletResponse response) {
|
||||
selfStationService.saveDataEfficiency(changeData.getM_vCurEffi(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getFuncId(), response);
|
||||
}
|
||||
|
||||
@PostMapping("callDataEfficiency")
|
||||
@ApiOperation(value = "导入Efficiency Calibration数据", notes = "导入Efficiency Calibration数据")
|
||||
public Result callDataEfficiency(MultipartFile file, String sampleFileName, Double width, String currentText, HttpServletRequest request) {
|
||||
return selfStationService.callDataEfficiency(file, sampleFileName, width, currentText, request);
|
||||
}
|
||||
|
||||
@PutMapping("setCurrentEfficiency")
|
||||
@ApiOperation(value = "Efficiency Calibration页面set to current按钮", notes = "Efficiency Calibration页面set to current按钮")
|
||||
public Result setCurrentEfficiency(String fileName, String currentName, HttpServletRequest request) {
|
||||
return selfStationService.setCurrentEfficiency(fileName, currentName, request);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
package org.jeecg.modules.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class SelfStationData implements Serializable {
|
||||
|
||||
/**
|
||||
* sample临时文件路径
|
||||
*/
|
||||
private String sampleTmpPath;
|
||||
|
||||
/**
|
||||
* det临时文件路径
|
||||
*/
|
||||
private String detTmpPath;
|
||||
|
||||
/**
|
||||
* sample文件分析内容
|
||||
*/
|
||||
private EnergySpectrumStruct sampleStruct;
|
||||
|
||||
/**
|
||||
* det文件分析内容
|
||||
*/
|
||||
private EnergySpectrumStruct detStruct;
|
||||
|
||||
/**
|
||||
* 存储公式的数组
|
||||
*/
|
||||
private List<Double> calParam;
|
||||
|
||||
/**
|
||||
* ROI-1结果数据
|
||||
*/
|
||||
//折线图横纵坐标数组
|
||||
private List<SeriseData> ROIOneList;
|
||||
//ROI-1范围矩形框起始道值
|
||||
private Integer ROIOneBetaStart;
|
||||
//ROI-1范围矩形框终止道值
|
||||
private Integer ROIOneBetaStop;
|
||||
|
||||
/**
|
||||
* ROI-2结果数据
|
||||
*/
|
||||
//折线图横纵坐标数组
|
||||
private List<SeriseData> ROITwoList;
|
||||
//ROI-2范围矩形框起始道值
|
||||
private Integer ROITwoBetaStart;
|
||||
//ROI-2范围矩形框终止道值
|
||||
private Integer ROITwoBetaStop;
|
||||
|
||||
/**
|
||||
* ROI-3结果数据
|
||||
*/
|
||||
//折线图横纵坐标数组
|
||||
private List<SeriseData> ROIThreeList;
|
||||
//ROI-3范围矩形框起始道值
|
||||
private Integer ROIThreeBetaStart;
|
||||
//ROI-3范围矩形框终止道值
|
||||
private Integer ROIThreeBetaStop;
|
||||
|
||||
/**
|
||||
* ROI-4结果数据
|
||||
*/
|
||||
//折线图横纵坐标数组
|
||||
private List<SeriseData> ROIFourList;
|
||||
//ROI-4范围矩形框起始道值
|
||||
private Integer ROIFourBetaStart;
|
||||
//ROI-4范围矩形框终止道值
|
||||
private Integer ROIFourBetaStop;
|
||||
|
||||
// 当前修改的刻度名称
|
||||
private String newEner;
|
||||
|
||||
private String newReso;
|
||||
|
||||
private String newEffi;
|
||||
|
||||
/**
|
||||
* 使用中的能量参数对应的刻度名称
|
||||
*/
|
||||
private String usedEner;
|
||||
|
||||
private String usedReso;
|
||||
|
||||
private String usedEffi;
|
||||
|
||||
// 当前寻峰结果所用的刻度数据
|
||||
private GEnergyBlock usedEnerKD;
|
||||
|
||||
private GResolutionBlock usedResoKD;
|
||||
|
||||
private GEfficiencyBlock usedEffiKD;
|
||||
|
||||
// 存储所有的刻度数据
|
||||
private Map<String, GEnergyBlock> mapEnerKD; // 能量刻度
|
||||
|
||||
private Map<String, GResolutionBlock> mapResoKD; // 分辨率刻度
|
||||
|
||||
private Map<String, GEfficiencyBlock> mapEffiKD; // 效率刻度
|
||||
|
||||
// 当前寻峰结果所用的刻度参数
|
||||
private ParameterInfo usedEnerPara;
|
||||
|
||||
private ParameterInfo usedResoPara;
|
||||
|
||||
private ParameterInfo usedEffiPara;
|
||||
|
||||
// 存储所有的刻度参数
|
||||
private Map<String, ParameterInfo> mapEnerPara;
|
||||
|
||||
private Map<String, ParameterInfo> mapResoPara;
|
||||
|
||||
private Map<String, ParameterInfo> mapEffiPara;
|
||||
|
||||
public SelfStationData() {
|
||||
newEner = "PHD";
|
||||
newReso = "PHD";
|
||||
newEffi = "PHD";
|
||||
usedEner= "";
|
||||
usedReso= "";
|
||||
usedEffi= "";
|
||||
mapEnerKD = new HashMap<>();
|
||||
mapResoKD = new HashMap<>();
|
||||
mapEffiKD = new HashMap<>();
|
||||
usedEnerPara = new ParameterInfo();
|
||||
usedResoPara = new ParameterInfo();
|
||||
usedEffiPara = new ParameterInfo();
|
||||
mapEnerPara = new HashMap<>();
|
||||
mapResoPara = new HashMap<>();
|
||||
mapEffiPara = new HashMap<>();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package org.jeecg.modules.service;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.entity.vo.ParameterInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
public interface ISelfStationService {
|
||||
|
||||
Result loadSelfStationByFile(String sampleFileName, String detFileName, HttpServletRequest request);
|
||||
|
||||
Result updateROI(Integer startChannel, Integer endChannel, Integer ROINum, String sampleFileName, HttpServletRequest request);
|
||||
|
||||
Result energyCalibration(String fileName, String currentText, Double width, HttpServletRequest request);
|
||||
|
||||
Result changeDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width, HttpServletRequest request);
|
||||
|
||||
Result applyDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName, HttpServletRequest request);
|
||||
|
||||
void saveDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, HttpServletResponse response);
|
||||
|
||||
Result callDataEnergy(MultipartFile file, String sampleFileName, Double width, String currentText, HttpServletRequest request);
|
||||
|
||||
Result setCurrentEnergy(String fileName, String currentName, HttpServletRequest request);
|
||||
|
||||
Result resolutionCalibration(String fileName, String currentText, Double width, HttpServletRequest request);
|
||||
|
||||
Result changeDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width, HttpServletRequest request);
|
||||
|
||||
Result applyDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName, HttpServletRequest request);
|
||||
|
||||
void saveDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, HttpServletResponse response);
|
||||
|
||||
Result callDataResolution(MultipartFile file, String sampleFileName, Double width, String currentText, HttpServletRequest request);
|
||||
|
||||
Result setCurrentResolution(String fileName, String currentName, HttpServletRequest request);
|
||||
|
||||
Result EfficiencyCalibration(String fileName, String currentText, Double width, HttpServletRequest request);
|
||||
|
||||
Result changeDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer funcId, Integer sampleId, String fileName, Double width, Integer curRow, HttpServletRequest request);
|
||||
|
||||
Result applyDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName, HttpServletRequest request);
|
||||
|
||||
void saveDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, Integer funId, HttpServletResponse response);
|
||||
|
||||
Result callDataEfficiency(MultipartFile file, String sampleFileName, Double width, String currentText, HttpServletRequest request);
|
||||
|
||||
Result setCurrentEfficiency(String fileName, String currentName, HttpServletRequest request);
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -3,6 +3,7 @@ package org.jeecg;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.cache.BetaCache;
|
||||
import org.jeecg.common.cache.LocalCache;
|
||||
import org.jeecg.common.cache.SelfCache;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.service.IDataService;
|
||||
import org.jeecg.modules.service.IGammaService;
|
||||
|
@ -32,6 +33,8 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
|
|||
@Autowired
|
||||
private BetaCache betaCache;
|
||||
@Autowired
|
||||
private SelfCache selfCache;
|
||||
@Autowired
|
||||
private IGammaService gammaService;
|
||||
@Autowired
|
||||
private IGardsNuclCoincidenceSumSpectrumService nuclCoincidenceSumSpectrumService;
|
||||
|
@ -71,6 +74,7 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
|
|||
//创建缓存
|
||||
betaCache.initCache();
|
||||
localCache.initCache();
|
||||
selfCache.initCache();
|
||||
gammaService.readMDCParameter();
|
||||
nuclIdedSpectrumService.getNuclideMap();
|
||||
nuclCoincidenceSumSpectrumService.getNuclCoincidenceMap();
|
||||
|
|
Loading…
Reference in New Issue
Block a user