|
@@ -596,7 +596,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
showMessage(R.string.net_error)
|
|
|
}
|
|
|
|
|
|
- Constant.callNums = 0
|
|
|
DoorLightHelper.resetDoorLight()
|
|
|
EventBus.getDefault().post(MessageEvent("clear_calls", Constant.EVENT_CLEAR_CALLS))
|
|
|
|
|
@@ -914,6 +913,12 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
room_action_nurse.visibility = View.GONE
|
|
|
}
|
|
|
|
|
|
+ if (partSetting.boolDoorLightAlwaysOn != null && partSetting.boolDoorLightAlwaysOn == 1) {
|
|
|
+ SettingConfig.setDoorLightAlwaysOn(activity, 1)
|
|
|
+ } else {
|
|
|
+ SettingConfig.setDoorLightAlwaysOn(activity, 0)
|
|
|
+ }
|
|
|
+
|
|
|
//护理门灯颜色
|
|
|
if (partSetting.nursingColorRgb != null && partSetting.nursingColorRgb.length == 3 && TextUtils.isDigitsOnly(partSetting.nursingColorRgb)) {
|
|
|
Constant.nursingColor = partSetting.nursingColorRgb
|
|
@@ -1308,25 +1313,24 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
|
|
|
private fun callControl(tcpModel: TcpModel) {
|
|
|
if (tcpModel.action == TcpAction.SideAction.CALL) {
|
|
|
- Constant.callNums++
|
|
|
SerialPortHelper.setDoorLight(1, "200")
|
|
|
} else if (tcpModel.action == TcpAction.SideAction.SOS_CALL) {
|
|
|
SerialPortHelper.setDoorLight(1, "200")
|
|
|
Constant.sosOn = true
|
|
|
} else if (tcpModel.action == TcpAction.SideAction.ACCEPT || tcpModel.action == TcpAction.SideAction.CANCEL) {
|
|
|
- Constant.callNums--
|
|
|
- if (Constant.callNums < 0) {
|
|
|
- Constant.callNums = 0
|
|
|
- }
|
|
|
-
|
|
|
- //如果当前还有其他床位呼叫或者是紧急呼叫则不重置门灯
|
|
|
- if (Constant.callNums == 0 && !Constant.sosOn) {
|
|
|
- DoorLightHelper.resetDoorLight()
|
|
|
+ if (SettingConfig.getDoorLightAlwaysOn(activity) == 0) {
|
|
|
+ //如果当前还有其他床位呼叫或者是紧急呼叫则不重置门灯
|
|
|
+ if (bedCalls.size == 0 && !Constant.sosOn) {
|
|
|
+ DoorLightHelper.resetDoorLight()
|
|
|
+ }
|
|
|
}
|
|
|
} else if (tcpModel.action == TcpAction.SideAction.SOS_CANCEL) {
|
|
|
Constant.sosOn = false
|
|
|
- if (Constant.callNums == 0) {
|
|
|
- DoorLightHelper.resetDoorLight()
|
|
|
+ if (SettingConfig.getDoorLightAlwaysOn(activity) == 0) {
|
|
|
+ //如果当前还有其他床位呼叫或者是紧急呼叫则不重置门灯
|
|
|
+ if (bedCalls.size == 0) {
|
|
|
+ DoorLightHelper.resetDoorLight()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1419,6 +1423,11 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
}
|
|
|
} else {
|
|
|
view_flipper.removeAllViews()
|
|
|
+
|
|
|
+ //重置门灯
|
|
|
+ if (!Constant.sosOn) {
|
|
|
+ DoorLightHelper.resetDoorLight()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1430,7 +1439,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
val iterator = bedCalls.iterator()
|
|
|
while (iterator.hasNext()) {
|
|
|
val it = iterator.next()
|
|
|
- if (System.currentTimeMillis() - it.time >= 10 * 60 * 1000) {
|
|
|
+ if (System.currentTimeMillis() - it.time >= 15 * 60 * 1000) {
|
|
|
iterator.remove()
|
|
|
}
|
|
|
}
|
|
@@ -1438,9 +1447,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
runOnUiThread {
|
|
|
showCalls()
|
|
|
}
|
|
|
- } else {
|
|
|
- Constant.callNums = 0
|
|
|
- DoorLightHelper.resetDoorLight()
|
|
|
}
|
|
|
} catch (ex: Exception) {
|
|
|
ex.printStackTrace()
|