|
@@ -62,6 +62,7 @@ import com.wdkl.ncs.android.middleware.tcp.enums.TcpAction
|
|
import com.wdkl.ncs.android.middleware.tcp.enums.TcpType
|
|
import com.wdkl.ncs.android.middleware.tcp.enums.TcpType
|
|
import com.wdkl.ncs.android.middleware.udp.ServerInfoUtil
|
|
import com.wdkl.ncs.android.middleware.udp.ServerInfoUtil
|
|
import com.wdkl.ncs.android.middleware.utils.CommonUtils
|
|
import com.wdkl.ncs.android.middleware.utils.CommonUtils
|
|
|
|
+import com.wdkl.ncs.android.middleware.utils.StringUtil
|
|
import com.wdkl.ncs.janus.util.JanusConstant
|
|
import com.wdkl.ncs.janus.util.JanusConstant
|
|
import kotlinx.android.synthetic.main.callingbed_main_lay.*
|
|
import kotlinx.android.synthetic.main.callingbed_main_lay.*
|
|
import kotlinx.android.synthetic.main.view_title_layout.*
|
|
import kotlinx.android.synthetic.main.view_title_layout.*
|
|
@@ -448,8 +449,8 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
//初始化默认护理项
|
|
//初始化默认护理项
|
|
for (index in 1..5) {
|
|
for (index in 1..5) {
|
|
var item = NurseConfigDto()
|
|
var item = NurseConfigDto()
|
|
- item.nurseConfigName = "护理"
|
|
|
|
- item.nurseOptionName = "暂无"
|
|
|
|
|
|
+ item.nurseConfigName = StringUtil.getResString(R.string.default_nurse_config_name)
|
|
|
|
+ item.nurseOptionName = StringUtil.getResString(R.string.str_empty)
|
|
item.nurseColorRbg = "2F9DF1"
|
|
item.nurseColorRbg = "2F9DF1"
|
|
configList.add(item)
|
|
configList.add(item)
|
|
}
|
|
}
|
|
@@ -481,7 +482,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
|
|
|
|
//没有网络
|
|
//没有网络
|
|
override fun onNoNet() {
|
|
override fun onNoNet() {
|
|
- showMessage("没有网络")
|
|
|
|
|
|
+ showMessage("No network")
|
|
//加载失败,重置customid
|
|
//加载失败,重置customid
|
|
//Constant.CUSTOM_ID = -1
|
|
//Constant.CUSTOM_ID = -1
|
|
}
|
|
}
|
|
@@ -541,7 +542,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
|
|
|
|
//开启TCP连接
|
|
//开启TCP连接
|
|
startTcp()
|
|
startTcp()
|
|
- showMessage("tcp开始连接...host: " + Constant.TCP_SERVER_URL + ", port: " + Constant.TCP_PORT)
|
|
|
|
|
|
+ showMessage("tcp connect --> host: " + Constant.TCP_SERVER_URL + ", port: " + Constant.TCP_PORT)
|
|
|
|
|
|
Thread(Runnable {
|
|
Thread(Runnable {
|
|
while (!initialized) {
|
|
while (!initialized) {
|
|
@@ -576,7 +577,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
|
|
|
|
initialized = true
|
|
initialized = true
|
|
view_title_layout_tv_hospital_name.text = deviceInfo.hospitalName + deviceInfo.partName
|
|
view_title_layout_tv_hospital_name.text = deviceInfo.hospitalName + deviceInfo.partName
|
|
- view_title_layout_tv_no.text = "设备ID:" + deviceInfo.id
|
|
|
|
|
|
+ view_title_layout_tv_no.text = "ID:" + deviceInfo.id
|
|
|
|
|
|
if (deviceInfo.customerId != null) {
|
|
if (deviceInfo.customerId != null) {
|
|
Constant.CUSTOM_ID = deviceInfo.customerId
|
|
Constant.CUSTOM_ID = deviceInfo.customerId
|
|
@@ -584,10 +585,10 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
//EventBus.getDefault().post(MessageEvent("updateCustom", Constant.EVENT_UPDATE_CUSTOM))
|
|
//EventBus.getDefault().post(MessageEvent("updateCustom", Constant.EVENT_UPDATE_CUSTOM))
|
|
|
|
|
|
if (TextUtils.isEmpty(Constant.SIP_ID)) {
|
|
if (TextUtils.isEmpty(Constant.SIP_ID)) {
|
|
- showMessage("SIP ID为空")
|
|
|
|
|
|
+ showMessage("SIP ID empty")
|
|
}
|
|
}
|
|
if (Constant.DEVICE_STATUS == 0) {
|
|
if (Constant.DEVICE_STATUS == 0) {
|
|
- showMessage("设备未启用")
|
|
|
|
|
|
+ showMessage(StringUtil.getResString(R.string.device_disable))
|
|
} else if (Constant.DEVICE_STATUS == 1) {
|
|
} else if (Constant.DEVICE_STATUS == 1) {
|
|
//启动主fragment
|
|
//启动主fragment
|
|
switchToMainFragment()
|
|
switchToMainFragment()
|
|
@@ -637,7 +638,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
|
|
|
|
VoiceManagerUtil.setCallVoice(activity, partSetting.dayBedVol)
|
|
VoiceManagerUtil.setCallVoice(activity, partSetting.dayBedVol)
|
|
} catch (ex: Exception) {
|
|
} catch (ex: Exception) {
|
|
- showMessage("获取设置参数信息异常" + ex.message)
|
|
|
|
|
|
+ showMessage(StringUtil.getResString(R.string.setting_params_error) + ex.message)
|
|
ex.printStackTrace()
|
|
ex.printStackTrace()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -799,21 +800,21 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
override fun loadAppVersion(appInfo: AppVersionDO) {
|
|
override fun loadAppVersion(appInfo: AppVersionDO) {
|
|
val newAppVersion = appInfo.versionCode.substring(1)
|
|
val newAppVersion = appInfo.versionCode.substring(1)
|
|
Log.d("AppUpdate", "loadAppVersion =====>> newAppVersion: " + newAppVersion + ", curAppVersion: " + BuildConfig.VERSION_NAME + ", path: " + appInfo.appPath)
|
|
Log.d("AppUpdate", "loadAppVersion =====>> newAppVersion: " + newAppVersion + ", curAppVersion: " + BuildConfig.VERSION_NAME + ", path: " + appInfo.appPath)
|
|
- showMessage("获取版本成功,当前版本: " + BuildConfig.VERSION_NAME + "_" + BuildConfig.VERSION_CODE + ", 服务器版本: " + newAppVersion + "_" + appInfo.versionNo)
|
|
|
|
|
|
+ showMessage("current version: " + BuildConfig.VERSION_NAME + "_" + BuildConfig.VERSION_CODE + ", new version: " + newAppVersion + "_" + appInfo.versionNo)
|
|
|
|
|
|
if (BuildConfig.VERSION_CODE < appInfo.versionNo) {
|
|
if (BuildConfig.VERSION_CODE < appInfo.versionNo) {
|
|
if (!updating) {
|
|
if (!updating) {
|
|
- showMessage("即将升级...")
|
|
|
|
|
|
+ //showMessage("即将升级...")
|
|
Constant.APP_PATH = appInfo.appPath
|
|
Constant.APP_PATH = appInfo.appPath
|
|
updating = true
|
|
updating = true
|
|
AppTool.Time.delay(200) {
|
|
AppTool.Time.delay(200) {
|
|
push("/callingbed/update")
|
|
push("/callingbed/update")
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- showMessage("正在升级中...")
|
|
|
|
|
|
+ showMessage(R.string.updating)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- showMessage("当前已是最新版本")
|
|
|
|
|
|
+ showMessage(R.string.update_no_required)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -983,19 +984,16 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
backTimeout = 0
|
|
backTimeout = 0
|
|
if (isVisible(right_menu)) {
|
|
if (isVisible(right_menu)) {
|
|
hideRightMenu(true)
|
|
hideRightMenu(true)
|
|
- showMessage("增援请求已发送!")
|
|
|
|
|
|
+ showMessage(R.string.support_sent)
|
|
if (Constant.TCP_CONNECTED) {
|
|
if (Constant.TCP_CONNECTED) {
|
|
if (Constant.DEVICE_ID != -1) {
|
|
if (Constant.DEVICE_ID != -1) {
|
|
OtherUtil.sendReinforce(Constant.DEVICE_ID)
|
|
OtherUtil.sendReinforce(Constant.DEVICE_ID)
|
|
} else {
|
|
} else {
|
|
- showMessage("没有设备id!")
|
|
|
|
|
|
+ showMessage("no device id!")
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- showMessage("网络异常,请求失败!")
|
|
|
|
|
|
+ showMessage(R.string.net_error)
|
|
}
|
|
}
|
|
-
|
|
|
|
- //switchToFragment(R.id.callingbed_main_frame, SupportFragment(), supportFragment)
|
|
|
|
- //SoundPoolHelper.getInstance().playSound(2)
|
|
|
|
} else {
|
|
} else {
|
|
showRightMenu()
|
|
showRightMenu()
|
|
}
|
|
}
|
|
@@ -1013,7 +1011,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
//没有摄像头则只能拨打语音
|
|
//没有摄像头则只能拨打语音
|
|
startCall(Constant.VOICE_CALL)
|
|
startCall(Constant.VOICE_CALL)
|
|
} else {
|
|
} else {
|
|
- showMessage("当前设备可能未办理入住,不能呼叫")
|
|
|
|
|
|
+ showMessage(R.string.no_custom)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
showRightMenu()
|
|
showRightMenu()
|
|
@@ -1026,7 +1024,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
//没有摄像头则只能拨打语音
|
|
//没有摄像头则只能拨打语音
|
|
startCall(Constant.VOICE_CALL)
|
|
startCall(Constant.VOICE_CALL)
|
|
} else {
|
|
} else {
|
|
- showMessage("当前设备可能未办理入住,不能呼叫")
|
|
|
|
|
|
+ showMessage(R.string.no_custom)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (Constant.CALL_STATE == Constant.CALL_CALLING) {
|
|
} else if (Constant.CALL_STATE == Constant.CALL_CALLING) {
|
|
@@ -1055,7 +1053,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
//没有摄像头则只能拨打语音
|
|
//没有摄像头则只能拨打语音
|
|
startCall(Constant.VOICE_CALL)
|
|
startCall(Constant.VOICE_CALL)
|
|
} else {
|
|
} else {
|
|
- showMessage("当前设备可能未办理入住,不能呼叫")
|
|
|
|
|
|
+ showMessage(R.string.no_custom)
|
|
}
|
|
}
|
|
} else if (Constant.CALL_STATE == Constant.CALL_INCOMING) {
|
|
} else if (Constant.CALL_STATE == Constant.CALL_INCOMING) {
|
|
//来电接听
|
|
//来电接听
|
|
@@ -1100,7 +1098,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
fragment.arguments = bundle
|
|
fragment.arguments = bundle
|
|
addCallFragment(fragment)
|
|
addCallFragment(fragment)
|
|
} else {
|
|
} else {
|
|
- showMessage("服务未连接或sipId为空")
|
|
|
|
|
|
+ showMessage(R.string.call_init_error)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1179,7 +1177,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
fragment.arguments = bundle
|
|
fragment.arguments = bundle
|
|
addCallFragment(fragment)
|
|
addCallFragment(fragment)
|
|
} else {
|
|
} else {
|
|
- showMessage("服务未连接或sipId为空")
|
|
|
|
|
|
+ showMessage(R.string.call_init_error)
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
VoiceUtil.rejectAudioCall(
|
|
VoiceUtil.rejectAudioCall(
|
|
Constant.DEVICE_ID,
|
|
Constant.DEVICE_ID,
|
|
@@ -1418,7 +1416,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- showMessage("请重启机器!")
|
|
|
|
|
|
+ showMessage(R.string.tips_reboot)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|