Merge remote-tracking branch 'origin/SelfStation' into SelfStation
This commit is contained in:
commit
755f36d012
|
@ -176,7 +176,6 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
detVueData.setROITwoBetaStart(startChannel);
|
detVueData.setROITwoBetaStart(startChannel);
|
||||||
detVueData.setROITwoBetaStop(endChannel);
|
detVueData.setROITwoBetaStop(endChannel);
|
||||||
detVueData.setROITwoList(seriseDataList);
|
detVueData.setROITwoList(seriseDataList);
|
||||||
sampleVueData.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));
|
||||||
|
@ -894,7 +893,7 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
out.println("MSG_ID " + struct.msg_id + " " + struct.msg_type + "\n" + "DATA_TYPE " + struct.data_type);
|
out.println("MSG_ID " + struct.msg_id + " " + struct.msg_type + "\n" + "DATA_TYPE " + struct.data_type);
|
||||||
out.println("#Header 3");
|
out.println("#Header 3");
|
||||||
// 解析出的Gamma谱 系统类型暂时使用G
|
// 解析出的Gamma谱 系统类型暂时使用G
|
||||||
out.println(struct.site_code + " " + struct.detector_code + " G " +
|
out.println(struct.site_code + " " + struct.detector_code + " C " +
|
||||||
struct.sample_geometry + " " + struct.spectrum_quantity);
|
struct.sample_geometry + " " + struct.spectrum_quantity);
|
||||||
out.println(struct.sample_ref_id);
|
out.println(struct.sample_ref_id);
|
||||||
out.println(struct.measurement_id + " " + struct.detector_bk_measurement_id + " 0");
|
out.println(struct.measurement_id + " " + struct.detector_bk_measurement_id + " 0");
|
||||||
|
@ -924,9 +923,9 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
String str = g_counts.get(i).toString();
|
String str = g_counts.get(i).toString();
|
||||||
if(i % 5 == 0) {
|
if(i % 5 == 0) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
out.printf(i+"");
|
out.printf((i+1)+"");
|
||||||
} else {
|
} else {
|
||||||
out.printf("\n" + i );
|
out.printf("\n" + (i+1) );
|
||||||
}
|
}
|
||||||
beforeStr = i+"";
|
beforeStr = i+"";
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("selfStation")
|
@RequestMapping("selfStation")
|
||||||
|
@ -50,8 +51,8 @@ public class SelfStationController {
|
||||||
|
|
||||||
@PutMapping("updateROI")
|
@PutMapping("updateROI")
|
||||||
@ApiOperation(value = "更新ROI范围", notes = "更新ROI范围")
|
@ApiOperation(value = "更新ROI范围", notes = "更新ROI范围")
|
||||||
public Result updateROI(Integer startChannel, Integer endChannel, Integer ROINum, String sampleFileName, HttpServletRequest request) {
|
public Result updateROI(@RequestBody List<ROIParam> roiParams, @RequestParam String sampleFileName, HttpServletRequest request) {
|
||||||
return selfStationService.updateROI(startChannel, endChannel, ROINum, sampleFileName, request);
|
return selfStationService.updateROI(roiParams, sampleFileName, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("energyCalibration")
|
@GetMapping("energyCalibration")
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
package org.jeecg.modules.service;
|
package org.jeecg.modules.service;
|
||||||
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.entity.vo.ConfigureData;
|
import org.jeecg.modules.entity.vo.*;
|
||||||
import org.jeecg.modules.entity.vo.ParameterInfo;
|
|
||||||
import org.jeecg.modules.entity.vo.PeakInfo;
|
|
||||||
import org.jeecg.modules.entity.vo.SeriseData;
|
|
||||||
import org.jeecg.modules.entity.vo.TablePeaks;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
@ -25,6 +21,8 @@ public interface ISelfStationService {
|
||||||
|
|
||||||
Result updateROI(Integer startChannel, Integer endChannel, Integer ROINum, String sampleFileName, HttpServletRequest request);
|
Result updateROI(Integer startChannel, Integer endChannel, Integer ROINum, String sampleFileName, HttpServletRequest request);
|
||||||
|
|
||||||
|
Result updateROI(List<ROIParam> roiParams, String sampleFileName, HttpServletRequest request);
|
||||||
|
|
||||||
Result energyCalibration(String fileName, String currentText, Double width, 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 changeDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width, HttpServletRequest request);
|
||||||
|
|
|
@ -5666,6 +5666,8 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
|
if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
|
||||||
redisUtil.set("mdcInfoMap-G", mdcInfoMap);
|
redisUtil.set("mdcInfoMap-G", mdcInfoMap);
|
||||||
|
// todo 暂时和气体使用一样的
|
||||||
|
redisUtil.set("mdcInfoMap-C", mdcInfoMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,13 +263,13 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
|
|
||||||
// Gamma文件内容转换为PHD实体
|
// Gamma文件内容转换为PHD实体
|
||||||
sampleVueData.setROIOneFileName(gammaOneName);
|
sampleVueData.setROIOneFileName(gammaOneName);
|
||||||
sampleVueData.setROIOnePHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
|
sampleVueData.setROIOnePHDFile(selfStationUtil.getGammaPHD(gammaOneName, path));
|
||||||
sampleVueData.setROITwoFileName(gammaTwoName);
|
sampleVueData.setROITwoFileName(gammaTwoName);
|
||||||
sampleVueData.setROITwoPHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
|
sampleVueData.setROITwoPHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
|
||||||
sampleVueData.setROIThreeFileName(gammaThreeName);
|
sampleVueData.setROIThreeFileName(gammaThreeName);
|
||||||
sampleVueData.setROIThreePHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
|
sampleVueData.setROIThreePHDFile(selfStationUtil.getGammaPHD(gammaThreeName, path));
|
||||||
sampleVueData.setROIFourFileName(gammaFourName);
|
sampleVueData.setROIFourFileName(gammaFourName);
|
||||||
sampleVueData.setROIFourPHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
|
sampleVueData.setROIFourPHDFile(selfStationUtil.getGammaPHD(gammaFourName, path));
|
||||||
|
|
||||||
resultMap.put("sample", map);
|
resultMap.put("sample", map);
|
||||||
// 初始化Configure
|
// 初始化Configure
|
||||||
|
@ -543,6 +543,53 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result updateROI(List<ROIParam> roiParams, String sampleFileName, HttpServletRequest request) {
|
||||||
|
Result result = new Result();
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
//获取用户名
|
||||||
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
|
//读取自建台站缓存
|
||||||
|
Cache<String, SelfStationData> selfCache = selfStationCache.getSelfCache();
|
||||||
|
//获取缓存的当前谱对应的数据
|
||||||
|
SelfStationData selfStationData = selfCache.getIfPresent(sampleFileName + StringPool.DASH + userName);
|
||||||
|
if (Objects.isNull(selfStationData)) {
|
||||||
|
result.error500("Load basic file information first!");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
EnergySpectrumStruct struct = selfStationData.getSampleStruct();
|
||||||
|
for (ROIParam roiParam : roiParams) {
|
||||||
|
Integer ROINum = roiParam.getRoiNum();
|
||||||
|
Map<String, Object> resultMap = selfStationUtil.statisticsROIList(roiParam.getStartChannel(), roiParam.getEndChannel(),
|
||||||
|
struct.b_channels, struct.g_channels, struct.h_counts);
|
||||||
|
if ( CollectionUtils.isNotEmpty(resultMap) ) {
|
||||||
|
Integer startChannelValue = (Integer) resultMap.get("startChannel");
|
||||||
|
Integer endChannelValue = (Integer) resultMap.get("endChannel");
|
||||||
|
List<SeriseData> seriseDataList = (List<SeriseData>) resultMap.get("dataList");
|
||||||
|
if (1 == ROINum) {
|
||||||
|
map.put("ROIOneList", seriseDataList);
|
||||||
|
map.put("ROIOneStart", startChannelValue);
|
||||||
|
map.put("ROIOneStop", endChannelValue);
|
||||||
|
} else if (2 == ROINum) {
|
||||||
|
map.put("ROITwoList", seriseDataList);
|
||||||
|
map.put("ROITwoStart", startChannelValue);
|
||||||
|
map.put("ROITwoStop", endChannelValue);
|
||||||
|
} else if (3 == ROINum) {
|
||||||
|
map.put("ROIThreeList", seriseDataList);
|
||||||
|
map.put("ROIThreeStart", startChannelValue);
|
||||||
|
map.put("ROIThreeStop", endChannelValue);
|
||||||
|
} else if (4 == ROINum) {
|
||||||
|
map.put("ROIFourList", seriseDataList);
|
||||||
|
map.put("ROIFourStart", startChannelValue);
|
||||||
|
map.put("ROIFourStop", endChannelValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(map);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result energyCalibration(String fileName, String currentText, Double width, HttpServletRequest request) {
|
public Result energyCalibration(String fileName, String currentText, Double width, HttpServletRequest request) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
@ -3324,6 +3371,11 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
//分析时将phd的核素map重置
|
//分析时将phd的核素map重置
|
||||||
phd.setPhdNuclideMap(nuclideLinesMap);
|
phd.setPhdNuclideMap(nuclideLinesMap);
|
||||||
|
//读取redis缓存的计算mdc信息
|
||||||
|
Map<String, CalMDCInfo> mdcInfoMap = (Map<String, CalMDCInfo>) redisUtil.get("mdcInfoMap-"+phd.getHeader().getSystem_type());
|
||||||
|
if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
|
||||||
|
phd.setMdcInfoMap(mdcInfoMap);
|
||||||
|
}
|
||||||
//调用分析算法
|
//调用分析算法
|
||||||
boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap);
|
boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap);
|
||||||
if (analyseSpectrum) {
|
if (analyseSpectrum) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user