[6.8.2] add func of fusion color

This commit is contained in:
zhongchao
2024-12-04 11:34:32 +08:00
parent b92f8e69fd
commit 5e477b5873
12 changed files with 120 additions and 15 deletions

View File

@@ -56,6 +56,7 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.telematic.MogoProtocolMsg
import com.mogo.telematic.MogoProtocolMsg.NORMAL_DATA
import com.mogo.telematic.MogoProtocolMsg.SYNC_FUSION_COLOR_STATUS
import com.mogo.telematic.MogoProtocolMsg.SYNC_MODE_STATUS
import com.mogo.telematic.NSDNettyManager
import com.mogo.telematic.client.listener.NettyClientListener
@@ -161,6 +162,7 @@ class MoGoAutopilotControlProvider :
override fun run() {
// 同步是否开启美化模式
setDemoMode(FunctionBuildConfig.isDemoMode)
setFusionColor(FunctionBuildConfig.isFusionColor)
setIgnoreConditionDraw(FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData)
msgHandler.synMsgToAllClients()
}
@@ -559,6 +561,32 @@ class MoGoAutopilotControlProvider :
}
}
/**
* 感知颜色绘制同步
*/
override fun setFusionColor(isEnable: Boolean) {
// 同步给乘客端
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
val byteArray = if (isEnable) {
"1;${System.currentTimeMillis()}".toByteArray()
} else {
"0;${System.currentTimeMillis()}".toByteArray()
}
if (NSDNettyManager.getInstance().isServerStart) {
NSDNettyManager.getInstance()
.sendMsgToAllClients(
MogoProtocolMsg(
SYNC_FUSION_COLOR_STATUS,
byteArray.size,
byteArray
)
)
} else {
CallerLogger.d("$M_D_C$TAG", "同步感知颜色绘制时司机端Server未启动")
}
}
}
override fun setIgnoreConditionDraw(isIgnore: Boolean) {
// 同步给乘客端
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {

View File

@@ -20,6 +20,7 @@ import com.mogo.eagle.core.data.multidisplay.TelematicConstant
import com.mogo.eagle.core.data.v2x.V2XEvent.RoadEventX
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setFusionColor
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
@@ -74,6 +75,9 @@ class TeleMsgHandler : IMsgHandler {
@Volatile
private var demoModeTime = 0L
@Volatile
private var fusionColorTime = 0L
@Volatile
private var timestamp = 0L
@@ -299,6 +303,27 @@ class TeleMsgHandler : IMsgHandler {
}
}
MogoProtocolMsg.SYNC_FUSION_COLOR_STATUS -> {
val content = String(it.body)
if (content.contains(";")) {
val strArr = content.split(";")
if (strArr.size == 2) {
val currTime = strArr[1].toLong()
if (currTime > fusionColorTime) {
val fusionColor = when (strArr[0]) {
"1" -> true
else -> false
}
CallerTelematicListenerManager.dispatchFusionColor(fusionColor)
fusionColorTime = currTime
invokeNettyConnResult("乘客屏收到 fusionColor为${fusionColor}")
} else {
invokeNettyConnResult("乘客屏收到过时的fusionColor")
}
}
}
}
MogoProtocolMsg.REQ_MAC_ADDRESS -> {
val carConfig = MessagePad.CarConfigResp.parseFrom(msg.body)
AppConfigInfo.plateNumber = carConfig.plateNumber
@@ -481,6 +506,7 @@ class TeleMsgHandler : IMsgHandler {
val socketAddress = channel?.remoteAddress().toString()
CallerLogger.d("${SceneConstant.M_D_C}$TAG", "Client ip is:${socketAddress}")
setDemoMode(FunctionBuildConfig.isDemoMode)
setFusionColor(FunctionBuildConfig.isFusionColor)
setIgnoreConditionDraw(FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData)
}

View File

@@ -445,6 +445,7 @@ class OperatePanelLayout : LinearLayout {
FunctionBuildConfig.isFusionColor = isChecked //6.6.2版本基于运营需求-产品设计-v2i进pnc,感知目标颜色替换
FunctionBuildConfig.fusionMode = 2
CallerAutoPilotControlManager.sendFusionMode(2)
CallerAutoPilotControlManager.setFusionColor(isChecked)
CallerHmiViewControlListenerManager.invokeFuncMode(IViewControlListener.FUNC_FUSION_COLOR,isChecked)
CallerAutoPilotControlManager.sendV2iToPncCmd(isChecked)
hmiAction("V2I场景进PNC, ", isChecked)

View File

@@ -75,6 +75,7 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_DEMO
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_RAIN
import com.mogo.eagle.core.function.api.setting.ISopSettingListener
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
@@ -97,6 +98,7 @@ import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuInfoListenerManager
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager
import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
@@ -360,7 +362,8 @@ internal class DebugSettingView @JvmOverloads constructor(
IMoGoChassisStatesListener,
IMoGoSweeperFutianCleanSystemListener,
IMoGoObuInfoListener,
ISopSettingListener, IViewControlListener, IMoGoCloudListener, IBindStateChangeListener {
ISopSettingListener, IViewControlListener, IMoGoCloudListener, IBindStateChangeListener,
IReceivedMsgListener {
companion object {
private const val TAG = "DebugSettingView"
@@ -469,6 +472,8 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerHmiViewControlListenerManager.addListener(TAG, this)
CallerTelematicListenerManager.addListener(TAG, this)
//添加 业务配置监听
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
FuncBizConfig.FOUNDATION, TAG, true, this
@@ -513,6 +518,9 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerSopSettingManager.removeListener(TAG)
CallerHmiViewControlListenerManager.removeListener(TAG)
CallerTelematicListenerManager.removeListener(TAG)
DevicesManager.removeBindStateChangeListener(TAG)
// 移除 业务配置监听
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(
@@ -946,6 +954,7 @@ internal class DebugSettingView @JvmOverloads constructor(
btnDrawFusion.isChecked = FunctionBuildConfig.isFusionColor
btnDrawFusion.setOnCheckedChangeListener { _, isChecked ->
FunctionBuildConfig.isFusionColor = isChecked
CallerAutoPilotControlManager.setFusionColor(isChecked)
}
// 演示模式,上一次勾选的数据
@@ -2714,6 +2723,13 @@ internal class DebugSettingView @JvmOverloads constructor(
tbCarAperture.isChecked = status
}
override fun onFusionColor(fusionColor: Boolean) {
super.onFusionColor(fusionColor)
ThreadUtils.runOnUiThread {
btnDrawFusion.isChecked = FunctionBuildConfig.isFusionColor
}
}
override fun updateFuncMode(tag: String, boolean: Boolean) {
super.updateFuncMode(tag, boolean)
if (tag == FUNC_MODE_DEMO) {