|
|
|
|
@@ -9,14 +9,20 @@ import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
|
|
|
|
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
|
|
|
|
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VIP
|
|
|
|
|
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N
|
|
|
|
|
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
|
|
|
|
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
|
|
|
|
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
|
|
|
|
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
|
|
|
|
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
|
|
|
|
import com.mogo.eagle.core.data.trafficlight.currentRoadTrafficLight
|
|
|
|
|
import com.mogo.eagle.core.data.trafficlight.isGreen
|
|
|
|
|
import com.mogo.eagle.core.data.trafficlight.isRed
|
|
|
|
|
import com.mogo.eagle.core.data.v2x.VipMessage
|
|
|
|
|
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
|
|
|
|
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
|
|
|
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
|
|
|
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
|
|
|
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
|
|
|
|
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
|
|
|
|
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
|
|
|
|
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
|
|
|
|
@@ -25,11 +31,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
|
|
|
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
|
|
|
|
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
|
|
|
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
|
|
|
|
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
|
|
|
|
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
|
|
|
|
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
|
|
|
|
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
|
|
|
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
|
|
|
|
import com.zhjt.service_biz.BizConfig
|
|
|
|
|
|
|
|
|
|
class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListener,
|
|
|
|
|
@@ -205,6 +206,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
|
|
|
|
MogoTrafficLightManager.INSTANCE.turnLightToGreen(
|
|
|
|
|
result!!.lightId, result!!.crossId, bearing, controlTime,
|
|
|
|
|
{
|
|
|
|
|
// 请求变灯成功,直接提示
|
|
|
|
|
if (it.sn == MoGoAiCloudClientConfig.getInstance().sn && it.code == 0) {
|
|
|
|
|
CallerLogger.d("$M_V2X$TAG", "变灯请求成功")
|
|
|
|
|
showWarning(
|
|
|
|
|
@@ -213,7 +215,22 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
|
|
|
|
EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts,
|
|
|
|
|
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
return@turnLightToGreen
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 请求变灯失败,根据灯态来提示。 此处灯态未获取到
|
|
|
|
|
if (this.result == null || this.result?.currentRoadTrafficLight() == null) {
|
|
|
|
|
showWarning(
|
|
|
|
|
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
|
|
|
|
|
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + "稍后重试",
|
|
|
|
|
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
|
|
|
|
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
|
|
|
|
)
|
|
|
|
|
return@turnLightToGreen
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 如果当前为红灯,则提示
|
|
|
|
|
if (this.result!!.currentRoadTrafficLight()!!.isRed()) {
|
|
|
|
|
val time = if (it.countDown / 60 >= 1) {
|
|
|
|
|
"${it.countDown / 60}分${it.countDown % 60}秒后重试"
|
|
|
|
|
} else {
|
|
|
|
|
@@ -230,6 +247,11 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
|
|
|
|
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
|
|
|
|
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
CallerLogger.d(
|
|
|
|
|
"$M_V2X$TAG",
|
|
|
|
|
"变灯请求失败,当前为非红灯不做展示 , light : ${result.toString()} , trafficLightControl : $it"
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{ errorMsg ->
|
|
|
|
|
@@ -246,12 +268,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
|
|
|
|
tag: String
|
|
|
|
|
) {
|
|
|
|
|
CallerMsgBoxManager.saveMsgBox(
|
|
|
|
|
MsgBoxBean(
|
|
|
|
|
MsgBoxType.V2X,
|
|
|
|
|
V2XMsg(v2xType,
|
|
|
|
|
alertContent.toString(),
|
|
|
|
|
ttsContent)
|
|
|
|
|
)
|
|
|
|
|
MsgBoxBean(MsgBoxType.V2X, V2XMsg(v2xType, alertContent.toString(), ttsContent))
|
|
|
|
|
)
|
|
|
|
|
CallerHmiManager.warningV2X(
|
|
|
|
|
v2xType, alertContent, ttsContent, tag,
|
|
|
|
|
|