红绿灯

红绿灯Bus司机端增加信号来源显示
This commit is contained in:
xuxinchao
2022-06-23 16:07:40 +08:00
committed by liujing
parent 2d7e0a5c2c
commit 8a87127bdf
17 changed files with 143 additions and 49 deletions

View File

@@ -49,10 +49,11 @@ public class BusPassengerTrafficLightView extends IViewTrafficLight {
* 展示红绿灯预警 * 展示红绿灯预警
* *
* @param checkLightId 0-都是默认1-红2-黄3-绿 * @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
@Override @Override
public void showWarningTrafficLight(int checkLightId) { public void showWarningTrafficLight(int checkLightId,int lightSource) {
super.showWarningTrafficLight(checkLightId); super.showWarningTrafficLight(checkLightId,lightSource);
mCurrentLightId = checkLightId; mCurrentLightId = checkLightId;
updateTrafficLightIcon(checkLightId); updateTrafficLightIcon(checkLightId);
} }

View File

@@ -46,10 +46,11 @@ public class BusTrafficLightView extends IViewTrafficLight {
* 展示红绿灯预警 * 展示红绿灯预警
* *
* @param checkLightId 0-都是默认1-红2-黄3-绿 * @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
@Override @Override
public void showWarningTrafficLight(int checkLightId) { public void showWarningTrafficLight(int checkLightId,int lightSource) {
super.showWarningTrafficLight(checkLightId); super.showWarningTrafficLight(checkLightId,lightSource);
mCurrentLightId = checkLightId; mCurrentLightId = checkLightId;
updateTrafficLightIcon(checkLightId); updateTrafficLightIcon(checkLightId);
} }

View File

@@ -49,10 +49,11 @@ public class TaxiPassengerTrafficLightView extends IViewTrafficLight {
* 展示红绿灯预警 * 展示红绿灯预警
* *
* @param checkLightId 0-都是默认1-红2-黄3-绿 * @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
@Override @Override
public void showWarningTrafficLight(int checkLightId) { public void showWarningTrafficLight(int checkLightId,int lightSource) {
super.showWarningTrafficLight(checkLightId); super.showWarningTrafficLight(checkLightId,lightSource);
mCurrentLightId = checkLightId; mCurrentLightId = checkLightId;
updateTrafficLightIcon(checkLightId); updateTrafficLightIcon(checkLightId);
} }

View File

@@ -46,10 +46,11 @@ public class TaxiTrafficLightView extends IViewTrafficLight {
* 展示红绿灯预警 * 展示红绿灯预警
* *
* @param checkLightId 0-都是默认1-红2-黄3-绿 * @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
@Override @Override
public void showWarningTrafficLight(int checkLightId) { public void showWarningTrafficLight(int checkLightId,int lightSource) {
super.showWarningTrafficLight(checkLightId); super.showWarningTrafficLight(checkLightId,lightSource);
mCurrentLightId = checkLightId; mCurrentLightId = checkLightId;
updateTrafficLightIcon(checkLightId); updateTrafficLightIcon(checkLightId);
} }

View File

@@ -57,7 +57,7 @@ class V2XTrafficLightBroadcastReceiver : BroadcastReceiver() {
* @param trafficLightCountDown 对应交通灯倒计时如果倒计时为0则disable * @param trafficLightCountDown 对应交通灯倒计时如果倒计时为0则disable
*/ */
private fun dispatchShowWaring(trafficLightCheckType: Int, trafficLightCountDown: Int) { private fun dispatchShowWaring(trafficLightCheckType: Int, trafficLightCountDown: Int) {
CallerHmiManager.showWarningTrafficLight(trafficLightCheckType) CallerHmiManager.showWarningTrafficLight(trafficLightCheckType,1)
when(trafficLightCheckType){ when(trafficLightCheckType){
1 -> CallerHmiManager.changeCountdownRed(trafficLightCountDown) 1 -> CallerHmiManager.changeCountdownRed(trafficLightCountDown)
2 -> CallerHmiManager.changeCountdownYellow(trafficLightCountDown) 2 -> CallerHmiManager.changeCountdownYellow(trafficLightCountDown)

View File

@@ -78,7 +78,7 @@ import kotlin.collections.ArrayList
* 预警图层 * 预警图层
*/ */
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_HMI) @Route(path = MoGoFragmentPaths.PATH_FRAGMENT_HMI)
class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(), class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
IMoGoWaringProvider, IMoGoWaringProvider,
IMoGoHmiViewProxy, IMoGoHmiViewProxy,
MoGoHmiContract.View, MoGoHmiContract.View,
@@ -618,9 +618,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
* 展示红绿灯预警 * 展示红绿灯预警
* *
* @param checkLightId 0-都是默认不亮起1-红2-黄3-绿 * @param checkLightId 0-都是默认不亮起1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
override fun showWarningTrafficLight(checkLightId: Int) { override fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {
mViewTrafficLight?.showWarningTrafficLight(checkLightId) mViewTrafficLight?.showWarningTrafficLight(checkLightId,lightSource)
} }
override fun isWarningTrafficLightShow(): Boolean { override fun isWarningTrafficLightShow(): Boolean {

View File

@@ -5,9 +5,11 @@ import android.util.AttributeSet
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import androidx.core.view.marginLeft import android.widget.TextView
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.eagle.core.utilcode.util.UiThreadHandler
/** /**
@@ -21,6 +23,8 @@ class SingleTrafficLightView @JvmOverloads constructor(
private var mLightIconIV: ImageView? = null private var mLightIconIV: ImageView? = null
private var mLightIconBG: ImageView? = null private var mLightIconBG: ImageView? = null
private var mLightTimeTV: GradientTextView? = null private var mLightTimeTV: GradientTextView? = null
private var mLightSourceTV: TextView? = null
private var mLightSourceDivider: View? = null
private var mCurrentLightId = 0 private var mCurrentLightId = 0
init { init {
@@ -32,17 +36,20 @@ class SingleTrafficLightView @JvmOverloads constructor(
mLightIconIV = findViewById(R.id.hmi_traffic_light_iv) mLightIconIV = findViewById(R.id.hmi_traffic_light_iv)
mLightIconBG = findViewById(R.id.hmi_traffic_light_bg) mLightIconBG = findViewById(R.id.hmi_traffic_light_bg)
mLightTimeTV = findViewById(R.id.hmi_traffic_light_time_tv) mLightTimeTV = findViewById(R.id.hmi_traffic_light_time_tv)
mLightSourceTV = findViewById(R.id.hmi_traffic_light_source)
mLightSourceDivider = findViewById(R.id.hmi_traffic_light_divider)
} }
/** /**
* 展示红绿灯预警 * 展示红绿灯预警
* *
* @param checkLightId 0-都是默认1-红2-黄3-绿 * @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
override fun showWarningTrafficLight(checkLightId: Int) { override fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {
super.showWarningTrafficLight(checkLightId) super.showWarningTrafficLight(checkLightId,lightSource)
mCurrentLightId = checkLightId mCurrentLightId = checkLightId
updateTrafficLightIcon(checkLightId) updateTrafficLightIcon(checkLightId,lightSource)
} }
/** /**
@@ -59,11 +66,26 @@ class SingleTrafficLightView @JvmOverloads constructor(
override fun disableCountdown() { override fun disableCountdown() {
super.disableCountdown() super.disableCountdown()
UiThreadHandler.post { UiThreadHandler.post {
val lp = this.layoutParams as MarginLayoutParams // 小巴车的司机端需要展示红绿灯信号来源
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_icon_size).toInt() if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
this.layoutParams = lp && AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
mLightTimeTV!!.visibility = GONE val lp = this.layoutParams as MarginLayoutParams
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.dp_124).toInt() lp.width = context.resources.getDimension(R.dimen.dp_325).toInt()
this.layoutParams = lp
mLightSourceTV!!.visibility = VISIBLE
mLightSourceDivider!!.visibility = VISIBLE
mLightTimeTV!!.visibility = GONE
mLightSourceTV!!.setPadding(0,0,75,0)
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.dp_310).toInt()
}else{
val lp = this.layoutParams as MarginLayoutParams
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_icon_size).toInt()
this.layoutParams = lp
mLightTimeTV!!.visibility = GONE
mLightSourceDivider!!.visibility = View.GONE
mLightSourceTV!!.visibility = View.GONE
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.dp_124).toInt()
}
} }
} }
@@ -149,8 +171,9 @@ class SingleTrafficLightView @JvmOverloads constructor(
* 更新红绿灯icon * 更新红绿灯icon
* *
* @param lightId 0-都是默认1-红2-黄3-绿 * @param lightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
private fun updateTrafficLightIcon(lightId: Int) { private fun updateTrafficLightIcon(lightId: Int,lightSource: Int) {
UiThreadHandler.post { UiThreadHandler.post {
when (lightId) { when (lightId) {
1 -> { 1 -> {
@@ -167,15 +190,41 @@ class SingleTrafficLightView @JvmOverloads constructor(
} }
else -> this@SingleTrafficLightView.visibility = GONE else -> this@SingleTrafficLightView.visibility = GONE
} }
when(lightSource){
1 -> {
mLightSourceTV!!.text = "云端下发"
}
2 -> {
mLightSourceTV!!.text = "自车感知"
}
else -> {
mLightSourceTV!!.visibility = GONE
}
}
} }
} }
private fun resetView(){ private fun resetView(){
val lp = this.layoutParams as MarginLayoutParams // 小巴车的司机端需要展示红绿灯信号来源
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_layout_width).toInt() if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
this.layoutParams = lp && AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
mLightTimeTV!!.visibility = View.VISIBLE val lp = this.layoutParams as MarginLayoutParams
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bg_width).toInt() lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bus_layout_width).toInt()
this.layoutParams = lp
mLightTimeTV!!.visibility = View.VISIBLE
mLightSourceDivider!!.visibility = View.VISIBLE
mLightSourceTV!!.visibility = View.VISIBLE
mLightSourceTV!!.setPadding(0,0,0,0)
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bus_bg_width).toInt()
}else{
val lp = this.layoutParams as MarginLayoutParams
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_layout_width).toInt()
this.layoutParams = lp
mLightTimeTV!!.visibility = View.VISIBLE
mLightSourceDivider!!.visibility = View.GONE
mLightSourceTV!!.visibility = View.GONE
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bg_width).toInt()
}
} }
} }

View File

@@ -30,8 +30,9 @@ class TrafficLightView @JvmOverloads constructor(
* 展示红绿灯预警 * 展示红绿灯预警
* *
* @param checkLightId 0-都是默认1-红2-黄3-绿 * @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
override fun showWarningTrafficLight(checkLightId: Int) { override fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {
UiThreadHandler.post { UiThreadHandler.post {
visibility = View.VISIBLE visibility = View.VISIBLE
when (checkLightId) { when (checkLightId) {

View File

@@ -1,19 +1,21 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/hmi_traffic_light_layout_width" android:layout_width="@dimen/hmi_traffic_light_bus_layout_width"
android:layout_height="@dimen/hmi_traffic_light_layout_height" android:layout_height="@dimen/hmi_traffic_light_layout_height"
xmlns:tools="http://schemas.android.com/tools"
android:visibility="visible"> android:visibility="visible">
<ImageView <ImageView
android:id="@+id/hmi_traffic_light_bg" android:id="@+id/hmi_traffic_light_bg"
android:layout_width="@dimen/hmi_traffic_light_bg_width" android:layout_width="@dimen/hmi_traffic_light_bus_bg_width"
android:layout_height="@dimen/hmi_traffic_light_bg_height" android:layout_height="@dimen/hmi_traffic_light_bg_height"
android:layout_marginStart="@dimen/hmi_traffic_light_bg_margin_left" android:layout_marginStart="@dimen/hmi_traffic_light_bg_margin_left"
android:layout_marginTop="@dimen/hmi_traffic_light_bg_margin_top" android:layout_marginTop="@dimen/hmi_traffic_light_bg_margin_top"
android:background="@drawable/traffic_light_bg" android:background="@drawable/traffic_light_bg"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent"
/>
<ImageView <ImageView
android:id="@+id/hmi_traffic_light_iv" android:id="@+id/hmi_traffic_light_iv"
@@ -29,7 +31,33 @@
android:gravity="center" android:gravity="center"
android:textSize="@dimen/hmi_traffic_light_time_size" android:textSize="@dimen/hmi_traffic_light_time_size"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/hmi_traffic_light_iv"
android:layout_marginStart="-30px"
/>
<TextView
android:id="@+id/hmi_traffic_light_source"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="自车感知"
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/hmi_traffic_light_source_size"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" /> android:layout_marginEnd="@dimen/dp_30"
/>
<View
android:id="@+id/hmi_traffic_light_divider"
android:layout_width="@dimen/dp_1"
android:layout_height="@dimen/dp_47"
android:background="@color/color_FFFFFF"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/hmi_traffic_light_source"
android:layout_marginEnd="@dimen/dp_25"
/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -39,15 +39,19 @@
<dimen name="dp_1066">1066px</dimen> <dimen name="dp_1066">1066px</dimen>
<dimen name="hmi_traffic_light_layout_width">225px</dimen> <dimen name="hmi_traffic_light_layout_width">225px</dimen>
<dimen name="hmi_traffic_light_bus_layout_width">400px</dimen>
<dimen name="hmi_traffic_light_layout_height">154px</dimen> <dimen name="hmi_traffic_light_layout_height">154px</dimen>
<dimen name="hmi_traffic_light_layout_corner">60px</dimen> <dimen name="hmi_traffic_light_layout_corner">60px</dimen>
<dimen name="hmi_traffic_light_layout_margin_right">40px</dimen> <dimen name="hmi_traffic_light_layout_margin_right">40px</dimen>
<dimen name="hmi_traffic_light_layout_margin_top">28px</dimen> <dimen name="hmi_traffic_light_layout_margin_top">28px</dimen>
<dimen name="hmi_traffic_light_bg_width">210px</dimen> <dimen name="hmi_traffic_light_bg_width">210px</dimen>
<dimen name="hmi_traffic_light_bus_bg_width">385px</dimen>
<dimen name="hmi_traffic_light_bg_height">120px</dimen> <dimen name="hmi_traffic_light_bg_height">120px</dimen>
<dimen name="hmi_traffic_light_bg_margin_left">15px</dimen> <dimen name="hmi_traffic_light_bg_margin_left">15px</dimen>
<dimen name="hmi_traffic_light_bg_margin_top">17px</dimen> <dimen name="hmi_traffic_light_bg_margin_top">17px</dimen>
<dimen name="hmi_traffic_light_icon_size">154px</dimen> <dimen name="hmi_traffic_light_icon_size">154px</dimen>
<dimen name="hmi_traffic_light_time_view_width">130px</dimen> <dimen name="hmi_traffic_light_time_view_width">71px</dimen>
<dimen name="hmi_traffic_light_time_size">60px</dimen> <dimen name="hmi_traffic_light_time_size">60px</dimen>
<dimen name="hmi_traffic_light_source_size">32px</dimen>
</resources> </resources>

View File

@@ -45,15 +45,19 @@
<dimen name="brakelight_height_daytime">120px</dimen> <dimen name="brakelight_height_daytime">120px</dimen>
<dimen name="hmi_traffic_light_layout_width">225px</dimen> <dimen name="hmi_traffic_light_layout_width">225px</dimen>
<dimen name="hmi_traffic_light_bus_layout_width">400px</dimen>
<dimen name="hmi_traffic_light_layout_height">154px</dimen> <dimen name="hmi_traffic_light_layout_height">154px</dimen>
<dimen name="hmi_traffic_light_layout_corner">60px</dimen> <dimen name="hmi_traffic_light_layout_corner">60px</dimen>
<dimen name="hmi_traffic_light_layout_margin_right">40px</dimen> <dimen name="hmi_traffic_light_layout_margin_right">40px</dimen>
<dimen name="hmi_traffic_light_layout_margin_top">28px</dimen> <dimen name="hmi_traffic_light_layout_margin_top">28px</dimen>
<dimen name="hmi_traffic_light_bg_width">210px</dimen> <dimen name="hmi_traffic_light_bg_width">210px</dimen>
<dimen name="hmi_traffic_light_bus_bg_width">385px</dimen>
<dimen name="hmi_traffic_light_bg_height">120px</dimen> <dimen name="hmi_traffic_light_bg_height">120px</dimen>
<dimen name="hmi_traffic_light_bg_margin_left">15px</dimen> <dimen name="hmi_traffic_light_bg_margin_left">15px</dimen>
<dimen name="hmi_traffic_light_bg_margin_top">17px</dimen> <dimen name="hmi_traffic_light_bg_margin_top">17px</dimen>
<dimen name="hmi_traffic_light_icon_size">154px</dimen> <dimen name="hmi_traffic_light_icon_size">154px</dimen>
<dimen name="hmi_traffic_light_time_view_width">130px</dimen> <dimen name="hmi_traffic_light_time_view_width">71px</dimen>
<dimen name="hmi_traffic_light_time_size">60px</dimen> <dimen name="hmi_traffic_light_time_size">60px</dimen>
<dimen name="hmi_traffic_light_source_size">32px</dimen>
</resources> </resources>

View File

@@ -664,7 +664,7 @@ class MogoPrivateObuManager private constructor() {
when (currentLight.phase) { when (currentLight.phase) {
// 灯光不可用 // 灯光不可用
0x0 -> { 0x0 -> {
CallerHmiManager.showWarningTrafficLight(0) CallerHmiManager.showWarningTrafficLight(0,2)
} }
// 红灯 // 红灯
0x1 -> { 0x1 -> {
@@ -673,7 +673,7 @@ class MogoPrivateObuManager private constructor() {
isRedLight = true isRedLight = true
} }
isGreenLight = false isGreenLight = false
CallerHmiManager.showWarningTrafficLight(1) CallerHmiManager.showWarningTrafficLight(1,2)
val red = currentLight.count_down.toInt() val red = currentLight.count_down.toInt()
CallerHmiManager.changeCountdownRed(red) CallerHmiManager.changeCountdownRed(red)
@@ -688,7 +688,7 @@ class MogoPrivateObuManager private constructor() {
isGreenLight = true isGreenLight = true
} }
isRedLight = false isRedLight = false
CallerHmiManager.showWarningTrafficLight(3) CallerHmiManager.showWarningTrafficLight(3,2)
val green = currentLight.count_down.toInt() val green = currentLight.count_down.toInt()
CallerHmiManager.changeCountdownGreen(green) CallerHmiManager.changeCountdownGreen(green)
//防止数据出现问题的容错 //防止数据出现问题的容错
@@ -733,7 +733,7 @@ class MogoPrivateObuManager private constructor() {
// 黄灯 // 黄灯
0x3 -> { 0x3 -> {
CallerHmiManager.disableWarningV2X(appId.toString()) CallerHmiManager.disableWarningV2X(appId.toString())
CallerHmiManager.showWarningTrafficLight(2) CallerHmiManager.showWarningTrafficLight(2,2)
val yellow = currentLight.count_down.toInt() val yellow = currentLight.count_down.toInt()
CallerHmiManager.changeCountdownYellow(yellow) CallerHmiManager.changeCountdownYellow(yellow)
CallerHmiManager.changeCountdownGreen(0) CallerHmiManager.changeCountdownGreen(0)

View File

@@ -24,7 +24,7 @@ class TrafficLightHMIManager {
currentTrafficLight?.let { currentTrafficLight?.let {
if (!initView) { if (!initView) {
initView = true initView = true
CallerHmiManager.showWarningTrafficLight(0) CallerHmiManager.showWarningTrafficLight(0,1)
} }
callerHMIToChangeLight(it) callerHMIToChangeLight(it)
} }
@@ -38,19 +38,19 @@ class TrafficLightHMIManager {
} }
when { when {
trafficLightStatus.isGreen() || trafficLightStatus.isFlashGreen() -> { trafficLightStatus.isGreen() || trafficLightStatus.isFlashGreen() -> {
CallerHmiManager.showWarningTrafficLight(3) CallerHmiManager.showWarningTrafficLight(3,1)
CallerHmiManager.changeCountdownGreen(remain) CallerHmiManager.changeCountdownGreen(remain)
// CallerHmiManager.changeCountdownRed(-1) // CallerHmiManager.changeCountdownRed(-1)
// CallerHmiManager.changeCountdownYellow(-1) // CallerHmiManager.changeCountdownYellow(-1)
} }
trafficLightStatus.isYellow() -> { trafficLightStatus.isYellow() -> {
CallerHmiManager.showWarningTrafficLight(2) CallerHmiManager.showWarningTrafficLight(2,1)
CallerHmiManager.changeCountdownYellow(remain) CallerHmiManager.changeCountdownYellow(remain)
// CallerHmiManager.changeCountdownGreen(-1) // CallerHmiManager.changeCountdownGreen(-1)
// CallerHmiManager.changeCountdownRed(-1) // CallerHmiManager.changeCountdownRed(-1)
} }
trafficLightStatus.isRed() -> { trafficLightStatus.isRed() -> {
CallerHmiManager.showWarningTrafficLight(1) CallerHmiManager.showWarningTrafficLight(1,1)
CallerHmiManager.changeCountdownRed(remain) CallerHmiManager.changeCountdownRed(remain)
// CallerHmiManager.changeCountdownGreen(-1) // CallerHmiManager.changeCountdownGreen(-1)
// CallerHmiManager.changeCountdownYellow(-1) // CallerHmiManager.changeCountdownYellow(-1)

View File

@@ -67,17 +67,17 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLigh
when (light.state) { when (light.state) {
TrafficLightOuterClass.LightState.STATE_RED -> { TrafficLightOuterClass.LightState.STATE_RED -> {
//红灯 //红灯
CallerHmiManager.showWarningTrafficLight(1) CallerHmiManager.showWarningTrafficLight(1,2)
CallerHmiManager.changeCountdownGreen(0) CallerHmiManager.changeCountdownGreen(0)
} }
TrafficLightOuterClass.LightState.STATE_YELLOW -> { TrafficLightOuterClass.LightState.STATE_YELLOW -> {
//黄灯 //黄灯
CallerHmiManager.showWarningTrafficLight(2) CallerHmiManager.showWarningTrafficLight(2,2)
CallerHmiManager.changeCountdownGreen(0) CallerHmiManager.changeCountdownGreen(0)
} }
TrafficLightOuterClass.LightState.STATE_GREEN -> { TrafficLightOuterClass.LightState.STATE_GREEN -> {
//绿灯 //绿灯
CallerHmiManager.showWarningTrafficLight(3) CallerHmiManager.showWarningTrafficLight(3,2)
CallerHmiManager.changeCountdownGreen(0) CallerHmiManager.changeCountdownGreen(0)
} }
else -> {} else -> {}

View File

@@ -14,8 +14,9 @@ abstract class IViewTrafficLight(context: Context?, attrs: AttributeSet?, defSty
* 展示红绿灯预警 * 展示红绿灯预警
* *
* @param checkLightId 0-都是默认1-红2-黄3-绿 * @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
open fun showWarningTrafficLight(checkLightId: Int) {} open fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {}
/** /**
* 关闭红绿灯预警展示,并重制灯态 * 关闭红绿灯预警展示,并重制灯态

View File

@@ -86,8 +86,9 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
* 展示红绿灯预警 * 展示红绿灯预警
* *
* @param checkLightId 0-都是默认1-红2-黄3-绿 * @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
fun showWarningTrafficLight(checkLightId: Int) fun showWarningTrafficLight(checkLightId: Int,lightSource: Int)
/** /**
* 红绿灯是否展示 * 红绿灯是否展示

View File

@@ -114,9 +114,10 @@ object CallerHmiManager : CallerBase() {
* 展示红绿灯预警 * 展示红绿灯预警
* *
* @param checkLightId 0-都是默认1-红2-黄3-绿 * @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知
*/ */
fun showWarningTrafficLight(checkLightId: Int) { fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {
waringProviderApi?.showWarningTrafficLight(checkLightId) waringProviderApi?.showWarningTrafficLight(checkLightId,lightSource)
} }
/** /**