[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

@@ -85,5 +85,8 @@ public class LanSocketManagerJava implements IReceivedMsgListener {
}
@Override
public void onFusionColor(boolean fusionColor) {
}
}

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) {

View File

@@ -360,14 +360,14 @@ object FunctionBuildConfig {
*/
@Volatile
@JvmField
var v2nNewLinkedToPNC = false
var v2nNewLinkedToPNC = true
/**
* 是否开启V2I场景进PNC的开关开关默认关闭
*/
@Volatile
@JvmField
var v2iToPNC = false
var v2iToPNC = true
@Volatile
@JvmField

View File

@@ -164,6 +164,12 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
*/
fun setDemoMode(isEnable: Boolean)
/**
* 融合颜色
* 司机屏同步给乘客屏
*/
fun setFusionColor(isEnable: Boolean)
/**
* 是否忽略条件直接绘制
* 司机屏同步给乘客屏

View File

@@ -1,9 +1,11 @@
package com.mogo.eagle.core.function.api.telematic
interface IReceivedMsgListener {
fun onReceivedMsg(type: Int, byteArray: ByteArray)
fun onReceivedMsg(type: Int, byteArray: ByteArray){}
fun onReceivedServerSn(sn: String?) {}
fun onDemoMode(isDemoMode: Boolean) {}
fun onFusionColor(fusionColor: Boolean){}
}

View File

@@ -349,6 +349,12 @@ object CallerAutoPilotControlManager {
}
}
fun setFusionColor(isEnable: Boolean){
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
providerApi?.setFusionColor(isEnable)
}
}
/**
* 是否忽略条件直接绘制
* 司机屏同步给乘客屏

View File

@@ -57,4 +57,21 @@ object CallerTelematicListenerManager: CallerBase<IReceivedMsgListener>() {
}
}
}
fun dispatchFusionColor(fusionColor: Boolean) {
if (fusionColor != FunctionBuildConfig.isFusionColor) {
FunctionBuildConfig.isFusionColor = fusionColor
M_LISTENERS.forEach {
val listener = it.value
try {
listener.onFusionColor(fusionColor)
} catch (e: Exception) {
e.printStackTrace()
Log.e(TAG, "转发感知颜色出现异常:${e.message}")
}
}
}
}
}

View File

@@ -8,10 +8,10 @@
<bool name="v2n_total_switch">true</bool>
<!-- 是否是V2N新链路(云->工控机->App)-->
<bool name="v2n_new_linked">false</bool>
<bool name="v2n_new_linked">true</bool>
<!-- V2N场景进PNC -->
<bool name="v2n_new_linked_to_pnc">false</bool>
<bool name="v2n_new_linked_to_pnc">true</bool>
<!-- 是否开启绿波通行, 默认关闭 -->
<bool name="v2n_green_wave">false</bool>
@@ -26,7 +26,7 @@
<bool name="v2i_weakness_traffic">false</bool>
<!-- 是否开启V2I场景进PNC -->
<bool name="v2i_from_pnc">false</bool>
<bool name="v2i_from_pnc">true</bool>
<!-- 是否开启v2v总开关 -->
<bool name="v2v_total_switch">false</bool>

View File

@@ -64,21 +64,21 @@ bytex.ASM_API=ASM7
LOGLIB_VERSION=1.10.18
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.7.42
MOGO_NETWORK_VERSION=1.4.7.58
# 鉴权
MOGO_PASSPORT_VERSION=1.4.7.42
MOGO_PASSPORT_VERSION=1.4.7.58
# 长链接
MOGO_SOCKET_VERSION=1.4.7.42
MOGO_SOCKET_VERSION=1.4.7.58
# 数据采集
MOGO_REALTIME_VERSION=1.4.7.42
MOGO_REALTIME_VERSION=1.4.7.58
# 直播推流
MOGO_LIVE_VERSION=1.4.7.42
MOGO_LIVE_VERSION=1.4.7.58
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.7.42
MOGO_TRAFFICLIVE_VERSION=1.4.7.58
# 定位服务
MOGO_LOCATION_VERSION=1.4.7.42
MOGO_LOCATION_VERSION=1.4.7.58
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.7.42
MOGO_TELEMATIC_VERSION=1.4.7.58
# 动态换肤SDK
MOGO_SKIN_VERSION=1.4.7.49.19
######## MogoAiCloudSDK Version ########