-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.1","enabled":true,"outputFile":"IcL02WorkService_V57_202102011623_release.apk","fullName":"IcL02WorkServiceRelease","baseName":"IcL02WorkService-release"},"path":"IcL02WorkService_V57_202102011623_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.1","enabled":true,"outputFile":"IcL02WorkService_V57_202104151129_release.apk","fullName":"IcL02WorkServiceRelease","baseName":"IcL02WorkService-release"},"path":"IcL02WorkService_V57_202104151129_release.apk","properties":{}}]
\ No newline at end of file
private IPedRemoteService.Stub pedBinder = new IPedRemoteService.Stub() {
@Override
- public void registerCallback(IPedAidlInterface cb) throws RemoteException {
+ public void registerCallback(IPedAidlInterface cb) {
if (cb != null) {
mCallbacks.register(cb);
}
}
@Override
- public void unregisterCallback(IPedAidlInterface cb) throws RemoteException {
+ public void unregisterCallback(IPedAidlInterface cb) {
if (cb != null) {
mCallbacks.unregister(cb);
}
}
@Override
- public void queryPedCount() throws RemoteException {
+ public void queryPedCount() {
EventBus.getDefault().post(new ThreadPoolEvent(TEST_STEP));
}
@Override
- public void queryPedRecord() throws RemoteException {
+ public void queryPedRecord() {
EventBus.getDefault().post(new ThreadPoolEvent(STEP_RECORD));
}
@Override
- public void syncPedHeightSetting(int height) throws RemoteException {
+ public void syncPedHeightSetting(int height) {
EventBus.getDefault().post(new PedSettingEvent(1, height));
}
@Override
- public void syncPedWeightSetting(int weight) throws RemoteException {
+ public void syncPedWeightSetting(int weight) {
EventBus.getDefault().post(new PedSettingEvent(2, weight));
}
};
--- /dev/null
+package com.ic.work.utils;
+
+import android.text.TextUtils;
+
+public class AlgorithmUtils {
+
+ private static final String TAG = "AlgorithmUtils";
+
+ public static double l004Pt(double bodyTemp, double innerTemp) {
+ //判断范围
+ if (innerTemp < 36.18f) {
+ return bodyTemp;
+ }
+ double dx = 0f;
+ //36.18~38.64:result = 0.0472*sourceTemp-0.1094
+ if (innerTemp >= 36.18f && innerTemp < 38.64f) {
+ //dx = (0.0472f * innerTemp - 0.1094f);
+ dx = (0.02587991718f * innerTemp);
+ } else
+ //38.64~43.46:result = 0.0178*result+1.3565
+ if (innerTemp >= 38.64f && innerTemp < 43.46f) {
+ //dx = (0.0178f * innerTemp + 1.3565f);
+ dx = (0.083605614358f * innerTemp + 1.3565f);
+ } else
+ //43.46~45.55: result = 0.0026*sourceTemp+5.1097
+ if (innerTemp >= 43.46f && innerTemp < 45.55f) {
+ //dx = (0.0026f * innerTemp + 5.1097f);
+ dx = (0.01830618f * innerTemp + 5.1097f);
+ } else
+ //45.55~48.04: result = 0.001*sourceTemp+6.6122
+ if (innerTemp >= 45.55f) {
+ //dx = (0.001f * innerTemp + 6.6172f);
+ dx = (0.0264945878f * innerTemp + 6.6172f);
+ }
+ ICLogger.d("bodyTemp == > " + bodyTemp);
+ ICLogger.d("innerTemp == > " + innerTemp);
+ ICLogger.d("dx == > " + dx);
+ double result = bodyTemp - dx;
+ ICLogger.d("result == > " + result);
+ return result;
+ }
+
+
+ //对数据进行处理=======================================================start
+ // 环境温度计算公式:
+ // Ut=St-(0.6205x-22.049),St为传感器温度,其中x主板温度,x∈[38,56]
+ // 体温计算公式:
+ // Ut = St-(Bt*0.4533-15.294) St为传感器温度,Bt为板子温度 Bt∈[38,56]
+ // 系数不要抽成常量,以后如果有更好的公式可以替换。
+ // 以上公式通过数据分析出来的,此公式仅适用于S123的产品,公式跟产品结构有关系
+ //TODO:以上重要,所以同时对外可支持配置,如果没有配置不进行数据处理,直接返回原数值
+ //TODO:配置格式:
+ // PRODUCT_PROPERTY_OVERRIDES += persist.sys.envTempAlgSlope=系数(斜率)
+ // PRODUCT_PROPERTY_OVERRIDES += persist.sys.envTempAlgDy=Y轴偏移值
+ //========================================================================//
+ public static double s123GetEnvData(double evnTemp, double boardTemp) {
+
+ String envDy = IcSystemProperty.getSystemProperties("persist.sys.envAlgDy", "");
+ if (TextUtils.isEmpty(envDy)) {
+ envDy = "-22.049";
+ }
+ //环境温度的斜率和Y轴偏移值
+ String envSlope = IcSystemProperty.getSystemProperties("persist.sys.envAlgSlope", "");
+ if (TextUtils.isEmpty(envSlope)) {
+ envSlope = "0.6205";
+ }
+
+ IcLog.d(TAG, "envSlope == > " + envSlope + " envDy == > " + envDy);
+ //这个值是不可能的,所以有这个-100表示数据出错
+ double resultEnvTemp = -100;
+ if (!TextUtils.isEmpty(envDy) && !TextUtils.isEmpty(envSlope) && boardTemp > 39) {
+ //进行换算
+ IcLog.d(TAG, "env temp with board temp...");
+ resultEnvTemp = evnTemp - (Float.parseFloat(envSlope) * boardTemp + Float.parseFloat(envDy));
+ // resultEnvTemp = evnTemp - (0.8492 * boardTemp - 25.204);
+ } else if (boardTemp <= 39 && boardTemp >= 27) {
+ IcLog.d(TAG, "in range of 27 to 39");
+ //Ut = St-(Bt*0.869-27.167) Bt∈[32,38)
+ resultEnvTemp = evnTemp - (0.2441 * boardTemp - 2.3248);
+ }
+ return resultEnvTemp;
+ }
+
+ public static double s123GetBodyTemp(double bodyTemp, double boardTemp) {
+
+ String bodySlope = IcSystemProperty.getSystemProperties("persist.sys.bodyAlgSlope", "");
+ if (TextUtils.isEmpty(bodySlope)) {
+ bodySlope = "0.4533";
+ }
+ String bodyDy = IcSystemProperty.getSystemProperties("persist.sys.bodyAlgDy", "");
+ if (TextUtils.isEmpty(bodyDy)) {
+ bodyDy = "-15.294";
+ }
+
+ IcLog.d(TAG, "bodySlope == > " + bodySlope + " bodyDy == > " + bodyDy);
+ double resultBodyTemp = bodyTemp;
+ if (!TextUtils.isEmpty(bodyDy) && !TextUtils.isEmpty(bodySlope)) {
+ IcLog.d(TAG, "body temp with board temp...");
+ resultBodyTemp = bodyTemp - (Float.parseFloat(bodySlope) * boardTemp + Float.parseFloat(bodyDy));
+ }
+ return resultBodyTemp;
+ }
+
+
+}
interface ServiceType {
String ACTION_WEATHER = "com.ic.weather";
String ACTION_BLOOD = "com.ic.blood";
- String ACTION_HARD_WARE = "com.ic.hardware";
+ String ACTION_HARD_WARE = "com.ic.sport";
String ACTION_IC_TEMP = "com.ic.temp";
String ACTION_IC_AK = "com.ic.ak";
}
package com.ic.work.utils;
-import android.text.TextUtils;
import android.util.Log;
import com.ic.jni.ICJniUtils;
//数据处理一下
cpuTemp = Integer.parseInt(cpuTempStr) / 1000.0f;
gpuTemp = Integer.parseInt(gpuTempStr) / 1000.0f;
- // try {
- // chargeTemp = Integer.parseInt(chargeTempStr) / 1000.0f;
- // } catch (Exception e) {
- // chargeTemp = 0.0f;
- // }
- // try {
- // paTemp = Integer.parseInt(paTempStr) / 1000.0f;
- // } catch (Exception e) {
- // paTemp = 0.0f;
- // }
boardTemp = Integer.parseInt(boardTempStr) / 1000.0f;
} catch (Exception e) {
//no crash is okay.
}
evnTemp = get_tempOut_value_origin();
bodyTemp = get_temp_value_adjusted();
- //对数据进行处理=======================================================start
- // 环境温度计算公式:
- // Ut=St-(0.6205x-22.049),St为传感器温度,其中x主板温度,x∈[38,56]
- // 体温计算公式:
- // Ut = St-(Bt*0.4533-15.294) St为传感器温度,Bt为板子温度 Bt∈[38,56]
- // 系数不要抽成常量,以后如果有更好的公式可以替换。
- // 以上公式通过数据分析出来的,此公式仅适用于S123的产品,公式跟产品结构有关系
- //TODO:以上重要,所以同时对外可支持配置,如果没有配置不进行数据处理,直接返回原数值
- //TODO:配置格式:
- // PRODUCT_PROPERTY_OVERRIDES += persist.sys.envTempAlgSlope=系数(斜率)
- // PRODUCT_PROPERTY_OVERRIDES += persist.sys.envTempAlgDy=Y轴偏移值
- //========================================================================//
- //环境温度的斜率和Y轴偏移值
- String envSlope = IcSystemProperty.getSystemProperties("persist.sys.envAlgSlope", "");
- if (TextUtils.isEmpty(envSlope)) {
- envSlope = "0.6205";
- }
- String envDy = IcSystemProperty.getSystemProperties("persist.sys.envAlgDy", "");
- if (TextUtils.isEmpty(envDy)) {
- envDy = "-22.049";
- }
- IcLog.d(TAG, "envSlope == > " + envSlope + " envDy == > " + envDy);
- double resultEnvTemp = evnTemp;
- if (!TextUtils.isEmpty(envDy) && !TextUtils.isEmpty(envSlope) && boardTemp > 39) {
- //进行换算
- IcLog.d(TAG, "env temp with board temp...");
- resultEnvTemp = evnTemp - (Float.parseFloat(envSlope) * boardTemp + Float.parseFloat(envDy));
- // resultEnvTemp = evnTemp - (0.8492 * boardTemp - 25.204);
- } else if (boardTemp <= 39 && boardTemp >= 27) {
- IcLog.d(TAG, "in range of 27 to 39");
- //Ut = St-(Bt*0.869-27.167) Bt∈[32,38)
- resultEnvTemp = evnTemp - (0.2441 * boardTemp - 2.3248);
- } else {
- //TODO:主板温度低于27度的,如果测试有这样的case,再采集数据
- }
- String bodySlope = IcSystemProperty.getSystemProperties("persist.sys.bodyAlgSlope", "");
- if (TextUtils.isEmpty(bodySlope)) {
- bodySlope = "0.4533";
- }
- String bodyDy = IcSystemProperty.getSystemProperties("persist.sys.bodyAlgDy", "");
- if (TextUtils.isEmpty(bodyDy)) {
- bodyDy = "-15.294";
- }
- IcLog.d(TAG, "bodySlope == > " + bodySlope + " bodyDy == > " + bodyDy);
- double resultBodyTemp = bodyTemp;
- if (!TextUtils.isEmpty(bodyDy) && !TextUtils.isEmpty(bodySlope)) {
- IcLog.d(TAG, "body temp with board temp...");
- resultBodyTemp = bodyTemp - (Float.parseFloat(bodySlope) * boardTemp + Float.parseFloat(bodyDy));
+ String property = Utils.getSystemProperties("persist.sys.id_num", null);
+ double resultEnvTemp = -100;
+ double resultBodyTemp = 0;
+ if ("l004pt".equals(property)) {
+ double bodyTempResult = AlgorithmUtils.l004Pt(bodyTemp, evnTemp);
+ if (bodyTempResult != -1) {
+ //越接近34.1越准确
+ ICLogger.d("bodyTempResult == > " + bodyTempResult);
+ resultBodyTemp = getBodyTemp(bodyTempResult, 26.1f);
+ ICLogger.d("final body temp == > " + resultBodyTemp);
+ }
+ } else if ("q3ft".equals(property)) {
+ resultEnvTemp = AlgorithmUtils.s123GetEnvData(evnTemp, boardTemp);
+ resultBodyTemp = AlgorithmUtils.s123GetBodyTemp(bodyTemp, boardTemp);
+
+ IcLog.d(TAG, "evnTemp == > " + evnTemp + " resultEnvTemp = > " + resultEnvTemp);
+ IcLog.d(TAG, "bodyTemp == > " + bodyTemp + " resultBodyTemp = > " + resultBodyTemp);
}
- //=======================================================================end
- IcLog.d(TAG, "evnTemp == > " + evnTemp + " resultEnvTemp = > " + resultEnvTemp);
- IcLog.d(TAG, "bodyTemp == > " + bodyTemp + " resultBodyTemp = > " + resultBodyTemp);
- if (resultBodyTemp < 0) {
+
+ if (resultBodyTemp <= 0) {
return null;
}
try {
--- /dev/null
+package com.ic.work.utils;
+
+import java.lang.reflect.Method;
+
+public class Utils {
+
+ public static String getSystemProperties(String prop, String defaultValue) {
+
+ String str = defaultValue;
+ Class clazz = null;
+ try {
+ clazz = Class.forName("android.os.SystemProperties");
+ Method get = clazz.getMethod("get", new Class[]{String.class});
+ str = (String) get.invoke(clazz, new Object[]{prop});
+ if (str == null || (str != null && str.trim().isEmpty())) {
+ str = defaultValue;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ ICLogger.e(e.getMessage(), e);
+ }
+ return str;
+ }
+
+}