private static double tempOut_value = 0.0f;
public static double get_tempOut_value_origin() {
+ long tmp=System.currentTimeMillis();
tempOut_value = ICJniUtils.getTemperatureOrigin();
+ long tmp1=System.currentTimeMillis()-tmp;
+ if (tmp1>1000)
+ ICLogger.i("测量环境温度 原始值 " + tempOut_value+" 超过1秒 "+tmp1);
ICLogger.i( "测量环境温度 原始值 " + tempOut_value);
return tempOut_value;
}
public static double get_temp_value_adjusted() {
+ long tmp=System.currentTimeMillis();
temp_value_orig = ICJniUtils.getTemperature();
+ long tmp1=System.currentTimeMillis()-tmp;
+ if (tmp1>1000)
+ ICLogger.i("测量体温 原始值 " + temp_value_orig+" 超过1秒 "+tmp1);
ICLogger.i("测量体温 原始值 " + temp_value_orig);
return temp_value_orig;
}
private static double tempOut_value = 0.0f;
public static double get_tempOut_value_origin() {
+ long tmp=System.currentTimeMillis();
tempOut_value = ICJniUtils.getTemperatureOrigin();
- ICLogger.i("测量环境温度 原始值 " + tempOut_value);
+ long tmp1=System.currentTimeMillis()-tmp;
+ if (tmp1>1000)
+ ICLogger.i("1测量环境温度 原始值 " + tempOut_value+" 超过1秒 "+tmp1);
+ ICLogger.i( "1测量环境温度 原始值 " + tempOut_value);
return tempOut_value;
}
public static double get_temp_value_adjusted() {
+ long tmp=System.currentTimeMillis();
temp_value_orig = ICJniUtils.getTemperature();
- ICLogger.i("测量体温 原始值 " + temp_value_orig);
+ long tmp1=System.currentTimeMillis()-tmp;
+ if (tmp1>1000)
+ ICLogger.i("1测量体温 原始值 " + temp_value_orig+" 超过1秒 "+tmp1);
+ ICLogger.i("1测量体温 原始值 " + temp_value_orig);
return temp_value_orig;
}
+
public static double getTempAdjustValue() {
// temp_adjust_value=ICJniUtils.getTemperatureAdjustValue();
public static void doTempTestInThread() {
- new Handler().postDelayed(new Runnable() {
+ ThreadPool.newInstance().submitThreadPool(new Runnable() {
@Override
public void run() {
-
DoTempTest();
}
- }, 500);
+ });
}
public static final String ACTION_TEMP_RESULT = "com.ic.action.temp_result";
double wrist_temp, body_temp, temout;
temout = 0.0f;
+ wrist_temp=0.0f;
+ body_temp=0.0f;
while (true) {
- wrist_temp = TemperatureUtil.get_temp_value_adjusted();
- if (wrist_temp < 10) {
- Util.mSleep(1000);
- ICLogger.i("retry read temp for <10");
- wrist_temp = TemperatureUtil.get_temp_value_adjusted();
- }
-
if (ICJniUtils.isTemperatureDevAvailable() == ICJniUtils.TempSensorType.TEMPSENSOR_TYPE_IC68.ordinal()) {
//此处温度会走一个算法,跟主板挂钩,不同的主板有不同的公式,需要做实验,配置。
//具体可以点击进去看里面的代码。
} else {
body_temp = TemperatureUtil.getBodyTemp(wrist_temp, 26.0f);
}
- } else {
- ICLogger.log(TAG, "temperatureItem is null...");
- if (Config.disableWristTemp) {
- body_temp = wrist_temp;
- } else {
- temout = TemperatureUtil.get_tempOut_value_origin();
- if (temout < 10) {
- Util.mSleep(1000);
- ICLogger.i("retry read tempOut for <10");
- temout = TemperatureUtil.get_tempOut_value_origin();
- }
- if (temout > 60 || temout < 10) {
- temout = 0.0f;
- }
- if (temout > 10) {
- body_temp = TemperatureUtil.getBodyTemp(wrist_temp, temout);
- } else {
- body_temp = TemperatureUtil.getBodyTemp(wrist_temp, 26.0f);
- }
- }
}
} else {
- body_temp = TemperatureUtil.getBodyTemp(wrist_temp, 26.0f);
+ wrist_temp = TemperatureUtil.get_temp_value_adjusted();
+ if (wrist_temp < 10) {
+ Util.mSleep(1000);
+ ICLogger.i("retry read temp for <10");
+ wrist_temp = TemperatureUtil.get_temp_value_adjusted();
+ }
+ ICLogger.log(TAG, "temperatureItem is null...");
+ if (Config.disableWristTemp) {
+ body_temp = wrist_temp;
+ } else {
+ body_temp = TemperatureUtil.getBodyTemp(wrist_temp, 26.0f);
+ }
}
try {
Thread.sleep(1000);