[dev_minibus-d_230425_3.2.0] 修改红绿灯按钮同步乘客屏

This commit is contained in:
lixiaopeng
2023-05-11 14:02:44 +08:00
parent e7836b87cd
commit fc2a750c6c
3 changed files with 39 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
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.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
@@ -154,6 +155,28 @@ class TeleMsgHandler : IMsgHandler {
CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR,it.body)
}
}
TelematicConstant.OBU_RUNREDLIGHT_WARNING -> {
when (String(it.body)) {
"0" -> {
HmiBuildConfig.isShowRunRedLightView = false
}
"1" -> {
HmiBuildConfig.isShowRunRedLightView = true
}
}
}
TelematicConstant.OBU_GREENWAVE_WARNING -> {
when (String(it.body)) {
"0" -> {
HmiBuildConfig.isShowGreenWaveView = false
}
"1" -> {
HmiBuildConfig.isShowGreenWaveView = true
}
}
}
else -> {
}
}

View File

@@ -2,13 +2,13 @@ package com.mogo.eagle.core.function.hmi.ui.setting
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
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.data.multidisplay.TelematicConstant
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
@@ -21,6 +21,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.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
@@ -121,6 +122,11 @@ internal class SOPSettingView @JvmOverloads constructor(
tbRunRedLightSop.isChecked = HmiBuildConfig.isShowRunRedLightView
tbRunRedLightSop.setOnCheckedChangeListener { _, isChecked ->
HmiBuildConfig.isShowRunRedLightView = isChecked
if (HmiBuildConfig.isShowRunRedLightView) {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_RUNREDLIGHT_WARNING, "1".toByteArray())
} else {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_RUNREDLIGHT_WARNING, "0".toByteArray())
}
}
/**
@@ -129,6 +135,11 @@ internal class SOPSettingView @JvmOverloads constructor(
tbGreenWaveSop.isChecked = HmiBuildConfig.isShowGreenWaveView
tbGreenWaveSop.setOnCheckedChangeListener { _, isChecked ->
HmiBuildConfig.isShowGreenWaveView = isChecked
if (HmiBuildConfig.isShowGreenWaveView) {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_GREENWAVE_WARNING, "1".toByteArray())
} else {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_GREENWAVE_WARNING, "0".toByteArray())
}
}
//红绿灯标识

View File

@@ -13,5 +13,9 @@ class TelematicConstant {
const val OPEN_ROMA_STATUS = 103
const val ROMA_UPDATE = 104
const val CONTROL_PASSENGER_DRIVER_MONITOR = 105
const val OBU_RUNREDLIGHT_WARNING = 200 //闯红灯预警开关
const val OBU_GREENWAVE_WARNING = 201 //绿波通行开关
}
}