From: kfl_614 Date: Thu, 17 Dec 2020 08:47:46 +0000 (+0800) Subject: update algorithm of handle temperature. X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=4cb287a57db17ab1d810ba2ff21e31eec9625b40;p=icworkservice.git update algorithm of handle temperature. --- diff --git a/app/src/main/java/com/ic/work/utils/TemperatureUtil.java b/app/src/main/java/com/ic/work/utils/TemperatureUtil.java index 7f8fa80..0491261 100644 --- a/app/src/main/java/com/ic/work/utils/TemperatureUtil.java +++ b/app/src/main/java/com/ic/work/utils/TemperatureUtil.java @@ -34,9 +34,11 @@ public class TemperatureUtil { } } + public static double getBodyTemp(double wristtemp, double envtemp) { - return ICJniUtils.getBodyTempFromWristTemp(wristtemp, envtemp); + return ICJniUtils.getBodyTempFromWristTemp(wristtemp, envtemp); } + public static void disableTemp() { if (ICJniUtils.isTemperatureDevAvailable() > ICJniUtils.TempSensorType.TEMPSENSOR_TYPE_NONE.ordinal()) { ICJniUtils.disableTemperature(); @@ -139,10 +141,16 @@ public class TemperatureUtil { String envDy = IcSystemProperty.getSystemProperties("persist.sys.envAlgDy", ""); IcLog.d(TAG, "envSlope == > " + envSlope + " envDy == > " + envDy); double resultEnvTemp = evnTemp; - if (!TextUtils.isEmpty(envDy) && !TextUtils.isEmpty(envSlope)) { + if (!TextUtils.isEmpty(envDy) && !TextUtils.isEmpty(envSlope) && boardTemp > 38) { //进行换算 IcLog.d(TAG, "env temp with board temp..."); resultEnvTemp = evnTemp - (Float.parseFloat(envSlope) * boardTemp + Float.parseFloat(envDy)); + } else if (boardTemp <= 38 && boardTemp >= 32) { + IcLog.d(TAG, "in range of 32 to 38"); + //Ut = St-(Bt*0.869-27.167) Bt∈[32,38) + resultEnvTemp = evnTemp - (0.869 * boardTemp - 27.167); + } else { + //TODO:主板温度低于32度的,如果测试有这样的case,再采集数据 } String bodySlope = IcSystemProperty.getSystemProperties("persist.sys.bodyAlgSlope", ""); @@ -153,7 +161,6 @@ public class TemperatureUtil { IcLog.d(TAG, "body temp with board temp..."); resultBodyTemp = bodyTemp - (Float.parseFloat(bodySlope) * boardTemp + Float.parseFloat(bodyDy)); } - //=======================================================================end IcLog.d(TAG, "evnTemp == > " + evnTemp + " resultEnvTemp = > " + resultEnvTemp); IcLog.d(TAG, "bodyTemp == > " + bodyTemp + " resultBodyTemp = > " + resultBodyTemp);