|
@@ -43,6 +43,7 @@ import com.wdkl.app.ncs.callingbed.bt_gateway.*
|
|
|
import com.wdkl.app.ncs.callingbed.databinding.CallingbedMainNewBinding
|
|
|
import com.wdkl.app.ncs.callingbed.dialog.CallTypeDialogHelper
|
|
|
import com.wdkl.app.ncs.callingbed.dialog.Device433DialogHelper
|
|
|
+import com.wdkl.app.ncs.callingbed.dialog.LoadingDialogHelper
|
|
|
import com.wdkl.app.ncs.callingbed.dialog.ReinforcementsDialogHelper
|
|
|
import com.wdkl.app.ncs.callingbed.fragment.*
|
|
|
import com.wdkl.app.ncs.callingbed.hardware.HardWareFactory
|
|
@@ -1494,7 +1495,7 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
|
|
|
if (time - clickCallTime > 2500) {
|
|
|
clickCallTime = time
|
|
|
|
|
|
- if ( Constant.NursingTitle .equals(getString(R.string.enter_nursing))){
|
|
|
+ if (Constant.NursingTitle .equals(getString(R.string.enter_nursing))){
|
|
|
if (Constant.CALL_STATE == Constant.CALL_CALLING) {
|
|
|
//通话中挂断
|
|
|
EventBus.getDefault().post(MessageEvent("handoff", Constant.EVENT_SERIAL_EVENT))
|
|
@@ -1578,6 +1579,7 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
|
|
|
*/
|
|
|
fun setButtonType(status: String?) {
|
|
|
if (Constant.device_button_function.isNullOrEmpty()) {
|
|
|
+ Log.e(TAG, "没有配置按键功能,使用默认")
|
|
|
if (status == "5" || status == "6") {
|
|
|
//手柄呼叫键,面板呼叫键
|
|
|
val time = System.currentTimeMillis()
|
|
@@ -1689,10 +1691,19 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
|
|
|
EventBus.getDefault().post(MessageEvent("reject", Constant.EVENT_SERIAL_EVENT))
|
|
|
}
|
|
|
} else {
|
|
|
- when {
|
|
|
- TextUtils.isEmpty(Constant.SIP_ID) -> showMessage(R.string.no_custom)
|
|
|
- Constant.CALL_STATE == Constant.CALL_STANDBY -> startCallRoleName(value.toString())
|
|
|
- else -> showMessage(R.string.call_fail)
|
|
|
+ if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
|
+ //发起呼叫
|
|
|
+ if (!TextUtils.isEmpty(Constant.SIP_ID)) {
|
|
|
+ startCallRoleName(value.toString())
|
|
|
+ } else {
|
|
|
+ showMessage(R.string.no_custom)
|
|
|
+ }
|
|
|
+ } else if (Constant.CALL_STATE == Constant.CALL_INCOMING) {
|
|
|
+ //来电接听
|
|
|
+ EventBus.getDefault().post(MessageEvent("accept", Constant.EVENT_SERIAL_EVENT))
|
|
|
+ } else if (Constant.CALL_STATE == Constant.CALL_CALLING) {
|
|
|
+ //通话中挂断
|
|
|
+ EventBus.getDefault().post(MessageEvent("handoff", Constant.EVENT_SERIAL_EVENT))
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -1711,6 +1722,15 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
|
|
|
val eventValue = value as Double?
|
|
|
val tcpModel = EventUtil.eventKeyClick(Constant.DEVICE_ID, eventValue?.toInt())
|
|
|
TcpClient.getInstance().sendMsg(tcpModel.toJson())
|
|
|
+
|
|
|
+ runOnUiThread {
|
|
|
+ if (BuildConfig.device_type.equals("1")){
|
|
|
+ LoadingDialogHelper.showLoadingDialog(activity)
|
|
|
+ }else {
|
|
|
+ ReinforcementsDialogHelper.showDialog(activity, 1)
|
|
|
+ }
|
|
|
+ SoundPoolManager.getInstance().playSound(4, 1.0f, 1.0f, 0)
|
|
|
+ }
|
|
|
} catch (e: Exception) {
|
|
|
e.printStackTrace()
|
|
|
}
|