bug调整
This commit is contained in:
@@ -54,9 +54,11 @@ import java.util.zip.ZipOutputStream;
|
||||
public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
|
||||
// 定义阈值常量(单位:百分比)
|
||||
final double[] EVENT_VALUE_THRESHOLDS = {90, 85, 70, 40, 10};
|
||||
final double[] EVENT_VALUE_THRESHOLDS = {85, 70, 40, 10, 0};
|
||||
// 定义持续时间阈值(单位:毫秒)
|
||||
final double[] DURATION_THRESHOLDS = {0.02, 0.1, 0.5, 1, 3, 20, 60, 180};
|
||||
// 定义持续时间阈值(单位:毫秒)
|
||||
final double[] DURATION_THRESHOLDS_411 = {0.02, 0.1, 0.2, 0.5, 1, 180};
|
||||
|
||||
String[] labels = {"90%", "85%", "70%", "40%", "10%"};
|
||||
|
||||
@@ -320,6 +322,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
List<RmpEventDetailPO> events = eventDetailService.list(
|
||||
new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||
.le(RmpEventDetailPO::getFeatureAmplitude,0.9)
|
||||
.ge(StringUtils.isNotBlank(statisticsParam.getStartTime()),
|
||||
RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime())))
|
||||
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()),
|
||||
@@ -384,6 +387,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
//查询监测点未处理暂态事件
|
||||
List<RmpEventDetailPO> events = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||
.le(RmpEventDetailPO::getFeatureAmplitude,0.9)
|
||||
.ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime())))
|
||||
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||
);
|
||||
@@ -401,7 +405,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
// 确定事件等级(0=90%, 1=85%, ..., 4=10%)
|
||||
int level = getIEC411_EventLevel(eventValue);
|
||||
// 确定持续时间区间索引
|
||||
int durationIndex = getDurationIndex(duration, DURATION_THRESHOLDS);
|
||||
int durationIndex = getDurationIndex(duration, DURATION_THRESHOLDS_411);
|
||||
|
||||
if (level != -1 && durationIndex != -1) {
|
||||
arr[level][durationIndex]++;
|
||||
@@ -418,11 +422,15 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
* 根据事件值获取等级索引(从高到低匹配)
|
||||
*/
|
||||
private int getIEC411_EventLevel(double eventValue) {
|
||||
if (eventValue >= 0.1 && eventValue < 0.4) {
|
||||
if (eventValue >= 0.01 && eventValue < 0.4) {
|
||||
return 1;
|
||||
} else if (eventValue >= 0.4 && eventValue < 0.7) {
|
||||
return 0;
|
||||
} else if (eventValue >= 0.7 && eventValue < 1) {
|
||||
}
|
||||
// else if (eventValue >= 0.7 && eventValue < 1) {
|
||||
// return 2;
|
||||
// }
|
||||
else if (eventValue < 0.01) {
|
||||
return 2;
|
||||
}
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user