Merge branch 'dev_robotaxi-p-app_110_220304_1.1.0' into dev_robotaxi-d-app-module_260_220304_2.6.0
# Conflicts: # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt # core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt # core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt
This commit is contained in:
@@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
@@ -19,7 +20,7 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
object CallerHmiManager : CallerBase() {
|
||||
private val waringProviderApi
|
||||
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI)
|
||||
.navigation() as? IMoGoWaringProvider;
|
||||
.navigation() as? IMoGoWaringProvider;
|
||||
|
||||
/**
|
||||
* 隐藏 脉速表
|
||||
@@ -63,14 +64,14 @@ object CallerHmiManager : CallerBase() {
|
||||
/**
|
||||
* 控制刹车功能
|
||||
*/
|
||||
fun setBrakeLightFunction (isOpen: Boolean) {
|
||||
fun setBrakeLightFunction(isOpen: Boolean) {
|
||||
waringProviderApi?.setBrakeLightFunction(isOpen)
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关DebugView
|
||||
*/
|
||||
fun toggleDebugView(){
|
||||
fun toggleDebugView() {
|
||||
waringProviderApi?.toggleDebugView()
|
||||
}
|
||||
|
||||
@@ -259,16 +260,15 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param downloadVersion 下载版本
|
||||
* @param upgradeStatus 升级状态
|
||||
*/
|
||||
fun showAdUpgradeStatus(upgradeMode : Int, downloadStatus : Int,currentProgress : Int,totalProgress : Int
|
||||
,downloadVersion : String,upgradeStatus : Int){
|
||||
waringProviderApi?.showAdUpgradeStatus(upgradeMode,downloadStatus, currentProgress, totalProgress, downloadVersion, upgradeStatus)
|
||||
fun showAdUpgradeStatus(upgradeMode: Int, downloadStatus: Int, currentProgress: Int, totalProgress: Int, downloadVersion: String, upgradeStatus: Int) {
|
||||
waringProviderApi?.showAdUpgradeStatus(upgradeMode, downloadStatus, currentProgress, totalProgress, downloadVersion, upgradeStatus)
|
||||
}
|
||||
|
||||
/**
|
||||
*注册工控机升级提示圆点View的回调
|
||||
* @param 提示圆点View
|
||||
*/
|
||||
fun registerUpgradeTipsCallback(tipsView:() -> View){
|
||||
fun registerUpgradeTipsCallback(tipsView: () -> View) {
|
||||
waringProviderApi?.registerUpgradeTipsCallback(tipsView)
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param code
|
||||
* @param msg
|
||||
*/
|
||||
fun showDockerRebootResult(code: Int,msg: String){
|
||||
fun showDockerRebootResult(code: Int, msg: String) {
|
||||
waringProviderApi?.showDockerRebootResult(code, msg)
|
||||
}
|
||||
|
||||
@@ -287,4 +287,14 @@ object CallerHmiManager : CallerBase() {
|
||||
fun showBadCaseFloat(tag: String = "BadCaseFloat", floatView: View): (() -> Unit)? {
|
||||
return waringProviderApi?.showBadCaseFloat(tag, floatView)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置红绿灯代理View
|
||||
* @param view
|
||||
*/
|
||||
fun setProxyTrafficLightView(view: IViewTrafficLight) {
|
||||
waringProviderApi?.setProxyTrafficLightView(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.mogo.eagle.core.function.call.v2x
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* 限速信息监听
|
||||
*/
|
||||
object CallLimitingVelocityListenerManager {
|
||||
|
||||
private const val TAG = "CallLimitingVelocityListenerManager"
|
||||
|
||||
private val M_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap<String, LimitingVelocityListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
private var mCurrentLimitingVelocity = 0
|
||||
|
||||
/**
|
||||
* 添加监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun addListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: LimitingVelocityListener
|
||||
) {
|
||||
if (M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
listener.onLimitingVelocityChange(mCurrentLimitingVelocity)
|
||||
M_TRAFFIC_LIGHT_LISTENER[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
M_TRAFFIC_LIGHT_LISTENER.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun removeListener(@Nullable listener: LimitingVelocityListener) {
|
||||
if (!M_TRAFFIC_LIGHT_LISTENER.containsValue(listener)) {
|
||||
LogUtils.eTag(TAG, "listener:$listener not exists")
|
||||
return
|
||||
}
|
||||
M_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
if (it.value == listener) {
|
||||
M_TRAFFIC_LIGHT_LISTENER.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeOnLimitingVelocityChange(limitingVelocity: Int) {
|
||||
this.mCurrentLimitingVelocity = limitingVelocity
|
||||
M_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
val tag = it.key
|
||||
//LogUtils.dTag(TAG, "invokeOnLimitingVelocityChange tag is : $tag")
|
||||
val listener = it.value
|
||||
listener.onLimitingVelocityChange(limitingVelocity)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user