[Fix]同步美化模式状态
This commit is contained in:
@@ -379,7 +379,7 @@ class MoGoAutopilotProvider :
|
||||
override fun setDemoMode(isEnable: Boolean) {
|
||||
// 同步给乘客端
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
val byteArray = "${FunctionBuildConfig.isDemoMode},${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}".toByteArray()
|
||||
val byteArray = if (isEnable) byteArrayOf(1) else byteArrayOf(0)
|
||||
if (NSDNettyManager.getInstance().isServerStart) {
|
||||
NSDNettyManager.getInstance()
|
||||
.sendMsgToAllClients(
|
||||
@@ -395,6 +395,25 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
}
|
||||
|
||||
override fun setIgnoreConditionDraw(isIgnore: Boolean) {
|
||||
// 同步给乘客端
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
val byteArray = if (isIgnore) byteArrayOf(1) else byteArrayOf(0)
|
||||
if (NSDNettyManager.getInstance().isServerStart) {
|
||||
NSDNettyManager.getInstance()
|
||||
.sendMsgToAllClients(
|
||||
MogoProtocolMsg(
|
||||
11,
|
||||
byteArray.size,
|
||||
byteArray
|
||||
)
|
||||
)
|
||||
} else {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "同步美化模式状态时司机端Server未启动!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置工控机演示模式(美化模式)开启、关闭
|
||||
* isEnable = true 开启
|
||||
|
||||
@@ -11,6 +11,7 @@ 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.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.setDemoMode
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.setIgnoreConditionDraw
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -56,15 +57,11 @@ class TeleMsgHandler : IMsgHandler {
|
||||
}
|
||||
}
|
||||
MogoProtocolMsg.SYNC_MODE_STATUS -> {
|
||||
val demoModeAndTrajectoryString = String(it.body)
|
||||
invokeNettyConnResult("乘客屏收到的美化模式状态为:${demoModeAndTrajectoryString}")
|
||||
if (demoModeAndTrajectoryString.contains(",")) {
|
||||
val strArray = demoModeAndTrajectoryString.split(",")
|
||||
if (strArray.size == 2) {
|
||||
FunctionBuildConfig.isDemoMode = (strArray[0] == "true")
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = (strArray[1] == "true")
|
||||
}
|
||||
FunctionBuildConfig.isDemoMode = when (it.body[0].toInt()) {
|
||||
1 -> true
|
||||
else -> false
|
||||
}
|
||||
invokeNettyConnResult("乘客屏收到的美化模式DemoMode为:${FunctionBuildConfig.isDemoMode}")
|
||||
}
|
||||
MogoProtocolMsg.REQ_MAC_ADDRESS -> {
|
||||
val carConfig = MessagePad.CarConfigResp.parseFrom(msg.body)
|
||||
@@ -82,11 +79,20 @@ class TeleMsgHandler : IMsgHandler {
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
)
|
||||
}
|
||||
// SN
|
||||
10 -> {
|
||||
val sn = String(it.body)
|
||||
isReceiveSN = true
|
||||
NettyTcpClient.sSERVER_SN = sn
|
||||
}
|
||||
// 美化模式是否忽略条件直接绘制
|
||||
11 -> {
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = when (it.body[0].toInt()) {
|
||||
1 -> true
|
||||
else -> false
|
||||
}
|
||||
invokeNettyConnResult("乘客屏收到的美化模式isIgnore为:${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}")
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
@@ -144,16 +150,8 @@ class TeleMsgHandler : IMsgHandler {
|
||||
override fun handleClientConn2Server(channel: Channel?) {
|
||||
val socketAddress = channel?.remoteAddress().toString()
|
||||
CallerLogger.d("${SceneConstant.M_ADAS_IMPL}$TAG", "Client ip is:${socketAddress}")
|
||||
val byteArray = "${FunctionBuildConfig.isDemoMode},${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}".toByteArray()
|
||||
NSDNettyManager.getInstance().sendMsgToSpecifiedClient(
|
||||
MogoProtocolMsg(
|
||||
MogoProtocolMsg.SYNC_MODE_STATUS,
|
||||
byteArray.size,
|
||||
byteArray
|
||||
), channel
|
||||
) {
|
||||
CallerLogger.d("${SceneConstant.M_ADAS_IMPL}$TAG", "同步美化模式状态是否成功:${it.isSuccess}")
|
||||
}
|
||||
setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
setIgnoreConditionDraw(FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData)
|
||||
}
|
||||
|
||||
override fun handleClientConnStatus(statusCode: Int, content: String?, channel: Channel) {
|
||||
|
||||
@@ -125,11 +125,18 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
|
||||
|
||||
/**
|
||||
* 演示模式(美化模式)该设置作用域只限定于鹰眼
|
||||
* 司机屏同步给乘客屏
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
fun setDemoMode(isEnable: Boolean)
|
||||
|
||||
/**
|
||||
* 是否忽略条件直接绘制
|
||||
* 司机屏同步给乘客屏
|
||||
*/
|
||||
fun setIgnoreConditionDraw(isIgnore: Boolean)
|
||||
|
||||
/**
|
||||
* 设置工控机演示模式(美化模式)开启、关闭
|
||||
* isEnable = true 开启
|
||||
|
||||
@@ -160,6 +160,14 @@ object CallerAutoPilotManager {
|
||||
providerApi?.setDemoMode(isEnable)
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否忽略条件直接绘制
|
||||
* 司机屏同步给乘客屏
|
||||
*/
|
||||
fun setIgnoreConditionDraw(isIgnore: Boolean) {
|
||||
providerApi?.setIgnoreConditionDraw(isIgnore)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置工控机演示模式(美化模式)开启、关闭
|
||||
* isEnable = true 开启
|
||||
|
||||
Reference in New Issue
Block a user