相角180度时特殊处理
This commit is contained in:
@@ -488,6 +488,19 @@ public class DetectionServiceImpl {
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(checkData)) {
|
||||
List<Double> phaseValue = map.get(phase);
|
||||
if (ResultUnitEnum.ANGLE.getCode().equals(type)) {
|
||||
phaseValue = phaseValue.stream().map(x -> {
|
||||
// 原始误差值
|
||||
double originDiff = x - checkData.get(0).getValue();
|
||||
// 转换误差值
|
||||
double translateDiff = Math.abs(originDiff) - 360;
|
||||
if (Math.abs(translateDiff) <= 10) {
|
||||
return Math.abs(x);
|
||||
} else {
|
||||
return x;
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
// 注意:如果map中不存在该phase的键,phaseValue可能为null,需确保map包含该键
|
||||
DetectionData detectionData = rangeComparisonList(phaseValue, isQualified, pqErrSysDtls, fData, checkData.get(0).getValue(), dataRule, scale);
|
||||
resultFlag.add(detectionData);
|
||||
|
||||
Reference in New Issue
Block a user