添加QC-Flag、sauna、sauna2的显示规则计算参数。

添加规则实体类,修改Sections类获取规则方式
This commit is contained in:
duwenyuan 2025-06-30 10:24:35 +08:00
parent be5ef47c10
commit 8010b316b8
9 changed files with 2073 additions and 1354 deletions

View File

@ -0,0 +1,23 @@
package org.jeecg.modules.entity.vo.QCFlagParmData;
import lombok.Data;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
@Data
@XmlAccessorType(XmlAccessType.FIELD)
public class ParamConfig {
@XmlElement(name = "collectionTime")
private RuleGroup collectionTime;
@XmlElement(name = "acquisitionTime")
private RuleGroup acquisitionTime;
@XmlElement(name = "xeVolume")
private RuleGroup xeVolume;
@XmlElement(name = "airVolume")
private RuleGroup airVolume;
}

View File

@ -0,0 +1,16 @@
package org.jeecg.modules.entity.vo.QCFlagParmData;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "config")
@XmlAccessorType(XmlAccessType.FIELD)
public class QCFlagParam {
@XmlElement(name = "sauna")
public ParamConfig sauna;
@XmlElement(name = "sauna2")
public ParamConfig sauna2;
}

View File

@ -0,0 +1,20 @@
package org.jeecg.modules.entity.vo.QCFlagParmData;
import lombok.Data;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
@Data
@XmlAccessorType(XmlAccessType.FIELD)
public class Rule {
@XmlAttribute(name = "min")
private double min;
@XmlAttribute(name = "max")
private Double max; // 使用Double以便可以为null表示没有上限
@XmlAttribute(name = "color")
private String color;
}

View File

@ -0,0 +1,15 @@
package org.jeecg.modules.entity.vo.QCFlagParmData;
import lombok.Data;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import java.util.List;
@Data
@XmlAccessorType(XmlAccessType.FIELD)
public class RuleGroup {
@XmlElement(name = "Rule")
List<Rule> rules;
}

View File

