diff --git a/OCH/mogo-och-bus-passenger/build.gradle b/OCH/mogo-och-bus-passenger/build.gradle
index 0677d0aacd..8749b55ad1 100644
--- a/OCH/mogo-och-bus-passenger/build.gradle
+++ b/OCH/mogo-och-bus-passenger/build.gradle
@@ -53,18 +53,10 @@ dependencies {
implementation rootProject.ext.dependencies.amapnavi3dmap
implementation project(":OCH:mogo-och-common-module")
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
- implementation rootProject.ext.dependencies.mogoutils
- implementation rootProject.ext.dependencies.mogocommons
- implementation rootProject.ext.dependencies.mogo_core_data
- implementation rootProject.ext.dependencies.mogo_core_function_call
- implementation rootProject.ext.dependencies.mogo_core_function_hmi
+ implementation rootProject.ext.dependencies.mogo_core_function_v2x
}else {
implementation project(':foudations:mogo-aicloud-services-sdk')
- implementation project(":foudations:mogo-commons")
- implementation project(':core:mogo-core-data')
- implementation project(":core:mogo-core-utils")
- implementation project(':core:mogo-core-function-call')
- implementation project(':core:function-impl:mogo-core-function-hmi')
+ implementation project(':core:function-impl:mogo-core-function-v2x')
}
}
diff --git a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml
index 59714c2b32..564aa1e394 100644
--- a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml
+++ b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml
@@ -31,11 +31,29 @@
android:layout_width="@dimen/module_vip_width"
android:layout_height="@dimen/module_vip_height"
android:visibility="gone"
- app:marginStart="@dimen/dp_640"
- app:marginTop="@dimen/dp_80"
+ android:layout_marginStart="@dimen/dp_640"
+ android:layout_marginTop="@dimen/dp_80"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
+
+
+
+
+
+
+ android:layout_marginStart="@dimen/dp_640"
+ android:layout_marginTop="@dimen/dp_80"/>
+
+
+
+
+
+
+
+
+
+
+
+
(),
@@ -32,14 +26,6 @@ class OchNoopFragment : MvpFragment(),
override fun initViews() {
- //设置StatusBar初始状态
- CallerHmiViewControlListenerManager.updateStatusBarRightView(
- StatusBarView.TAG,
- FunctionBuildConfig.isDemoMode,
- "demoMode",
- DemoModeView(requireContext())
- )
-
viewShowDebugView.setOnLongClickListener {
ToggleDebugView.toggleDebugView.toggle(requireContext())
true
@@ -51,7 +37,7 @@ class OchNoopFragment : MvpFragment(),
viewDriverMsgBoxList.notifyData()
viewDriverMsgBoxBubble.visibility = View.GONE
viewDriverMsgBoxBubble.isShowData(false)
- CallerHmiManager.updateDriverMsgBoxTipView(false)
+ MsgBoxTipView.visibility = View.GONE
} else {
viewDriverMsgBoxList.visibility = View.GONE
viewDriverMsgBoxBubble.visibility = View.VISIBLE
@@ -64,7 +50,7 @@ class OchNoopFragment : MvpFragment(),
viewPassengerMsgBoxList.visibility = View.VISIBLE
viewPassengerMsgBoxBubble.visibility = View.GONE
viewPassengerMsgBoxBubble.isShowData(false)
- CallerHmiManager.updatePassengerMsgBoxTipView(false)
+ MsgBoxTipView.visibility = View.GONE
} else {
viewPassengerMsgBoxList.visibility = View.GONE
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
diff --git a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml
index 2638954937..fb1bec67f4 100644
--- a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml
+++ b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml
@@ -43,13 +43,14 @@
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-sweeper/build.gradle b/OCH/mogo-och-sweeper/build.gradle
index faa8d4934e..0a74593753 100644
--- a/OCH/mogo-och-sweeper/build.gradle
+++ b/OCH/mogo-och-sweeper/build.gradle
@@ -55,19 +55,6 @@ dependencies {
implementation project(":OCH:mogo-och-common-module")
implementation rootProject.ext.dependencies.androidxrecyclerview
- if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
- implementation rootProject.ext.dependencies.mogoutils
- implementation rootProject.ext.dependencies.mogocommons
- implementation rootProject.ext.dependencies.mogo_core_data
- implementation rootProject.ext.dependencies.mogo_core_function_call
- implementation rootProject.ext.dependencies.mogo_core_function_hmi
- }else {
- implementation project(":core:mogo-core-utils")
- implementation project(":foudations:mogo-commons")
- implementation project(':core:mogo-core-data')
- implementation project(':core:mogo-core-function-call')
- implementation project(':core:function-impl:mogo-core-function-hmi')
- }
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
\ No newline at end of file
diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.java
deleted file mode 100644
index b8831bae9f..0000000000
--- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.mogo.och.sweeper.view;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.LayoutInflater;
-import android.widget.TextView;
-
-import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity;
-import com.mogo.och.sweeper.R;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
-public class SweeperLimitingVelocityView extends IViewLimitingVelocity {
- private TextView limitingVelocity;
-
- public SweeperLimitingVelocityView(@Nullable Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
- public SweeperLimitingVelocityView(@Nullable Context context, @Nullable AttributeSet attrs) {
- this(context,attrs,0);
- initView(context);
- }
- @Override
- public void updateLimitingSpeed(int limitingSpeed, int limitSource) {
- super.updateLimitingSpeed(limitingSpeed, limitSource);
- limitingVelocity.setText(String.valueOf(limitingSpeed));
- }
- private void initView(@NonNull Context context) {
- LayoutInflater.from(context).inflate(R.layout.sweeper_limiting_speed, this);
- limitingVelocity = findViewById(R.id.tvLimitingVelocity);
- }
-}
diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt
new file mode 100644
index 0000000000..c4761b07e2
--- /dev/null
+++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt
@@ -0,0 +1,54 @@
+package com.mogo.och.sweeper.view
+
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import android.widget.LinearLayout
+import com.mogo.eagle.core.data.enums.DataSourceType
+import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
+import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
+import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
+import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
+import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
+import com.mogo.och.sweeper.R
+import kotlinx.android.synthetic.main.sweeper_limiting_speed.view.*
+
+class SweeperLimitingVelocityView(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) :
+ LinearLayout(context, attrs, defStyleAttr), ILimitingVelocityListener, IViewControlListener {
+
+ companion object {
+ private const val TAG = "SweeperLimitingVelocityView"
+ }
+
+ init {
+ LayoutInflater.from(context).inflate(R.layout.sweeper_limiting_speed, this)
+ }
+
+ override fun onAttachedToWindow() {
+ super.onAttachedToWindow()
+ CallerViewLimitingVelocityListenerManager.addListener(TAG, this)
+ CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
+ }
+
+ override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
+ if (limitingVelocity > 0) {
+ tvLimitingVelocity.visibility = View.VISIBLE
+ tvLimitingVelocity.text = "$limitingVelocity"
+ } else {
+ tvLimitingVelocity.visibility = View.GONE
+ }
+ }
+
+ override fun visible(v: Int) {
+ super.visible(v)
+ tvLimitingVelocity.visibility = v
+ }
+
+ override fun onDetachedFromWindow() {
+ super.onDetachedFromWindow()
+ CallerViewLimitingVelocityListenerManager.removeListener(TAG)
+ CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
+ }
+
+}
\ No newline at end of file
diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java
index 11aaf92603..23cc010b44 100644
--- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java
+++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java
@@ -10,15 +10,15 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
+import com.mogo.eagle.core.data.enums.DataSourceType;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener;
-import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener;
-import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
+import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager;
-import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager;
+import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager;
import com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
@@ -26,9 +26,6 @@ import com.mogo.och.sweeper.R;
import org.jetbrains.annotations.NotNull;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.constraintlayout.widget.ConstraintLayout;
import chassis.Chassis;
import chassis.VehicleStateOuterClass;
@@ -75,7 +72,7 @@ public class SweeperTrafficDataView extends ConstraintLayout
CallerChassisSteeringStateListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this);
//增加限速监听
- CallLimitingVelocityListenerManager.INSTANCE.addListener(TAG,limitingVelocityListener);
+ CallerLimitingVelocityListenerManager.INSTANCE.addListener(TAG,limitingVelocityListener);
}
@Override
@@ -85,7 +82,7 @@ public class SweeperTrafficDataView extends ConstraintLayout
CallerChassisLamplightListenerManager.INSTANCE.removeListener(TAG);
CallerChassisSteeringStateListenerManager.INSTANCE.removeListener(TAG);
CallerChassisGearStateListenerManager.INSTANCE.removeListener(TAG);
- CallLimitingVelocityListenerManager.INSTANCE.removeListener(limitingVelocityListener);
+ CallerLimitingVelocityListenerManager.INSTANCE.removeListener(limitingVelocityListener);
}
/**
@@ -146,10 +143,10 @@ public class SweeperTrafficDataView extends ConstraintLayout
/**
* 限速监听
*/
- private final LimitingVelocityListener limitingVelocityListener = new LimitingVelocityListener(){
+ private final ILimitingVelocityListener limitingVelocityListener = new ILimitingVelocityListener(){
@Override
- public void onLimitingVelocityChange(int limitingVelocity) {
+ public void onLimitingVelocityChange(int limitingVelocity, DataSourceType sourceType) {
//设置限速
sweeperLimitingVelocity.updateLimitingSpeed(limitingVelocity, 0);
}
diff --git a/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml b/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml
index aa7a2a60ad..c4c85c96b3 100644
--- a/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml
+++ b/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml
@@ -21,6 +21,57 @@
android:layout_height="match_parent" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
() {
}
override fun dependenciesByName(): List {
- return listOf("com.mogo.launcher.stageone.ARouterStartUp", "com.mogo.launcher.stageone.ThreadOptStartup")
+ return listOf("com.mogo.launcher.stageone.ARouterStartUp","com.mogo.launcher.stageone.ConfigStartUp")
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt b/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt
index 2350e3440c..82ac67ce34 100644
--- a/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt
+++ b/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt
@@ -105,13 +105,8 @@ class ConfigStartUp : AndroidStartup() {
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
- //是否显示 限速UI
- HmiBuildConfig.isShowLimitingVelocityView = false
//白天模式
FunctionBuildConfig.skinMode = 1
- } else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
- //是否显示 限速UI
- HmiBuildConfig.isShowLimitingVelocityView = false
}
}
@@ -154,7 +149,4 @@ class ConfigStartUp : AndroidStartup() {
}
- override fun dependenciesByName(): List {
- return listOf("com.mogo.launcher.stageone.ThreadOptStartup")
- }
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java
index c3e3ffedb3..385cfb841e 100644
--- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java
+++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java
@@ -1,6 +1,5 @@
package com.mogo.eagle.function.biz.v2x.speedlimit;
-import static com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView;
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW;
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I;
@@ -8,9 +7,8 @@ import androidx.annotation.Nullable;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
-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.v2x.CallLimitingVelocityListenerManager;
+import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.zhjt.service_biz.BizConfig;
@@ -66,7 +64,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
UiThreadHandler.post(() -> {
if (speedLimit > 0) {
// CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit, 1);
- CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit);
+ CallerLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit);
}
});
diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt
index c236c2ed0e..47e491ac75 100644
--- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt
+++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt
@@ -1,20 +1,19 @@
package com.mogo.eagle.function.biz.v2x.speedlimit
import android.content.Context
-import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener
-import com.mogo.eagle.core.function.api.v2x.ObuLimitingSpeedListener
-import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
-import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
-import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
-import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager
-import com.mogo.eagle.core.function.call.v2x.CallObuLimitingSpeedListenerManager
+import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
+import com.mogo.eagle.core.data.enums.DataSourceType
+import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
+import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
+import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
+import com.zhjt.service_biz.BizConfig
/**
* @author lixiaopeng
* @description 对多个限速进行调度(map,rsu ...)
* @since: 2023/1/12
*/
-class SpeedLimitDispatcher : LimitingVelocityListener, ObuLimitingSpeedListener {
+class SpeedLimitDispatcher : ILimitingVelocityListener {
companion object {
const val TAG = "SpeedLimitDispatcher"
val INSTANCE: SpeedLimitDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
@@ -24,47 +23,42 @@ class SpeedLimitDispatcher : LimitingVelocityListener, ObuLimitingSpeedListener
private var mContext: Context? = null
- //是否有AI获取红绿灯灯态
+ //obu限速状态
private var hasObuStatus: Boolean = false
-
fun initLimit(context: Context) {
mContext = context
- //注册监听MAP的限速
- CallLimitingVelocityListenerManager.addListener(TAG, this)
- //注册监听OBU的限速
- CallObuLimitingSpeedListenerManager.addListener(TAG, this)
+ CallerLimitingVelocityListenerManager.addListener(TAG, this)
}
/**
* 地图限速数据
*/
- override fun onLimitingVelocityChange(limitingVelocity: Int) {
-// CallerHmiManager.disableLimitingVelocity()
- if (!hasObuStatus) {
- CallerHmiManager.showLimitingVelocity(limitingVelocity, 1)
- }
- }
-
- /**
- * obu限速
- */
- override fun onObuLimitingSpeedChange(limitingSpeed: Int) {
-// CallerHmiManager.disableLimitingVelocity()
- if (limitingSpeed > 0) {
- hasObuStatus = true
- CallerHmiManager.showLimitingVelocity(limitingSpeed, 2)
- } else {
- hasObuStatus = false
- CallerHmiManager.disableLimitingVelocity()
+ @BizConfig(FuncBizConfig.V2I, "", FuncBizConfig.BIZ_SLW)
+ override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
+ when (sourceType) { // obu 优先级高于 map,体现链路能力
+ DataSourceType.OBU -> {
+ hasObuStatus = limitingVelocity > 0
+ CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
+ limitingVelocity,
+ sourceType
+ )
+ return
+ }
+ DataSourceType.MAP -> {
+ if (!hasObuStatus) {
+ CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
+ limitingVelocity,
+ sourceType
+ )
+ }
+ }
+ else -> {}
}
}
fun destroy() {
- //取消注册监听AI云获取红绿灯状态
- CallerTrafficLightListenerManager.removeListener(TAG)
- //取消注册监听工控机感知红绿灯
- CallerAutopilotIdentifyListenerManager.removeListener(TAG)
+ CallerLimitingVelocityListenerManager.removeListener(TAG)
}
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt
index 8950dd989b..27b38679d6 100644
--- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt
+++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt
@@ -4,7 +4,7 @@ import android.content.Context
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
-import com.mogo.eagle.core.data.msgbox.DataSourceType
+import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
@@ -14,11 +14,13 @@ 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.obucombine.CallerObuDcCombineListenerManager
+import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.support.obu.constants.MogoObuConstants
import mogo.v2x.ObuWarningEvent
import mogo.v2x.ObuWarningEvent.*
+import kotlin.math.roundToInt
/**
@@ -441,14 +443,15 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*0.02*3.6))} --- data.speedMaxLimit = ${data.speedMaxLimit}")
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加 TODO
- CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*0.02*3.6)).toInt(), 2)
+ CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
+ (data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),DataSourceType.OBU)
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
}
MogoObuConstants.STATUS.DELETE -> { // 删除
- CallerHmiManager.disableLimitingVelocity()
+ CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1 ,DataSourceType.OBU)
}
}
}
diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt
index ed185ab548..c06aacde0b 100644
--- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt
+++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt
@@ -4,7 +4,6 @@ import android.content.Context
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.enums.*
-import com.mogo.eagle.core.data.msgbox.DataSourceType
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
@@ -18,8 +17,8 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooC
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager
-import com.mogo.eagle.core.function.call.v2x.CallObuLimitingSpeedListenerManager
-import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
+import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
+import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
@@ -34,6 +33,7 @@ import com.mogo.support.obu.model.advance.SpatLight
import com.mogo.support.obu.option.MogoObuCom
import com.mogo.support.obu.option.MogoObuOptions
import org.json.JSONObject
+import kotlin.math.roundToInt
/**
*
@@ -510,7 +510,9 @@ class MogoPrivateObuNewManager private constructor() {
//物体数据绘制
CallerLogger.d(
- "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}")
+ "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
+ "onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}"
+ )
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
// 更新数据,模型变色的时候是不是update,如果不是更新,可能导致模型不变色,(add的时候,是否有level高的) TODO
@@ -550,7 +552,7 @@ class MogoPrivateObuNewManager private constructor() {
//删除弱势交通元素
CallerMapUIServiceManager.getMarkerService()
?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString())
- }
+ }
}
//预警status
@@ -627,347 +629,421 @@ class MogoPrivateObuNewManager private constructor() {
*/
override fun onMogoObuMapMath(data: MogoObuMapMathData?) {
super.onMogoObuMapMath(data)
-// if (isShowObuLimitSpeedView) {
- if (data != null) {
- CallerLogger.d(
- "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
- "onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit * 3.6))}"
- )
- when (data.status) {
- MogoObuConstants.STATUS.ADD -> { // 添加
- UiThreadHandler.post {
- if (data.speedMaxLimit > 0) {
-// CallerHmiManager.showLimitingVelocity(
-// Math.round((data.speedMaxLimit * 3.6)).toInt(), 2)
- CallObuLimitingSpeedListenerManager.invokeOnObuLimitingSpeedChange(Math.round((data.speedMaxLimit * 3.6)).toInt())
- }
- }
- }
-
- MogoObuConstants.STATUS.UPDATE -> { // 更新
- }
-
- MogoObuConstants.STATUS.DELETE -> { // 删除
- UiThreadHandler.post {
-// CallerHmiManager.disableLimitingVelocity()
- CallObuLimitingSpeedListenerManager.invokeOnObuLimitingSpeedChange(-1)
+ if (data != null) {
+ CallerLogger.d(
+ "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
+ "onMogoObuMapMath = ${data.status} --speedMaxLimit = ${(data.speedMaxLimit * 3.6).roundToInt()}"
+ )
+ when (data.status) {
+ MogoObuConstants.STATUS.ADD -> { // 添加
+ UiThreadHandler.post {
+ if (data.speedMaxLimit > 0) {
+ CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
+ (data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU
+ )
}
}
}
+
+ MogoObuConstants.STATUS.UPDATE -> { // 更新
+ }
+
+ MogoObuConstants.STATUS.DELETE -> { // 删除
+ UiThreadHandler.post {
+ CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1,DataSourceType.OBU)
+ }
+ }
}
-// }
+ }
}
}
}
- /**
- * 获取消息的方位 车辆相关
- */
- private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
+/**
+ * 获取消息的方位 车辆相关
+ */
+private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
// CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification")
- return when (targetClassification) {
- MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
- MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
+ return when (targetClassification) {
+ MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
+ MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
- MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方
+ MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方
- MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方
+ MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方
- MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方
+ MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方
- MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT,
- MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT
- -> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方
+ MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT,
+ MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT
+ -> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方
- MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT,
- MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT
- -> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方
+ MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT,
+ MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT
+ -> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方
- MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT,
- -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方
+ MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT,
+ -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方
- MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT,
- -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方
+ MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT,
+ -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方
- MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知
- else -> WarningDirectionEnum.ALERT_WARNING_ALL
- }
+ MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知
+ else -> WarningDirectionEnum.ALERT_WARNING_ALL
}
+}
- /**
- * 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示
- *
- * @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截
- *
- * @see com.mogo.module.common.enums.EventTypeEnum
- */
- private fun handleSdkObu(
- appId: String,
- direction: WarningDirectionEnum,
- status: Int,
- level: Int,
- info: MogoObuRvWarningData
- ) {
- // 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
- var alertContent: String = ""
- var ttsContent: String = ""
- var changeVisualAngle = false
- when (appId) {
- //交叉路口碰撞预警
- MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
- alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
- ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
- }
+/**
+ * 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示
+ *
+ * @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截
+ *
+ * @see com.mogo.module.common.enums.EventTypeEnum
+ */
+private fun handleSdkObu(
+ appId: String,
+ direction: WarningDirectionEnum,
+ status: Int,
+ level: Int,
+ info: MogoObuRvWarningData
+) {
+ // 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
+ var alertContent: String = ""
+ var ttsContent: String = ""
+ var changeVisualAngle = false
+ when (appId) {
+ //交叉路口碰撞预警
+ MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
+ }
- //交叉路口碰撞预警
- MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> {
- alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
- ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
- }
+ //交叉路口碰撞预警
+ MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> {
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
+ }
- //左转辅助预警
- MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> {
- alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
- ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
- }
+ //左转辅助预警
+ MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> {
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
+ }
- //盲区预警
- MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> {
- ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
- alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
- if (
- direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
- direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
- direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
- ) { //左后
- changeVisualAngle = true
- ttsContent = String.format(ttsContent, "左")
- alertContent = String.format(alertContent, "左")
- } else if (
- direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
- direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
- direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
- ) { //右后
- changeVisualAngle = true
- ttsContent = String.format(ttsContent, "右")
- alertContent = String.format(alertContent, "右")
- }
+ //盲区预警
+ MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> {
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
+ if (
+ direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
+ direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
+ direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
+ ) { //左后
+ changeVisualAngle = true
+ ttsContent = String.format(ttsContent, "左")
+ alertContent = String.format(alertContent, "左")
+ } else if (
+ direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
+ direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
+ direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
+ ) { //右后
+ changeVisualAngle = true
+ ttsContent = String.format(ttsContent, "右")
+ alertContent = String.format(alertContent, "右")
}
+ }
- // 变道预警,注意左后车辆/注意右后车辆
- MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> {
- alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
- ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
- if (
- direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
- direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
- direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
- ) {
- ttsContent = String.format(ttsContent, "左")
- alertContent = String.format(alertContent, "左")
- } else if (
- direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
- direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
- direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
- ) {
- ttsContent = String.format(ttsContent, "右")
- alertContent = String.format(alertContent, "右")
- }
+ // 变道预警,注意左后车辆/注意右后车辆
+ MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> {
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
+ if (
+ direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
+ direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
+ direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
+ ) {
+ ttsContent = String.format(ttsContent, "左")
+ alertContent = String.format(alertContent, "左")
+ } else if (
+ direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
+ direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
+ direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
+ ) {
+ ttsContent = String.format(ttsContent, "右")
+ alertContent = String.format(alertContent, "右")
}
+ }
- //逆向超车预警
- MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> {
- alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
- ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
- }
+ //逆向超车预警
+ MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> {
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
+ }
- //紧急制动预警
- MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> {
- alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
- ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
- }
+ //紧急制动预警
+ MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> {
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
+ }
- //异常车辆提醒
- MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> {
- alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
- ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
- alertContent = String.format(alertContent, direction.desc)
- ttsContent = String.format(ttsContent, direction.desc)
- }
+ //异常车辆提醒
+ MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> {
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
+ alertContent = String.format(alertContent, direction.desc)
+ ttsContent = String.format(ttsContent, direction.desc)
+ }
- //车辆失控预警
- MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> {
- alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
- ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
- alertContent = String.format(alertContent, direction.desc)
- ttsContent = String.format(ttsContent, direction.desc)
- }
- //车辆失控预警
- MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> {
- alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
- ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
- }
+ //车辆失控预警
+ MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> {
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
+ alertContent = String.format(alertContent, direction.desc)
+ ttsContent = String.format(ttsContent, direction.desc)
+ }
+ //车辆失控预警
+ MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> {
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
+ }
- // 这里处理固定的提示信息,包括了<紧急车辆提醒>
- else -> { //TODO
+ // 这里处理固定的提示信息,包括了<紧急车辆提醒>
+ else -> { //TODO
// ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
// alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
- }
- }
-
- when (status) {
- // 添加,更新 add的时候,可能级别是2,
- MogoObuConstants.STATUS.ADD,
- MogoObuConstants.STATUS.UPDATE -> {
- CallerLogger.d(
- "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
- "new handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
- )
- if (level == 2 || level == 3) {
- //不显示弹框,其它保留
- CallerMsgBoxManager.saveMsgBox(
- MsgBoxBean(
- MsgBoxType.V2X,
- V2XMsg(
- appId,
- alertContent,
- ttsContent
- )
- ).apply {
- sourceType = DataSourceType.OBU
- }
- )
- CallerHmiManager.warningV2X(
- appId,
- alertContent,
- ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
- (appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
- object : IMoGoWarningStatusListener {
- override fun onShow() {
- super.onShow()
- if (changeVisualAngle) {
- CallerVisualAngleManager.changeVisualAngle(TooClose)
- }
- }
-
- override fun onDismiss() {
- // 关闭警告红边
- CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
- if (changeVisualAngle) {
- CallerVisualAngleManager.changeVisualAngle(Default())
- }
- }
- },
- true,
- 5000L
- )
- //显示警告红边
- CallerHmiManager.showWarning(direction)
- }
- //更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了
- TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
- CallerMapUIServiceManager.getMarkerService()
- ?.updateITrafficThreatLevelInfo(it)
- }
- }
- // 删除
- MogoObuConstants.STATUS.DELETE -> {
- // 关闭警告红边
- CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
- // 移除顶部弹窗
- // CallerHmiManager.disableWarningV2X((appId + direction.direction))
- //更新周边车辆进行预警颜色变换,车辆实时移动和变色
- TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
- it.threatLevel = 0x01
- CallerMapUIServiceManager.getMarkerService()
- ?.updateITrafficThreatLevelInfo(it)
- }
- }
}
}
- /**
- * 处理红绿灯
- */
- private fun handlerTrafficLight(appId: Int, status: Int, lights: List) {
- CallerLogger.d(
- "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
- "handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId"
- )
- when (status) {
- // 添加
- MogoObuConstants.STATUS.ADD,
- MogoObuConstants.STATUS.UPDATE
- -> {
- if (lights != null && lights.isNotEmpty()) {
- changeTrafficLightStatus(appId, lights)
- }
+ when (status) {
+ // 添加,更新 add的时候,可能级别是2,
+ MogoObuConstants.STATUS.ADD,
+ MogoObuConstants.STATUS.UPDATE -> {
+ CallerLogger.d(
+ "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
+ "new handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
+ )
+ if (level == 2 || level == 3) {
+ //不显示弹框,其它保留
+ CallerMsgBoxManager.saveMsgBox(
+ MsgBoxBean(
+ MsgBoxType.V2X,
+ V2XMsg(
+ appId,
+ alertContent,
+ ttsContent
+ )
+ ).apply {
+ sourceType = DataSourceType.OBU
+ }
+ )
+ CallerHmiManager.warningV2X(
+ appId,
+ alertContent,
+ ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
+ (appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
+ object : IMoGoWarningStatusListener {
+ override fun onShow() {
+ super.onShow()
+ if (changeVisualAngle) {
+ CallerVisualAngleManager.changeVisualAngle(TooClose)
+ }
+ }
+
+ override fun onDismiss() {
+ // 关闭警告红边
+ CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
+ if (changeVisualAngle) {
+ CallerVisualAngleManager.changeVisualAngle(Default())
+ }
+ }
+ },
+ true,
+ 5000L
+ )
+ //显示警告红边
+ CallerHmiManager.showWarning(direction)
}
- // 删除
- MogoObuConstants.STATUS.DELETE -> {
- // 移除顶部弹窗
- CallerHmiManager.disableWarningTrafficLight()
- CallerHmiManager.disableWarningV2X(appId.toString())
- isShowGreenWave = false
- isShowRunRedLight = false
- isYellowLight = false
+ //更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了
+ TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
+ CallerMapUIServiceManager.getMarkerService()
+ ?.updateITrafficThreatLevelInfo(it)
+ }
+ }
+ // 删除
+ MogoObuConstants.STATUS.DELETE -> {
+ // 关闭警告红边
+ CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
+ // 移除顶部弹窗
+ // CallerHmiManager.disableWarningV2X((appId + direction.direction))
+ //更新周边车辆进行预警颜色变换,车辆实时移动和变色
+ TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
+ it.threatLevel = 0x01
+ CallerMapUIServiceManager.getMarkerService()
+ ?.updateITrafficThreatLevelInfo(it)
+ }
+ }
+ }
+}
+
+/**
+ * 处理红绿灯
+ */
+private fun handlerTrafficLight(appId: Int, status: Int, lights: List) {
+ CallerLogger.d(
+ "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
+ "handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId"
+ )
+ when (status) {
+ // 添加
+ MogoObuConstants.STATUS.ADD,
+ MogoObuConstants.STATUS.UPDATE
+ -> {
+ if (lights != null && lights.isNotEmpty()) {
+ changeTrafficLightStatus(appId, lights)
+ }
+ }
+ // 删除
+ MogoObuConstants.STATUS.DELETE -> {
+ // 移除顶部弹窗
+ CallerHmiManager.disableWarningTrafficLight()
+ CallerHmiManager.disableWarningV2X(appId.toString())
+ isShowGreenWave = false
+ isShowRunRedLight = false
+ isYellowLight = false
// lightCountDownRed = 1
// lightCountDownGreen = 1
// lightCountDownYellow = 1
- }
}
}
+}
- private var isRedLight = false
- private var isGreenLight = false
- private var isYellowLight = false
- private var isShowGreenWave = false
- private var isShowRunRedLight = false
+private var isRedLight = false
+private var isGreenLight = false
+private var isYellowLight = false
+private var isShowGreenWave = false
+private var isShowRunRedLight = false
// private var lightCountDownRed : Int = 1
// private var lightCountDownGreen : Int = 1
// private var lightCountDownYellow : Int = 1
- /**
- * 修改红绿灯
- */
- @Synchronized
- private fun changeTrafficLightStatus(
- appId: Int,
- lights: List
- ) {
- var ttsContent = ""
- var alertContent = ""
- //这里需要根据真实数据确定 index 取值方式
- val currentLight = lights[0]
- CallerLogger.d(
- "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
- "changeTrafficLightStatus currentLight = $currentLight ----currentLight.light = ${currentLight.light} ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId --countDown = ${currentLight.countDown.toInt()}"
- )
- // 闯红灯预警,绿波通行和闯红灯是互斥的
- when (appId) {
- 0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效
+/**
+ * 修改红绿灯
+ */
+@Synchronized
+private fun changeTrafficLightStatus(
+ appId: Int,
+ lights: List
+) {
+ var ttsContent = ""
+ var alertContent = ""
+ //这里需要根据真实数据确定 index 取值方式
+ val currentLight = lights[0]
+ CallerLogger.d(
+ "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
+ "changeTrafficLightStatus currentLight = $currentLight ----currentLight.light = ${currentLight.light} ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId --countDown = ${currentLight.countDown.toInt()}"
+ )
+ // 闯红灯预警,绿波通行和闯红灯是互斥的
+ when (appId) {
+ 0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效
+ }
+ 1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
+ if (!isShowRunRedLight) {
+ isShowRunRedLight = true
+ CallerHmiManager.disableWarningV2X(1667.toString())
+ CallerLogger.d(
+ "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
+ "changeTrafficLightStatus 闯红灯 --------> "
+ )
+ ttsContent =
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
+ alertContent =
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
+ CallerMsgBoxManager.saveMsgBox(
+ MsgBoxBean(
+ MsgBoxType.V2X,
+ V2XMsg(
+ EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
+ alertContent,
+ ttsContent
+ )
+ ).apply {
+ sourceType = DataSourceType.OBU
+ }
+ )
+
+ CallerHmiManager.warningV2X(
+ EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
+ alertContent,
+ ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
+ EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
+ null,
+ true,
+ 5000L
+ )
}
- 1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
- if (!isShowRunRedLight) {
- isShowRunRedLight = true
- CallerHmiManager.disableWarningV2X(1667.toString())
- CallerLogger.d(
- "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
- "changeTrafficLightStatus 闯红灯 --------> "
+ }
+
+ 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候
+ if (!isShowGreenWave) {
+ isShowGreenWave = true
+ CallerHmiManager.disableWarningV2X(1666.toString())
+
+ var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6)
+ var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6)
+ if (minSpeedTemp == maxSpeedTemp) {
+ minSpeedTemp -= 5
+ }
+
+ val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp"
+ val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp"
+
+// val adviceSpeed =
+// "${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
+// val adviceSpeedTts =
+// "${Math.round(currentLight.suggestMinSpeed*3.6)} 到 ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
+
+ ttsContent =
+ String.format(
+ EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
+ adviceSpeedTts
)
- ttsContent =
- EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
- alertContent =
- EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
+ alertContent =
+ String.format(
+ EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
+ adviceSpeed
+ )
+
+ val maxSpeed = currentLight.suggestMaxSpeed
+ if (maxSpeed > 0) {
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
- EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
+ EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent
)
@@ -977,118 +1053,61 @@ class MogoPrivateObuNewManager private constructor() {
)
CallerHmiManager.warningV2X(
- EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
+ EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
- EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
+ appId.toString(),
null,
true,
5000L
)
}
}
-
- 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候
- if (!isShowGreenWave) {
- isShowGreenWave = true
- CallerHmiManager.disableWarningV2X(1666.toString())
-
- var minSpeedTemp = Math.round(currentLight.suggestMinSpeed*3.6)
- var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed*3.6)
- if (minSpeedTemp == maxSpeedTemp) {
- minSpeedTemp -= 5
- }
-
- val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp"
- val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp"
-
-// val adviceSpeed =
-// "${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
-// val adviceSpeedTts =
-// "${Math.round(currentLight.suggestMinSpeed*3.6)} 到 ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
-
- ttsContent =
- String.format(
- EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
- adviceSpeedTts
- )
- alertContent =
- String.format(
- EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
- adviceSpeed
- )
-
- val maxSpeed = currentLight.suggestMaxSpeed
- if (maxSpeed > 0) {
- CallerMsgBoxManager.saveMsgBox(
- MsgBoxBean(
- MsgBoxType.V2X,
- V2XMsg(
- EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
- alertContent,
- ttsContent
- )
- ).apply {
- sourceType = DataSourceType.OBU
- }
- )
-
- CallerHmiManager.warningV2X(
- EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
- alertContent,
- ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
- appId.toString(),
- null,
- true,
- 5000L
- )
- }
- }
- }
- }
-
- when (currentLight.light) {
- // 灯光不可用
- 0 -> {
- CallerObuTrafficLightListenerManager.invokeObuTrafficLight(0)
- }
- // 红灯
- 2, 3 -> {
- if (!isRedLight) {
- CallerHmiManager.disableWarningV2X(appId.toString())
- isRedLight = true
- }
- isGreenLight = false
- isYellowLight = false
- CallerObuTrafficLightListenerManager.invokeObuTrafficLight(1)
- val red = currentLight.countDown.toInt()
- CallerHmiManager.changeCountdownRed(red)
- }
-
- // 绿灯
- 4, 5, 6 -> {
- if (!isGreenLight) {
- CallerHmiManager.disableWarningV2X(appId.toString())
- isGreenLight = true
- }
- isRedLight = false
- isYellowLight = false
- CallerObuTrafficLightListenerManager.invokeObuTrafficLight(3)
- val green = currentLight.countDown.toInt()
- CallerHmiManager.changeCountdownGreen(green)
- }
-
- // 黄灯
- 7, 8 -> {
- if (!isYellowLight) {
- isYellowLight = true
- }
- isRedLight = false
- isGreenLight = false
- CallerHmiManager.disableWarningV2X(appId.toString())
- CallerObuTrafficLightListenerManager.invokeObuTrafficLight(2)
- val yellow = currentLight.countDown.toInt()
- CallerHmiManager.changeCountdownYellow(yellow)
- }
}
}
+
+ when (currentLight.light) {
+ // 灯光不可用
+ 0 -> {
+ CallerObuTrafficLightListenerManager.invokeObuTrafficLight(0)
+ }
+ // 红灯
+ 2, 3 -> {
+ if (!isRedLight) {
+ CallerHmiManager.disableWarningV2X(appId.toString())
+ isRedLight = true
+ }
+ isGreenLight = false
+ isYellowLight = false
+ CallerObuTrafficLightListenerManager.invokeObuTrafficLight(1)
+ val red = currentLight.countDown.toInt()
+ CallerHmiManager.changeCountdownRed(red)
+ }
+
+ // 绿灯
+ 4, 5, 6 -> {
+ if (!isGreenLight) {
+ CallerHmiManager.disableWarningV2X(appId.toString())
+ isGreenLight = true
+ }
+ isRedLight = false
+ isYellowLight = false
+ CallerObuTrafficLightListenerManager.invokeObuTrafficLight(3)
+ val green = currentLight.countDown.toInt()
+ CallerHmiManager.changeCountdownGreen(green)
+ }
+
+ // 黄灯
+ 7, 8 -> {
+ if (!isYellowLight) {
+ isYellowLight = true
+ }
+ isRedLight = false
+ isGreenLight = false
+ CallerHmiManager.disableWarningV2X(appId.toString())
+ CallerObuTrafficLightListenerManager.invokeObuTrafficLight(2)
+ val yellow = currentLight.countDown.toInt()
+ CallerHmiManager.changeCountdownYellow(yellow)
+ }
+ }
+}
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt
index 1395d3578f..5c2a231c3d 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt
@@ -3,7 +3,11 @@ package com.mogo.eagle.core.function.hmi.receiver
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
-import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
+import android.view.View
+import com.mogo.eagle.core.data.enums.DataSourceType
+import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
+import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
+import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
import com.mogo.eagle.core.function.hmi.WaringConst
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
@@ -57,13 +61,13 @@ class V2XLimitingVelocityBroadcastReceiver : BroadcastReceiver() {
* @param limitingVelocitySpeed 限速速度
*/
private fun dispatchShowWaring(limitingVelocitySpeed: Int) {
- CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed, 1)
+ CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(limitingVelocitySpeed,DataSourceType.MAP)
}
/**
* 关闭限速标志
*/
private fun dispatchCloseWaring() {
- CallerHmiManager.disableLimitingVelocity()
+ CallerHmiViewControlListenerManager.invokeVisible(LimitingVelocityView_TAG, View.GONE)
}
}
\ No newline at end of file
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 9f482ca275..8bd6b1baef 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
@@ -1,7 +1,6 @@
package com.mogo.eagle.core.function.hmi.ui
import android.content.Context
-import android.os.Bundle
import android.text.TextUtils
import android.util.Log
import android.view.View
@@ -31,13 +30,6 @@ import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.PerspectiveSwitchView_TAG
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.SpeedPanelView_TAG
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG
-import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
@@ -87,7 +79,7 @@ import java.util.concurrent.atomic.AtomicReference
class MoGoHmiFragment : MvpFragment(),
IMoGoHmiProvider,
IMoGoHmiViewProxy,
- MoGoHmiContract.View{
+ MoGoHmiContract.View {
companion object {
private const val TAG = "MoGoHmiFragment"
@@ -97,9 +89,6 @@ class MoGoHmiFragment : MvpFragment(),
// todo 需要统一数据源 红绿灯 View代理
private var mViewTrafficLight: IViewTrafficLight? = null
- // todo 需要统一数据源 限速 View代理
- private var mViewLimitingVelocity: IViewLimitingVelocity? = null
-
private val lastSpeakJob by lazy { AtomicReference() }
private var lastShowV2XJob: Job? = null
@@ -107,9 +96,6 @@ class MoGoHmiFragment : MvpFragment(),
override fun initViews() {
- //设置StatusBar初始状态
- CallerHmiViewControlListenerManager.updateStatusBarRightView(StatusBarView.TAG,FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(requireContext()))
-
//todo 新超,封装至消息盒子
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
@@ -170,12 +156,6 @@ class MoGoHmiFragment : MvpFragment(),
}
}
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
- //todo 确认使用方 taxi bus 乘客/司机
- setProxyLimitingSpeedView(viewLimitingVelocity)
- }
-
/** todo ----------------------------------------------**/
/**
* 设置 红绿灯 代理View
@@ -184,13 +164,6 @@ class MoGoHmiFragment : MvpFragment(),
mViewTrafficLight = view
}
- /**
- * 设置 限速 代理View
- */
- override fun setProxyLimitingSpeedView(view: IViewLimitingVelocity) {
- mViewLimitingVelocity = view
- }
-
/**
* ok
* 工控机重启返回结果
@@ -236,23 +209,38 @@ class MoGoHmiFragment : MvpFragment(),
}
override fun setStatusBarDarkOrLight(light: Boolean) {
- CallerHmiViewControlListenerManager.setStatusBarDarkOrLight(StatusBarView.TAG,light)
+ CallerHmiViewControlListenerManager.setStatusBarDarkOrLight(StatusBarView.TAG, light)
}
override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
- CallerHmiViewControlListenerManager.updateStatusBarRightView(StatusBarView.TAG,insert, tag, viewGroup)
+ CallerHmiViewControlListenerManager.updateStatusBarRightView(
+ StatusBarView.TAG,
+ insert,
+ tag,
+ viewGroup
+ )
}
override fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
- CallerHmiViewControlListenerManager.updateStatusBarLeftView(StatusBarView.TAG,insert, tag, viewGroup)
+ CallerHmiViewControlListenerManager.updateStatusBarLeftView(
+ StatusBarView.TAG,
+ insert,
+ tag,
+ viewGroup
+ )
}
override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
- CallerHmiViewControlListenerManager.updateStatusBarDownloadView(StatusBarView.TAG,insert, tag, progress)
+ CallerHmiViewControlListenerManager.updateStatusBarDownloadView(
+ StatusBarView.TAG,
+ insert,
+ tag,
+ progress
+ )
}
override fun updateMfStatus(tag: String, status: Boolean) {
- CallerHmiViewControlListenerManager.updateMfStatus(StatusBarView.TAG,tag, status)
+ CallerHmiViewControlListenerManager.updateMfStatus(StatusBarView.TAG, tag, status)
}
override fun getLayoutId(): Int {
@@ -271,30 +259,6 @@ class MoGoHmiFragment : MvpFragment(),
DisplayEffectsHelper.getInstance().display()
}
- override fun setTrafficLightVrVisibility(visibility: Int) {
- CallerHmiViewControlListenerManager.invokeVisible(TrafficLightView_TAG,visibility)
- }
-
- override fun setToolsViewVisibility(visibility: Int) {
- CallerHmiViewControlListenerManager.invokeVisible(ToolsView_TAG,visibility)
- }
-
- override fun setSpeedChartViewVisibility(visibility: Int) {
- CallerHmiViewControlListenerManager.invokeVisible(SpeedPanelView_TAG,visibility)
- }
-
- override fun setAutopilotStatusViewVisibility(visibility: Int) {
- CallerHmiViewControlListenerManager.invokeVisible(AutoPilotStatusView_TAG,visibility)
- }
-
- override fun setPerspectiveSwitchViewVisibility(visibility: Int) {
- CallerHmiViewControlListenerManager.invokeVisible(PerspectiveSwitchView_TAG,visibility)
- }
-
- override fun setCameraViewVisibility(visibility: Int) {
- CallerHmiViewControlListenerManager.invokeVisible(CameraView_TAG, visibility)
- }
-
/** todo----------------------------------------------- **/
/**
* 不展示顶部弹窗,其它保留
@@ -351,7 +315,7 @@ class MoGoHmiFragment : MvpFragment(),
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
val last = lastSpeakJob.get()
Log.d("CODE", "---- 0 ------: last: $last")
- if (last != null && !last.isCompleted) {
+ if (last != null && !last.isCompleted) {
Log.d("CODE", "---- 1 ------")
return
}
@@ -452,40 +416,6 @@ class MoGoHmiFragment : MvpFragment(),
mViewTrafficLight?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum)
}
- /**
- * 控制展示限速标志及内容
- */
- override fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) {
- // 控制 限速UI 展示
- if (HmiBuildConfig.isShowLimitingVelocityView) {
- if (limitingSpeed > 0) {
- mViewLimitingVelocity?.visibility = View.VISIBLE
- mViewLimitingVelocity?.updateLimitingSpeed(limitingSpeed, limitSpeedSource)
- tvLimitingSource?.visibility = View.VISIBLE
- if (limitSpeedSource == 1) {
- tvLimitingSource.text = "MAP"
- } else if (limitSpeedSource == 2) {
- tvLimitingSource.text = "RSU"
- }
- } else {
- mViewLimitingVelocity?.visibility = View.INVISIBLE
- mViewLimitingVelocity?.updateLimitingSpeed(0, limitSpeedSource)
- tvLimitingSource?.visibility = View.INVISIBLE
- }
- } else {
- disableLimitingVelocity()
- tvLimitingSource?.visibility = View.GONE
- }
- }
-
- /**
- * 控制关闭限速标志及内容
- */
- override fun disableLimitingVelocity() {
- mViewLimitingVelocity?.visibility = View.GONE
- mViewLimitingVelocity?.updateLimitingSpeed(0, 1)
- }
-
/**
* 展示指定方位上的红框预警
* @param direction
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 1674acdcb5..14e6d0cee2 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
@@ -1032,49 +1032,6 @@ internal class DebugSettingView @JvmOverloads constructor(
* 设置Hmi点击监听
*/
private fun setHmiCheckedChangeListener() {
- /**
- * 显示、隐藏迈速表
- */
- tbSpeedView.setOnCheckedChangeListener { _, isChecked ->
- if (!isChecked) {
- CallerHmiManager.setSpeedChartViewVisibility(View.VISIBLE)
- } else {
- CallerHmiManager.setSpeedChartViewVisibility(View.GONE)
- }
- }
-
- /**
- * 显示、隐藏“自动驾驶控制按钮”
- */
- tbAutopilotStatusView.setOnCheckedChangeListener { _, isChecked ->
- if (!isChecked) {
- CallerHmiManager.setAutopilotStatusViewVisibility(View.VISIBLE)
- } else {
- CallerHmiManager.setAutopilotStatusViewVisibility(View.GONE)
- }
- }
-
- /**
- * 显示、隐藏视角切换按钮
- */
- tbPerspectiveSwitchView.setOnCheckedChangeListener { _, isChecked ->
- if (!isChecked) {
- CallerHmiManager.setPerspectiveSwitchViewVisibility(View.VISIBLE)
- } else {
- CallerHmiManager.setPerspectiveSwitchViewVisibility(View.GONE)
- }
- }
-
- /**
- * 显示、隐藏工具箱
- */
- tbCheckStatusView.setOnCheckedChangeListener { _, isChecked ->
- if (!isChecked) {
- CallerHmiManager.setToolsViewVisibility(View.VISIBLE)
- } else {
- CallerHmiManager.setToolsViewVisibility(View.GONE)
- }
- }
/**
* 隐藏、显示小地图
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt
index e6afb2b7b2..0ae1263047 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
+import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
@@ -19,6 +20,7 @@ import com.mogo.eagle.core.utilcode.kotlin.currentPadding
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy
+import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.view_debug_setting.view.*
@@ -150,7 +152,7 @@ internal class SOPSettingView @JvmOverloads constructor(
HmiBuildConfig.isShowLimitingVelocityView = true
} else {
HmiBuildConfig.isShowLimitingVelocityView = false
- CallerHmiManager.disableLimitingVelocity()
+ CallerHmiViewControlListenerManager.invokeVisible(IViewControlListener.LimitingVelocityView_TAG,View.GONE)
}
}
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt
index 84400ca732..2e8b24e018 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt
@@ -2,14 +2,11 @@ package com.mogo.eagle.core.function.hmi.ui.tools
import android.content.Context
import android.util.AttributeSet
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG
-import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
class ToolsImageView(context: Context, attrs: AttributeSet?) :
- androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
+ androidx.appcompat.widget.AppCompatImageView(context, attrs) {
override fun onAttachedToWindow() {
super.onAttachedToWindow()
@@ -19,17 +16,6 @@ class ToolsImageView(context: Context, attrs: AttributeSet?) :
setOnClickListener{
toolsView.showToolsFloat(context)
}
-
- CallerHmiViewControlListenerManager.addListener(ToolsView_TAG, this)
}
- override fun visible(v: Int) {
- super.visible(v)
- visibility = v
- }
-
- override fun onDetachedFromWindow() {
- super.onDetachedFromWindow()
- CallerHmiViewControlListenerManager.removeListener(ToolsView_TAG)
- }
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt
index e6c453db80..2ff479a1c7 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt
@@ -8,14 +8,11 @@ import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
-import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
@@ -33,7 +30,7 @@ class AutoPilotStatusView constructor(
attrs: AttributeSet
) : ConstraintLayout(context, attrs),
View.OnClickListener,
- IMoGoAutopilotStatusListener, IViewControlListener {
+ IMoGoAutopilotStatusListener {
companion object {
const val TAG = "AutopilotStatusView"
@@ -57,17 +54,10 @@ class AutoPilotStatusView constructor(
setOnClickListener(this)
// 自动驾驶状态监听
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
- CallerHmiViewControlListenerManager.addListener(AutoPilotStatusView_TAG, this)
-
CallerLogger.d("$M_HMI$TAG", "autopilotStatus: $mAutopilotStatus")
setAutoPilotStatus(mAutopilotStatus)
}
- override fun visible(v: Int) {
- super.visible(v)
- visibility = v
- }
-
override fun onClick(v: View?) {
when (mAutopilotStatus) {
0 -> {// 不可自动驾驶,adas与工控机没有链接,或工控机异常
@@ -139,7 +129,6 @@ class AutoPilotStatusView constructor(
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerAutoPilotStatusListenerManager.removeListener(TAG)
- CallerHmiViewControlListenerManager.removeListener(AutoPilotStatusView_TAG)
}
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CameraView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CameraView.kt
index 70e5ae0f35..36337a284b 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CameraView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CameraView.kt
@@ -2,15 +2,12 @@ package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
-import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
class CameraView(context: Context, attrs: AttributeSet?) :
- androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
+ androidx.appcompat.widget.AppCompatImageView(context, attrs) {
override fun onAttachedToWindow() {
super.onAttachedToWindow()
@@ -28,16 +25,6 @@ class CameraView(context: Context, attrs: AttributeSet?) :
}
}
- CallerHmiViewControlListenerManager.addListener(CameraView_TAG, this)
}
- override fun visible(v: Int) {
- super.visible(v)
- visibility = v
- }
-
- override fun onDetachedFromWindow() {
- super.onDetachedFromWindow()
- CallerHmiViewControlListenerManager.removeListener(CameraView_TAG)
- }
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt
index c766f7a029..6df4d6b3c2 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt
@@ -3,7 +3,14 @@ package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
-import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
+import android.view.View
+import android.widget.LinearLayout
+import com.mogo.eagle.core.data.enums.DataSourceType
+import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
+import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
+import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
+import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
+import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
import com.mogo.eagle.core.function.hmi.R
import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
@@ -11,17 +18,48 @@ import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
* 限速控件
*/
class LimitingVelocityView @JvmOverloads constructor(
- context: Context,
- attrs: AttributeSet? = null,
- defStyleAttr: Int = 0
-) : IViewLimitingVelocity(context, attrs, defStyleAttr) {
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0
+) : LinearLayout(context, attrs, defStyleAttr), ILimitingVelocityListener, IViewControlListener {
+
+ companion object {
+ private const val TAG = "LimitingVelocityView"
+ }
init {
LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true)
}
- override fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) {
- super.updateLimitingSpeed(limitingSpeed, limitSource)
- tvLimitingVelocity.text = "$limitingSpeed"
+ override fun onAttachedToWindow() {
+ super.onAttachedToWindow()
+ CallerViewLimitingVelocityListenerManager.addListener(TAG, this)
+ CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
}
+
+ override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
+ if (limitingVelocity > 0) {
+ tvLimitingVelocity.visibility = View.VISIBLE
+ tvLimitingSource.visibility = View.VISIBLE
+ tvLimitingVelocity.text = "$limitingVelocity"
+ tvLimitingSource.text = sourceType.name
+ } else {
+ tvLimitingVelocity.visibility = View.GONE
+ tvLimitingSource.visibility = View.GONE
+ tvLimitingSource.text = ""
+ }
+ }
+
+ override fun visible(v: Int) {
+ super.visible(v)
+ tvLimitingVelocity.visibility = v
+ tvLimitingSource.visibility = v
+ }
+
+ override fun onDetachedFromWindow() {
+ super.onDetachedFromWindow()
+ CallerViewLimitingVelocityListenerManager.removeListener(TAG)
+ CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
+ }
+
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt
index 55e04f82ec..09cd83ed9a 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt
@@ -5,9 +5,6 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.PerspectiveSwitchView_TAG
-import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
import com.mogo.eagle.core.function.hmi.R
import com.mogo.map.uicontroller.VisualAngleMode
@@ -22,20 +19,13 @@ class PerspectiveSwitchView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
-) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener, IViewControlListener{
+) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener{
override fun onAttachedToWindow() {
super.onAttachedToWindow()
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
setBackgroundResource(R.drawable.module_switch_map_bg)
setOnClickListener(this)
-
- CallerHmiViewControlListenerManager.addListener(PerspectiveSwitchView_TAG,this)
- }
-
- override fun visible(v: Int) {
- super.visible(v)
- visibility = v
}
override fun onClick(v: View?) {
@@ -53,9 +43,4 @@ class PerspectiveSwitchView @JvmOverloads constructor(
}
}
- override fun onDetachedFromWindow() {
- super.onDetachedFromWindow()
- CallerHmiViewControlListenerManager.removeListener(PerspectiveSwitchView_TAG)
- }
-
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt
index 46dda6467e..17b6cd5978 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt
@@ -6,11 +6,7 @@ import android.util.AttributeSet
import android.view.Gravity
import android.widget.FrameLayout
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.SpeedPanelView_TAG
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
-import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
-import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
@@ -25,7 +21,7 @@ class SpeedPanelView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
-) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener,IViewControlListener {
+) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener {
companion object {
const val TAG = "SpeedPanelView"
@@ -58,8 +54,6 @@ class SpeedPanelView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
- // 注册view控制显示隐藏监听
- CallerHmiViewControlListenerManager.addListener(SpeedPanelView_TAG,this)
// 注册位置回调
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
// 开启定时查询速度
@@ -89,15 +83,9 @@ class SpeedPanelView @JvmOverloads constructor(
}
}
- override fun visible(v: Int) {
- super.visible(v)
- visibility = v
- }
-
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
// 解除注册
- CallerHmiViewControlListenerManager.removeListener(SpeedPanelView_TAG)
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
try {
timerTask?.cancel()
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/StatusBarView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/StatusBarView.kt
index 42079aa30b..3aad68006d 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/StatusBarView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/StatusBarView.kt
@@ -6,6 +6,7 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.LinearLayout
+import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.mofang.MfConstants
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
@@ -51,6 +52,7 @@ class StatusBarView @JvmOverloads constructor(
//将状态窗口中的状态移到状态栏上
CallerDevaToolsManager.showStatusBar(context, status_container)
+ updateStatusBarRightView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(this.context))
}
override fun onSkinModeChange(skinMode: Int) {
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/VipIdentificationView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/VipIdentificationView.kt
index d9dd3ee643..47054ca428 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/VipIdentificationView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/VipIdentificationView.kt
@@ -27,32 +27,14 @@ class VipIdentificationView : ConstraintLayout, IMoGoVipSetListener {
attributeSet,
defStyleAttr
) {
- init(attributeSet, defStyleAttr)
}
- private var marginStart: Float = 0.0f
- private var marginTop: Float = 0.0f
-
- private fun init(attrs: AttributeSet, defStyleAttr: Int) {
+ init {
LayoutInflater.from(context).inflate(R.layout.view_vip_identification, this, true)
- val a = context.obtainStyledAttributes(
- attrs,
- R.styleable.VipIdentificationView,
- defStyleAttr,
- 0
- )
- marginStart = a.getDimension(R.styleable.VipIdentificationView_marginStart, 0.0f)
- marginTop = a.getDimension(R.styleable.VipIdentificationView_marginTop, 0.0f)
- a.recycle()
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
- val lp = this.layoutParams as LayoutParams
- lp.marginStart = marginStart.toInt()
- lp.topMargin = marginTop.toInt()
- this.layoutParams = lp
- invalidate()
CallVipSetListenerManager.addListener(TAG, this)
}
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml
index b2dd4a6f0a..56b54cc6dd 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml
@@ -20,45 +20,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="72dp">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml
index d3969d4863..639cc50149 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml
@@ -1274,54 +1274,6 @@
app:layout_constraintLeft_toRightOf="@+id/tbChangeCurrentCarIcon"
app:layout_constraintTop_toTopOf="@id/tbChangeCurrentCarIcon" />
-
-
-
-
-
-
-
-
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml
index cb5e3610d1..7e72417466 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml
@@ -69,9 +69,4 @@
- @android:color/transparent
-
-
-
-
-
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt
index 711fde9e88..c67989c8b8 100644
--- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt
+++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt
@@ -19,7 +19,7 @@ import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
-import com.mogo.eagle.core.data.msgbox.DataSourceType
+import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt
new file mode 100644
index 0000000000..7cc8ddb8fa
--- /dev/null
+++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt
@@ -0,0 +1,11 @@
+package com.mogo.eagle.core.data.enums
+
+enum class DataSourceType(name: String) {
+ DEFAULT("defalut"),
+ OBU("OBU"),
+ MAP("MAP"),
+ TELEMATIC("TELEMATIC"),
+ AICLOUD("AI云"),
+ SUMMARY("汇总")// V2X事件汇总
+
+}
\ No newline at end of file
diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/DataSourceType.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/DataSourceType.kt
deleted file mode 100644
index af15d0b8a7..0000000000
--- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/DataSourceType.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.mogo.eagle.core.data.msgbox
-
-enum class DataSourceType {
- DEFAULT,
- OBU,
- TELEMATIC,
- AICLOUD,
- SUMMARY// V2X事件汇总
-}
\ No newline at end of file
diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt
index 9c370be85d..0626508331 100644
--- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt
+++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt
@@ -1,5 +1,7 @@
package com.mogo.eagle.core.data.msgbox
+import com.mogo.eagle.core.data.enums.DataSourceType
+
data class MsgBoxBean(val type: MsgBoxType, val bean: Any) {
var timestamp: Long = 0
var bean2Json: String = ""
diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/IMoGoHmiViewProxy.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/IMoGoHmiViewProxy.kt
index 7dd525ac24..7b760ac015 100644
--- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/IMoGoHmiViewProxy.kt
+++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/IMoGoHmiViewProxy.kt
@@ -1,7 +1,5 @@
package com.mogo.eagle.core.function.api.hmi
-import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
-import com.mogo.eagle.core.function.api.hmi.view.IViewNotification
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
/**
@@ -15,10 +13,4 @@ interface IMoGoHmiViewProxy {
*/
fun setProxyTrafficLightView(view: IViewTrafficLight)
- /**
- * 设置 限速 代理View
- * @param view
- */
- fun setProxyLimitingSpeedView(view: IViewLimitingVelocity)
-
}
\ No newline at end of file
diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewControlListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewControlListener.kt
index 4a1c67310f..2bdf8d3bce 100644
--- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewControlListener.kt
+++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewControlListener.kt
@@ -5,12 +5,8 @@ import android.view.ViewGroup
interface IViewControlListener {
companion object{
- const val SpeedPanelView_TAG = "SpeedPanelView_TAG"
- const val AutoPilotStatusView_TAG = "AutoPilotStatusView_TAG"
- const val PerspectiveSwitchView_TAG = "PerspectiveSwitchView_TAG"
- const val CameraView_TAG = "CameraView_TAG"
- const val ToolsView_TAG = "ToolsView_TAG"
const val TrafficLightView_TAG = "TrafficLightView_TAG"
+ const val LimitingVelocityView_TAG = "LimitingVelocityView_TAG"
}
/** --------- View --------- **/
diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt
deleted file mode 100644
index c1b5499a1d..0000000000
--- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.mogo.eagle.core.function.api.hmi.view
-
-import android.content.Context
-import android.util.AttributeSet
-import android.widget.LinearLayout
-
-/**
- * 定义限速View具备的接口
- */
-abstract class IViewLimitingVelocity(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) :
- LinearLayout(context, attrs, defStyleAttr) {
-
- /**
- * 更新限速数据
- * @param limitingSpeed 限速值,单位:km/h
- * @param limitSource 限速来源 1:MAP, 2:RSU
- */
- open fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) {}
-}
\ No newline at end of file
diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt
index 266eaa8fa6..928554ef5b 100644
--- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt
+++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt
@@ -1,6 +1,5 @@
package com.mogo.eagle.core.function.api.hmi.warning
-import android.view.View
import android.view.ViewGroup
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
@@ -22,38 +21,6 @@ interface IMoGoHmiProvider : IMoGoHmiViewProxy {
*/
fun displayEffects()
- /**
- * 隐藏 脉速表
- * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
- */
- fun setSpeedChartViewVisibility(visibility: Int)
-
- /**
- * 隐藏 红绿灯UI
- * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
- */
- fun setTrafficLightVrVisibility(visibility: Int)
-
- /**
- * 隐藏 自动驾驶触发 按钮
- * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
- */
- fun setAutopilotStatusViewVisibility(visibility: Int)
-
- /**
- * 隐藏 切换视角 按钮
- * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
- */
- fun setPerspectiveSwitchViewVisibility(visibility: Int)
-
- /**
- * 隐藏 工具箱 按钮
- * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
- */
- fun setToolsViewVisibility(visibility: Int)
-
- fun setCameraViewVisibility(visibility: Int)
-
/**
* 控制转向灯
*/
@@ -135,19 +102,6 @@ interface IMoGoHmiProvider : IMoGoHmiViewProxy {
*/
fun changeCountdownTrafficLightNum(readNum: Int, yellowNum: Int, greenNum: Int)
- /**
- * 展示限速预警
- *
- * @param limitingSpeed 限速速度
- * @param limitSpeedSource 限速来源 1:MAP, 2:RSU
- */
- fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int)
-
- /**
- * 关闭限速预警
- */
- fun disableLimitingVelocity()
-
/**
* 展示指定方位上的红框预警
* @param direction
diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ILimitingVelocityListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ILimitingVelocityListener.kt
new file mode 100644
index 0000000000..49bfecb6dd
--- /dev/null
+++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ILimitingVelocityListener.kt
@@ -0,0 +1,10 @@
+package com.mogo.eagle.core.function.api.v2x
+
+import com.mogo.eagle.core.data.enums.DataSourceType
+
+/**
+ * 限速信息回掉
+ */
+interface ILimitingVelocityListener {
+ fun onLimitingVelocityChange(limitingVelocity: Int,sourceType: DataSourceType)
+}
\ No newline at end of file
diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/LimitingVelocityListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/LimitingVelocityListener.kt
deleted file mode 100644
index 4df12373e2..0000000000
--- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/LimitingVelocityListener.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.mogo.eagle.core.function.api.v2x
-
-/**
- * 限速信息回掉
- */
-interface LimitingVelocityListener {
- fun onLimitingVelocityChange(limitingVelocity: Int)
-}
\ No newline at end of file
diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ObuLimitingSpeedListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ObuLimitingSpeedListener.kt
deleted file mode 100644
index 1fb84cdeaa..0000000000
--- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ObuLimitingSpeedListener.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.mogo.eagle.core.function.api.v2x
-
-/**
- * 限速信息
- */
-interface ObuLimitingSpeedListener {
- fun onObuLimitingSpeedChange(limitingSpeed: Int)
-}
\ No newline at end of file
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 1a1eedf412..b89e16b16d 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
@@ -1,23 +1,18 @@
package com.mogo.eagle.core.function.call.hmi
-import android.view.View
import android.view.ViewGroup
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
-import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_SLW
-import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
-import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
-import com.zhjt.service_biz.BizConfig
/**
* @author xiaoyuzhou
@@ -37,42 +32,6 @@ object CallerHmiManager {
waringProviderApi?.displayEffects()
}
- /**
- * 隐藏 脉速表
- * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
- */
- fun setSpeedChartViewVisibility(visibility: Int) {
- waringProviderApi?.setSpeedChartViewVisibility(visibility)
- }
-
- /**
- * 隐藏 自动驾驶触发 按钮
- * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
- */
- fun setAutopilotStatusViewVisibility(visibility: Int) {
- waringProviderApi?.setAutopilotStatusViewVisibility(visibility)
- }
-
- /**
- * 隐藏 切换视角 按钮
- * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
- */
- fun setPerspectiveSwitchViewVisibility(visibility: Int) {
- waringProviderApi?.setPerspectiveSwitchViewVisibility(visibility)
- }
-
- /**
- * 隐藏 工具箱 按钮
- * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
- */
- fun setToolsViewVisibility(visibility: Int) {
- waringProviderApi?.setToolsViewVisibility(visibility)
- }
-
- fun setCameraViewVisibility(visibility: Int) {
- waringProviderApi?.setCameraViewVisibility(visibility)
- }
-
/**
* 控制转向灯功能
*/
@@ -200,24 +159,6 @@ object CallerHmiManager {
waringProviderApi?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum)
}
- /**
- * 展示限速预警
- *
- * @param limitingSpeed 限速速度
- * @param limitSpeedSource 限速来源 1:MAP, 2:RSU
- */
- @BizConfig(V2I, "", BIZ_SLW)
- fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) {
- waringProviderApi?.showLimitingVelocity(limitingSpeed, limitSpeedSource)
- }
-
- /**
- * 关闭限速预警
- */
- fun disableLimitingVelocity() {
- waringProviderApi?.disableLimitingVelocity()
- }
-
/**
* 展示指定方位上的红框预警
* @param direction
@@ -346,14 +287,6 @@ object CallerHmiManager {
waringProviderApi?.setProxyTrafficLightView(view)
}
- /**
- * 设置 限速 代理View
- * @param view
- */
- fun setProxyLimitingSpeedView(view: IViewLimitingVelocity) {
- waringProviderApi?.setProxyLimitingSpeedView(view)
- }
-
/**
* 展示工控机监控上报数据
* @param errorReportList 错误级别上报数据列表
diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallLimitingVelocityListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallLimitingVelocityListenerManager.kt
deleted file mode 100644
index 726288cd2d..0000000000
--- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallLimitingVelocityListenerManager.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.mogo.eagle.core.function.call.v2x
-
-import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener
-import com.mogo.eagle.core.function.call.base.CallerBase
-
-/**
- * 限速信息监听
- */
-object CallLimitingVelocityListenerManager : CallerBase() {
-
- private const val TAG = "CallLimitingVelocityListenerManager"
-
- private var mCurrentLimitingVelocity = 0
-
- override fun doSomeAfterAddListener(tag: String, listener: LimitingVelocityListener) {
- listener.onLimitingVelocityChange(mCurrentLimitingVelocity)
- }
-
- fun invokeOnLimitingVelocityChange(limitingVelocity: Int) {
- this.mCurrentLimitingVelocity = limitingVelocity
- M_LISTENERS.forEach {
- val tag = it.key
- //LogUtils.dTag(TAG, "invokeOnLimitingVelocityChange tag is : $tag")
- val listener = it.value
- listener.onLimitingVelocityChange(limitingVelocity)
- }
- }
-
-}
\ No newline at end of file
diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallObuLimitingSpeedListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallObuLimitingSpeedListenerManager.kt
deleted file mode 100644
index 1a33b7af68..0000000000
--- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallObuLimitingSpeedListenerManager.kt
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.mogo.eagle.core.function.call.v2x
-
-import com.mogo.eagle.core.function.api.v2x.ObuLimitingSpeedListener
-import com.mogo.eagle.core.function.call.base.CallerBase
-import java.util.concurrent.ConcurrentHashMap
-
-/**
- * 限速信息监听
- */
-object CallObuLimitingSpeedListenerManager : CallerBase(){
-
- private const val TAG = "CallObuLimitingSpeedListenerManager"
- private val M_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap =
- ConcurrentHashMap()
- private var mObuLimitSpeed = 0
-
- fun invokeOnObuLimitingSpeedChange(limitingSpeed: Int) {
- this.mObuLimitSpeed = limitingSpeed
- M_TRAFFIC_LIGHT_LISTENER.forEach {
- val tag = it.key
- val listener = it.value
- listener.onObuLimitingSpeedChange(limitingSpeed)
- }
- }
-
-}
\ No newline at end of file
diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt
new file mode 100644
index 0000000000..4d9211b39c
--- /dev/null
+++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt
@@ -0,0 +1,28 @@
+package com.mogo.eagle.core.function.call.v2x
+
+import com.mogo.eagle.core.data.enums.DataSourceType
+import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
+import com.mogo.eagle.core.function.call.base.CallerBase
+
+/**
+ * 限速信息监听
+ */
+object CallerLimitingVelocityListenerManager : CallerBase() {
+
+ private var mCurrentLimitingVelocity = 0
+ private var sourceType = DataSourceType.DEFAULT
+
+ override fun doSomeAfterAddListener(tag: String, listener: ILimitingVelocityListener) {
+ listener.onLimitingVelocityChange(mCurrentLimitingVelocity, sourceType)
+ }
+
+ fun invokeOnLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
+ this.mCurrentLimitingVelocity = limitingVelocity
+ this.sourceType = sourceType
+ M_LISTENERS.forEach {
+ val listener = it.value
+ listener.onLimitingVelocityChange(limitingVelocity, sourceType)
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerViewLimitingVelocityListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerViewLimitingVelocityListenerManager.kt
new file mode 100644
index 0000000000..cdfbe782b8
--- /dev/null
+++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerViewLimitingVelocityListenerManager.kt
@@ -0,0 +1,28 @@
+package com.mogo.eagle.core.function.call.v2x
+
+import com.mogo.eagle.core.data.enums.DataSourceType
+import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
+import com.mogo.eagle.core.function.call.base.CallerBase
+
+/**
+ * 限速信息监听
+ */
+object CallerViewLimitingVelocityListenerManager : CallerBase() {
+
+ private var mCurrentLimitingVelocity = 0
+ private var sourceType = DataSourceType.DEFAULT
+
+ override fun doSomeAfterAddListener(tag: String, listener: ILimitingVelocityListener) {
+ listener.onLimitingVelocityChange(mCurrentLimitingVelocity, sourceType)
+ }
+
+ fun invokeOnLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
+ this.mCurrentLimitingVelocity = limitingVelocity
+ this.sourceType = sourceType
+ M_LISTENERS.forEach {
+ val listener = it.value
+ listener.onLimitingVelocityChange(limitingVelocity, sourceType)
+ }
+ }
+
+}
\ No newline at end of file