[dev_minibus-d_230425_3.2.0] 修改红绿灯闪烁问题,优化红绿灯读秒三位数显示不全问题
This commit is contained in:
@@ -13,6 +13,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
|
|||||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_CROSS_ROAD
|
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_CROSS_ROAD
|
||||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_TRAFFIC_LIGHT
|
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_TRAFFIC_LIGHT
|
||||||
@@ -100,7 +101,6 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
|||||||
}
|
}
|
||||||
CallerTrafficLightListenerManager.resetTrafficLightStatus()
|
CallerTrafficLightListenerManager.resetTrafficLightStatus()
|
||||||
CallerTrafficLightListenerManager.invokeTrafficRequestError()
|
CallerTrafficLightListenerManager.invokeTrafficRequestError()
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
val INSTANCE: TrafficLightDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
val INSTANCE: TrafficLightDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||||
TrafficLightDispatcher()
|
TrafficLightDispatcher()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var mContext: Context? = null
|
private var mContext: Context? = null
|
||||||
@@ -156,7 +155,20 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
hide()
|
hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否重置红绿灯数据,需要确保,在obu的红绿灯显示的时候,不执行。否则会闪屏
|
||||||
|
*/
|
||||||
|
override fun resetTrafficLight(isReset: Boolean) {
|
||||||
|
CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "resetTrafficLight ------> isReset = $isReset ")
|
||||||
|
if (!hasObuLightStatus) {
|
||||||
|
if(isReset){
|
||||||
|
hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun hide(){
|
private fun hide(){
|
||||||
|
CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "hide() -------> ")
|
||||||
CallerTrafficLightListenerManager.disableTrafficLight()
|
CallerTrafficLightListenerManager.disableTrafficLight()
|
||||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||||
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.HIDE_TRAFFIC_LIGHT, "0".toByteArray())
|
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.HIDE_TRAFFIC_LIGHT, "0".toByteArray())
|
||||||
@@ -172,7 +184,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
lightSource: DataSourceType
|
lightSource: DataSourceType
|
||||||
) {
|
) {
|
||||||
super.onTrafficLightPlusSource(light, remain, lightSource)
|
super.onTrafficLightPlusSource(light, remain, lightSource)
|
||||||
CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "onTrafficLightPlusSource ----- light = $light ---remain = $remain ---lightSource = $lightSource")
|
// CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "onTrafficLightPlusSource ----- light = $light ---remain = $remain ---lightSource = $lightSource")
|
||||||
if (lightSource == DataSourceType.OBU) {
|
if (lightSource == DataSourceType.OBU) {
|
||||||
hasObuLightStatus = true
|
hasObuLightStatus = true
|
||||||
}
|
}
|
||||||
@@ -213,9 +225,9 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
|||||||
}
|
}
|
||||||
onTrafficLightPlusSource(it.convert(), remain, DataSourceType.AICLOUD)
|
onTrafficLightPlusSource(it.convert(), remain, DataSourceType.AICLOUD)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun destroy() {
|
fun destroy() {
|
||||||
//取消注册监听AI云.OBU,路侧获取红绿灯状态
|
//取消注册监听AI云.OBU,路侧获取红绿灯状态
|
||||||
CallerTrafficLightListenerManager.removeListener(TAG)
|
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
<dimen name="hmi_traffic_light_bg_margin_left">15dp</dimen>
|
<dimen name="hmi_traffic_light_bg_margin_left">15dp</dimen>
|
||||||
<dimen name="hmi_traffic_light_bg_margin_top">17dp</dimen>
|
<dimen name="hmi_traffic_light_bg_margin_top">17dp</dimen>
|
||||||
<dimen name="hmi_traffic_light_icon_size">154dp</dimen>
|
<dimen name="hmi_traffic_light_icon_size">154dp</dimen>
|
||||||
<dimen name="hmi_traffic_light_time_view_width">71dp</dimen>
|
<dimen name="hmi_traffic_light_time_view_width">110dp</dimen>
|
||||||
<dimen name="hmi_traffic_light_time_size">60dp</dimen>
|
<dimen name="hmi_traffic_light_time_size">60dp</dimen>
|
||||||
<dimen name="hmi_traffic_light_source_size">32dp</dimen>
|
<dimen name="hmi_traffic_light_source_size">32dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ interface IMoGoTrafficLightListener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否重置
|
||||||
|
*/
|
||||||
|
fun resetTrafficLight(isReset: Boolean) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 云端红绿灯接口请求失败
|
* 云端红绿灯接口请求失败
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
|||||||
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
||||||
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
|
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
|
||||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||||
|
|
||||||
object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>() {
|
object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>() {
|
||||||
|
|
||||||
@@ -57,10 +59,17 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>
|
|||||||
*/
|
*/
|
||||||
fun resetTrafficLightStatus(hideTrafficLight:Boolean = true) {
|
fun resetTrafficLightStatus(hideTrafficLight:Boolean = true) {
|
||||||
trafficLightResult = null
|
trafficLightResult = null
|
||||||
// 隐藏traffic light
|
// // 隐藏traffic light
|
||||||
if(hideTrafficLight){
|
// if(hideTrafficLight){
|
||||||
disableTrafficLight()
|
// CallerLogger.d("${SceneConstant.M_OBU}${"TrafficLightDispatcher"}", "resetTrafficLightStatus ------> hideTrafficLight = $hideTrafficLight ")
|
||||||
|
// disableTrafficLight()
|
||||||
|
// }
|
||||||
|
|
||||||
|
M_LISTENERS.forEach {
|
||||||
|
val listener = it.value
|
||||||
|
listener.resetTrafficLight(hideTrafficLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun showTrafficLight(checkLightId: TrafficLightEnum, lightSource: DataSourceType) {
|
fun showTrafficLight(checkLightId: TrafficLightEnum, lightSource: DataSourceType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user