解决间谐波检测脚本问题

This commit is contained in:
wr
2025-03-10 16:49:02 +08:00
parent 67b6f822c3
commit 1c12187d93
3 changed files with 20 additions and 20 deletions

View File

@@ -676,9 +676,9 @@ public class DetectionServiceImpl {
DetectionData c;
if (DUR.equals(dur)) {
c = rangeDURComparisonList(mag.get(typeC), magErrList, fData, channelTypeCList.get(0).getDipData().getRetainTime(), dataRule);
}else {
} else {
List<Double> ampData = mag.get(typeC).stream()
.filter(x->ObjectUtil.isNotNull(x))
.filter(x -> ObjectUtil.isNotNull(x))
.map(x -> x * channelTypeCList.get(0).getFAmp() * 0.01)
.collect(Collectors.toList());
c = rangeComparisonList(ampData, magErrList, fData, channelTypeCList.get(0).getDipData().getFTransValue(), dataRule);
@@ -885,11 +885,11 @@ public class DetectionServiceImpl {
private void setDetection(DictDataEnum dataRule, List<Double> harmDataList, PqErrSysDtls errSysDtl, DetectionData data, Double v) {
List<Double> qualifiedList = harmDataList.stream()
.filter(x -> v == 0 ? NumberUtil.isIn(devSubtractChannelData(x, v, errSysDtl.getErrorValueType()),
BigDecimal.valueOf(-errSysDtl.getMaxErrorValue()),
BigDecimal.valueOf(errSysDtl.getMaxErrorValue())) :
x != 0 && NumberUtil.isIn(devSubtractChannelData(x, v, errSysDtl.getErrorValueType()),
BigDecimal.valueOf(-errSysDtl.getMaxErrorValue()),
BigDecimal.valueOf(errSysDtl.getMaxErrorValue()))).collect(Collectors.toList());
BigDecimal.valueOf(errSysDtl.getMaxErrorValue())) :
x != 0 && NumberUtil.isIn(devSubtractChannelData(x, v, errSysDtl.getErrorValueType()),
BigDecimal.valueOf(-errSysDtl.getMaxErrorValue()),
BigDecimal.valueOf(errSysDtl.getMaxErrorValue()))).collect(Collectors.toList());
isData(dataRule, harmDataList, data, qualifiedList);
}
@@ -1003,6 +1003,7 @@ public class DetectionServiceImpl {
});
return map;
}
/**
* 处理数据是否合格
*
@@ -1219,14 +1220,15 @@ public class DetectionServiceImpl {
if (i.equals(1.0)) {
integerListMap.get(1.0).add(multiply(fund, fund));
} else {
double v = num == 1 ? num : (i - num);
if (type.equals("A")) {
integerListMap.get(i).add(multiply(harm.getList().getA().get((int) (i - num)), fund));
integerListMap.get(i).add(multiply(harm.getList().getA().get((int) v), fund));
}
if (type.equals("B")) {
integerListMap.get(i).add(multiply(harm.getList().getB().get((int) (i - num)), fund));
integerListMap.get(i).add(multiply(harm.getList().getB().get((int) v), fund));
}
if (type.equals("C")) {
integerListMap.get(i).add(multiply(harm.getList().getC().get((int) (i - num)), fund));
integerListMap.get(i).add(multiply(harm.getList().getC().get((int) v), fund));
}
}
}
@@ -1239,14 +1241,15 @@ public class DetectionServiceImpl {
integerList.add(multiply(fund, fund));
integerListMap.put(1.0, integerList);
} else {
double v = num == 1 ? num : (i - num);
if (type.equals("A")) {
integerList.add(multiply(harm.getList().getA().get((int) (i - num)), fund));
integerList.add(multiply(harm.getList().getA().get((int) v), fund));
}
if (type.equals("B")) {
integerList.add(multiply(harm.getList().getB().get((int) (i - num)), fund));
integerList.add(multiply(harm.getList().getB().get((int) v), fund));
}
if (type.equals("C")) {
integerList.add(multiply(harm.getList().getC().get((int) (i - num)), fund));
integerList.add(multiply(harm.getList().getC().get((int) v), fund));
}
integerListMap.put(i, integerList);
}