|
@@ -38,6 +38,7 @@ import com.wdkl.ncs.android.middleware.tcp.channel.*
|
|
|
import com.wdkl.ncs.android.middleware.tcp.dto.TcpCallback
|
|
|
import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
|
|
|
import com.wdkl.ncs.android.middleware.tcp.enums.DeviceTypeEnum
|
|
|
+import com.wdkl.ncs.android.middleware.tcp.enums.FrameTypeEnum
|
|
|
import com.wdkl.ncs.android.middleware.tcp.enums.TcpAction
|
|
|
import com.wdkl.ncs.android.middleware.tcp.enums.TcpType
|
|
|
import com.wdkl.ncs.android.middleware.utils.MessageEvent
|
|
@@ -424,95 +425,114 @@ class IncidentWindow(var activity: Activity) {
|
|
|
binding.handleImagev.setBackgroundResource(R.drawable.sp_event_unhandled_bg)
|
|
|
|
|
|
//如果分机绑定了紧急按钮则加上紧急按钮名称
|
|
|
- if (interactionVO.fromDeviceType == DeviceTypeEnum.EMERGENCY_BUTTON.value()
|
|
|
- || interactionVO.fromDeviceType == DeviceTypeEnum.SIMULATE_EMERGENCY_BUTTON.value()
|
|
|
- ) {
|
|
|
+ if (interactionVO.fromDeviceType == DeviceTypeEnum.EMERGENCY_BUTTON.value()) {
|
|
|
room = interactionVO.fromDeviceName
|
|
|
- }
|
|
|
-
|
|
|
- //紧急呼叫显示data中数据
|
|
|
- if (SettingConfig.getSosCallNameOn(BaseApplication.appContext)) {
|
|
|
val text = BaseApplication.appContext.getString(R.string.sos_call_speech, room)
|
|
|
binding.incidentTv.text = text
|
|
|
- } else if (interactionVO.data != null) {
|
|
|
- binding.incidentTv.text = interactionVO.data
|
|
|
+ } else if (interactionVO.fromDeviceType == DeviceTypeEnum.SIMULATE_EMERGENCY_BUTTON.value()
|
|
|
+ && interactionVO.fromFrameType == FrameTypeEnum.BED.value()) {
|
|
|
+ val text = BaseApplication.appContext.getString(R.string.sos_call_speech, room)
|
|
|
+ binding.incidentTv.text = text
|
|
|
} else {
|
|
|
- if (tcpModel.action == TcpAction.SOSAction.CALL || tcpModel.action == TcpAction.SOSAction.ROOM_CALL) {
|
|
|
- val text = BaseApplication.appContext.getString(
|
|
|
- R.string.sos_call_speech,
|
|
|
- room
|
|
|
- )
|
|
|
- binding.incidentTv.text = text
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_TEST) {
|
|
|
- //测试报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_TEST.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_INTRUSION) {
|
|
|
- //入侵报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_INTRUSION.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_ON_EIGHT_HOURS) {
|
|
|
- //8小时无人报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_ON_EIGHT_HOURS.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_ON_TWELVE_HOURS) {
|
|
|
- //12小时报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_ON_TWELVE_HOURS.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_ON_TWENTY_FOUR_HOURS) {
|
|
|
- //24小时无人报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_ON_TWENTY_FOUR_HOURS.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_INFRARED_NO_TRIGGER) {
|
|
|
- //无人报警
|
|
|
- var str = ""
|
|
|
- if (interactionVO.data != null) {
|
|
|
- str = interactionVO.data as String
|
|
|
- }
|
|
|
- binding.incidentTv.text = str + BaseApplication.appContext.getString(R.string.none_warning)
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_FALL_RADAR) {
|
|
|
- //雷达跌倒报警
|
|
|
- binding.incidentTv.text = room + StringUtil.getResString(R.string.str_fall_alarm)
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_INFUSION_RADAR) {
|
|
|
- //输液报警
|
|
|
- if (interactionVO.data != null) {
|
|
|
- val str = interactionVO.data as String
|
|
|
- binding.incidentTv.text = str
|
|
|
+ //紧急呼叫显示data中数据
|
|
|
+ if (interactionVO.data != null) {
|
|
|
+ binding.incidentTv.text = interactionVO.data
|
|
|
+ } else {
|
|
|
+ if (tcpModel.action == TcpAction.SOSAction.CALL || tcpModel.action == TcpAction.SOSAction.ROOM_CALL) {
|
|
|
+ val text = BaseApplication.appContext.getString(
|
|
|
+ R.string.sos_call_speech,
|
|
|
+ room
|
|
|
+ )
|
|
|
+ binding.incidentTv.text = text
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_TEST) {
|
|
|
+ //测试报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_TEST.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_INTRUSION) {
|
|
|
+ //入侵报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_INTRUSION.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_ON_EIGHT_HOURS) {
|
|
|
+ //8小时无人报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_ON_EIGHT_HOURS.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_ON_TWELVE_HOURS) {
|
|
|
+ //12小时报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_ON_TWELVE_HOURS.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_ON_TWENTY_FOUR_HOURS) {
|
|
|
+ //24小时无人报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_ON_TWENTY_FOUR_HOURS.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_INFRARED_NO_TRIGGER) {
|
|
|
+ //无人报警
|
|
|
+ var str = ""
|
|
|
+ if (interactionVO.data != null) {
|
|
|
+ str = interactionVO.data as String
|
|
|
+ }
|
|
|
+ binding.incidentTv.text =
|
|
|
+ str + BaseApplication.appContext.getString(R.string.none_warning)
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_FALL_RADAR) {
|
|
|
+ //雷达跌倒报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ room + StringUtil.getResString(R.string.str_fall_alarm)
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_INFUSION_RADAR) {
|
|
|
+ //输液报警
|
|
|
+ if (interactionVO.data != null) {
|
|
|
+ val str = interactionVO.data as String
|
|
|
+ binding.incidentTv.text = str
|
|
|
+ }
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_DISASSEMBLE) {
|
|
|
+ //防拆报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_DISASSEMBLE.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_FAULT) {
|
|
|
+ //故障报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_FAULT.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_DOOR_LOCK) {
|
|
|
+ //门磁报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_DOOR_LOCK.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_RESTRAINT_BAND) {
|
|
|
+ //约束带报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_RESTRAINT_BAND.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_SMOKE) {
|
|
|
+ //烟感报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_SMOKE.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_GAS) {
|
|
|
+ //燃气报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_GAS.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_WATER_OVERFLOW) {
|
|
|
+ //浸水报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_WATER_OVERFLOW.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_LOW_VOLTAGE) {
|
|
|
+ //低电压报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_LOW_VOLTAGE.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_TEMPERATURE) {
|
|
|
+ //温度报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_TEMPERATURE.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_FALL) {
|
|
|
+ //跌倒报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_FALL.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.ALARM_VITAL) {
|
|
|
+ //体征报警
|
|
|
+ binding.incidentTv.text =
|
|
|
+ TcpAction.SOSAction.ALARM_VITAL.description
|
|
|
+ } else if (tcpModel.action == TcpAction.SOSAction.AlARM_BUTTON) {
|
|
|
+ //腕表紧急按钮
|
|
|
+ binding.incidentTv.text = BaseApplication.appContext.getString(
|
|
|
+ R.string.sos_call_speech,
|
|
|
+ interactionVO.fromMemberName
|
|
|
+ )
|
|
|
}
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_DISASSEMBLE) {
|
|
|
- //防拆报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_DISASSEMBLE.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_FAULT) {
|
|
|
- //故障报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_FAULT.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_DOOR_LOCK) {
|
|
|
- //门磁报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_DOOR_LOCK.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_RESTRAINT_BAND) {
|
|
|
- //约束带报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_RESTRAINT_BAND.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_SMOKE) {
|
|
|
- //烟感报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_SMOKE.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_GAS) {
|
|
|
- //燃气报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_GAS.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_WATER_OVERFLOW) {
|
|
|
- //浸水报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_WATER_OVERFLOW.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_LOW_VOLTAGE) {
|
|
|
- //低电压报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_LOW_VOLTAGE.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_TEMPERATURE) {
|
|
|
- //温度报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_TEMPERATURE.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_FALL) {
|
|
|
- //跌倒报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_FALL.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.ALARM_VITAL) {
|
|
|
- //体征报警
|
|
|
- binding.incidentTv.text = TcpAction.SOSAction.ALARM_VITAL.description
|
|
|
- } else if (tcpModel.action == TcpAction.SOSAction.AlARM_BUTTON) {
|
|
|
- //腕表紧急按钮
|
|
|
- binding.incidentTv.text = BaseApplication.appContext.getString(
|
|
|
- R.string.sos_call_speech,
|
|
|
- interactionVO.fromMemberName
|
|
|
- )
|
|
|
}
|
|
|
}
|
|
|
}
|