[6.2.11] traffic light demo

This commit is contained in:
EmArrow
2024-03-08 12:33:36 +08:00
parent 1f9a644230
commit 3b25da0096
8 changed files with 72 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ import android.os.CountDownTimer
import android.os.Handler
import com.mogo.eagle.core.data.biz.trafficlight.*
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
@@ -118,7 +119,16 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
if(!hasAutopilotPerception){
hasAutopilotPerception = true
}
onTrafficLightPlusSource(light.convert(), 0, DataSourceType.TELEMATIC)
if(HmiBuildConfig.isShowCarSourceTrafficLightView){
val source = when(trafficLights.source){
1 -> DataSourceType.TELEMATIC_UNION_V2I
2 -> DataSourceType.TELEMATIC_UNION_V2N
else -> DataSourceType.TELEMATIC
}
onTrafficLightPlusSource(light.convert(), light.duration.toInt(), source)
}else{
onTrafficLightPlusSource(light.convert(), 0, DataSourceType.TELEMATIC)
}
}
}
}
@@ -150,6 +160,9 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
*/
override fun onEnterCrossRoad(enter: Boolean) {
CallerLogger.d("${SceneConstant.M_D_C}${TAG}", "onEnterCrossRoad enter = $enter ")
if(HmiBuildConfig.isShowCarSourceTrafficLightView){
return
}
if (!enter) {
Handler().postDelayed({
hasAiLightStatus = false
@@ -177,6 +190,9 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
"${SceneConstant.M_D_C}${TAG}",
"onTrafficRequestError hasObuLightStatus = $hasObuLightStatus ------> "
)
if(HmiBuildConfig.isShowCarSourceTrafficLightView){
return
}
CallerTrafficLightListenerManager.resetTrafficLightStatus(hasAiLightStatus)
hasAiLightStatus = false
// if (!hasObuLightStatus) {
@@ -216,6 +232,9 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
)
private fun hide(msg: String, sourceType: DataSourceType) {
CallerLogger.d("${SceneConstant.M_D_C}${TAG}", "hide() :$msg type :$sourceType")
if(filterTelematicUnion(sourceType)){
return
}
CallerTrafficLightListenerManager.disableTrafficLight()
}
@@ -234,6 +253,9 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
lightSource: DataSourceType
) {
super.onTrafficLightPlusSource(light, remain, lightSource)
if(filterTelematicUnion(lightSource)){
return
}
if (lightSource == DataSourceType.OBU) {
hasObuLightStatus = true
hasAutopilotPerception = false
@@ -313,6 +335,9 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
}
}
private fun filterTelematicUnion(source:DataSourceType):Boolean{
return HmiBuildConfig.isShowCarSourceTrafficLightView && source != DataSourceType.TELEMATIC_UNION_V2N && source != DataSourceType.TELEMATIC_UNION_V2I
}
fun destroy() {
//取消注册监听AI云.OBU,路侧获取红绿灯状态

View File

@@ -56,6 +56,7 @@ import kotlinx.android.synthetic.main.view_sop_setting.view.rbThirty
import kotlinx.android.synthetic.main.view_sop_setting.view.rgFusionMode
import kotlinx.android.synthetic.main.view_sop_setting.view.rgPullTime
import kotlinx.android.synthetic.main.view_sop_setting.view.scCarAperture
import kotlinx.android.synthetic.main.view_sop_setting.view.scCarUnionTrafficLight
import kotlinx.android.synthetic.main.view_sop_setting.view.scDemoMode
import kotlinx.android.synthetic.main.view_sop_setting.view.scDrawPointCloudData
import kotlinx.android.synthetic.main.view_sop_setting.view.scFaultSlowDown
@@ -673,6 +674,13 @@ internal class SOPSettingView @JvmOverloads constructor(
}
}
//红绿灯车端来源标识开关
scCarUnionTrafficLight.isChecked = HmiBuildConfig.isShowCarSourceTrafficLightView
scCarUnionTrafficLight.setOnCheckedChangeListener { _, isChecked ->
hmiAction("SOP 红绿灯车端来源标识开关, ", isChecked)
HmiBuildConfig.isShowCarSourceTrafficLightView = isChecked
}
//限速标识
scSpeedLimit.isChecked = HmiBuildConfig.isShowLimitingVelocityView
scSpeedLimit.setOnCheckedChangeListener { _, isChecked ->

View File

@@ -312,6 +312,12 @@ class SingleTrafficLightView @JvmOverloads constructor(
DataSourceType.TELEMATIC -> {
mLightSourceTV!!.text = context.getString(R.string.light_source_perception)
}
DataSourceType.TELEMATIC_UNION_V2I -> {
mLightSourceTV!!.text = context.getString(R.string.light_source_perception_v2i)
}
DataSourceType.TELEMATIC_UNION_V2N -> {
mLightSourceTV!!.text = context.getString(R.string.light_source_perception_v2n)
}
DataSourceType.OBU -> {
mLightSourceTV!!.text = context.getString(R.string.light_source_obu)
}

View File

@@ -693,6 +693,20 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="@id/otherGuideLine"
app:layout_constraintTop_toBottomOf="@id/tvOtherTitle" />
<!--红绿灯新链路 车端融合标识-->
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/scCarUnionTrafficLight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:scaleX="1.2"
android:scaleY="1.2"
android:text="红绿灯车端融合标识"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toRightOf="@id/otherGuideLine"
app:layout_constraintTop_toBottomOf="@id/tvOtherTitle" />
<!--限速标识-->
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/scSpeedLimit"
@@ -704,7 +718,7 @@
android:text="限速标识"
app:layout_constraintLeft_toRightOf="@id/otherGuideLine"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOtherTitle" />
app:layout_constraintTop_toBottomOf="@id/scCarUnionTrafficLight" />
<!--异常上报提示-->
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/scIPCReport"
@@ -726,7 +740,7 @@
android:scaleX="1.2"
android:scaleY="1.2"
android:text="360环视"
app:layout_constraintLeft_toLeftOf="@id/otherGuideLine"
app:layout_constraintLeft_toRightOf="@id/otherGuideLine"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/scSpeedLimit" />
@@ -735,9 +749,9 @@
android:id="@+id/scSweeperModeSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/otherGuideLine"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/scNew360LookAround"
app:layout_constraintRight_toRightOf="@id/otherGuideLine"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/scIPCReport"
android:text="清扫云控业务"
android:scaleY="1.2"
android:scaleX="1.2"
@@ -755,7 +769,7 @@
android:text="自主算路验证模式"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="@id/otherGuideLine"
app:layout_constraintTop_toBottomOf="@id/scNew360LookAround" />
app:layout_constraintTop_toBottomOf="@id/scSweeperModeSwitch" />
<!--天气效果开关-->
<androidx.appcompat.widget.SwitchCompat

View File

@@ -87,6 +87,8 @@
<!--红绿灯数据来源-->
<string name="light_source_ai_cloud">云端下发</string>
<string name="light_source_perception">自车感知</string>
<string name="light_source_perception_v2i">融合V2I</string>
<string name="light_source_perception_v2n">融合V2N</string>
<string name="light_source_obu">\u2000OBU\u2000</string>
<string name="parallel_drive">远程代驾</string>
<string name="parallel_drive_requesting">请求中...</string>

View File

@@ -21,6 +21,12 @@ object HmiBuildConfig {
@JvmField
var isShowTrafficLightView = false
/**
* 是否显示 车端融合红绿等
*/
@JvmField
var isShowCarSourceTrafficLightView = false
/**
* 是否展示 sn绑定的弹框
*/

View File

@@ -7,6 +7,8 @@ enum class DataSourceType(name: String) {
OBU("OBU"),
MAP("HDMAP"),
TELEMATIC("TELEMATIC"),
TELEMATIC_UNION_V2N("TELEMATIC_UNION_V2N"),
TELEMATIC_UNION_V2I("TELEMATIC_UNION_V2I"),
AICLOUD("AI云"),
SUMMARY("汇总"),// V2X事件汇总
WORKORDER("工单建议");

View File

@@ -90,8 +90,8 @@ WEBSOCKET_VERSION=1.1.7
applicationId=com.mogo.launcer
applicationName=IntelligentPilot
# RoboBus司机端2.5.1RoboTaxi司机端2.5.1RoboTaxi乘客端1.0.0
versionCode=6002004
versionName=6.2.4
versionCode=6002011
versionName=6.2.11
################# 新架构模块Maven版本管理 #################
MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10