Merge remote-tracking branch 'origin/station' into station
This commit is contained in:
commit
f20fdb4271
|
@ -30,7 +30,7 @@ public interface CommonConstant {
|
|||
* 系统日志类型: 登录
|
||||
*/
|
||||
int LOG_TYPE_1 = 1;
|
||||
|
||||
|
||||
/**
|
||||
* 系统日志类型: 操作
|
||||
*/
|
||||
|
@ -40,38 +40,38 @@ public interface CommonConstant {
|
|||
* 操作日志类型: 查询
|
||||
*/
|
||||
int OPERATE_TYPE_1 = 1;
|
||||
|
||||
|
||||
/**
|
||||
* 操作日志类型: 添加
|
||||
*/
|
||||
int OPERATE_TYPE_2 = 2;
|
||||
|
||||
|
||||
/**
|
||||
* 操作日志类型: 更新
|
||||
*/
|
||||
int OPERATE_TYPE_3 = 3;
|
||||
|
||||
|
||||
/**
|
||||
* 操作日志类型: 删除
|
||||
*/
|
||||
int OPERATE_TYPE_4 = 4;
|
||||
|
||||
|
||||
/**
|
||||
* 操作日志类型: 倒入
|
||||
*/
|
||||
int OPERATE_TYPE_5 = 5;
|
||||
|
||||
|
||||
/**
|
||||
* 操作日志类型: 导出
|
||||
*/
|
||||
int OPERATE_TYPE_6 = 6;
|
||||
|
||||
|
||||
|
||||
|
||||
/** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
|
||||
Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
|
||||
/** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
|
||||
Integer SC_OK_200 = 200;
|
||||
|
||||
|
||||
/**访问权限认证未通过 510*/
|
||||
Integer SC_JEECG_NO_AUTHZ=510;
|
||||
|
||||
|
@ -94,7 +94,7 @@ public interface CommonConstant {
|
|||
*/
|
||||
Integer MENU_TYPE_0 = 0;
|
||||
/**
|
||||
* 1:子菜单
|
||||
* 1:子菜单
|
||||
*/
|
||||
Integer MENU_TYPE_1 = 1;
|
||||
/**
|
||||
|
@ -105,34 +105,34 @@ public interface CommonConstant {
|
|||
/**通告对象类型(USER:指定用户,ALL:全体用户)*/
|
||||
String MSG_TYPE_UESR = "USER";
|
||||
String MSG_TYPE_ALL = "ALL";
|
||||
|
||||
|
||||
/**发布状态(0未发布,1已发布,2已撤销)*/
|
||||
String NO_SEND = "0";
|
||||
String HAS_SEND = "1";
|
||||
String HAS_CANCLE = "2";
|
||||
|
||||
|
||||
/**阅读状态(0未读,1已读)*/
|
||||
String HAS_READ_FLAG = "1";
|
||||
String NO_READ_FLAG = "0";
|
||||
|
||||
|
||||
/**优先级(L低,M中,H高)*/
|
||||
String PRIORITY_L = "L";
|
||||
String PRIORITY_M = "M";
|
||||
String PRIORITY_H = "H";
|
||||
|
||||
|
||||
/**
|
||||
* 短信模板方式 0 .登录模板、1.注册模板、2.忘记密码模板
|
||||
*/
|
||||
String SMS_TPL_TYPE_0 = "0";
|
||||
String SMS_TPL_TYPE_1 = "1";
|
||||
String SMS_TPL_TYPE_2 = "2";
|
||||
|
||||
|
||||
/**
|
||||
* 状态(0无效1有效)
|
||||
*/
|
||||
String STATUS_0 = "0";
|
||||
String STATUS_1 = "1";
|
||||
|
||||
|
||||
/**
|
||||
* 同步工作流引擎1同步0不同步
|
||||
*/
|
||||
|
@ -144,7 +144,7 @@ public interface CommonConstant {
|
|||
*/
|
||||
String MSG_CATEGORY_1 = "1";
|
||||
String MSG_CATEGORY_2 = "2";
|
||||
|
||||
|
||||
/**
|
||||
* 是否配置菜单的数据权限 1是0否
|
||||
*/
|
||||
|
@ -157,7 +157,7 @@ public interface CommonConstant {
|
|||
Integer USER_UNFREEZE = 1;
|
||||
Integer USER_FREEZE = 2;
|
||||
Integer USER_QUIT = 3;
|
||||
|
||||
|
||||
/**字典翻译文本后缀*/
|
||||
String DICT_TEXT_SUFFIX = "_dictText";
|
||||
|
||||
|
@ -382,7 +382,7 @@ public interface CommonConstant {
|
|||
* https:// https协议
|
||||
*/
|
||||
String HTTPS_PROTOCOL = "https://";
|
||||
|
||||
|
||||
/** 部门表唯一key,id */
|
||||
String DEPART_KEY_ID = "id";
|
||||
/** 部门表唯一key,orgCode */
|
||||
|
@ -510,4 +510,14 @@ public interface CommonConstant {
|
|||
|
||||
String BETA = "Beta";
|
||||
String GAMMA = "Gamma";
|
||||
|
||||
/**
|
||||
* 自动处理Gamma报告前缀
|
||||
*/
|
||||
String REPORT_PREFIX_AUTO = "RNAUTO_";
|
||||
|
||||
/**
|
||||
* 自动处理报告后缀
|
||||
*/
|
||||
String REPORT_SUFFIX_AUTO = "_rpt";
|
||||
}
|
||||
|
|
|
@ -26,7 +26,13 @@ public enum FileTypeEnum {
|
|||
flv(".flv","video","视频"),
|
||||
mp4(".mp4","video","视频"),
|
||||
zip(".zip","zip","压缩包"),
|
||||
pdf(".pdf","pdf","pdf");
|
||||
pdf(".pdf","pdf","pdf"),
|
||||
baseline(".baseline","baseline","基线数据"),
|
||||
lc(".lc","lc","lc数据基线"),
|
||||
scac(".scac","scac","scac数据"),
|
||||
log(".log","log","日志"),
|
||||
arr(".txt","arr","自动处理报告"),
|
||||
rrr(".txt","rrr","人工交互分析报告");
|
||||
|
||||
private String type;
|
||||
private String value;
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package org.jeecg.common.constant.enums;
|
||||
|
||||
/**
|
||||
* 能谱 系统类型
|
||||
* @author: xiao
|
||||
*/
|
||||
public enum SpectrumSystemType {
|
||||
|
||||
/**
|
||||
* particulate
|
||||
*/
|
||||
P,
|
||||
/**
|
||||
* G :all other gas systems (high-resolution
|
||||
* γ-spectrometry or 2-D β-γ coincidence detection)
|
||||
*/
|
||||
G,
|
||||
/**
|
||||
* gas with 3-D β-γ coincidence detection
|
||||
*/
|
||||
B;
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
package org.jeecg.common.properties;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.constant.StringConstant;
|
||||
import org.jeecg.common.constant.enums.FileTypeEnum;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -55,4 +58,35 @@ public class SpectrumPathProperties implements Serializable {
|
|||
* 能谱文件存储路径以能谱系统类型/能谱类型为key,以存储路径为value
|
||||
*/
|
||||
private Map<String,String> filePathMap;
|
||||
|
||||
public String getSavePath(String fileType, String systemType, String dataType) {
|
||||
// systemType dataTYpe year month fileName fileType
|
||||
// Spectrum/Particulates /Samplephd /2023 /06 /RNAUTO_ARP01_001-20230603_1452_S_PREL_57371 .baseline
|
||||
// Spectrum/Xenon/Spalax /Samplephd /2023 /09 /RNAUTO_CAX05_001-20230910_1528_S_FULL_37564 .baseline
|
||||
StringBuilder path = new StringBuilder();
|
||||
|
||||
final int year = LocalDate.now().getYear();
|
||||
final int month = LocalDate.now().getMonth().getValue();
|
||||
|
||||
path.append(this.getRootPath()).append(StringConstant.SLASH);
|
||||
|
||||
// 自动处理报告
|
||||
if (fileType.equals(FileTypeEnum.arr.getValue())) {
|
||||
path.append(this.getArrPath()).append(StringConstant.SLASH);
|
||||
}
|
||||
// todo 人工交互分析报告地址
|
||||
if (fileType.equals(FileTypeEnum.rrr.getValue())) {
|
||||
}
|
||||
|
||||
// systemType
|
||||
path.append(this.getFilePathMap().get(systemType)).append(StringConstant.SLASH);
|
||||
// dataType
|
||||
path.append(this.getFilePathMap().get(dataType)).append(StringConstant.SLASH);
|
||||
// year
|
||||
path.append(year).append(StringConstant.SLASH);
|
||||
// month
|
||||
path.append(month >= 10 ? month : "0" + month).append(StringConstant.SLASH);
|
||||
|
||||
return path.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -304,6 +304,11 @@ public class MyLogFormatUtil {
|
|||
if(data.size() > 0) {
|
||||
List<List<String>> tempData = new LinkedList<>();
|
||||
// 行
|
||||
for(int row = 0; row < data.size(); row++) {
|
||||
List<String> columns = new LinkedList<>();
|
||||
columns.add(data.get(row).getAttribute());
|
||||
tempData.add(columns);
|
||||
}
|
||||
for(int row = 0; row < data.get(0).getContext().size(); row++) {
|
||||
List<String> columns = new LinkedList<>();
|
||||
tempData.add(columns);
|
||||
|
|
|
@ -21,6 +21,12 @@
|
|||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-starter-cloud</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.ejml/ejml-simple -->
|
||||
<dependency>
|
||||
<groupId>org.ejml</groupId>
|
||||
<artifactId>ejml-simple</artifactId>
|
||||
<version>0.39</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,196 @@
|
|||
package org.jeecg.common;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.modules.base.enums.DataType;
|
||||
import org.jeecg.modules.base.enums.SystemType;
|
||||
import org.jeecg.modules.entity.vo.PHDFile;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.ParseException;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class NameStandUtil {
|
||||
|
||||
public String GetSysTemSubdir(String systemType) {
|
||||
StringBuffer path = new StringBuffer();
|
||||
if(systemType.contains(SystemType.BETA.getType())) {
|
||||
path.append(StringPool.SLASH+"Spectrum");
|
||||
path.append(StringPool.SLASH+"Xenon");
|
||||
path.append(StringPool.SLASH+"Sauna");
|
||||
} else if(systemType.contains(SystemType.GAMMA.getType())) {
|
||||
path.append(StringPool.SLASH+"Spectrum");
|
||||
path.append(StringPool.SLASH+"Xenon");
|
||||
path.append(StringPool.SLASH+"Spalax");
|
||||
} else if(systemType.contains(SystemType.PARTICULATE.getType())) {
|
||||
path.append(StringPool.SLASH+"Spectrum");
|
||||
path.append(StringPool.SLASH+"Particulates");
|
||||
}
|
||||
return path.toString();
|
||||
}
|
||||
|
||||
public String GetDateTypeSubdir(String dataType){
|
||||
StringBuffer path = new StringBuffer();
|
||||
if(dataType.contains(DataType.SAMPLEPHD.getType()))
|
||||
{
|
||||
path.append(StringPool.SLASH+"Samplephd");
|
||||
}
|
||||
else if(dataType.contains(DataType.QCPHD.getType()))
|
||||
{
|
||||
path.append(StringPool.SLASH+"Qcphd");
|
||||
}
|
||||
else if(dataType.contains(DataType.DETBKPHD.getType()))
|
||||
{
|
||||
path.append(StringPool.SLASH+"Detbkphd");
|
||||
}
|
||||
else if(dataType.contains(DataType.GASBKPHD.getType()))
|
||||
{
|
||||
path.append(StringPool.SLASH+"Gasbkphd");
|
||||
}
|
||||
else if(dataType.contains(DataType.SOH.getType()))
|
||||
{
|
||||
path.append(StringPool.SLASH+"Soh");
|
||||
}
|
||||
else if(dataType.contains(DataType.MET.getType()))
|
||||
{
|
||||
path.append(StringPool.SLASH+"Met");
|
||||
}
|
||||
else if(dataType.contains(DataType.ALERT_FLOW.getType())||
|
||||
dataType.contains(DataType.ALERT_SYSTEM.getType())||
|
||||
dataType.contains(DataType.ALERT_TEMP.getType())||
|
||||
dataType.contains(DataType.ALERT_UPS.getType()))
|
||||
{
|
||||
path.append(StringPool.SLASH+"Alert");
|
||||
}
|
||||
else if(dataType.contains(DataType.ERROR.getType()))
|
||||
{
|
||||
path.append(StringPool.SLASH+"Error");
|
||||
}
|
||||
else
|
||||
{
|
||||
path.append(StringPool.SLASH+"Other");
|
||||
}
|
||||
return path.toString();
|
||||
}
|
||||
|
||||
public Map<String, String> NameStandard(String path, PHDFile fileAnlyse) {
|
||||
String suffix = GetSuffix(fileAnlyse.getMsgInfo().getData_type(),fileAnlyse.getHeader().getSystem_type(),fileAnlyse.getHeader().getSpectrum_quantity(),String.valueOf(fileAnlyse.getAcq().getAcquisition_live_time()));
|
||||
Map<String, String> fileNames = NameStandardByName(path, fileAnlyse.getFilename(), fileAnlyse.getHeader().getMeasurement_id(),suffix);
|
||||
return fileNames;
|
||||
}
|
||||
|
||||
public String GetSuffix(String dataType,String sysType,String Fulltype,String LT) {
|
||||
String rData = "";
|
||||
BigDecimal bd = new BigDecimal(LT);
|
||||
if(dataType.contains(DataType.SAMPLEPHD.getType())) {
|
||||
bd = bd.setScale(1, RoundingMode.HALF_UP);
|
||||
rData = "_S_"+Fulltype+"_"+bd+".PHD";
|
||||
} else if(dataType.contains(DataType.GASBKPHD.getType())){
|
||||
bd = bd.setScale(1, RoundingMode.HALF_UP);
|
||||
rData = "_G_"+Fulltype+"_"+bd+".PHD";
|
||||
}else if(dataType.contains(DataType.DETBKPHD.getType())){
|
||||
bd = bd.setScale(0, RoundingMode.HALF_UP);
|
||||
rData = "_D_"+Fulltype+"_"+bd+".PHD";
|
||||
}else if(dataType.contains(DataType.QCPHD.getType())){
|
||||
bd = bd.setScale(2, RoundingMode.HALF_UP);
|
||||
rData = "_Q_"+Fulltype+"_"+bd+".PHD";
|
||||
}
|
||||
return rData;
|
||||
}
|
||||
|
||||
public Map<String, String> NameStandardByName(String path, String fileName, String dateTimeFormat, String suffix) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
String StandardFileName="";
|
||||
String measurementName = GetFileNameFromDateTime(dateTimeFormat, suffix);
|
||||
String fileDir = path + StringPool.SLASH;
|
||||
if(measurementName != fileName) {
|
||||
StandardFileName = fileDir+measurementName;
|
||||
}
|
||||
String fileSuffix = "PHD";
|
||||
|
||||
String m_lcFileName = StandardFileName;
|
||||
String m_baseLineFileName = StandardFileName;
|
||||
String m_scacFileName = StandardFileName;
|
||||
String m_logfileName = StandardFileName;
|
||||
String m_reportFileName = StandardFileName;
|
||||
|
||||
m_lcFileName.replace(fileSuffix,"lc");
|
||||
m_baseLineFileName.replace(fileSuffix,"baseline");
|
||||
m_scacFileName.replace(fileSuffix,"scac");
|
||||
m_logfileName.replace(fileSuffix,"log");
|
||||
m_reportFileName.replace("."+fileSuffix,"_rpt");
|
||||
|
||||
String m_saveFileName = StandardFileName;
|
||||
|
||||
map.put("lc", m_lcFileName);
|
||||
map.put("baseline", m_baseLineFileName);
|
||||
map.put("scac", m_scacFileName);
|
||||
map.put("log", m_logfileName);
|
||||
map.put("rpt", m_reportFileName);
|
||||
map.put("saveFile", m_saveFileName);
|
||||
return map;
|
||||
}
|
||||
|
||||
public String GetFileNameFromDateTime(String dateTimeFormat, String suffix){
|
||||
String rData = "";
|
||||
int pos = dateTimeFormat.indexOf("-");
|
||||
if(-1 != pos) {
|
||||
String dateTime = dateTimeFormat;
|
||||
if (pos+17>dateTime.length()){
|
||||
dateTime = dateTime.substring(pos+1);
|
||||
}else {
|
||||
dateTime = dateTime.substring(pos+1, pos+17);
|
||||
}
|
||||
dateTime = dateTime.replace(" ","-");
|
||||
String fileHeader = dateTimeFormat.substring(0, pos+1);
|
||||
String temp = DateTimeStandardToFileFormat(dateTime);
|
||||
rData = fileHeader+ temp + suffix;
|
||||
}
|
||||
return rData;
|
||||
}
|
||||
|
||||
public String DateTimeStandardToFileFormat(String data) {
|
||||
String dateTime = "";
|
||||
try {
|
||||
if ( data.indexOf("-") > 0 ){
|
||||
dateTime = DateUtils.formatDate(DateUtils.parseDate(data,"yyyy/MM/dd-HH:mm"), "yyyyMMdd_HHmm");
|
||||
} else if( data.indexOf(" ") > 0 ) {
|
||||
dateTime = DateUtils.formatDate(DateUtils.parseDate(data,"yyyy/MM/dd HH:mm"), "yyyyMMdd_HHmm");
|
||||
} else if( data.indexOf("-")<0 && data.indexOf(" ") < 0) {
|
||||
dateTime = DateUtils.formatDate(DateUtils.parseDate(data,"yyyy/MM/dd"), "yyyyMMdd");
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
public String SetFileDir(String path, String saveFileName) {
|
||||
String input_file_name = path;
|
||||
//添加文件名日期
|
||||
List<String> dateSub = GetSubDirByFileName(saveFileName);
|
||||
for(int pos=0;pos<dateSub.size();pos++) {
|
||||
input_file_name=input_file_name+dateSub.get(pos)+StringPool.SLASH;
|
||||
}
|
||||
return input_file_name;
|
||||
}
|
||||
|
||||
public List<String> GetSubDirByFileName(String fileName) {
|
||||
List<String> rData = new LinkedList<>();
|
||||
int pos = fileName.indexOf('-');
|
||||
if(-1 == pos) {
|
||||
//
|
||||
} else if(fileName.length()>=pos+7) {
|
||||
rData.add(fileName.substring(pos+1, pos+5));
|
||||
rData.add(fileName.substring(pos+5, pos+7));
|
||||
}
|
||||
return rData;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,149 @@
|
|||
package org.jeecg.modules.eneity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class GardsAnalysesSpectrum implements Serializable {
|
||||
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
private Integer idAnalysis;
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
private Integer sampleId;
|
||||
|
||||
/**
|
||||
* 分析开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date analysisBegin;
|
||||
|
||||
/**
|
||||
* 开始时间-字符串
|
||||
*/
|
||||
private String analysisBeginStr;
|
||||
|
||||
/**
|
||||
* 分析结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date analysisEnd;
|
||||
|
||||
/**
|
||||
* 结束时间-字符串
|
||||
*/
|
||||
private String analysisEndStr;
|
||||
|
||||
/**
|
||||
* Reviewed:交互,auto:自动
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 使用的软件名称
|
||||
*/
|
||||
private String software;
|
||||
|
||||
/**
|
||||
* 软件版本号
|
||||
*/
|
||||
private String swVersion;
|
||||
|
||||
/**
|
||||
* 分析员名称
|
||||
*/
|
||||
private String analyst;
|
||||
|
||||
/**
|
||||
* 基线计数方法描述
|
||||
*/
|
||||
private String baselineMethod;
|
||||
|
||||
/**
|
||||
* 寻峰方法描述
|
||||
*/
|
||||
private String peaksMethod;
|
||||
|
||||
/**
|
||||
* 核素识别方法描述
|
||||
*/
|
||||
private String nuclideMethod;
|
||||
|
||||
/**
|
||||
* 不确定度计算描述
|
||||
*/
|
||||
private String uncCalcMethod;
|
||||
|
||||
/**
|
||||
* Lc计算方法描述
|
||||
*/
|
||||
private String lcMethod;
|
||||
|
||||
/**
|
||||
* 寻峰起始道
|
||||
*/
|
||||
private Integer searchStartChannel;
|
||||
|
||||
/**
|
||||
* 寻峰结束道
|
||||
*/
|
||||
private Integer searchEndChannel;
|
||||
|
||||
/**
|
||||
* 寻峰阈值
|
||||
*/
|
||||
private Double searchThreshold;
|
||||
|
||||
/**
|
||||
* 峰数目
|
||||
*/
|
||||
private Integer numberOfPeaks;
|
||||
|
||||
/**
|
||||
* 总计数
|
||||
*/
|
||||
private Float totalCounts;
|
||||
|
||||
/**
|
||||
* 分级结果
|
||||
*/
|
||||
private Integer category;
|
||||
|
||||
/**
|
||||
* 注释
|
||||
*/
|
||||
private String comments;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
private String usedgasphd;
|
||||
|
||||
private String useddetphd;
|
||||
|
||||
private Integer usedgasphdId;
|
||||
|
||||
private Integer useddetphdId;
|
||||
|
||||
private String baselinePath;
|
||||
|
||||
private String lcPath;
|
||||
|
||||
private String scacPath;
|
||||
|
||||
private String logPath;
|
||||
|
||||
private String reportPath;
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package org.jeecg.modules.eneity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class GardsCalibrationPairsSpectrum implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
private Integer sampleId;
|
||||
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
private Integer idAnalysis;
|
||||
|
||||
/**
|
||||
* G:gamma探测器的数据,#g_;B:beta探测器的数据,#b_
|
||||
*/
|
||||
private String sampleType;
|
||||
|
||||
/**
|
||||
* energy:能量刻度;
|
||||
* efficiency:效率刻度;
|
||||
* Resolution:分辨率刻度
|
||||
*/
|
||||
private String caltype;
|
||||
|
||||
/**
|
||||
* PHD:代表数据来自PHD文件;External:代表数据来自外部,如刻度工具、其它文件等
|
||||
*/
|
||||
private String input;
|
||||
|
||||
/**
|
||||
* 刻度点ID号
|
||||
*/
|
||||
private Integer idCalPoint;
|
||||
|
||||
private Double xValue;
|
||||
|
||||
private Double yValue;
|
||||
|
||||
private String decayMode;
|
||||
|
||||
/**
|
||||
* y值不确定度
|
||||
*/
|
||||
private String uncYValue;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package org.jeecg.modules.eneity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class GardsCalibrationSpectrum implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
private Integer sampleId;
|
||||
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
private Integer idAnalysis;
|
||||
|
||||
/**
|
||||
* G:gamma探测器的数据,#g_;B:beta探测器的数据,#b_
|
||||
*/
|
||||
private String sampleType;
|
||||
|
||||
/**
|
||||
* energy:能量刻度;
|
||||
* efficiency:效率刻度;
|
||||
* Resolution:分辨率刻度
|
||||
*/
|
||||
private String calType;
|
||||
|
||||
/**
|
||||
* 拟合方程ID号(统一定义)
|
||||
*/
|
||||
private Integer function;
|
||||
|
||||
/**
|
||||
* 拟合方程描述
|
||||
*/
|
||||
private String functionDef;
|
||||
|
||||
/**
|
||||
* 拟合的起始值
|
||||
*/
|
||||
private Integer startOfRange;
|
||||
|
||||
/**
|
||||
* 拟合的结束值
|
||||
*/
|
||||
private Integer endOfRange;
|
||||
|
||||
/**
|
||||
* 拟合系数1
|
||||
*/
|
||||
private Double coeff1;
|
||||
|
||||
/**
|
||||
* 拟合系数2
|
||||
*/
|
||||
private Double coeff2;
|
||||
|
||||
/**
|
||||
* 拟合系数3
|
||||
*/
|
||||
private Double coeff3;
|
||||
|
||||
/**
|
||||
* 拟合系数4
|
||||
*/
|
||||
private Double coeff4;
|
||||
|
||||
/**
|
||||
* 拟合系数5
|
||||
*/
|
||||
private Double coeff5;
|
||||
|
||||
/**
|
||||
* 拟合系数6
|
||||
*/
|
||||
private Double coeff6;
|
||||
|
||||
/**
|
||||
* 拟合系数7
|
||||
*/
|
||||
private Double coeff7;
|
||||
|
||||
/**
|
||||
* 拟合系数8
|
||||
*/
|
||||
private Double coeff8;
|
||||
|
||||
/**
|
||||
* 拟合系数9
|
||||
*/
|
||||
private Double coeff9;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
private String coeffString;
|
||||
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
package org.jeecg.modules.eneity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class GardsNuclIdedSpectrum implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
private Integer sampleId;
|
||||
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
private Integer idAnalysis;
|
||||
|
||||
/**
|
||||
* 核素名称
|
||||
*/
|
||||
private String nuclideName;
|
||||
|
||||
/**
|
||||
* 核素类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 核素半衰期
|
||||
*/
|
||||
private String halflife;
|
||||
|
||||
/**
|
||||
* 平均活度值
|
||||
*/
|
||||
private String aveActiv;
|
||||
|
||||
/**
|
||||
* 平均活度值不确定度
|
||||
*/
|
||||
private Double aveActivErr;
|
||||
|
||||
/**
|
||||
* 主射线活度值
|
||||
*/
|
||||
private Double activKey;
|
||||
|
||||
/**
|
||||
* 主射线活度值不确定度
|
||||
*/
|
||||
private Double activKeyErr;
|
||||
|
||||
/**
|
||||
* 核素的最小可探测活度
|
||||
*/
|
||||
private String mda;
|
||||
|
||||
/**
|
||||
* 核素的最小可探测活度不确定度
|
||||
*/
|
||||
private Double mdaErr;
|
||||
|
||||
/**
|
||||
* 核素识别标志
|
||||
*/
|
||||
private Integer nidFlag;
|
||||
|
||||
private Double activDecay;
|
||||
|
||||
private Double activDecayErr;
|
||||
/**
|
||||
* 符合相加校正因子(无设为1)
|
||||
*/
|
||||
private Double cscRatio;
|
||||
|
||||
/**
|
||||
* 符合相加校正因子不确定度(无设为0)
|
||||
*/
|
||||
private Double cscRatioErr;
|
||||
|
||||
/**
|
||||
* 活度是否经过符合相加校正
|
||||
*/
|
||||
private Integer cscModFlag;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
private String mdc;
|
||||
|
||||
private String concentration;
|
||||
|
||||
private String keyEnergy;
|
||||
|
||||
private String keyYield;
|
||||
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
package org.jeecg.modules.eneity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class GardsNuclLinesIdedSpectrum implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
private Integer sampleId;
|
||||
|
||||
/**
|
||||
* 峰序号
|
||||
*/
|
||||
private Integer idPeak;
|
||||
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
private Integer idAnalysis;
|
||||
|
||||
/**
|
||||
* 核素名称
|
||||
*/
|
||||
private String nuclideName;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
/**
|
||||
* 核素库中核素对应峰的能量(keV)
|
||||
*/
|
||||
private Double energy;
|
||||
|
||||
/**
|
||||
* 核素库中核素对应峰的能量不确定度(keV)
|
||||
*/
|
||||
private Double uncEnergy;
|
||||
|
||||
/**
|
||||
* 核素库中核素对应峰的发射几率
|
||||
*/
|
||||
private Double abundance;
|
||||
|
||||
/**
|
||||
* 核素库中核素对应峰的发射几率不确定度
|
||||
*/
|
||||
private Double uncAbundance;
|
||||
|
||||
/**
|
||||
* 利用该峰计算得到的活度
|
||||
*/
|
||||
private String activity;
|
||||
|
||||
/**
|
||||
* 利用该峰计算得到的活度不确定度
|
||||
*/
|
||||
private Double uncActivity;
|
||||
|
||||
/**
|
||||
* 该峰处的探测效率
|
||||
*/
|
||||
private Double effic;
|
||||
|
||||
/**
|
||||
* 该峰处的探测效率不确定度
|
||||
*/
|
||||
private Double unEffic;
|
||||
|
||||
/**
|
||||
* 利用该峰计算得到的最小可探测活度
|
||||
*/
|
||||
private Double mda;
|
||||
|
||||
/**
|
||||
* 主射线标识:0-否;1-是
|
||||
*/
|
||||
private Double keyFlag;
|
||||
|
||||
/**
|
||||
* 符合相加校正因子(无设为1)
|
||||
*/
|
||||
private Double cscRatio;
|
||||
|
||||
/**
|
||||
* 符合相加校正因子不确定度(无设为0)
|
||||
*/
|
||||
private Double cscRatioErr;
|
||||
|
||||
/**
|
||||
* 活度是否经过符合相加校正
|
||||
*/
|
||||
private Double cscModFlag;
|
||||
|
||||
private String nuclidefullname;
|
||||
|
||||
private String mdc;
|
||||
|
||||
private String concentration;
|
||||
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
package org.jeecg.modules.eneity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class GardsPeaksSpectrum implements Serializable {
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
private Integer sampleId;
|
||||
|
||||
/**
|
||||
* 峰序号
|
||||
*/
|
||||
private Integer idPeak;
|
||||
|
||||
/**
|
||||
* 分析ID号
|
||||
*/
|
||||
private Integer idAnalysis;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date moddate;
|
||||
|
||||
/**
|
||||
* 峰中心道(道址)
|
||||
*/
|
||||
private Double centroidChannel;
|
||||
|
||||
/**
|
||||
* 峰中心道不确定度(道址)
|
||||
*/
|
||||
private Double uncCentroidChannel;
|
||||
|
||||
/**
|
||||
* 峰中心道能量(keV)
|
||||
*/
|
||||
private Double energy;
|
||||
|
||||
/**
|
||||
* 峰中心道能量不确定度(keV)
|
||||
*/
|
||||
private Double uncEnergy;
|
||||
|
||||
/**
|
||||
* 峰面积(计数)。已扣除基线面积,但未扣除空白样品计数和探测器本底计数
|
||||
*/
|
||||
private Double area;
|
||||
|
||||
/**
|
||||
* 峰面积不确定度(计数)
|
||||
*/
|
||||
private Double uncArea;
|
||||
|
||||
/**
|
||||
* 峰的净计数率(1/s)=峰面积/活时间
|
||||
*/
|
||||
private Double netCountRate;
|
||||
/**
|
||||
* 峰的净计数率的不确定度(1/s)
|
||||
*/
|
||||
private Double uncNetCountRate;
|
||||
/**
|
||||
* 测量系统在峰能量处的绝对效率
|
||||
*/
|
||||
private Double efficiency;
|
||||
/**
|
||||
* 测量系统在峰能量处的绝对效率的不确定度
|
||||
*/
|
||||
private Double uncefficiency;
|
||||
/**
|
||||
* 峰的半高宽(道)
|
||||
*/
|
||||
private Double fwhm;
|
||||
/**
|
||||
* 峰的十分之一高宽(道)
|
||||
*/
|
||||
private Double fwtm;
|
||||
/**
|
||||
* 峰的重要性因子
|
||||
*/
|
||||
private Double significance;
|
||||
/**
|
||||
* 峰的可探测线Lc
|
||||
*/
|
||||
private Double lc;
|
||||
/**
|
||||
* 峰的感兴趣区的起始道
|
||||
*/
|
||||
private Double roiStart;
|
||||
/**
|
||||
* 峰的感兴趣区的结束道
|
||||
*/
|
||||
private Double roiEnd;
|
||||
|
||||
private Double mulitiIndex;
|
||||
|
||||
private Double tail;
|
||||
|
||||
private Double tailAlpha;
|
||||
|
||||
private Double upperTail;
|
||||
|
||||
private Double upperTailAlpha;
|
||||
|
||||
private Double bwwidthchan;
|
||||
|
||||
private Double recoildeltachan;
|
||||
|
||||
private Double stepraio;
|
||||
|
||||
private Double ld;
|
||||
|
||||
private Double sensitivity;
|
||||
|
||||
private Double backgroundarea;
|
||||
|
||||
private Double meanbackcount;
|
||||
|
||||
private Double recoilbetachan;
|
||||
|
||||
private String peakcomments;
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package org.jeecg.modules.eneity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class GardsQcCheckSpectrum implements Serializable {
|
||||
|
||||
private Integer sampleId;
|
||||
|
||||
private Integer idanalysis;
|
||||
|
||||
private String qcName;
|
||||
|
||||
private Double qcValue;
|
||||
|
||||
private String qcStandard;
|
||||
|
||||
private Integer qcResult;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date moddate;
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package org.jeecg.modules.eneity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
@TableName("ORIGINAL.GARDS_SAMPLE_DATA")
|
||||
public class GardsSampleDataSpectrum extends GardsSampleData {
|
||||
|
||||
/**
|
||||
* 台站名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "STATION" ,orderNum = "2")
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 探测器名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String detectorsName;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "CALIB REPORTS" ,orderNum = "7")
|
||||
private String calibReports;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String dbName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "NO" ,orderNum = "1")
|
||||
private Integer no;
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package org.jeecg.modules.eneity.vo;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class StructInsertInput implements Serializable {
|
||||
|
||||
//-----------------input:------------------
|
||||
public List<Double> peakCentroid;
|
||||
|
||||
public List<Double> fwhmc;
|
||||
|
||||
public List<Double> tail;
|
||||
|
||||
public List<Double> tailAlpha;
|
||||
|
||||
public List<Double> upperTail;
|
||||
|
||||
public List<Double> upperTailAlpha;
|
||||
|
||||
public List<Double> area;
|
||||
|
||||
public List<Double> stepRatio;
|
||||
|
||||
public List<Double> usedEnerPara;
|
||||
|
||||
public List<Double> usedResoPara;
|
||||
|
||||
public List<Double> usedEffiPara;
|
||||
|
||||
public long num_g_channel;
|
||||
|
||||
public long begin_channel;
|
||||
|
||||
public List<Double> XCtrl;
|
||||
|
||||
public List<Double> YCtrl;
|
||||
|
||||
public List<Double> YSlope;
|
||||
|
||||
public int rg_low;
|
||||
|
||||
public int rg_high;
|
||||
|
||||
public List<Double> para_tail;
|
||||
|
||||
public List<Double> para_tailAlpha;
|
||||
|
||||
public List<Double> para_tailRight;
|
||||
|
||||
public List<Double> para_tailRightAlpha;
|
||||
|
||||
public List<Double> para_stepRatio;
|
||||
|
||||
public int curChan;
|
||||
|
||||
public List<Double> vCount;
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package org.jeecg.modules.eneity.vo;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class StructInsertOutput implements Serializable {
|
||||
|
||||
//-----------------output:------------------
|
||||
public List<Double> peakCentroid;
|
||||
|
||||
public List<Double> energy;
|
||||
|
||||
public List<Double> area;
|
||||
|
||||
public List<Double> sensitivity;
|
||||
|
||||
public List<Double> fwhm;
|
||||
|
||||
public List<Double> fwhmc;
|
||||
|
||||
public List<Double> stepRatio;
|
||||
|
||||
public List<Double> tail;
|
||||
|
||||
public List<Double> tailAlpha;
|
||||
|
||||
public List<Double> upperTail;
|
||||
|
||||
public List<Double> upperTailAlpha;
|
||||
|
||||
public List<Double> efficiency;
|
||||
|
||||
public List<Double> BWWidthChan;
|
||||
|
||||
public List<Double> recoilBetaChan;
|
||||
|
||||
public List<Double> recoilDeltaChan;
|
||||
|
||||
public List<Double> vIdx;
|
||||
|
||||
public List<Double> vLeft;
|
||||
|
||||
public List<Double> vRight;
|
||||
|
||||
public List<Double> vCentroid;
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package org.jeecg.modules.eneity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class TablePeaks implements Serializable {
|
||||
|
||||
private String lab;
|
||||
|
||||
private String nuclide;
|
||||
|
||||
private String energy;
|
||||
|
||||
private String netArea;
|
||||
|
||||
private String fwhm;
|
||||
|
||||
private String step;
|
||||
|
||||
private String bwGamma;
|
||||
|
||||
private boolean netAreaB;
|
||||
|
||||
private boolean centroid;
|
||||
|
||||
private boolean fwhmB;
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.base.entity.configuration.GardsNuclLib;
|
||||
import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsAnalySetting;
|
||||
import org.jeecg.modules.eneity.*;
|
||||
import org.jeecg.modules.entity.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SpectrumAnalysisMapper {
|
||||
|
||||
String getStatus(@Param(value = "sampleId") Integer sampleId);
|
||||
|
||||
GardsAnalysesSpectrum getAnalysis(@Param(value = "dbName") String dbName, @Param(value = "sampleId") Integer sampleId);
|
||||
|
||||
List<GardsPeaksSpectrum> getPeaks(@Param(value = "dbName") String dbName, @Param(value = "idAnalysis") Integer idAnalysis);
|
||||
|
||||
List<GardsCalibrationPairsSpectrum> getCalibrationPairs(@Param(value = "dbName") String dbName, @Param(value = "idAnalysis") Integer idAnalysis);
|
||||
|
||||
List<GardsCalibrationSpectrum> getPara(@Param(value = "dbName") String dbName, @Param(value = "idAnalysis") Integer idAnalysis);
|
||||
|
||||
List<GardsNuclLinesIdedSpectrum> getNuclLinesIded(@Param(value = "dbName") String dbName, @Param(value = "idAnalysis") Integer idAnalysis);
|
||||
|
||||
List<GardsNuclIdedSpectrum> getNuclIded(@Param(value = "dbName") String dbName, @Param(value = "idAnalysis") Integer idAnalysis);
|
||||
|
||||
List<GardsQcCheckSpectrum> getQcCheck(@Param(value = "dbName") String dbName, @Param(value = "idAnalysis") Integer idAnalysis);
|
||||
|
||||
GardsAnalySetting getAnalySetting(@Param(value = "idAnalysis") Integer idAnalysis);
|
||||
|
||||
List<NuclideLine> getNuclideLines(@Param(value = "name") String name);
|
||||
|
||||
List<HalfData> getHalf(@Param(value = "names") List<String> names);
|
||||
|
||||
List<GardsNuclLinesLib> getNuclideLine(@Param(value = "min") Double min, @Param(value = "max") Double max, @Param(value = "name") String name);
|
||||
|
||||
GardsNuclLib getNuclideInfo(@Param(value = "name") String name);
|
||||
|
||||
GardsNuclLib getParentAndDaughter(@Param(value = "name") String name);
|
||||
|
||||
List<String> findNuclideList(@Param(value = "min") Double min, @Param(value = "max") Double max, @Param(value = "nuclides") List<String> nuclides);
|
||||
|
||||
List<GardsNuclLinesLib> getNuclideTable( @Param(value = "name") String name, @Param(value = "span") Long span);
|
||||
|
||||
Integer getSampleId(@Param(value = "filePathName") String filePathName);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package org.jeecg.modules.native_jni;
|
||||
|
||||
import org.jeecg.modules.entity.vo.PeakInfo;
|
||||
import org.jeecg.modules.eneity.vo.StructInsertInput;
|
||||
import org.jeecg.modules.eneity.vo.StructInsertOutput;
|
||||
import org.jeecg.modules.native_jni.struct.CalValuesOut;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CalValuesHandler {
|
||||
|
||||
public static native CalValuesOut calFcnEval(List<Double> x, List<Double> para);
|
||||
|
||||
public static native CalValuesOut energyToChannel(List<Double> energy, List<Double> para);
|
||||
|
||||
public static native CalValuesOut calDerivEval(List<Double> channel, List<Double> para);
|
||||
|
||||
public static native double calDerivaOut(double Chan, List<Double> p);
|
||||
|
||||
public static native List<Double> interp1(PeakInfo peak, List<Double> t_base, List<Double> regChan);
|
||||
|
||||
public static native StructInsertOutput insertPeaks(StructInsertInput structInsertInput);
|
||||
|
||||
public static native List<Double> calFitPara(String type, int funcId, List<Double> x, List<Double> y, List<Double> err);
|
||||
|
||||
public static native StructInsertOutput ComputePeakRange(int peakSize, int m_nCount, List<Double> vCentroid, List<Double> vFwhmCh, List<Double> vTail, List<Double> vUpperTail);
|
||||
|
||||
public static native List<Double> calValues(int cal, int m_nChans);
|
||||
|
||||
public static native List<Double> GetFwhmcAll(int m_nChans);
|
||||
|
||||
public static native List<Double> calculateLC(List<Double> BaseLine, List<Double> FwhmcAll, double RiskLevelK);
|
||||
|
||||
public static native List<Double> calculateSCAC(List<Double> Spectrum, List<Double> BaseLine, List<Double> FwhmcAll);
|
||||
|
||||
public static native boolean armaAny(List<Double> Spectrum);
|
||||
|
||||
public static native String calUpdate(String dataType, List<Double> certEne, boolean E1, boolean R, boolean E2, boolean KeepCalPeakSearchPeaks, double k_back, double k_alpha, double k_beta);
|
||||
|
||||
public static native String peakSearch(double ECutLow, double ECutHigh, double deltaE, double pssLow, double k_back, double k_alpha, double k_beta);
|
||||
|
||||
public static native String baseImprove(double BaseImprovePSS, double k_back, double k_alpha, double k_beta);
|
||||
|
||||
public static native String fitPeakFull();
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.jeecg.modules.native_jni.struct;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CalValuesOut {
|
||||
|
||||
public int rowNum;
|
||||
|
||||
public int colNum;
|
||||
|
||||
public List<Double> counts;
|
||||
|
||||
}
|
|
@ -3,17 +3,27 @@ package org.jeecg.modules.spectrum;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.constant.DateConstant;
|
||||
import org.jeecg.common.constant.Setting;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.common.GammaFileUtil;
|
||||
import org.jeecg.common.constant.*;
|
||||
import org.jeecg.common.constant.enums.SpectrumSystemType;
|
||||
import org.jeecg.common.properties.SpectrumPathProperties;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.modules.base.bizVo.AttributeItemVo;
|
||||
import org.jeecg.common.util.MyLogFormatUtil;
|
||||
import org.jeecg.modules.base.dto.*;
|
||||
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
||||
import org.jeecg.modules.base.entity.rnauto.*;
|
||||
import org.jeecg.modules.entity.vo.*;
|
||||
import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -31,11 +41,58 @@ public class Sample_G_Analysis {
|
|||
// Sample谱结构体数据
|
||||
private EnergySpectrumStruct energySpectrumStruct;
|
||||
|
||||
// 能谱文件存储路径属性
|
||||
private SpectrumPathProperties spectrumPathProperties;
|
||||
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
/**
|
||||
* 系统类型
|
||||
*/
|
||||
private String systemType;
|
||||
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 样品谱地址
|
||||
*/
|
||||
private String sampleInputFilename;
|
||||
|
||||
/**
|
||||
* 样品谱名称
|
||||
*/
|
||||
private String sampleFilename;
|
||||
|
||||
/**
|
||||
* 日志文件路径
|
||||
*/
|
||||
private String logFilePath;
|
||||
/**
|
||||
* 日志文件名称
|
||||
*/
|
||||
private String logFileName;
|
||||
/**
|
||||
* 报告文件路径
|
||||
*/
|
||||
private String arrFilePath;
|
||||
/**
|
||||
* 报告文件名称
|
||||
*/
|
||||
private String arrFileName;
|
||||
|
||||
public Sample_G_Analysis(EnergySpectrumStruct energySpectrumStruct,SpectrumServiceQuotes serviceQuotes,
|
||||
GardsSampleData sampleData) {
|
||||
this.sampleData = sampleData;
|
||||
this.serviceQuotes = serviceQuotes;
|
||||
this.energySpectrumStruct = energySpectrumStruct;
|
||||
this.systemType = energySpectrumStruct.system_type;
|
||||
this.dataType = energySpectrumStruct.data_type;
|
||||
this.sampleInputFilename = sampleData.getInputFileName();
|
||||
this.sampleFilename = StringUtils.substring(sampleData.getInputFileName(),
|
||||
sampleData.getInputFileName().lastIndexOf((StringConstant.SLASH)+1));
|
||||
}
|
||||
|
||||
public void analysis(){
|
||||
|
@ -44,26 +101,45 @@ public class Sample_G_Analysis {
|
|||
GStoreMiddleProcessData middleData = new GStoreMiddleProcessData();
|
||||
Integer sampleId = sampleData.getSampleId();
|
||||
|
||||
GammaFileUtil gammaFileUtil = new GammaFileUtil();
|
||||
PHDFile phdFile = new PHDFile();
|
||||
|
||||
// todo 获取数据库 Gamma 默认参数
|
||||
// todo 文件路径
|
||||
middleData.setAnalyses_save_filePath(this.sampleInputFilename);
|
||||
// todo 读取文件内容并附值
|
||||
this.setPHDFile(phdFile, this.energySpectrumStruct);
|
||||
// todo 根据系统类型传入不同的核素参数
|
||||
Map<String, NuclideLines> nuclideLibs = new HashMap<>();
|
||||
if (this.systemType.equals(SpectrumSystemType.P.name())) {
|
||||
nuclideLibs = this.getNuclideLinesP();
|
||||
}
|
||||
if (this.systemType.equals(SpectrumSystemType.G.name())) {
|
||||
nuclideLibs = this.getNuclideLinesG();
|
||||
}
|
||||
gammaFileUtil.GetMiddleData(phdFile, CommonConstant.REPORT_PREFIX_AUTO, nuclideLibs, middleData, "1");
|
||||
|
||||
// 保存分析结果 ==> INSERT INTO RNAUTO.GARDS_ANALYSES
|
||||
saveAnalysis(middleData,sampleId);
|
||||
// 获取分析结果ID ==> SELECT IDANALYSIS
|
||||
Integer IdAnalysis = getIdAnalysis(sampleId);
|
||||
// 修改保存结果状态 ==> UPDATE ORIGINAL.GARDS_SAMPLE_DATA
|
||||
serviceQuotes.getSampleDataService().updateStatus(null,null);
|
||||
// serviceQuotes.getSampleDataService().updateStatus(null,null);
|
||||
/* GARDS_CALIBRATION_PAIRS 数据表保存 */
|
||||
saveCalibrationPairs(middleData,sampleId,IdAnalysis);
|
||||
// saveCalibrationPairs(middleData,sampleId,IdAnalysis);
|
||||
/* GARDS_CALIBRATION 数据表保存 */
|
||||
saveCalibration(middleData,sampleId,IdAnalysis);
|
||||
// saveCalibration(middleData,sampleId,IdAnalysis);
|
||||
/* Gards_Peaks 数据表保存 */
|
||||
savePeaks(middleData);
|
||||
// savePeaks(middleData);
|
||||
/* Gards_Nucl_Lines_Ided 数据表保存 */
|
||||
saveNuclLinesIded(middleData,sampleId,IdAnalysis);
|
||||
// saveNuclLinesIded(middleData,sampleId,IdAnalysis);
|
||||
/* Gards_Nucl_Ided 数据表保存 */
|
||||
saveNuclIded(middleData,sampleId,IdAnalysis);
|
||||
// saveNuclIded(middleData,sampleId,IdAnalysis);
|
||||
/* Gards_Qc_Check 数据表保存 */
|
||||
saveQcCheck(middleData,sampleId,IdAnalysis);
|
||||
// saveQcCheck(middleData,sampleId,IdAnalysis);
|
||||
/* */
|
||||
/** 收尾处理 ==> 写日志文件和报告文件 **/
|
||||
writeLog(middleData.getAnalyses_LogPath(), middleData);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
|
||||
|
@ -72,6 +148,314 @@ public class Sample_G_Analysis {
|
|||
}
|
||||
}
|
||||
|
||||
private void writeLog(String logFilePath, GStoreMiddleProcessData middleData) {
|
||||
String sampleId = middleData.getSample_id();
|
||||
MyLogFormatUtil myLogFormatUtil = new MyLogFormatUtil();
|
||||
List<String> writes = new LinkedList<>();
|
||||
|
||||
// 自动处理分析开始
|
||||
String analyseBegin = MyLogFormatUtil.analyseResultsBegin.replace("%1", "date");
|
||||
writes.add(MyLogFormatUtil.getTitleFormat(analyseBegin, MyLogFormatUtil.FILE_TITLE_FLAG));
|
||||
|
||||
/* Read calibration data */
|
||||
writes.add(MyLogFormatUtil.getTitleFormat(MyLogFormatUtil.titleCalibration));
|
||||
|
||||
List<AttributeItemVo> data = new ArrayList<>();
|
||||
writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.SetSampleGEnergyChannel.replace("%1", sampleId)));
|
||||
|
||||
AttributeItemVo item = null;
|
||||
item = new AttributeItemVo("Channel", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_E_xValue(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Energy", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_E_yValue(),3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Error", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_E_uncYValue(), 3));
|
||||
data.add(item);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(data));
|
||||
|
||||
// Reading gamma Efficiency pairs(sampleID: %1)
|
||||
writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GSetSampleEfficiencyChannel.replace("%1", sampleId)));
|
||||
|
||||
item = new AttributeItemVo("Channel", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_EF_xValue(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Energy", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_EF_xValue(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Error", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_EF_xValue(), 3));
|
||||
data.add(item);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(data));
|
||||
|
||||
// Reading gamma Resolution pairs(sampleID: %1)
|
||||
writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GSetSampleResolutionChannel.replace("%1", sampleId)));
|
||||
|
||||
item = new AttributeItemVo("Channel", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_EF_xValue(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Energy", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_R_yValue(),3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Error", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_R_uncYValue(),3));
|
||||
data.add(item);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(data));
|
||||
|
||||
// Reading gamma TotalEfficiency pairs(sampleID: %1)
|
||||
writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GSetSampleTotalEfficiencyChannel.replace("%1", sampleId)));
|
||||
item = new AttributeItemVo("Channel", middleData.getCalibration_pairs_S_T_xValue());
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Energy", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_T_yValue(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Error", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_T_uncYValue(), 3));
|
||||
data.add(item);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(data));
|
||||
|
||||
// Reading sample information
|
||||
writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.sampleInfo));
|
||||
Map<String, Object> infoMap = new LinkedHashMap<>();
|
||||
infoMap.put("Collection Start", middleData.sample_collection_start);
|
||||
infoMap.put("Collection Stop", middleData.sample_collection_stop);
|
||||
infoMap.put("Sampling Time[h]", middleData.sample_time);
|
||||
infoMap.put("Sample Quantity[m3]", middleData.sample_quantity);
|
||||
infoMap.put("Decay Time[h]", middleData.sample_decay_time);
|
||||
infoMap.put("Acquisition Start", middleData.sample_acquisiton_start);
|
||||
infoMap.put("Acquisition Stop", middleData.sample_acquistion_stop);
|
||||
infoMap.put("Acquisition Time[s]", middleData.sample_acquistion_time);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
|
||||
// Read calibration finished
|
||||
writes.add(MyLogFormatUtil.getTitleFormat(MyLogFormatUtil.titleCalibrationIdEnd));
|
||||
|
||||
/* Starting Calibration */
|
||||
writes.add(MyLogFormatUtil.getTitleFormat(MyLogFormatUtil.GTitleCalibration));
|
||||
|
||||
// Energy Calibration [%1 ]
|
||||
if(middleData.calibration_pairs_E_idCalPoint.size()>0) {
|
||||
infoMap = new LinkedHashMap<>();
|
||||
infoMap.put("Energy Calibration [%1 ]".replace("%1", middleData.calibration_pairs_R_Input), "");
|
||||
infoMap.put("Function", middleData.calibration_E_functionTypeDef);
|
||||
infoMap.put("E", middleData.calibration_E_functionDef);
|
||||
infoMap.put("P", middleData.calibration_E_coeff_string);
|
||||
infoMap.put("Err", middleData.calibration_E_uncoeff_string);
|
||||
infoMap.put("Data", middleData.calibration_pairs_E_Input);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
}
|
||||
|
||||
// Resolution Calibration [%1 ]
|
||||
if(middleData.calibration_pairs_R_idCalPoint.size()>0) {
|
||||
infoMap = new LinkedHashMap<>();
|
||||
infoMap.put("Resolution Calibration [%1 ]".replace("%1", middleData.calibration_pairs_R_Input) , "");
|
||||
infoMap.put("Function", middleData.calibration_R_functionTypeDef);
|
||||
infoMap.put("E", middleData.calibration_R_functionDef);
|
||||
infoMap.put("P", middleData.calibration_R_coeff_string);
|
||||
infoMap.put("Err", middleData.calibration_R_uncoeff_string);
|
||||
infoMap.put("Data", middleData.calibration_pairs_R_Input);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
}
|
||||
|
||||
// Efficiency Calibration [PHD ]
|
||||
if(middleData.calibration_pairs_EF_idCalPoint.size()>0) {
|
||||
infoMap = new LinkedHashMap<>();
|
||||
infoMap.put("Efficiency Calibration [%1 ]".replace("%1", middleData.calibration_pairs_EF_Input), "");
|
||||
infoMap.put("Function", middleData.calibration_pairs_EF_Input);
|
||||
infoMap.put("E", middleData.calibration_EF_functionTypeDef);
|
||||
infoMap.put("P", middleData.calibration_EF_functionDef);
|
||||
infoMap.put("Err", middleData.calibration_EF_coeff_string);
|
||||
infoMap.put("Data", middleData.calibration_EF_uncoeff_string);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
}
|
||||
|
||||
if(middleData.calibration_pairs_T_idCalPoint.size()>0) {
|
||||
infoMap = new LinkedHashMap<>();
|
||||
infoMap.put("Tot_efficiency Calibration [%1 ]".replace("%1", middleData.calibration_pairs_T_Input), "");
|
||||
infoMap.put("Function", middleData.calibration_pairs_T_Input);
|
||||
infoMap.put("E", middleData.calibration_T_functionTypeDef);
|
||||
infoMap.put("P", middleData.calibration_T_functionDef);
|
||||
infoMap.put("Err", middleData.calibration_T_coeff_string);
|
||||
infoMap.put("Data", middleData.calibration_T_uncoeff_string);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
|
||||
}
|
||||
// Calibration Finished
|
||||
writes.add(MyLogFormatUtil.getTitleFormat(MyLogFormatUtil.GTitleCalibrationEnd));
|
||||
|
||||
/* Starting Spectrum Analysis */
|
||||
writes.add(MyLogFormatUtil.getTitleFormat(MyLogFormatUtil.GTitleSpectrum));
|
||||
|
||||
// PROCESSING PARAMETERS.....
|
||||
writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GGetPROCESSING));
|
||||
|
||||
infoMap = new LinkedHashMap<>();
|
||||
infoMap.put("ECutAnalysis_Low", middleData.setting_specSetup.getECutAnalysis_Low());
|
||||
infoMap.put("ECutAnalysis_High", middleData.setting_specSetup.getECutAnalysis_High());
|
||||
infoMap.put("EnergyTolerance", middleData.setting_specSetup.getEnergyTolerance());
|
||||
infoMap.put("BaseImprovePSS", middleData.setting_specSetup.getBaseImprovePSS());
|
||||
infoMap.put("PSS_low", middleData.setting_specSetup.getPSS_low());
|
||||
infoMap.put("k_back", middleData.setting_specSetup.getK_back());
|
||||
infoMap.put("k_alpha", middleData.setting_specSetup.getK_alpha());
|
||||
infoMap.put("k_beta", middleData.setting_specSetup.getK_beta());
|
||||
infoMap.put("RiskLevelK", middleData.setting_specSetup.getRiskLevelK());
|
||||
infoMap.put("refTime_act", middleData.setting_specSetup.getRefTime_act());
|
||||
infoMap.put("refTime_conc", middleData.setting_specSetup.getRefTime_conc());
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
|
||||
// CALIBRATION PARAMETERS.....
|
||||
writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GGetCALIBRATION));
|
||||
infoMap = new LinkedHashMap<>();
|
||||
infoMap.put("CalibrationPSS_low", middleData.setting_specSetup.getCalibrationPSS_low());
|
||||
infoMap.put("CalibrationPSS_high", middleData.setting_specSetup.getCalibrationPSS_high());
|
||||
infoMap.put("bUpdateCal", middleData.setting_specSetup.isBUpdateCal());
|
||||
infoMap.put("KeepCalPeakSearchPeaks", middleData.setting_specSetup.isKeepCalPeakSearchPeaks());
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
|
||||
// Nuclide Identified.....
|
||||
writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GGetPeakSearchResult));
|
||||
infoMap = new LinkedHashMap<>();
|
||||
int idPeakSize = middleData.peaks_idPeak.size();
|
||||
double peaksUsed = 0;
|
||||
for(int m=0;m<middleData.peaks_Nuclide_name.size();m++)
|
||||
{
|
||||
if(!middleData.peaks_Nuclide_name.get(m).isEmpty())
|
||||
{
|
||||
peaksUsed++;
|
||||
}
|
||||
}
|
||||
|
||||
infoMap.put("%1 peaks reported".replace("%1", idPeakSize + ""), "");
|
||||
|
||||
infoMap.put("%1 peaks with ID (%2%)"
|
||||
.replace("%1", peaksUsed+"")
|
||||
.replace("%2", (peaksUsed / idPeakSize * 100) + ""), "");
|
||||
|
||||
infoMap.put("%1 peaks without ID(%2%)"
|
||||
.replace("%1", (idPeakSize - peaksUsed) + "")
|
||||
.replace("%2", ((idPeakSize - peaksUsed) / (idPeakSize * 100)) + ""), "");
|
||||
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
|
||||
data = new ArrayList<>();
|
||||
item = new AttributeItemVo("PeakID", middleData.getPeaks_idPeak());
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Energy", MyLogFormatUtil.getValuePoint(middleData.getPeaks_Energy(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Centroid", MyLogFormatUtil.getValuePoint(middleData.getPeaks_peakCentroid(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("FWHM", MyLogFormatUtil.getValuePoint(middleData.getPeaks_Fwhm(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("NetArea", MyLogFormatUtil.getValuePoint(middleData.getPeaks_Area(), 3));
|
||||
data.add(item);
|
||||
List<String> percentData = MyLogFormatUtil.getPercent(middleData.getPeaks_areaErr(), middleData.getPeaks_Area());
|
||||
item = new AttributeItemVo("NAErr%", MyLogFormatUtil.getValuePoint(percentData, 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Signif", MyLogFormatUtil.getValuePoint(middleData.getPeaks_Significance(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Sensit", MyLogFormatUtil.getValuePoint(middleData.getPeaks_Sensitivity(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Nuclide", middleData.getPeaks_Nuclide_name());
|
||||
data.add(item);
|
||||
writes.addAll(MyLogFormatUtil.getBlock(MyLogFormatUtil.GSetSampleEfficiencyChannel, sampleId, data));
|
||||
|
||||
// Nuclide Identified.....
|
||||
writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GGetPeakSearchResult));
|
||||
StringBuilder qsNuclidesName = new StringBuilder();
|
||||
for(int m = 0; m < middleData.nucl_ided_Nuclidename.size() -1; m++)
|
||||
{
|
||||
qsNuclidesName.append(middleData.nucl_ided_Nuclidename.get(m)).append(",");
|
||||
}
|
||||
if(middleData.nucl_ided_Nuclidename.size() > 1)
|
||||
{
|
||||
qsNuclidesName.append(middleData.nucl_ided_Nuclidename.get(middleData.nucl_ided_Nuclidename.size() - 1));
|
||||
}
|
||||
infoMap = new LinkedHashMap<>();
|
||||
infoMap.put("Nuclides Identified", qsNuclidesName.toString());
|
||||
infoMap.put("Keyline Activities for Nuclides with defined Reference Line", "");
|
||||
infoMap.put("Activity Reference Time", middleData.getSample_acquisiton_start());
|
||||
infoMap.put("Concentration Reference Time", middleData.getSample_collection_start());
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
|
||||
data = new ArrayList<>();
|
||||
item = new AttributeItemVo("Nuclide", middleData.getNucl_ided_Nuclidename());
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Halflife", middleData.getNucl_ided_Halflife());
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Activity",
|
||||
MyLogFormatUtil.getValuePoint(middleData.getNucl_ided_activ_key(), 3), "bq");
|
||||
data.add(item);
|
||||
List<String> ideaPercent = MyLogFormatUtil.getPercent(middleData.getNucl_ided_activ_key_err(), middleData.getNucl_ided_activ_key());
|
||||
item = new AttributeItemVo("RelErr", ideaPercent, "%");
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Conc", middleData.getNucl_ided_Concentration(), "uBq/m^3");
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("MDC", middleData.getNucl_ided_MDC(), "uBq/m^3");
|
||||
data.add(item);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
|
||||
// Starting Data Quality.....
|
||||
writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GGetDataQuality));
|
||||
data = new ArrayList<>();
|
||||
item = new AttributeItemVo("Name", middleData.getQC_CHECK_QC_NAME());
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Pass/Fail", MyLogFormatUtil.getPass(middleData.getQC_CHECK_QC_RESULT()));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Value", MyLogFormatUtil.getValuePoint(middleData.getQC_CHECK_QC_VALUE(), 3));
|
||||
data.add(item);
|
||||
item = new AttributeItemVo("Test", middleData.getQC_CHECK_QC_STANDARD());
|
||||
data.add(item);
|
||||
writes.addAll(MyLogFormatUtil.getBlockContext(infoMap));
|
||||
|
||||
// Spectrum Analysis Finished
|
||||
writes.add(MyLogFormatUtil.getTitleFormat(MyLogFormatUtil.GTitleSpectrumEnd));
|
||||
// todo Data store successfully .....
|
||||
// todo Instance status successfully set to: P.....
|
||||
// todo Error info: data has NULL INF.....
|
||||
|
||||
|
||||
// Sample Analyse Successfully at %1
|
||||
String analyseEnd = MyLogFormatUtil.analyseResultsEnd.replace("%1", "date");
|
||||
writes.add(MyLogFormatUtil.getTitleFormat(analyseEnd));
|
||||
|
||||
FileUtil.writeLines(writes, logFilePath, "utf8");
|
||||
}
|
||||
|
||||
private static List<String> getAttribute(List<String> channel, String channelUnit, List<String> energys, String energyUnit,
|
||||
List<String> errors, String errorUnit){
|
||||
|
||||
List<List<String>> data = new ArrayList<>();
|
||||
List<String> result = new ArrayList<>();
|
||||
|
||||
// 初始化数据
|
||||
for (int i = 0; i < channel.size(); i++) {
|
||||
data.add(Arrays.asList(
|
||||
"Channel : " + channel.get(i) + " " + channelUnit,
|
||||
"Energy : " + energys.get(i) + " " + energyUnit,
|
||||
"Error : " + errors.get(i) + " " + errorUnit)
|
||||
);
|
||||
}
|
||||
// 计算每列数据中最长的字符串长度
|
||||
int[] columnWidths = new int[data.get(0).size()];
|
||||
for (List<String> row : data) {
|
||||
for (int i = 0; i < row.size(); i++) {
|
||||
columnWidths[i] = Math.max(columnWidths[i], row.get(i).length());
|
||||
}
|
||||
}
|
||||
|
||||
// 构造格式化字符串
|
||||
StringBuilder formatBuilder = new StringBuilder();
|
||||
for (int i = 0; i < columnWidths.length; i++) {
|
||||
formatBuilder.append("%-" + (columnWidths[i] + 4) + "s");
|
||||
}
|
||||
formatBuilder.append("\n");
|
||||
String format = formatBuilder.toString();
|
||||
// 格式化输出日志
|
||||
for (List<String> row : data) {
|
||||
String log = String.format(format, row.toArray());
|
||||
result.add(log);
|
||||
System.out.print(log);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<String> channels = Arrays.asList("59.541", "88.034", "122.061", "165.857", "391.698", "661.657", "834.838", "898.036", "1115.540", "1173.230", "1332.490", "1836.050");
|
||||
List<String> energies = Arrays.asList("0.168", "0.176", "0.174", "0.155", "0.092", "0.059", "0.051", "0.040", "0.040", "0.031", "0.028", "0.022");
|
||||
List<String> errors = Arrays.asList("0.003", "0.004", "0.003", "0.003", "0.002", "0.001", "0.001", "0.001", "0.001", "0.001", "0.001", "0.000");
|
||||
getAttribute(channels,"",energies,"",errors,"");
|
||||
}
|
||||
|
||||
public void saveAnalysis(GStoreMiddleProcessData middleData,Integer sampleId){
|
||||
GardsAnalyses analysis = toAnalysis(middleData);
|
||||
analysis.setSampleId(sampleId);
|
||||
|
@ -303,12 +687,14 @@ public class Sample_G_Analysis {
|
|||
}
|
||||
}
|
||||
|
||||
public void getNuclideLinesG(){
|
||||
|
||||
public Map<String, NuclideLines> getNuclideLinesG() {
|
||||
Object nuclideLibs = redisUtil.get(RedisConstant.NUCLIDE_LINES_LIB + "G");
|
||||
return Objects.isNull(nuclideLibs) ? Maps.newHashMap() : (Map<String, NuclideLines>) nuclideLibs;
|
||||
}
|
||||
|
||||
public void getNuclideLinesP(){
|
||||
|
||||
public Map<String, NuclideLines> getNuclideLinesP(){
|
||||
Object nuclideLibs = redisUtil.get(RedisConstant.NUCLIDE_LINES_LIB + "P");
|
||||
return Objects.isNull(nuclideLibs) ? Maps.newHashMap() : (Map<String, NuclideLines>) nuclideLibs;
|
||||
}
|
||||
|
||||
public Map<String,String> fieldMap(){
|
||||
|
@ -407,7 +793,7 @@ public class Sample_G_Analysis {
|
|||
setting.setECutAnalysis_High(Double.POSITIVE_INFINITY);
|
||||
}
|
||||
String systemType = energySpectrumStruct.system_type;
|
||||
if (StrUtil.equals(systemType,"P")){
|
||||
if (StrUtil.equals(systemType, SpectrumSystemType.P.name())){
|
||||
String ECutAnalysis_Low = mapSetting.get(Setting.ECUTANALYSIS_LOW_P);
|
||||
if (StrUtil.isNotBlank(ECutAnalysis_Low))
|
||||
setting.setECutAnalysis_Low(Double.parseDouble(ECutAnalysis_Low));
|
||||
|
@ -524,4 +910,43 @@ public class Sample_G_Analysis {
|
|||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
private void setPHDFile(PHDFile phdFile, EnergySpectrumStruct spectrumStruct) {
|
||||
HeaderBlock headerBlock = new HeaderBlock();
|
||||
BeanUtil.copyProperties(spectrumStruct, headerBlock);
|
||||
phdFile.setHeader(headerBlock);
|
||||
|
||||
CollectionBlock collectionBlock = new CollectionBlock();
|
||||
BeanUtil.copyProperties(spectrumStruct, collectionBlock);
|
||||
phdFile.setCollect(collectionBlock);
|
||||
|
||||
// MessageInfo
|
||||
MessageInfo messageInfo = new MessageInfo();
|
||||
BeanUtil.copyProperties(spectrumStruct, messageInfo);
|
||||
phdFile.setMsgInfo(messageInfo);
|
||||
// AcquisitionBlock
|
||||
AcquisitionBlock acquisitionBlock = new AcquisitionBlock();
|
||||
BeanUtil.copyProperties(spectrumStruct, acquisitionBlock);
|
||||
phdFile.setAcq(acquisitionBlock);
|
||||
// GSpectrumBlock
|
||||
GSpectrumBlock gSpectrumBlock = new GSpectrumBlock();
|
||||
BeanUtil.copyProperties(spectrumStruct, gSpectrumBlock);
|
||||
phdFile.setSpec(gSpectrumBlock);
|
||||
// ProcessingBlock
|
||||
ProcessingBlock processingBlock = new ProcessingBlock();
|
||||
BeanUtil.copyProperties(spectrumStruct, processingBlock);
|
||||
phdFile.setProcess(processingBlock);
|
||||
// CalibrationBlock
|
||||
CalibrationBlock calibrationBlock = new CalibrationBlock();
|
||||
BeanUtil.copyProperties(spectrumStruct, calibrationBlock);
|
||||
phdFile.setCalibration(calibrationBlock);
|
||||
// SampleBlock
|
||||
SampleBlock sampleBlock = new SampleBlock();
|
||||
BeanUtil.copyProperties(spectrumStruct, sampleBlock);
|
||||
phdFile.setSampleBlock(sampleBlock);
|
||||
// CertificateBlock
|
||||
CertificateBlock certificateBlock = new CertificateBlock();
|
||||
BeanUtil.copyProperties(spectrumStruct, certificateBlock);
|
||||
phdFile.setCertificate(certificateBlock);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,10 +62,14 @@ public class SamplephdSpectrum extends S_D_Q_G_SpectrumHandler{
|
|||
* @throws Exception
|
||||
*/
|
||||
protected void autoAnalysis() throws Exception {
|
||||
if(this.sourceData.system_type.equals(SystemType.BETA.getType())){
|
||||
Sample_B_Analysis bAnalysis = new Sample_B_Analysis(super.sampleData,super.mailFile.getAbsolutePath(),
|
||||
super.spectrumServiceQuotes,super.sourceData,super.ftpUtil,super.logFilePath,super.logFileName);
|
||||
bAnalysis.start();
|
||||
// if(this.sourceData.system_type.equals(SystemType.BETA.getType())){
|
||||
// Sample_B_Analysis bAnalysis = new Sample_B_Analysis(super.sampleData,super.mailFile.getAbsolutePath(),
|
||||
// super.spectrumServiceQuotes,super.sourceData,super.ftpUtil,super.logFilePath,super.logFileName);
|
||||
// bAnalysis.start();
|
||||
// }
|
||||
if (this.sourceData.system_type.equals(SystemType.GAMMA.getType())) {
|
||||
Sample_G_Analysis sample_g_analysis = new Sample_G_Analysis(super.sourceData, super.spectrumServiceQuotes, super.sampleData);
|
||||
sample_g_analysis.analysis();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2562,9 +2562,13 @@ public class GammaFileUtil {
|
|||
strBuffer.append("..................................... Spectrum Analysis Finished .....................................");
|
||||
strBuffer.append("\n");
|
||||
strBuffer.append("Data store successfully .....");
|
||||
strBuffer.append("\n");
|
||||
strBuffer.append("Instance status successfully set to: .....");
|
||||
strBuffer.append("\n");
|
||||
strBuffer.append("Error info: data has NULL INF.....");
|
||||
strBuffer.append("\n");
|
||||
strBuffer.append("------------------------- Sample Analyse Successfully at "+DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss")+" -------------------------");
|
||||
strBuffer.append("\n");
|
||||
return strBuffer.toString();
|
||||
}
|
||||
|
||||
|
@ -2595,7 +2599,7 @@ public class GammaFileUtil {
|
|||
strBuffer.append(" \n");
|
||||
String qsNuclidesName = "";
|
||||
for(int m=0;m<middleData.nucl_ided_Nuclidename.size()-1;m++) {
|
||||
qsNuclidesName = qsNuclidesName+ middleData.nucl_ided_Nuclidename.get(m) + ",";
|
||||
qsNuclidesName = qsNuclidesName+ middleData.nucl_ided_Nuclidename.get(m) + ";";
|
||||
}
|
||||
if(middleData.nucl_ided_Nuclidename.size()>1) {
|
||||
qsNuclidesName = qsNuclidesName+middleData.nucl_ided_Nuclidename.get(middleData.nucl_ided_Nuclidename.size()-1);
|
||||
|
@ -2720,34 +2724,24 @@ public class GammaFileUtil {
|
|||
public List<String> DoubleLimit_I(List<Double> _data) {
|
||||
List<String> rdata = new LinkedList<>();
|
||||
for(int pos=0;pos<_data.size();pos++) {
|
||||
if(Objects.isNull(_data.get(pos))) {
|
||||
Double value = _data.get(pos);
|
||||
if(Objects.isNull(value)) {
|
||||
rdata.add("NULL");
|
||||
} else {
|
||||
rdata.add(String.valueOf(_data.get(pos).intValue()));
|
||||
rdata.add(String.valueOf(value));
|
||||
}
|
||||
}
|
||||
return rdata;
|
||||
}
|
||||
|
||||
public List<String> DoubleLimit_G(List<Double> _data) {
|
||||
NumberFormat numberFormat = new DecimalFormat("0.##########E0");
|
||||
List<String> rdata = new LinkedList<>();
|
||||
for(int pos=0;pos<_data.size();pos++) {
|
||||
Double value = _data.get(pos);
|
||||
if (String.valueOf(value).indexOf("e")>0) {
|
||||
if(Objects.isNull(value)) {
|
||||
rdata.add("NULL");
|
||||
} else {
|
||||
rdata.add(numberFormat.format(value));
|
||||
}
|
||||
if(Objects.isNull(value)) {
|
||||
rdata.add("NULL");
|
||||
} else {
|
||||
if (String.format("%.1f", value).indexOf(".0")>0) {
|
||||
rdata.addAll(DoubleLimit_I(_data));
|
||||
break;
|
||||
} else {
|
||||
rdata.addAll(DoubleLimit(_data));
|
||||
break;
|
||||
}
|
||||
rdata.add(String.format("%.10g", value));
|
||||
}
|
||||
}
|
||||
return rdata;
|
||||
|
@ -2855,9 +2849,6 @@ public class GammaFileUtil {
|
|||
String qsSaveBaseLine = StringPool.SLASH+spectrumPathProperties.getRootPath()+StringPool.SLASH+qsBaseLinePath;
|
||||
String qsSaveLc = StringPool.SLASH+spectrumPathProperties.getRootPath()+StringPool.SLASH+qsLcPath;
|
||||
String qsSaveScac = StringPool.SLASH+spectrumPathProperties.getRootPath()+StringPool.SLASH+qsScacPath;
|
||||
middleData.analyses_baseline_filePath = qsSaveBaseLine;
|
||||
middleData.analyses_lc_filePath = qsSaveLc;
|
||||
middleData.analyses_scac_filePath = qsSaveScac;
|
||||
// WriteBaseInfo(fileAnlyse.getBaseCtrls(),qsSaveBaseLine);
|
||||
// WriteLcScac(fileAnlyse.getVLc(),"Lc",qsSaveLc);
|
||||
// WriteLcScac(fileAnlyse.getVScac(),"Scac",qsSaveScac);
|
||||
|
@ -2876,6 +2867,16 @@ public class GammaFileUtil {
|
|||
middleData.analyses_searchThreshold = fileAnlyse.getUsedSetting().getEnergyTolerance();
|
||||
middleData.analyses_numberOfPeaks = fileAnlyse.getVPeak().size();
|
||||
middleData.analyses_totalCounts = totalNumber;
|
||||
middleData.analyses_baseline_filePath = qsBaseLinePath;
|
||||
middleData.analyses_lc_filePath = qsLcPath;
|
||||
middleData.analyses_scac_filePath = qsScacPath;
|
||||
|
||||
middleData.analyses_baseline_absolute_filePath =qsSaveLc;
|
||||
middleData.analyses_lc_absolute_filePath=qsSaveLc;
|
||||
middleData.analyses_scac_absolute_filePath=qsSaveScac;
|
||||
middleData.analyses_save_absolute_filePath=spectrumPathProperties.getRootPath()+StringPool.SLASH+qsSaveFile;
|
||||
middleData.analyses_absolute_LogPath=spectrumPathProperties.getLogPath()+StringPool.SLASH+qsLogPath;
|
||||
middleData.analyses_absolute_ReportPath=spectrumPathProperties.getRootPath()+StringPool.SLASH+qsReportPath;
|
||||
|
||||
if(fileAnlyse.getUsedEnerKD() != null && fileAnlyse.getUsedEnerKD().getG_energy().size() != 0) {
|
||||
middleData.calibration_pairs_E_Caltype = CalType.ENERGY_CAL.getType();
|
||||
|
@ -2975,7 +2976,6 @@ public class GammaFileUtil {
|
|||
//拼写刻度字符串
|
||||
//获取刻度描述字符串
|
||||
middleData.calibration_sample_type = fileAnlyse.getHeader().getSystem_type();
|
||||
NumberFormat numberFormat = new DecimalFormat("0.######E0");
|
||||
String coeffEnergy = "";
|
||||
String uncerEnergy = "";
|
||||
String funcDefEnergy = "";
|
||||
|
@ -2988,18 +2988,18 @@ public class GammaFileUtil {
|
|||
funcType = fileAnlyse.getUsedEnerPara().getP().get(0).intValue();
|
||||
}
|
||||
for(int m=1;m<coeffNumber-1;m++) {
|
||||
coeffEnergy += numberFormat.format(fileAnlyse.getUsedEnerPara().getP().get(m))+',';
|
||||
coeffEnergy += String.format("%e", fileAnlyse.getUsedEnerPara().getP().get(m))+ ",";
|
||||
}
|
||||
if(coeffNumber>0) {
|
||||
coeffEnergy+=numberFormat.format(fileAnlyse.getUsedEnerPara().getP().get(coeffNumber-1));
|
||||
coeffEnergy+=String.format("%e", fileAnlyse.getUsedEnerPara().getP().get(coeffNumber-1));
|
||||
}
|
||||
|
||||
uncerNumber = fileAnlyse.getUsedEnerPara().getPerr().size();
|
||||
for(int m=0;m<uncerNumber-1;m++) {
|
||||
uncerEnergy += numberFormat.format(fileAnlyse.getUsedEnerPara().getPerr().get(m))+',';
|
||||
uncerEnergy += String.format("%e", fileAnlyse.getUsedEnerPara().getPerr().get(m))+ ",";
|
||||
}
|
||||
if(uncerNumber>0) {
|
||||
uncerEnergy+=numberFormat.format(fileAnlyse.getUsedEnerPara().getPerr().get(uncerNumber-1));
|
||||
uncerEnergy+=String.format("%e", fileAnlyse.getUsedEnerPara().getPerr().get(uncerNumber-1));
|
||||
}
|
||||
funcDefEnergy = EquationDescription(funcType);
|
||||
funcTypeDefEnergy = EquationName(funcType);
|
||||
|
@ -3021,18 +3021,18 @@ public class GammaFileUtil {
|
|||
funcType = fileAnlyse.getUsedEffiPara().getP().get(0).intValue();
|
||||
}
|
||||
for(int m=1;m<coeffNumber-1;m++) {
|
||||
coeffEffi += numberFormat.format(fileAnlyse.getUsedEffiPara().getP().get(m))+',';
|
||||
coeffEffi += String.format("%e", fileAnlyse.getUsedEffiPara().getP().get(m))+ ",";
|
||||
}
|
||||
if(coeffNumber>0) {
|
||||
coeffEffi+=numberFormat.format(fileAnlyse.getUsedEffiPara().getP().get(coeffNumber-1));
|
||||
coeffEffi+=String.format("%e", fileAnlyse.getUsedEffiPara().getP().get(coeffNumber-1));
|
||||
}
|
||||
|
||||
uncerNumber = fileAnlyse.getUsedEffiPara().getPerr().size();
|
||||
for(int m=0;m<uncerNumber-1;m++) {
|
||||
uncerEffi += numberFormat.format(fileAnlyse.getUsedEffiPara().getPerr().get(m))+',';
|
||||
uncerEffi += String.format("%e", fileAnlyse.getUsedEffiPara().getPerr().get(m))+ ",";
|
||||
}
|
||||
if(uncerNumber>0) {
|
||||
uncerEffi+= numberFormat.format(fileAnlyse.getUsedEffiPara().getPerr().get(uncerNumber-1));
|
||||
uncerEffi+= String.format("%e", fileAnlyse.getUsedEffiPara().getPerr().get(uncerNumber-1));
|
||||
}
|
||||
funcDefEffi = EquationDescription(funcType);
|
||||
funcTypeDefEffi = EquationName(funcType);
|
||||
|
@ -3053,18 +3053,18 @@ public class GammaFileUtil {
|
|||
funcType = fileAnlyse.getUsedResoPara().getP().get(0).intValue();
|
||||
}
|
||||
for(int m=1;m<coeffNumber-1;m++) {
|
||||
coeffReso += numberFormat.format(fileAnlyse.getUsedResoPara().getP().get(m))+',';
|
||||
coeffReso += String.format("%e", fileAnlyse.getUsedResoPara().getP().get(m))+ ",";
|
||||
}
|
||||
if(coeffNumber>0) {
|
||||
coeffReso+= numberFormat.format(fileAnlyse.getUsedResoPara().getP().get(coeffNumber-1));
|
||||
coeffReso+= String.format("%e", fileAnlyse.getUsedResoPara().getP().get(coeffNumber-1));
|
||||
}
|
||||
|
||||
uncerNumber = fileAnlyse.getUsedResoPara().getPerr().size();
|
||||
for(int m=0;m<uncerNumber-1;m++) {
|
||||
uncerReso += numberFormat.format(fileAnlyse.getUsedResoPara().getPerr().get(m))+',';
|
||||
uncerReso += String.format("%e", fileAnlyse.getUsedResoPara().getPerr().get(m))+ ",";
|
||||
}
|
||||
if(uncerNumber>0) {
|
||||
uncerReso+= numberFormat.format(fileAnlyse.getUsedResoPara().getPerr().get(uncerNumber-1));
|
||||
uncerReso+= String.format("%e", fileAnlyse.getUsedResoPara().getPerr().get(uncerNumber-1));
|
||||
}
|
||||
funcDefReso = EquationDescription(funcType);
|
||||
funcTypeDefReso = EquationName(funcType);
|
||||
|
@ -3085,18 +3085,18 @@ public class GammaFileUtil {
|
|||
funcType = fileAnlyse.getUsedTotEPara().getP().get(0).intValue();
|
||||
}
|
||||
for(int m=1;m<coeffNumber-1;m++) {
|
||||
coeffTotE += numberFormat.format(fileAnlyse.getUsedTotEPara().getP().get(m))+',';
|
||||
coeffTotE += String.format("%e", fileAnlyse.getUsedTotEPara().getP().get(m))+ ",";
|
||||
}
|
||||
if(coeffNumber>0) {
|
||||
coeffTotE+= numberFormat.format(fileAnlyse.getUsedTotEPara().getP().get(coeffNumber-1));
|
||||
coeffTotE+= String.format("%e", fileAnlyse.getUsedTotEPara().getP().get(coeffNumber-1));
|
||||
}
|
||||
|
||||
uncerNumber = fileAnlyse.getUsedTotEPara().getPerr().size();
|
||||
for(int m=0;m<uncerNumber-1;m++) {
|
||||
uncerTotE += numberFormat.format(fileAnlyse.getUsedTotEPara().getPerr().get(m))+',';
|
||||
uncerTotE += String.format("%e", fileAnlyse.getUsedTotEPara().getPerr().get(m))+ ",";
|
||||
}
|
||||
if(uncerNumber>0) {
|
||||
uncerTotE+= numberFormat.format(fileAnlyse.getUsedTotEPara().getPerr().get(uncerNumber-1));
|
||||
uncerTotE+= String.format("%e", fileAnlyse.getUsedTotEPara().getPerr().get(uncerNumber-1));
|
||||
}
|
||||
funcDefTotE = EquationDescription(funcType);
|
||||
funcTypeDefTotE = EquationName(funcType);
|
||||
|
@ -3247,11 +3247,11 @@ public class GammaFileUtil {
|
|||
dvctUNCENERGY.add(itor.getValue().getVUncertE().get(m));
|
||||
dvctABUNDANCE.add(itor.getValue().getVYield().get(m));
|
||||
dvctUNCABUNDANCE.add(itor.getValue().getVUncertY().get(m));
|
||||
dvctACTIVITY.add(numberFormat.format(itor.getValue().getActivity()));
|
||||
dvctACTIVITY.add(String.format("%e", itor.getValue().getActivity()));
|
||||
dvctUNCACTIVITY.add(itor.getValue().getAct_err());
|
||||
dvctEFFIC.add(itor.getValue().getEfficiency());
|
||||
dvctUNEFFIC.add(itor.getValue().getEffi_err());
|
||||
dvctMDA.add(numberFormat.format(itor.getValue().getMda()));
|
||||
dvctMDA.add(itor.getValue().getMda()>0?String.format("%e", itor.getValue().getMda()):"0.0");
|
||||
// dvctKEY_FLAG.add(itor.value().vYield.get(m));
|
||||
dvctCSC_RATIO.add(1.0);
|
||||
dvctCSC_RATIO_ERR.add(0.0);
|
||||
|
@ -3261,8 +3261,8 @@ public class GammaFileUtil {
|
|||
} else {
|
||||
dvctKEY_FLAG.add(0.0);
|
||||
}
|
||||
dvctMDC.add(numberFormat.format(itor.getValue().getMdc()));
|
||||
dvctCONCENTRATION.add(numberFormat.format(itor.getValue().getConcentration()));
|
||||
dvctMDC.add(String.format("%e", itor.getValue().getMdc()));
|
||||
dvctCONCENTRATION.add(String.format("%e", itor.getValue().getConcentration()));
|
||||
}
|
||||
nucl_lines_ided_data.nuclideFullname = svctNUCLIDEFULLNAME;
|
||||
nucl_lines_ided_data.idPeak =DoubleLimit_I(dvctIDPEAK);
|
||||
|
@ -3285,34 +3285,34 @@ public class GammaFileUtil {
|
|||
}
|
||||
// gards_ nucl_ided数据表
|
||||
if( fileAnlyse.getMapNucActMda().size() != 0) {
|
||||
List<String> svctNUCLIDEFULLNAME1 = new LinkedList<>();
|
||||
List<String> svctNUCLIDEFULLNAME = new LinkedList<>();
|
||||
List<String> svctTYPE = new LinkedList<>();
|
||||
List<Double> dvctHALFLIFE = new LinkedList<>();
|
||||
List<String> dvctAVE_ACTIV = new LinkedList<>();
|
||||
List<Double> dvctAVE_ACTIV_ERR = new LinkedList<>();
|
||||
List<Double> dvctACTIV_KEY = new LinkedList<>();
|
||||
List<Double> dvctACTIV_KEY_ERR = new LinkedList<>();
|
||||
List<String> dvctMDA1 = new LinkedList<>();
|
||||
List<String> dvctMDA = new LinkedList<>();
|
||||
List<Double> dvctMDA_ERR = new LinkedList<>();
|
||||
List<Double> dvctNID_FLAG = new LinkedList<>();
|
||||
List<Double> dvctCSC_RATIO1 = new LinkedList<>();
|
||||
List<Double> dvctCSC_RATIO_ERR1 = new LinkedList<>();
|
||||
List<Double> dvctCSC_MOD_FLAG1 = new LinkedList<>();
|
||||
List<String> dvctMDC1 = new LinkedList<>();
|
||||
List<String> dvctCONCENTRATION1 = new LinkedList<>();
|
||||
List<Double> dvctCSC_RATIO = new LinkedList<>();
|
||||
List<Double> dvctCSC_RATIO_ERR = new LinkedList<>();
|
||||
List<Double> dvctCSC_MOD_FLAG = new LinkedList<>();
|
||||
List<String> dvctMDC = new LinkedList<>();
|
||||
List<String> dvctCONCENTRATION = new LinkedList<>();
|
||||
List<Double> dvctKey_Energy = new LinkedList<>();
|
||||
List<Double> dvctKey_Yield = new LinkedList<>();
|
||||
for(Map.Entry<String, NuclideActMda> itor_v: fileAnlyse.getMapNucActMda().entrySet()) {
|
||||
String nuclideName = itor_v.getKey();
|
||||
svctNUCLIDEFULLNAME1.add(nuclideName);
|
||||
svctNUCLIDEFULLNAME.add(nuclideName);
|
||||
dvctHALFLIFE.add(itor_v.getValue().getHalflife());
|
||||
dvctACTIV_KEY.add(itor_v.getValue().getActivity());
|
||||
dvctACTIV_KEY_ERR.add(itor_v.getValue().getAct_err());
|
||||
dvctMDA1.add(numberFormat.format(itor_v.getValue().getMda()));
|
||||
dvctMDC1.add(numberFormat.format(itor_v.getValue().getMdc()));
|
||||
dvctCONCENTRATION1.add(numberFormat.format(itor_v.getValue().getConcentration()));
|
||||
dvctCSC_RATIO1.add(1.0);
|
||||
dvctCSC_RATIO_ERR1.add(0.0);
|
||||
dvctMDA.add(String.format("%e", itor_v.getValue().getMda()));
|
||||
dvctMDC.add(itor_v.getValue().getMdc()>0?String.format("%e", itor_v.getValue().getMdc()):"0.0");
|
||||
dvctCONCENTRATION.add(String.format("%e", itor_v.getValue().getConcentration()));
|
||||
dvctCSC_RATIO.add(1.0);
|
||||
dvctCSC_RATIO_ERR.add(0.0);
|
||||
if(itor_v.getValue().getCalculateIdx() >= 0 && itor_v.getValue().getCalculateIdx()<itor_v.getValue().getVEnergy().size()) {
|
||||
dvctKey_Energy.add(itor_v.getValue().getVEnergy().get(itor_v.getValue().getCalculateIdx()));
|
||||
}
|
||||
|
@ -3320,21 +3320,21 @@ public class GammaFileUtil {
|
|||
dvctKey_Yield.add(itor_v.getValue().getVYield().get(itor_v.getValue().getCalculateIdx()));
|
||||
}
|
||||
}
|
||||
middleData.nucl_ided_Nuclidename = svctNUCLIDEFULLNAME1;
|
||||
middleData.nucl_ided_Nuclidename = svctNUCLIDEFULLNAME;
|
||||
middleData.nucl_ided_Type= svctTYPE;
|
||||
middleData.nucl_ided_Halflife =DoubleLimit_G(dvctHALFLIFE);
|
||||
middleData.nucl_ided_ave_activ = dvctAVE_ACTIV;
|
||||
middleData.nucl_ided_ave_activ_err =DoubleLimit_G(dvctAVE_ACTIV_ERR);
|
||||
middleData.nucl_ided_activ_key =DoubleLimit_G(dvctACTIV_KEY);
|
||||
middleData.nucl_ided_activ_key_err =DoubleLimit_G(dvctACTIV_KEY_ERR);
|
||||
middleData.nucl_ided_mda = dvctMDA1;
|
||||
middleData.nucl_ided_mda = dvctMDA;
|
||||
middleData.nucl_ided_mda_err =DoubleLimit_G(dvctMDA_ERR);
|
||||
middleData.nucl_ided_nid_flag =DoubleLimit_G(dvctNID_FLAG);
|
||||
middleData.nucl_ided_csc_ratio =DoubleLimit_G(dvctCSC_RATIO1);
|
||||
middleData.nucl_ided_csc_ratio_err =DoubleLimit_G(dvctCSC_RATIO_ERR1);
|
||||
middleData.nucl_ided_csc_mod_flag =DoubleLimit_G(dvctCSC_MOD_FLAG1);
|
||||
middleData.nucl_ided_MDC = dvctMDC1;
|
||||
middleData.nucl_ided_Concentration = dvctCONCENTRATION1;
|
||||
middleData.nucl_ided_csc_ratio =DoubleLimit_G(dvctCSC_RATIO);
|
||||
middleData.nucl_ided_csc_ratio_err =DoubleLimit_G(dvctCSC_RATIO_ERR);
|
||||
middleData.nucl_ided_csc_mod_flag =DoubleLimit_G(dvctCSC_MOD_FLAG);
|
||||
middleData.nucl_ided_MDC = dvctMDC;
|
||||
middleData.nucl_ided_Concentration = dvctCONCENTRATION;
|
||||
middleData.nucl_ided_Key_Energy = DoubleLimit_G(dvctKey_Energy);
|
||||
middleData.nucl_ided_Key_Yield = DoubleLimit_G(dvctKey_Yield);
|
||||
}
|
||||
|
|
|
@ -819,101 +819,6 @@ public class PHDFileUtil {
|
|||
resultIn.setMdc_Xe135(bgAnalyseResult.MDC_Xe135);
|
||||
resultIn.setLc_Xe135(bgAnalyseResult.LC_Xe135);
|
||||
resultIn.setXe135Flag(bgAnalyseResult.XE_135_NID_FLAG);
|
||||
|
||||
List<GardsCalibrationSpectrum> gammaCalibrationSpectrumList = new LinkedList<>();
|
||||
GardsCalibrationSpectrum gammaCalibrationS = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
|
||||
gammaCalibrationS.setCoeff1(bgAnalyseResult.s_g_fitting_c_e.get(0));
|
||||
gammaCalibrationS.setCoeff2(bgAnalyseResult.s_g_fitting_c_e.get(1));
|
||||
gammaCalibrationS.setCoeff3(bgAnalyseResult.s_g_fitting_c_e.get(2));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationS);
|
||||
GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
|
||||
gammaCalibrationG.setCoeff1(bgAnalyseResult.g_g_fitting_c_e.get(0));
|
||||
gammaCalibrationG.setCoeff2(bgAnalyseResult.g_g_fitting_c_e.get(1));
|
||||
gammaCalibrationG.setCoeff3(bgAnalyseResult.g_g_fitting_c_e.get(2));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationG);
|
||||
GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
|
||||
gammaCalibrationD.setCoeff1(bgAnalyseResult.d_g_fitting_c_e.get(0));
|
||||
gammaCalibrationD.setCoeff2(bgAnalyseResult.d_g_fitting_c_e.get(1));
|
||||
gammaCalibrationD.setCoeff3(bgAnalyseResult.d_g_fitting_c_e.get(2));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationD);
|
||||
List<GardsCalibrationSpectrum> betaCalibrationSpectrumList = new LinkedList<>();
|
||||
GardsCalibrationSpectrum betaCalibrationS = new GardsCalibrationSpectrum();
|
||||
betaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
|
||||
gammaCalibrationS.setCoeff1(bgAnalyseResult.s_b_fitting_c_e.get(0));
|
||||
gammaCalibrationS.setCoeff2(bgAnalyseResult.s_b_fitting_c_e.get(1));
|
||||
gammaCalibrationS.setCoeff3(bgAnalyseResult.s_b_fitting_c_e.get(2));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationS);
|
||||
GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum();
|
||||
betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
|
||||
betaCalibrationG.setCoeff1(bgAnalyseResult.g_b_fitting_c_e.get(0));
|
||||
betaCalibrationG.setCoeff2(bgAnalyseResult.g_b_fitting_c_e.get(1));
|
||||
betaCalibrationG.setCoeff3(bgAnalyseResult.g_b_fitting_c_e.get(2));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationG);
|
||||
GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum();
|
||||
betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
|
||||
betaCalibrationD.setCoeff1(bgAnalyseResult.d_b_fitting_c_e.get(0));
|
||||
betaCalibrationD.setCoeff2(bgAnalyseResult.d_b_fitting_c_e.get(1));
|
||||
betaCalibrationD.setCoeff3(bgAnalyseResult.d_b_fitting_c_e.get(2));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationD);
|
||||
List<GardsROIChannelsSpectrum> roiChannelsSpectrumList = new LinkedList<>();
|
||||
for (int i=0; i<bgAnalyseResult.S_ROI_B_Boundary_start.size(); i++) {
|
||||
GardsROIChannelsSpectrum roiChannels = new GardsROIChannelsSpectrum();
|
||||
roiChannels.setRoi(i+1);
|
||||
roiChannels.setBChanStart(bgAnalyseResult.S_ROI_B_Boundary_start.get(i));
|
||||
roiChannels.setBChanStop(bgAnalyseResult.S_ROI_B_Boundary_stop.get(i));
|
||||
roiChannels.setGChanStart(bgAnalyseResult.S_ROI_G_Boundary_start.get(i));
|
||||
roiChannels.setGChanStop(bgAnalyseResult.S_ROI_G_Boundary_stop.get(i));
|
||||
roiChannelsSpectrumList.add(roiChannels);
|
||||
}
|
||||
for (int i=0; i<bgAnalyseResult.G_ROI_B_Boundary_start.size(); i++) {
|
||||
GardsROIChannelsSpectrum roiChannels = new GardsROIChannelsSpectrum();
|
||||
roiChannels.setRoi(i+1);
|
||||
roiChannels.setBChanStart(bgAnalyseResult.G_ROI_B_Boundary_start.get(i));
|
||||
roiChannels.setBChanStop(bgAnalyseResult.G_ROI_B_Boundary_stop.get(i));
|
||||
roiChannels.setGChanStart(bgAnalyseResult.G_ROI_G_Boundary_start.get(i));
|
||||
roiChannels.setGChanStop(bgAnalyseResult.G_ROI_G_Boundary_stop.get(i));
|
||||
roiChannelsSpectrumList.add(roiChannels);
|
||||
}
|
||||
for (int i=0; i<bgAnalyseResult.D_ROI_B_Boundary_start.size(); i++) {
|
||||
GardsROIChannelsSpectrum roiChannels = new GardsROIChannelsSpectrum();
|
||||
roiChannels.setRoi(i+1);
|
||||
roiChannels.setBChanStart(bgAnalyseResult.D_ROI_B_Boundary_start.get(i));
|
||||
roiChannels.setBChanStop(bgAnalyseResult.D_ROI_B_Boundary_stop.get(i));
|
||||
roiChannels.setGChanStart(bgAnalyseResult.D_ROI_G_Boundary_start.get(i));
|
||||
roiChannels.setGChanStop(bgAnalyseResult.D_ROI_G_Boundary_stop.get(i));
|
||||
roiChannelsSpectrumList.add(roiChannels);
|
||||
}
|
||||
List<GardsROIResultsSpectrum> roiResultsSpectrumList = new LinkedList<>();
|
||||
for (int i=0; i<bgAnalyseResult.s_roi_cts.size(); i++) {
|
||||
GardsROIResultsSpectrum roiResults = new GardsROIResultsSpectrum();
|
||||
roiResults.setRoi(i+1);
|
||||
bgAnalyseResult.LC.add(0, 0.0);
|
||||
roiResults.setLc(bgAnalyseResult.LC.get(i));
|
||||
roiResults.setSGross(bgAnalyseResult.s_roi_cts.get(i));
|
||||
roiResults.setGGross(bgAnalyseResult.g_roi_cts.get(i));
|
||||
roiResults.setBGross(bgAnalyseResult.d_roi_cts.get(i));
|
||||
roiResults.setSNet(bgAnalyseResult.s_deduct_d_cts.get((i+1)*3));
|
||||
roiResults.setGNet(bgAnalyseResult.g_deduct_d_cts.get((i+1)*3));
|
||||
roiResults.setNet(bgAnalyseResult.ROI_net_coutns.get(i));
|
||||
roiResults.setNetErr(bgAnalyseResult.ROI_net_coutns_err.get(i));
|
||||
roiResults.setConc(bgAnalyseResult.ROI_con_uncer.get(i));
|
||||
roiResults.setConcErr(bgAnalyseResult.ROI_con_uncer_err.get(i));
|
||||
bgAnalyseResult.MDC.add(0, 0.0);
|
||||
roiResults.setMdc(bgAnalyseResult.MDC.get(i));
|
||||
if(bgAnalyseResult.ROI_con_uncer.get(i)>bgAnalyseResult.MDC.get(i)) {
|
||||
roiResults.setNidFlag(1);
|
||||
} else {
|
||||
roiResults.setNidFlag(0);
|
||||
}
|
||||
roiResultsSpectrumList.add(roiResults);
|
||||
}
|
||||
map.put("gammaCalibrationSpectrumList", gammaCalibrationSpectrumList);
|
||||
map.put("betaCalibrationSpectrumList", betaCalibrationSpectrumList);
|
||||
map.put("roiChannelsSpectrumList", roiChannelsSpectrumList);
|
||||
map.put("roiResultsSpectrumList", roiResultsSpectrumList);
|
||||
map.put("bProcessed", true);
|
||||
return resultIn;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class GammaController {
|
|||
}
|
||||
|
||||
@GetMapping("gammaByDB")
|
||||
public Result gammaByDB(@RequestParam Integer sampleId, @RequestParam String dbName, HttpServletRequest request){
|
||||
public Result gammaByDB(Integer sampleId, String dbName, HttpServletRequest request){
|
||||
return gammaService.gammaByDB(dbName, sampleId, request);
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class GammaController {
|
|||
|
||||
@GetMapping("configure")
|
||||
@ApiOperation(value = "analyze菜单下configure页面数据", notes = "analyze菜单下configure页面数据")
|
||||
public Result configure(@RequestParam Integer sampleId, @RequestParam String fileName) {
|
||||
public Result configure(Integer sampleId, String fileName) {
|
||||
return gammaService.configure(sampleId, fileName);
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class GammaController {
|
|||
|
||||
@GetMapping("InteractiveTool")
|
||||
@ApiOperation(value = "analyze菜单下InteractiveTool页面数据", notes = "analyze菜单下InteractiveTool页面数据")
|
||||
public Result InteractiveTool(@RequestParam Integer sampleId, @RequestParam String fileName, HttpServletRequest request) {
|
||||
public Result InteractiveTool(Integer sampleId, String fileName, HttpServletRequest request) {
|
||||
return gammaService.InteractiveTool(sampleId, fileName, request);
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ public class GammaController {
|
|||
|
||||
@GetMapping("energyCalibration")
|
||||
@ApiOperation(value = "查看Energy Calibration数据", notes = "查看Energy Calibration数据")
|
||||
public Result energyCalibration(@RequestParam Integer sampleId, String fileName, String currentText) {
|
||||
public Result energyCalibration(Integer sampleId, String fileName, String currentText) {
|
||||
return gammaService.energyCalibration(sampleId, fileName, currentText);
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ public class GammaController {
|
|||
|
||||
@GetMapping("resolutionCalibration")
|
||||
@ApiOperation(value = "查看Resolution Calibration数据", notes = "查看Resolution Calibration数据")
|
||||
public Result resolutionCalibration(@RequestParam Integer sampleId, String fileName, String currentText) {
|
||||
public Result resolutionCalibration(Integer sampleId, String fileName, String currentText) {
|
||||
return gammaService.resolutionCalibration(sampleId, fileName, currentText);
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ public class GammaController {
|
|||
|
||||
@GetMapping("EfficiencyCalibration")
|
||||
@ApiOperation(value = "查看Efficiency Calibration数据", notes = "查看Efficiency Calibration数据")
|
||||
public Result EfficiencyCalibration(@RequestParam Integer sampleId, String fileName, String currentText) {
|
||||
public Result EfficiencyCalibration(Integer sampleId, String fileName, String currentText) {
|
||||
return gammaService.EfficiencyCalibration(sampleId, fileName, currentText);
|
||||
}
|
||||
|
||||
|
@ -265,18 +265,18 @@ public class GammaController {
|
|||
|
||||
@GetMapping("viewComment")
|
||||
@ApiOperation(value = "查看Comment页面数据", notes = "查看Comment页面数据")
|
||||
public Result viewComment(@RequestParam Integer sampleId, String fileName) {
|
||||
public Result viewComment(Integer sampleId, String fileName) {
|
||||
return gammaService.viewComment(sampleId, fileName);
|
||||
}
|
||||
|
||||
@GetMapping("peakInformation")
|
||||
@ApiOperation(value = "查看Peak Information页面数据", notes = "查看Peak Information页面数据")
|
||||
public Result<?> peakInformation(@RequestParam Integer sampleId, String fileName){
|
||||
public Result<?> peakInformation(Integer sampleId, String fileName){
|
||||
return gammaService.peakInformation(sampleId, fileName);
|
||||
}
|
||||
|
||||
@GetMapping("exportPeakInformation")
|
||||
public void exportPeakInformation(@RequestParam Integer sampleId, String fileName,
|
||||
public void exportPeakInformation(Integer sampleId, String fileName,
|
||||
HttpServletResponse response){
|
||||
gammaService.exportPeakInformation(sampleId, fileName, response);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
package org.jeecg.modules.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sse")
|
||||
public class SSEController {
|
||||
private static Map<String, SseEmitter> sseCache = new ConcurrentHashMap<>();
|
||||
|
||||
@GetMapping("subscribe")
|
||||
public SseEmitter subscribe(String id) {
|
||||
// 超时时间设置为1小时
|
||||
SseEmitter sseEmitter = new SseEmitter(3600_000L);
|
||||
sseCache.put(id, sseEmitter);
|
||||
sseEmitter.onTimeout(() -> sseCache.remove(id));
|
||||
sseEmitter.onCompletion(() -> System.out.println("完成!!!"));
|
||||
return sseEmitter;
|
||||
}
|
||||
|
||||
@GetMapping("push")
|
||||
public String push(String id, String content) throws IOException {
|
||||
SseEmitter sseEmitter = sseCache.get(id);
|
||||
if (sseEmitter != null) {
|
||||
sseEmitter.send(content);
|
||||
}
|
||||
return "over";
|
||||
}
|
||||
|
||||
@GetMapping("over")
|
||||
public String over(String id) {
|
||||
SseEmitter sseEmitter = sseCache.get(id);
|
||||
if (sseEmitter != null) {
|
||||
sseEmitter.complete();
|
||||
sseCache.remove(id);
|
||||
}
|
||||
return "over";
|
||||
}
|
||||
|
||||
}
|
|
@ -81,12 +81,32 @@ public class BgDataAnlyseResultIn implements Serializable {
|
|||
/**
|
||||
* 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bGammaEnergyValid;
|
||||
private boolean bGammaEnergyValidSample;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bBetaEnergyValid;
|
||||
private boolean bBetaEnergyValidSample;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bGammaEnergyValidGas;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bBetaEnergyValidGas;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bGammaEnergyValidDet;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bBetaEnergyValidDet;
|
||||
|
||||
/**
|
||||
* 是否选中sampleData
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.jeecg.modules.entity.vo.*;
|
|||
import org.jeecg.modules.entity.*;
|
||||
import org.jeecg.modules.mapper.SpectrumAnalysisMapper;
|
||||
import org.jeecg.modules.native_jni.CalValuesHandler;
|
||||
import org.jeecg.modules.native_jni.struct.CalValuesOut;
|
||||
import org.jeecg.modules.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
@ -1152,33 +1153,38 @@ public class GammaServiceImpl implements IGammaService {
|
|||
}
|
||||
List<String> dataSourceList = phd.getMapEnerKD().keySet().stream().collect(Collectors.toList());
|
||||
map.put("list_dataSource", dataSourceList);
|
||||
List<Double> m_vCurCentroid = phd.getMapEnerKD().get(currentText).getCentroid_channel();
|
||||
List<Double> m_vCurEnergy = phd.getMapEnerKD().get(currentText).getG_energy();
|
||||
List<Double> m_vCurUncert = phd.getMapEnerKD().get(currentText).getUncertainty();
|
||||
map.put("uncert", m_vCurUncert);
|
||||
ParameterInfo m_curParam = phd.getMapEnerPara().get(currentText);
|
||||
map.put("param", m_curParam);
|
||||
int num = m_vCurEnergy.size();
|
||||
if(num < 1){
|
||||
return result;
|
||||
if (StringUtils.isNotBlank(currentText)) {
|
||||
List<Double> m_vCurCentroid = phd.getMapEnerKD().get(currentText).getCentroid_channel();
|
||||
List<Double> m_vCurEnergy = phd.getMapEnerKD().get(currentText).getG_energy();
|
||||
List<Double> m_vCurUncert = phd.getMapEnerKD().get(currentText).getUncertainty();
|
||||
map.put("uncert", m_vCurUncert);
|
||||
ParameterInfo m_curParam = phd.getMapEnerPara().get(currentText);
|
||||
if (Objects.isNull(m_curParam)) {
|
||||
m_curParam = new ParameterInfo();
|
||||
}
|
||||
map.put("param", m_curParam);
|
||||
int num = m_vCurEnergy.size();
|
||||
if(num < 1){
|
||||
return result;
|
||||
}
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(m_vCurCentroid, m_curParam.getP()).counts;
|
||||
List<EnergyData> energyDataList = new LinkedList<>();
|
||||
for(int i=0; i<num; ++i) {
|
||||
EnergyData energyData = new EnergyData();
|
||||
double delta = (m_vCurEnergy.get(i) - vFit.get(i)) / m_vCurEnergy.get(i) * 100;
|
||||
energyData.setChannel(String.format("%.3f", m_vCurCentroid.get(i)));
|
||||
energyData.setEnergy(String.format("%.3f", m_vCurEnergy.get(i)));
|
||||
energyData.setFit(String.format("%.3f", vFit.get(i)));
|
||||
energyData.setDelta(String.format("%.3f", delta));
|
||||
energyDataList.add(energyData);
|
||||
}
|
||||
map.put("table", energyDataList);
|
||||
String equation = gammaFileUtil.UpdateEquationEnergy(m_curParam);
|
||||
map.put("equation", equation);
|
||||
gammaFileUtil.UpdateChartEnergy(m_vCurEnergy, m_curParam, m_vCurCentroid, phd, map);
|
||||
map.put("rg_low", phd.getBaseCtrls().getRg_low());
|
||||
map.put("rg_high", phd.getBaseCtrls().getRg_high());
|
||||
}
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(m_vCurCentroid, m_curParam.getP()).counts;
|
||||
List<EnergyData> energyDataList = new LinkedList<>();
|
||||
for(int i=0; i<num; ++i) {
|
||||
EnergyData energyData = new EnergyData();
|
||||
double delta = (m_vCurEnergy.get(i) - vFit.get(i)) / m_vCurEnergy.get(i) * 100;
|
||||
energyData.setChannel(String.format("%.3f", m_vCurCentroid.get(i)));
|
||||
energyData.setEnergy(String.format("%.3f", m_vCurEnergy.get(i)));
|
||||
energyData.setFit(String.format("%.3f", vFit.get(i)));
|
||||
energyData.setDelta(String.format("%.3f", delta));
|
||||
energyDataList.add(energyData);
|
||||
}
|
||||
map.put("table", energyDataList);
|
||||
String equation = gammaFileUtil.UpdateEquationEnergy(m_curParam);
|
||||
map.put("equation", equation);
|
||||
gammaFileUtil.UpdateChartEnergy(m_vCurEnergy, m_curParam, m_vCurCentroid, phd, map);
|
||||
map.put("rg_low", phd.getBaseCtrls().getRg_low());
|
||||
map.put("rg_high", phd.getBaseCtrls().getRg_high());
|
||||
result.setSuccess(true);
|
||||
result.setResult(map);
|
||||
return result;
|
||||
|
@ -1316,33 +1322,38 @@ public class GammaServiceImpl implements IGammaService {
|
|||
}
|
||||
List<String> dataSourceList = phd.getMapResoKD().keySet().stream().collect(Collectors.toList());
|
||||
map.put("list_dataSource", dataSourceList);
|
||||
List<Double> m_vCurReso = phd.getMapResoKD().get(currentText).getFWHM();
|
||||
List<Double> m_vCurEnergy = phd.getMapResoKD().get(currentText).getG_energy();
|
||||
List<Double> m_vCurUncert = phd.getMapResoKD().get(currentText).getUncertainty();
|
||||
map.put("uncert", m_vCurUncert);
|
||||
ParameterInfo m_curParam = phd.getMapResoPara().get(currentText);
|
||||
map.put("param", m_curParam);
|
||||
int num = m_vCurEnergy.size();
|
||||
if(num < 1){
|
||||
return result;
|
||||
if (StringUtils.isNotBlank(currentText)) {
|
||||
List<Double> m_vCurReso = phd.getMapResoKD().get(currentText).getFWHM();
|
||||
List<Double> m_vCurEnergy = phd.getMapResoKD().get(currentText).getG_energy();
|
||||
List<Double> m_vCurUncert = phd.getMapResoKD().get(currentText).getUncertainty();
|
||||
map.put("uncert", m_vCurUncert);
|
||||
ParameterInfo m_curParam = phd.getMapResoPara().get(currentText);
|
||||
if (Objects.isNull(m_curParam)) {
|
||||
m_curParam = new ParameterInfo();
|
||||
}
|
||||
map.put("param", m_curParam);
|
||||
int num = m_vCurEnergy.size();
|
||||
if(num < 1){
|
||||
return result;
|
||||
}
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(m_vCurEnergy, m_curParam.getP()).counts;
|
||||
List<ResolutionData> resolutionDataList = new LinkedList<>();
|
||||
for(int i=0; i<num; ++i) {
|
||||
ResolutionData resolutionData = new ResolutionData();
|
||||
double delta = (m_vCurReso.get(i) - vFit.get(i)) / m_vCurReso.get(i) * 100;
|
||||
resolutionData.setEnergy(String.format("%.3f", m_vCurEnergy.get(i)));
|
||||
resolutionData.setFwhm(String.format("%.3f", m_vCurReso.get(i)));
|
||||
resolutionData.setFit(String.format("%.3f", vFit.get(i)));
|
||||
resolutionData.setDelta(String.format("%.3f", delta));
|
||||
resolutionDataList.add(resolutionData);
|
||||
}
|
||||
map.put("table", resolutionDataList);
|
||||
String equation = gammaFileUtil.UpdateEquationResolution(m_curParam);
|
||||
map.put("equation", equation);
|
||||
gammaFileUtil.UpdateChartResolution(m_vCurEnergy, m_curParam, m_vCurReso, phd, map);
|
||||
map.put("ECutAnalysis_Low", phd.getSetting().getECutAnalysis_Low());
|
||||
map.put("G_energy_span", phd.getSpec().getG_energy_span());
|
||||
}
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(m_vCurEnergy, m_curParam.getP()).counts;
|
||||
List<ResolutionData> resolutionDataList = new LinkedList<>();
|
||||
for(int i=0; i<num; ++i) {
|
||||
ResolutionData resolutionData = new ResolutionData();
|
||||
double delta = (m_vCurReso.get(i) - vFit.get(i)) / m_vCurReso.get(i) * 100;
|
||||
resolutionData.setEnergy(String.format("%.3f", m_vCurEnergy.get(i)));
|
||||
resolutionData.setFwhm(String.format("%.3f", m_vCurReso.get(i)));
|
||||
resolutionData.setFit(String.format("%.3f", vFit.get(i)));
|
||||
resolutionData.setDelta(String.format("%.3f", delta));
|
||||
resolutionDataList.add(resolutionData);
|
||||
}
|
||||
map.put("table", resolutionDataList);
|
||||
String equation = gammaFileUtil.UpdateEquationResolution(m_curParam);
|
||||
map.put("equation", equation);
|
||||
gammaFileUtil.UpdateChartResolution(m_vCurEnergy, m_curParam, m_vCurReso, phd, map);
|
||||
map.put("ECutAnalysis_Low", phd.getSetting().getECutAnalysis_Low());
|
||||
map.put("G_energy_span", phd.getSpec().getG_energy_span());
|
||||
result.setSuccess(true);
|
||||
result.setResult(map);
|
||||
return result;
|
||||
|
@ -1479,33 +1490,38 @@ public class GammaServiceImpl implements IGammaService {
|
|||
}
|
||||
List<String> dataSourceList = phd.getMapEffiKD().keySet().stream().collect(Collectors.toList());
|
||||
map.put("list_dataSource", dataSourceList);
|
||||
List<Double> m_vCurEffi = phd.getMapEffiKD().get(currentText).getEfficiency();
|
||||
List<Double> m_vCurEnergy = phd.getMapEffiKD().get(currentText).getG_energy();
|
||||
List<Double> m_vCurUncert = phd.getMapEffiKD().get(currentText).getUncertainty();
|
||||
map.put("uncert", m_vCurUncert);
|
||||
ParameterInfo m_curParam = phd.getMapEffiPara().get(currentText);
|
||||
map.put("param", m_curParam);
|
||||
int num = m_vCurEnergy.size();
|
||||
if(num < 1){
|
||||
return result;
|
||||
if (StringUtils.isNotBlank(currentText)) {
|
||||
List<Double> m_vCurEffi = phd.getMapEffiKD().get(currentText).getEfficiency();
|
||||
List<Double> m_vCurEnergy = phd.getMapEffiKD().get(currentText).getG_energy();
|
||||
List<Double> m_vCurUncert = phd.getMapEffiKD().get(currentText).getUncertainty();
|
||||
map.put("uncert", m_vCurUncert);
|
||||
ParameterInfo m_curParam = phd.getMapEffiPara().get(currentText);
|
||||
if (Objects.isNull(m_curParam)) {
|
||||
m_curParam = new ParameterInfo();
|
||||
}
|
||||
map.put("param", m_curParam);
|
||||
int num = m_vCurEnergy.size();
|
||||
if(num < 1){
|
||||
return result;
|
||||
}
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(m_vCurEnergy, m_curParam.getP()).counts;
|
||||
List<EfficiencyData> efficiencyDataList = new LinkedList<>();
|
||||
for(int i=0; i<num; ++i) {
|
||||
double delta = (m_vCurEffi.get(i) - vFit.get(i)) / m_vCurEffi.get(i) * 100;
|
||||
EfficiencyData efficiencyData = new EfficiencyData();
|
||||
efficiencyData.setEnergy(String.format("%.3f", m_vCurEnergy.get(i)));
|
||||
efficiencyData.setEfficiency(String.format("%.3f", m_vCurEffi.get(i)));
|
||||
efficiencyData.setFit(String.format("%.3f", vFit.get(i)));
|
||||
efficiencyData.setDelta(String.format("%.3f", delta));
|
||||
efficiencyDataList.add(efficiencyData);
|
||||
}
|
||||
map.put("table", efficiencyDataList);
|
||||
String equation = gammaFileUtil.UpdateEquationEfficiency(m_vCurEnergy, m_curParam);
|
||||
map.put("equation", equation);
|
||||
gammaFileUtil.UpdateChartEfficiency(m_vCurEnergy, m_curParam, m_vCurEffi, phd, map);
|
||||
map.put("ECutAnalysis_Low", phd.getSetting().getECutAnalysis_Low());
|
||||
map.put("G_energy_span", phd.getSpec().getG_energy_span());
|
||||
}
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(m_vCurEnergy, m_curParam.getP()).counts;
|
||||
List<EfficiencyData> efficiencyDataList = new LinkedList<>();
|
||||
for(int i=0; i<num; ++i) {
|
||||
double delta = (m_vCurEffi.get(i) - vFit.get(i)) / m_vCurEffi.get(i) * 100;
|
||||
EfficiencyData efficiencyData = new EfficiencyData();
|
||||
efficiencyData.setEnergy(String.format("%.3f", m_vCurEnergy.get(i)));
|
||||
efficiencyData.setEfficiency(String.format("%.3f", m_vCurEffi.get(i)));
|
||||
efficiencyData.setFit(String.format("%.3f", vFit.get(i)));
|
||||
efficiencyData.setDelta(String.format("%.3f", delta));
|
||||
efficiencyDataList.add(efficiencyData);
|
||||
}
|
||||
map.put("table", efficiencyDataList);
|
||||
String equation = gammaFileUtil.UpdateEquationEfficiency(m_vCurEnergy, m_curParam);
|
||||
map.put("equation", equation);
|
||||
gammaFileUtil.UpdateChartEfficiency(m_vCurEnergy, m_curParam, m_vCurEffi, phd, map);
|
||||
map.put("ECutAnalysis_Low", phd.getSetting().getECutAnalysis_Low());
|
||||
map.put("G_energy_span", phd.getSpec().getG_energy_span());
|
||||
result.setSuccess(true);
|
||||
result.setResult(map);
|
||||
return result;
|
||||
|
|
|
@ -333,12 +333,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
public Result getDBSpectrumChart(String dbName, Integer sampleId) {
|
||||
Result result = new Result();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<GardsCalibrationSpectrum> gammaCalibrationSpectrumList= new LinkedList<>();
|
||||
List<GardsCalibrationSpectrum> betaCalibrationSpectrumList = new LinkedList<>();
|
||||
List<GardsROIChannelsSpectrum> roiChannelsSpectrumList = new LinkedList<>();
|
||||
List<GardsROIResultsSpectrum> roiResultsSpectrumList = new LinkedList<>();
|
||||
List<GardsCalibrationPairsSpectrum> gammaCalibrationPairsList = new LinkedList<>();
|
||||
List<GardsCalibrationPairsSpectrum> betaCalibrationPairsList = new LinkedList<>();
|
||||
List<GardsXeResultsSpectrum> xeResultsSpectrumList = new LinkedList<>();
|
||||
if (Objects.isNull(sampleId)){
|
||||
result.error500("请选择一条数据");
|
||||
|
@ -347,31 +341,15 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (dbName.equalsIgnoreCase("auto")){
|
||||
dbName = "RNAUTO";
|
||||
Integer idAnalysis = spectrumAnalysisMapper.getAnalysisID("RNAUTO", sampleId);
|
||||
gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNAUTO", idAnalysis, sampleId);
|
||||
betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNAUTO", idAnalysis, sampleId);
|
||||
roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNAUTO", idAnalysis, sampleId);
|
||||
roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNAUTO", idAnalysis, sampleId);
|
||||
xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNAUTO", idAnalysis, sampleId);
|
||||
}else if (dbName.equalsIgnoreCase("man")){
|
||||
dbName = "RNMAN";
|
||||
Integer idAnalysis = spectrumAnalysisMapper.getAnalysisID("RNMAN", sampleId);
|
||||
gammaCalibrationPairsList = spectrumAnalysisMapper.ReadGammaFitChannelEnergy(idAnalysis, sampleId);
|
||||
gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNMAN", idAnalysis, sampleId);
|
||||
betaCalibrationPairsList = spectrumAnalysisMapper.ReadBetaFitChannelEnergy(idAnalysis, sampleId);
|
||||
betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNMAN", idAnalysis, sampleId);
|
||||
roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNMAN", idAnalysis, sampleId);
|
||||
roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNMAN", idAnalysis, sampleId);
|
||||
xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNMAN", idAnalysis, sampleId);
|
||||
resultMap.put("gammaCalibrationPairsList", gammaCalibrationPairsList);
|
||||
resultMap.put("betaCalibrationPairsList", betaCalibrationPairsList);
|
||||
}else {
|
||||
result.error500("数据库类型不存在");
|
||||
return result;
|
||||
}
|
||||
resultMap.put("gammaCalibrationSpectrumList", gammaCalibrationSpectrumList);
|
||||
resultMap.put("betaCalibrationSpectrumList", betaCalibrationSpectrumList);
|
||||
resultMap.put("roiChannelsSpectrumList", roiChannelsSpectrumList);
|
||||
resultMap.put("roiResultsSpectrumList", roiResultsSpectrumList);
|
||||
//查询数据库文件信息
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId);
|
||||
List<String> filePath = new LinkedList<>();
|
||||
|
@ -2415,7 +2393,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
BetaGammaAnalyzeCurrentProcess(analyseData, dbSpectrumFilePath, userName);
|
||||
}
|
||||
}
|
||||
|
||||
} else if ("AllSpectrum".equals(analyseData.getApplyType())) {
|
||||
Map<String, SpectrumFileRecord> m_loadData = new HashMap<>();
|
||||
for (int i=0; i<analyseData.getSampleIds().size(); i++) {
|
||||
|
@ -2752,8 +2729,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
//处理数据 获取对应的channel/energy值
|
||||
getChannelAndEnergy(anlyseResultIn, betaList, gammaList);
|
||||
//分析文件内容
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
analyzePHDFile(anlyseResultIn, betaFittingPara, gammaFittingPara, map);
|
||||
analyzePHDFile(anlyseResultIn, betaFittingPara, gammaFittingPara);
|
||||
//处理文件名称
|
||||
String sampleFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||
String gasFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
||||
|
@ -3171,7 +3147,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if(anlyseResultIn.isCheckSample()) {
|
||||
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(sampleTmp.getAbsolutePath());
|
||||
//没有点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮 channel/energy数据读取文件 如果点击过数据来源页面
|
||||
if (!anlyseResultIn.isBGammaEnergyValid()){
|
||||
if (!anlyseResultIn.isBGammaEnergyValidSample()){
|
||||
anlyseResultIn.setG_channel_sample(sourceData.g_centroid_channel);
|
||||
anlyseResultIn.setG_energy_sample(sourceData.g_energy);
|
||||
} else {
|
||||
|
@ -3181,7 +3157,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
anlyseResultIn.setG_energy_sample(energys);
|
||||
}
|
||||
//没有点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮 channel/energy数据读取文件 如果点击过数据来源页面
|
||||
if (!anlyseResultIn.isBGammaEnergyValid()){
|
||||
if (!anlyseResultIn.isBBetaEnergyValidSample()){
|
||||
anlyseResultIn.setB_channel_sample(sourceData.b_channel);
|
||||
anlyseResultIn.setB_energy_sample(sourceData.b_electron_energy);
|
||||
} else {
|
||||
|
@ -3201,7 +3177,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(gasTmp)) {
|
||||
if (anlyseResultIn.isCheckGas()) {
|
||||
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(gasTmp.getAbsolutePath());
|
||||
if (!anlyseResultIn.isBGammaEnergyValid()){
|
||||
if (!anlyseResultIn.isBGammaEnergyValidGas()){
|
||||
anlyseResultIn.setG_channel_gas(sourceData.g_centroid_channel);
|
||||
anlyseResultIn.setG_energy_gas(sourceData.g_energy);
|
||||
} else {
|
||||
|
@ -3210,7 +3186,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
List<Double> energys = gammaList.stream().map(SeriseData::getY).collect(Collectors.toList());
|
||||
anlyseResultIn.setG_energy_gas(energys);
|
||||
}
|
||||
if (!anlyseResultIn.isBGammaEnergyValid()){
|
||||
if (!anlyseResultIn.isBBetaEnergyValidGas()){
|
||||
anlyseResultIn.setB_channel_gas(sourceData.b_channel);
|
||||
anlyseResultIn.setB_energy_gas(sourceData.b_electron_energy);
|
||||
} else {
|
||||
|
@ -3230,7 +3206,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(detTmp)) {
|
||||
if (anlyseResultIn.isCheckDet()) {
|
||||
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(detTmp.getAbsolutePath());
|
||||
if (!anlyseResultIn.isBGammaEnergyValid()){
|
||||
if (!anlyseResultIn.isBGammaEnergyValidDet()){
|
||||
anlyseResultIn.setG_channel_det(sourceData.g_centroid_channel);
|
||||
anlyseResultIn.setG_energy_det(sourceData.g_energy);
|
||||
} else {
|
||||
|
@ -3239,7 +3215,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
List<Double> energys = gammaList.stream().map(SeriseData::getY).collect(Collectors.toList());
|
||||
anlyseResultIn.setG_energy_det(energys);
|
||||
}
|
||||
if (!anlyseResultIn.isBGammaEnergyValid()){
|
||||
if (!anlyseResultIn.isBBetaEnergyValidDet()){
|
||||
anlyseResultIn.setB_channel_det(sourceData.b_channel);
|
||||
anlyseResultIn.setB_energy_det(sourceData.b_electron_energy);
|
||||
} else {
|
||||
|
@ -3258,7 +3234,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
}
|
||||
|
||||
public void analyzePHDFile(BgDataAnlyseResultIn anlyseResultIn,List<String> betaFittingPara, List<String> gammaFittingPara, Map<String, Object> map) {
|
||||
public void analyzePHDFile(BgDataAnlyseResultIn anlyseResultIn,List<String> betaFittingPara, List<String> gammaFittingPara) {
|
||||
//根据文件路径 文件名称获取对应的临时文件
|
||||
File sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||
File gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
||||
|
@ -3311,26 +3287,13 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
anlyseResultIn.setXeData(xeResultsSpectrumList);
|
||||
|
||||
List<GardsCalibrationSpectrum> gammaCalibrationSpectrumList = new LinkedList<>();
|
||||
if (anlyseResultIn.isBGammaEnergyValid()) {
|
||||
if (anlyseResultIn.isBGammaEnergyValidSample()) {
|
||||
GardsCalibrationSpectrum gammaCalibrationS = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
|
||||
gammaCalibrationS.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
|
||||
gammaCalibrationS.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
|
||||
gammaCalibrationS.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationS);
|
||||
GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
|
||||
gammaCalibrationG.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
|
||||
gammaCalibrationG.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
|
||||
gammaCalibrationG.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationG);
|
||||
GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
|
||||
gammaCalibrationD.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
|
||||
gammaCalibrationD.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
|
||||
gammaCalibrationD.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationD);
|
||||
anlyseResultIn.setGammaCalibrationSpectrumList(gammaCalibrationSpectrumList);
|
||||
} else {
|
||||
GardsCalibrationSpectrum gammaCalibrationS = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
|
||||
|
@ -3338,42 +3301,47 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
gammaCalibrationS.setCoeff2(bgAnalyseResult.s_g_fitting_c_e.get(1));
|
||||
gammaCalibrationS.setCoeff3(bgAnalyseResult.s_g_fitting_c_e.get(2));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationS);
|
||||
}
|
||||
if (anlyseResultIn.isBGammaEnergyValidGas()) {
|
||||
GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
|
||||
gammaCalibrationG.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
|
||||
gammaCalibrationG.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
|
||||
gammaCalibrationG.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationG);
|
||||
} else {
|
||||
GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
|
||||
gammaCalibrationG.setCoeff1(bgAnalyseResult.g_g_fitting_c_e.get(0));
|
||||
gammaCalibrationG.setCoeff2(bgAnalyseResult.g_g_fitting_c_e.get(1));
|
||||
gammaCalibrationG.setCoeff3(bgAnalyseResult.g_g_fitting_c_e.get(2));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationG);
|
||||
}
|
||||
if (anlyseResultIn.isBGammaEnergyValidDet()) {
|
||||
GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
|
||||
gammaCalibrationD.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
|
||||
gammaCalibrationD.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
|
||||
gammaCalibrationD.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationD);
|
||||
} else {
|
||||
GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
|
||||
gammaCalibrationD.setCoeff1(bgAnalyseResult.d_g_fitting_c_e.get(0));
|
||||
gammaCalibrationD.setCoeff2(bgAnalyseResult.d_g_fitting_c_e.get(1));
|
||||
gammaCalibrationD.setCoeff3(bgAnalyseResult.d_g_fitting_c_e.get(2));
|
||||
gammaCalibrationSpectrumList.add(gammaCalibrationD);
|
||||
anlyseResultIn.setGammaCalibrationSpectrumList(gammaCalibrationSpectrumList);
|
||||
}
|
||||
|
||||
anlyseResultIn.setGammaCalibrationSpectrumList(gammaCalibrationSpectrumList);
|
||||
|
||||
List<GardsCalibrationSpectrum> betaCalibrationSpectrumList = new LinkedList<>();
|
||||
if (anlyseResultIn.isBBetaEnergyValid()) {
|
||||
if (anlyseResultIn.isBBetaEnergyValidSample()) {
|
||||
GardsCalibrationSpectrum betaCalibrationS = new GardsCalibrationSpectrum();
|
||||
betaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
|
||||
betaCalibrationS.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
|
||||
betaCalibrationS.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
|
||||
betaCalibrationS.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationS);
|
||||
GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum();
|
||||
betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
|
||||
betaCalibrationG.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
|
||||
betaCalibrationG.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
|
||||
betaCalibrationG.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationG);
|
||||
GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum();
|
||||
betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
|
||||
betaCalibrationD.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
|
||||
betaCalibrationD.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
|
||||
betaCalibrationD.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationD);
|
||||
} else {
|
||||
GardsCalibrationSpectrum betaCalibrationS = new GardsCalibrationSpectrum();
|
||||
betaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
|
||||
|
@ -3381,12 +3349,30 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
betaCalibrationS.setCoeff2(bgAnalyseResult.s_b_fitting_c_e.get(1));
|
||||
betaCalibrationS.setCoeff3(bgAnalyseResult.s_b_fitting_c_e.get(2));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationS);
|
||||
}
|
||||
if (anlyseResultIn.isBBetaEnergyValidGas()) {
|
||||
GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum();
|
||||
betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
|
||||
betaCalibrationG.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
|
||||
betaCalibrationG.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
|
||||
betaCalibrationG.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationG);
|
||||
} else {
|
||||
GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum();
|
||||
betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
|
||||
betaCalibrationG.setCoeff1(bgAnalyseResult.g_b_fitting_c_e.get(0));
|
||||
betaCalibrationG.setCoeff2(bgAnalyseResult.g_b_fitting_c_e.get(1));
|
||||
betaCalibrationG.setCoeff3(bgAnalyseResult.g_b_fitting_c_e.get(2));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationG);
|
||||
}
|
||||
if (anlyseResultIn.isBBetaEnergyValidDet()) {
|
||||
GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum();
|
||||
betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
|
||||
betaCalibrationD.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
|
||||
betaCalibrationD.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
|
||||
betaCalibrationD.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationD);
|
||||
} else {
|
||||
GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum();
|
||||
betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
|
||||
betaCalibrationD.setCoeff1(bgAnalyseResult.d_b_fitting_c_e.get(0));
|
||||
|
@ -3394,7 +3380,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
betaCalibrationD.setCoeff3(bgAnalyseResult.d_b_fitting_c_e.get(2));
|
||||
betaCalibrationSpectrumList.add(betaCalibrationD);
|
||||
}
|
||||
|
||||
anlyseResultIn.setBetaCalibrationSpectrumList(betaCalibrationSpectrumList);
|
||||
List<GardsROIChannelsSpectrum> roiChannelsSpectrumList = new LinkedList<>();
|
||||
for (int i=0; i<bgAnalyseResult.S_ROI_B_Boundary_start.size(); i++) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user