|
@@ -116,8 +116,11 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
private var initialized :Boolean = false
|
|
private var initialized :Boolean = false
|
|
private var loaded: Boolean = false
|
|
private var loaded: Boolean = false
|
|
|
|
|
|
|
|
+ private var sosItId: Int = -1
|
|
|
|
+ private var sosToId: Int = -1
|
|
private var nursingInteId: Int = -1
|
|
private var nursingInteId: Int = -1
|
|
private var blueCodeId: Int = -1
|
|
private var blueCodeId: Int = -1
|
|
|
|
+ private var blueCodeTid: String = ""
|
|
|
|
|
|
private var clickTime : Long = 0
|
|
private var clickTime : Long = 0
|
|
private var clickSosTime : Long = 0
|
|
private var clickSosTime : Long = 0
|
|
@@ -617,6 +620,18 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
OtherUtil.sendNursingEnd(Constant.DEVICE_ID, nursingInteId)
|
|
OtherUtil.sendNursingEnd(Constant.DEVICE_ID, nursingInteId)
|
|
nursingInteId = -1
|
|
nursingInteId = -1
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //退出护理时同时取消blue code
|
|
|
|
+ if (Constant.inBlueCode) {
|
|
|
|
+ Constant.inBlueCode = false
|
|
|
|
+ room_action_blue_code.isEnabled = false
|
|
|
|
+
|
|
|
|
+ SerialPortHelper.setDoorLight(0, "000")
|
|
|
|
+
|
|
|
|
+ if (Constant.DEVICE_ID != -1 && blueCodeId != -1) {
|
|
|
|
+ BlueCodeUtil.sendBlueCodeResponse(blueCodeTid, Constant.DEVICE_ID, blueCodeId)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
Constant.inNursing = true
|
|
Constant.inNursing = true
|
|
SettingConfig.setInNursing(activity, true)
|
|
SettingConfig.setInNursing(activity, true)
|
|
@@ -627,6 +642,17 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //当有紧急呼叫时按下护理后取消紧急呼叫灯,同时取消紧急呼叫
|
|
|
|
+ if (Constant.sosOn && Constant.DEVICE_ID != -1) {
|
|
|
|
+ SOSHelper.sosReset()
|
|
|
|
+ val tcpModel = OtherUtil.SOSCancel2(Constant.DEVICE_ID, sosToId, sosItId)
|
|
|
|
+ TcpClient.getInstance().sendMsg(tcpModel.toJson())
|
|
|
|
+
|
|
|
|
+ //按了护理清除呼叫信息
|
|
|
|
+ bedCalls.clear()
|
|
|
|
+ showCalls()
|
|
|
|
+ }
|
|
|
|
+
|
|
return@setOnLongClickListener true
|
|
return@setOnLongClickListener true
|
|
}
|
|
}
|
|
|
|
|
|
@@ -804,7 +830,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
if (Constant.inBlueCode) {
|
|
if (Constant.inBlueCode) {
|
|
//退出blue code
|
|
//退出blue code
|
|
Constant.inBlueCode = false
|
|
Constant.inBlueCode = false
|
|
- room_action_blue_code.setText(R.string.str_blue_code)
|
|
|
|
|
|
+ /*room_action_blue_code.setText(R.string.str_blue_code)
|
|
if (!Constant.inNursing) {
|
|
if (!Constant.inNursing) {
|
|
room_action_blue_code.isEnabled = false
|
|
room_action_blue_code.isEnabled = false
|
|
}
|
|
}
|
|
@@ -812,11 +838,11 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
|
|
|
if (blueCodeId != -1) {
|
|
if (blueCodeId != -1) {
|
|
BlueCodeUtil.sendBlueCodeResponse(Constant.DEVICE_ID, blueCodeId)
|
|
BlueCodeUtil.sendBlueCodeResponse(Constant.DEVICE_ID, blueCodeId)
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
} else {
|
|
} else {
|
|
//进入blue code
|
|
//进入blue code
|
|
Constant.inBlueCode = true
|
|
Constant.inBlueCode = true
|
|
- room_action_blue_code.setText(R.string.str_cancel)
|
|
|
|
|
|
+ room_action_blue_code.isEnabled = false
|
|
//蓝色门灯0.25s闪烁一次
|
|
//蓝色门灯0.25s闪烁一次
|
|
DoorLightHelper.blueCodeLight()
|
|
DoorLightHelper.blueCodeLight()
|
|
|
|
|
|
@@ -1549,7 +1575,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
} else if (tcpModel.type == TcpType.SOS) {
|
|
} else if (tcpModel.type == TcpType.SOS) {
|
|
if (tcpModel.action == TcpAction.SOSAction.CANCEL) {
|
|
if (tcpModel.action == TcpAction.SOSAction.CANCEL) {
|
|
//紧急呼叫已处理
|
|
//紧急呼叫已处理
|
|
- SOSHelper.sosStop()
|
|
|
|
|
|
+ //SOSHelper.sosStop()
|
|
}
|
|
}
|
|
} else if (tcpModel.type == TcpType.DEVICE) {
|
|
} else if (tcpModel.type == TcpType.DEVICE) {
|
|
//检查APP版本
|
|
//检查APP版本
|
|
@@ -1633,14 +1659,15 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
//blue code请求成功
|
|
//blue code请求成功
|
|
val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
blueCodeId = interactionVO.id
|
|
blueCodeId = interactionVO.id
|
|
|
|
+ blueCodeTid = tcpModel.tid
|
|
} else if (tcpModel.action == TcpAction.BlueCodeAction.RESPONDED) {
|
|
} else if (tcpModel.action == TcpAction.BlueCodeAction.RESPONDED) {
|
|
//主机响应blue code
|
|
//主机响应blue code
|
|
- Constant.inBlueCode = false
|
|
|
|
|
|
+ /*Constant.inBlueCode = false
|
|
room_action_blue_code.setText(R.string.str_blue_code)
|
|
room_action_blue_code.setText(R.string.str_blue_code)
|
|
if (!Constant.inNursing) {
|
|
if (!Constant.inNursing) {
|
|
room_action_blue_code.isEnabled = false
|
|
room_action_blue_code.isEnabled = false
|
|
}
|
|
}
|
|
- DoorLightHelper.resetDoorLight()
|
|
|
|
|
|
+ DoorLightHelper.resetDoorLight()*/
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1707,6 +1734,9 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
//SerialPortHelper.setDoorLight(1, "200")
|
|
//SerialPortHelper.setDoorLight(1, "200")
|
|
SerialPortHelper.flashDoorLight("100", 1000) //红色间隔1s闪烁
|
|
SerialPortHelper.flashDoorLight("100", 1000) //红色间隔1s闪烁
|
|
Constant.sosOn = true
|
|
Constant.sosOn = true
|
|
|
|
+ val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
|
|
+ sosItId = interactionVO.id
|
|
|
|
+ sosToId = interactionVO.fromDeviceId
|
|
} else if (tcpModel.action == TcpAction.SideAction.ACCEPT || tcpModel.action == TcpAction.SideAction.CANCEL) {
|
|
} else if (tcpModel.action == TcpAction.SideAction.ACCEPT || tcpModel.action == TcpAction.SideAction.CANCEL) {
|
|
if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
RingPlayHelper.stopRingTone()
|
|
RingPlayHelper.stopRingTone()
|
|
@@ -1723,13 +1753,10 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
//}
|
|
//}
|
|
}
|
|
}
|
|
} else if (tcpModel.action == TcpAction.SideAction.SOS_CANCEL) {
|
|
} else if (tcpModel.action == TcpAction.SideAction.SOS_CANCEL) {
|
|
- Constant.sosOn = false
|
|
|
|
|
|
+ /*Constant.sosOn = false
|
|
if (SettingConfig.getDoorLightAlwaysOn(activity) == 0) {
|
|
if (SettingConfig.getDoorLightAlwaysOn(activity) == 0) {
|
|
- //如果当前还有其他床位呼叫或者是紧急呼叫则不重置门灯
|
|
|
|
- //if (bedCalls.size == 0) {
|
|
|
|
- DoorLightHelper.resetDoorLight()
|
|
|
|
- //}
|
|
|
|
- }
|
|
|
|
|
|
+ DoorLightHelper.resetDoorLight()
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1768,7 +1795,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
val iterator = bedCalls.iterator()
|
|
val iterator = bedCalls.iterator()
|
|
while (iterator.hasNext()) {
|
|
while (iterator.hasNext()) {
|
|
val it = iterator.next()
|
|
val it = iterator.next()
|
|
- if (it.text == showText) {
|
|
|
|
|
|
+ if (it.text == showText && interactionVO.actionType != TcpType.SOS.name) {
|
|
iterator.remove()
|
|
iterator.remove()
|
|
}
|
|
}
|
|
}
|
|
}
|