From: TrillGates Date: Sat, 17 Jul 2021 07:36:26 +0000 (+0800) Subject: completed temperature limit. X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=af8ee5e49aeee94aae7228e4f646fe20d6500f0c;p=protocol_srv.git completed temperature limit. --- diff --git a/app/src/main/java/com/enqualcomm/support/Config.java b/app/src/main/java/com/enqualcomm/support/Config.java index 3d7e835b..f2c6ca01 100644 --- a/app/src/main/java/com/enqualcomm/support/Config.java +++ b/app/src/main/java/com/enqualcomm/support/Config.java @@ -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 diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index ba62c20d..3aaee439 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -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 diff --git a/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java b/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java index 62346331..90d0f5ce 100644 --- a/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java +++ b/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java @@ -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(); diff --git a/app/src/main/java/com/ic/protocols/protocol_s123.java b/app/src/main/java/com/ic/protocols/protocol_s123.java index 7cb497de..7b269e25 100644 --- a/app/src/main/java/com/ic/protocols/protocol_s123.java +++ b/app/src/main/java/com/ic/protocols/protocol_s123.java @@ -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;