completed temperature limit.
authorTrillGates <williamtrillgates@gmail.com>
Sat, 17 Jul 2021 07:36:26 +0000 (15:36 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Sat, 17 Jul 2021 07:36:26 +0000 (15:36 +0800)
app/src/main/java/com/enqualcomm/support/Config.java
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java
app/src/main/java/com/ic/protocols/protocol_s123.java

index 3d7e835..f2c6ca0 100644 (file)
@@ -105,6 +105,8 @@ public class Config {
     public static int LIMIT_VALUE_BPL_H = 0;
     public static int LIMIT_VALUE_BPL_L = 0;
     public static int LIMIT_VALUE_OXYGEN = 0;
+    public static int LIMIT_VALUE_TEMPERATURE_TOP = 0;
+    public static int LIMIT_VALUE_TEMPERATURE_BOTTOM = 0;
     //add by TrillGates=================end
 
 
index ba62c20..3aaee43 100644 (file)
@@ -976,6 +976,18 @@ public class CoreService extends Service {
         if (!TextUtils.isEmpty(bloodOxygenLimitValue)) {
             Config.LIMIT_VALUE_OXYGEN = Integer.parseInt(bloodOxygenLimitValue);
         }
+        //体温的
+        String bodyTemperatureTopValue = getICSettingsValue("body_temperature_top_value");
+        ICLogger.d("bodyTemperatureTopValue == > " + bodyTemperatureTopValue);
+        if (!TextUtils.isEmpty(bodyTemperatureTopValue)) {
+            Config.LIMIT_VALUE_TEMPERATURE_TOP = Integer.parseInt(bodyTemperatureTopValue);
+        }
+        String bodTemperatureBottomValue =
+                getICSettingsValue("body_temperature_bottom_value");
+        ICLogger.d("body_temperature_bottom_value == > " + bodTemperatureBottomValue);
+        if (!TextUtils.isEmpty(bodTemperatureBottomValue)) {
+            Config.LIMIT_VALUE_TEMPERATURE_BOTTOM = Integer.parseInt(bodTemperatureBottomValue);
+        }
     }
 
     private String getICSettingsValue(String key) {
@@ -1003,11 +1015,8 @@ public class CoreService extends Service {
 
     //检查是否有未读消息需要提醒
     private void checkUnreadMessage() {
-
         String msg = Config.getLastUnReadMessage(this);
         Util.checkMesageNeedNotifi(msg, runtime);
-
-
     }
 
     //内部广播StringMessage
index 6234633..90d0f5c 100644 (file)
@@ -188,10 +188,6 @@ public class HeartRateManager extends AbstractInvokeHandlerService {
     };
 
     private void checkHeartRateValue(HeartRate heartRate) {
-
-
-
-
         int oxygenValue = heartRate.getOxygen();
         int heartRateValue = heartRate.getHeartRate();
         int bloodHeightValue = heartRate.getBloodHeight();
index 7cb497d..7b269e2 100644 (file)
@@ -54,6 +54,8 @@ import static com.enqualcomm.support.Constants.FROM_SERVER;
 import static com.enqualcomm.support.LocationClient.LOCATION_MODE;
 import static com.enqualcomm.support.bean.Contact.GROUP_ALL;
 import static java.lang.Math.abs;
+import static java.lang.Math.max;
+import static java.lang.Math.min;
 
 /**
  * IC协议
@@ -2255,9 +2257,15 @@ public class protocol_s123 {
                 String max_temp = list[5];
                 connection.send(APDG(index));
                 if (Integer.parseInt(switch_on) == 1) {
-                    ICLogger.i("Handle BPDG index " + index + ", 体温报警阈值开 min=" + min_temp + ",max=" + max_temp);
+                    ICLogger.i("Handle BPDG index " + index + ", 体温报警阈值开 min="
+                            + min_temp + ",max=" + max_temp);
                     runtime.tempInfo.setBodyTempThreshold(Double.valueOf(max_temp), Double.valueOf(min_temp));
                     Config.needTemperature_abnormal_alarm = true;
+                    //阀值入库
+                    updateIcSettingsValue("body_temperature_bottom_value", min_temp);
+                    updateIcSettingsValue("body_temperature_top_value", max_temp);
+                    Config.LIMIT_VALUE_TEMPERATURE_TOP = Integer.parseInt(max_temp);
+                    Config.LIMIT_VALUE_TEMPERATURE_BOTTOM = Integer.parseInt(min_temp);
                 } else {
                     ICLogger.i("Handle BPDG index " + index + ", 体温报警阈值关 ");
                     Config.needTemperature_abnormal_alarm = false;