[8.1.4]
[fea] [tts 司机屏乘客屏车外]
This commit is contained in:
@@ -21,6 +21,9 @@ import com.mogo.och.bridge.autopilot.autopilot.bean.ArrivedStation
|
||||
import com.mogo.och.bridge.autopilot.line.ILineCallback
|
||||
import com.mogo.och.bridge.autopilot.line.LineManager
|
||||
import com.mogo.och.bridge.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.biz.birdge.BridgeListener
|
||||
import com.mogo.och.common.module.biz.birdge.BridgeManager
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
@@ -78,6 +81,8 @@ object OrderModel {
|
||||
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, ochAutopilotStatusListener)
|
||||
|
||||
BridgeManager.addBridgeListener(TAG,bridgeListener)
|
||||
|
||||
LineManager.addListener(TAG,arriveStationBySearch)
|
||||
|
||||
OchTransform.addListener(TAG,ochTransform)
|
||||
@@ -96,11 +101,23 @@ object OrderModel {
|
||||
TicketModel.release()
|
||||
|
||||
OchAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
BridgeManager.removeBridgeListener(LineModel.TAG)
|
||||
|
||||
LineManager.removeListener(TAG)
|
||||
OchTransform.removeListener(TAG)
|
||||
}
|
||||
|
||||
private val bridgeListener = object : BridgeListener{
|
||||
override fun onPncInfoListener(pncAction: String) {
|
||||
when (pncAction) {
|
||||
OchCommonConst.PNC_ACTION_ENTERSTATION -> {
|
||||
ShuttleVoiceManager.arrivedStationOut(ResourcesUtils.getString(R.string.m2_voice_out_arriving_station))
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val ochAutopilotStatusListener = object : IOchAutopilotStatusListener{
|
||||
override fun onAutopilotArriveAtStation(arrivedStation: ArrivedStation?) {
|
||||
e(TAG, "行程日志-onAutopilotArriveAtStation arrive")
|
||||
|
||||
@@ -4,9 +4,14 @@ import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.bridge.autopilot.line.LineManager
|
||||
import com.mogo.och.bridge.distance.IDistanceListener
|
||||
import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.common.module.biz.birdge.BridgeListener
|
||||
import com.mogo.och.common.module.biz.birdge.BridgeManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.action.OperateAction
|
||||
@@ -17,6 +22,7 @@ import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.TaskDetailsMsg
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.voice.VoiceNotice.showNotice
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusTransferData
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
@@ -31,6 +37,32 @@ object ThirdDeviceData {
|
||||
@JvmStatic
|
||||
val busRoutesResult: BusRoutesResult = BusRoutesResult()
|
||||
|
||||
private val bridgeListener: BridgeListener = object : BridgeListener {
|
||||
override fun onCollisionRisk() {
|
||||
ShuttleVoiceManager.collisionRisk()
|
||||
}
|
||||
}
|
||||
private val trajectoryListener: IDistanceListener = object : IDistanceListener {
|
||||
override fun distanceCallback(distance: Float) {
|
||||
// 小于200m 播报站点介绍
|
||||
if (distance < 200) {
|
||||
LineManager.getStations { start, end ->
|
||||
if (!end.isPlayTts) {
|
||||
end.isPlayTts = true
|
||||
if (StringUtils.isEmpty(end.introduction)) {
|
||||
if(!StringUtils.isEmpty(end.name)){
|
||||
val message = "前方到站:${end.name},请下车的乘客做好准备"
|
||||
ShuttleVoiceManager.leave200Distance(message)
|
||||
}
|
||||
}else{
|
||||
ShuttleVoiceManager.leave200Distance(end.introduction)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun init() {
|
||||
//监听运营消息
|
||||
OCHSocketMessageManager.registerSocketMessageListener(
|
||||
@@ -51,6 +83,8 @@ object ThirdDeviceData {
|
||||
DPMsgType.TYPE_TASK_DETAILS.type,
|
||||
taskDetailsMsgListener
|
||||
)
|
||||
TrajectoryAndDistanceManager.addDistanceListener(TAG,trajectoryListener)
|
||||
BridgeManager.addBridgeListener(TAG,bridgeListener)
|
||||
}
|
||||
|
||||
fun release() {
|
||||
@@ -61,6 +95,10 @@ object ThirdDeviceData {
|
||||
|
||||
AbnormalFactorsLoopManager.stopLoopAbnormalFactors()
|
||||
|
||||
TrajectoryAndDistanceManager.removeListener(TAG)
|
||||
|
||||
BridgeManager.removeBridgeListener(TAG)
|
||||
|
||||
//监听乘客屏发来的消息
|
||||
LanSocketManager.unRegisterSocketMessageListener(
|
||||
DPMsgType.TYPE_TASK_DETAILS.type,
|
||||
|
||||
@@ -47,20 +47,11 @@ object ShuttleVoiceManager {
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL1,null)
|
||||
} else if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
siteNameCN?.let {
|
||||
sendArrivedStationToClient(it)
|
||||
sendPassengerPlay( ResourcesUtils.getString(R.string.bus_arrived_station_tip,it))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendArrivedStationToClient(arriveStation: String) {
|
||||
val arrivedMsg = AppConnectMsg(
|
||||
isViewShow = false,
|
||||
isPlay = true,
|
||||
msg = ResourcesUtils.getString(R.string.bus_arrived_station_tip,arriveStation),
|
||||
)
|
||||
LanSocketManager.sendMsgToClient(arrivedMsg)
|
||||
}
|
||||
|
||||
fun leaveStationBus(siteNameCN: String?, siteNameKR: String?) {
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
val context = AbsMogoApplication.getApp()
|
||||
@@ -88,20 +79,11 @@ object ShuttleVoiceManager {
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL1,null)
|
||||
} else if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
siteNameCN?.let {
|
||||
sendStartStationToClient(it)
|
||||
sendPassengerPlay(ResourcesUtils.getString(R.string.bus_leave_station_tip,it))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendStartStationToClient(nextStation: String) {
|
||||
val startMsg = AppConnectMsg(
|
||||
isViewShow = false,
|
||||
isPlay = true,
|
||||
msg = ResourcesUtils.getString(R.string.bus_leave_station_tip,nextStation),
|
||||
)
|
||||
LanSocketManager.sendMsgToClient(startMsg)
|
||||
}
|
||||
|
||||
fun endOrderBus() {
|
||||
val context = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
@@ -115,40 +97,20 @@ object ShuttleVoiceManager {
|
||||
if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL0,null)
|
||||
} else if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
sendEndTaskToClient()
|
||||
sendPassengerPlay(SkinResources.getInstance().getString(R.string.bus_end_task_tip))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun sendEndTaskToClient() {
|
||||
val endMsg = AppConnectMsg(
|
||||
isViewShow = false,
|
||||
isPlay = true,
|
||||
msg = SkinResources.getInstance().getString(R.string.bus_end_task_tip),
|
||||
)
|
||||
LanSocketManager.sendMsgToClient(endMsg)
|
||||
}
|
||||
|
||||
|
||||
fun writeOffCount(successNum:Int){
|
||||
if(successNum<=1){
|
||||
VoiceNotice.showNotice("核验通过", AIAssist.LEVEL3)
|
||||
//sendWriteOffNumToClient("核验通过")
|
||||
}else{
|
||||
VoiceNotice.showNotice("$successNum 人核验通过", AIAssist.LEVEL3)
|
||||
//sendWriteOffNumToClient("$successNum 人核验通过")
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendWriteOffNumToClient(msg: String?) {
|
||||
val passengerMsg = AppConnectMsg(
|
||||
isViewShow = false,
|
||||
isPlay = true,
|
||||
msg = msg!!,
|
||||
)
|
||||
LanSocketManager.sendMsgToClient(passengerMsg)
|
||||
}
|
||||
|
||||
|
||||
// 距离发车还有1分钟
|
||||
fun showLeafTime(tips: String) {
|
||||
@@ -160,4 +122,33 @@ object ShuttleVoiceManager {
|
||||
VoiceNotice.showNotice(reaseon, AIAssist.LEVEL3)
|
||||
}
|
||||
|
||||
fun leave200Distance(message:String){
|
||||
if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
VoiceNotice.showNotice(message, AIAssist.LEVEL0)
|
||||
} else if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
sendPassengerPlay(message)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun collisionRisk() {
|
||||
val message = ResourcesUtils.getString(R.string.m2_voice_collision_risk)
|
||||
if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
VoiceNotice.showNotice(message, AIAssist.LEVEL0)
|
||||
} else if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
sendPassengerPlay(message)
|
||||
arrivedStationOut("车辆遇到紧急情况,正在安全处理")
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendPassengerPlay(msg:String){
|
||||
val passengerMsg = AppConnectMsg(
|
||||
isViewShow = false,
|
||||
isPlay = true,
|
||||
msg = msg,
|
||||
)
|
||||
LanSocketManager.sendMsgToClient(passengerMsg)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -46,8 +46,10 @@
|
||||
<string name="bus_dialog_confirm">确认</string>
|
||||
<string name="bus_dialog_cancel">取消</string>
|
||||
|
||||
<string name="m2_voice_out_arrive_station">蘑菇小巴正在进站</string>
|
||||
<string name="m2_voice_out_arrive_station">欢迎乘坐蘑菇小巴</string>
|
||||
<string name="m2_voice_out_arriving_station">蘑菇小巴正在进站</string>
|
||||
<string name="m2_voice_out_autopilot_start_in15m">蘑菇小巴出发咯</string>
|
||||
<string name="m2_voice_collision_risk">尊敬的乘客,车辆遇到紧急情况,正在安全处理,请坐稳扶好,听从指引,感谢配合</string>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user