@ -1,11 +1,22 @@
package org.jeecg.modules.entity.vo; package org.jeecg.modules.entity.vo;
import lombok.Data; import lombok.Data;
import org.jeecg.common.properties.ParameterProperties;
import org.jeecg.modules.base.enums.StationDetailType;
import org.jeecg.modules.entity.vo.QCFlagParmData.QCFlagParam;
import org.jeecg.modules.entity.vo.QCFlagParmData.Rule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import java.io.File;
import java.io.Serializable; import java.io.Serializable;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import static org.jeecg.modules.base.enums.StationDetailType.*;
@Data @Data
public class Sections implements Serializable { public class Sections implements Serializable {
@ -17,6 +28,16 @@ public class Sections implements Serializable {
private List<Double> airVolumeSections; private List<Double> airVolumeSections;
//region QC-Flag参数
private List<Rule> collectionTimeRules;
private List<Rule> acquisitionTimeRules;
private List<Rule> xeVolumeRules;
private List<Rule> airVolumeRules;
//endregion
public Sections() { public Sections() {
collectionTimeSections = new LinkedList<>(); collectionTimeSections = new LinkedList<>();
collectionTimeSections.add(0.0); collectionTimeSections.add(0.0);
@ -43,4 +64,34 @@ public class Sections implements Serializable {
airVolumeSections.add(10.0); airVolumeSections.add(10.0);
} }
public Sections(StationDetailType sectionsType,String pathname) {
try {
// 创建JAXB上下文
JAXBContext context = JAXBContext.newInstance(QCFlagParam.class);
// 创建Unmarshaller
Unmarshaller unmarshaller = context.createUnmarshaller();
File file = new File(pathname);
QCFlagParam config = (QCFlagParam) unmarshaller.unmarshal(file);
switch (sectionsType) {
case SAUNA:
collectionTimeRules = config.sauna.getCollectionTime().getRules();
acquisitionTimeRules = config.sauna.getAcquisitionTime().getRules();
xeVolumeRules = config.sauna.getXeVolume().getRules();
airVolumeRules = config.sauna.getAirVolume().getRules();
break;
case SAUNA2:
collectionTimeRules = config.sauna2.getCollectionTime().getRules();
acquisitionTimeRules = config.sauna2.getAcquisitionTime().getRules();
xeVolumeRules = config.sauna2.getXeVolume().getRules();
airVolumeRules = config.sauna2.getAirVolume().getRules();
break;
}
} catch (Exception e) {
e.printStackTrace();
}
}
} }

View File

@ -17,6 +17,7 @@ import org.jeecg.common.properties.ParameterProperties;
import org.jeecg.common.properties.SpectrumPathProperties; import org.jeecg.common.properties.SpectrumPathProperties;
import org.jeecg.modules.base.abstracts.AbstractLogOrReport; import org.jeecg.modules.base.abstracts.AbstractLogOrReport;
import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib; import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib;
import org.jeecg.modules.base.entity.configuration.GardsStations;
import org.jeecg.modules.base.enums.CalName; import org.jeecg.modules.base.enums.CalName;
import org.jeecg.modules.base.enums.CalType; import org.jeecg.modules.base.enums.CalType;
import org.jeecg.modules.base.enums.MiddleDataType; import org.jeecg.modules.base.enums.MiddleDataType;
@ -532,9 +533,16 @@ public class GammaFileUtil extends AbstractLogOrReport {
//声明一个数组存储QcItems数据 //声明一个数组存储QcItems数据
Map<String, QcCheckItem> qcItems = new TreeMap<>(); Map<String, QcCheckItem> qcItems = new TreeMap<>();
//调用方法 读取文件信息 判断QC数据 //调用方法 读取文件信息 判断QC数据
if(!ReadQCLimit(qcItems, vMdcInfoMap, Be7Value, phd.getHeader().getSystem_type().toUpperCase())) { //if (!ReadQCLimit(qcItems, vMdcInfoMap, Be7Value, phd.getHeader().getSystem_type().toUpperCase())) {
// String WARNING = "Read QC Flags from SystemManager.xml Failed!";
//}
String stationCode = phd.getHeader().getSite_code();
GardsStations stationInfo = getStationInfo(stationCode);
String stationType = stationInfo.getEfficCalculType();
if (!ReadQCLimitByStationType(qcItems, vMdcInfoMap, Be7Value, stationType, stationCode)) {
String WARNING = "Read QC Flags from SystemManager.xml Failed!"; String WARNING = "Read QC Flags from SystemManager.xml Failed!";
} }
//判断map是否为空 //判断map是否为空
if (CollectionUtils.isNotEmpty(vMdcInfoMap)) { if (CollectionUtils.isNotEmpty(vMdcInfoMap)) {
//根据键值按顺序向数组中插入数据 //根据键值按顺序向数组中插入数据
@ -543,6 +551,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
vMdcInfo.add(vMdcInfoMap.get("2")); vMdcInfo.add(vMdcInfoMap.get("2"));
} }
//获取QcItem中col_time数据 //获取QcItem中col_time数据
log.info("获取QcItem中col_time数据:" + qcItems.get("col_time"));
QcCheckItem colTime = qcItems.get("col_time"); QcCheckItem colTime = qcItems.get("col_time");
//将采集耗时 赋值给 colTime //将采集耗时 赋值给 colTime
colTime.setValue(collect_hour); colTime.setValue(collect_hour);
@ -903,6 +912,145 @@ public class GammaFileUtil extends AbstractLogOrReport {
return true; return true;
} }
//region 添加根据台站类型获取QC参数
public boolean ReadQCLimitByStationType(Map<String, QcCheckItem> qcItems, Map<String, Double> vMdcInfoMap,
List<Double> Be7Value, String systemType, String stationCode) {
try {
String filePath = parameterProperties.getFilePath() + File.separator + "parameter.xml";
log.info("filePath:" + filePath);
//创建一个文档解析器工厂
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
//创建文档解析器
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
//读取xml文件生成一个文档
Document document = documentBuilder.parse(filePath);
log.info("stationCode:" + stationCode);
log.info("document:" + document);
log.info("systemType:" + systemType);
if (StringUtils.isBlank(stationCode) || Objects.isNull(document)) {
return false;
}
//获取文档的根元素
Element element = document.getDocumentElement();
log.info("获取文档的根元素:" + element);
// if (stationCode.charAt(2) == 'X' && systemType.equals("SAUNA")) {
// //切割台站编码 如果 第三个字符是 X 并且 EFFIC_CALCUL_TYPE类型是 SAUNA
// NodeList nodes = element.getElementsByTagName("QCFlags-SAUNA");
// for (int i = 0; i < nodes.getLength(); i++) {
// parseQCFlags(nodes.item(i), qcItems, vMdcInfoMap, Be7Value);
// log.info("第三个字符是 X 并且 EFFIC_CALCUL_TYPE类型是 SAUNA:"+nodes);
// }
// } else if (stationCode.charAt(2) == 'X' && systemType.equals("SAUNA2")) {
// //切割台站编码 如果 第三个字符是 X 并且 EFFIC_CALCUL_TYPE类型是 SAUNA2
// NodeList nodes = element.getElementsByTagName("QCFlags-SAUNA2");
// for (int i = 0; i < nodes.getLength(); i++) {
// parseQCFlags(nodes.item(i), qcItems, vMdcInfoMap, Be7Value);
// }
// } else
//
if (stationCode.charAt(2) == 'X' && systemType.equals("SPALAX")) {
//切割台站编码 如果 第三个字符是 X 并且 EFFIC_CALCUL_TYPE类型是 SPALAX
NodeList nodes = element.getElementsByTagName("QCFlags-SPALAX");
log.info("第三个字符是 X 并且 EFFIC_CALCUL_TYPE类型是 QCFlags-SPALAX:" + nodes);
for (int i = 0; i < nodes.getLength(); i++) {
parseQCFlags(nodes.item(i), qcItems, vMdcInfoMap, Be7Value);
}
} else if (stationCode.charAt(2) == 'X' && systemType.equals("SPALAX_PLC")) {
//切割台站编码 如果 第三个字符是 X 并且 EFFIC_CALCUL_TYPE类型是 SPALAX-PLC
NodeList nodes = element.getElementsByTagName("QCFlags-SPALAX-PLC");
log.info("第三个字符是 X 并且 EFFIC_CALCUL_TYPE类型是 QCFlags-SPALAX-PLC:" + nodes);
for (int i = 0; i < nodes.getLength(); i++) {
parseQCFlags(nodes.item(i), qcItems, vMdcInfoMap, Be7Value);
}
} else if (stationCode.charAt(2) == 'P') {
//切割台站编码 如果 第三个字符是 P
NodeList nodes = element.getElementsByTagName("QCFlags-P");
log.info("第三个字符是 X 并且 EFFIC_CALCUL_TYPE类型是 QCFlags-P:" + nodes);
for (int i = 0; i < nodes.getLength(); i++) {
parseQCFlags(nodes.item(i), qcItems, vMdcInfoMap, Be7Value);
}
}
log.info("col_time:" + qcItems.get("col_time"));
} catch (ParserConfigurationException | IOException | SAXException e) {
throw new RuntimeException(e);
}
return true;
}
private static void parseQCFlags(Node node, Map<String, QcCheckItem> qcItems, Map<String, Double> vMdcInfoMap, List<Double> Be7Value) {
Node childNode = node.getFirstChild();
QcCheckItem qcCheckItem = new QcCheckItem();
while (Objects.nonNull(childNode)) {
String nodeName = childNode.getNodeName();
switch (nodeName) {
case "col_time":
case "acq_time":
case "decay_time":
case "samp_vol":
case "Xe133-MDC":
case "airFlow":
case "Be7-FWHM":
case "Ba140-MDC":
qcCheckItem = new QcCheckItem();
setAttributeSetter(childNode, "green", qcCheckItem::setStandard);
qcItems.put(nodeName, qcCheckItem);
log.info(nodeName + ":" + qcCheckItem.getStandard());
break;
case "Be7":
setAttributeSetter(childNode, CalType.ENERGY_CAL.getType(), value -> Be7Value.add(Double.valueOf(value)));
log.info(nodeName + ":" + Be7Value);
break;
case "Ba140":
setAttributeSetter(childNode, CalType.ENERGY_CAL.getType(), value -> vMdcInfoMap.put("0", Double.valueOf(value)));
setAttributeSetter(childNode, "yield", value -> vMdcInfoMap.put("1", Double.valueOf(value)));
setAttributeSetter(childNode, "halflife", value -> vMdcInfoMap.put("2", Double.valueOf(value)));
log.info(nodeName + ":" + vMdcInfoMap.get("0") + vMdcInfoMap.get("1") + vMdcInfoMap.get("2"));
break;
case "Xe133":
setAttributeSetter(childNode, CalType.ENERGY_CAL.getType(), value -> vMdcInfoMap.put("0", Double.valueOf(value)));
setAttributeSetter(childNode, "yield", value -> vMdcInfoMap.put("1", Double.valueOf(value)));
setAttributeSetter(childNode, "halflife", value -> vMdcInfoMap.put("2", Double.valueOf(value)));
log.info(nodeName + ":" + vMdcInfoMap.get("0") + vMdcInfoMap.get("1") + vMdcInfoMap.get("2"));
break;
}
childNode = childNode.getNextSibling();
}
}
//根据map的value获取map的key
private GardsStations getStationInfo(String value) {
Map<String, String> stationMap = (Map<String, String>) redisUtil.get("stationMap");
Map<String, GardsStations> stations = (Map<String, GardsStations>) redisUtil.get("stationInfoMap");
GardsStations station = new GardsStations();
if (Objects.nonNull(stationMap)) {
for (Map.Entry<String, String> entry : stationMap.entrySet()) {
if (value.equals(entry.getValue())) {
station = stations.get(entry.getKey());
}
}
}
return station;
}
private static void setAttributeSetter(Node node, String attributeName, AttributeSetter setter) {
NamedNodeMap attributes = node.getAttributes();
if (Objects.nonNull(attributes)) {
for (int i = 0; i < attributes.getLength(); i++) {
Node item = attributes.item(i);
if (attributeName.equals(item.getNodeName())) {
setter.setValue(item.getNodeValue());
}
}
}
}
@FunctionalInterface
private interface AttributeSetter {
void setValue(String value);
}
public List<String> DetailedInfo(String sampleId, PHDFile phd) { public List<String> DetailedInfo(String sampleId, PHDFile phd) {
try { try {
// Sample_Id, Station_Code, Detector_Code, System_Type, Data_Type, Spectral_Qualifier, // Sample_Id, Station_Code, Detector_Code, System_Type, Data_Type, Spectral_Qualifier,
@ -1548,8 +1696,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|| newSets.getK_beta() != oldSets.getK_beta() || newSets.getK_beta() != oldSets.getK_beta()
|| newSets.getRiskLevelK() != oldSets.getRiskLevelK() || newSets.getRiskLevelK() != oldSets.getRiskLevelK()
|| newSets.getRefTime_act() != oldSets.getRefTime_act() || newSets.getRefTime_act() != oldSets.getRefTime_act()
|| newSets.getRefTime_conc() != oldSets.getRefTime_conc()) || newSets.getRefTime_conc() != oldSets.getRefTime_conc()) {
{
return 1; return 1;
} }
@ -1659,8 +1806,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
if (rate > 0.5) { if (rate > 0.5) {
// 获取用于计算ActivityMDC的主γ峰和最大分支比 // 获取用于计算ActivityMDC的主γ峰和最大分支比
double maxFoundYield = vYield.get(iter.getValue().maxYeildIdx); double maxFoundYield = vYield.get(iter.getValue().maxYeildIdx);
if(mainPeakIdx < 0) if (mainPeakIdx < 0) {
{
maxFoundYield = 0; maxFoundYield = 0;
for (int ii = 0; ii < vFit.size(); ii++) { for (int ii = 0; ii < vFit.size(); ii++) {
if (vFit.get(ii) >= 0 && vYield.get(ii) > maxFoundYield) { if (vFit.get(ii) >= 0 && vYield.get(ii) > maxFoundYield) {
@ -2188,8 +2334,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
if (i < 0 || i >= e_size) break; if (i < 0 || i >= e_size) break;
double y1, y0, x1, x0; double y1, y0, x1, x0;
if(i < e_size - 1) if (i < e_size - 1) {
{
y1 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i * 2 + 3)))); y1 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i * 2 + 3))));
y0 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i * 2 + 1)))); y0 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i * 2 + 1))));
x1 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i * 2 + 2)))); x1 = Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(m_curParam.getP().get(i * 2 + 2))));
@ -3161,50 +3306,116 @@ public class GammaFileUtil extends AbstractLogOrReport {
public String EquationDescription(int funcId) { public String EquationDescription(int funcId) {
String desc = ""; String desc = "";
switch (funcId) switch (funcId) {
{ case 1:
case 1: desc = "y=yi+(y(i+1)-yi)*(x-xi)/(x(i+1)-xi) for xi<=x<x(i+1)"; break; desc = "y=yi+(y(i+1)-yi)*(x-xi)/(x(i+1)-xi) for xi<=x<x(i+1)";
case 2: desc = "y=a0+a1*x+a2*x^2+a3*x^3"; break; break;
case 3: desc = "y=a0+a1*x^(1/2)+a2*x+a3*x^(3/2)"; break; case 2:
case 4: desc = "y=sqrt(a0+a1*x+a2*x^2+a3*x^3)"; break; desc = "y=a0+a1*x+a2*x^2+a3*x^3";
case 5: desc = "y=A*exp(-(E1/x)^k)*(1-exp(-(E2/x)^n))"; break; break;
case 6: desc = "log(y)=a0+a1*log(x)+a2*log(x)^2+a3*log(x)^3"; break; case 3:
case 7: desc = "log(y)=a0*x+a1+a2/x+a3/(x^2)"; break; desc = "y=a0+a1*x^(1/2)+a2*x+a3*x^(3/2)";
case 8: desc = "log(y)=a0+a1*log(c/x)+a2*log(c/x)^2+a3*log(c/x)^3+a4*log(c/x)^4"; break; break;
case 9: desc = "y=1/(a*x^(-k)+b*x^(-n))"; break; case 4:
case 93: desc = "y=S*exp(-(E1/x)^k)*(1-exp(-(2*E3/(x-E3))^n"; break; desc = "y=sqrt(a0+a1*x+a2*x^2+a3*x^3)";
case 94: desc = "y=S*exp(-(E1/x)^k)*(1-exp(-b*(1/(x-E2))^m))"; break; break;
case 95: desc = "y=S*exp(-(E1/x)^k)*(1-exp(-b*(1/(x-E2))^m))*(1-exp(-(2*E3/(E-E3))^n))"; break; case 5:
case 96: desc = "y=A+E1*x^(-n)"; break; desc = "y=A*exp(-(E1/x)^k)*(1-exp(-(E2/x)^n))";
case 97: desc = "y=a0+a1*exp(-lam1*x)"; break; break;
case 98: desc = "y=c"; break; case 6:
case 99: desc = "y=t_0+k_t*x if x>ECut"; break; desc = "log(y)=a0+a1*log(x)+a2*log(x)^2+a3*log(x)^3";
default: desc = ""; break; break;
case 7:
desc = "log(y)=a0*x+a1+a2/x+a3/(x^2)";
break;
case 8:
desc = "log(y)=a0+a1*log(c/x)+a2*log(c/x)^2+a3*log(c/x)^3+a4*log(c/x)^4";
break;
case 9:
desc = "y=1/(a*x^(-k)+b*x^(-n))";
break;
case 93:
desc = "y=S*exp(-(E1/x)^k)*(1-exp(-(2*E3/(x-E3))^n";
break;
case 94:
desc = "y=S*exp(-(E1/x)^k)*(1-exp(-b*(1/(x-E2))^m))";
break;
case 95:
desc = "y=S*exp(-(E1/x)^k)*(1-exp(-b*(1/(x-E2))^m))*(1-exp(-(2*E3/(E-E3))^n))";
break;
case 96:
desc = "y=A+E1*x^(-n)";
break;
case 97:
desc = "y=a0+a1*exp(-lam1*x)";
break;
case 98:
desc = "y=c";
break;
case 99:
desc = "y=t_0+k_t*x if x>ECut";
break;
default:
desc = "";
break;
} }
return desc; return desc;
} }
public String EquationName(int funcId) { public String EquationName(int funcId) {
String name = ""; String name = "";
switch (funcId) switch (funcId) {
{ case 1:
case 1: name = "Interpolation"; break; name = "Interpolation";
case 2: name = "Polynomial"; break; break;
case 3: name = "Square root polynomial"; break; case 2:
case 4: name = "Square root of polynomial"; break; name = "Polynomial";
case 5: name = "HT Efficiency"; break; break;
case 6: name = "Polynomial in log(y) against log(x)"; break; case 3:
case 7: name = "Polynomial in log(y)"; break; name = "Square root polynomial";
case 8: name = "Polynomial in log(y) against log(1/x)"; break; break;
case 9: name = "Inverse exponential"; break; case 4:
case 93: name = "HAE Efficiency (1-3)"; break; name = "Square root of polynomial";
case 94: name = "HAE Efficiency (1-2)"; break; break;
case 95: name = "HAE Efficiency (1-2-3)"; break; case 5:
case 96: name = "Inverse power"; break; name = "HT Efficiency";
case 97: name = "Exponential sum"; break; break;
case 98: name = "Constant"; break; case 6:
case 99: name = "Linear with cut-off"; break; name = "Polynomial in log(y) against log(x)";
default: name = ""; break; break;
case 7:
name = "Polynomial in log(y)";
break;
case 8:
name = "Polynomial in log(y) against log(1/x)";
break;
case 9:
name = "Inverse exponential";
break;
case 93:
name = "HAE Efficiency (1-3)";
break;
case 94:
name = "HAE Efficiency (1-2)";
break;
case 95:
name = "HAE Efficiency (1-2-3)";
break;
case 96:
name = "Inverse power";
break;
case 97:
name = "Exponential sum";
break;
case 98:
name = "Constant";
break;
case 99:
name = "Linear with cut-off";
break;
default:
name = "";
break;
} }
return name; return name;
} }
@ -3359,8 +3570,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
middleData.calibration_pairs_S_EF_Caltype = CalType.EFFICIENCY_CAL.getType(); middleData.calibration_pairs_S_EF_Caltype = CalType.EFFICIENCY_CAL.getType();
middleData.calibration_pairs_S_EF_Input = fileAnlyse.getUsedEffi(); middleData.calibration_pairs_S_EF_Input = fileAnlyse.getUsedEffi();
List<String> temp = new LinkedList<>(); List<String> temp = new LinkedList<>();
for(int pos=0;pos<fileAnlyse.getUsedEffiKD().getG_energy().size();pos++) for (int pos = 0; pos < fileAnlyse.getUsedEffiKD().getG_energy().size(); pos++) {
{
temp.add(String.valueOf(pos)); temp.add(String.valueOf(pos));
} }
middleData.calibration_pairs_EF_idCalPoint = temp; middleData.calibration_pairs_EF_idCalPoint = temp;
@ -3869,14 +4079,11 @@ public class GammaFileUtil extends AbstractLogOrReport {
{ {
halflife /= 31556736; halflife /= 31556736;
units = 'A'; units = 'A';
} } else if (halflife >= 86400) // 1天 = 24 * 60 * 60 = 86400s
else if(halflife >= 86400) // 1天 = 24 * 60 * 60 = 86400s
{ {
halflife /= 86400; halflife /= 86400;
units = 'D'; units = 'D';
} } else if (halflife >= 3600) {
else if(halflife >= 3600)
{
halflife /= 3600; halflife /= 3600;
units = 'H'; units = 'H';
} }

View File

@ -9,9 +9,11 @@ import org.jeecg.common.properties.ParameterProperties;
import org.jeecg.modules.base.abstracts.AbstractLogOrReport; import org.jeecg.modules.base.abstracts.AbstractLogOrReport;
import org.jeecg.modules.base.entity.rnman.GardsXeResults; import org.jeecg.modules.base.entity.rnman.GardsXeResults;
import org.jeecg.modules.base.enums.DataTypeAbbr; import org.jeecg.modules.base.enums.DataTypeAbbr;
import org.jeecg.modules.base.enums.StationDetailType;
import org.jeecg.modules.base.enums.XeNuclideName; import org.jeecg.modules.base.enums.XeNuclideName;
import org.jeecg.modules.entity.*; import org.jeecg.modules.entity.*;
import org.jeecg.modules.entity.vo.*; import org.jeecg.modules.entity.vo.*;
import org.jeecg.modules.entity.vo.QCFlagParmData.Rule;
import org.jeecg.modules.native_jni.EnergySpectrumHandler; import org.jeecg.modules.native_jni.EnergySpectrumHandler;
import org.jeecg.modules.native_jni.struct.BgAnalyseResult; import org.jeecg.modules.native_jni.struct.BgAnalyseResult;
import org.jeecg.modules.native_jni.struct.BgBoundary; import org.jeecg.modules.native_jni.struct.BgBoundary;
@ -204,8 +206,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
List<Long> betaProjectedData = new LinkedList<>(); List<Long> betaProjectedData = new LinkedList<>();
for (int j = 0; j < bChannels; ++j) { for (int j = 0; j < bChannels; ++j) {
long j_count = 0; long j_count = 0;
for (int i=0; i<gChannels; ++i) for (int i = 0; i < gChannels; ++i) {
{
j_count += hCounts.get((int) (i * bChannels + j)); j_count += hCounts.get((int) (i * bChannels + j));
} }
betaProjectedData.add(j_count); betaProjectedData.add(j_count);
@ -805,6 +806,139 @@ public class PHDFileUtil extends AbstractLogOrReport {
} }
} }
public void getLightColor(StationDetailType stationType, Map<String, Object> sampleMap, Map<String, Object> gasBgMap, Map<String, Object> detBgMap, Map<String, Object> qcMap) {
String pathname = parameterProperties.getFilePath() + File.separator + "parameter.xml";
SpectrumData sampleSpectrumData = (SpectrumData) sampleMap.get("spectrumData");
SpectrumData gasBgSpectrumData = (SpectrumData) gasBgMap.get("spectrumData");
SpectrumData detBgSpectrumData = (SpectrumData) detBgMap.get("spectrumData");
//灯颜色
Sections sections = new Sections(stationType, pathname);
List<Rule> airVolumeRules = sections.getAirVolumeRules();
List<Rule> collectionTimeRules = sections.getCollectionTimeRules();
List<Rule> acquisitionTimeRules = sections.getAcquisitionTimeRules();
List<Rule> xeVolumeRules = sections.getXeVolumeRules();
//region air volume check
double airVolume = Double.parseDouble(sampleSpectrumData.getAirVolume());
if (Objects.nonNull(airVolume) && Objects.nonNull(airVolumeRules)) {
// air volume check
for (Rule rule : airVolumeRules) {
if (Objects.isNull(rule.getMax())) {
if (rule.getMin() < airVolume) {
sampleMap.put("SampleVolumeBtn", rule.getColor());
gasBgMap.put("SampleVolumeBtn", rule.getColor());
detBgMap.put("SampleVolumeBtn", rule.getColor());
qcMap.put("SampleVolumeBtn", rule.getColor());
break;
}
}
if (rule.getMin() < airVolume && airVolume <= rule.getMax()) {
sampleMap.put("SampleVolumeBtn", rule.getColor());
gasBgMap.put("SampleVolumeBtn", rule.getColor());
detBgMap.put("SampleVolumeBtn", rule.getColor());
qcMap.put("SampleVolumeBtn", rule.getColor());
break;
}
}
}
//endregion
//region collection time check
String collectionTime = sampleSpectrumData.getCollectionTime();
if (StringUtils.isNotBlank(collectionTime) && Objects.nonNull(collectionTimeRules)) {
double collection_time = Double.parseDouble(collectionTime);
collection_time = collection_time / 3600;
for (Rule rule : collectionTimeRules) {
if (Objects.isNull(rule.getMax())) {
if (rule.getMin() < collection_time) {
sampleMap.put("CollectTimeBtn", rule.getColor());
gasBgMap.put("CollectTimeBtn", rule.getColor());
detBgMap.put("CollectTimeBtn", rule.getColor());
qcMap.put("CollectTimeBtn", rule.getColor());
break;
}
}
if (rule.getMin() < collection_time && collection_time <= rule.getMax()) {
sampleMap.put("CollectTimeBtn", rule.getColor());
gasBgMap.put("CollectTimeBtn", rule.getColor());
detBgMap.put("CollectTimeBtn", rule.getColor());
qcMap.put("CollectTimeBtn", rule.getColor());
break;
}
}
}
//endregion
//region acquisition time check
double acquisitionLiveTime = Double.parseDouble(sampleSpectrumData.getAcquisitionLiveTime());
if (Objects.nonNull(acquisitionLiveTime) && Objects.nonNull(acquisitionTimeRules)) {
acquisitionLiveTime = acquisitionLiveTime / 3600;
for (Rule rule : acquisitionTimeRules) {
if (Objects.isNull(rule.getMax())) {
if (rule.getMin() < acquisitionLiveTime) {
sampleMap.put("AcqTimeBtn", rule.getColor());
gasBgMap.put("AcqTimeBtn", rule.getColor());
detBgMap.put("AcqTimeBtn", rule.getColor());
qcMap.put("AcqTimeBtn", rule.getColor());
break;
}
}
if (rule.getMin() < acquisitionLiveTime && acquisitionLiveTime <= rule.getMax()) {
sampleMap.put("AcqTimeBtn", rule.getColor());
gasBgMap.put("AcqTimeBtn", rule.getColor());
detBgMap.put("AcqTimeBtn", rule.getColor());
qcMap.put("AcqTimeBtn", rule.getColor());
break;
}
}
}
//endregion
//region XeVolume
double xeVolume = Double.parseDouble(sampleSpectrumData.getXeVolume());
if (Objects.nonNull(xeVolumeRules)) {
for (Rule rule : xeVolumeRules) {
if (Objects.isNull(rule.getMax())) {
if (rule.getMin() < xeVolume) {
sampleMap.put("XeVolumeBtn", rule.getColor());
gasBgMap.put("XeVolumeBtn", rule.getColor());
detBgMap.put("XeVolumeBtn", rule.getColor());
qcMap.put("XeVolumeBtn", rule.getColor());
break;
}
}
if (rule.getMin() < xeVolume && xeVolume <= rule.getMax()) {
sampleMap.put("XeVolumeBtn", rule.getColor());
gasBgMap.put("XeVolumeBtn", rule.getColor());
detBgMap.put("XeVolumeBtn", rule.getColor());
qcMap.put("XeVolumeBtn", rule.getColor());
break;
}
}
}
//endregion
//region GasBgBtnDetBgBtn
String gasBgColor = gasBgSpectrumData.getMeasurementId().equals(sampleSpectrumData.getGasBkMeasurementId()) ? "GreenLight" : "RedLight";
sampleMap.put("GasBgBtn", gasBgColor);
gasBgMap.put("GasBgBtn", gasBgColor);
detBgMap.put("GasBgBtn", gasBgColor);
qcMap.put("GasBgBtn", gasBgColor);
String detBgColor = detBgSpectrumData.getMeasurementId().equals(sampleSpectrumData.getDetectorBkMeasurementId()) ? "GreenLight" : "RedLight";
sampleMap.put("DetBgBtn", detBgColor);
gasBgMap.put("DetBgBtn", detBgColor);
detBgMap.put("DetBgBtn", detBgColor);
qcMap.put("DetBgBtn", detBgColor);
//endregion
}
public Map<String, String> getFileData(String filePath, String sampleFileName) { public Map<String, String> getFileData(String filePath, String sampleFileName) {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
File file = null; File file = null;
@ -882,6 +1016,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
return path.toString(); return path.toString();
} }
} }
public String NameStandardBy(String fileName, String systemType, String dataType) { public String NameStandardBy(String fileName, String systemType, String dataType) {
StringBuffer path = new StringBuffer(); StringBuffer path = new StringBuffer();
try { try {
@ -2778,6 +2913,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
/** /**
* 获取beta刻度校正数据 * 获取beta刻度校正数据
*
* @param gEtoCParam gamma e2c公式参数 * @param gEtoCParam gamma e2c公式参数
* @param bElectronEnergy beta energy * @param bElectronEnergy beta energy
* @param bEtoCParam beta e2c公式参数 * @param bEtoCParam beta e2c公式参数
@ -2827,7 +2963,6 @@ public class PHDFileUtil extends AbstractLogOrReport {
} }
/** /**
*
* @param chartHeight 图形高度 * @param chartHeight 图形高度
* @param channelWidth 图形宽度 * @param channelWidth 图形宽度
* @param gammaChannel gamma道址 * @param gammaChannel gamma道址

View File

@ -39,6 +39,7 @@ import org.jeecg.modules.base.entity.rnman.*;
import org.jeecg.modules.base.enums.*; import org.jeecg.modules.base.enums.*;
import org.jeecg.modules.entity.*; import org.jeecg.modules.entity.*;
import org.jeecg.modules.entity.vo.*; import org.jeecg.modules.entity.vo.*;
import org.jeecg.modules.entity.vo.QCFlagParmData.Rule;
import org.jeecg.modules.mapper.SpectrumAnalysisMapper; import org.jeecg.modules.mapper.SpectrumAnalysisMapper;
import org.jeecg.modules.native_jni.EnergySpectrumHandler; import org.jeecg.modules.native_jni.EnergySpectrumHandler;
import org.jeecg.modules.native_jni.struct.BgAnalyseResult; import org.jeecg.modules.native_jni.struct.BgAnalyseResult;
@ -385,6 +386,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
@Override @Override
public Result getDBSpectrumChart(String dbName, Integer sampleId, String analyst, HttpServletRequest request) { public Result getDBSpectrumChart(String dbName, Integer sampleId, String analyst, HttpServletRequest request) {
HashMap<String, GardsStations> stationInfoMap = (HashMap<String, GardsStations>) redisUtil.get("stationInfoMap");
Result result = new Result(); Result result = new Result();
//获取当前的用户名称 //获取当前的用户名称
String userName = JwtUtil.getUserNameByToken(request); String userName = JwtUtil.getUserNameByToken(request);
@ -632,8 +634,23 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
qcMap.put("fileName", betaDataFile.getQcFileName()); qcMap.put("fileName", betaDataFile.getQcFileName());
resultMap.put("qc", qcMap); resultMap.put("qc", qcMap);
} }
Integer stationId = spectrumAnalysisMapper.getStationId(betaDataFile.getSampleStruct().getSite_code());
GardsStations station = stationInfoMap.get(stationId.toString());
switch (station.getEfficCalculType()) {
case "SAUNA":
//分析状态颜色
phdFileUtil.getLightColor(StationDetailType.SAUNA, sampleMap, gasBgMap, detBgMap, qcMap);
break;
case "SAUNA2":
//分析状态颜色
phdFileUtil.getLightColor(StationDetailType.SAUNA2, sampleMap, gasBgMap, detBgMap, qcMap);
break;
default:
//分析状态颜色 //分析状态颜色
phdFileUtil.getLightColor(sampleMap, gasBgMap, detBgMap, qcMap); phdFileUtil.getLightColor(sampleMap, gasBgMap, detBgMap, qcMap);
break;
}
//Xe //Xe
if (CollectionUtils.isNotEmpty(xeResultsSpectrumList)) { if (CollectionUtils.isNotEmpty(xeResultsSpectrumList)) {
for (GardsXeResultsSpectrum xeData : xeResultsSpectrumList) { for (GardsXeResultsSpectrum xeData : xeResultsSpectrumList) {
@ -796,6 +813,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
@Override @Override
public Result getFileSpectrumChart(String sampleFileName, String gasFileName, String detFileName, String qcFileName, HttpServletRequest request) { public Result getFileSpectrumChart(String sampleFileName, String gasFileName, String detFileName, String qcFileName, HttpServletRequest request) {
Result result = new Result(); Result result = new Result();
HashMap<String, GardsStations> stationInfoMap = (HashMap<String, GardsStations>) redisUtil.get("stationInfoMap");
//获取用户名 //获取用户名
String userName = JwtUtil.getUserNameByToken(request); String userName = JwtUtil.getUserNameByToken(request);
//上传文件路径 //上传文件路径
@ -862,6 +880,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
resultMap.put("qc", qcMap); resultMap.put("qc", qcMap);
} }
} }
} else { } else {
xeResultsSpectrumList = betaDataFile.getXeResultsSpectrumList(); xeResultsSpectrumList = betaDataFile.getXeResultsSpectrumList();
sampleMap = loadData("sample", betaDataFile); sampleMap = loadData("sample", betaDataFile);
@ -877,7 +896,22 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
qcMap.put("fileName", betaDataFile.getQcFileName()); qcMap.put("fileName", betaDataFile.getQcFileName());
resultMap.put("qc", qcMap); resultMap.put("qc", qcMap);
} }
Integer stationId = spectrumAnalysisMapper.getStationId(betaDataFile.getSampleStruct().getSite_code());
GardsStations station = stationInfoMap.get(stationId.toString());
switch (station.getEfficCalculType()) {
case "SAUNA":
//分析状态颜色
phdFileUtil.getLightColor(StationDetailType.SAUNA, sampleMap, gasBgMap, detBgMap, qcMap);
break;
case "SAUNA2":
//分析状态颜色
phdFileUtil.getLightColor(StationDetailType.SAUNA2, sampleMap, gasBgMap, detBgMap, qcMap);
break;
default:
//分析状态颜色
phdFileUtil.getLightColor(sampleMap, gasBgMap, detBgMap, qcMap); phdFileUtil.getLightColor(sampleMap, gasBgMap, detBgMap, qcMap);
break;
}
//Xe //Xe
if (CollectionUtils.isNotEmpty(xeResultsSpectrumList)) { if (CollectionUtils.isNotEmpty(xeResultsSpectrumList)) {
for (GardsXeResultsSpectrum xeData : xeResultsSpectrumList) { for (GardsXeResultsSpectrum xeData : xeResultsSpectrumList) {
@ -1685,6 +1719,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
@Override @Override
public Result<QCResult> viewQCResult(Integer sampleId, String dbName, String sampleFileName, String gasFileName, String detFileName, HttpServletRequest request) { public Result<QCResult> viewQCResult(Integer sampleId, String dbName, String sampleFileName, String gasFileName, String detFileName, HttpServletRequest request) {
Result<QCResult> result = new Result(); Result<QCResult> result = new Result();
HashMap<String, GardsStations> stationInfoMap = (HashMap<String, GardsStations>) redisUtil.get("stationInfoMap");
//获取用户名称 //获取用户名称
String userName = JwtUtil.getUserNameByToken(request); String userName = JwtUtil.getUserNameByToken(request);
//读取本地缓存 //读取本地缓存
@ -1694,6 +1729,25 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
result.error500("Load basic file information first!"); result.error500("Load basic file information first!");
return result; return result;
} }
Integer stationId = spectrumAnalysisMapper.getStationId(betaDataFile.getSampleStruct().getSite_code());
GardsStations station = stationInfoMap.get(stationId.toString());
QCResult qcResult = new QCResult();
switch (station.getEfficCalculType()) {
case "SAUNA":
qcResult = ProcessQCResultBranch(StationDetailType.SAUNA,betaDataFile);
break;
case "SAUNA2":
qcResult = ProcessQCResultBranch(StationDetailType.SAUNA2, betaDataFile);
break;
default:
break;
}
result.setSuccess(true);
result.setResult(qcResult);
return result;
}
private QCResult ProcessQCResultBranch(BetaDataFile betaDataFile) {
QCResult qcResult = new QCResult(); QCResult qcResult = new QCResult();
//获取各数据的范围信息 //获取各数据的范围信息
Sections sections = new Sections(); Sections sections = new Sections();
@ -1718,7 +1772,6 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
gardsXeResults = xeDataList.get(0); gardsXeResults = xeDataList.get(0);
} }
//解析sample,gas,det文件并判断数据状态 //解析sample,gas,det文件并判断数据状态
if (Objects.nonNull(betaDataFile)) {
EnergySpectrumStruct sampleSourceData = betaDataFile.getSampleStruct(); EnergySpectrumStruct sampleSourceData = betaDataFile.getSampleStruct();
EnergySpectrumStruct gasSourceData = betaDataFile.getGasStruct(); EnergySpectrumStruct gasSourceData = betaDataFile.getGasStruct();
EnergySpectrumStruct detSourceData = betaDataFile.getDetStruct(); EnergySpectrumStruct detSourceData = betaDataFile.getDetStruct();
@ -1726,7 +1779,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
if (Objects.nonNull(sampleSourceData) && Objects.nonNull(gasSourceData) && Objects.nonNull(detSourceData)) { if (Objects.nonNull(sampleSourceData) && Objects.nonNull(gasSourceData) && Objects.nonNull(detSourceData)) {
Date collectStartDate = DateUtils.parseDate(sampleSourceData.collection_start_date + StringPool.SPACE + sampleSourceData.collection_start_time); Date collectStartDate = DateUtils.parseDate(sampleSourceData.collection_start_date + StringPool.SPACE + sampleSourceData.collection_start_time);
Date collectStopDate = DateUtils.parseDate(sampleSourceData.collection_stop_date + StringPool.SPACE + sampleSourceData.collection_stop_time); Date collectStopDate = DateUtils.parseDate(sampleSourceData.collection_stop_date + StringPool.SPACE + sampleSourceData.collection_stop_time);
Double collection_time = Double.valueOf((collectStopDate.getTime() - collectStartDate.getTime()) / 1000); Double collection_time = (double) ((collectStopDate.getTime() - collectStartDate.getTime()) / 1000);
String collection_time_value = String.format("%.4f", collection_time / 3600.0); String collection_time_value = String.format("%.4f", collection_time / 3600.0);
qcResult.setCollectTimeValue(collection_time_value); qcResult.setCollectTimeValue(collection_time_value);
if (collectionTimeSections.get(1) < collection_time / 3600.0 && collection_time / 3600.0 < collectionTimeSections.get(4)) { if (collectionTimeSections.get(1) < collection_time / 3600.0 && collection_time / 3600.0 < collectionTimeSections.get(4)) {
@ -1785,13 +1838,121 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
qcResult.setXe133MDCValue("None"); qcResult.setXe133MDCValue("None");
qcResult.setXe133MDCStatus("None"); qcResult.setXe133MDCStatus("None");
} }
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
result.setSuccess(true); return qcResult;
result.setResult(qcResult); }
return result;
private QCResult ProcessQCResultBranch(StationDetailType stationType, BetaDataFile betaDataFile) {
//region 参数信息
QCResult qcResult = new QCResult();
String pathname = parameterProperties.getFilePath() + File.separator + "parameter.xml";
//获取各数据的范围信息
Sections sections = new Sections(stationType, pathname);
List<Rule> collectionTimeRules = sections.getCollectionTimeRules();
if (CollectionUtils.isNotEmpty(collectionTimeRules)) {
String collectionMerits = collectionTimeRules.get(1).getMin() + "~" + collectionTimeRules.get(collectionTimeRules.size() - 1).getMin();
qcResult.setCollectTimeEvaluationMetrics(collectionMerits);
}
List<Rule> acquisitionTimeRules = sections.getAcquisitionTimeRules();
if (CollectionUtils.isNotEmpty(acquisitionTimeRules)) {
String acquisitionMerits = acquisitionTimeRules.get(1).getMin() + "~" + acquisitionTimeRules.get(acquisitionTimeRules.size() - 1).getMin();
qcResult.setAcquisitionTimeEvaluationMetrics(acquisitionMerits);
}
List<Rule> xeVolumeRules = sections.getXeVolumeRules();
if (CollectionUtils.isNotEmpty(xeVolumeRules)) {
String xeMerits = xeVolumeRules.get(1).getMin() + "~ ";
qcResult.setXenonVolumeEvaluationMetrics(xeMerits);
}
String xe133MDCEvaluationMetrics = "0.001 ~ 5";
qcResult.setXe133MDCEvaluationMetrics(xe133MDCEvaluationMetrics);
//endregion
//获取数据信息
GardsXeResultsSpectrum gardsXeResults = null;
List<GardsXeResultsSpectrum> xeDataList = new LinkedList<>();
try {
xeDataList = betaDataFile.getXeResultsSpectrumList();
if (CollectionUtils.isNotEmpty(xeDataList)) {
xeDataList = xeDataList.stream().filter(item -> item.getNuclideName().equals(XeNuclideName.XE_133.getType())).collect(Collectors.toList());
gardsXeResults = xeDataList.get(0);
}
//解析sample,gas,det文件并判断数据状态
EnergySpectrumStruct sampleSourceData = betaDataFile.getSampleStruct();
EnergySpectrumStruct gasSourceData = betaDataFile.getGasStruct();
EnergySpectrumStruct detSourceData = betaDataFile.getDetStruct();
try {
if (Objects.nonNull(sampleSourceData) && Objects.nonNull(gasSourceData) && Objects.nonNull(detSourceData)) {
Date collectStartDate = DateUtils.parseDate(sampleSourceData.collection_start_date + StringPool.SPACE + sampleSourceData.collection_start_time);
Date collectStopDate = DateUtils.parseDate(sampleSourceData.collection_stop_date + StringPool.SPACE + sampleSourceData.collection_stop_time);
double collection_time = ((double) ((collectStopDate.getTime() - collectStartDate.getTime()) / 1000)) / 3600.0;
String collection_time_value = String.format("%.4f", collection_time);
qcResult.setCollectTimeValue(collection_time_value);
if (collectionTimeRules.get(1).getMin() < collection_time && collection_time < collectionTimeRules.get(collectionTimeRules.size() - 1).getMin()) {
qcResult.setCollectTimeStatus("Pass");
} else {
qcResult.setCollectTimeStatus("Failed");
}
double acquisition_live_time = sampleSourceData.acquisition_live_time / 3600.0;
String acquisition_live_sec = String.format("%.2f", sampleSourceData.acquisition_live_time / 3600.0);
qcResult.setAcquisitionTimeValue(acquisition_live_sec);
if (acquisitionTimeRules.get(1).getMin() < acquisition_live_time && acquisition_live_time < acquisitionTimeRules.get(acquisitionTimeRules.size()-1).getMin()) {
qcResult.setAcquisitionTimeStatus("Pass");
} else {
qcResult.setAcquisitionTimeStatus("Failed");
}
String s_xe_stable_volume = String.valueOf(sampleSourceData.sample_volume_of_Xe);
qcResult.setXenonVolumeValue(s_xe_stable_volume);
if (xeVolumeRules.get(1).getMin() < sampleSourceData.sample_volume_of_Xe) {
qcResult.setXenonVolumeStatus("Pass");
} else {
qcResult.setXenonVolumeStatus("Failed");
}
//
String gasMeasurementID = gasSourceData.measurement_id;
if (gasMeasurementID.equals(sampleSourceData.gas_bk_measurement_id)) {
qcResult.setGasBgValue("Match");
qcResult.setGasBgEvaluationMetrics("Match");
qcResult.setGasBgValueAndStatus(true);
} else {
qcResult.setGasBgValue("");
qcResult.setGasBgEvaluationMetrics("");
qcResult.setGasBgValueAndStatus(false);
}
//
String detMeasurementID = detSourceData.measurement_id;
if (detMeasurementID.equals(sampleSourceData.detector_bk_measurement_id)) {
qcResult.setDetBgValue("Match");
qcResult.setDetBgEvaluationMetrics("Match");
qcResult.setDetBgValueAndStatus(true);
} else {
qcResult.setDetBgValue("");
qcResult.setDetBgEvaluationMetrics("");
qcResult.setDetBgValueAndStatus(false);
}
}
} catch (RuntimeException e) {
throw new RuntimeException(e);
}
if (Objects.nonNull(gardsXeResults)) {
qcResult.setXe133MDCValue(String.valueOf(gardsXeResults.getMdc()));
if (0.001 < gardsXeResults.getMdc() && gardsXeResults.getMdc() < 5.0) {
qcResult.setXe133MDCStatus("Pass");
} else {
qcResult.setXe133MDCStatus("Failed");
}
} else {
qcResult.setXe133MDCValue("None");
qcResult.setXe133MDCStatus("None");
}
} catch (Exception e) {
e.printStackTrace();
}
return qcResult;
} }
@Override @Override

View File

@ -1,4 +1,5 @@
<config> <config>
<DAYSPAN> <DAYSPAN>
<item dayspan="30"/> <item dayspan="30"/>
</DAYSPAN> </DAYSPAN>
@ -22,7 +23,7 @@
<SAUNA2> <SAUNA2>
<item collect_low="5.4"/> <item collect_low="5.4"/>
<item collect_high="6.6"/> <item collect_high="6.6"/>
<item live_low="5.4"/> <item live_low="4.2"/>
<item live_high="6.6"/> <item live_high="6.6"/>
<item quantity="10"/> <item quantity="10"/>
<item xe_volume="0.87"/> <item xe_volume="0.87"/>
@ -74,7 +75,7 @@
<SAUNA2> <SAUNA2>
<item collect_low="5.4"/> <item collect_low="5.4"/>
<item collect_high="6.6"/> <item collect_high="6.6"/>
<item live_low="5.4"/> <item live_low="4.2"/>
<item live_high="6.6"/> <item live_high="6.6"/>
<item quantity="10"/> <item quantity="10"/>
<item xe_volume="0.87"/> <item xe_volume="0.87"/>
@ -239,4 +240,94 @@
</SPHD_MET_SOH> </SPHD_MET_SOH>
</STATION> </STATION>
</SPECIAL> </SPECIAL>
<QCFlags-P>
<!-- 范围内显示绿色,否则显示红色 -->
<!-- "["表示大于等于,"]"表示小于等于,"("表示大于,")"表示小于 -->
<col_time green="[21.6,26.4]"/>
<!-- 21.6 <= col_time <= 26.4, units:hour -->
<acq_time green="(18.0,-)"/>
<!-- acq_time > 18, units:hour -->
<decay_time green="(-,26.4)"/>
<!-- decay_time < 26.4, units:hour -->
<samp_vol green="(10800,-)"/>
<!-- samp_vol > 10800, units:cube meter -->
<Be7-FWHM green="(-,1.7)"/>
<!-- Be7-FWHM < 1.7, units:keV -->
<Ba140-MDC green="(-,30)"/>
<!-- Ba140-MDC < 30, units:uBq/m3 -->
<airFlow green="(500,-)"/>
<!-- airFlow > 500, units:cube meter per hour -->
<Be7 energy="477.595001"/>
<Ba140 energy="537.260986" yield="0.24389999" halflife="12.752"/>
</QCFlags-P>
<QCFlags-SPALAX>
<col_time green="[5.4,6.6]"/>
<acq_time green="[16.0,24.0]"/>
<decay_time green="(-,10.0)"/>
<samp_vol green="(10,-)"/>
<Xe133-MDC green="(-,1000)"/>
<airFlow green="(0.4,-)"/>
<Xe133 energy="80.997002" yield="0.38" halflife="5.243"/>
</QCFlags-SPALAX>
<QCFlags-SPALAX-PLC>
<col_time green="[10.8,13.2]"/>
<acq_time green="[10.8,13.2]"/>
<decay_time green="(-,10.0)"/>
<samp_vol green="(10,-)"/>
<Xe133-MDC green="(-,1000)"/>
<airFlow green="(0.4,-)"/>
<Xe133 energy="80.997002" yield="0.38" halflife="5.243"/>
</QCFlags-SPALAX-PLC>
<sauna>
<collectionTime>
<Rule min="0.0" max="6.0" color="RedLight"/>
<Rule min="6.0" max="10.8" color="YellowLight"/>
<Rule min="10.8" max="13.2" color="GreenLight"/>
<Rule min="13.2" max="24.0" color="YellowLight"/>
<Rule min="24.0" color="RedLight"/>
</collectionTime>
<acquisitionTime>
<Rule min="0.0" max="6.0" color="RedLight"/>
<Rule min="6.0" max="10.8" color="YellowLight"/>
<Rule min="10.8" max="13.2" color="GreenLight"/>
<Rule min="13.2" max="24.0" color="YellowLight"/>
<Rule min="24.0" color="RedLight"/>
</acquisitionTime>
<xeVolume>
<Rule min="0.0" max="0.2" color="RedLight"/>
<Rule min="0.2" max="0.87" color="YellowLight"/>
<Rule min="0.87" color="GreenLight"/>
</xeVolume>
<airVolume>
<Rule min="0.0" max="2.3" color="RedLight"/>
<Rule min="2.3" max="10.0" color="YellowLight"/>
<Rule min="10.0" color="GreenLight"/>
</airVolume>
</sauna>
<sauna2>
<collectionTime>
<Rule min="0.0" max="3.0" color="RedLight"/>
<Rule min="3.0" max="5.4" color="YellowLight"/>
<Rule min="5.4" max="6.6" color="GreenLight"/>
<Rule min="6.6" max="12.0" color="RedLight"/>
<Rule min="12.0" color="RedLight"/>
</collectionTime>
<acquisitionTime>
<Rule min="0.0" max="3.0" color="RedLight"/>
<Rule min="3.0" max="5.4" color="YellowLight"/>
<Rule min="5.4" max="6.6" color="GreenLight"/>
<Rule min="6.6" max="12.0" color="RedLight"/>
<Rule min="12.0" color="RedLight"/>
</acquisitionTime>
<xeVolume>
<Rule min="0.0" max="0.2" color="RedLight"/>
<Rule min="0.2" max="0.87" color="YellowLight"/>
<Rule min="0.87" color="GreenLight"/>
</xeVolume>
<airVolume>
<Rule min="0.0" max="2.3" color="RedLight"/>
<Rule min="2.3" max="10.0" color="YellowLight"/>
<Rule min="10.0" color="GreenLight"/>
</airVolume>
</sauna2>
</config> </config>