diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index b9a62441f8..82504edac8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -604,9 +604,8 @@ class DebugSettingView @JvmOverloads constructor( tbIsRainMode.isChecked = FunctionBuildConfig.isRainMode //雨天模式 tbIsRainMode.setOnCheckedChangeListener { _, isChecked -> - VipCarManager.INSTANCE.turnLight(25) -// CallerAutoPilotManager.setRainMode(isChecked) -// FunctionBuildConfig.isRainMode = isChecked + CallerAutoPilotManager.setRainMode(isChecked) + FunctionBuildConfig.isRainMode = isChecked } //雨天模式按钮只在司机屏生效,乘客屏不显示 if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt index 5f33f1af73..018853805a 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt @@ -20,6 +20,7 @@ import com.mogo.eagle.core.data.trafficlight.isRed import com.mogo.eagle.core.data.v2x.VipMessage 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 @@ -63,13 +64,7 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe .registerOnMessageListener(401025, this) //首次进入应用查询是否为VIP车辆 -// requestVip() - - //todo emArrow test - CallerHmiManager.vipIdentification(true) - CallVipSetListenerManager.invokeVipSetStatus(true) - CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this) - CallerTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this) + requestVip() } override fun handleMessage(msg: Message): Boolean { @@ -108,9 +103,9 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe } override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) { -// if (!vip) { //todo emArrow test -// return -// } + if (!vip) { + return + } if (exit) { CallerLogger.d("$M_V2X$TAG", "驶离路口,返回 , then resetConditions") @@ -201,69 +196,69 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe } fun turnLight(controlTime: Int) { -// if (result == null || mContext == null) return -// val locationClient = CallerMapUIServiceManager.getSingletonLocationClient(mContext!!) -// if (locationClient != null) { -// val bearing = -// locationClient.lastKnowLocation.bearing.toDouble() - CallerLogger.d("$M_V2X$TAG", "-- turnLight -- ") - MogoTrafficLightManager.INSTANCE.turnLightToGreen( -// result!!.lightId, result!!.crossId, bearing, controlTime, - 100445, "10037", 90.0, controlTime, - { - // 请求变灯成功,直接提示 - if (it.sn == MoGoAiCloudClientConfig.getInstance().sn && it.code == 0) { - CallerLogger.d("$M_V2X$TAG", "变灯请求成功") - showWarning( - EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType, - EventTypeEnum.TYPE_VIP_IDENTIFICATION.content, - EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts, - EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType - ) - 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 { - val temp = if (it.countDown == 0) { - 1 - } else { - it.countDown - } - "${temp}秒后重试" + if (result == null || mContext == null) return + val locationClient = CallerMapUIServiceManager.getSingletonLocationClient(mContext!!) + if (locationClient != null) { + val bearing = + locationClient.lastKnowLocation.bearing.toDouble() + CallerLogger.d("$M_V2X$TAG", "-- turnLight -- ") + MogoTrafficLightManager.INSTANCE.turnLightToGreen( + result!!.lightId, result!!.crossId, bearing, controlTime, +// 100445, "10037", 90.0, controlTime, //衡阳25号路口测试数据 + { + // 请求变灯成功,直接提示 + if (it.sn == MoGoAiCloudClientConfig.getInstance().sn && it.code == 0) { + CallerLogger.d("$M_V2X$TAG", "变灯请求成功") + showWarning( + EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType, + EventTypeEnum.TYPE_VIP_IDENTIFICATION.content, + EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts, + EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType + ) + return@turnLightToGreen } - showWarning( - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + time, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType - ) - } else { - CallerLogger.d( - "$M_V2X$TAG", - "变灯请求失败,当前为非红灯不做展示 , light : ${result.toString()} , trafficLightControl : $it" - ) - } - }, - { errorMsg -> - CallerLogger.e("$M_V2X$TAG", "变灯请求失败 msg : $errorMsg") - ToastUtils.showLong("服务异常,请稍后重试") - }) -// } + + // 请求变灯失败,根据灯态来提示。 此处灯态未获取到 + 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 { + val temp = if (it.countDown == 0) { + 1 + } else { + it.countDown + } + "${temp}秒后重试" + } + showWarning( + EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType, + EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + time, + EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts, + EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType + ) + } else { + CallerLogger.d( + "$M_V2X$TAG", + "变灯请求失败,当前为非红灯不做展示 , light : ${result.toString()} , trafficLightControl : $it" + ) + } + }, + { errorMsg -> + CallerLogger.e("$M_V2X$TAG", "变灯请求失败 msg : $errorMsg") + ToastUtils.showLong("服务异常,请稍后重试") + }) + } } private fun showWarning(