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 daed3fa99b..f7b4c5d0ba 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 @@ -1185,25 +1185,27 @@ class MoGoHmiFragment : MvpFragment(), * 控制展示限速标志及内容 */ 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" + ThreadUtils.runOnUiThread { + // 控制 限速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 { - mViewLimitingVelocity?.visibility = View.INVISIBLE - mViewLimitingVelocity?.updateLimitingSpeed(0, limitSpeedSource) - tvLimitingSource?.visibility = View.INVISIBLE + disableLimitingVelocity() + tvLimitingSource?.visibility = View.GONE } - } else { - disableLimitingVelocity() - tvLimitingSource?.visibility = 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 87f08bde14..a3a612b656 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 @@ -103,24 +103,28 @@ class SOPSettingView @JvmOverloads constructor( * 限速数据来源开关 */ tbRoadLimitSpeedSop.setOnCheckedChangeListener { _, isChecked -> - //默认关闭 + //默认开启 HmiBuildConfig.isShowObuLimitSpeedView = isChecked } /** * obu V2V开关 */ + tbObuV2vView.isChecked = HmiBuildConfig.isShowObuV2vView tbObuV2vView.setOnCheckedChangeListener { _, isChecked -> - //默认关闭 + //默认开启 HmiBuildConfig.isShowObuV2vView = isChecked +// Log.e("liyz", "---2222-- v2v = ${HmiBuildConfig.isShowObuV2vView}") } /** * obu V2i开关 */ + tbObuV2iView.isChecked = HmiBuildConfig.isShowObuV2iView tbObuV2iView.setOnCheckedChangeListener { _, isChecked -> //默认关闭 HmiBuildConfig.isShowObuV2iView = isChecked +// Log.d("liyz", "---2--- v2i = ${HmiBuildConfig.isShowObuV2iView}") } /** @@ -187,13 +191,8 @@ class SOPSettingView @JvmOverloads constructor( //OBU控制总开关 tbObu.isChecked = CallerOBUManager.isConnected() tbObu.setOnCheckedChangeListener { _, isChecked -> - if (!isChecked) { + if (isChecked) { CallerOBUManager.resetObuIpAddress("192.168.1.199") -// if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { -// CallerOBUManager.resetObuIpAddress("192.168.1.199") -// } else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { -// CallerOBUManager.resetObuIpAddress("192.168.8.199") -// } } else { //断开链接 CallerOBUManager.disConnectObu() diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml index e9830e19b0..d6720d62b6 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml @@ -208,6 +208,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="@dimen/dp_20" + android:visibility="gone" android:background="@drawable/radio_button_normal_background_right" android:textColor="#000" android:textOff="获取路侧限速提醒" diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt index c012b9f31e..a36ed03ddd 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt @@ -164,7 +164,7 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onMogoObuRvWarning(data: MogoObuRvWarningData) { super.onMogoObuRvWarning(data) -// if (HmiBuildConfig.isShowObuV2vView) { //TODO 临时需要关闭v2v开关 + if (HmiBuildConfig.isShowObuV2vView) { mObuStatusInfo.obuRvStatus = true CallerObuListenerManager.invokeListener(mObuStatusInfo) if (!data.warningMsg.warningData.isNullOrEmpty()) { @@ -218,7 +218,7 @@ class MogoPrivateObuNewManager private constructor() { } } } -// } + } } /** @@ -227,13 +227,13 @@ class MogoPrivateObuNewManager private constructor() { override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) { super.onMogoObuSpatWarning(data) if (data != null) { -// if (HmiBuildConfig.isShowObuV2iView) { + if (HmiBuildConfig.isShowObuV2iView) { handlerTrafficLight( data.warningType, data.status, data.lights ) -// } + } } } @@ -247,7 +247,7 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) { super.onMogoObuRsiWarning(data) -// if (HmiBuildConfig.isShowObuV2iView) { + if (HmiBuildConfig.isShowObuV2iView) { if (data != null && data.warningMsg != null && data.warningMsg.size > 0) { var alertContent = "" var ttsContent = "" @@ -493,7 +493,7 @@ class MogoPrivateObuNewManager private constructor() { } } } -// } + } } /** @@ -513,7 +513,7 @@ class MogoPrivateObuNewManager private constructor() { "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRsmWarning ------> ${data.toString()}" ) -// if (HmiBuildConfig.isShowObuV2iView) { + if (HmiBuildConfig.isShowObuV2iView) { if (HmiBuildConfig.isShowObuWeaknessTrafficView) { // 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu if (data != null && data.participant != null) { @@ -666,7 +666,7 @@ class MogoPrivateObuNewManager private constructor() { } } } -// } + } } /** @@ -1049,6 +1049,10 @@ class MogoPrivateObuNewManager private constructor() { if (minSpeedTemp == maxSpeedTemp) { minSpeedTemp -= 5 } + if (minSpeedTemp < 0) { + minSpeedTemp = 1 + } + val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp" val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp" diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt index 3fa53c8834..c2874fa8af 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt @@ -152,7 +152,6 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight * obu 红绿灯数据 */ override fun onObuTrafficLight(light: Int) { - super.onObuTrafficLight(light) hasObuLightStatus = true CallerHmiManager.showWarningTrafficLight(light, 3) } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt index f156f8b981..1f551208f2 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt @@ -105,14 +105,14 @@ object HmiBuildConfig { */ @JvmField @Volatile - var isShowObuV2vView = false + var isShowObuV2vView = true /** * 是否展示obu的v2i */ @JvmField @Volatile - var isShowObuV2iView = false + var isShowObuV2iView = true /** * 是否展示obu通过工控机展示的v2i diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt index 70662d49e5..a3759c6710 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt @@ -8,8 +8,6 @@ object CallerObuTrafficLightListenerManager { private val M_OBU_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap = ConcurrentHashMap() - var mLight: Int = 0 - /** * 添加监听 * @param tag 标记,用来注销监听使用 @@ -52,7 +50,6 @@ object CallerObuTrafficLightListenerManager { } fun invokeObuTrafficLight(light: Int) { - this.mLight = light M_OBU_TRAFFIC_LIGHT_LISTENER.forEach { val tag = it.key val listener = it.value