修改QCFlag获取参数方式
This commit is contained in:
parent
92aa2e9f77
commit
d91947b181
|
@ -15,9 +15,11 @@ import org.jeecg.modules.base.abstracts.AbstractLogOrReport;
|
|||
import org.jeecg.modules.base.entity.rnman.GardsXeResults;
|
||||
import org.jeecg.modules.base.enums.DataType;
|
||||
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.entity.*;
|
||||
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.struct.BgAnalyseResult;
|
||||
import org.jeecg.modules.native_jni.struct.BgBoundary;
|
||||
|
@ -211,8 +213,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
List<Long> betaProjectedData = new LinkedList<>();
|
||||
for (int j = 0; j < bChannels; ++j) {
|
||||
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));
|
||||
}
|
||||
betaProjectedData.add(j_count);
|
||||
|
@ -402,17 +403,6 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
}
|
||||
}
|
||||
|
||||
public List<String> readLine(String filePath) {
|
||||
List<String> allLines = new ArrayList<>();
|
||||
try {
|
||||
File file = new File(filePath);
|
||||
return FileUtils.readLines(file, "UTF-8");
|
||||
}catch (IOException e){
|
||||
e.printStackTrace();
|
||||
return allLines;
|
||||
}
|
||||
}
|
||||
|
||||
public void createBgCalPara(BetaDataFile betaDataFile, List<GardsCalibrationSpectrum> gammaCalibrationSpectrumList, List<GardsCalibrationSpectrum> betaCalibrationSpectrumList,
|
||||
List<GardsCalibrationPairsSpectrum> gammaCalibrationPairsList, List<GardsCalibrationPairsSpectrum> betaCalibrationPairsList) {
|
||||
SpectrumGroup spectrum_group = new SpectrumGroup();
|
||||
|
@ -674,6 +664,17 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
}
|
||||
}
|
||||
|
||||
public List<String> readLine(String filePath) {
|
||||
List<String> allLines = new ArrayList<>();
|
||||
try {
|
||||
File file = new File(filePath);
|
||||
return FileUtils.readLines(file, "UTF-8");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return allLines;
|
||||
}
|
||||
}
|
||||
|
||||
public void getLightColor(Map<String, Object> sampleMap, Map<String, Object> gasBgMap, Map<String, Object> detBgMap, Map<String, Object> qcMap) {
|
||||
SpectrumData sampleSpectrumData = (SpectrumData) sampleMap.get("spectrumData");
|
||||
SpectrumData gasBgSpectrumData = (SpectrumData) gasBgMap.get("spectrumData");
|
||||
|
@ -812,6 +813,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 GasBgBtn、DetBgBtn
|
||||
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) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
File file = null;
|
||||
|
@ -889,6 +1023,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
return path.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public String NameStandardBy(String fileName, String systemType, String dataType) {
|
||||
StringBuffer path = new StringBuffer();
|
||||
try {
|
||||
|
@ -2784,5 +2919,4 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user