|
@@ -1,5 +1,8 @@
|
|
|
package com.wdkl.ncs.android.component.nursehome.util;
|
|
|
|
|
|
+import android.util.Log;
|
|
|
+
|
|
|
+import com.google.common.base.Strings;
|
|
|
import com.wdkl.ncs.android.component.nursehome.R;
|
|
|
import com.wdkl.ncs.android.component.nursehome.settingconfig.SettingConfig;
|
|
|
import com.wdkl.ncs.android.lib.base.BaseApplication;
|
|
@@ -15,6 +18,7 @@ public class LedHelper {
|
|
|
public static void updateLedInfo(InteractionVO interactionVO, boolean isAdd, boolean emergency) {
|
|
|
//没有点阵屏设备,直接返回
|
|
|
if (!Constants.Companion.getLED_EXIST()) {
|
|
|
+ Log.e("led", "no led device.");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -31,6 +35,7 @@ public class LedHelper {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ Log.d("led", "update led info, deviceType: " + interactionVO.getFromDeviceType() + ", frameName: " + interactionVO.getFromFrameFullName() + ", data: " + interactionVO.getData());
|
|
|
if (interactionVO.getFromDeviceType() == DeviceTypeEnum.DIGIT_BED_DEVICE.value()
|
|
|
|| interactionVO.getFromDeviceType() == DeviceTypeEnum.SIMULATE_BED_DEVICE.value()) {
|
|
|
//如果交互记录中的fromdevice是分机,有可能是数字分机发送过来的紧急呼叫,需要特别处理
|
|
@@ -56,20 +61,45 @@ public class LedHelper {
|
|
|
}
|
|
|
}
|
|
|
} else if (interactionVO.getFromDeviceType() == DeviceTypeEnum.EMERGENCY_BUTTON.value()
|
|
|
- || interactionVO.getFromDeviceType() == DeviceTypeEnum.SIMULATE_EMERGENCY_BUTTON.value()
|
|
|
- || interactionVO.getFromDeviceType() == DeviceTypeEnum.ALARM_BUTTON_SOS.value()) {
|
|
|
+ || interactionVO.getFromDeviceType() == DeviceTypeEnum.SIMULATE_EMERGENCY_BUTTON.value()) {
|
|
|
//紧急呼叫
|
|
|
String frameName = CommonUtils.subStringBefore(interactionVO.getFromFrameFullName(), "-");
|
|
|
if (SettingConfig.getSosCallNameOn(BaseApplication.appContext)) {
|
|
|
frameName = interactionVO.getFromDeviceName();
|
|
|
}
|
|
|
- String sosCall = BaseApplication.appContext.getString(R.string.led_show_emergency_call, frameName);
|
|
|
+
|
|
|
+ if (Strings.isNullOrEmpty(interactionVO.getData())) {
|
|
|
+ if (isAdd) {
|
|
|
+ //新增led节目
|
|
|
+ LedManagerUtils.getInstance().updateProgram(interactionVO.getData(), 1);
|
|
|
+ } else {
|
|
|
+ //删除led节目
|
|
|
+ LedManagerUtils.getInstance().updateProgram(interactionVO.getData(), 2);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (isAdd) {
|
|
|
+ //新增led节目
|
|
|
+ LedManagerUtils.getInstance().updateProgram(BaseApplication.appContext.getString(R.string.led_show_emergency_call, frameName), 1);
|
|
|
+ } else {
|
|
|
+ //删除led节目
|
|
|
+ LedManagerUtils.getInstance().updateProgram(BaseApplication.appContext.getString(R.string.led_show_emergency_call, frameName), 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (interactionVO.getFromDeviceType() == DeviceTypeEnum.ALARM_BUTTON_SOS.value()
|
|
|
+ || interactionVO.getFromDeviceType() == DeviceTypeEnum.ALARM_433BUTTON.value()) {
|
|
|
+ String frameName = CommonUtils.subStringBefore(interactionVO.getFromFrameFullName(), "-");
|
|
|
+ if (Strings.isNullOrEmpty(interactionVO.getData())) {
|
|
|
+ frameName = BaseApplication.appContext.getString(R.string.led_show_emergency_call, frameName);
|
|
|
+ } else {
|
|
|
+ frameName = interactionVO.getData();
|
|
|
+ }
|
|
|
+
|
|
|
if (isAdd) {
|
|
|
//新增led节目
|
|
|
- LedManagerUtils.getInstance().updateProgram(sosCall, 1);
|
|
|
+ LedManagerUtils.getInstance().updateProgram(frameName, 1);
|
|
|
} else {
|
|
|
//删除led节目
|
|
|
- LedManagerUtils.getInstance().updateProgram(sosCall, 2);
|
|
|
+ LedManagerUtils.getInstance().updateProgram(frameName, 2);
|
|
|
}
|
|
|
}
|
|
|
}
|