Commit 90de48d8 by huangjy

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

parent fc6176f2
...@@ -233,6 +233,7 @@ public class IotProductDeviceService extends IotCommonService { ...@@ -233,6 +233,7 @@ public class IotProductDeviceService extends IotCommonService {
DeviceInfoContentBreathe.Properties tempProperties; DeviceInfoContentBreathe.Properties tempProperties;
for (Map.Entry<String, List<DeviceInfoContentBreathe>> entry : minuteMap.entrySet()) { for (Map.Entry<String, List<DeviceInfoContentBreathe>> entry : minuteMap.entrySet()) {
deviceInfoContentBreathes = entry.getValue(); deviceInfoContentBreathes = entry.getValue();
int reportCount = deviceInfoContentBreathes.size();
DeviceInfoContentBreathe.Properties breatheProperties; DeviceInfoContentBreathe.Properties breatheProperties;
Integer bodymove = 0; Integer bodymove = 0;
int br = 0; int br = 0;
...@@ -246,15 +247,27 @@ public class IotProductDeviceService extends IotCommonService { ...@@ -246,15 +247,27 @@ public class IotProductDeviceService extends IotCommonService {
noPersonCount++; noPersonCount++;
continue; continue;
} }
// 0和255直接跳过
if (breatheProperties.getHr() == 255 || breatheProperties.getHr() == 0 ) {
noPersonCount++;
continue;
}
if (breatheProperties.getBr() == 255 || breatheProperties.getBr() == 0) {
noPersonCount++;
continue;
}
hr += breatheProperties.getHr(); hr += breatheProperties.getHr();
br += breatheProperties.getBr(); br += breatheProperties.getBr();
bodymove += breatheProperties.getBodymove(); bodymove += breatheProperties.getBodymove();
} }
temp = new DeviceInfoContentBreathe(); temp = new DeviceInfoContentBreathe();
tempProperties = new DeviceInfoContentBreathe.Properties(); tempProperties = new DeviceInfoContentBreathe.Properties();
tempProperties.setHr(noPersonCount == 60 ? 0 : hr / (60 - noPersonCount)); if (noPersonCount == reportCount) {
tempProperties.setBr(noPersonCount == 60 ? 0 : br / (60 - noPersonCount)); continue;
tempProperties.setBodymove(noPersonCount == 60 ? 0 : bodymove / (60- noPersonCount)); }
tempProperties.setHr(hr / (reportCount - noPersonCount));
tempProperties.setBr(br / (reportCount - noPersonCount));
tempProperties.setBodymove(bodymove / (reportCount- noPersonCount));
temp.setTimestamp(timestamp); temp.setTimestamp(timestamp);
temp.setProperties(tempProperties); temp.setProperties(tempProperties);
tempList.add(temp); 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