From: TrillGates Date: Mon, 13 Jun 2022 03:29:11 +0000 (+0800) Subject: 根据陈总提供的血压与时间的关系表,修改了血压的返回值计算方式. X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=14da4aa192b668cbfbebf6854dbf964134419ca5;p=icworkservice.git 根据陈总提供的血压与时间的关系表,修改了血压的返回值计算方式. --- diff --git a/app/src/main/java/com/ic/work/hardware/BloodInfoHelper.java b/app/src/main/java/com/ic/work/hardware/BloodInfoHelper.java index d5450fe..8901b3c 100644 --- a/app/src/main/java/com/ic/work/hardware/BloodInfoHelper.java +++ b/app/src/main/java/com/ic/work/hardware/BloodInfoHelper.java @@ -15,6 +15,8 @@ import com.ic.work.utils.HardwareUtils; import com.ic.work.utils.ICLogger; import com.ic.work.utils.IcLog; +import java.util.Calendar; +import java.util.HashMap; import java.util.Random; /** @@ -256,8 +258,76 @@ public class BloodInfoHelper implements SensorEventListener { } }; + public static HashMap sBoolPressLow = new HashMap<>(); + public static HashMap sBoolPressHigh = new HashMap<>(); + + static { + sBoolPressLow.put(9, 93); + sBoolPressLow.put(10, 86); + sBoolPressLow.put(11, 86); + sBoolPressLow.put(12, 86); + sBoolPressLow.put(13, 86); + sBoolPressLow.put(14, 86); + sBoolPressLow.put(15, 96); + sBoolPressLow.put(16, 93); + sBoolPressLow.put(17, 90); + sBoolPressLow.put(18, 88); + sBoolPressLow.put(19, 80); + sBoolPressLow.put(20, 76); + sBoolPressLow.put(21, 70); + sBoolPressLow.put(22, 73); + sBoolPressLow.put(23, 68); + sBoolPressLow.put(24, 55); + sBoolPressLow.put(1, 58); + sBoolPressLow.put(2, 60); + sBoolPressLow.put(3, 78); + sBoolPressLow.put(4, 84); + sBoolPressLow.put(5, 95); + sBoolPressLow.put(6, 100); + sBoolPressLow.put(7, 100); + sBoolPressLow.put(8, 105); + // + sBoolPressHigh.put(9, 140); + sBoolPressHigh.put(10, 133); + sBoolPressHigh.put(11, 133); + sBoolPressHigh.put(12, 133); + sBoolPressHigh.put(13, 133); + sBoolPressHigh.put(14, 133); + sBoolPressHigh.put(15, 140); + sBoolPressHigh.put(16, 145); + sBoolPressHigh.put(17, 142); + sBoolPressHigh.put(18, 132); + sBoolPressHigh.put(19, 125); + sBoolPressHigh.put(20, 120); + sBoolPressHigh.put(21, 118); + sBoolPressHigh.put(22, 120); + sBoolPressHigh.put(23, 115); + sBoolPressHigh.put(24, 105); + sBoolPressHigh.put(1, 103); + sBoolPressHigh.put(2, 115); + sBoolPressHigh.put(3, 125); + sBoolPressHigh.put(4, 133); + sBoolPressHigh.put(5, 140); + sBoolPressHigh.put(6, 150); + sBoolPressHigh.put(7, 150); + sBoolPressHigh.put(8, 150); + } + private void handleResultOtherBlood() { if (mListener != null) { + //对血压数据进行转换,映射表参考陈总给的一个血压与时间关系的曲线图 + Random random = new Random(); + int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); + Integer highValue = sBoolPressHigh.get(hour); + if (highValue != null) { + ndkHigh = highValue + random.nextInt(8); + ICLogger.d("random ndkHigh ==> " + ndkHigh); + } + Integer lowValue = sBoolPressLow.get(hour); + if (lowValue != null) { + ndkLow = lowValue + random.nextInt(5); + ICLogger.d("random ndkLow ==> " + ndkLow); + } mListener.onHeartRateResult(ndkHigh, ndkLow, ndkHeart, oxygen); } if (mListener != null) {