Commit 90de48d8 by huangjy

feat: 生成报告过滤呼吸心率是0和255

parent fc6176f2
......@@ -233,6 +233,7 @@ public class IotProductDeviceService extends IotCommonService {
DeviceInfoContentBreathe.Properties tempProperties;
for (Map.Entry<String, List<DeviceInfoContentBreathe>> entry : minuteMap.entrySet()) {
deviceInfoContentBreathes = entry.getValue();
int reportCount = deviceInfoContentBreathes.size();
DeviceInfoContentBreathe.Properties breatheProperties;
Integer bodymove = 0;
int br = 0;
......@@ -246,15 +247,27 @@ public class IotProductDeviceService extends IotCommonService {
noPersonCount++;
continue;
}
// 0和255直接跳过
if (breatheProperties.getHr() == 255 || breatheProperties.getHr() == 0 ) {
noPersonCount++;
continue;
}
if (breatheProperties.getBr() == 255 || breatheProperties.getBr() == 0) {
noPersonCount++;
continue;
}
hr += breatheProperties.getHr();
br += breatheProperties.getBr();
bodymove += breatheProperties.getBodymove();
}
temp = new DeviceInfoContentBreathe();
tempProperties = new DeviceInfoContentBreathe.Properties();
tempProperties.setHr(noPersonCount == 60 ? 0 : hr / (60 - noPersonCount));
tempProperties.setBr(noPersonCount == 60 ? 0 : br / (60 - noPersonCount));
tempProperties.setBodymove(noPersonCount == 60 ? 0 : bodymove / (60- noPersonCount));
if (noPersonCount == reportCount) {
continue;
}
tempProperties.setHr(hr / (reportCount - noPersonCount));
tempProperties.setBr(br / (reportCount - noPersonCount));
tempProperties.setBodymove(bodymove / (reportCount- noPersonCount));
temp.setTimestamp(timestamp);
temp.setProperties(tempProperties);
tempList.add(temp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment