diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index de94064026..f2444ddf4d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -27,11 +27,13 @@ import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView import com.mogo.eagle.core.function.hmi.ui.notice.NoticeBannerView import com.mogo.eagle.core.function.hmi.ui.notice.NoticeNormalBannerView import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView +import com.mogo.eagle.core.function.hmi.ui.utils.visible import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.module.common.enums.EventTypeEnum import com.mogo.utils.logger.Logger import kotlinx.android.synthetic.main.fragment_hmi.* +import androidx.core.view.isVisible as isVisible /** * @author xiaoyuzhou @@ -281,6 +283,10 @@ class MoGoHmiFragment : MvpFragment viewTrafficLightVr?.showWarningTrafficLight(checkLightId) } + override fun isWarningTrafficLightShow(): Boolean { + return viewTrafficLightVr.visibility == View.VISIBLE + } + /** * 关闭红绿灯预警展示,并重制灯态 */ diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/TrafficLightHMIManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/TrafficLightHMIManager.kt index 8f2f20fba4..ea333b6491 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/TrafficLightHMIManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/TrafficLightHMIManager.kt @@ -15,6 +15,10 @@ class TrafficLightHMIManager { private var initView: Boolean = false + fun isWarningTrafficLightShow():Boolean{ + return CallerHmiManager.isWarningTrafficLightShow() + } + fun updateTrafficLight(trafficLightResult: TrafficLightResult) { val currentTrafficLight = trafficLightResult.currentRoadTrafficLight() currentTrafficLight?.let { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt index 651aaa3cce..e2ac1e3cfa 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt @@ -46,6 +46,13 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 { TrafficLightThreadHandler(WorkThreadHandler.newInstance("TrafficLight").looper, { Logger.d(TAG, "loop search roadID , mLocation : $mLocation") + + //查询路口时,如果红绿灯显示,则隐藏掉 + if(TrafficLightHMIManager.INSTANCE.isWarningTrafficLightShow()){ + TrafficLightHMIManager.INSTANCE.hideTrafficLight() + CallTrafficLightListenerManager.resetTrafficLightData() + } + mLocation?.let { it -> val tileId = MogoApisHandler.getInstance().apis .mapServiceApi.mapUIController.getTileId(it.longitude, it.latitude) @@ -74,7 +81,12 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 { CallTrafficLightListenerManager.invokeTrafficLightStatus(result) }, { errorMsg -> + //如果没有获取到正确的红绿灯数据,则取消读灯,继续读路口,防止出现一直读灯的情况 Logger.d(TAG, "request Traffic Light error : $errorMsg") + //stop loop traffic light + trafficLightNetWorkModel.cancelRequestTrafficLight() + //未查到红绿灯,加入2秒延时请求路口ID + mThreadHandler?.sendEmptyMessageDelayed(MSG_WHAT_LOOP_SEARCH_CROSS_ROAD, 2_000L) }) } }, { @@ -116,7 +128,7 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 { && (CoordinateUtils.calculateLineDistance( it.longitude, it.latitude, trafficLightResult!!.lon, trafficLightResult!!.lat - ) < 5) + ) < 10) ) { trafficLightResult = null TrafficLightHMIManager.INSTANCE.hideTrafficLight() diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightResult.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightResult.kt index 939f438816..1cd18f663c 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightResult.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/trafficlight/TrafficLightResult.kt @@ -12,6 +12,7 @@ data class TrafficLightResult( val lat: Double, //纬度 val lon: Double, //经度 val direction: String, //航向角 + val heading: String, //红绿灯方向 val lightId: Int, //红绿灯ID val laneNo: Int, //车道号 val arrowNo: Int, //当前车道对应地面要素转向 diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt index 376ab0ae21..0243ff311c 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt @@ -63,6 +63,11 @@ interface IMoGoWaringProvider { */ fun showWarningTrafficLight(checkLightId: Int) + /** + * 红绿灯是否展示 + */ + fun isWarningTrafficLightShow():Boolean + /** * 关闭红绿灯预警 */ diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt index db4e8f28b0..03a802ce74 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt @@ -16,15 +16,16 @@ import com.mogo.eagle.core.function.call.base.CallerBase * HMI 调用者管理,这里对外及其他模块提供功能的调用,用啥写啥,不要过度设计,不允许直接将Provider暴露出去 */ object CallerHmiManager : CallerBase() { - private val waringProviderApi: IMoGoWaringProvider? - get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI).navigation() as IMoGoWaringProvider + private val waringProviderApi: IMoGoWaringProvider + get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI) + .navigation() as IMoGoWaringProvider; /** * 隐藏 脉速表 * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE */ fun setSpeedChartViewVisibility(visibility: Int) { - waringProviderApi?.setSpeedChartViewVisibility(visibility) + waringProviderApi.setSpeedChartViewVisibility(visibility) } /** @@ -32,7 +33,7 @@ object CallerHmiManager : CallerBase() { * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE */ fun setAutopilotStatusViewVisibility(visibility: Int) { - waringProviderApi?.setAutopilotStatusViewVisibility(visibility) + waringProviderApi.setAutopilotStatusViewVisibility(visibility) } /** @@ -40,7 +41,7 @@ object CallerHmiManager : CallerBase() { * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE */ fun setPerspectiveSwitchViewVisibility(visibility: Int) { - waringProviderApi?.setPerspectiveSwitchViewVisibility(visibility) + waringProviderApi.setPerspectiveSwitchViewVisibility(visibility) } /** @@ -48,7 +49,7 @@ object CallerHmiManager : CallerBase() { * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE */ fun setCheckStatusViewVisibility(visibility: Int) { - waringProviderApi?.setCheckStatusViewVisibility(visibility) + waringProviderApi.setCheckStatusViewVisibility(visibility) } /** @@ -66,7 +67,7 @@ object CallerHmiManager : CallerBase() { tag: String?, listenerIMoGo: IMoGoWarningStatusListener? ) { - waringProviderApi?.showWarningV2X(v2xType, alertContent, ttsContent, tag, listenerIMoGo) + waringProviderApi.showWarningV2X(v2xType, alertContent, ttsContent, tag, listenerIMoGo) } /** @@ -74,7 +75,7 @@ object CallerHmiManager : CallerBase() { * @param tag 弹窗标识 */ fun disableWarningV2X(tag: String?) { - waringProviderApi?.disableWarningV2X(tag) + waringProviderApi.disableWarningV2X(tag) } /** @@ -83,35 +84,42 @@ object CallerHmiManager : CallerBase() { * @param checkLightId 0-都是默认,1-红,2-黄,3-绿 */ fun showWarningTrafficLight(checkLightId: Int) { - waringProviderApi?.showWarningTrafficLight(checkLightId) + waringProviderApi.showWarningTrafficLight(checkLightId) } /** * 关闭红绿灯预警 */ fun disableWarningTrafficLight() { - waringProviderApi?.disableWarningTrafficLight() + waringProviderApi.disableWarningTrafficLight() + } + + /** + * 红绿灯是否展示 + */ + fun isWarningTrafficLightShow(): Boolean { + return waringProviderApi.isWarningTrafficLightShow() } /** * 修改红灯倒计时 */ fun changeCountdownRed(redNum: Int) { - waringProviderApi?.changeCountdownRed(redNum) + waringProviderApi.changeCountdownRed(redNum) } /** * 修改黄灯倒计时 */ fun changeCountdownYellow(yellowNum: Int) { - waringProviderApi?.changeCountdownYellow(yellowNum) + waringProviderApi.changeCountdownYellow(yellowNum) } /** * 修改绿灯倒计时 */ fun changeCountdownGreen(greenNum: Int) { - waringProviderApi?.changeCountdownGreen(greenNum) + waringProviderApi.changeCountdownGreen(greenNum) } /** @@ -120,7 +128,7 @@ object CallerHmiManager : CallerBase() { * @param greenNum 绿灯倒计时 */ fun changeCountdownTrafficLightNum(readNum: Int, yellowNum: Int, greenNum: Int) { - waringProviderApi?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum) + waringProviderApi.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum) } /** @@ -129,14 +137,14 @@ object CallerHmiManager : CallerBase() { * @param limitingSpeed 限速速度 */ fun showLimitingVelocity(limitingSpeed: Int) { - waringProviderApi?.showLimitingVelocity(limitingSpeed) + waringProviderApi.showLimitingVelocity(limitingSpeed) } /** * 关闭限速预警 */ fun disableLimitingVelocity() { - waringProviderApi?.disableLimitingVelocity() + waringProviderApi.disableLimitingVelocity() } /** @@ -145,7 +153,7 @@ object CallerHmiManager : CallerBase() { * @see WarningDirectionEnum */ fun showWarning(direction: WarningDirectionEnum) { - waringProviderApi?.showWarning(direction) + waringProviderApi.showWarning(direction) } /** @@ -155,7 +163,7 @@ object CallerHmiManager : CallerBase() { * @param closeTime 倒计时 */ fun showWarning(direction: WarningDirectionEnum, closeTime: Long) { - waringProviderApi?.showWarning(direction, closeTime) + waringProviderApi.showWarning(direction, closeTime) } /** @@ -164,7 +172,7 @@ object CallerHmiManager : CallerBase() { * @param trafficStylePushData */ fun showTrafficBanner(trafficStylePushData: NoticeTrafficStylePushData?) { - waringProviderApi?.showNoticeForTrafficWithData(trafficStylePushData) + waringProviderApi.showNoticeForTrafficWithData(trafficStylePushData) } /** @@ -172,21 +180,21 @@ object CallerHmiManager : CallerBase() { * */ fun showNoticeNormalData(noticeNormal: NoticeNormalData) { - waringProviderApi?.showNoticeNormalData(noticeNormal) + waringProviderApi.showNoticeNormalData(noticeNormal) } /** * 展示VIP标识 */ fun vipIdentification(visible: Boolean) { - waringProviderApi?.vipIdentification(visible) + waringProviderApi.vipIdentification(visible) } fun startRoadCameraLive(flvUrl: String) { - waringProviderApi?.startRoadCameraLive(flvUrl) + waringProviderApi.startRoadCameraLive(flvUrl) } fun showNoSignalView() { - waringProviderApi?.showNoSignView() + waringProviderApi.showNoSignView() } } \ No newline at end of file diff --git a/modules/mogo-module-chat/src/main/java/com/mogo/chat/voice/IMVoiceClient.kt b/modules/mogo-module-chat/src/main/java/com/mogo/chat/voice/IMVoiceClient.kt index dccded0d47..79d1ee0d6c 100644 --- a/modules/mogo-module-chat/src/main/java/com/mogo/chat/voice/IMVoiceClient.kt +++ b/modules/mogo-module-chat/src/main/java/com/mogo/chat/voice/IMVoiceClient.kt @@ -16,7 +16,7 @@ object IMVoiceClient { private var intentRegister: IMogoIntentManager? = null private const val REQUEST_VOICE_CALL = "主人,有新的小伙伴找你聊天啦,你要接听吗?你可以说“接听”开启通话。或者说“挂断”结束通话" - private const val REQUEST_CLOUD_VOICE_CALL = "您有来自管理平台的语音电话,请接听!" + private const val REQUEST_CLOUD_VOICE_CALL = "云平台请求跟你进行语音通话" private val requestCallYArray: Array = arrayOf("接听") private val requestCallNArray: Array = arrayOf("挂断")