fix:1。增加qc文件;2.增加交互分析(gamma)

This commit is contained in:
xiaoguangbin 2024-07-17 09:53:43 +08:00
parent 9bbdd5eb5d
commit 03d92b7889
7 changed files with 191 additions and 65 deletions

View File

@ -40,6 +40,10 @@ public class SelfStationUtil extends AbstractLogOrReport {
struct = selfStationData.getSampleStruct(); struct = selfStationData.getSampleStruct();
} else if (systemType.equals("det")) { } else if (systemType.equals("det")) {
struct = selfStationData.getDetStruct(); struct = selfStationData.getDetStruct();
} else if (systemType.equals("qc")) {
struct = selfStationData.getQcStruct();
} else {
return;
} }
//存储页面操作数据 //存储页面操作数据
SelfStationVueData selfStationVueData = new SelfStationVueData(); SelfStationVueData selfStationVueData = new SelfStationVueData();
@ -143,6 +147,7 @@ public class SelfStationUtil extends AbstractLogOrReport {
selfStationData.getDetVueData().setROIOneBetaStart(startChannel); selfStationData.getDetVueData().setROIOneBetaStart(startChannel);
selfStationData.getDetVueData().setROIOneBetaStop(endChannel); selfStationData.getDetVueData().setROIOneBetaStop(endChannel);
selfStationData.getDetVueData().setROIOneList(seriseDataList); selfStationData.getDetVueData().setROIOneList(seriseDataList);
selfStationData.getSampleVueData().setROIOneCounts((List<Long>)oneMap.get("counts"));
} }
map.put("ROIOneStart", roiBBoundaryStart.get(0)); map.put("ROIOneStart", roiBBoundaryStart.get(0));
map.put("ROIOneStop", roiBBoundaryStop.get(0)); map.put("ROIOneStop", roiBBoundaryStop.get(0));
@ -158,10 +163,12 @@ public class SelfStationUtil extends AbstractLogOrReport {
selfStationData.getSampleVueData().setROITwoBetaStart(startChannel); selfStationData.getSampleVueData().setROITwoBetaStart(startChannel);
selfStationData.getSampleVueData().setROITwoBetaStop(endChannel); selfStationData.getSampleVueData().setROITwoBetaStop(endChannel);
selfStationData.getSampleVueData().setROITwoList(seriseDataList); selfStationData.getSampleVueData().setROITwoList(seriseDataList);
selfStationData.getSampleVueData().setROITwoCounts((List<Long>)twoMap.get("counts"));
} else if (systemType.equals("det")) { } else if (systemType.equals("det")) {
selfStationData.getDetVueData().setROITwoBetaStart(startChannel); selfStationData.getDetVueData().setROITwoBetaStart(startChannel);
selfStationData.getDetVueData().setROITwoBetaStop(endChannel); selfStationData.getDetVueData().setROITwoBetaStop(endChannel);
selfStationData.getDetVueData().setROITwoList(seriseDataList); selfStationData.getDetVueData().setROITwoList(seriseDataList);
selfStationData.getSampleVueData().setROITwoCounts((List<Long>)twoMap.get("counts"));
} }
map.put("ROITwoStart", roiBBoundaryStart.get(1)); map.put("ROITwoStart", roiBBoundaryStart.get(1));
map.put("ROITwoStop", roiBBoundaryStop.get(1)); map.put("ROITwoStop", roiBBoundaryStop.get(1));
@ -177,11 +184,12 @@ public class SelfStationUtil extends AbstractLogOrReport {
selfStationData.getSampleVueData().setROIThreeBetaStart(startChannel); selfStationData.getSampleVueData().setROIThreeBetaStart(startChannel);
selfStationData.getSampleVueData().setROIThreeBetaStop(endChannel); selfStationData.getSampleVueData().setROIThreeBetaStop(endChannel);
selfStationData.getSampleVueData().setROIThreeList(seriseDataList); selfStationData.getSampleVueData().setROIThreeList(seriseDataList);
selfStationData.getSampleVueData().setROIThreeCounts((List<Long>)threeMap.get("counts"));
} else if (systemType.equals("det")) { } else if (systemType.equals("det")) {
selfStationData.getDetVueData().setROIThreeBetaStart(startChannel); selfStationData.getDetVueData().setROIThreeBetaStart(startChannel);
selfStationData.getDetVueData().setROIThreeBetaStop(endChannel); selfStationData.getDetVueData().setROIThreeBetaStop(endChannel);
selfStationData.getDetVueData().setROIThreeList(seriseDataList); selfStationData.getDetVueData().setROIThreeList(seriseDataList);
selfStationData.getSampleVueData().setROIOneCounts((List<Long>)threeMap.get("counts")); selfStationData.getSampleVueData().setROIThreeCounts((List<Long>)threeMap.get("counts"));
} }
map.put("ROIThreeStart", roiBBoundaryStart.get(2)); map.put("ROIThreeStart", roiBBoundaryStart.get(2));
map.put("ROIThreeStop", roiBBoundaryStop.get(2)); map.put("ROIThreeStop", roiBBoundaryStop.get(2));
@ -197,10 +205,12 @@ public class SelfStationUtil extends AbstractLogOrReport {
selfStationData.getSampleVueData().setROIFourBetaStart(startChannel); selfStationData.getSampleVueData().setROIFourBetaStart(startChannel);
selfStationData.getSampleVueData().setROIFourBetaStop(endChannel); selfStationData.getSampleVueData().setROIFourBetaStop(endChannel);
selfStationData.getSampleVueData().setROIFourList(seriseDataList); selfStationData.getSampleVueData().setROIFourList(seriseDataList);
selfStationData.getSampleVueData().setROIFourCounts((List<Long>)fourMap.get("counts"));
} else if (systemType.equals("det")) { } else if (systemType.equals("det")) {
selfStationData.getDetVueData().setROIFourBetaStart(startChannel); selfStationData.getDetVueData().setROIFourBetaStart(startChannel);
selfStationData.getDetVueData().setROIFourBetaStop(endChannel); selfStationData.getDetVueData().setROIFourBetaStop(endChannel);
selfStationData.getDetVueData().setROIFourList(seriseDataList); selfStationData.getDetVueData().setROIFourList(seriseDataList);
selfStationData.getSampleVueData().setROIFourCounts((List<Long>)fourMap.get("counts"));
} }
map.put("ROIFourStart", roiBBoundaryStart.get(3)); map.put("ROIFourStart", roiBBoundaryStart.get(3));
map.put("ROIFourStop", roiBBoundaryStop.get(3)); map.put("ROIFourStop", roiBBoundaryStop.get(3));
@ -472,7 +482,8 @@ public class SelfStationUtil extends AbstractLogOrReport {
return equation; return equation;
} }
public void UpdateChartResolution(List<Double> m_vCurEnergy, ParameterInfo m_curParam, List<Double> m_vCurReso, SelfStationData selfStationData, Double width, Map<String, Object> map) { 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(); int num = m_vCurEnergy.size();
if(num < 1) return; if(num < 1) return;

View File

@ -22,8 +22,9 @@ public class SelfStationController {
@GetMapping("initValue") @GetMapping("initValue")
@ApiOperation(value = "预加载谱文件数据", notes = "预加载谱文件数据") @ApiOperation(value = "预加载谱文件数据", notes = "预加载谱文件数据")
public void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName, HttpServletRequest request) { public void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName,
selfStationService.initValue(dbName, sampleId, analyst, sampleFileName, detFileName, request); String qcFileName, HttpServletRequest request) {
selfStationService.initValue(dbName, sampleId, analyst, sampleFileName, detFileName,qcFileName, request);
} }
@GetMapping("loadFromDB") @GetMapping("loadFromDB")
@ -34,8 +35,8 @@ public class SelfStationController {
@GetMapping("loadFromFile") @GetMapping("loadFromFile")
@ApiOperation(value = "从文件加载自建台站谱数据", notes = "从文件加载自建台站谱数据") @ApiOperation(value = "从文件加载自建台站谱数据", notes = "从文件加载自建台站谱数据")
public Result loadFromFile(String sampleFileName, String detFileName, HttpServletRequest request) { public Result loadFromFile(String sampleFileName, String detFileName, String qcFileName, HttpServletRequest request) {
return selfStationService.loadSelfStationByFile(sampleFileName, detFileName, request); return selfStationService.loadSelfStationByFile(sampleFileName, detFileName, qcFileName, request);
} }
@DeleteMapping("deleteSelfStationCache") @DeleteMapping("deleteSelfStationCache")

View File

@ -4,9 +4,8 @@ import lombok.Data;
import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map;
@Data @Data
public class SelfStationData implements Serializable { public class SelfStationData implements Serializable {
@ -21,6 +20,11 @@ public class SelfStationData implements Serializable {
*/ */
private String detTmpPath; private String detTmpPath;
/**
* qc临时文件路径
*/
private String qcTmpPath;
/** /**
* sample文件分析内容 * sample文件分析内容
*/ */
@ -112,6 +116,31 @@ public class SelfStationData implements Serializable {
public SelfStationData() { public SelfStationData() {
sampleVueData = new SelfStationVueData(); sampleVueData = new SelfStationVueData();
detVueData = new SelfStationVueData(); detVueData = new SelfStationVueData();
betaList = new LinkedList<>();
betaFittingPara = new LinkedList<>();
betaFittingParaToUi = new LinkedList<>();
gammaList = new LinkedList<>();
gammaFittingPara = new LinkedList<>();
gammaFittingParaToUi = new LinkedList<>();
betaListNow = new LinkedList<>();
betaFittingParaNow = new LinkedList<>();
betaFittingParaToUiNow = new LinkedList<>();
gammaListNow = new LinkedList<>();
gammaFittingParaNow = new LinkedList<>();
gammaFittingParaToUiNow = new LinkedList<>();
bGammaEnergyValidSample = false;
bBetaEnergyValidSample = false;
bGammaEnergyValidGas = false;
bBetaEnergyValidGas = false;
bGammaEnergyValidDet = false;
bBetaEnergyValidDet = false;
gammaNewEnergyListNow = new LinkedList<>();
betaNewEnergyListNow = new LinkedList<>();
} }
} }

View File

@ -13,24 +13,44 @@ public class SelfStationVueData implements Serializable {
/** /**
* ROI-1结果数据 * ROI-1结果数据
*/ */
//折线图横纵坐标数组 /**
* 折线图横纵坐标数组
*/
private List<SeriseData> ROIOneList; private List<SeriseData> ROIOneList;
private List<Long> ROIOneCounts; private List<Long> ROIOneCounts;
//ROI-1范围矩形框起始道值 /**
* ROI-1范围矩形框起始道值
*/
private Integer ROIOneBetaStart; private Integer ROIOneBetaStart;
//ROI-1范围矩形框终止道值 /**
* ROI-1范围矩形框终止道值
*/
private Integer ROIOneBetaStop; private Integer ROIOneBetaStop;
/**
* ROI-1 GammaPHD数据
*/
private PHDFile ROIOnePHDFile;
/** /**
* ROI-2结果数据 * ROI-2结果数据
*/ */
//折线图横纵坐标数组 /**
* 折线图横纵坐标数组
*/
private List<SeriseData> ROITwoList; private List<SeriseData> ROITwoList;
private List<Long> ROITwoCounts; private List<Long> ROITwoCounts;
//ROI-2范围矩形框起始道值 /**
* ROI-2范围矩形框起始道值
*/
private Integer ROITwoBetaStart; private Integer ROITwoBetaStart;
//ROI-2范围矩形框终止道值 /**
* ROI-2范围矩形框终止道值
*/
private Integer ROITwoBetaStop; private Integer ROITwoBetaStop;
/**
* ROI-2 GammaPHD数据
*/
private PHDFile ROITwoPHDFile;
/** /**
* ROI-3结果数据 * ROI-3结果数据
@ -42,6 +62,10 @@ public class SelfStationVueData implements Serializable {
private Integer ROIThreeBetaStart; private Integer ROIThreeBetaStart;
//ROI-3范围矩形框终止道值 //ROI-3范围矩形框终止道值
private Integer ROIThreeBetaStop; private Integer ROIThreeBetaStop;
/**
* ROI-3 GammaPHD数据
*/
private PHDFile ROIThreePHDFile;
/** /**
* ROI-4结果数据 * ROI-4结果数据
@ -53,6 +77,10 @@ public class SelfStationVueData implements Serializable {
private Integer ROIFourBetaStart; private Integer ROIFourBetaStart;
//ROI-4范围矩形框终止道值 //ROI-4范围矩形框终止道值
private Integer ROIFourBetaStop; private Integer ROIFourBetaStop;
/**
* ROI-4 GammaPHD数据
*/
private PHDFile ROIFourPHDFile;
// 当前修改的刻度名称 // 当前修改的刻度名称
private String newEner; private String newEner;

View File

@ -10,11 +10,12 @@ import java.util.List;
public interface ISelfStationService { public interface ISelfStationService {
void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName, HttpServletRequest request); void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName,
String qcFileName, HttpServletRequest request);
Result loadFromDB(String dbName, Integer sampleId, String analyst, HttpServletRequest request); Result loadFromDB(String dbName, Integer sampleId, String analyst, HttpServletRequest request);
Result loadSelfStationByFile(String sampleFileName, String detFileName, HttpServletRequest request); Result loadSelfStationByFile(String sampleFileName, String detFileName, String qcFileName, HttpServletRequest request);
void deleteSelfStationCache(String sampleFileName, HttpServletRequest request); void deleteSelfStationCache(String sampleFileName, HttpServletRequest request);

View File

@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringPool; import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.google.common.cache.Cache; import com.google.common.cache.Cache;
import com.google.common.collect.Maps;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.cache.LocalCache;
import org.jeecg.common.cache.SelfCache; import org.jeecg.common.cache.SelfCache;
import org.jeecg.common.properties.ParameterProperties; import org.jeecg.common.properties.ParameterProperties;
import org.jeecg.common.properties.SpectrumPathProperties; import org.jeecg.common.properties.SpectrumPathProperties;
@ -55,11 +55,12 @@ public class SelfStationServiceImpl implements ISelfStationService {
private SpectrumAnalysisMapper spectrumAnalysisMapper; private SpectrumAnalysisMapper spectrumAnalysisMapper;
@Override @Override
public void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName, HttpServletRequest request) { public void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName,
String qcFileName, HttpServletRequest request) {
if (StringUtils.isNotBlank(dbName) && Objects.nonNull(sampleId)) { if (StringUtils.isNotBlank(dbName) && Objects.nonNull(sampleId)) {
loadFromDB(dbName, sampleId, analyst, request); loadFromDB(dbName, sampleId, analyst, request);
} else { } else {
loadSelfStationByFile(sampleFileName, detFileName, request); loadSelfStationByFile(sampleFileName, detFileName,qcFileName, request);
} }
} }
@ -164,7 +165,8 @@ public class SelfStationServiceImpl implements ISelfStationService {
} }
@Override @Override
public Result loadSelfStationByFile(String sampleFileName, String detFileName, HttpServletRequest request) { public Result loadSelfStationByFile(String sampleFileName, String detFileName, String qcFileName,
HttpServletRequest request) {
Result result = new Result(); Result result = new Result();
Map<String, Map<String, Object>> resultMap = new HashMap<>(); Map<String, Map<String, Object>> resultMap = new HashMap<>();
//获取用户名 //获取用户名
@ -209,6 +211,21 @@ public class SelfStationServiceImpl implements ISelfStationService {
resultMap.put("det", map); resultMap.put("det", map);
} }
} }
//判断qc文件名是否为空
if (StringUtils.isNotBlank(qcFileName)) {
//拼接det文件路径
String qcFilePath = path + StringPool.SLASH + qcFileName;
//返回结果map
Map<String, Object> map = new HashMap<>();
//获取sample分析后的对象
EnergySpectrumStruct struct = selfStationUtil.getSourceData(qcFilePath, "qc", selfStationData);
if (Objects.nonNull(struct)) {
selfStationData.setQcStruct(struct);
selfStationData.setQcTmpPath(qcFilePath);
selfStationUtil.loadFile(selfStationData, null, null, "qc", map);
resultMap.put("qc", map);
}
}
} else { } else {
if (StringUtils.isNotBlank(sampleFileName)) { if (StringUtils.isNotBlank(sampleFileName)) {
//返回结果map //返回结果map
@ -1641,79 +1658,110 @@ public class SelfStationServiceImpl implements ISelfStationService {
// Gamma文件内容转换为PHD实体 // Gamma文件内容转换为PHD实体
PHDFile phd = selfStationUtil.getGammaPHD(gammaTwoName, pathName); PHDFile phdOne = selfStationUtil.getGammaPHD(gammaTwoName, pathName);
PHDFile phdTwo = selfStationUtil.getGammaPHD(gammaTwoName, pathName);
PHDFile phdThree = selfStationUtil.getGammaPHD(gammaTwoName, pathName);
PHDFile phdFour = selfStationUtil.getGammaPHD(gammaTwoName, pathName);
// Cache<String, PHDFile> phdCache = localCache.getPHDCache(); // Cache<String, PHDFile> phdCache = localCache.getPHDCache();
// PHDFile phd = phdCache.getIfPresent(fileName + StringPool.DASH + userName); // PHDFile phd = phdCache.getIfPresent(fileName + StringPool.DASH + userName);
if (Objects.isNull(phd)) { if (Objects.isNull(phdOne)) {
result.error500("Please select the parse file first"); result.error500("Please select the parse file first");
return result; return result;
} }
phd.setUserId(processKey); phdOne.setUserId(processKey);
// 赋值xml文件存放路径 // 赋值xml文件存放路径
phd.setXmlFilePath(parameterProperties.getFilePath()); phdOne.setXmlFilePath(parameterProperties.getFilePath());
// 获取当前角色的颜色配置 // 获取当前角色的颜色配置
Map<String, String> colorMap = sysUserColorService.initColor(userName); Map<String, String> colorMap = sysUserColorService.initColor(userName);
// 分析文件数据 // 分析文件数据
int flag = gammaFileUtil.AnalyseData(phd); int flag = gammaFileUtil.AnalyseData(phdOne);
if (flag == 0) { if (flag == 0) {
String warning = "The spectrum needn't Analyed. Maybe:\n" + String warning = "The spectrum needn't Analyed. Maybe:\n" +
"1. It has already Analyed.\n" + "1. It has already Analyed.\n" +
"2. You didn't change any setting or calibration."; "2. You didn't change any setting or calibration.";
result.error500(warning); result.error500(warning);
} else if (flag == -1) { } else if (flag == -1) {
Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(userName+StringPool.DASH+phd.getHeader().getSystem_type()); Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(userName+StringPool.DASH+phdOne.getHeader().getSystem_type());
//分析时将phd的核素map重置 //分析时将phd的核素map重置
phd.setPhdNuclideMap(nuclideLinesMap); phdOne.setPhdNuclideMap(nuclideLinesMap);
//重新计算核素的活度浓度 //重新计算核素的活度浓度
gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap); gammaFileUtil.NuclidesIdent(phdOne, nuclideLinesMap);
// todo 不要qcflags phdOne.setEfficiencyParam(phdOne.getUsedEffiPara().getP());
// gammaFileUtil.RunQC(phd); phdOne.setEfficiencyEnergy(phdOne.getUsedEffiKD().getG_energy());
phd.setEfficiencyParam(phd.getUsedEffiPara().getP()); phdOne.setEfficiencyCurRow(0);
phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy());
phd.setEfficiencyCurRow(0);
// 重新计算峰值 // 重新计算峰值
Map<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap"); Map<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap");
gammaFileUtil.getNuclideMDCValue(phd, phd.getMdcInfoMap(), nuclideLinesMDCMap); gammaFileUtil.getNuclideMDCValue(phdOne, phdOne.getMdcInfoMap(), nuclideLinesMDCMap);
String warning = "Finish three tasks:\n" + String warning = "Finish three tasks:\n" +
"\t1.Update efficiencies of all peaks;\n" + "\t1.Update efficiencies of all peaks;\n" +
"\t2.Identify nuclides again;\n" + "\t2.Identify nuclides again;\n" +
"\t3.Test QC again."; "\t3.Test QC again.";
result.error500(warning); result.error500(warning);
} else { } else {
Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(userName+StringPool.DASH+phd.getHeader().getSystem_type()); Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(userName+StringPool.DASH+phdOne.getHeader().getSystem_type());
//分析时将phd的核素map重置
phd.setPhdNuclideMap(nuclideLinesMap); try {
//调用分析算法 Map<String, Object> gammaResult = Maps.newHashMap();
boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap); Map<String, Object> map1 = this.gammaAnalyse(phdOne, nuclideLinesMap, colorMap);
if (analyseSpectrum) { Map<String, Object> map2 = this.gammaAnalyse(phdTwo, nuclideLinesMap, colorMap);
// 重新分析各峰值对应的核素信息 Map<String, Object> map3 = this.gammaAnalyse(phdThree, nuclideLinesMap, colorMap);
// gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap); Map<String, Object> map4 = this.gammaAnalyse(phdFour, nuclideLinesMap, colorMap);
phd.setEfficiencyParam(phd.getUsedEffiPara().getP()); gammaResult.put("ROI1", map1);
phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy()); gammaResult.put("ROI2", map2);
phd.setEfficiencyCurRow(0); gammaResult.put("ROI3", map3);
// 重新计算峰值 gammaResult.put("ROI4", map4);
Map<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap"); SelfStationVueData sampleVueData = selfStationData.getSampleVueData();
gammaFileUtil.getNuclideMDCValue(phd, phd.getMdcInfoMap(), nuclideLinesMDCMap); sampleVueData.setUsedEnerKD(phdOne.getUsedEnerKD());
Map<String, Object> map = new HashMap<>(); sampleVueData.setUsedEffiKD(phdOne.getUsedEffiKD());
gammaFileUtil.UpdateChart(phd, map, colorMap); sampleVueData.setUsedResoKD(phdOne.getUsedResoKD());
// 更新 QC Flags 状态 sampleVueData.setMapEnerKD(phdOne.getMapEnerKD());
phd.getQcItems().clear(); sampleVueData.setMapResoKD(phdOne.getMapResoKD());
// List<String> qcstate = gammaFileUtil.Qcstate(phd); sampleVueData.setMapEffiKD(phdOne.getMapEffiKD());
// todo 不要qcflags sampleVueData.setUsedEnerPara(phdOne.getUsedEnerPara());
// map.put("QCFlag", qcstate); sampleVueData.setUsedEffiPara(phdOne.getUsedEffiPara());
map.put("bAnalyed", phd.isBAnalyed()); sampleVueData.setUsedResoPara(phdOne.getUsedResoPara());
map.put("peak", phd.getVPeak()); sampleVueData.setMapEnerPara(phdOne.getMapEnerPara());
map.put("BaseCtrls", phd.getBaseCtrls()); sampleVueData.setMapResoPara(phdOne.getMapResoPara());
// Bar Chart 柱状图 sampleVueData.setMapEffiPara(phdOne.getMapEffiPara());
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
map.put("barChart", differance);
result.setSuccess(true); result.setSuccess(true);
result.setResult(map); result.setResult(gammaResult);
} else { } catch (RuntimeException e) {
result.error500("There is a problem with the current phd file, Analysis failure!"); result.error500(StrUtil.replace(e.getMessage(), "%s", "ROI"));
} }
} }
return result; return result;
} }
private Map<String, Object> gammaAnalyse(PHDFile phd, Map<String, NuclideLines> nuclideLinesMap,
Map<String, String> colorMap) throws RuntimeException{
Map<String, Object> map = new HashMap<>();
//分析时将phd的核素map重置
phd.setPhdNuclideMap(nuclideLinesMap);
//调用分析算法
boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap);
if (analyseSpectrum) {
phd.setEfficiencyParam(phd.getUsedEffiPara().getP());
phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy());
phd.setEfficiencyCurRow(0);
// 重新计算峰值
Map<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap");
gammaFileUtil.getNuclideMDCValue(phd, phd.getMdcInfoMap(), nuclideLinesMDCMap);
gammaFileUtil.UpdateChart(phd, map, colorMap);
map.put("bAnalyed", phd.isBAnalyed());
map.put("peak", phd.getVPeak());
map.put("BaseCtrls", phd.getBaseCtrls());
// Bar Chart 柱状图
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
map.put("barChart", differance);
} else {
throw new RuntimeException("There is a problem with the current %s phd file, Analysis failure!");
}
return map;
}
} }

View File

@ -380,11 +380,19 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
detaFileName = detphd; detaFileName = detphd;
detStatus = true; detStatus = true;
} }
//匹配获取QCFile
boolean qcStatus = true;
String qcphd = phdFileUtil.GetQCPHD(sampleFileName, fileNames);
if (StringUtils.isBlank(qcphd)) {
qcphd = sampleFileName.substring(0, 23)+"_Q.PHD";
qcStatus = false;
}
map.put("sampleFileName", sampleFileName); map.put("sampleFileName", sampleFileName);
map.put("gasFileName", ""); map.put("gasFileName", "");
map.put("detFileName", detaFileName); map.put("detFileName", detaFileName);
map.put("detFileStatus", detStatus); map.put("detFileStatus", detStatus);
map.put("qcFileName", ""); map.put("qcFileName", qcphd);
map.put("qcFileStatus", qcStatus);
map.put("sampleSystemType", sampleSystemType); map.put("sampleSystemType", sampleSystemType);
} }
} }