|
@@ -121,6 +121,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
private var clickSosTime : Long = 0
|
|
private var clickSosTime : Long = 0
|
|
private var clickVersionTime : Long = 0
|
|
private var clickVersionTime : Long = 0
|
|
private var clickCount = 1
|
|
private var clickCount = 1
|
|
|
|
+ private var callNums = 0
|
|
|
|
|
|
private var serverSuccess = false
|
|
private var serverSuccess = false
|
|
private var cancelRestart = false
|
|
private var cancelRestart = false
|
|
@@ -600,6 +601,9 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
showMessage(R.string.net_error)
|
|
showMessage(R.string.net_error)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ callNums == 0
|
|
|
|
+ DoorLightHelper.resetDoorLight()
|
|
|
|
+
|
|
SpeechUtil.getInstance().stopSpeak()
|
|
SpeechUtil.getInstance().stopSpeak()
|
|
bedCalls.clear()
|
|
bedCalls.clear()
|
|
view_flipper.removeAllViews()
|
|
view_flipper.removeAllViews()
|
|
@@ -1309,27 +1313,24 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
|
|
|
private fun callControl(tcpModel: TcpModel) {
|
|
private fun callControl(tcpModel: TcpModel) {
|
|
if (tcpModel.action == TcpAction.SideAction.CALL) {
|
|
if (tcpModel.action == TcpAction.SideAction.CALL) {
|
|
|
|
+ callNums++
|
|
SerialPortHelper.setDoorLight(1, "200")
|
|
SerialPortHelper.setDoorLight(1, "200")
|
|
- //显示分机呼叫信息
|
|
|
|
- //val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
|
|
- //updateBedCall(interactionVO, true)
|
|
|
|
} else if (tcpModel.action == TcpAction.SideAction.SOS_CALL) {
|
|
} else if (tcpModel.action == TcpAction.SideAction.SOS_CALL) {
|
|
SerialPortHelper.setDoorLight(1, "200")
|
|
SerialPortHelper.setDoorLight(1, "200")
|
|
Constant.sosOn = true
|
|
Constant.sosOn = true
|
|
} else if (tcpModel.action == TcpAction.SideAction.ACCEPT || tcpModel.action == TcpAction.SideAction.CANCEL) {
|
|
} else if (tcpModel.action == TcpAction.SideAction.ACCEPT || tcpModel.action == TcpAction.SideAction.CANCEL) {
|
|
- //val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
|
|
- //updateBedCall(interactionVO, false)
|
|
|
|
|
|
+ callNums--
|
|
|
|
+ if (callNums < 0) {
|
|
|
|
+ callNums = 0
|
|
|
|
+ }
|
|
|
|
|
|
//如果当前还有其他床位呼叫或者是紧急呼叫则不重置门灯
|
|
//如果当前还有其他床位呼叫或者是紧急呼叫则不重置门灯
|
|
- if (bedCalls.size == 0 && !Constant.sosOn) {
|
|
|
|
|
|
+ if (callNums == 0 && !Constant.sosOn) {
|
|
DoorLightHelper.resetDoorLight()
|
|
DoorLightHelper.resetDoorLight()
|
|
}
|
|
}
|
|
} else if (tcpModel.action == TcpAction.SideAction.SOS_CANCEL) {
|
|
} else if (tcpModel.action == TcpAction.SideAction.SOS_CANCEL) {
|
|
- DoorLightHelper.resetDoorLight()
|
|
|
|
Constant.sosOn = false
|
|
Constant.sosOn = false
|
|
-
|
|
|
|
- //如果当前还有其他床位呼叫或者是紧急呼叫则不重置门灯
|
|
|
|
- if (bedCalls.size == 0) {
|
|
|
|
|
|
+ if (callNums == 0) {
|
|
DoorLightHelper.resetDoorLight()
|
|
DoorLightHelper.resetDoorLight()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1442,6 +1443,9 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
runOnUiThread {
|
|
runOnUiThread {
|
|
showCalls()
|
|
showCalls()
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ callNums == 0
|
|
|
|
+ DoorLightHelper.resetDoorLight()
|
|
}
|
|
}
|
|
} catch (ex: Exception) {
|
|
} catch (ex: Exception) {
|
|
ex.printStackTrace()
|
|
ex.printStackTrace()
|